"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ojRadioset = exports.OjRadioset = void 0;
const __1 = require("../../");
const OjRadioset_1 = require("./OjRadioset");
Object.defineProperty(exports, "OjRadioset", { enumerable: true, get: function () { return OjRadioset_1.OjRadioset; } });
/**
 * Retrieve an instance of [OjRadioset](../classes/elements.OjRadioset.html).
 * @example
 * ```javascript
 * import { ojRadioset } from '@oracle/oraclejet-webdriver/elements';
 * const el = await ojRadioset(driver, By.id('my-oj-radioset'));
 * ```
 * @param driver A WebDriver/WebElement instance from where the element will be
 * searched. If WebDriver is passed, the element will be searched globally in the
 * document. If WebElement is passed, the search will be relative to this element.
 * @param by The locator with which to find the element
 */
async function ojRadioset(driver, by) {
    const webEl = await driver.findElement(by);
    // Check that the element is of type OjRadioset
    if (!(webEl instanceof OjRadioset_1.OjRadioset)) {
        const tagName = await webEl.getTagName();
        let supplemental = '';
        if (webEl.constructor.name === 'OjRadioset') {
            supplemental = 'You likely have multiple installations of this package.';
        }
        throw Error(`ojRadioset(${by}) created ${webEl.constructor.name} for <${tagName}>, but expected ${OjRadioset_1.OjRadioset.name}. ${supplemental}`);
    }
    return webEl;
}
exports.ojRadioset = ojRadioset;
(0, __1.register)('oj-radioset', OjRadioset_1.OjRadioset);
//# sourceMappingURL=index.js.map