"use strict";

exports.__esModule = true;
exports.PickerStandaloneUniDriver = PickerStandaloneUniDriver;
exports.default = void 0;
var _unidriver = require("../../unidriver");
var _PickerStandaloneLayoutUni = require("../PickerStandaloneLayout/PickerStandaloneLayout.uni.driver");
var _PickerUni = require("../Picker/Picker.uni.driver");
var _unidriver2 = require("@wix/design-system/dist/testkit/unidriver");
function PickerStandaloneUniDriver(base, body) {
  const layout = (0, _PickerStandaloneLayoutUni.PickerStandaloneLayoutUniDriver)(base, body);
  const picker = (0, _PickerUni.PickerUniDriver)(base.$('[data-hook="picker"]'), body);
  return {
    wait: timeout => base.wait(timeout),
    ...(0, _unidriver.baseUniDriverFactory)(base),
    /**
     * Enter a value to the search input
     * @param {string} value
     * @returns {Promise<void>}
     */
    enterSearchTerm: layout.enterSearchTerm,
    /**
     * Clear the search input
     * @returns {Promise<void>}
     */
    clearSearchTerm: layout.clearSearchTerm,
    /**
     * Get the value of the search input
     * @returns {Promise<string>}
     */
    getSearchTerm: layout.getSearchTerm,
    /**
     * Returns whether the search component exists
     * @returns {Promise<boolean>}
     */
    searchExists: layout.searchExists,
    /**
     * Returns a promise that'll resolve when search loader is displayed
     * @param {number} [timeout]
     * @returns {Promise<void>}
     */
    waitSearchLoader: picker.waitSearchLoader,
    /**
     * Returns whether the search loader is displayed
     * @returns {Promise<boolean>}
     */
    searchLoaderExists: picker.searchLoaderExists,
    /**
     * Returns a promise that'll resolve when search loader is removed
     * @param {number} [timeout]
     * @returns {Promise<void>}
     */
    waitSearchLoaderRemoved: picker.waitSearchLoaderRemoved,
    /**
     * Returns whether the floating notification exists
     * @returns {Promise<boolean>}
     */
    floatingNotificationExists: picker.floatingNotificationExists,
    /**
     * Returns the floating notification's current text
     * @returns {Promise<string>}
     */
    getFloatingNotificationText: picker.getFloatingNotificationText,
    /**
     * Returns a promise that'll resolve when the initial loader is displayed
     * @param {number} [timeout]
     * @returns {Promise<void>}
     */
    waitInitialLoader: layout.waitInitialLoader,
    /**
     * Returns a promise that'll resolve when the initial loader is removed
     * @param {number} [timeout]
     * @returns {Promise<void>}
     */
    waitInitialLoaderRemoved: layout.waitInitialLoaderRemoved,
    /**
     * Indicates whether initial loader is in loading status
     * @returns {Promise<boolean>}
     */
    isInitialLoaderLoading: () => layout.isInitialLoaderLoading(),
    /**
     * Indicates whether initial loader exists
     * @returns {Promise<boolean>}
     */
    initialLoaderExists: () => layout.initialLoaderExists(),
    /**
     * Get a `TableListItem` driver at row index
     */
    getTableListItemAt: picker.getTableListItemAt,
    /**
     * Get item primary button driver
     */
    getPrimaryActionButtonAt: picker.getPrimaryActionButtonAt,
    /**
     * Wait for new row to finish enter animation
     */
    waitRowEntered: picker.waitRowEntered,
    /**
     * Returns the picker's title
     * @returns {Promise<string>}
     */
    getTitleText: layout.getTitleText,
    /**
     * Returns the picker's subtitle
     * @returns {Promise<string>}
     */
    getSubtitleText: layout.getSubtitleText,
    /**
     * Returns the number of items currently displayed within the picker
     * @returns {Promise<number>}
     */
    numberOfItemsInList: picker.numberOfItemsInList,
    /**
     * Triggers hover state on a row
     */
    hoverItemAt: picker.hoverItemAt,
    /**
     * Indicates whether the action button of the row exists
     */
    primaryButtonExistsAt: picker.primaryButtonExistsAt,
    /**
     * Triggers "scroll" event on the list.
     * @returns {Promise<void>}
     */
    scrollDown: picker.scrollDown,
    /**
     * Triggers "scroll" event to a given item's index
     * @param {number} index
     * @returns {Promise<void>}
     */
    scrollTo: picker.scrollTo,
    /**
     * Selects item at given index
     * @param {number} index
     * @returns {Promise<void>}
     */
    toggleSelectorAt: picker.toggleSelectorAt,
    /**
     * Returns the amount of items selected
     * @returns {Promise<number>}
     */
    getTotalSelected: picker.getTotalSelected,
    /**
     * Returns whether a given item is currently selected
     * @param {number} index
     * @returns {Promise<boolean>}
     */
    isSelectorCheckedAt: picker.isSelectorCheckedAt,
    /**
     * Returns a promise that resolves when a given item is displayed
     * @param {number} index
     * @param {number} [timeout]
     * @returns {Promise<void>}
     */
    waitListItemAt: picker.waitListItemAt,
    /**
     * Returns the inner html of a given item
     * @param {number} index
     * @returns {Promise<string>}
     */
    getTitleTextAt: picker.getTitleTextAt,
    /**
     * Returns the title text of a given item
     * @param {number} index
     * @returns {Promise<string>}
     */
    getTitleTextContentAt: picker.getTitleTextContentAt,
    /**
     * Returns the subtitle inner html of a given item
     * @param {number} index
     * @returns {Promise<string>}
     */
    getSubtitleTextAt: picker.getSubtitleTextAt,
    /**
     * Returns the subtitle text of a given item
     * @param {number} index
     * @returns {Promise<string>}
     */
    getSubtitleTextContentAt: picker.getSubtitleTextAt,
    /**
     * Returns the <img> element of a given item
     * @param {number} index
     * @returns {Promise<HTMLElement>}
     */
    getImageElementAt: picker.getImageElementAt,
    /**
     * Returns the extra node element of a given item
     * @param {number} index
     * @returns {Promise<HTMLElement>}
     */
    getExtraNodeElementAt: picker.getExtraNodeElementAt,
    /**
     * Returns the `EmptyState` component's UniDriver by its `dataHook`
     * @param {string} dataHook
     * @returns {Promise<EmptyStateUniDriver>}
     */
    getEmptyStateByDataHook: picker.getEmptyStateByDataHook,
    /**
     * Returns the splash error state component's UniDriver by its `dataHook`
     * @param {string} dataHook
     * @returns {Promise<EmptyStateUniDriver>}
     */
    getSplashErrorStateByDataHook: picker.getErrorStateByDataHook,
    /**
     * Returns the error state component's UniDriver by its `dataHook`
     * @param {string} dataHook
     * @returns {Promise<EmptyStateUniDriver>}
     */
    getErrorStateByDataHook: picker.getEmptyStateByDataHook,
    createNewItemCta: () => (0, _unidriver2.ButtonUniDriver)(base.$('[data-hook="create-new-item-cta"]'), body)
  };
}
var _default = exports.default = PickerStandaloneUniDriver;
//# sourceMappingURL=PickerStandalone.uni.driver.js.map