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