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