import { LoaderUniDriver, SearchUniDriver, } from '@wix/design-system/dist/testkit/unidriver';
import { baseUniDriverFactory } from '../../unidriver';
import { waitFor } from '@wix/wix-ui-test-utils/unidriver';
export 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 = () => LoaderUniDriver(getInitialLoaderBase(), body);
    const getSearch = () => SearchUniDriver(base.$('[data-hook="collection-search"]'), body);
    return {
        ...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) => 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