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