import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-e582ed08.js';
import { K as KlevuInit } from './klevu-init-ea2d74dc.js';
import { g as getTranslation } from './getTranslation-f7bfa845.js';
import { t as trendingProducts, s as stringConcat } from './stringConcat-fc082417.js';
import { g as getKMCSettings } from './getKMCSettings-cd5894f5.js';
import { p as partsExports } from './partsExports-48dff18e.js';
import { F as FilterManager } from './filterManager-5718a879.js';
import { c as KlevuFetch, d as applyFilterWithManager } from './klevuFetch-ab326dc0.js';
import { s as sendSearchEvent } from './sendSearchEvent-eae14fb3.js';
import { l as listFilters } from './listFilters-9dca05b9.js';
import { p as personalisation } from './personalisation-a27d067d.js';
import { k as klaviyo } from './klaviyo-f6575e8f.js';
import { s as search } from './search-58784dca.js';
import './KlevuDomEvents-062429b2.js';
import './KlevuApiRawResponse-82e24d1e.js';

const klevuSearchLandingPageCss = ":host{display:block}.header{width:100%}.header .info{display:flex;justify-content:space-between;width:100%;align-items:center}.footer{display:flex;justify-content:center}@media (max-width: 511px){.header{display:block}}.noResultsMessage{text-align:center}.noResultsBannerImage{max-width:100%;margin-top:var(--klevu-spacing-04)}";

var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
  if (kind === "m")
    throw new TypeError("Private method is not writable");
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _KlevuSearchLandingPage_instances, _KlevuSearchLandingPage_noResultsOptions, _KlevuSearchLandingPage_resultObject, _KlevuSearchLandingPage_viewportUtil, _KlevuSearchLandingPage_layoutElement, _KlevuSearchLandingPage_facetListElement, _KlevuSearchLandingPage_currency, _KlevuSearchLandingPage_fetchData, _KlevuSearchLandingPage_handleNoResults, _KlevuSearchLandingPage_sizeChange, _KlevuSearchLandingPage_emitChanges, _KlevuSearchLandingPage_sortChanged, _KlevuSearchLandingPage_applyFilters, _KlevuSearchLandingPage_isMobile, _KlevuSearchLandingPage_mobileDrawerOpened, _KlevuSearchLandingPage_updateTerm, _KlevuSearchLandingPage_renderNoResultBanners;
const KlevuSearchLandingPage = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.klevuData = createEvent(this, "klevuData", 7);
    _KlevuSearchLandingPage_instances.add(this);
    _KlevuSearchLandingPage_noResultsOptions.set(this, void 0);
    _KlevuSearchLandingPage_resultObject.set(this, void 0);
    _KlevuSearchLandingPage_viewportUtil.set(this, void 0);
    _KlevuSearchLandingPage_layoutElement.set(this, void 0);
    _KlevuSearchLandingPage_facetListElement.set(this, void 0);
    _KlevuSearchLandingPage_currency.set(this, "");
    this.limit = 24;
    this.term = undefined;
    this.sort = undefined;
    this.filterCount = undefined;
    this.filterCustomOrder = undefined;
    this.usePagination = undefined;
    this.useInfiniteScroll = undefined;
    this.showRatings = undefined;
    this.showRatingsCount = undefined;
    this.tSearchTitle = getTranslation("searchLandingPage.tSearchTitle");
    this.tLoadMore = getTranslation("searchLandingPage.tLoadMore");
    this.usePersonalisation = undefined;
    this.popularProductsResultCount = 3;
    this.showSearch = undefined;
    this.hideFilters = undefined;
    this.useMultiSelectFilters = undefined;
    this.useKlaviyo = undefined;
    this.showPriceAsSlider = undefined;
    this.priceInterval = 500;
    this.hidePrice = undefined;
    this.showVariantsCount = false;
    this.autoUpdateUrl = undefined;
    this.options = undefined;
    this.sortOptions = undefined;
    this.useLoadingIndicator = false;
    this.hideBrand = undefined;
    this.hideDescription = undefined;
    this.hideHoverImage = undefined;
    this.hideImage = undefined;
    this.hideName = undefined;
    this.hideSwatches = undefined;
    this.outOfStockCaption = undefined;
    this.showAddToCart = undefined;
    this.showProductCode = undefined;
    this.tAddToCart = undefined;
    this.vatCaption = undefined;
    this.results = [];
    this.manager = new FilterManager();
    this.currentViewPortSize = undefined;
    this.infiniteScrollingPaused = false;
    this.loading = false;
    this.noResultsMessage = "";
    this.trendingProducts = [];
    this.noResultsBannerDetails = [];
    this.searchResultTopBanners = [];
    this.searchResultBottomBanners = [];
  }
  async connectedCallback() {
    await KlevuInit.ready();
    await this.init();
  }
  async init() {
    var _a, _b, _c, _d, _e, _f, _g, _h;
    const settings = getKMCSettings();
    if (settings) {
      __classPrivateFieldSet(this, _KlevuSearchLandingPage_noResultsOptions, (_a = settings.klevu_uc_userOptions) === null || _a === void 0 ? void 0 : _a.noResultsOptions, "f");
      if (this.showRatings === undefined) {
        this.showRatings = ((_b = settings.klevu_uc_userOptions) === null || _b === void 0 ? void 0 : _b.showRatingsOnSearchResultsLandingPage) || false;
      }
      if (this.showRatingsCount === undefined) {
        this.showRatingsCount = ((_c = settings.klevu_uc_userOptions) === null || _c === void 0 ? void 0 : _c.showRatingsCountOnSearchResultsLandingPage) || false;
      }
      if (this.usePersonalisation === undefined && (settings === null || settings === void 0 ? void 0 : settings.klevu_uc_userOptions.enablePersonalisationInSearch)) {
        this.usePersonalisation = true;
      }
      if (this.showSearch === undefined) {
        this.showSearch = settings.klevu_uc_userOptions.showSearchBoxOnLandingPage;
      }
      if (this.hideFilters === undefined) {
        this.hideFilters = !settings.klevu_filtersEnabled;
      }
      if (this.useMultiSelectFilters === undefined) {
        this.useMultiSelectFilters = settings.klevu_multiSelectFilters;
        this.showSearch = settings === null || settings === void 0 ? void 0 : settings.klevu_uc_userOptions.showSearchBoxOnLandingPage;
      }
      if (this.showPriceAsSlider === undefined) {
        this.showPriceAsSlider = settings.klevu_showPriceSlider;
      }
      if (this.priceInterval === undefined && typeof settings.klevu_uc_userOptions.priceInterval !== "undefined") {
        this.priceInterval = parseInt(settings.klevu_uc_userOptions.priceInterval, 10);
      }
      if (this.hidePrice === undefined) {
        this.hidePrice = !settings.klevu_showPrices;
      }
      if (this.useKlaviyo === undefined && ((_e = (_d = settings === null || settings === void 0 ? void 0 : settings.klevu_connectors) === null || _d === void 0 ? void 0 : _d.klaviyo) === null || _e === void 0 ? void 0 : _e.enabled)) {
        this.useKlaviyo = true;
      }
      __classPrivateFieldSet(this, _KlevuSearchLandingPage_currency, ((_f = settings.klevu_uc_userOptions.priceFormatter) === null || _f === void 0 ? void 0 : _f.currencySymbol) || "", "f");
    }
    const showPopularProducts = (_h = (_g = settings === null || settings === void 0 ? void 0 : settings.klevu_uc_userOptions) === null || _g === void 0 ? void 0 : _g.noResultsOptions) === null || _h === void 0 ? void 0 : _h.showPopularProducts;
    if (showPopularProducts) {
      const trendingProductsQuery = await KlevuFetch(trendingProducts({
        limit: this.popularProductsResultCount,
      }));
      const resultObject = trendingProductsQuery.queriesById("trendingProducts");
      if (resultObject) {
        this.trendingProducts = resultObject.records;
      }
    }
    if (!this.autoUpdateUrl)
      await __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_fetchData).call(this);
  }
  termChanged(oldValue, newValue) {
    __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_fetchData).call(this);
  }
  async loadMore() {
    var _a, _b, _c;
    this.loading = true;
    if (!((_a = __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f")) === null || _a === void 0 ? void 0 : _a.getPage)) {
      return;
    }
    const nextResultObject = await __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f").getPage();
    __classPrivateFieldSet(this, _KlevuSearchLandingPage_resultObject, nextResultObject === null || nextResultObject === void 0 ? void 0 : nextResultObject.queriesById("search"), "f");
    this.results = [...this.results, ...((_c = (_b = __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f")) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : [])];
    __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_emitChanges).call(this);
    this.loading = false;
  }
  async paginationChange(event) {
    var _a, _b, _c;
    if (!((_a = __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f")) === null || _a === void 0 ? void 0 : _a.getPage)) {
      return;
    }
    this.loading = true;
    const nextResultObject = await __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f").getPage({ pageIndex: event.detail - 1 });
    __classPrivateFieldSet(this, _KlevuSearchLandingPage_resultObject, nextResultObject === null || nextResultObject === void 0 ? void 0 : nextResultObject.queriesById("search"), "f");
    this.results = (_c = (_b = __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f")) === null || _b === void 0 ? void 0 : _b.records) !== null && _c !== void 0 ? _c : [];
    __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_emitChanges).call(this);
    this.loading = false;
  }
  productClickHandler(event) {
    var _a;
    if (((_a = __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f")) === null || _a === void 0 ? void 0 : _a.searchClickEvent) && event.detail.product.id) {
      __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f").searchClickEvent({
        productId: event.detail.product.id,
        variantId: event.detail.product.variantId || event.detail.product.id,
      });
    }
  }
  filterManagerFiltersUpdated() {
    if (__classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_isMobile).call(this)) {
      return;
    }
    __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_fetchData).call(this);
  }
  async componentDidLoad() {
    this.currentViewPortSize = await __classPrivateFieldGet(this, _KlevuSearchLandingPage_viewportUtil, "f").getCurrentSize();
  }
  render() {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
    const isMobile = ((_a = this.currentViewPortSize) === null || _a === void 0 ? void 0 : _a.name) === "xs" || ((_b = this.currentViewPortSize) === null || _b === void 0 ? void 0 : _b.name) === "sm";
    const showInfiniteScroll = this.useInfiniteScroll && !this.infiniteScrollingPaused && this.results.length > 0;
    let facetMode = "checkbox";
    if (this.useMultiSelectFilters === false) {
      facetMode = "radio";
    }
    return (h(Host, null, h("klevu-util-viewport", { onKlevuSizeChanged: __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_sizeChange).bind(this), ref: (el) => (__classPrivateFieldSet(this, _KlevuSearchLandingPage_viewportUtil, el, "f")) }), h("klevu-layout-results", { onKlevuDrawerOpened: __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_mobileDrawerOpened).bind(this), ref: (el) => (__classPrivateFieldSet(this, _KlevuSearchLandingPage_layoutElement, el, "f")), exportparts: partsExports("klevu-layout-results") }, h("slot", { name: "facets", slot: "sidebar" }, h("div", { part: "search-landing-page-sidebar" }, !this.hideFilters && (h("klevu-facet-list", { priceSliderCurrency: __classPrivateFieldGet(this, _KlevuSearchLandingPage_currency, "f"), ref: (el) => (__classPrivateFieldSet(this, _KlevuSearchLandingPage_facetListElement, el, "f")), customOrder: this.filterCustomOrder, manager: this.manager, useApplyButton: isMobile, onKlevuApplyFilters: __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_applyFilters).bind(this), mode: facetMode, exportparts: partsExports("klevu-facet-list"), shouldUpdateUrlForFacets: this.autoUpdateUrl })))), h("div", { slot: "header", class: "header", part: "search-landing-page-header" }, this.showSearch && (h("klevu-quicksearch", { exportparts: partsExports("klevu-quicksearch"), term: this.term, onKlevuSearch: (event) => __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_updateTerm).call(this, event.detail) })), h("div", { class: "info" }, h("klevu-typography", { slot: "header", variant: "h1" }, stringConcat(this.tSearchTitle, [this.term])), ((_c = this.results) === null || _c === void 0 ? void 0 : _c.length) > 0 && (h("klevu-sort", { variant: "inline", onKlevuSortChanged: __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_sortChanged).bind(this), exportparts: partsExports("klevu-sort"), options: this.sortOptions })))), h("slot", { name: "content", slot: "content" }, h("div", { part: "search-landing-page-content" }, h("slot", { name: "topbanners" }, this.searchResultTopBanners.map((b) => (h("klevu-banner", { exportparts: partsExports("klevu-banner"), imageUrl: b.bannerImg, linkUrl: b.redirectUrl, altText: b.bannerAltTag })))), ((_d = this.results) === null || _d === void 0 ? void 0 : _d.length) > 0 ? (h("klevu-product-grid", { slot: "content" }, (_e = this.results) === null || _e === void 0 ? void 0 : _e.map((p) => (h("klevu-product", { hidePrice: this.hidePrice, product: p, fixedWidth: true, exportparts: partsExports("klevu-product"), showRatings: this.showRatings, showRatingsCount: this.showRatingsCount, showVariantsCount: this.showVariantsCount, hideBrand: this.hideBrand, hideDescription: this.hideDescription, hideHoverImage: this.hideHoverImage, hideImage: this.hideImage, hideName: this.hideName, hideSwatches: this.hideSwatches, outOfStockCaption: this.outOfStockCaption, showAddToCart: this.showAddToCart, showProductCode: this.showProductCode, tAddToCart: this.tAddToCart, vatCaption: this.vatCaption }))))) : (h("slot", { name: "noResults" }, !this.loading && this.noResultsMessage ? (h("p", { class: "noResultsMessage" }, h("klevu-typography", { variant: "body-s" }, this.noResultsMessage))) : (!this.loading && getTranslation("searchLandingPage.tNoResultsFound")), h(Fragment, null, h("slot", { name: "trending-products" }, this.trendingProducts.length > 0 && (h(Fragment, null, h("klevu-typography", { variant: "body-s" }, ((_f = __classPrivateFieldGet(this, _KlevuSearchLandingPage_noResultsOptions, "f")) === null || _f === void 0 ? void 0 : _f.productsHeading) || ""), (_g = this.trendingProducts) === null || _g === void 0 ? void 0 :
      _g.map((p) => (h("klevu-product", { hidePrice: this.hidePrice, product: p, variant: "line", exportparts: partsExports("klevu-product") }))))))), !this.loading && __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_renderNoResultBanners).call(this), ((_h = __classPrivateFieldGet(this, _KlevuSearchLandingPage_noResultsOptions, "f")) === null || _h === void 0 ? void 0 : _h.showPopularKeywords) && (h("klevu-popular-searches", { exportparts: partsExports("klevu-popular-searches"), onKlevuPopularSearchClicked: (event) => __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_updateTerm).call(this, event.detail) })))), this.useLoadingIndicator && this.loading && !this.infiniteScrollingPaused && (h("klevu-loading-indicator", { exportparts: partsExports("klevu-loading-indicator") })), h("slot", { name: "bottombanners" }, this.searchResultBottomBanners.map((b) => (h("klevu-banner", { exportparts: partsExports("klevu-banner"), imageUrl: b.bannerImg, linkUrl: b.redirectUrl, altText: b.bannerAltTag })))))), h("div", { slot: "footer", class: "footer", part: "search-landing-page-footer" }, showInfiniteScroll ? (h("klevu-util-infinite-scroll", { onKlevuLoadMore: () => {
        this.loadMore();
      }, onKlevuInfiniteScrollingPaused: () => {
        this.infiniteScrollingPaused = true;
      }, infiniteScrollPauseThreshold: 3, enabled: !!((_j = __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f")) === null || _j === void 0 ? void 0 : _j.hasNextPage()) && !this.loading })) : this.usePagination && __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f") && this.results.length > 0 ? (h("klevu-pagination", { shouldUpdateUrlForPage: this.autoUpdateUrl, exportparts: partsExports("klevu-pagination"), queryResult: __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f"), onKlevuPaginationChange: this.paginationChange.bind(this) })) : ((_k = __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f")) === null || _k === void 0 ? void 0 : _k.hasNextPage()) ? (h("klevu-button", { exportparts: partsExports("klevu-button"), onClick: this.loadMore.bind(this) }, this.tLoadMore)) : null))));
  }
  static get watchers() { return {
    "term": ["termChanged"]
  }; }
};
_KlevuSearchLandingPage_noResultsOptions = new WeakMap(), _KlevuSearchLandingPage_resultObject = new WeakMap(), _KlevuSearchLandingPage_viewportUtil = new WeakMap(), _KlevuSearchLandingPage_layoutElement = new WeakMap(), _KlevuSearchLandingPage_facetListElement = new WeakMap(), _KlevuSearchLandingPage_currency = new WeakMap(), _KlevuSearchLandingPage_instances = new WeakSet(), _KlevuSearchLandingPage_fetchData = async function _KlevuSearchLandingPage_fetchData() {
  var _a, _b, _c;
  this.loading = true;
  const rangeFilterSetting = this.showPriceAsSlider
    ? {
      key: "klevu_price",
      minMax: true,
    }
    : {
      key: "klevu_price",
      rangeInterval: this.priceInterval,
      minMax: false,
    };
  const modifiers = [
    sendSearchEvent(),
    listFilters({
      filterManager: this.manager,
      limit: this.filterCount,
      rangeFilterSettings: [rangeFilterSetting],
    }),
    applyFilterWithManager(this.manager),
  ];
  if (this.usePersonalisation) {
    modifiers.push(personalisation());
  }
  if (this.useKlaviyo) {
    modifiers.push(klaviyo());
  }
  const result = await KlevuFetch(search(this.term, Object.assign({ limit: this.limit, sort: this.sort }, this.options), ...modifiers));
  __classPrivateFieldSet(this, _KlevuSearchLandingPage_resultObject, result.queriesById("search"), "f");
  this.results = (_b = (_a = __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f")) === null || _a === void 0 ? void 0 : _a.records) !== null && _b !== void 0 ? _b : [];
  if (this.results.length > 0 && !__classPrivateFieldGet(this, _KlevuSearchLandingPage_currency, "f")) {
    __classPrivateFieldSet(this, _KlevuSearchLandingPage_currency, this.results[0].currency, "f");
  }
  __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_emitChanges).call(this);
  this.loading = false;
  const allBanners = (_c = (await __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f").getBanners({ searchType: "quicksearch" }))) !== null && _c !== void 0 ? _c : [];
  this.searchResultTopBanners = allBanners.filter((b) => b.position === "top");
  this.searchResultBottomBanners = allBanners.filter((b) => b.position === "bottom");
  this.noResultsMessage = "";
  this.noResultsBannerDetails = [];
  if (this.results.length === 0) {
    __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_handleNoResults).call(this);
  }
}, _KlevuSearchLandingPage_handleNoResults = function _KlevuSearchLandingPage_handleNoResults() {
  var _a, _b, _c, _d, _e;
  this.noResultsMessage =
    ((_b = (_a = __classPrivateFieldGet(this, _KlevuSearchLandingPage_noResultsOptions, "f")) === null || _a === void 0 ? void 0 : _a.messages.find((m) => m.showForTerms === null)) === null || _b === void 0 ? void 0 : _b.message) ||
      getTranslation("searchLandingPage.tNoResultsFound");
  this.noResultsBannerDetails =
    ((_c = __classPrivateFieldGet(this, _KlevuSearchLandingPage_noResultsOptions, "f")) === null || _c === void 0 ? void 0 : _c.banners.filter((m) => m.showOnLandingPage && m.showForTerms === null)) || [];
  if (this.term) {
    const searchTermSpecificMessage = (_d = __classPrivateFieldGet(this, _KlevuSearchLandingPage_noResultsOptions, "f")) === null || _d === void 0 ? void 0 : _d.messages.find((m) => m.showForTerms && m.showForTerms.includes(this.term));
    if (searchTermSpecificMessage)
      this.noResultsMessage = searchTermSpecificMessage === null || searchTermSpecificMessage === void 0 ? void 0 : searchTermSpecificMessage.message;
    const searchTermSpecificBanner = ((_e = __classPrivateFieldGet(this, _KlevuSearchLandingPage_noResultsOptions, "f")) === null || _e === void 0 ? void 0 : _e.banners.filter((m) => m.showOnLandingPage && m.showForTerms && m.showForTerms.includes(this.term))) || [];
    if (searchTermSpecificBanner.length > 0)
      this.noResultsBannerDetails.unshift(...searchTermSpecificBanner);
  }
}, _KlevuSearchLandingPage_sizeChange = function _KlevuSearchLandingPage_sizeChange(event) {
  this.currentViewPortSize = event.detail;
}, _KlevuSearchLandingPage_emitChanges = function _KlevuSearchLandingPage_emitChanges() {
  if (!__classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f")) {
    return;
  }
  this.klevuData.emit({
    resultObject: __classPrivateFieldGet(this, _KlevuSearchLandingPage_resultObject, "f"),
    records: this.results,
    manager: this.manager,
  });
  this.infiniteScrollingPaused = false;
}, _KlevuSearchLandingPage_sortChanged = async function _KlevuSearchLandingPage_sortChanged(event) {
  this.sort = event.detail;
  await __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_fetchData).call(this);
}, _KlevuSearchLandingPage_applyFilters = function _KlevuSearchLandingPage_applyFilters() {
  __classPrivateFieldGet(this, _KlevuSearchLandingPage_instances, "m", _KlevuSearchLandingPage_fetchData).call(this);
  __classPrivateFieldGet(this, _KlevuSearchLandingPage_layoutElement, "f").closeDrawer();
}, _KlevuSearchLandingPage_isMobile = function _KlevuSearchLandingPage_isMobile() {
  var _a, _b;
  return ((_a = this.currentViewPortSize) === null || _a === void 0 ? void 0 : _a.name) === "xs" || ((_b = this.currentViewPortSize) === null || _b === void 0 ? void 0 : _b.name) === "sm";
}, _KlevuSearchLandingPage_mobileDrawerOpened = function _KlevuSearchLandingPage_mobileDrawerOpened() {
  __classPrivateFieldGet(this, _KlevuSearchLandingPage_facetListElement, "f").updateApplyFilterState();
}, _KlevuSearchLandingPage_updateTerm = function _KlevuSearchLandingPage_updateTerm(term) {
  this.term = term;
}, _KlevuSearchLandingPage_renderNoResultBanners = function _KlevuSearchLandingPage_renderNoResultBanners() {
  return this.noResultsBannerDetails.map((banner) => (h("a", { href: banner.redirectUrl }, h("img", { class: "noResultsBannerImage", src: banner.bannerImageUrl, alt: banner.bannerAltTag, title: banner.bannerAltTag }))));
};
KlevuSearchLandingPage.style = klevuSearchLandingPageCss;

export { KlevuSearchLandingPage as klevu_search_landing_page };

//# sourceMappingURL=klevu-search-landing-page.entry.js.map