"use strict";

exports.__esModule = true;
exports.PickerStandaloneLayoutUniDriver = PickerStandaloneLayoutUniDriver;
var _unidriver = require("@wix/design-system/dist/testkit/unidriver");
var _unidriver2 = require("../../unidriver");
var _unidriver3 = require("@wix/wix-ui-test-utils/unidriver");
function PickerStandaloneLayoutUniDriver(base, body) {
  const getTitle = () => base.$('[data-hook="picker-standalone-title"]');
  const getSubtitle = () => base.$('[data-hook="picker-standalone-subtitle"]');
  const getInitialLoaderBase = () => base.$('[data-hook="initial-loader"]');
  const getInitialLoader = () => (0, _unidriver.LoaderUniDriver)(getInitialLoaderBase(), body);
  const getSearch = () => (0, _unidriver.SearchUniDriver)(base.$('[data-hook="collection-search"]'), body);
  return {
    ...(0, _unidriver2.baseUniDriverFactory)(base),
    waitInitialLoader: timeout => getInitialLoaderBase().wait(timeout),
    /** Indicates whether initial loader is in loading status */
    isInitialLoaderLoading: () => getInitialLoader().isLoading(),
    /** Indicates whether initial loader exists */
    initialLoaderExists: () => getInitialLoader().exists(),
    waitInitialLoaderRemoved: timeout => (0, _unidriver3.waitFor)(async () => !(await getInitialLoader().exists()), timeout),
    getTitleText: () => getTitle().text(),
    getSubtitleText: () => getSubtitle().text(),
    enterSearchTerm: value => getSearch().inputDriver.enterText(value),
    clearSearchTerm: () => getSearch().inputDriver.clearText(),
    getSearchTerm: () => getSearch().inputDriver.getText(),
    searchExists: () => getSearch().inputDriver.exists()
  };
}
//# sourceMappingURL=PickerStandaloneLayout.uni.driver.js.map