@getlupa/vue 0.9.6 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2248,6 +2248,11 @@ const useOptionsStore = defineStore("options", () => {
2248
2248
  const setInitialFilters = ({ initialFilters: initialFilters2 }) => {
2249
2249
  searchResultInitialFilters.value = initialFilters2;
2250
2250
  };
2251
+ const getQueryParamName = (param) => {
2252
+ var _a;
2253
+ const nameMap = searchBoxOptions.value.queryParameterNames;
2254
+ return (_a = nameMap == null ? void 0 : nameMap[param]) != null ? _a : param;
2255
+ };
2251
2256
  return {
2252
2257
  searchBoxOptions,
2253
2258
  searchResultOptions,
@@ -2262,7 +2267,8 @@ const useOptionsStore = defineStore("options", () => {
2262
2267
  setSearchBoxOptions,
2263
2268
  setTrackingOptions,
2264
2269
  setSearchResultOptions,
2265
- setInitialFilters
2270
+ setInitialFilters,
2271
+ getQueryParamName
2266
2272
  };
2267
2273
  });
2268
2274
  var DocumentElementType = /* @__PURE__ */ ((DocumentElementType2) => {
@@ -2515,9 +2521,14 @@ const parseParam = (key, params) => {
2515
2521
  return void 0;
2516
2522
  }
2517
2523
  };
2518
- const parseRegularKeys = (regularKeys, searchParams) => {
2524
+ const parseRegularKeys = (regularKeys, searchParams, getQueryParamName) => {
2519
2525
  const params = /* @__PURE__ */ Object.create({});
2520
- const keys = reverseKeyValue(QUERY_PARAMS);
2526
+ const keys = reverseKeyValue({
2527
+ QUERY: getQueryParamName ? getQueryParamName(QUERY_PARAMS.QUERY) : QUERY_PARAMS.QUERY,
2528
+ LIMIT: getQueryParamName ? getQueryParamName(QUERY_PARAMS.LIMIT) : QUERY_PARAMS.LIMIT,
2529
+ PAGE: getQueryParamName ? getQueryParamName(QUERY_PARAMS.PAGE) : QUERY_PARAMS.PAGE,
2530
+ SORT: getQueryParamName ? getQueryParamName(QUERY_PARAMS.SORT) : QUERY_PARAMS.SORT
2531
+ });
2521
2532
  for (const key of regularKeys) {
2522
2533
  const rawKey = keys[key] || key;
2523
2534
  params[rawKey] = parseParam(key, searchParams);
@@ -2559,16 +2570,17 @@ const parseFacetKeys = (facetKeys, searchParams) => {
2559
2570
  }
2560
2571
  return params;
2561
2572
  };
2562
- const parseParams = (searchParams) => {
2573
+ const parseParams = (getQueryParamName, searchParams) => {
2563
2574
  const params = /* @__PURE__ */ Object.create({});
2564
2575
  if (!searchParams)
2565
2576
  return params;
2566
2577
  const paramKeys = Array.from(searchParams.keys());
2567
2578
  const facetKeys = paramKeys.filter((k) => isFacetKey(k));
2568
2579
  const regularKeys = paramKeys.filter((k) => !isFacetKey(k));
2569
- return __spreadValues(__spreadValues({
2580
+ const r = __spreadValues(__spreadValues({
2570
2581
  [QUERY_PARAMS_PARSED.QUERY]: ""
2571
- }, parseRegularKeys(regularKeys, searchParams)), parseFacetKeys(facetKeys, searchParams));
2582
+ }, parseRegularKeys(regularKeys, searchParams, getQueryParamName)), parseFacetKeys(facetKeys, searchParams));
2583
+ return r;
2572
2584
  };
2573
2585
  const appendParam = (url, { name, value }, encode = true) => {
2574
2586
  if (Array.isArray(value)) {
@@ -2589,10 +2601,16 @@ const appendArrayParams = (url, param) => {
2589
2601
  url.searchParams.delete(param.name);
2590
2602
  param.value.forEach((v) => url.searchParams.append(param.name, encodeParam(v)));
2591
2603
  };
2592
- const getRemovableParams = (url, paramsToRemove) => {
2604
+ const getRemovableParams = (url, getQueryParamName, paramsToRemove) => {
2593
2605
  if (paramsToRemove === "all") {
2606
+ const params = {
2607
+ QUERY: getQueryParamName ? getQueryParamName(QUERY_PARAMS.QUERY) : QUERY_PARAMS.QUERY,
2608
+ LIMIT: getQueryParamName ? getQueryParamName(QUERY_PARAMS.LIMIT) : QUERY_PARAMS.LIMIT,
2609
+ PAGE: getQueryParamName ? getQueryParamName(QUERY_PARAMS.PAGE) : QUERY_PARAMS.PAGE,
2610
+ SORT: getQueryParamName ? getQueryParamName(QUERY_PARAMS.SORT) : QUERY_PARAMS.SORT
2611
+ };
2594
2612
  return [
2595
- ...Object.values(QUERY_PARAMS),
2613
+ ...Object.values(params),
2596
2614
  ...Array.from(url.searchParams.keys()).filter((k) => isFacetKey(k))
2597
2615
  ];
2598
2616
  }
@@ -2623,12 +2641,12 @@ const generateLink = (linkPattern, document2) => {
2623
2641
  }
2624
2642
  return link;
2625
2643
  };
2626
- const generateResultLink = (link, searchText, facet) => {
2644
+ const generateResultLink = (link, getQueryParamName, searchText, facet) => {
2627
2645
  if (!searchText) {
2628
2646
  return link;
2629
2647
  }
2630
2648
  const facetParam = facet ? `&${FACET_PARAMS_TYPE.TERMS}${encodeParam(facet.key)}=${encodeParam(facet.title)}` : "";
2631
- const queryParam = `?${QUERY_PARAMS.QUERY}=${encodeParam(searchText)}`;
2649
+ const queryParam = `?${getQueryParamName ? getQueryParamName(QUERY_PARAMS.QUERY) : QUERY_PARAMS.QUERY}=${encodeParam(searchText)}`;
2632
2650
  return `${link}${queryParam}${facetParam}`;
2633
2651
  };
2634
2652
  const getRelativePath = (link) => {
@@ -2657,8 +2675,8 @@ const handleRoutingEvent = (link, event, hasEventRouting = false) => {
2657
2675
  event == null ? void 0 : event.preventDefault();
2658
2676
  emitRoutingEvent(link);
2659
2677
  };
2660
- const redirectToResultsPage = (link, searchText, facet, routingBehavior = "direct-link") => {
2661
- const url = generateResultLink(link, searchText, facet);
2678
+ const redirectToResultsPage = (link, searchText, getQueryParamName, facet, routingBehavior = "direct-link") => {
2679
+ const url = generateResultLink(link, getQueryParamName, searchText, facet);
2662
2680
  if (routingBehavior === "event") {
2663
2681
  emitRoutingEvent(url);
2664
2682
  } else {
@@ -2683,15 +2701,15 @@ const getFacetParam = (key, value, type = FACET_PARAMS_TYPE.TERMS) => {
2683
2701
  value
2684
2702
  };
2685
2703
  };
2686
- const toggleTermFilter = (appendParams, facetAction, currentFilters) => {
2704
+ const toggleTermFilter = (appendParams, facetAction, getQueryParamName, currentFilters) => {
2687
2705
  const currentFilter = currentFilters == null ? void 0 : currentFilters[facetAction.key];
2688
2706
  const newParams = toggleTermParam(currentFilter, facetAction.value);
2689
2707
  appendParams({
2690
2708
  params: [getFacetParam(facetAction.key, newParams)],
2691
- paramsToRemove: [QUERY_PARAMS.PAGE]
2709
+ paramsToRemove: [getQueryParamName ? getQueryParamName(QUERY_PARAMS.PAGE) : QUERY_PARAMS.PAGE]
2692
2710
  });
2693
2711
  };
2694
- const toggleHierarchyFilter = (appendParams, facetAction, currentFilters, removeAllLevels = false) => {
2712
+ const toggleHierarchyFilter = (appendParams, facetAction, getQueryParamName, currentFilters, removeAllLevels = false) => {
2695
2713
  var _a;
2696
2714
  const currentFilter = currentFilters == null ? void 0 : currentFilters[facetAction.key];
2697
2715
  const newParams = toggleHierarchyParam(
@@ -2701,10 +2719,10 @@ const toggleHierarchyFilter = (appendParams, facetAction, currentFilters, remove
2701
2719
  );
2702
2720
  appendParams({
2703
2721
  params: [getFacetParam(facetAction.key, newParams, FACET_PARAMS_TYPE.HIERARCHY)],
2704
- paramsToRemove: [QUERY_PARAMS.PAGE]
2722
+ paramsToRemove: [getQueryParamName ? getQueryParamName(QUERY_PARAMS.PAGE) : QUERY_PARAMS.PAGE]
2705
2723
  });
2706
2724
  };
2707
- const toggleRangeFilter = (appendParams, facetAction, currentFilters) => {
2725
+ const toggleRangeFilter = (appendParams, facetAction, getQueryParamName, currentFilters) => {
2708
2726
  const currentFilter = rangeFilterToString(
2709
2727
  currentFilters == null ? void 0 : currentFilters[facetAction.key],
2710
2728
  FACET_RANGE_SEPARATOR
@@ -2713,7 +2731,7 @@ const toggleRangeFilter = (appendParams, facetAction, currentFilters) => {
2713
2731
  facetValue = currentFilter === facetValue ? "" : facetValue;
2714
2732
  appendParams({
2715
2733
  params: [getFacetParam(facetAction.key, facetValue, FACET_PARAMS_TYPE.RANGE)],
2716
- paramsToRemove: [QUERY_PARAMS.PAGE],
2734
+ paramsToRemove: [getQueryParamName ? getQueryParamName(QUERY_PARAMS.PAGE) : QUERY_PARAMS.PAGE],
2717
2735
  encode: false
2718
2736
  });
2719
2737
  };
@@ -2842,7 +2860,7 @@ const useParamsStore = defineStore("params", () => {
2842
2860
  const navigate = (url) => {
2843
2861
  var _a, _b, _c;
2844
2862
  window.history.pushState("", "Append params", url.pathname + url.search);
2845
- const params2 = parseParams(url.searchParams);
2863
+ const params2 = parseParams(optionsStore.getQueryParamName, url.searchParams);
2846
2864
  (_c = (_b = (_a = optionsStore == null ? void 0 : optionsStore.searchBoxOptions) == null ? void 0 : _a.callbacks) == null ? void 0 : _b.onSearchResultsNavigate) == null ? void 0 : _c.call(_b, {
2847
2865
  params: params2
2848
2866
  });
@@ -2860,7 +2878,7 @@ const useParamsStore = defineStore("params", () => {
2860
2878
  const paramsToRemove = Array.from(url.searchParams.keys()).filter(isFacetKey);
2861
2879
  removeParams(url, paramsToRemove);
2862
2880
  navigate(url);
2863
- params.value = parseParams(url.searchParams);
2881
+ params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
2864
2882
  searchString.value = url.search;
2865
2883
  };
2866
2884
  const removeParameters = ({
@@ -2868,13 +2886,13 @@ const useParamsStore = defineStore("params", () => {
2868
2886
  save = true
2869
2887
  }) => {
2870
2888
  const url = getPageUrl();
2871
- paramsToRemove = getRemovableParams(url, paramsToRemove);
2889
+ paramsToRemove = getRemovableParams(url, optionsStore.getQueryParamName, paramsToRemove);
2872
2890
  removeParams(url, paramsToRemove);
2873
2891
  navigate(url);
2874
2892
  if (!save) {
2875
2893
  return;
2876
2894
  }
2877
- params.value = parseParams(url.searchParams);
2895
+ params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
2878
2896
  searchString.value = url.search;
2879
2897
  };
2880
2898
  const handleNoResultsFlag = ({
@@ -2916,13 +2934,22 @@ const useParamsStore = defineStore("params", () => {
2916
2934
  })
2917
2935
  ] : [];
2918
2936
  appendParams({
2919
- params: [{ name: QUERY_PARAMS.QUERY, value: searchText }, ...facetParam],
2937
+ params: [
2938
+ { name: optionsStore.getQueryParamName(QUERY_PARAMS.QUERY), value: searchText },
2939
+ ...facetParam
2940
+ ],
2920
2941
  paramsToRemove: "all",
2921
2942
  searchResultsLink: searchResultsLink.value
2922
2943
  });
2923
2944
  } else {
2924
2945
  const routing = (_a = optionsStore.boxRoutingBehavior) != null ? _a : "direct-link";
2925
- redirectToResultsPage(searchResultsLink.value, searchText, facet, routing);
2946
+ redirectToResultsPage(
2947
+ searchResultsLink.value,
2948
+ searchText,
2949
+ optionsStore.getQueryParamName,
2950
+ facet,
2951
+ routing
2952
+ );
2926
2953
  }
2927
2954
  };
2928
2955
  const appendParams = ({
@@ -2936,14 +2963,14 @@ const useParamsStore = defineStore("params", () => {
2936
2963
  return { params: params.value };
2937
2964
  }
2938
2965
  const url = getPageUrl(searchResultsLink2);
2939
- paramsToRemove = getRemovableParams(url, paramsToRemove);
2966
+ paramsToRemove = getRemovableParams(url, optionsStore.getQueryParamName, paramsToRemove);
2940
2967
  removeParams(url, paramsToRemove);
2941
2968
  newParams.forEach((p2) => appendParam(url, p2, encode));
2942
2969
  navigate(url);
2943
2970
  if (!save) {
2944
2971
  return;
2945
2972
  }
2946
- params.value = parseParams(url.searchParams);
2973
+ params.value = parseParams(optionsStore.getQueryParamName, url.searchParams);
2947
2974
  searchString.value = url.search;
2948
2975
  };
2949
2976
  const setDefaultLimit = (newDefaultLimit) => {
@@ -3194,7 +3221,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
3194
3221
  resetHighlightIndex
3195
3222
  };
3196
3223
  });
3197
- const _hoisted_1$1c = { id: "lupa-search-box-input-container" };
3224
+ const _hoisted_1$1d = { id: "lupa-search-box-input-container" };
3198
3225
  const _hoisted_2$P = { class: "lupa-input-clear" };
3199
3226
  const _hoisted_3$A = { id: "lupa-search-box-input" };
3200
3227
  const _hoisted_4$s = ["value"];
@@ -3284,7 +3311,7 @@ const _sfc_main$1l = /* @__PURE__ */ vue.defineComponent({
3284
3311
  };
3285
3312
  __expose({ focus });
3286
3313
  return (_ctx, _cache) => {
3287
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1c, [
3314
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1d, [
3288
3315
  vue.createElementVNode("div", _hoisted_2$P, [
3289
3316
  vue.createElementVNode("div", {
3290
3317
  class: vue.normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
@@ -3358,7 +3385,7 @@ const _sfc_main$1k = /* @__PURE__ */ vue.defineComponent({
3358
3385
  };
3359
3386
  }
3360
3387
  });
3361
- const _hoisted_1$1b = { class: "lupa-search-box-history-item" };
3388
+ const _hoisted_1$1c = { class: "lupa-search-box-history-item" };
3362
3389
  const _hoisted_2$O = { class: "lupa-search-box-history-item-content" };
3363
3390
  const _sfc_main$1j = /* @__PURE__ */ vue.defineComponent({
3364
3391
  __name: "SearchBoxHistoryItem",
@@ -3376,7 +3403,7 @@ const _sfc_main$1j = /* @__PURE__ */ vue.defineComponent({
3376
3403
  emit("click", { query: props.item });
3377
3404
  };
3378
3405
  return (_ctx, _cache) => {
3379
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1b, [
3406
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1c, [
3380
3407
  vue.createElementVNode("div", _hoisted_2$O, [
3381
3408
  vue.createElementVNode("div", {
3382
3409
  class: vue.normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
@@ -3391,7 +3418,7 @@ const _sfc_main$1j = /* @__PURE__ */ vue.defineComponent({
3391
3418
  };
3392
3419
  }
3393
3420
  });
3394
- const _hoisted_1$1a = {
3421
+ const _hoisted_1$1b = {
3395
3422
  key: 0,
3396
3423
  class: "lupa-search-box-history-panel"
3397
3424
  };
@@ -3436,7 +3463,7 @@ const _sfc_main$1i = /* @__PURE__ */ vue.defineComponent({
3436
3463
  }
3437
3464
  };
3438
3465
  return (_ctx, _cache) => {
3439
- return hasHistory.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1a, [
3466
+ return hasHistory.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1b, [
3440
3467
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(history), (item, index) => {
3441
3468
  return vue.openBlock(), vue.createBlock(_sfc_main$1j, {
3442
3469
  key: item,
@@ -3454,7 +3481,7 @@ const _sfc_main$1i = /* @__PURE__ */ vue.defineComponent({
3454
3481
  };
3455
3482
  }
3456
3483
  });
3457
- const _hoisted_1$19 = { class: "lupa-search-box-no-results" };
3484
+ const _hoisted_1$1a = { class: "lupa-search-box-no-results" };
3458
3485
  const _sfc_main$1h = /* @__PURE__ */ vue.defineComponent({
3459
3486
  __name: "SearchBoxNoResults",
3460
3487
  props: {
@@ -3462,11 +3489,11 @@ const _sfc_main$1h = /* @__PURE__ */ vue.defineComponent({
3462
3489
  },
3463
3490
  setup(__props) {
3464
3491
  return (_ctx, _cache) => {
3465
- return vue.openBlock(), vue.createElementBlock("p", _hoisted_1$19, vue.toDisplayString(_ctx.labels.noResults), 1);
3492
+ return vue.openBlock(), vue.createElementBlock("p", _hoisted_1$1a, vue.toDisplayString(_ctx.labels.noResults), 1);
3466
3493
  };
3467
3494
  }
3468
3495
  });
3469
- const _hoisted_1$18 = ["innerHTML"];
3496
+ const _hoisted_1$19 = ["innerHTML"];
3470
3497
  const _hoisted_2$N = {
3471
3498
  key: 1,
3472
3499
  "data-cy": "lupa-suggestion-value",
@@ -3521,7 +3548,7 @@ const _sfc_main$1g = /* @__PURE__ */ vue.defineComponent({
3521
3548
  class: "lupa-suggestion-value",
3522
3549
  "data-cy": "lupa-suggestion-value",
3523
3550
  innerHTML: _ctx.suggestion.displayHighlight
3524
- }, null, 8, _hoisted_1$18)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$N, vue.toDisplayString(_ctx.suggestion.display), 1)),
3551
+ }, null, 8, _hoisted_1$19)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$N, vue.toDisplayString(_ctx.suggestion.display), 1)),
3525
3552
  _ctx.suggestion.facet ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$z, [
3526
3553
  vue.createElementVNode("span", _hoisted_4$r, vue.toDisplayString(facetLabel.value), 1),
3527
3554
  vue.createElementVNode("span", _hoisted_5$g, vue.toDisplayString(_ctx.suggestion.facet.title), 1)
@@ -3530,7 +3557,7 @@ const _sfc_main$1g = /* @__PURE__ */ vue.defineComponent({
3530
3557
  };
3531
3558
  }
3532
3559
  });
3533
- const _hoisted_1$17 = {
3560
+ const _hoisted_1$18 = {
3534
3561
  id: "lupa-search-box-suggestions",
3535
3562
  "data-cy": "lupa-search-box-suggestions"
3536
3563
  };
@@ -3594,7 +3621,7 @@ const _sfc_main$1f = /* @__PURE__ */ vue.defineComponent({
3594
3621
  });
3595
3622
  });
3596
3623
  return (_ctx, _cache) => {
3597
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$17, [
3624
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$18, [
3598
3625
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items.value, (item, index) => {
3599
3626
  return vue.openBlock(), vue.createBlock(_sfc_main$1g, {
3600
3627
  key: getSuggestionKey(item),
@@ -3678,8 +3705,9 @@ const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
3678
3705
  const useDynamicDataStore = defineStore("dynamicData", () => {
3679
3706
  const loading = vue.ref(false);
3680
3707
  const dynamicDataIdMap = vue.ref({});
3708
+ const loadingIds = vue.ref({});
3681
3709
  const optionsStore = useOptionsStore();
3682
- const loadedIds = vue.computed(() => Object.keys(dynamicDataIdMap.value));
3710
+ vue.computed(() => Object.keys(dynamicDataIdMap.value));
3683
3711
  const searchResultOptions = vue.computed(() => optionsStore.searchResultOptions);
3684
3712
  const searchBoxOptions = vue.computed(() => optionsStore.searchBoxOptions);
3685
3713
  const dynamicSearchResultData = vue.computed(() => {
@@ -3719,11 +3747,12 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
3719
3747
  const similarQueryResultIds = (_e = (_d = (_c = result.similarQueries) == null ? void 0 : _c.map((q) => q.items.map((i) => i.id))) == null ? void 0 : _d.flat()) != null ? _e : [];
3720
3748
  let requestedIds = [...resultIds, ...similarQueryResultIds];
3721
3749
  if (isCacheEnabled.value) {
3722
- requestedIds = requestedIds.filter((i) => !loadedIds.value.includes(i));
3750
+ requestedIds = requestedIds.filter((i) => !dynamicDataIdMap.value[`${i}`]);
3723
3751
  }
3724
3752
  if (!requestedIds.length) {
3725
3753
  return;
3726
3754
  }
3755
+ loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps(__spreadValues({}, a), { [c2]: true }), {});
3727
3756
  loading.value = true;
3728
3757
  try {
3729
3758
  const dynamicData = dynamicSearchResultData.value || dynamicSearchBoxData.value;
@@ -3733,15 +3762,16 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
3733
3762
  const dynamicDataResult = (_f = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _f : [];
3734
3763
  const seed = {};
3735
3764
  const dynamicDataIdMapValue = dynamicDataResult.reduce(
3736
- (a, c2) => __spreadProps(__spreadValues({}, a), { [c2.id]: c2 }),
3765
+ (a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
3737
3766
  seed
3738
3767
  );
3739
3768
  dynamicDataIdMap.value = __spreadValues(__spreadValues({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
3740
3769
  } finally {
3741
3770
  loading.value = false;
3771
+ loadingIds.value = {};
3742
3772
  }
3743
3773
  });
3744
- return { dynamicDataIdMap, loading, enhanceSearchResultsWithDynamicData };
3774
+ return { dynamicDataIdMap, loading, loadingIds, enhanceSearchResultsWithDynamicData };
3745
3775
  });
3746
3776
  const joinUrlParts = (...parts) => {
3747
3777
  var _a, _b, _c;
@@ -3750,7 +3780,7 @@ const joinUrlParts = (...parts) => {
3750
3780
  }
3751
3781
  return (_c = (_b = (_a = parts == null ? void 0 : parts.map((part) => part.replace(/(^\/+|\/+$)/g, ""))) == null ? void 0 : _a.filter((part) => part !== "")) == null ? void 0 : _b.join("/")) != null ? _c : "";
3752
3782
  };
3753
- const _hoisted_1$16 = ["src"];
3783
+ const _hoisted_1$17 = ["src"];
3754
3784
  const _sfc_main$1d = /* @__PURE__ */ vue.defineComponent({
3755
3785
  __name: "ProductImage",
3756
3786
  props: {
@@ -3804,7 +3834,7 @@ const _sfc_main$1d = /* @__PURE__ */ vue.defineComponent({
3804
3834
  vue.createElementVNode("img", vue.mergeProps({
3805
3835
  class: (_b = _ctx.imageClass) != null ? _b : "",
3806
3836
  src: finalUrl.value
3807
- }, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_1$16)
3837
+ }, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_1$17)
3808
3838
  ], 2);
3809
3839
  };
3810
3840
  }
@@ -3826,7 +3856,7 @@ const _sfc_main$1c = /* @__PURE__ */ vue.defineComponent({
3826
3856
  };
3827
3857
  }
3828
3858
  });
3829
- const _hoisted_1$15 = ["innerHTML"];
3859
+ const _hoisted_1$16 = ["innerHTML"];
3830
3860
  const _hoisted_2$M = {
3831
3861
  key: 1,
3832
3862
  class: "lupa-search-box-product-title"
@@ -3851,13 +3881,13 @@ const _sfc_main$1b = /* @__PURE__ */ vue.defineComponent({
3851
3881
  key: 0,
3852
3882
  class: "lupa-search-box-product-title",
3853
3883
  innerHTML: title.value
3854
- }, null, 8, _hoisted_1$15)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$M, [
3884
+ }, null, 8, _hoisted_1$16)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$M, [
3855
3885
  vue.createElementVNode("strong", null, vue.toDisplayString(title.value), 1)
3856
3886
  ]));
3857
3887
  };
3858
3888
  }
3859
3889
  });
3860
- const _hoisted_1$14 = ["innerHTML"];
3890
+ const _hoisted_1$15 = ["innerHTML"];
3861
3891
  const _hoisted_2$L = {
3862
3892
  key: 1,
3863
3893
  class: "lupa-search-box-product-description"
@@ -3882,11 +3912,11 @@ const _sfc_main$1a = /* @__PURE__ */ vue.defineComponent({
3882
3912
  key: 0,
3883
3913
  class: "lupa-search-box-product-description",
3884
3914
  innerHTML: description.value
3885
- }, null, 8, _hoisted_1$14)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$L, vue.toDisplayString(description.value), 1));
3915
+ }, null, 8, _hoisted_1$15)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$L, vue.toDisplayString(description.value), 1));
3886
3916
  };
3887
3917
  }
3888
3918
  });
3889
- const _hoisted_1$13 = { class: "lupa-search-box-product-price" };
3919
+ const _hoisted_1$14 = { class: "lupa-search-box-product-price" };
3890
3920
  const _sfc_main$19 = /* @__PURE__ */ vue.defineComponent({
3891
3921
  __name: "SearchBoxProductPrice",
3892
3922
  props: {
@@ -3905,13 +3935,13 @@ const _sfc_main$19 = /* @__PURE__ */ vue.defineComponent({
3905
3935
  );
3906
3936
  });
3907
3937
  return (_ctx, _cache) => {
3908
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$13, [
3938
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$14, [
3909
3939
  vue.createElementVNode("strong", null, vue.toDisplayString(price.value), 1)
3910
3940
  ]);
3911
3941
  };
3912
3942
  }
3913
3943
  });
3914
- const _hoisted_1$12 = { class: "lupa-search-box-product-regular-price" };
3944
+ const _hoisted_1$13 = { class: "lupa-search-box-product-regular-price" };
3915
3945
  const _sfc_main$18 = /* @__PURE__ */ vue.defineComponent({
3916
3946
  __name: "SearchBoxProductRegularPrice",
3917
3947
  props: {
@@ -3930,11 +3960,11 @@ const _sfc_main$18 = /* @__PURE__ */ vue.defineComponent({
3930
3960
  );
3931
3961
  });
3932
3962
  return (_ctx, _cache) => {
3933
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$12, vue.toDisplayString(price.value), 1);
3963
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$13, vue.toDisplayString(price.value), 1);
3934
3964
  };
3935
3965
  }
3936
3966
  });
3937
- const _hoisted_1$11 = ["innerHTML"];
3967
+ const _hoisted_1$12 = ["innerHTML"];
3938
3968
  const _hoisted_2$K = { key: 0 };
3939
3969
  const _hoisted_3$y = { key: 1 };
3940
3970
  const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
@@ -3965,7 +3995,7 @@ const _sfc_main$17 = /* @__PURE__ */ vue.defineComponent({
3965
3995
  key: 0,
3966
3996
  class: [className.value, "lupa-search-box-product-custom"],
3967
3997
  innerHTML: text.value
3968
- }, vue.toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$11)) : (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
3998
+ }, vue.toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$12)) : (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
3969
3999
  key: 1,
3970
4000
  class: [className.value, "lupa-search-box-product-custom"]
3971
4001
  }, vue.toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
@@ -3977,7 +4007,7 @@ const _sfc_main$17 = /* @__PURE__ */ vue.defineComponent({
3977
4007
  };
3978
4008
  }
3979
4009
  });
3980
- const _hoisted_1$10 = ["innerHTML"];
4010
+ const _hoisted_1$11 = ["innerHTML"];
3981
4011
  const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
3982
4012
  __name: "SearchBoxProductCustomHtml",
3983
4013
  props: {
@@ -3998,7 +4028,7 @@ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
3998
4028
  return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
3999
4029
  class: className.value,
4000
4030
  innerHTML: text.value
4001
- }, vue.toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$10);
4031
+ }, vue.toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$11);
4002
4032
  };
4003
4033
  }
4004
4034
  });
@@ -4192,7 +4222,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
4192
4222
  setLoading
4193
4223
  };
4194
4224
  });
4195
- const _hoisted_1$$ = { class: "lupa-search-box-add-to-cart-wrapper" };
4225
+ const _hoisted_1$10 = { class: "lupa-search-box-add-to-cart-wrapper" };
4196
4226
  const _hoisted_2$J = { class: "lupa-search-box-product-addtocart" };
4197
4227
  const _hoisted_3$x = ["onClick", "disabled"];
4198
4228
  const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
@@ -4222,7 +4252,7 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
4222
4252
  loading.value = false;
4223
4253
  });
4224
4254
  return (_ctx, _cache) => {
4225
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$$, [
4255
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$10, [
4226
4256
  vue.createElementVNode("div", _hoisted_2$J, [
4227
4257
  vue.createElementVNode("button", {
4228
4258
  onClick: vue.withModifiers(handleClick, ["stop", "prevent"]),
@@ -4236,6 +4266,10 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
4236
4266
  };
4237
4267
  }
4238
4268
  });
4269
+ const _hoisted_1$$ = {
4270
+ key: 1,
4271
+ class: "lupa-search-box-element-badge-wrapper"
4272
+ };
4239
4273
  const __default__$4 = {
4240
4274
  components: {
4241
4275
  SearchBoxProductImage: _sfc_main$1c,
@@ -4259,7 +4293,7 @@ const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadV
4259
4293
  setup(__props) {
4260
4294
  const props = __props;
4261
4295
  const dynamicDataStore = useDynamicDataStore();
4262
- const { loading, dynamicDataIdMap } = storeToRefs(dynamicDataStore);
4296
+ const { loading, loadingIds, dynamicDataIdMap } = storeToRefs(dynamicDataStore);
4263
4297
  const elementComponent = vue.computed(() => {
4264
4298
  switch (props.element.type) {
4265
4299
  case DocumentElementType.IMAGE:
@@ -4284,9 +4318,6 @@ const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadV
4284
4318
  const displayElement = vue.computed(() => {
4285
4319
  return props.element.display ? props.element.display(props.item) : true;
4286
4320
  });
4287
- const isLoadingDynamicData = vue.computed(() => {
4288
- return Boolean(props.element.dynamic && loading.value);
4289
- });
4290
4321
  const enhancedItem = vue.computed(() => {
4291
4322
  var _a, _b, _c, _d;
4292
4323
  if (!((_a = props.item) == null ? void 0 : _a.id)) {
@@ -4295,26 +4326,295 @@ const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadV
4295
4326
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
4296
4327
  return __spreadValues(__spreadValues({}, props.item), enhancementData);
4297
4328
  });
4329
+ const isLoadingDynamicData = (id) => {
4330
+ return Boolean(props.element.dynamic && id && loading.value && (loadingIds == null ? void 0 : loadingIds.value[id]));
4331
+ };
4298
4332
  return (_ctx, _cache) => {
4299
- return displayElement.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(elementComponent.value), {
4300
- key: 0,
4301
- item: enhancedItem.value,
4302
- options: _ctx.element,
4303
- labels: _ctx.labels,
4304
- class: vue.normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData.value }),
4305
- inStock: _ctx.isInStock
4306
- }, null, 8, ["item", "options", "labels", "class", "inStock"])) : vue.createCommentVNode("", true);
4333
+ var _a, _b;
4334
+ return !_ctx.$slots.badges ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
4335
+ displayElement.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(elementComponent.value), {
4336
+ key: 0,
4337
+ item: enhancedItem.value,
4338
+ options: _ctx.element,
4339
+ labels: _ctx.labels,
4340
+ class: vue.normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData((_a = _ctx.item) == null ? void 0 : _a.id) }),
4341
+ inStock: _ctx.isInStock
4342
+ }, null, 8, ["item", "options", "labels", "class", "inStock"])) : vue.createCommentVNode("", true)
4343
+ ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$$, [
4344
+ displayElement.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(elementComponent.value), {
4345
+ key: 0,
4346
+ item: enhancedItem.value,
4347
+ options: _ctx.element,
4348
+ labels: _ctx.labels,
4349
+ class: vue.normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData((_b = _ctx.item) == null ? void 0 : _b.id) }),
4350
+ inStock: _ctx.isInStock
4351
+ }, null, 8, ["item", "options", "labels", "class", "inStock"])) : vue.createCommentVNode("", true),
4352
+ vue.renderSlot(_ctx.$slots, "badges")
4353
+ ]));
4307
4354
  };
4308
4355
  }
4309
4356
  }));
4310
- const _hoisted_1$_ = ["href"];
4311
- const _hoisted_2$I = { class: "lupa-search-box-product-image-section" };
4312
- const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
4357
+ const _hoisted_1$_ = { class: "lupa-badge-title" };
4358
+ const _hoisted_2$I = ["src"];
4359
+ const _hoisted_3$w = { key: 1 };
4313
4360
  const _hoisted_4$p = {
4314
4361
  key: 0,
4315
- class: "lupa-search-box-product-add-to-cart-section"
4362
+ class: "lupa-badge-full-text"
4316
4363
  };
4317
4364
  const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
4365
+ __name: "SearchResultGeneratedBadge",
4366
+ props: {
4367
+ options: {},
4368
+ badge: {}
4369
+ },
4370
+ setup(__props) {
4371
+ const props = __props;
4372
+ const image = vue.computed(() => {
4373
+ var _a, _b, _c;
4374
+ return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.image) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : "";
4375
+ });
4376
+ const showTitle = vue.computed(() => {
4377
+ var _a, _b, _c;
4378
+ return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.showTitle) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : true;
4379
+ });
4380
+ const hasAdditionalText = vue.computed(() => {
4381
+ var _a, _b;
4382
+ return Boolean((_a = props.badge) == null ? void 0 : _a.additionalText) && typeof ((_b = props.badge) == null ? void 0 : _b.additionalText) === "string";
4383
+ });
4384
+ const hasTitleText = vue.computed(() => {
4385
+ var _a, _b;
4386
+ return Boolean((_a = props.badge) == null ? void 0 : _a.titleText) && typeof ((_b = props.badge) == null ? void 0 : _b.titleText) === "string";
4387
+ });
4388
+ const customClassName = vue.computed(() => {
4389
+ var _a, _b, _c;
4390
+ return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.customClass) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : "";
4391
+ });
4392
+ return (_ctx, _cache) => {
4393
+ return vue.openBlock(), vue.createElementBlock("div", {
4394
+ class: vue.normalizeClass(["lupa-dynamic-badge", customClassName.value]),
4395
+ style: vue.normalizeStyle({ background: _ctx.badge.backgroundColor, color: _ctx.badge.color })
4396
+ }, [
4397
+ vue.createElementVNode("span", _hoisted_1$_, [
4398
+ image.value ? (vue.openBlock(), vue.createElementBlock("img", {
4399
+ key: 0,
4400
+ src: image.value
4401
+ }, null, 8, _hoisted_2$I)) : vue.createCommentVNode("", true),
4402
+ hasTitleText.value && showTitle.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$w, vue.toDisplayString(_ctx.badge.titleText), 1)) : vue.createCommentVNode("", true)
4403
+ ]),
4404
+ hasAdditionalText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$p, vue.toDisplayString(_ctx.badge.additionalText), 1)) : vue.createCommentVNode("", true)
4405
+ ], 6);
4406
+ };
4407
+ }
4408
+ });
4409
+ const _hoisted_1$Z = { class: "lupa-generated-badges" };
4410
+ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
4411
+ __name: "SearchResultGeneratedBadges",
4412
+ props: {
4413
+ options: {}
4414
+ },
4415
+ setup(__props) {
4416
+ const props = __props;
4417
+ const badgeField = vue.computed(() => {
4418
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4419
+ const fieldHasBadges = ((_a = props.options.generate) == null ? void 0 : _a.key) && ((_d = props.options.product) == null ? void 0 : _d[(_c = (_b = props.options.generate) == null ? void 0 : _b.key) != null ? _c : ""]) && Array.isArray(props.options.product[(_f = (_e = props.options.generate) == null ? void 0 : _e.key) != null ? _f : ""]);
4420
+ return fieldHasBadges ? props.options.product[(_h = (_g = props.options.generate) == null ? void 0 : _g.key) != null ? _h : ""] : [];
4421
+ });
4422
+ const keyMap = vue.computed(() => {
4423
+ var _a, _b;
4424
+ return (_b = (_a = props.options.generate) == null ? void 0 : _a.keyMap) != null ? _b : {};
4425
+ });
4426
+ const badges = vue.computed(() => {
4427
+ return badgeField.value.filter((f2) => Boolean(f2)).map((f2) => ({
4428
+ backgroundColor: keyMap.value.backgroundColor ? f2[keyMap.value.backgroundColor] : void 0,
4429
+ color: keyMap.value.color ? f2[keyMap.value.color] : void 0,
4430
+ titleText: keyMap.value.titleText ? f2[keyMap.value.titleText] : void 0,
4431
+ additionalText: keyMap.value.additionalText ? f2[keyMap.value.additionalText] : void 0,
4432
+ id: keyMap.value.id ? f2[keyMap.value.id] : void 0
4433
+ })).filter((b) => Boolean(b.id));
4434
+ });
4435
+ return (_ctx, _cache) => {
4436
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Z, [
4437
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(badges.value, (badge) => {
4438
+ return vue.openBlock(), vue.createBlock(_sfc_main$13, {
4439
+ key: badge.id,
4440
+ badge,
4441
+ options: _ctx.options
4442
+ }, null, 8, ["badge", "options"]);
4443
+ }), 128))
4444
+ ]);
4445
+ };
4446
+ }
4447
+ });
4448
+ const _hoisted_1$Y = ["innerHTML"];
4449
+ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
4450
+ __name: "CustomBadge",
4451
+ props: {
4452
+ badge: {}
4453
+ },
4454
+ setup(__props) {
4455
+ const props = __props;
4456
+ const text = vue.computed(() => {
4457
+ var _a, _b, _c;
4458
+ return (_c = (_b = props.badge).html) == null ? void 0 : _c.call(_b, (_a = props.badge.product) != null ? _a : {});
4459
+ });
4460
+ const className = vue.computed(() => {
4461
+ var _a;
4462
+ return (_a = props.badge.className) != null ? _a : "";
4463
+ });
4464
+ return (_ctx, _cache) => {
4465
+ return vue.openBlock(), vue.createElementBlock("div", {
4466
+ class: vue.normalizeClass(className.value),
4467
+ innerHTML: text.value
4468
+ }, null, 10, _hoisted_1$Y);
4469
+ };
4470
+ }
4471
+ });
4472
+ const _hoisted_1$X = { class: "lupa-text-badges" };
4473
+ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
4474
+ __name: "TextBadge",
4475
+ props: {
4476
+ badge: {}
4477
+ },
4478
+ setup(__props) {
4479
+ const props = __props;
4480
+ const badges = vue.computed(() => {
4481
+ var _a, _b;
4482
+ return (_b = (_a = props.badge) == null ? void 0 : _a.value) != null ? _b : [];
4483
+ });
4484
+ const displayBadges = vue.computed(() => {
4485
+ return badges.value.slice(0, props.badge.maxItems);
4486
+ });
4487
+ return (_ctx, _cache) => {
4488
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$X, [
4489
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayBadges.value, (item) => {
4490
+ return vue.openBlock(), vue.createElementBlock("div", {
4491
+ class: "lupa-badge lupa-text-badge",
4492
+ key: item
4493
+ }, vue.toDisplayString(_ctx.badge.prefix) + vue.toDisplayString(item), 1);
4494
+ }), 128))
4495
+ ]);
4496
+ };
4497
+ }
4498
+ });
4499
+ const _hoisted_1$W = { class: "lupa-image-badges" };
4500
+ const _hoisted_2$H = ["src"];
4501
+ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
4502
+ __name: "ImageBadge",
4503
+ props: {
4504
+ badge: {}
4505
+ },
4506
+ setup(__props) {
4507
+ const props = __props;
4508
+ const badges = vue.computed(() => {
4509
+ return props.badge.value;
4510
+ });
4511
+ const displayBadges = vue.computed(() => {
4512
+ return badges.value.slice(0, props.badge.maxItems);
4513
+ });
4514
+ const getImageUrl = (src) => {
4515
+ if (!props.badge.rootImageUrl) {
4516
+ return src;
4517
+ }
4518
+ return `${props.badge.rootImageUrl}${src}`;
4519
+ };
4520
+ return (_ctx, _cache) => {
4521
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$W, [
4522
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayBadges.value, (item) => {
4523
+ return vue.openBlock(), vue.createElementBlock("div", {
4524
+ class: "lupa-badge lupa-image-badge",
4525
+ key: item
4526
+ }, [
4527
+ vue.createElementVNode("img", {
4528
+ src: getImageUrl(item)
4529
+ }, null, 8, _hoisted_2$H)
4530
+ ]);
4531
+ }), 128))
4532
+ ]);
4533
+ };
4534
+ }
4535
+ });
4536
+ const _hoisted_1$V = { id: "lupa-search-results-badges" };
4537
+ const __default__$3 = {
4538
+ components: {
4539
+ CustomBadge: _sfc_main$11,
4540
+ TextBadge: _sfc_main$10,
4541
+ ImageBadge: _sfc_main$$
4542
+ }
4543
+ };
4544
+ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
4545
+ __name: "SearchResultsBadgeWrapper",
4546
+ props: {
4547
+ position: {},
4548
+ options: {}
4549
+ },
4550
+ setup(__props) {
4551
+ const props = __props;
4552
+ const positionValue = vue.computed(() => {
4553
+ var _a;
4554
+ return (_a = props.position) != null ? _a : "card";
4555
+ });
4556
+ const anchorPosition = vue.computed(() => {
4557
+ return props.options.anchor;
4558
+ });
4559
+ const badges = vue.computed(() => {
4560
+ if (!props.options.elements) {
4561
+ return [];
4562
+ }
4563
+ return props.options.elements.filter((e) => {
4564
+ var _a;
4565
+ return !e.display || e.display((_a = props.options.product) != null ? _a : {});
4566
+ }).map((x) => {
4567
+ var _a;
4568
+ return __spreadProps(__spreadValues({}, x), {
4569
+ value: ((_a = props.options.product) == null ? void 0 : _a[x.key]) || "badge",
4570
+ product: props.options.product
4571
+ });
4572
+ });
4573
+ });
4574
+ const displayBadges = vue.computed(() => {
4575
+ return positionValue.value === "card" ? badges.value.filter((b) => !b.position || b.position === "card") : badges.value.filter((b) => b.position === "image");
4576
+ });
4577
+ const getBadgeComponent = (type) => {
4578
+ switch (type) {
4579
+ case BadgeType.TEXT:
4580
+ return "TextBadge";
4581
+ case BadgeType.IMAGE:
4582
+ return "ImageBadge";
4583
+ case BadgeType.CUSTOM_HTML:
4584
+ return "CustomBadge";
4585
+ default:
4586
+ return "CustomBadge";
4587
+ }
4588
+ };
4589
+ return (_ctx, _cache) => {
4590
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$V, [
4591
+ vue.createElementVNode("div", {
4592
+ id: "lupa-badges",
4593
+ class: vue.normalizeClass(anchorPosition.value)
4594
+ }, [
4595
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayBadges.value, (badge, index) => {
4596
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getBadgeComponent(badge.type)), {
4597
+ key: index,
4598
+ badge
4599
+ }, null, 8, ["badge"]);
4600
+ }), 128)),
4601
+ positionValue.value === "card" ? (vue.openBlock(), vue.createBlock(_sfc_main$12, {
4602
+ key: 0,
4603
+ options: _ctx.options
4604
+ }, null, 8, ["options"])) : vue.createCommentVNode("", true)
4605
+ ], 2)
4606
+ ]);
4607
+ };
4608
+ }
4609
+ }));
4610
+ const _hoisted_1$U = ["href"];
4611
+ const _hoisted_2$G = { class: "lupa-search-box-product-image-section" };
4612
+ const _hoisted_3$v = { class: "lupa-search-box-product-details-section" };
4613
+ const _hoisted_4$o = {
4614
+ key: 0,
4615
+ class: "lupa-search-box-product-add-to-cart-section"
4616
+ };
4617
+ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
4318
4618
  __name: "SearchBoxProduct",
4319
4619
  props: {
4320
4620
  item: {},
@@ -4331,6 +4631,9 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
4331
4631
  var _a, _b;
4332
4632
  return generateLink((_b = (_a = props.panelOptions.links) == null ? void 0 : _a.details) != null ? _b : "", props.item);
4333
4633
  });
4634
+ const badgeOptions = vue.computed(() => {
4635
+ return __spreadProps(__spreadValues({}, props.panelOptions.badges), { product: props.item });
4636
+ });
4334
4637
  const imageElements = vue.computed(() => {
4335
4638
  var _a, _b;
4336
4639
  return (_b = (_a = props.panelOptions.elements) == null ? void 0 : _a.filter((e) => e.type === DocumentElementType.IMAGE)) != null ? _b : [];
@@ -4370,7 +4673,7 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
4370
4673
  "data-cy": "lupa-search-box-product",
4371
4674
  onClick: handleClick
4372
4675
  }), [
4373
- vue.createElementVNode("div", _hoisted_2$I, [
4676
+ vue.createElementVNode("div", _hoisted_2$G, [
4374
4677
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(imageElements.value, (element) => {
4375
4678
  return vue.openBlock(), vue.createBlock(_sfc_main$14, {
4376
4679
  class: "lupa-search-box-product-element",
@@ -4382,19 +4685,31 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
4382
4685
  }, null, 8, ["item", "element", "labels", "link"]);
4383
4686
  }), 128))
4384
4687
  ]),
4385
- vue.createElementVNode("div", _hoisted_3$w, [
4688
+ vue.createElementVNode("div", _hoisted_3$v, [
4386
4689
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(detailElements.value, (element) => {
4690
+ var _a;
4387
4691
  return vue.openBlock(), vue.createBlock(_sfc_main$14, {
4692
+ key: element.key,
4388
4693
  class: "lupa-search-box-product-element",
4389
4694
  item: _ctx.item,
4390
4695
  element,
4391
- key: element.key,
4392
4696
  labels: _ctx.labels,
4393
4697
  link: link.value
4394
- }, null, 8, ["item", "element", "labels", "link"]);
4698
+ }, vue.createSlots({ _: 2 }, [
4699
+ badgeOptions.value && ((_a = badgeOptions.value) == null ? void 0 : _a.anchorElementKey) === element.key ? {
4700
+ name: "badges",
4701
+ fn: vue.withCtx(() => [
4702
+ vue.createVNode(_sfc_main$_, {
4703
+ options: badgeOptions.value,
4704
+ position: "card"
4705
+ }, null, 8, ["options"])
4706
+ ]),
4707
+ key: "0"
4708
+ } : void 0
4709
+ ]), 1032, ["item", "element", "labels", "link"]);
4395
4710
  }), 128))
4396
4711
  ]),
4397
- addToCartElement.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$p, [
4712
+ addToCartElement.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$o, [
4398
4713
  vue.createVNode(_sfc_main$14, {
4399
4714
  class: "lupa-search-box-product-element",
4400
4715
  item: _ctx.item,
@@ -4404,7 +4719,7 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
4404
4719
  isInStock: isInStock.value
4405
4720
  }, null, 8, ["item", "element", "labels", "link", "isInStock"])
4406
4721
  ])) : vue.createCommentVNode("", true)
4407
- ], 16, _hoisted_1$_);
4722
+ ], 16, _hoisted_1$U);
4408
4723
  };
4409
4724
  }
4410
4725
  });
@@ -4465,8 +4780,8 @@ const useTrackingStore = defineStore("tracking", () => {
4465
4780
  };
4466
4781
  return { trackSearch, trackResults, trackEvent };
4467
4782
  });
4468
- const _hoisted_1$Z = { id: "lupa-search-box-products" };
4469
- const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
4783
+ const _hoisted_1$T = { id: "lupa-search-box-products" };
4784
+ const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
4470
4785
  __name: "SearchBoxProducts",
4471
4786
  props: {
4472
4787
  items: {},
@@ -4527,7 +4842,7 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
4527
4842
  handleRoutingEvent(link, event, boxRoutingBehavior.value === "event");
4528
4843
  };
4529
4844
  return (_ctx, _cache) => {
4530
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Z, [
4845
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$T, [
4531
4846
  _ctx.$slots.productCard ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.items, (item, index) => {
4532
4847
  return vue.renderSlot(_ctx.$slots, "productCard", {
4533
4848
  key: index,
@@ -4539,7 +4854,7 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
4539
4854
  itemClicked: handleProductClick
4540
4855
  });
4541
4856
  }), 128)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(_ctx.items, (item, index) => {
4542
- return vue.openBlock(), vue.createBlock(_sfc_main$13, {
4857
+ return vue.openBlock(), vue.createBlock(_sfc_main$Z, {
4543
4858
  key: index,
4544
4859
  item,
4545
4860
  panelOptions: _ctx.panelOptions,
@@ -4553,7 +4868,7 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
4553
4868
  };
4554
4869
  }
4555
4870
  });
4556
- const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
4871
+ const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
4557
4872
  __name: "SearchBoxProductsWrapper",
4558
4873
  props: {
4559
4874
  panel: {},
@@ -4605,7 +4920,7 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
4605
4920
  const getItemsDebounced = debounce$1(getItems, props.debounce);
4606
4921
  return (_ctx, _cache) => {
4607
4922
  var _a, _b;
4608
- return vue.openBlock(), vue.createBlock(_sfc_main$12, {
4923
+ return vue.openBlock(), vue.createBlock(_sfc_main$Y, {
4609
4924
  items: (_b = (_a = searchResult.value) == null ? void 0 : _a.items) != null ? _b : [],
4610
4925
  panelOptions: _ctx.panel,
4611
4926
  labels: _ctx.labels,
@@ -4623,7 +4938,7 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
4623
4938
  };
4624
4939
  }
4625
4940
  });
4626
- const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
4941
+ const _sfc_main$W = /* @__PURE__ */ vue.defineComponent({
4627
4942
  __name: "SearchBoxRelatedSourceWrapper",
4628
4943
  props: {
4629
4944
  panel: {},
@@ -4695,7 +5010,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
4695
5010
  });
4696
5011
  return (_ctx, _cache) => {
4697
5012
  var _a, _b;
4698
- return vue.openBlock(), vue.createBlock(_sfc_main$12, {
5013
+ return vue.openBlock(), vue.createBlock(_sfc_main$Y, {
4699
5014
  items: (_b = (_a = searchResult.value) == null ? void 0 : _a.items) != null ? _b : [],
4700
5015
  panelOptions: documentPanelOptions.value,
4701
5016
  labels: _ctx.labels,
@@ -4713,16 +5028,16 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
4713
5028
  };
4714
5029
  }
4715
5030
  });
4716
- const _hoisted_1$Y = {
5031
+ const _hoisted_1$S = {
4717
5032
  key: 0,
4718
5033
  id: "lupa-search-box-panel"
4719
5034
  };
4720
- const _hoisted_2$H = ["data-cy"];
4721
- const _hoisted_3$v = {
5035
+ const _hoisted_2$F = ["data-cy"];
5036
+ const _hoisted_3$u = {
4722
5037
  key: 0,
4723
5038
  class: "lupa-panel-title lupa-panel-title-top-results"
4724
5039
  };
4725
- const _hoisted_4$o = {
5040
+ const _hoisted_4$n = {
4726
5041
  key: 1,
4727
5042
  class: "lupa-panel-title"
4728
5043
  };
@@ -4730,14 +5045,14 @@ const _hoisted_5$e = {
4730
5045
  key: 1,
4731
5046
  id: "lupa-search-box-panel"
4732
5047
  };
4733
- const __default__$3 = {
5048
+ const __default__$2 = {
4734
5049
  components: {
4735
5050
  SearchBoxSuggestionsWrapper: _sfc_main$1e,
4736
- SearchBoxProductsWrapper: _sfc_main$11,
4737
- SearchBoxRelatedSourceWrapper: _sfc_main$10
5051
+ SearchBoxProductsWrapper: _sfc_main$X,
5052
+ SearchBoxRelatedSourceWrapper: _sfc_main$W
4738
5053
  }
4739
5054
  };
4740
- const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
5055
+ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
4741
5056
  __name: "SearchBoxMainPanel",
4742
5057
  props: {
4743
5058
  options: {},
@@ -4883,7 +5198,7 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4883
5198
  ref_key: "panelContainer",
4884
5199
  ref: panelContainer
4885
5200
  }, [
4886
- displayResults.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Y, [
5201
+ displayResults.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$S, [
4887
5202
  labels.value.closePanel ? (vue.openBlock(), vue.createElementBlock("a", {
4888
5203
  key: 0,
4889
5204
  class: "lupa-search-box-close-panel",
@@ -4904,8 +5219,8 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4904
5219
  ]),
4905
5220
  "data-cy": "lupa-panel-" + panel.type + "-index"
4906
5221
  }, [
4907
- ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$v, vue.toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : vue.createCommentVNode("", true),
4908
- ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$o, vue.toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : vue.createCommentVNode("", true),
5222
+ ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$u, vue.toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : vue.createCommentVNode("", true),
5223
+ ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$n, vue.toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : vue.createCommentVNode("", true),
4909
5224
  panel.queryKey && canShowPanel(panel) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getComponent(panel.type)), {
4910
5225
  key: 2,
4911
5226
  panel,
@@ -4925,7 +5240,7 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
4925
5240
  key: "0"
4926
5241
  } : void 0
4927
5242
  ]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : vue.createCommentVNode("", true)
4928
- ], 10, _hoisted_2$H);
5243
+ ], 10, _hoisted_2$F);
4929
5244
  }), 128))
4930
5245
  ], 4),
4931
5246
  !vue.unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (vue.openBlock(), vue.createBlock(_sfc_main$1h, {
@@ -4964,9 +5279,9 @@ const unbindSearchTriggers = (triggers = [], event) => {
4964
5279
  const elements = getElements(triggers);
4965
5280
  elements.forEach((e) => e == null ? void 0 : e.removeEventListener(BIND_EVENT, event));
4966
5281
  };
4967
- const _hoisted_1$X = { id: "lupa-search-box" };
4968
- const _hoisted_2$G = { class: "lupa-search-box-wrapper" };
4969
- const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
5282
+ const _hoisted_1$R = { id: "lupa-search-box" };
5283
+ const _hoisted_2$E = { class: "lupa-search-box-wrapper" };
5284
+ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
4970
5285
  __name: "SearchBox",
4971
5286
  props: {
4972
5287
  options: {},
@@ -5211,8 +5526,8 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
5211
5526
  };
5212
5527
  return (_ctx, _cache) => {
5213
5528
  var _a2;
5214
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$X, [
5215
- vue.createElementVNode("div", _hoisted_2$G, [
5529
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$R, [
5530
+ vue.createElementVNode("div", _hoisted_2$E, [
5216
5531
  vue.createVNode(_sfc_main$1l, {
5217
5532
  options: inputOptions.value,
5218
5533
  suggestedValue: suggestedValue.value,
@@ -5224,7 +5539,7 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
5224
5539
  onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
5225
5540
  onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
5226
5541
  }, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
5227
- opened.value || _ctx.isSearchContainer ? (vue.openBlock(), vue.createBlock(_sfc_main$$, {
5542
+ opened.value || _ctx.isSearchContainer ? (vue.openBlock(), vue.createBlock(_sfc_main$V, {
5228
5543
  key: 0,
5229
5544
  options: panelOptions.value,
5230
5545
  inputValue: inputValue.value,
@@ -5312,11 +5627,11 @@ const getSearchParams = (url, params, baseUrl) => {
5312
5627
  }
5313
5628
  return searchParams;
5314
5629
  };
5315
- const getInitialSearchResults = (options, defaultData) => __async(exports, null, function* () {
5630
+ const getInitialSearchResults = (options, getQueryParamName, defaultData) => __async(exports, null, function* () {
5316
5631
  var _a, _b, _c;
5317
5632
  const searchParams = getSearchParams((_a = options.ssr) == null ? void 0 : _a.url, void 0, (_b = options.ssr) == null ? void 0 : _b.baseUrl);
5318
5633
  const publicQuery = createPublicQuery(
5319
- parseParams(searchParams),
5634
+ parseParams(getQueryParamName, searchParams),
5320
5635
  options.sort,
5321
5636
  defaultData == null ? void 0 : defaultData.pageSize
5322
5637
  );
@@ -5328,20 +5643,20 @@ const getInitialSearchResults = (options, defaultData) => __async(exports, null,
5328
5643
  options.options.onError(e);
5329
5644
  }
5330
5645
  });
5331
- const _hoisted_1$W = {
5646
+ const _hoisted_1$Q = {
5332
5647
  key: 0,
5333
5648
  id: "lupa-search-results-did-you-mean"
5334
5649
  };
5335
- const _hoisted_2$F = {
5650
+ const _hoisted_2$D = {
5336
5651
  key: 0,
5337
5652
  "data-cy": "suggested-search-text-label"
5338
5653
  };
5339
- const _hoisted_3$u = {
5654
+ const _hoisted_3$t = {
5340
5655
  key: 1,
5341
5656
  "data-cy": "did-you-mean-label"
5342
5657
  };
5343
- const _hoisted_4$n = { key: 1 };
5344
- const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
5658
+ const _hoisted_4$m = { key: 1 };
5659
+ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
5345
5660
  __name: "SearchResultsDidYouMean",
5346
5661
  props: {
5347
5662
  labels: {}
@@ -5373,8 +5688,8 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
5373
5688
  paramStore.goToResults({ searchText, facet });
5374
5689
  };
5375
5690
  return (_ctx, _cache) => {
5376
- return vue.unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$W, [
5377
- vue.unref(searchResult).suggestedSearchText ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$F, [
5691
+ return vue.unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Q, [
5692
+ vue.unref(searchResult).suggestedSearchText ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$D, [
5378
5693
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.labels.noResultsSuggestion.split(" "), (label, index) => {
5379
5694
  return vue.openBlock(), vue.createElementBlock("span", { key: index }, [
5380
5695
  vue.createElementVNode("span", {
@@ -5383,7 +5698,7 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
5383
5698
  ]);
5384
5699
  }), 128))
5385
5700
  ])) : vue.createCommentVNode("", true),
5386
- didYouMeanValue.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$u, [
5701
+ didYouMeanValue.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$t, [
5387
5702
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.labels.didYouMean.split(" "), (label, index) => {
5388
5703
  return vue.openBlock(), vue.createElementBlock("span", { key: index }, [
5389
5704
  label.includes("{1}") ? (vue.openBlock(), vue.createElementBlock("span", {
@@ -5391,7 +5706,7 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
5391
5706
  class: "lupa-did-you-mean lupa-highlighted-search-text",
5392
5707
  "data-cy": "did-you-mean-value",
5393
5708
  onClick: _cache[0] || (_cache[0] = ($event) => goToResults({ searchText: didYouMeanValue.value }))
5394
- }, vue.toDisplayString(didYouMeanValue.value) + " ", 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$n, vue.toDisplayString(label) + " ", 1))
5709
+ }, vue.toDisplayString(didYouMeanValue.value) + " ", 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$m, vue.toDisplayString(label) + " ", 1))
5395
5710
  ]);
5396
5711
  }), 128))
5397
5712
  ])) : vue.createCommentVNode("", true)
@@ -5399,12 +5714,12 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
5399
5714
  };
5400
5715
  }
5401
5716
  });
5402
- const _hoisted_1$V = {
5717
+ const _hoisted_1$P = {
5403
5718
  key: 0,
5404
5719
  class: "lupa-search-results-summary"
5405
5720
  };
5406
- const _hoisted_2$E = ["innerHTML"];
5407
- const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
5721
+ const _hoisted_2$C = ["innerHTML"];
5722
+ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
5408
5723
  __name: "SearchResultsSummary",
5409
5724
  props: {
5410
5725
  label: {},
@@ -5419,8 +5734,8 @@ const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
5419
5734
  return addParamsToLabel(props.label, range, `<span>${totalItems.value}</span>`);
5420
5735
  });
5421
5736
  return (_ctx, _cache) => {
5422
- return vue.unref(totalItems) > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$V, [
5423
- vue.createElementVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$E),
5737
+ return vue.unref(totalItems) > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$P, [
5738
+ vue.createElementVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$C),
5424
5739
  _ctx.clearable ? (vue.openBlock(), vue.createElementBlock("span", {
5425
5740
  key: 0,
5426
5741
  class: "lupa-filter-clear",
@@ -5431,18 +5746,18 @@ const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
5431
5746
  };
5432
5747
  }
5433
5748
  });
5434
- const _hoisted_1$U = {
5749
+ const _hoisted_1$O = {
5435
5750
  key: 0,
5436
5751
  class: "lupa-result-page-title",
5437
5752
  "data-cy": "lupa-result-page-title"
5438
5753
  };
5439
- const _hoisted_2$D = { key: 0 };
5440
- const _hoisted_3$t = {
5754
+ const _hoisted_2$B = { key: 0 };
5755
+ const _hoisted_3$s = {
5441
5756
  key: 1,
5442
5757
  class: "lupa-results-total-count"
5443
5758
  };
5444
- const _hoisted_4$m = ["innerHTML"];
5445
- const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
5759
+ const _hoisted_4$l = ["innerHTML"];
5760
+ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
5446
5761
  __name: "SearchResultsTitle",
5447
5762
  props: {
5448
5763
  options: {},
@@ -5477,12 +5792,12 @@ const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
5477
5792
  });
5478
5793
  return (_ctx, _cache) => {
5479
5794
  return vue.openBlock(), vue.createElementBlock("div", null, [
5480
- showSearchTitle.value ? (vue.openBlock(), vue.createElementBlock("h1", _hoisted_1$U, [
5795
+ showSearchTitle.value ? (vue.openBlock(), vue.createElementBlock("h1", _hoisted_1$O, [
5481
5796
  vue.createTextVNode(vue.toDisplayString(_ctx.options.labels.searchResults), 1),
5482
- queryText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$D, "'" + vue.toDisplayString(queryText.value) + "'", 1)) : vue.createCommentVNode("", true),
5483
- showProductCount.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$t, "(" + vue.toDisplayString(vue.unref(totalItems)) + ")", 1)) : vue.createCommentVNode("", true)
5797
+ queryText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$B, "'" + vue.toDisplayString(queryText.value) + "'", 1)) : vue.createCommentVNode("", true),
5798
+ showProductCount.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$s, "(" + vue.toDisplayString(vue.unref(totalItems)) + ")", 1)) : vue.createCommentVNode("", true)
5484
5799
  ])) : vue.createCommentVNode("", true),
5485
- _ctx.showSummary ? (vue.openBlock(), vue.createBlock(_sfc_main$Y, {
5800
+ _ctx.showSummary ? (vue.openBlock(), vue.createBlock(_sfc_main$S, {
5486
5801
  key: 1,
5487
5802
  label: summaryLabel.value
5488
5803
  }, null, 8, ["label"])) : vue.createCommentVNode("", true),
@@ -5490,21 +5805,21 @@ const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
5490
5805
  key: 2,
5491
5806
  class: "lupa-result-page-description-top",
5492
5807
  innerHTML: descriptionTop.value
5493
- }, null, 8, _hoisted_4$m)) : vue.createCommentVNode("", true)
5808
+ }, null, 8, _hoisted_4$l)) : vue.createCommentVNode("", true)
5494
5809
  ]);
5495
5810
  };
5496
5811
  }
5497
5812
  });
5498
- const _hoisted_1$T = { class: "lupa-search-result-filter-value" };
5499
- const _hoisted_2$C = {
5813
+ const _hoisted_1$N = { class: "lupa-search-result-filter-value" };
5814
+ const _hoisted_2$A = {
5500
5815
  class: "lupa-current-filter-label",
5501
5816
  "data-cy": "lupa-current-filter-label"
5502
5817
  };
5503
- const _hoisted_3$s = {
5818
+ const _hoisted_3$r = {
5504
5819
  class: "lupa-current-filter-value",
5505
5820
  "data-cy": "lupa-current-filter-value"
5506
5821
  };
5507
- const _sfc_main$W = /* @__PURE__ */ vue.defineComponent({
5822
+ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
5508
5823
  __name: "CurrentFilterDisplay",
5509
5824
  props: {
5510
5825
  filter: {}
@@ -5516,28 +5831,28 @@ const _sfc_main$W = /* @__PURE__ */ vue.defineComponent({
5516
5831
  emit("remove", { filter: props.filter });
5517
5832
  };
5518
5833
  return (_ctx, _cache) => {
5519
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$T, [
5834
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$N, [
5520
5835
  vue.createElementVNode("div", {
5521
5836
  class: "lupa-current-filter-action",
5522
5837
  onClick: handleClick
5523
5838
  }, "⨉"),
5524
- vue.createElementVNode("div", _hoisted_2$C, vue.toDisplayString(_ctx.filter.label) + ": ", 1),
5525
- vue.createElementVNode("div", _hoisted_3$s, vue.toDisplayString(_ctx.filter.value), 1)
5839
+ vue.createElementVNode("div", _hoisted_2$A, vue.toDisplayString(_ctx.filter.label) + ": ", 1),
5840
+ vue.createElementVNode("div", _hoisted_3$r, vue.toDisplayString(_ctx.filter.value), 1)
5526
5841
  ]);
5527
5842
  };
5528
5843
  }
5529
5844
  });
5530
- const _hoisted_1$S = { class: "lupa-filter-title-text" };
5531
- const _hoisted_2$B = {
5845
+ const _hoisted_1$M = { class: "lupa-filter-title-text" };
5846
+ const _hoisted_2$z = {
5532
5847
  key: 0,
5533
5848
  class: "lupa-filter-count"
5534
5849
  };
5535
- const _hoisted_3$r = {
5850
+ const _hoisted_3$q = {
5536
5851
  key: 0,
5537
5852
  class: "filter-values"
5538
5853
  };
5539
- const _hoisted_4$l = { class: "lupa-current-filter-list" };
5540
- const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
5854
+ const _hoisted_4$k = { class: "lupa-current-filter-list" };
5855
+ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
5541
5856
  __name: "CurrentFilters",
5542
5857
  props: {
5543
5858
  options: {},
@@ -5546,6 +5861,7 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
5546
5861
  setup(__props) {
5547
5862
  const isOpen = vue.ref(false);
5548
5863
  const paramsStore = useParamsStore();
5864
+ const optionStore = useOptionsStore();
5549
5865
  const searchResultStore = useSearchResultStore();
5550
5866
  const { filters, displayFilters, currentFilterCount } = storeToRefs(searchResultStore);
5551
5867
  const currentFilters = vue.computed(() => filters.value);
@@ -5563,6 +5879,7 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
5563
5879
  // TODO: Fix any
5564
5880
  paramsStore.appendParams,
5565
5881
  { type: "terms", value: filter.value, key: filter.key },
5882
+ optionStore.getQueryParamName,
5566
5883
  currentFilters.value
5567
5884
  );
5568
5885
  break;
@@ -5570,13 +5887,17 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
5570
5887
  toggleHierarchyFilter(
5571
5888
  paramsStore.appendParams,
5572
5889
  { type: "hierarchy", value: filter.value, key: filter.key },
5890
+ optionStore.getQueryParamName,
5573
5891
  currentFilters.value,
5574
5892
  true
5575
5893
  );
5576
5894
  break;
5577
5895
  case "range":
5578
5896
  paramsStore.removeParameters({
5579
- paramsToRemove: [QUERY_PARAMS.PAGE, `${FACET_PARAMS_TYPE.RANGE}${filter.key}`]
5897
+ paramsToRemove: [
5898
+ optionStore.getQueryParamName(QUERY_PARAMS.PAGE),
5899
+ `${FACET_PARAMS_TYPE.RANGE}${filter.key}`
5900
+ ]
5580
5901
  });
5581
5902
  break;
5582
5903
  }
@@ -5592,19 +5913,19 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
5592
5913
  class: "lupa-current-filter-title",
5593
5914
  onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
5594
5915
  }, [
5595
- vue.createElementVNode("div", _hoisted_1$S, [
5916
+ vue.createElementVNode("div", _hoisted_1$M, [
5596
5917
  vue.createTextVNode(vue.toDisplayString((_c = (_b = (_a = _ctx.options) == null ? void 0 : _a.labels) == null ? void 0 : _b.title) != null ? _c : "") + " ", 1),
5597
- _ctx.expandable ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$B, " (" + vue.toDisplayString(vue.unref(currentFilterCount)) + ") ", 1)) : vue.createCommentVNode("", true)
5918
+ _ctx.expandable ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$z, " (" + vue.toDisplayString(vue.unref(currentFilterCount)) + ") ", 1)) : vue.createCommentVNode("", true)
5598
5919
  ]),
5599
5920
  _ctx.expandable ? (vue.openBlock(), vue.createElementBlock("div", {
5600
5921
  key: 0,
5601
5922
  class: vue.normalizeClass(["lupa-filter-title-caret", isOpen.value && "open"])
5602
5923
  }, null, 2)) : vue.createCommentVNode("", true)
5603
5924
  ]),
5604
- !_ctx.expandable || isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$r, [
5605
- vue.createElementVNode("div", _hoisted_4$l, [
5925
+ !_ctx.expandable || isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$q, [
5926
+ vue.createElementVNode("div", _hoisted_4$k, [
5606
5927
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(displayFilters), (filter) => {
5607
- return vue.openBlock(), vue.createBlock(_sfc_main$W, {
5928
+ return vue.openBlock(), vue.createBlock(_sfc_main$Q, {
5608
5929
  key: filter.key + "_" + filter.value,
5609
5930
  filter,
5610
5931
  onRemove: handleRemove
@@ -5621,8 +5942,8 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
5621
5942
  };
5622
5943
  }
5623
5944
  });
5624
- const _hoisted_1$R = ["href"];
5625
- const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
5945
+ const _hoisted_1$L = ["href"];
5946
+ const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
5626
5947
  __name: "CategoryFilterItem",
5627
5948
  props: {
5628
5949
  options: {},
@@ -5659,20 +5980,20 @@ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
5659
5980
  "data-cy": "lupa-child-category-item",
5660
5981
  href: urlLink.value,
5661
5982
  onClick: handleNavigation
5662
- }, vue.toDisplayString(title.value), 9, _hoisted_1$R)
5983
+ }, vue.toDisplayString(title.value), 9, _hoisted_1$L)
5663
5984
  ], 2);
5664
5985
  };
5665
5986
  }
5666
5987
  });
5667
- const _hoisted_1$Q = {
5988
+ const _hoisted_1$K = {
5668
5989
  class: "lupa-category-filter",
5669
5990
  "data-cy": "lupa-category-filter"
5670
5991
  };
5671
- const _hoisted_2$A = { class: "lupa-category-back" };
5672
- const _hoisted_3$q = ["href"];
5673
- const _hoisted_4$k = ["href"];
5992
+ const _hoisted_2$y = { class: "lupa-category-back" };
5993
+ const _hoisted_3$p = ["href"];
5994
+ const _hoisted_4$j = ["href"];
5674
5995
  const _hoisted_5$d = { class: "lupa-child-category-list" };
5675
- const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
5996
+ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
5676
5997
  __name: "CategoryFilter",
5677
5998
  props: {
5678
5999
  options: {}
@@ -5758,14 +6079,14 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
5758
6079
  };
5759
6080
  __expose({ fetch: fetch2 });
5760
6081
  return (_ctx, _cache) => {
5761
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Q, [
5762
- vue.createElementVNode("div", _hoisted_2$A, [
6082
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$K, [
6083
+ vue.createElementVNode("div", _hoisted_2$y, [
5763
6084
  hasBackButton.value ? (vue.openBlock(), vue.createElementBlock("a", {
5764
6085
  key: 0,
5765
6086
  "data-cy": "lupa-category-back",
5766
6087
  href: backUrlLink.value,
5767
6088
  onClick: handleNavigationBack
5768
- }, vue.toDisplayString(backTitle.value), 9, _hoisted_3$q)) : vue.createCommentVNode("", true)
6089
+ }, vue.toDisplayString(backTitle.value), 9, _hoisted_3$p)) : vue.createCommentVNode("", true)
5769
6090
  ]),
5770
6091
  vue.createElementVNode("div", {
5771
6092
  class: vue.normalizeClass(["lupa-current-category", { "lupa-current-category-active": isActive }])
@@ -5775,11 +6096,11 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
5775
6096
  href: parentUrlLink.value,
5776
6097
  class: vue.normalizeClass({ "lupa-title-category": !hasBackButton.value }),
5777
6098
  onClick: handleNavigationParent
5778
- }, vue.toDisplayString(parentTitle.value), 11, _hoisted_4$k)
6099
+ }, vue.toDisplayString(parentTitle.value), 11, _hoisted_4$j)
5779
6100
  ], 2),
5780
6101
  vue.createElementVNode("div", _hoisted_5$d, [
5781
6102
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(categoryChildren.value, (child) => {
5782
- return vue.openBlock(), vue.createBlock(_sfc_main$U, {
6103
+ return vue.openBlock(), vue.createBlock(_sfc_main$O, {
5783
6104
  key: getCategoryKey(child),
5784
6105
  item: child,
5785
6106
  options: _ctx.options
@@ -5790,13 +6111,13 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
5790
6111
  };
5791
6112
  }
5792
6113
  });
5793
- const _hoisted_1$P = {
6114
+ const _hoisted_1$J = {
5794
6115
  class: "lupa-search-result-facet-term-values",
5795
6116
  "data-cy": "lupa-search-result-facet-term-values"
5796
6117
  };
5797
- const _hoisted_2$z = ["placeholder"];
5798
- const _hoisted_3$p = { class: "lupa-terms-list" };
5799
- const _hoisted_4$j = ["onClick"];
6118
+ const _hoisted_2$x = ["placeholder"];
6119
+ const _hoisted_3$o = { class: "lupa-terms-list" };
6120
+ const _hoisted_4$i = ["onClick"];
5800
6121
  const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
5801
6122
  const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
5802
6123
  const _hoisted_7$6 = { class: "lupa-term-label" };
@@ -5806,7 +6127,7 @@ const _hoisted_8$1 = {
5806
6127
  };
5807
6128
  const _hoisted_9$1 = { key: 0 };
5808
6129
  const _hoisted_10$1 = { key: 1 };
5809
- const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
6130
+ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
5810
6131
  __name: "TermFacet",
5811
6132
  props: {
5812
6133
  options: {},
@@ -5875,17 +6196,17 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
5875
6196
  return selectedItems == null ? void 0 : selectedItems.includes((_b = item.title) == null ? void 0 : _b.toString());
5876
6197
  };
5877
6198
  return (_ctx, _cache) => {
5878
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$P, [
6199
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$J, [
5879
6200
  isFilterable.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
5880
6201
  key: 0,
5881
6202
  class: "lupa-term-filter",
5882
6203
  "data-cy": "lupa-term-filter",
5883
6204
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
5884
6205
  placeholder: _ctx.options.labels.facetFilter
5885
- }, null, 8, _hoisted_2$z)), [
6206
+ }, null, 8, _hoisted_2$x)), [
5886
6207
  [vue.vModelText, termFilter.value]
5887
6208
  ]) : vue.createCommentVNode("", true),
5888
- vue.createElementVNode("div", _hoisted_3$p, [
6209
+ vue.createElementVNode("div", _hoisted_3$o, [
5889
6210
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayValues.value, (item) => {
5890
6211
  return vue.openBlock(), vue.createElementBlock("div", {
5891
6212
  class: vue.normalizeClass(["lupa-facet-term", { checked: isChecked(item) }]),
@@ -5902,7 +6223,7 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
5902
6223
  vue.createElementVNode("span", _hoisted_7$6, vue.toDisplayString(item.title), 1),
5903
6224
  _ctx.options.showDocumentCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$1, "(" + vue.toDisplayString(item.count) + ")", 1)) : vue.createCommentVNode("", true)
5904
6225
  ])
5905
- ], 10, _hoisted_4$j);
6226
+ ], 10, _hoisted_4$i);
5906
6227
  }), 128))
5907
6228
  ]),
5908
6229
  displayShowMore.value ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -6893,16 +7214,16 @@ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide"
6893
7214
  m.render = function(e, t, r, i, n, o) {
6894
7215
  return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps(e.sliderProps, { ref: "slider" }), null, 16);
6895
7216
  }, m.__file = "src/Slider.vue";
6896
- const _hoisted_1$O = { class: "lupa-search-result-facet-stats-values" };
6897
- const _hoisted_2$y = {
7217
+ const _hoisted_1$I = { class: "lupa-search-result-facet-stats-values" };
7218
+ const _hoisted_2$w = {
6898
7219
  key: 0,
6899
7220
  class: "lupa-stats-facet-summary"
6900
7221
  };
6901
- const _hoisted_3$o = {
7222
+ const _hoisted_3$n = {
6902
7223
  key: 1,
6903
7224
  class: "lupa-stats-facet-summary-input"
6904
7225
  };
6905
- const _hoisted_4$i = {
7226
+ const _hoisted_4$h = {
6906
7227
  key: 0,
6907
7228
  class: "lupa-stats-range-label"
6908
7229
  };
@@ -6921,7 +7242,7 @@ const _hoisted_13 = {
6921
7242
  key: 2,
6922
7243
  class: "lupa-stats-slider-wrapper"
6923
7244
  };
6924
- const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
7245
+ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
6925
7246
  __name: "StatsFacet",
6926
7247
  props: {
6927
7248
  options: {},
@@ -7090,10 +7411,10 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
7090
7411
  innerSliderRange.value = value;
7091
7412
  };
7092
7413
  return (_ctx, _cache) => {
7093
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$O, [
7094
- !isInputVisible.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$y, vue.toDisplayString(statsSummary.value), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$o, [
7414
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$I, [
7415
+ !isInputVisible.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$w, vue.toDisplayString(statsSummary.value), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$n, [
7095
7416
  vue.createElementVNode("div", null, [
7096
- rangeLabelFrom.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$i, vue.toDisplayString(rangeLabelFrom.value), 1)) : vue.createCommentVNode("", true),
7417
+ rangeLabelFrom.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$h, vue.toDisplayString(rangeLabelFrom.value), 1)) : vue.createCommentVNode("", true),
7097
7418
  vue.createElementVNode("div", _hoisted_5$b, [
7098
7419
  vue.withDirectives(vue.createElementVNode("input", {
7099
7420
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
@@ -7157,10 +7478,10 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
7157
7478
  };
7158
7479
  }
7159
7480
  });
7160
- const _hoisted_1$N = { class: "lupa-term-checkbox-wrapper" };
7161
- const _hoisted_2$x = { class: "lupa-term-checkbox-label" };
7162
- const _hoisted_3$n = { class: "lupa-term-label" };
7163
- const _hoisted_4$h = {
7481
+ const _hoisted_1$H = { class: "lupa-term-checkbox-wrapper" };
7482
+ const _hoisted_2$v = { class: "lupa-term-checkbox-label" };
7483
+ const _hoisted_3$m = { class: "lupa-term-label" };
7484
+ const _hoisted_4$g = {
7164
7485
  key: 0,
7165
7486
  class: "lupa-term-count"
7166
7487
  };
@@ -7168,7 +7489,7 @@ const _hoisted_5$a = {
7168
7489
  key: 0,
7169
7490
  class: "lupa-facet-level"
7170
7491
  };
7171
- const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
7492
+ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
7172
7493
  __name: "HierarchyFacetLevel",
7173
7494
  props: {
7174
7495
  options: {},
@@ -7214,14 +7535,14 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
7214
7535
  "data-cy": "lupa-facet-term",
7215
7536
  onClick: _cache[0] || (_cache[0] = ($event) => handleFacetClick(_ctx.item))
7216
7537
  }, [
7217
- vue.createElementVNode("div", _hoisted_1$N, [
7538
+ vue.createElementVNode("div", _hoisted_1$H, [
7218
7539
  vue.createElementVNode("span", {
7219
7540
  class: vue.normalizeClass(["lupa-term-checkbox", { checked: isChecked.value }])
7220
7541
  }, null, 2)
7221
7542
  ]),
7222
- vue.createElementVNode("div", _hoisted_2$x, [
7223
- vue.createElementVNode("span", _hoisted_3$n, vue.toDisplayString(_ctx.item.title) + vue.toDisplayString(" "), 1),
7224
- _ctx.options.showDocumentCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$h, "(" + vue.toDisplayString(_ctx.item.count) + ")", 1)) : vue.createCommentVNode("", true)
7543
+ vue.createElementVNode("div", _hoisted_2$v, [
7544
+ vue.createElementVNode("span", _hoisted_3$m, vue.toDisplayString(_ctx.item.title) + vue.toDisplayString(" "), 1),
7545
+ _ctx.options.showDocumentCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$g, "(" + vue.toDisplayString(_ctx.item.count) + ")", 1)) : vue.createCommentVNode("", true)
7225
7546
  ])
7226
7547
  ]),
7227
7548
  showChildren.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$a, [
@@ -7240,13 +7561,13 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
7240
7561
  };
7241
7562
  }
7242
7563
  });
7243
- const _hoisted_1$M = {
7564
+ const _hoisted_1$G = {
7244
7565
  class: "lupa-search-result-facet-term-values lupa-search-result-facet-hierarchy-values",
7245
7566
  "data-cy": "lupa-search-result-facet-term-values"
7246
7567
  };
7247
- const _hoisted_2$w = { key: 0 };
7248
- const _hoisted_3$m = ["placeholder"];
7249
- const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
7568
+ const _hoisted_2$u = { key: 0 };
7569
+ const _hoisted_3$l = ["placeholder"];
7570
+ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
7250
7571
  __name: "HierarchyFacet",
7251
7572
  props: {
7252
7573
  options: {},
@@ -7296,19 +7617,19 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
7296
7617
  showAll.value = true;
7297
7618
  };
7298
7619
  return (_ctx, _cache) => {
7299
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$M, [
7300
- isFilterable.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$w, [
7620
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$G, [
7621
+ isFilterable.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$u, [
7301
7622
  vue.withDirectives(vue.createElementVNode("input", {
7302
7623
  class: "lupa-term-filter",
7303
7624
  "data-cy": "lupa-term-filter",
7304
7625
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
7305
7626
  placeholder: _ctx.options.labels.facetFilter
7306
- }, null, 8, _hoisted_3$m), [
7627
+ }, null, 8, _hoisted_3$l), [
7307
7628
  [vue.vModelText, termFilter.value]
7308
7629
  ])
7309
7630
  ])) : vue.createCommentVNode("", true),
7310
7631
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayValues.value, (item) => {
7311
- return vue.openBlock(), vue.createBlock(_sfc_main$Q, {
7632
+ return vue.openBlock(), vue.createBlock(_sfc_main$K, {
7312
7633
  key: item.title,
7313
7634
  options: _ctx.options,
7314
7635
  item,
@@ -7328,20 +7649,20 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
7328
7649
  };
7329
7650
  }
7330
7651
  });
7331
- const _hoisted_1$L = { class: "lupa-facet-label-text" };
7332
- const _hoisted_2$v = {
7652
+ const _hoisted_1$F = { class: "lupa-facet-label-text" };
7653
+ const _hoisted_2$t = {
7333
7654
  key: 0,
7334
7655
  class: "lupa-facet-content",
7335
7656
  "data-cy": "lupa-facet-content"
7336
7657
  };
7337
- const __default__$2 = {
7658
+ const __default__$1 = {
7338
7659
  components: {
7339
- TermFacet: _sfc_main$S,
7340
- StatsFacet: _sfc_main$R,
7341
- HierarchyFacet: _sfc_main$P
7660
+ TermFacet: _sfc_main$M,
7661
+ StatsFacet: _sfc_main$L,
7662
+ HierarchyFacet: _sfc_main$J
7342
7663
  }
7343
7664
  };
7344
- const _sfc_main$O = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
7665
+ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
7345
7666
  __name: "FacetDisplay",
7346
7667
  props: {
7347
7668
  options: {},
@@ -7453,12 +7774,12 @@ const _sfc_main$O = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
7453
7774
  "data-cy": "lupa-search-result-facet-label",
7454
7775
  onClick: toggleFacet
7455
7776
  }, [
7456
- vue.createElementVNode("div", _hoisted_1$L, vue.toDisplayString(facet.value.label), 1),
7777
+ vue.createElementVNode("div", _hoisted_1$F, vue.toDisplayString(facet.value.label), 1),
7457
7778
  vue.createElementVNode("div", {
7458
7779
  class: vue.normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
7459
7780
  }, null, 2)
7460
7781
  ], 2),
7461
- isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$v, [
7782
+ isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$t, [
7462
7783
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(facetType.value), {
7463
7784
  facet: facet.value,
7464
7785
  currentFilters: currentFilters.value[facet.value.key],
@@ -7476,12 +7797,12 @@ const _sfc_main$O = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
7476
7797
  };
7477
7798
  }
7478
7799
  }));
7479
- const _hoisted_1$K = { class: "lupa-search-result-facet-section" };
7480
- const _hoisted_2$u = {
7800
+ const _hoisted_1$E = { class: "lupa-search-result-facet-section" };
7801
+ const _hoisted_2$s = {
7481
7802
  key: 0,
7482
7803
  class: "lupa-facets-title"
7483
7804
  };
7484
- const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
7805
+ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
7485
7806
  __name: "FacetList",
7486
7807
  props: {
7487
7808
  options: {},
@@ -7515,14 +7836,14 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
7515
7836
  };
7516
7837
  return (_ctx, _cache) => {
7517
7838
  var _a;
7518
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$K, [
7519
- _ctx.options.labels.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$u, vue.toDisplayString(_ctx.options.labels.title), 1)) : vue.createCommentVNode("", true),
7839
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$E, [
7840
+ _ctx.options.labels.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$s, vue.toDisplayString(_ctx.options.labels.title), 1)) : vue.createCommentVNode("", true),
7520
7841
  vue.createElementVNode("div", {
7521
7842
  class: vue.normalizeClass(["lupa-search-result-facet-list", "lupa-" + ((_a = _ctx.facetStyle) != null ? _a : "")])
7522
7843
  }, [
7523
7844
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayFacets.value, (facet) => {
7524
7845
  var _a2;
7525
- return vue.openBlock(), vue.createBlock(_sfc_main$O, {
7846
+ return vue.openBlock(), vue.createBlock(_sfc_main$I, {
7526
7847
  key: facet.key,
7527
7848
  facet,
7528
7849
  currentFilters: currentFiltersValue.value,
@@ -7537,8 +7858,8 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
7537
7858
  };
7538
7859
  }
7539
7860
  });
7540
- const _hoisted_1$J = { class: "lupa-search-result-facets" };
7541
- const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
7861
+ const _hoisted_1$D = { class: "lupa-search-result-facets" };
7862
+ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
7542
7863
  __name: "Facets",
7543
7864
  props: {
7544
7865
  options: {},
@@ -7578,13 +7899,28 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
7578
7899
  const handleFacetSelect = (facetAction) => {
7579
7900
  switch (facetAction.type) {
7580
7901
  case "terms":
7581
- toggleTermFilter(paramStore.appendParams, facetAction, filters.value);
7902
+ toggleTermFilter(
7903
+ paramStore.appendParams,
7904
+ facetAction,
7905
+ optionsStore.getQueryParamName,
7906
+ filters.value
7907
+ );
7582
7908
  break;
7583
7909
  case "range":
7584
- toggleRangeFilter(paramStore.appendParams, facetAction, filters.value);
7910
+ toggleRangeFilter(
7911
+ paramStore.appendParams,
7912
+ facetAction,
7913
+ optionsStore.getQueryParamName,
7914
+ filters.value
7915
+ );
7585
7916
  break;
7586
7917
  case "hierarchy":
7587
- toggleHierarchyFilter(paramStore.appendParams, facetAction, filters.value);
7918
+ toggleHierarchyFilter(
7919
+ paramStore.appendParams,
7920
+ facetAction,
7921
+ optionsStore.getQueryParamName,
7922
+ filters.value
7923
+ );
7588
7924
  break;
7589
7925
  }
7590
7926
  if (scrollToResultsOptions.value.enabled) {
@@ -7599,8 +7935,8 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
7599
7935
  paramStore.removeParameters({ paramsToRemove: [param] });
7600
7936
  };
7601
7937
  return (_ctx, _cache) => {
7602
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$J, [
7603
- regularFacets.value ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
7938
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$D, [
7939
+ regularFacets.value ? (vue.openBlock(), vue.createBlock(_sfc_main$H, {
7604
7940
  key: 0,
7605
7941
  options: _ctx.options,
7606
7942
  facets: regularFacets.value,
@@ -7614,11 +7950,11 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
7614
7950
  };
7615
7951
  }
7616
7952
  });
7617
- const _hoisted_1$I = {
7953
+ const _hoisted_1$C = {
7618
7954
  id: "lupa-search-result-filters",
7619
7955
  class: "lupa-search-result-filters"
7620
7956
  };
7621
- const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
7957
+ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
7622
7958
  __name: "SearchResultsFilters",
7623
7959
  props: {
7624
7960
  options: {},
@@ -7647,19 +7983,19 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
7647
7983
  __expose({ fetch: fetch2 });
7648
7984
  return (_ctx, _cache) => {
7649
7985
  var _a;
7650
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$I, [
7651
- showCurrentFilters.value ? (vue.openBlock(), vue.createBlock(_sfc_main$V, {
7986
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$C, [
7987
+ showCurrentFilters.value ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
7652
7988
  key: 0,
7653
7989
  options: _ctx.options.currentFilters,
7654
7990
  expandable: (_a = _ctx.expandable) != null ? _a : false
7655
7991
  }, null, 8, ["options", "expandable"])) : vue.createCommentVNode("", true),
7656
- _ctx.options.categories ? (vue.openBlock(), vue.createBlock(_sfc_main$T, {
7992
+ _ctx.options.categories ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
7657
7993
  key: 1,
7658
7994
  options: _ctx.options.categories,
7659
7995
  ref_key: "categoryFilters",
7660
7996
  ref: categoryFilters
7661
7997
  }, null, 8, ["options"])) : vue.createCommentVNode("", true),
7662
- _ctx.options.facets ? (vue.openBlock(), vue.createBlock(_sfc_main$M, {
7998
+ _ctx.options.facets ? (vue.openBlock(), vue.createBlock(_sfc_main$G, {
7663
7999
  key: 2,
7664
8000
  options: _ctx.options.facets
7665
8001
  }, null, 8, ["options"])) : vue.createCommentVNode("", true)
@@ -7667,20 +8003,20 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
7667
8003
  };
7668
8004
  }
7669
8005
  });
7670
- const _hoisted_1$H = {
8006
+ const _hoisted_1$B = {
7671
8007
  key: 0,
7672
8008
  class: "lupa-mobile-filter-sidebar"
7673
8009
  };
7674
- const _hoisted_2$t = ["onClick"];
7675
- const _hoisted_3$l = { class: "lupa-mobile-sidebar-content" };
7676
- const _hoisted_4$g = { class: "lupa-sidebar-top" };
8010
+ const _hoisted_2$r = ["onClick"];
8011
+ const _hoisted_3$k = { class: "lupa-mobile-sidebar-content" };
8012
+ const _hoisted_4$f = { class: "lupa-sidebar-top" };
7677
8013
  const _hoisted_5$9 = { class: "lupa-sidebar-title" };
7678
8014
  const _hoisted_6$6 = {
7679
8015
  key: 0,
7680
8016
  class: "lupa-sidebar-filter-count"
7681
8017
  };
7682
8018
  const _hoisted_7$4 = { class: "lupa-sidebar-filter-options" };
7683
- const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
8019
+ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
7684
8020
  __name: "MobileFilterSidebar",
7685
8021
  props: {
7686
8022
  options: {}
@@ -7706,13 +8042,13 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
7706
8042
  searchResultStore.setSidebarState({ visible: false });
7707
8043
  };
7708
8044
  return (_ctx, _cache) => {
7709
- return isMobileSidebarVisible.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$H, [
8045
+ return isMobileSidebarVisible.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$B, [
7710
8046
  vue.createElementVNode("div", {
7711
8047
  class: "lupa-sidebar-close",
7712
8048
  onClick: vue.withModifiers(handleMobileToggle, ["stop"])
7713
- }, null, 8, _hoisted_2$t),
7714
- vue.createElementVNode("div", _hoisted_3$l, [
7715
- vue.createElementVNode("div", _hoisted_4$g, [
8049
+ }, null, 8, _hoisted_2$r),
8050
+ vue.createElementVNode("div", _hoisted_3$k, [
8051
+ vue.createElementVNode("div", _hoisted_4$f, [
7716
8052
  vue.createElementVNode("div", _hoisted_5$9, [
7717
8053
  vue.createTextVNode(vue.toDisplayString(sidebarTitle.value) + " ", 1),
7718
8054
  isFilterCountVisible.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$6, vue.toDisplayString(vue.unref(currentFilterCount)), 1)) : vue.createCommentVNode("", true)
@@ -7723,7 +8059,7 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
7723
8059
  })
7724
8060
  ]),
7725
8061
  vue.createElementVNode("div", _hoisted_7$4, [
7726
- vue.createVNode(_sfc_main$L, {
8062
+ vue.createVNode(_sfc_main$F, {
7727
8063
  options: _ctx.options,
7728
8064
  expandable: isActiveFiltersExpanded.value
7729
8065
  }, null, 8, ["options", "expandable"])
@@ -7733,14 +8069,14 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
7733
8069
  };
7734
8070
  }
7735
8071
  });
7736
- const _hoisted_1$G = { id: "lupa-search-results-breadcrumbs" };
7737
- const _hoisted_2$s = ["href", "onClick"];
7738
- const _hoisted_3$k = {
8072
+ const _hoisted_1$A = { id: "lupa-search-results-breadcrumbs" };
8073
+ const _hoisted_2$q = ["href", "onClick"];
8074
+ const _hoisted_3$j = {
7739
8075
  key: 1,
7740
8076
  class: "lupa-search-results-breadcrumb-text"
7741
8077
  };
7742
- const _hoisted_4$f = { key: 2 };
7743
- const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
8078
+ const _hoisted_4$e = { key: 2 };
8079
+ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
7744
8080
  __name: "SearchResultsBreadcrumbs",
7745
8081
  props: {
7746
8082
  breadcrumbs: {}
@@ -7765,7 +8101,7 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
7765
8101
  handleRoutingEvent(link, event, hasEventRouting.value);
7766
8102
  };
7767
8103
  return (_ctx, _cache) => {
7768
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$G, [
8104
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$A, [
7769
8105
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(breadcrumbsValue.value, (breadcrumb, index) => {
7770
8106
  return vue.openBlock(), vue.createElementBlock("span", {
7771
8107
  class: "lupa-search-results-breadcrumb",
@@ -7779,19 +8115,19 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
7779
8115
  var _a;
7780
8116
  return handleNavigation(e, (_a = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a : "");
7781
8117
  }
7782
- }, vue.toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$s)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$k, vue.toDisplayString(getLabel(breadcrumb.label)), 1)),
7783
- index < breadcrumbsValue.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$f, " / ")) : vue.createCommentVNode("", true)
8118
+ }, vue.toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$q)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$j, vue.toDisplayString(getLabel(breadcrumb.label)), 1)),
8119
+ index < breadcrumbsValue.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$e, " / ")) : vue.createCommentVNode("", true)
7784
8120
  ]);
7785
8121
  }), 128))
7786
8122
  ]);
7787
8123
  };
7788
8124
  }
7789
8125
  });
7790
- const _hoisted_1$F = {
8126
+ const _hoisted_1$z = {
7791
8127
  id: "lupa-search-result-filters",
7792
8128
  class: "lupa-search-result-filters"
7793
8129
  };
7794
- const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
8130
+ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
7795
8131
  __name: "FiltersTopDropdown",
7796
8132
  props: {
7797
8133
  options: {}
@@ -7799,8 +8135,8 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
7799
8135
  setup(__props) {
7800
8136
  return (_ctx, _cache) => {
7801
8137
  var _a;
7802
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$F, [
7803
- _ctx.options.facets ? (vue.openBlock(), vue.createBlock(_sfc_main$M, {
8138
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$z, [
8139
+ _ctx.options.facets ? (vue.openBlock(), vue.createBlock(_sfc_main$G, {
7804
8140
  key: 0,
7805
8141
  options: _ctx.options.facets,
7806
8142
  "facet-style": (_a = _ctx.options.facets.style) == null ? void 0 : _a.type,
@@ -7810,8 +8146,8 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
7810
8146
  };
7811
8147
  }
7812
8148
  });
7813
- const _hoisted_1$E = { id: "lupa-search-results-layout-selection" };
7814
- const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
8149
+ const _hoisted_1$y = { id: "lupa-search-results-layout-selection" };
8150
+ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
7815
8151
  __name: "SearchResultsLayoutSelection",
7816
8152
  setup(__props) {
7817
8153
  const searchResultStore = useSearchResultStore();
@@ -7822,7 +8158,7 @@ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
7822
8158
  searchResultStore.setLayout(layout2);
7823
8159
  };
7824
8160
  return (_ctx, _cache) => {
7825
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$E, [
8161
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$y, [
7826
8162
  vue.createElementVNode("div", {
7827
8163
  class: vue.normalizeClass([
7828
8164
  "lupa-layout-selection-grid",
@@ -7844,11 +8180,11 @@ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
7844
8180
  };
7845
8181
  }
7846
8182
  });
7847
- const _hoisted_1$D = {
8183
+ const _hoisted_1$x = {
7848
8184
  key: 0,
7849
8185
  class: "lupa-mobile-toggle-filter-count"
7850
8186
  };
7851
- const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
8187
+ const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
7852
8188
  __name: "SearchResultsMobileToggle",
7853
8189
  props: {
7854
8190
  label: {},
@@ -7866,26 +8202,26 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
7866
8202
  onClick: handleMobileToggle
7867
8203
  }, [
7868
8204
  vue.createTextVNode(vue.toDisplayString(_ctx.label) + " ", 1),
7869
- _ctx.showFilterCount && vue.unref(currentFilterCount) > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$D, vue.toDisplayString(vue.unref(currentFilterCount)), 1)) : vue.createCommentVNode("", true)
8205
+ _ctx.showFilterCount && vue.unref(currentFilterCount) > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$x, vue.toDisplayString(vue.unref(currentFilterCount)), 1)) : vue.createCommentVNode("", true)
7870
8206
  ], 2);
7871
8207
  };
7872
8208
  }
7873
8209
  });
7874
- const _hoisted_1$C = {
8210
+ const _hoisted_1$w = {
7875
8211
  key: 0,
7876
8212
  id: "lupa-search-results-page-select",
7877
8213
  "data-cy": "lupa-search-results-page-select"
7878
8214
  };
7879
- const _hoisted_2$r = {
8215
+ const _hoisted_2$p = {
7880
8216
  key: 0,
7881
8217
  class: "lupa-page-number-separator"
7882
8218
  };
7883
- const _hoisted_3$j = ["onClick"];
7884
- const _hoisted_4$e = {
8219
+ const _hoisted_3$i = ["onClick"];
8220
+ const _hoisted_4$d = {
7885
8221
  key: 0,
7886
8222
  class: "lupa-page-number-separator"
7887
8223
  };
7888
- const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
8224
+ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
7889
8225
  __name: "SearchResultsPageSelect",
7890
8226
  props: {
7891
8227
  lastPageLabel: {},
@@ -7951,7 +8287,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
7951
8287
  const handlePageChange = (page) => {
7952
8288
  if (page > 0) {
7953
8289
  paramStore.appendParams({
7954
- params: [{ name: QUERY_PARAMS.PAGE, value: page.toString() }]
8290
+ params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS.PAGE), value: page.toString() }]
7955
8291
  });
7956
8292
  if (scrollToResultsOptions.value.enabled) {
7957
8293
  scrollToSearchResults(
@@ -7962,7 +8298,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
7962
8298
  }
7963
8299
  };
7964
8300
  return (_ctx, _cache) => {
7965
- return showPagination.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$C, [
8301
+ return showPagination.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$w, [
7966
8302
  showBack.value ? (vue.openBlock(), vue.createElementBlock("div", {
7967
8303
  key: 0,
7968
8304
  class: vue.normalizeClass(firstPageLabel.value === "<" ? "lupa-page-arrow" : "lupa-show-less"),
@@ -7973,7 +8309,7 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
7973
8309
  class: "lupa-page-number lupa-page-number-first",
7974
8310
  onClick: _cache[1] || (_cache[1] = () => handlePageChange(1))
7975
8311
  }, " 1 "),
7976
- showFirstPageSeparator.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$r, "...")) : vue.createCommentVNode("", true)
8312
+ showFirstPageSeparator.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$p, "...")) : vue.createCommentVNode("", true)
7977
8313
  ], 64)) : vue.createCommentVNode("", true),
7978
8314
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(pages.value, (page) => {
7979
8315
  return vue.openBlock(), vue.createElementBlock("div", {
@@ -7984,10 +8320,10 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
7984
8320
  page === _ctx.options.selectedPage ? "lupa-page-number-selected" : ""
7985
8321
  ]),
7986
8322
  "data-cy": "lupa-page-number"
7987
- }, vue.toDisplayString(page), 11, _hoisted_3$j);
8323
+ }, vue.toDisplayString(page), 11, _hoisted_3$i);
7988
8324
  }), 128)),
7989
8325
  showLastPage.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
7990
- showLastPageSeparator.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$e, "...")) : vue.createCommentVNode("", true),
8326
+ showLastPageSeparator.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$d, "...")) : vue.createCommentVNode("", true),
7991
8327
  vue.createElementVNode("div", {
7992
8328
  class: "lupa-page-number lupa-page-number-last",
7993
8329
  onClick: _cache[2] || (_cache[2] = () => {
@@ -8006,14 +8342,14 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
8006
8342
  };
8007
8343
  }
8008
8344
  });
8009
- const _hoisted_1$B = {
8345
+ const _hoisted_1$v = {
8010
8346
  id: "lupa-search-results-page-size",
8011
8347
  "data-cy": "lupa-search-results-page-size"
8012
8348
  };
8013
- const _hoisted_2$q = { id: "lupa-select" };
8014
- const _hoisted_3$i = { class: "lupa-select-label" };
8015
- const _hoisted_4$d = ["aria-label"];
8016
- const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
8349
+ const _hoisted_2$o = { id: "lupa-select" };
8350
+ const _hoisted_3$h = { class: "lupa-select-label" };
8351
+ const _hoisted_4$c = ["aria-label"];
8352
+ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
8017
8353
  __name: "SearchResultsPageSize",
8018
8354
  props: {
8019
8355
  label: {},
@@ -8021,18 +8357,19 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
8021
8357
  },
8022
8358
  setup(__props) {
8023
8359
  const paramsStore = useParamsStore();
8360
+ const optionsStore = useOptionsStore();
8024
8361
  const select = vue.ref(null);
8025
8362
  const handleSelect = (e) => {
8026
8363
  const value = e.target.value;
8027
8364
  paramsStore.appendParams({
8028
- params: [{ name: QUERY_PARAMS.LIMIT, value }],
8029
- paramsToRemove: [QUERY_PARAMS.PAGE]
8365
+ params: [{ name: optionsStore.getQueryParamName(QUERY_PARAMS.LIMIT), value }],
8366
+ paramsToRemove: [optionsStore.getQueryParamName(QUERY_PARAMS.PAGE)]
8030
8367
  });
8031
8368
  };
8032
8369
  return (_ctx, _cache) => {
8033
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$B, [
8034
- vue.createElementVNode("div", _hoisted_2$q, [
8035
- vue.createElementVNode("label", _hoisted_3$i, vue.toDisplayString(_ctx.label), 1),
8370
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$v, [
8371
+ vue.createElementVNode("div", _hoisted_2$o, [
8372
+ vue.createElementVNode("label", _hoisted_3$h, vue.toDisplayString(_ctx.label), 1),
8036
8373
  vue.createElementVNode("select", {
8037
8374
  class: "lupa-select-dropdown",
8038
8375
  "aria-label": _ctx.label,
@@ -8044,21 +8381,21 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
8044
8381
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options.sizes, (option) => {
8045
8382
  return vue.openBlock(), vue.createElementBlock("option", { key: option }, vue.toDisplayString(option), 1);
8046
8383
  }), 128))
8047
- ], 40, _hoisted_4$d)
8384
+ ], 40, _hoisted_4$c)
8048
8385
  ])
8049
8386
  ]);
8050
8387
  };
8051
8388
  }
8052
8389
  });
8053
- const _hoisted_1$A = {
8390
+ const _hoisted_1$u = {
8054
8391
  id: "lupa-search-results-sort",
8055
8392
  class: "lupa-search-results-sort"
8056
8393
  };
8057
- const _hoisted_2$p = { id: "lupa-select" };
8058
- const _hoisted_3$h = { class: "lupa-select-label" };
8059
- const _hoisted_4$c = ["aria-label"];
8394
+ const _hoisted_2$n = { id: "lupa-select" };
8395
+ const _hoisted_3$g = { class: "lupa-select-label" };
8396
+ const _hoisted_4$b = ["aria-label"];
8060
8397
  const _hoisted_5$8 = ["value"];
8061
- const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
8398
+ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
8062
8399
  __name: "SearchResultsSort",
8063
8400
  props: {
8064
8401
  options: {},
@@ -8067,6 +8404,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
8067
8404
  setup(__props) {
8068
8405
  const props = __props;
8069
8406
  const paramStore = useParamsStore();
8407
+ const optionStore = useOptionsStore();
8070
8408
  const { sort } = storeToRefs(paramStore);
8071
8409
  const selectedKey = vue.ref("");
8072
8410
  const previousKey = vue.ref("");
@@ -8100,15 +8438,15 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
8100
8438
  paramStore.setSortSettings({ selectedSortKey: value, previousSortKey: previousKey.value });
8101
8439
  (_c = (_b = props.callbacks) == null ? void 0 : _b.onSortChange) == null ? void 0 : _c.call(_b, { selectedSortKey: value, previousSortKey: previousKey.value });
8102
8440
  paramStore.appendParams({
8103
- params: [{ name: QUERY_PARAMS.SORT, value }],
8104
- paramsToRemove: [QUERY_PARAMS.PAGE]
8441
+ params: [{ name: optionStore.getQueryParamName(QUERY_PARAMS.SORT), value }],
8442
+ paramsToRemove: [optionStore.getQueryParamName(QUERY_PARAMS.PAGE)]
8105
8443
  });
8106
8444
  previousKey.value = selectedKey.value;
8107
8445
  };
8108
8446
  return (_ctx, _cache) => {
8109
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$A, [
8110
- vue.createElementVNode("div", _hoisted_2$p, [
8111
- vue.createElementVNode("label", _hoisted_3$h, vue.toDisplayString(_ctx.options.label), 1),
8447
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$u, [
8448
+ vue.createElementVNode("div", _hoisted_2$n, [
8449
+ vue.createElementVNode("label", _hoisted_3$g, vue.toDisplayString(_ctx.options.label), 1),
8112
8450
  vue.withDirectives(vue.createElementVNode("select", {
8113
8451
  class: "lupa-select-dropdown",
8114
8452
  "aria-label": _ctx.options.label,
@@ -8123,7 +8461,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
8123
8461
  value: option.key
8124
8462
  }, vue.toDisplayString(option.label), 9, _hoisted_5$8);
8125
8463
  }), 128))
8126
- ], 40, _hoisted_4$c), [
8464
+ ], 40, _hoisted_4$b), [
8127
8465
  [vue.vModelSelect, selectedKey.value]
8128
8466
  ])
8129
8467
  ])
@@ -8131,14 +8469,14 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
8131
8469
  };
8132
8470
  }
8133
8471
  });
8134
- const _hoisted_1$z = { class: "lupa-toolbar-left" };
8135
- const _hoisted_2$o = { key: 1 };
8136
- const _hoisted_3$g = { key: 3 };
8137
- const _hoisted_4$b = { key: 5 };
8472
+ const _hoisted_1$t = { class: "lupa-toolbar-left" };
8473
+ const _hoisted_2$m = { key: 1 };
8474
+ const _hoisted_3$f = { key: 3 };
8475
+ const _hoisted_4$a = { key: 5 };
8138
8476
  const _hoisted_5$7 = { class: "lupa-toolbar-right" };
8139
8477
  const _hoisted_6$5 = { key: 1 };
8140
8478
  const _hoisted_7$3 = { key: 3 };
8141
- const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
8479
+ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
8142
8480
  __name: "SearchResultsToolbar",
8143
8481
  props: {
8144
8482
  options: {},
@@ -8237,32 +8575,32 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
8237
8575
  id: "lupa-search-results-toolbar",
8238
8576
  class: vue.normalizeClass({ "lupa-filter-no-results": !hasResults.value })
8239
8577
  }, [
8240
- vue.createElementVNode("div", _hoisted_1$z, [
8241
- showLayoutSelection.value ? (vue.openBlock(), vue.createBlock(_sfc_main$H, { key: 0 })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$o)),
8242
- showItemSummary.value ? (vue.openBlock(), vue.createBlock(_sfc_main$Y, {
8578
+ vue.createElementVNode("div", _hoisted_1$t, [
8579
+ showLayoutSelection.value ? (vue.openBlock(), vue.createBlock(_sfc_main$B, { key: 0 })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$m)),
8580
+ showItemSummary.value ? (vue.openBlock(), vue.createBlock(_sfc_main$S, {
8243
8581
  key: 2,
8244
8582
  label: searchSummaryLabel.value,
8245
8583
  clearable: vue.unref(hasAnyFilter) && showFilterClear.value,
8246
8584
  onClear: handleClearAll
8247
- }, null, 8, ["label", "clearable"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$g)),
8248
- displayPageSelect.value ? (vue.openBlock(), vue.createBlock(_sfc_main$F, {
8585
+ }, null, 8, ["label", "clearable"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$f)),
8586
+ displayPageSelect.value ? (vue.openBlock(), vue.createBlock(_sfc_main$z, {
8249
8587
  key: 4,
8250
8588
  options: paginationOptions.value.pageSelect,
8251
8589
  "last-page-label": paginationOptions.value.labels.showMore,
8252
8590
  "first-page-label": paginationOptions.value.labels.showLess
8253
- }, null, 8, ["options", "last-page-label", "first-page-label"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$b))
8591
+ }, null, 8, ["options", "last-page-label", "first-page-label"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$a))
8254
8592
  ]),
8255
8593
  vue.createElementVNode("div", _hoisted_5$7, [
8256
- vue.createVNode(_sfc_main$G, {
8594
+ vue.createVNode(_sfc_main$A, {
8257
8595
  label: optionsValue.value.labels.mobileFilterButton,
8258
8596
  "show-filter-count": showMobileFilterCount.value
8259
8597
  }, null, 8, ["label", "show-filter-count"]),
8260
- paginationDisplay.value.pageSize ? (vue.openBlock(), vue.createBlock(_sfc_main$E, {
8598
+ paginationDisplay.value.pageSize ? (vue.openBlock(), vue.createBlock(_sfc_main$y, {
8261
8599
  key: 0,
8262
8600
  options: paginationOptions.value.pageSize,
8263
8601
  label: paginationOptions.value.labels.pageSize
8264
8602
  }, null, 8, ["options", "label"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$5)),
8265
- sortOptions.value ? (vue.openBlock(), vue.createBlock(_sfc_main$D, {
8603
+ sortOptions.value ? (vue.openBlock(), vue.createBlock(_sfc_main$x, {
8266
8604
  key: 2,
8267
8605
  options: sortOptions.value,
8268
8606
  callbacks: callbacks.value
@@ -8272,259 +8610,6 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
8272
8610
  };
8273
8611
  }
8274
8612
  });
8275
- const _hoisted_1$y = { class: "lupa-badge-title" };
8276
- const _hoisted_2$n = ["src"];
8277
- const _hoisted_3$f = { key: 1 };
8278
- const _hoisted_4$a = {
8279
- key: 0,
8280
- class: "lupa-badge-full-text"
8281
- };
8282
- const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
8283
- __name: "SearchResultGeneratedBadge",
8284
- props: {
8285
- options: {},
8286
- badge: {}
8287
- },
8288
- setup(__props) {
8289
- const props = __props;
8290
- const image = vue.computed(() => {
8291
- var _a, _b, _c;
8292
- return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.image) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : "";
8293
- });
8294
- const showTitle = vue.computed(() => {
8295
- var _a, _b, _c;
8296
- return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.showTitle) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : true;
8297
- });
8298
- const hasAdditionalText = vue.computed(() => {
8299
- var _a, _b;
8300
- return Boolean((_a = props.badge) == null ? void 0 : _a.additionalText) && typeof ((_b = props.badge) == null ? void 0 : _b.additionalText) === "string";
8301
- });
8302
- const hasTitleText = vue.computed(() => {
8303
- var _a, _b;
8304
- return Boolean((_a = props.badge) == null ? void 0 : _a.titleText) && typeof ((_b = props.badge) == null ? void 0 : _b.titleText) === "string";
8305
- });
8306
- const customClassName = vue.computed(() => {
8307
- var _a, _b, _c;
8308
- return (_c = (_b = (_a = props.options.generate) == null ? void 0 : _a.customClass) == null ? void 0 : _b.call(_a, props.badge)) != null ? _c : "";
8309
- });
8310
- return (_ctx, _cache) => {
8311
- return vue.openBlock(), vue.createElementBlock("div", {
8312
- class: vue.normalizeClass(["lupa-dynamic-badge", customClassName.value]),
8313
- style: vue.normalizeStyle({ background: _ctx.badge.backgroundColor, color: _ctx.badge.color })
8314
- }, [
8315
- vue.createElementVNode("span", _hoisted_1$y, [
8316
- image.value ? (vue.openBlock(), vue.createElementBlock("img", {
8317
- key: 0,
8318
- src: image.value
8319
- }, null, 8, _hoisted_2$n)) : vue.createCommentVNode("", true),
8320
- hasTitleText.value && showTitle.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$f, vue.toDisplayString(_ctx.badge.titleText), 1)) : vue.createCommentVNode("", true)
8321
- ]),
8322
- hasAdditionalText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$a, vue.toDisplayString(_ctx.badge.additionalText), 1)) : vue.createCommentVNode("", true)
8323
- ], 6);
8324
- };
8325
- }
8326
- });
8327
- const _hoisted_1$x = { class: "lupa-generated-badges" };
8328
- const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
8329
- __name: "SearchResultGeneratedBadges",
8330
- props: {
8331
- options: {}
8332
- },
8333
- setup(__props) {
8334
- const props = __props;
8335
- const badgeField = vue.computed(() => {
8336
- var _a, _b, _c, _d, _e, _f, _g;
8337
- const fieldHasBadges = ((_a = props.options.generate) == null ? void 0 : _a.key) && props.options.product[(_c = (_b = props.options.generate) == null ? void 0 : _b.key) != null ? _c : ""] && Array.isArray(props.options.product[(_e = (_d = props.options.generate) == null ? void 0 : _d.key) != null ? _e : ""]);
8338
- return fieldHasBadges ? props.options.product[(_g = (_f = props.options.generate) == null ? void 0 : _f.key) != null ? _g : ""] : [];
8339
- });
8340
- const keyMap = vue.computed(() => {
8341
- var _a, _b;
8342
- return (_b = (_a = props.options.generate) == null ? void 0 : _a.keyMap) != null ? _b : {};
8343
- });
8344
- const badges = vue.computed(() => {
8345
- return badgeField.value.filter((f2) => Boolean(f2)).map((f2) => ({
8346
- backgroundColor: keyMap.value.backgroundColor ? f2[keyMap.value.backgroundColor] : void 0,
8347
- color: keyMap.value.color ? f2[keyMap.value.color] : void 0,
8348
- titleText: keyMap.value.titleText ? f2[keyMap.value.titleText] : void 0,
8349
- additionalText: keyMap.value.additionalText ? f2[keyMap.value.additionalText] : void 0,
8350
- id: keyMap.value.id ? f2[keyMap.value.id] : void 0
8351
- })).filter((b) => Boolean(b.id));
8352
- });
8353
- return (_ctx, _cache) => {
8354
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$x, [
8355
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(badges.value, (badge) => {
8356
- return vue.openBlock(), vue.createBlock(_sfc_main$B, {
8357
- key: badge.id,
8358
- badge,
8359
- options: _ctx.options
8360
- }, null, 8, ["badge", "options"]);
8361
- }), 128))
8362
- ]);
8363
- };
8364
- }
8365
- });
8366
- const _hoisted_1$w = ["innerHTML"];
8367
- const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
8368
- __name: "CustomBadge",
8369
- props: {
8370
- badge: {}
8371
- },
8372
- setup(__props) {
8373
- const props = __props;
8374
- const text = vue.computed(() => {
8375
- var _a, _b, _c;
8376
- return (_c = (_b = props.badge).html) == null ? void 0 : _c.call(_b, (_a = props.badge.product) != null ? _a : {});
8377
- });
8378
- const className = vue.computed(() => {
8379
- var _a;
8380
- return (_a = props.badge.className) != null ? _a : "";
8381
- });
8382
- return (_ctx, _cache) => {
8383
- return vue.openBlock(), vue.createElementBlock("div", {
8384
- class: vue.normalizeClass(className.value),
8385
- innerHTML: text.value
8386
- }, null, 10, _hoisted_1$w);
8387
- };
8388
- }
8389
- });
8390
- const _hoisted_1$v = { class: "lupa-text-badges" };
8391
- const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
8392
- __name: "TextBadge",
8393
- props: {
8394
- badge: {}
8395
- },
8396
- setup(__props) {
8397
- const props = __props;
8398
- const badges = vue.computed(() => {
8399
- var _a, _b;
8400
- return (_b = (_a = props.badge) == null ? void 0 : _a.value) != null ? _b : [];
8401
- });
8402
- const displayBadges = vue.computed(() => {
8403
- return badges.value.slice(0, props.badge.maxItems);
8404
- });
8405
- return (_ctx, _cache) => {
8406
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$v, [
8407
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayBadges.value, (item) => {
8408
- return vue.openBlock(), vue.createElementBlock("div", {
8409
- class: "lupa-badge lupa-text-badge",
8410
- key: item
8411
- }, vue.toDisplayString(_ctx.badge.prefix) + vue.toDisplayString(item), 1);
8412
- }), 128))
8413
- ]);
8414
- };
8415
- }
8416
- });
8417
- const _hoisted_1$u = { class: "lupa-image-badges" };
8418
- const _hoisted_2$m = ["src"];
8419
- const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
8420
- __name: "ImageBadge",
8421
- props: {
8422
- badge: {}
8423
- },
8424
- setup(__props) {
8425
- const props = __props;
8426
- const badges = vue.computed(() => {
8427
- return props.badge.value;
8428
- });
8429
- const displayBadges = vue.computed(() => {
8430
- return badges.value.slice(0, props.badge.maxItems);
8431
- });
8432
- const getImageUrl = (src) => {
8433
- if (!props.badge.rootImageUrl) {
8434
- return src;
8435
- }
8436
- return `${props.badge.rootImageUrl}${src}`;
8437
- };
8438
- return (_ctx, _cache) => {
8439
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$u, [
8440
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayBadges.value, (item) => {
8441
- return vue.openBlock(), vue.createElementBlock("div", {
8442
- class: "lupa-badge lupa-image-badge",
8443
- key: item
8444
- }, [
8445
- vue.createElementVNode("img", {
8446
- src: getImageUrl(item)
8447
- }, null, 8, _hoisted_2$m)
8448
- ]);
8449
- }), 128))
8450
- ]);
8451
- };
8452
- }
8453
- });
8454
- const _hoisted_1$t = { id: "lupa-search-results-badges" };
8455
- const __default__$1 = {
8456
- components: {
8457
- CustomBadge: _sfc_main$z,
8458
- TextBadge: _sfc_main$y,
8459
- ImageBadge: _sfc_main$x
8460
- }
8461
- };
8462
- const _sfc_main$w = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
8463
- __name: "SearchResultsBadgeWrapper",
8464
- props: {
8465
- position: {},
8466
- options: {}
8467
- },
8468
- setup(__props) {
8469
- const props = __props;
8470
- const positionValue = vue.computed(() => {
8471
- var _a;
8472
- return (_a = props.position) != null ? _a : "card";
8473
- });
8474
- const anchorPosition = vue.computed(() => {
8475
- return props.options.anchor;
8476
- });
8477
- const badges = vue.computed(() => {
8478
- if (!props.options.elements) {
8479
- return [];
8480
- }
8481
- return props.options.elements.filter((e) => {
8482
- var _a;
8483
- return !e.display || e.display((_a = props.options.product) != null ? _a : {});
8484
- }).map((x) => {
8485
- var _a;
8486
- return __spreadProps(__spreadValues({}, x), {
8487
- value: ((_a = props.options.product) == null ? void 0 : _a[x.key]) || "badge",
8488
- product: props.options.product
8489
- });
8490
- });
8491
- });
8492
- const displayBadges = vue.computed(() => {
8493
- return positionValue.value === "card" ? badges.value.filter((b) => !b.position || b.position === "card") : badges.value.filter((b) => b.position === "image");
8494
- });
8495
- const getBadgeComponent = (type) => {
8496
- switch (type) {
8497
- case BadgeType.TEXT:
8498
- return "TextBadge";
8499
- case BadgeType.IMAGE:
8500
- return "ImageBadge";
8501
- case BadgeType.CUSTOM_HTML:
8502
- return "CustomBadge";
8503
- default:
8504
- return "CustomBadge";
8505
- }
8506
- };
8507
- return (_ctx, _cache) => {
8508
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t, [
8509
- vue.createElementVNode("div", {
8510
- id: "lupa-badges",
8511
- class: vue.normalizeClass(anchorPosition.value)
8512
- }, [
8513
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayBadges.value, (badge, index) => {
8514
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getBadgeComponent(badge.type)), {
8515
- key: index,
8516
- badge
8517
- }, null, 8, ["badge"]);
8518
- }), 128)),
8519
- positionValue.value === "card" ? (vue.openBlock(), vue.createBlock(_sfc_main$A, {
8520
- key: 0,
8521
- options: _ctx.options
8522
- }, null, 8, ["options"])) : vue.createCommentVNode("", true)
8523
- ], 2)
8524
- ]);
8525
- };
8526
- }
8527
- }));
8528
8613
  const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
8529
8614
  __name: "SearchResultsProductImage",
8530
8615
  props: {
@@ -8959,7 +9044,7 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
8959
9044
  setup(__props, { emit }) {
8960
9045
  const props = __props;
8961
9046
  const dynamicDataStore = useDynamicDataStore();
8962
- const { dynamicDataIdMap, loading } = storeToRefs(dynamicDataStore);
9047
+ const { dynamicDataIdMap, loadingIds, loading } = storeToRefs(dynamicDataStore);
8963
9048
  const elementComponent = vue.computed(() => {
8964
9049
  switch (props.element.type) {
8965
9050
  case DocumentElementType.IMAGE:
@@ -8985,9 +9070,6 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
8985
9070
  }
8986
9071
  return "searchResultsProductTitle";
8987
9072
  });
8988
- const isLoadingDynamicData = vue.computed(() => {
8989
- return Boolean(props.element.dynamic && loading.value);
8990
- });
8991
9073
  const enhancedItem = vue.computed(() => {
8992
9074
  var _a, _b, _c, _d;
8993
9075
  if (!((_a = props.item) == null ? void 0 : _a.id)) {
@@ -9002,7 +9084,11 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
9002
9084
  const handleProductEvent = (item) => {
9003
9085
  emit("productEvent", item);
9004
9086
  };
9087
+ const isLoadingDynamicData = (id) => {
9088
+ return Boolean(props.element.dynamic && id && loading.value && (loadingIds == null ? void 0 : loadingIds.value[id]));
9089
+ };
9005
9090
  return (_ctx, _cache) => {
9091
+ var _a;
9006
9092
  return displayElement.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(elementComponent.value), {
9007
9093
  key: 0,
9008
9094
  item: enhancedItem.value,
@@ -9010,7 +9096,7 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadVa
9010
9096
  labels: _ctx.labels,
9011
9097
  inStock: _ctx.inStock,
9012
9098
  link: _ctx.link,
9013
- class: vue.normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData.value }),
9099
+ class: vue.normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData((_a = _ctx.item) == null ? void 0 : _a.id) }),
9014
9100
  onProductEvent: handleProductEvent
9015
9101
  }, null, 40, ["item", "options", "labels", "inStock", "link", "class"])) : vue.createCommentVNode("", true);
9016
9102
  };
@@ -9170,7 +9256,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
9170
9256
  "data-cy": "lupa-search-result-product-card",
9171
9257
  class: ["lupa-search-result-product-card", !isInStock.value ? "lupa-out-of-stock" : ""]
9172
9258
  }, customDocumentHtmlAttributes.value, { onClick: handleClick }), [
9173
- vue.createVNode(_sfc_main$w, { options: badgesOptions.value }, null, 8, ["options"]),
9259
+ vue.createVNode(_sfc_main$_, { options: badgesOptions.value }, null, 8, ["options"]),
9174
9260
  vue.createElementVNode("div", {
9175
9261
  class: vue.normalizeClass(["lupa-search-result-product-contents", listLayoutClass.value])
9176
9262
  }, [
@@ -9190,7 +9276,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
9190
9276
  link: link.value
9191
9277
  }, null, 8, ["item", "element", "labels", "inStock", "link"]);
9192
9278
  }), 128)),
9193
- vue.createVNode(_sfc_main$w, {
9279
+ vue.createVNode(_sfc_main$_, {
9194
9280
  options: badgesOptions.value,
9195
9281
  position: "image",
9196
9282
  class: "lupa-image-badges"
@@ -9537,7 +9623,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9537
9623
  const props = __props;
9538
9624
  const searchResultStore = useSearchResultStore();
9539
9625
  const paramStore = useParamsStore();
9540
- useOptionsStore();
9626
+ const optionStore = useOptionsStore();
9541
9627
  const {
9542
9628
  hasResults,
9543
9629
  currentQueryText,
@@ -9621,7 +9707,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9621
9707
  };
9622
9708
  const goToFirstPage = () => {
9623
9709
  paramStore.appendParams({
9624
- params: [{ name: QUERY_PARAMS.PAGE, value: "1" }]
9710
+ params: [{ name: optionStore.getQueryParamName(QUERY_PARAMS.PAGE), value: "1" }]
9625
9711
  });
9626
9712
  };
9627
9713
  return (_ctx, _cache) => {
@@ -9632,17 +9718,17 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9632
9718
  class: "lupa-loader"
9633
9719
  })) : vue.createCommentVNode("", true),
9634
9720
  vue.unref(hasResults) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
9635
- showTopFilters.value ? (vue.openBlock(), vue.createBlock(_sfc_main$I, {
9721
+ showTopFilters.value ? (vue.openBlock(), vue.createBlock(_sfc_main$C, {
9636
9722
  key: 0,
9637
9723
  options: (_a = _ctx.options.filters) != null ? _a : {}
9638
9724
  }, null, 8, ["options"])) : vue.createCommentVNode("", true),
9639
- showMobileFilters.value ? (vue.openBlock(), vue.createBlock(_sfc_main$C, {
9725
+ showMobileFilters.value ? (vue.openBlock(), vue.createBlock(_sfc_main$w, {
9640
9726
  key: 1,
9641
9727
  class: "lupa-toolbar-mobile",
9642
9728
  options: _ctx.options,
9643
9729
  "pagination-location": "top"
9644
9730
  }, null, 8, ["options"])) : vue.createCommentVNode("", true),
9645
- currentFilterOptions.value ? (vue.openBlock(), vue.createBlock(_sfc_main$V, {
9731
+ currentFilterOptions.value ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
9646
9732
  key: 2,
9647
9733
  class: vue.normalizeClass(currentFiltersClass.value),
9648
9734
  "data-cy": "lupa-search-result-filters-mobile-toolbar",
@@ -9656,7 +9742,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9656
9742
  sdkOptions: _ctx.options.options
9657
9743
  }, null, 8, ["options", "sdkOptions"]),
9658
9744
  vue.unref(hasResults) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
9659
- vue.createVNode(_sfc_main$C, {
9745
+ vue.createVNode(_sfc_main$w, {
9660
9746
  class: "lupa-toolbar-top",
9661
9747
  options: _ctx.options,
9662
9748
  "pagination-location": "top"
@@ -9686,7 +9772,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
9686
9772
  onClick: goToFirstPage
9687
9773
  }, vue.toDisplayString(_ctx.options.labels.backToFirstPage), 1)) : vue.createCommentVNode("", true)
9688
9774
  ])) : vue.createCommentVNode("", true),
9689
- vue.createVNode(_sfc_main$C, {
9775
+ vue.createVNode(_sfc_main$w, {
9690
9776
  class: "lupa-toolbar-bottom",
9691
9777
  options: _ctx.options,
9692
9778
  "pagination-location": "bottom"
@@ -9765,7 +9851,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
9765
9851
  onClick: handleNavigationBack
9766
9852
  }, vue.toDisplayString(backTitle.value), 9, _hoisted_3$5)
9767
9853
  ])) : vue.createCommentVNode("", true),
9768
- vue.createVNode(_sfc_main$C, {
9854
+ vue.createVNode(_sfc_main$w, {
9769
9855
  class: "lupa-toolbar-mobile",
9770
9856
  "pagination-location": "top",
9771
9857
  options: _ctx.options
@@ -9827,7 +9913,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
9827
9913
  const handlePopState = () => {
9828
9914
  var _a;
9829
9915
  const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url);
9830
- paramStore.add(parseParams(searchParams));
9916
+ paramStore.add(parseParams(optionStore.getQueryParamName, searchParams));
9831
9917
  };
9832
9918
  vue.onMounted(() => __async(this, null, function* () {
9833
9919
  var _a, _b;
@@ -9927,7 +10013,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
9927
10013
  var _a;
9928
10014
  const searchParams = getSearchParams((_a = props.options.ssr) == null ? void 0 : _a.url, params);
9929
10015
  const publicQuery = createPublicQuery(
9930
- parseParams(searchParams),
10016
+ parseParams(optionStore.getQueryParamName, searchParams),
9931
10017
  props.options.sort,
9932
10018
  defaultSearchResultPageSize.value
9933
10019
  );
@@ -9947,10 +10033,10 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
9947
10033
  }
9948
10034
  }
9949
10035
  const params = new URLSearchParams(window.location.search);
9950
- if (!params.has(QUERY_PARAMS.QUERY) && !props.initialData) {
10036
+ if (!params.has(optionStore.getQueryParamName(QUERY_PARAMS.QUERY)) && !props.initialData) {
9951
10037
  handleUrlChange(params);
9952
10038
  }
9953
- paramStore.add(parseParams(params));
10039
+ paramStore.add(parseParams(optionStore.getQueryParamName, params));
9954
10040
  paramStore.setDefaultLimit(defaultSearchResultPageSize.value);
9955
10041
  };
9956
10042
  vue.watch(searchString, () => handleParamsChange());
@@ -9984,7 +10070,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
9984
10070
  );
9985
10071
  optionStore.setSearchResultOptions({ options: props.options });
9986
10072
  searchResultStore.add(__spreadValues({}, initialData));
9987
- paramStore.add(parseParams(searchParams), props.options.ssr);
10073
+ paramStore.add(parseParams(optionStore.getQueryParamName, searchParams), props.options.ssr);
9988
10074
  paramStore.setDefaultLimit(defaultSearchResultPageSize.value);
9989
10075
  handleResults({ queryKey: props.options.queryKey, results: initialData });
9990
10076
  }
@@ -9997,8 +10083,8 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
9997
10083
  class: vue.normalizeClass(["lupa-search-result-wrapper", { "lupa-search-wrapper-no-results": !vue.unref(hasResults) }])
9998
10084
  }, [
9999
10085
  _ctx.isContainer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
10000
- vue.createVNode(_sfc_main$Z, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
10001
- vue.createVNode(_sfc_main$X, {
10086
+ vue.createVNode(_sfc_main$T, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
10087
+ vue.createVNode(_sfc_main$R, {
10002
10088
  "show-summary": true,
10003
10089
  options: _ctx.options,
10004
10090
  "is-product-list": (_a = _ctx.isProductList) != null ? _a : false
@@ -10008,24 +10094,24 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
10008
10094
  key: 1,
10009
10095
  options: _ctx.options
10010
10096
  }, null, 8, ["options"])) : vue.createCommentVNode("", true),
10011
- _ctx.options.filters ? (vue.openBlock(), vue.createBlock(_sfc_main$K, {
10097
+ _ctx.options.filters ? (vue.openBlock(), vue.createBlock(_sfc_main$E, {
10012
10098
  key: 2,
10013
10099
  options: _ctx.options.filters
10014
10100
  }, null, 8, ["options"])) : vue.createCommentVNode("", true),
10015
- vue.unref(currentQueryText) || _ctx.isProductList ? (vue.openBlock(), vue.createBlock(_sfc_main$J, {
10101
+ vue.unref(currentQueryText) || _ctx.isProductList ? (vue.openBlock(), vue.createBlock(_sfc_main$D, {
10016
10102
  key: 3,
10017
10103
  breadcrumbs: _ctx.options.breadcrumbs
10018
10104
  }, null, 8, ["breadcrumbs"])) : vue.createCommentVNode("", true),
10019
10105
  isTitleResultTopPosition.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9, [
10020
- showFilterSidebar.value ? (vue.openBlock(), vue.createBlock(_sfc_main$L, {
10106
+ showFilterSidebar.value ? (vue.openBlock(), vue.createBlock(_sfc_main$F, {
10021
10107
  key: 0,
10022
10108
  options: (_b = _ctx.options.filters) != null ? _b : {},
10023
10109
  ref_key: "searchResultsFilters",
10024
10110
  ref: searchResultsFilters
10025
10111
  }, null, 8, ["options"])) : vue.createCommentVNode("", true),
10026
10112
  vue.createElementVNode("div", _hoisted_3$4, [
10027
- vue.createVNode(_sfc_main$Z, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
10028
- vue.createVNode(_sfc_main$X, {
10113
+ vue.createVNode(_sfc_main$T, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
10114
+ vue.createVNode(_sfc_main$R, {
10029
10115
  options: _ctx.options,
10030
10116
  "is-product-list": (_c = _ctx.isProductList) != null ? _c : false
10031
10117
  }, null, 8, ["options", "is-product-list"]),
@@ -10040,13 +10126,13 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
10040
10126
  }, 8, ["options", "ssr"])
10041
10127
  ])
10042
10128
  ])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 5 }, [
10043
- vue.createVNode(_sfc_main$Z, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
10044
- vue.createVNode(_sfc_main$X, {
10129
+ vue.createVNode(_sfc_main$T, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
10130
+ vue.createVNode(_sfc_main$R, {
10045
10131
  options: _ctx.options,
10046
10132
  "is-product-list": (_d = _ctx.isProductList) != null ? _d : false
10047
10133
  }, null, 8, ["options", "is-product-list"]),
10048
10134
  vue.createElementVNode("div", _hoisted_4$3, [
10049
- showFilterSidebar.value ? (vue.openBlock(), vue.createBlock(_sfc_main$L, {
10135
+ showFilterSidebar.value ? (vue.openBlock(), vue.createBlock(_sfc_main$F, {
10050
10136
  key: 0,
10051
10137
  options: (_e = _ctx.options.filters) != null ? _e : {},
10052
10138
  ref_key: "searchResultsFilters",
@@ -15676,7 +15762,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
15676
15762
  onClick: vue.withModifiers(innerClick, ["stop"])
15677
15763
  }, [
15678
15764
  vue.createElementVNode("div", _hoisted_2$7, [
15679
- vue.createVNode(_sfc_main$_, {
15765
+ vue.createVNode(_sfc_main$U, {
15680
15766
  options: fullSearchBoxOptions.value,
15681
15767
  "is-search-container": true,
15682
15768
  ref_key: "searchBox",
@@ -17154,7 +17240,7 @@ exports.DocumentElementType = DocumentElementType;
17154
17240
  exports.LupaSearch = LupaSearch;
17155
17241
  exports.ProductList = _sfc_main$a;
17156
17242
  exports.Recommendations = _sfc_main$8;
17157
- exports.SearchBox = _sfc_main$_;
17243
+ exports.SearchBox = _sfc_main$U;
17158
17244
  exports.SearchBoxPanelType = SearchBoxPanelType;
17159
17245
  exports.SearchContainer = _sfc_main$9;
17160
17246
  exports.SearchResults = _sfc_main$c;