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