"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ojAccordion = exports.OjAccordion = void 0;
const __1 = require("../../");
const OjAccordion_1 = require("./OjAccordion");
Object.defineProperty(exports, "OjAccordion", { enumerable: true, get: function () { return OjAccordion_1.OjAccordion; } });
/**
 * Retrieve an instance of [OjAccordion](../classes/elements.OjAccordion.html).
 * @example
 * ```javascript
 * import { ojAccordion } from '@oracle/oraclejet-webdriver/elements';
 * const el = await ojAccordion(driver, By.id('my-oj-accordion'));
 * ```
 * @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 ojAccordion(driver, by) {
    const webEl = await driver.findElement(by);
    // Check that the element is of type OjAccordion
    if (!(webEl instanceof OjAccordion_1.OjAccordion)) {
        const tagName = await webEl.getTagName();
        let supplemental = '';
        if (webEl.constructor.name === 'OjAccordion') {
            supplemental = 'You likely have multiple installations of this package.';
        }
        throw Error(`ojAccordion(${by}) created ${webEl.constructor.name} for <${tagName}>, but expected ${OjAccordion_1.OjAccordion.name}. ${supplemental}`);
    }
    return webEl;
}
exports.ojAccordion = ojAccordion;
(0, __1.register)('oj-accordion', OjAccordion_1.OjAccordion);
//# sourceMappingURL=index.js.map