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