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