@depict-ai/ui 1.0.9 → 1.0.10

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.
package/dist/main.js CHANGED
@@ -32,12 +32,15 @@ $parcel$export(module.exports, "setup_fast_leave", () => $08e7f10b1831645f$expor
32
32
  $parcel$export(module.exports, "show_toast", () => $ee498ec5e7dc2bba$export$5196e4c01fa56fcb);
33
33
  $parcel$export(module.exports, "SolidFormatPrice", () => $d659702496cb72ea$export$a71e92cfbb498adc);
34
34
  $parcel$export(module.exports, "connect_search_field_height_to_aligner_height", () => $d8e94ea381ab57fa$export$828dcdd425fd3231);
35
+ $parcel$export(module.exports, "BasePlaceholder", () => $9fe9883b1d8ecccc$export$acb3eaade4b23afd);
36
+ $parcel$export(module.exports, "TextPlaceholder", () => $061ff5b4c3d36171$export$89c6019e4baa40b1);
37
+ $parcel$export(module.exports, "ImagePlaceholder", () => $3bc4a89b971a3af5$export$3f37af283f8fb843);
35
38
  $parcel$export(module.exports, "PageReplacer", () => $0a6acf31d1eae57c$export$3ccaa27d81dd8556);
36
39
  $parcel$export(module.exports, "defaultGridSpacing", () => $a3280f0aad997933$export$864d304a0bc46829);
37
40
  $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$export$c3834fa86c616831);
38
41
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
39
42
  $parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
40
- /*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.0.9";
43
+ /*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.0.10";
41
44
 
42
45
 
43
46
 
@@ -821,8 +824,8 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: pro
821
824
  });
822
825
  return get_elements; // https://github.com/solidjs/solid/releases/tag/v1.7.0
823
826
  }
824
- /**
825
- * Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
827
+ /**
828
+ * Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
826
829
  */ function $0caf87eaa19079da$var$Placeholder({ product_card_template_: product_card_template_ }) {
827
830
  const get_cloned_placeholders = (element_to_clone = $0caf87eaa19079da$var$cached_placeholder_element)=>Array.isArray(element_to_clone) ? element_to_clone.map((el)=>el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
828
831
  if ($0caf87eaa19079da$var$cached_placeholder_element) return get_cloned_placeholders();
@@ -867,8 +870,8 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: pro
867
870
  }
868
871
 
869
872
 
870
- /*
871
- * Usually product templates are somewhat height-elastic depending on the content, i.e. if the title is longer we might up to two extra rows for this. That means that the placeholders almost never will reflect the size of the actual content when we do scroll restoration. This magic number specifies how many extra placeholders we should render everytime to compensate for this, since if the placeholders are in total shorter than the old scroll location the scroll restoration won't work.
873
+ /*
874
+ * Usually product templates are somewhat height-elastic depending on the content, i.e. if the title is longer we might up to two extra rows for this. That means that the placeholders almost never will reflect the size of the actual content when we do scroll restoration. This magic number specifies how many extra placeholders we should render everytime to compensate for this, since if the placeholders are in total shorter than the old scroll location the scroll restoration won't work.
872
875
  */ const $aec24316ed262dc0$export$6c9030e511152266 = 30;
873
876
 
874
877
 
@@ -960,8 +963,8 @@ function $4117463e2939f5f4$export$63dd0350f8559dda({ displays_by_key_: displays_
960
963
 
961
964
 
962
965
 
963
- /**
964
- * Gets product_id (the thing we key the rendering on) from a display
966
+ /**
967
+ * Gets product_id (the thing we key the rendering on) from a display
965
968
  */ function $a5871dacf261adf8$export$548d053aba053d79(display) {
966
969
  if ("variant_index" in display) {
967
970
  const actual_display = display.variant_displays[display.variant_index];
@@ -1262,9 +1265,9 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
1262
1265
  return _el$;
1263
1266
  })();
1264
1267
  }
1265
- /**
1266
- * Sets styling to styling generated by "Layout" (n_col_styling_with_dist) depending on if filters are open or not
1267
- * This function is special to the actual PLPResults.
1268
+ /**
1269
+ * Sets styling to styling generated by "Layout" (n_col_styling_with_dist) depending on if filters are open or not
1270
+ * This function is special to the actual PLPResults.
1268
1271
  */ function $fe76fb463cc60b89$var$results_grid_styling_generator({ layout_options_: layout_options_ , sort_or_filter_open_: sort_or_filter_open_ , set_styling_: set_styling_ , selector_beginning_: selector_beginning_ }) {
1269
1272
  (0, $iBTHO$solidjs.createRenderEffect)(()=>{
1270
1273
  // Add grid styling that changes when filters get opened/closed
@@ -3187,6 +3190,52 @@ function $8c939a05b87fbbbc$export$ab34afce88557c0e(props) {
3187
3190
 
3188
3191
 
3189
3192
 
3193
+
3194
+
3195
+
3196
+
3197
+
3198
+ const $9fe9883b1d8ecccc$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<span></span>`, 2);
3199
+ function $9fe9883b1d8ecccc$export$acb3eaade4b23afd(props) {
3200
+ return (()=>{
3201
+ const _el$ = $9fe9883b1d8ecccc$var$_tmpl$.cloneNode(true);
3202
+ (0, $iBTHO$solidjsweb.effect)((_p$)=>{
3203
+ const _v$ = `depict-placeholder ${props.class || ""}`, _v$2 = props.style;
3204
+ _v$ !== _p$._v$ && (0, $iBTHO$solidjsweb.className)(_el$, _p$._v$ = _v$);
3205
+ _p$._v$2 = (0, $iBTHO$solidjsweb.style)(_el$, _v$2, _p$._v$2);
3206
+ return _p$;
3207
+ }, {
3208
+ _v$: undefined,
3209
+ _v$2: undefined
3210
+ });
3211
+ return _el$;
3212
+ })();
3213
+ }
3214
+
3215
+
3216
+
3217
+ function $061ff5b4c3d36171$export$89c6019e4baa40b1(props) {
3218
+ const style = (0, $iBTHO$solidjs.createMemo)(()=>{
3219
+ const { style: style , height: height , width: width } = props;
3220
+ return {
3221
+ ...style || {},
3222
+ height: height ?? "1em",
3223
+ ...width && {
3224
+ width: width
3225
+ }
3226
+ };
3227
+ });
3228
+ return (0, $iBTHO$solidjsweb.createComponent)((0, $9fe9883b1d8ecccc$export$acb3eaade4b23afd), {
3229
+ get style () {
3230
+ return style();
3231
+ },
3232
+ get ["class"] () {
3233
+ return props.class;
3234
+ }
3235
+ });
3236
+ }
3237
+
3238
+
3190
3239
  const $aff9a96d30ed3563$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="filter-collapsible"></div>`, 2), $aff9a96d30ed3563$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<button class="clear-group"><span></span></button>`, 4), $aff9a96d30ed3563$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="view-more-clear"></div>`, 2), $aff9a96d30ed3563$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="filter-collapsible-body"><div class="filter-part"></div></div>`, 4), $aff9a96d30ed3563$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<details class="filter-collapsible"></details>`, 2), $aff9a96d30ed3563$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<summary class="filter-group-summary"><div class="summary"><span></span><div class="selected-w-sign"></div></div></summary>`, 8), $aff9a96d30ed3563$var$_tmpl$7 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="ungrouped"></div>`, 2), $aff9a96d30ed3563$var$_tmpl$8 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<button class="clear-all-filters major"></button>`, 2);
3191
3240
  function $aff9a96d30ed3563$export$3f1a388cc0d8fed7(props) {
3192
3241
  // Split like this to make placeholder wrapping more visible & this component is exported and used in MobileModal
@@ -3199,7 +3248,7 @@ function $aff9a96d30ed3563$export$3f1a388cc0d8fed7(props) {
3199
3248
  length: 5
3200
3249
  }).map(()=>(()=>{
3201
3250
  const _el$ = $aff9a96d30ed3563$var$_tmpl$.cloneNode(true);
3202
- (0, $iBTHO$solidjsweb.insert)(_el$, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.Placeholder), {
3251
+ (0, $iBTHO$solidjsweb.insert)(_el$, (0, $iBTHO$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
3203
3252
  width: "100%",
3204
3253
  height: "50px"
3205
3254
  }));
@@ -3429,6 +3478,7 @@ function $aff9a96d30ed3563$var$ActualFilterBody(props) {
3429
3478
 
3430
3479
 
3431
3480
 
3481
+
3432
3482
  const $be89be42ce9ea60f$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="sorting-attributes"></div>`, 2), $be89be42ce9ea60f$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="sorting-direction"></div>`, 2), $be89be42ce9ea60f$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div><div class="input-row"><input type="radio"><span class="custom-indicator"></span></div></div>`, 7), $be89be42ce9ea60f$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div><label class="input-row"><input type="radio"><span class="custom-indicator"></span></label></div>`, 7);
3433
3483
  function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: available_sortings_ , current_sorting_: [get_current_sorting, set_current_sorting] , meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_ }) {
3434
3484
  const title_radio_name = (0, $iBTHO$depictaiutilishared.make_random_classname)();
@@ -3445,7 +3495,7 @@ function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: availa
3445
3495
  }).map(()=>(()=>{
3446
3496
  const _el$4 = $be89be42ce9ea60f$var$_tmpl$3.cloneNode(true), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
3447
3497
  _el$6.disabled = true;
3448
- (0, $iBTHO$solidjsweb.insert)(_el$5, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.Placeholder), {
3498
+ (0, $iBTHO$solidjsweb.insert)(_el$5, (0, $iBTHO$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
3449
3499
  height: "1.2em",
3450
3500
  width: "100%"
3451
3501
  }), null);
@@ -3954,9 +4004,9 @@ function $70482f04605572e2$export$b288c38ae3fddb56({ available_filters_: availab
3954
4004
  last_remote_state = available_filters_();
3955
4005
  });
3956
4006
  }
3957
- /**
3958
- * When a filter is only available locally due to being selected in a previous navigation, we want to make that clear and prevent further "invalid" choices.
3959
- * This sets the counts to 0 (if applicable) and removes non-selected options (if applicable)
4007
+ /**
4008
+ * When a filter is only available locally due to being selected in a previous navigation, we want to make that clear and prevent further "invalid" choices.
4009
+ * This sets the counts to 0 (if applicable) and removes non-selected options (if applicable)
3960
4010
  */ function $70482f04605572e2$var$modify_only_local_filter(local_filter_object, selected_filter) {
3961
4011
  const old_meta = local_filter_object.meta;
3962
4012
  const selected_filter_data = selected_filter.data;
@@ -4396,10 +4446,10 @@ const $1ab22f2cd39b3061$var$range_delimiter = "-";
4396
4446
  const $1ab22f2cd39b3061$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
4397
4447
  const $1ab22f2cd39b3061$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
4398
4448
  const $1ab22f2cd39b3061$var$empty_item_replacement = "0️⃣";
4399
- /**
4400
- * Checks if a given array of filter data can be neatly serialized into an URL query parameter, or if it should fall back to JSON+base64.
4401
- * The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
4402
- * No deep or mixed nesting levels are supported.
4449
+ /**
4450
+ * Checks if a given array of filter data can be neatly serialized into an URL query parameter, or if it should fall back to JSON+base64.
4451
+ * The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
4452
+ * No deep or mixed nesting levels are supported.
4403
4453
  */ function $1ab22f2cd39b3061$var$array_is_serializable(array, is_root = true) {
4404
4454
  if (array.every((item)=>Array.isArray(item))) {
4405
4455
  if (!is_root) // Deeply nested arrays are not supported, but also don't exist as filters (yet)
@@ -4411,10 +4461,10 @@ const $1ab22f2cd39b3061$var$empty_item_replacement = "0️⃣";
4411
4461
  // Encoding reserved characters is not supported
4412
4462
  return !array.some((item)=>item.includes($1ab22f2cd39b3061$var$array_item_delimiter) || item.includes($1ab22f2cd39b3061$var$string_item_delimiter) || item === $1ab22f2cd39b3061$var$empty_item_replacement);
4413
4463
  }
4414
- /**
4415
- * Human readable string[] or string[][] serialization for URLs.
4416
- * @param array
4417
- * @returns
4464
+ /**
4465
+ * Human readable string[] or string[][] serialization for URLs.
4466
+ * @param array
4467
+ * @returns
4418
4468
  */ function $1ab22f2cd39b3061$var$encode_array(array) {
4419
4469
  const is_nested = array.every((item)=>Array.isArray(item));
4420
4470
  if (is_nested) return array.map($1ab22f2cd39b3061$var$encode_array).join($1ab22f2cd39b3061$var$array_item_delimiter) + $1ab22f2cd39b3061$var$array_item_delimiter; // Nested arrays require a suffix to close nesting levels
@@ -4526,6 +4576,7 @@ function $1ab22f2cd39b3061$export$43cd1e747fecd42e(to_url, set_clearing_flag, fr
4526
4576
  }
4527
4577
 
4528
4578
 
4579
+
4529
4580
  const $e53b2e7e632ac4cb$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<nav class="crumbs"></nav>`, 2), $e53b2e7e632ac4cb$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<a class="crumb"></a>`, 2), $e53b2e7e632ac4cb$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<span class="separator"></span>`, 2);
4530
4581
  function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data , router_: router_ , i18n_: i18n_ }) {
4531
4582
  const placeholder_crumb_data = [
@@ -4551,7 +4602,7 @@ function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
4551
4602
  return display_accessor();
4552
4603
  },
4553
4604
  get fallback () {
4554
- return (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.Placeholder), {
4605
+ return (0, $iBTHO$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
4555
4606
  height: "calc(1em + 1px)",
4556
4607
  width: "10ch"
4557
4608
  });
@@ -4604,6 +4655,7 @@ function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
4604
4655
 
4605
4656
 
4606
4657
 
4658
+
4607
4659
  const $8cceb1d3a967f369$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<nav class="quicklinks"></nav>`, 2), $8cceb1d3a967f369$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div>QuickLinks failed</div>`, 2), $8cceb1d3a967f369$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<a class="quicklink"></a>`, 2);
4608
4660
  function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_ , router_: router_ , current_query_id_: current_query_id_ , slider_arrow_button_: slider_arrow_button_ , breadcrumb_data_: breadcrumb_data_ , i18n_: i18n_ }) {
4609
4661
  let scrolling_logic_ran_for_query_id = false;
@@ -4756,7 +4808,7 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
4756
4808
  category_query_id_: display_accessor()?.query_id
4757
4809
  });
4758
4810
  }), true);
4759
- (0, $iBTHO$solidjsweb.insert)(_el$3, ()=>display_accessor()?.title || (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.Placeholder), {
4811
+ (0, $iBTHO$solidjsweb.insert)(_el$3, ()=>display_accessor()?.title || (0, $iBTHO$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
4760
4812
  height: "1em",
4761
4813
  width: "10ch"
4762
4814
  }));
@@ -4976,14 +5028,14 @@ function $cc7c480116d2eba0$var$clear_if_opened_new_tab_with_sideways_url_params_
4976
5028
 
4977
5029
 
4978
5030
 
4979
- const $cafad5eca9f09cb5$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="statement">No category ID specified, this is probably unintentional. Make sure to first create (and insert) the SearchPage once you have told the SDK about a category ID.</div>`, 2), $cafad5eca9f09cb5$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="buttons"><button class="ok major"></button></div>`, 4);
5031
+ const $cafad5eca9f09cb5$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="statement">No category ID specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a category ID in your Depict Provider.</div>`, 2), $cafad5eca9f09cb5$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="buttons"><button class="ok major"></button></div>`, 4);
4980
5032
  function $cafad5eca9f09cb5$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
4981
5033
  if (!(0, $iBTHO$depictaiutilishared.is_debug)) return; // Just to make sure we don't show this in production
4982
5034
  const owner = (0, $iBTHO$solidjs.getOwner)();
4983
5035
  const disconnect = (0, $iBTHO$depictaiutilishared.observer).onexists(el, ({ element: element })=>(0, $iBTHO$solidjs.runWithOwner)(owner, ()=>(0, $iBTHO$solidjs.createEffect)(()=>{
4984
5036
  if (!document.documentElement.contains(element)) return;
4985
5037
  if (!query_id_()) {
4986
- const warning = "No category ID specified, this is probably unintentional. Make sure to first create (and insert) the SearchPage once you have told the SDK about a category ID.";
5038
+ const warning = "No category ID specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a category ID in your Depict Provider.";
4987
5039
  (0, $iBTHO$depictaiutilishared.dwarn)(warning);
4988
5040
  const { close_toast_: close_toast_ } = (0, $ee498ec5e7dc2bba$export$5196e4c01fa56fcb)({
4989
5041
  class: "warning",
@@ -5010,6 +5062,7 @@ function $cafad5eca9f09cb5$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
5010
5062
  ]);
5011
5063
 
5012
5064
 
5065
+
5013
5066
  const $840d88a04b2d22a7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="product-count"> </div>`, 2), $840d88a04b2d22a7$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div></div>`, 2), $840d88a04b2d22a7$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="filter-results-for-one-row"></div>`, 2), $840d88a04b2d22a7$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="depict plp category"><div class="listing-page"></div></div>`, 4);
5014
5067
  function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , slider_arrow_button_: slider_arrow_button_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , router_: router_ , show_quicklinks_: show_quicklinks_ , category_title_: category_title_ , show_breadcrumbs_: show_breadcrumbs_ , layout_options_: layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ }) {
5015
5068
  let results_for;
@@ -5086,7 +5139,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
5086
5139
  get children () {
5087
5140
  return [
5088
5141
  " ",
5089
- (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.Placeholder), {
5142
+ (0, $iBTHO$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
5090
5143
  height: "1em",
5091
5144
  width: "3ch"
5092
5145
  })
@@ -5509,8 +5562,8 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
5509
5562
  }
5510
5563
  };
5511
5564
  }
5512
- /**
5513
- * Writes the sorting and filters to the URL query parameters when they change.
5565
+ /**
5566
+ * Writes the sorting and filters to the URL query parameters when they change.
5514
5567
  */ function $c79fd10a3ab7d6e0$var$start_href_writer({ get_sorting_: get_sorting_ , get_selected_filters_: get_selected_filters_ , router_: router_ , get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_ }) {
5515
5568
  (0, $iBTHO$solidjs.createEffect)((0, $iBTHO$solidjs.on)([
5516
5569
  get_sorting_,
@@ -5550,8 +5603,8 @@ function $c79fd10a3ab7d6e0$var$delete_sideways_param_flag(searchParams) {
5550
5603
 
5551
5604
 
5552
5605
  class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
5553
- /**
5554
- * Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
5606
+ /**
5607
+ * Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
5555
5608
  */ #throwing_on_navigation(...args) {
5556
5609
  const { on_navigation_: on_navigation_ } = this;
5557
5610
  if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
@@ -5564,14 +5617,14 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
5564
5617
  });
5565
5618
  }
5566
5619
  }
5567
- /**
5568
- * Checks if this tab shouldn't navigate because user wants to open in new tab
5620
+ /**
5621
+ * Checks if this tab shouldn't navigate because user wants to open in new tab
5569
5622
  */ #dont_attempt_navigation(ev) {
5570
5623
  return ev?.button || ev?.metaKey || ev?.ctrlKey;
5571
5624
  }
5572
- /**
5573
- * Vue has async router that needs to be awaited (it navigates after a microtask)
5574
- * This standardises waiting for all kinds of routers
5625
+ /**
5626
+ * Vue has async router that needs to be awaited (it navigates after a microtask)
5627
+ * This standardises waiting for all kinds of routers
5575
5628
  */ #get_navigation_happened_promise(is_replace) {
5576
5629
  return new Promise((resolve)=>{
5577
5630
  const handler = (what_happened)=>{
@@ -5584,19 +5637,19 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
5584
5637
  });
5585
5638
  }
5586
5639
  navigate_ = {
5587
- /**
5588
- * Call this if you *just* want to replace the state object in history.state
5640
+ /**
5641
+ * Call this if you *just* want to replace the state object in history.state
5589
5642
  */ replace_state_: (new_state)=>{
5590
5643
  // This doesn't break any router, so we just do this directly for now, since many don't expose an interface for changing the state
5591
5644
  history.replaceState(new_state, "");
5592
5645
  },
5593
- /**
5594
- * Call this to change the URL
5595
- * @param new_url_ new URL to go to
5596
- * @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
5597
- * @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
5598
- * @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
5599
- * @param category_query_id_ If you are navigating to a category and know the query_id of, please provide it. This is for making a better devEx in js-ui
5646
+ /**
5647
+ * Call this to change the URL
5648
+ * @param new_url_ new URL to go to
5649
+ * @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
5650
+ * @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
5651
+ * @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
5652
+ * @param category_query_id_ If you are navigating to a category and know the query_id of, please provide it. This is for making a better devEx in js-ui
5600
5653
  */ go_to_: (0, $iBTHO$depictaiutilishared.catchify)(async ({ new_url_: raw_new_url , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ , category_query_id_: category_query_id_ })=>{
5601
5654
  const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
5602
5655
  const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
@@ -5804,7 +5857,7 @@ const $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
5804
5857
  const actual_function = ({ category_title_: category_title_ , product_count_: product_count_ })=>{
5805
5858
  return (()=>{
5806
5859
  const _el$ = $0b23bfd073d9a4e8$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild;
5807
- (0, $iBTHO$solidjsweb.insert)(_el$2, ()=>category_title_() || (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.Placeholder), {
5860
+ (0, $iBTHO$solidjsweb.insert)(_el$2, ()=>category_title_() || (0, $iBTHO$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
5808
5861
  height: "1em",
5809
5862
  width: "10ch"
5810
5863
  }));
@@ -5982,14 +6035,45 @@ async function $7b4bc889571cc67b$var$download_categories(tenant, market) {
5982
6035
 
5983
6036
 
5984
6037
 
6038
+
6039
+
6040
+ function $3bc4a89b971a3af5$export$3f37af283f8fb843(props) {
6041
+ const style = (0, $iBTHO$solidjs.createMemo)(()=>{
6042
+ const { style: style , height: height , width: width , aspectRatio: aspectRatio } = props;
6043
+ const is_image = aspectRatio != undefined;
6044
+ const size_data = is_image ? {
6045
+ width: "100%",
6046
+ "padding-bottom": 1 / aspectRatio * 100 + "%"
6047
+ } : {
6048
+ width: width,
6049
+ height: height
6050
+ };
6051
+ return {
6052
+ display: "block",
6053
+ ...style || {},
6054
+ ...size_data
6055
+ };
6056
+ });
6057
+ return (0, $iBTHO$solidjsweb.createComponent)((0, $9fe9883b1d8ecccc$export$acb3eaade4b23afd), {
6058
+ get style () {
6059
+ return style();
6060
+ },
6061
+ get ["class"] () {
6062
+ return props.class;
6063
+ }
6064
+ });
6065
+ }
6066
+
6067
+
6068
+
5985
6069
  const $6f604560873e4f69$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="instant-card"><div class="img-part"></div><div class="right-part"><div class="title-brand-tagline"><span class="title"></span></div></div></div>`, 10);
5986
6070
  function $6f604560873e4f69$export$ee1733d9a8495996() {
5987
6071
  return (()=>{
5988
6072
  const _el$ = $6f604560873e4f69$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild;
5989
- (0, $iBTHO$solidjsweb.insert)(_el$2, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.ContainedPlaceholderImage), {
5990
- aspect_ratio: 1
6073
+ (0, $iBTHO$solidjsweb.insert)(_el$2, (0, $iBTHO$solidjsweb.createComponent)((0, $3bc4a89b971a3af5$export$3f37af283f8fb843), {
6074
+ aspectRatio: 1
5991
6075
  }));
5992
- (0, $iBTHO$solidjsweb.insert)(_el$5, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.Placeholder), {
6076
+ (0, $iBTHO$solidjsweb.insert)(_el$5, (0, $iBTHO$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
5993
6077
  width: "20ch",
5994
6078
  height: "1em"
5995
6079
  }));
@@ -6404,8 +6488,8 @@ async function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchan
6404
6488
 
6405
6489
 
6406
6490
 
6407
- /**
6408
- * Expand an object where every value in the top-level is an accessor into a normal object. Used for converting solid_i18n objects into external i18n typed objects.
6491
+ /**
6492
+ * Expand an object where every value in the top-level is an accessor into a normal object. Used for converting solid_i18n objects into external i18n typed objects.
6409
6493
  */ const $639c124c22b6cbaa$export$27b710c08412a7ad = (obj)=>{
6410
6494
  return Object.fromEntries(Object.keys(obj).map((key)=>[
6411
6495
  key,
@@ -7572,7 +7656,7 @@ function $04048c1bef16c249$export$c05a196222ba1302({ suggestions_: suggestions_
7572
7656
  get fallback () {
7573
7657
  return (()=>{
7574
7658
  const _el$2 = $04048c1bef16c249$var$_tmpl$2.cloneNode(true);
7575
- (0, $iBTHO$solidjsweb.insert)(_el$2, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.Placeholder), {
7659
+ (0, $iBTHO$solidjsweb.insert)(_el$2, (0, $iBTHO$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
7576
7660
  height: "19px",
7577
7661
  width: "133px"
7578
7662
  }));
@@ -7946,8 +8030,8 @@ function $d8e94ea381ab57fa$export$828dcdd425fd3231(aligner) {
7946
8030
 
7947
8031
 
7948
8032
  const $2c61e4cd8229c49a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$iBTHO$solidjsweb.template)(`<div class="depict plp search"></div>`, 2);
7949
- /**
7950
- * Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
8033
+ /**
8034
+ * Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
7951
8035
  */ const $2c61e4cd8229c49a$var$privately_shared_properties = /*@__PURE__*/ new WeakMap();
7952
8036
  const $2c61e4cd8229c49a$var$min_products_to_fetch_ = 20;
7953
8037
  const $2c61e4cd8229c49a$export$bde3eb976dfded9 = (depict_search)=>$2c61e4cd8229c49a$var$privately_shared_properties.get(depict_search)?.search_query_updating_blocked_;
@@ -8148,7 +8232,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
8148
8232
  set market(market) {
8149
8233
  this.#market_signal[1](market);
8150
8234
  }
8151
- async fetchSearchResults(query, filters, maxResults = 50) {
8235
+ async fetchSearchResults(query, filters, maxResults = 48) {
8152
8236
  const { depict_api_: depict_api_ } = $2c61e4cd8229c49a$var$privately_shared_properties.get(this);
8153
8237
  const result = await depict_api_.query({
8154
8238
  tenant: this.merchant,
@@ -8344,8 +8428,8 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = (openModalParams)=>{
8344
8428
  }
8345
8429
  const { cleanup: cleanup } = (0, $d8e94ea381ab57fa$export$828dcdd425fd3231)(openModalParams.element);
8346
8430
  let dispose_aligner;
8347
- /**
8348
- * Setting position to fixed is important to make the modal work with align_field.
8431
+ /**
8432
+ * Setting position to fixed is important to make the modal work with align_field.
8349
8433
  */ const style_props_ = (0, $iBTHO$solidjs.createSignal)({
8350
8434
  position: "fixed"
8351
8435
  });
@@ -8425,6 +8509,9 @@ function $08e7f10b1831645f$export$689e204eadb33baf(pr) {
8425
8509
 
8426
8510
 
8427
8511
 
8512
+
8513
+
8514
+
8428
8515
  class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
8429
8516
  #stop_listening;
8430
8517
  #disconnect_observer;
@@ -8441,8 +8528,8 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
8441
8528
  })();
8442
8529
  return new Set();
8443
8530
  })();
8444
- /**
8445
- * Returns if the "replacement page" is currently open
8531
+ /**
8532
+ * Returns if the "replacement page" is currently open
8446
8533
  */ get open_() {
8447
8534
  // make this "readonly" from the outside, the only way to open is by making the url change so that is_page_ returns true
8448
8535
  return this.#is_open;
@@ -8527,26 +8614,26 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
8527
8614
  if (what_happened !== "popstate") return;
8528
8615
  const cleaned_current_url = $0a6acf31d1eae57c$var$clean_url(location.href);
8529
8616
  if (!$0a6acf31d1eae57c$export$3ccaa27d81dd8556.#visited_urls.has(cleaned_current_url)) {
8530
- /*
8531
- What does this check do? Well, there's a bug without it where people end up on a page that they shouldn't see (i.e. a somewhat blank page).
8532
- The culprit of that bug is: the browser remembers where to make "hard"-navigations (i.e. a full document rebuild with a new `document` and `window` object) when going back and forwards in the history and where to just change the url. What it doesn't always correctly remember (observed in at least chrome and firefox), is *what document to hard-navigate to*. Therefore, we have to jump in and take care of that.
8533
- The reproduction is this:
8534
- Spendrups has set up a search page for us under /start/search. We don't want to hard-reload the page though to get there.
8535
- 1. Go to a product page like https://ehandel.spendrups.se/Product/1104201
8536
- 2. Make a search
8537
- We use PageReplacer to just replace the current page (and the url in the address bar) with the search page. The thing is though, that when going back now the URL just updates but the browser doesn't actually navigate - that's fine, PageReplacer will just restore the old page contents
8538
- 3. Try going back just for fun
8539
- Everything works as expected
8540
- 4. Go forwards again (just for fun, skip this if you skipped 3)
8541
- Now the trouble comes when we introduce "hard" navigation.
8542
- 5. Click on a search result. The browser will now "hard" navigate to a new page.
8543
- 6. Click "back"
8544
- What happens now, is that the browser hard-navigates to /start/search.
8545
- 7. Click "back" again
8546
- What happens now, is that the browser "soft-navigates" (just changes the URL) to https://ehandel.spendrups.se/Product/1104201
8547
- PageReplacer unload itself and reveals the original document - it is expected to be the one under https://ehandel.spendrups.se/Product/1104201, but actually it is the one under /start/search - a white page.
8548
- The fix: is to remember all pages that we have visited since the creation of `window` (we do that by having a static property on PageReplacer since we assume the PageReplacer source code will only exist once on the page and will be loaded at page load, the latter assumption might be wrong, but I hope not). If we get a "popstate" event (meaning back or forwards button, not new page being pushed) to an unknown page we reload.
8549
- */ (0, $iBTHO$depictaiutilishared.dlog)("PageReplacer: ", cleaned_current_url, " hasn't been visited since document was created, reloading since we won't be able to show this page otherwise");
8617
+ /*
8618
+ What does this check do? Well, there's a bug without it where people end up on a page that they shouldn't see (i.e. a somewhat blank page).
8619
+ The culprit of that bug is: the browser remembers where to make "hard"-navigations (i.e. a full document rebuild with a new `document` and `window` object) when going back and forwards in the history and where to just change the url. What it doesn't always correctly remember (observed in at least chrome and firefox), is *what document to hard-navigate to*. Therefore, we have to jump in and take care of that.
8620
+ The reproduction is this:
8621
+ Spendrups has set up a search page for us under /start/search. We don't want to hard-reload the page though to get there.
8622
+ 1. Go to a product page like https://ehandel.spendrups.se/Product/1104201
8623
+ 2. Make a search
8624
+ We use PageReplacer to just replace the current page (and the url in the address bar) with the search page. The thing is though, that when going back now the URL just updates but the browser doesn't actually navigate - that's fine, PageReplacer will just restore the old page contents
8625
+ 3. Try going back just for fun
8626
+ Everything works as expected
8627
+ 4. Go forwards again (just for fun, skip this if you skipped 3)
8628
+ Now the trouble comes when we introduce "hard" navigation.
8629
+ 5. Click on a search result. The browser will now "hard" navigate to a new page.
8630
+ 6. Click "back"
8631
+ What happens now, is that the browser hard-navigates to /start/search.
8632
+ 7. Click "back" again
8633
+ What happens now, is that the browser "soft-navigates" (just changes the URL) to https://ehandel.spendrups.se/Product/1104201
8634
+ PageReplacer unload itself and reveals the original document - it is expected to be the one under https://ehandel.spendrups.se/Product/1104201, but actually it is the one under /start/search - a white page.
8635
+ The fix: is to remember all pages that we have visited since the creation of `window` (we do that by having a static property on PageReplacer since we assume the PageReplacer source code will only exist once on the page and will be loaded at page load, the latter assumption might be wrong, but I hope not). If we get a "popstate" event (meaning back or forwards button, not new page being pushed) to an unknown page we reload.
8636
+ */ (0, $iBTHO$depictaiutilishared.dlog)("PageReplacer: ", cleaned_current_url, " hasn't been visited since document was created, reloading since we won't be able to show this page otherwise");
8550
8637
  location.reload();
8551
8638
  $0a6acf31d1eae57c$export$3ccaa27d81dd8556.#reverting_permitted = false; // Disallow any reverting since we can't - it would flash a white page until the reload has finished.
8552
8639
  this.#unload(); // Call unload to "kill" the solid-js stuff quicker so that it stops updating - the user is expecting the next thing that happens to be a navigation to the actual page the URL says they're on.
@@ -8555,8 +8642,8 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
8555
8642
  (0, $iBTHO$depictaiutilishared.instant_exec_on_suspect_history_change).add(on_maybe_popstate);
8556
8643
  this.#revert_fns.push(()=>(0, $iBTHO$depictaiutilishared.instant_exec_on_suspect_history_change).delete(on_maybe_popstate)); // Don't run the bugfixer if there isn't a PageReplacer page open since I assume the bug only happens when going back from a PageReplace'd page
8557
8644
  }
8558
- /**
8559
- * Stops listening to URL changes and closes the page (if it is currently open)
8645
+ /**
8646
+ * Stops listening to URL changes and closes the page (if it is currently open)
8560
8647
  */ destroy_() {
8561
8648
  this.#unload();
8562
8649
  this.#stop_listening?.();
@@ -8571,8 +8658,8 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
8571
8658
  if (!is_spa_) (0, $08e7f10b1831645f$export$689e204eadb33baf)(this); // Make so that clicking on links to the previous page work instantly
8572
8659
  }
8573
8660
  }
8574
- /**
8575
- * Remove hash from URL
8661
+ /**
8662
+ * Remove hash from URL
8576
8663
  */ function $0a6acf31d1eae57c$var$clean_url(url) {
8577
8664
  // Would want to have this a static private function on PageReplacer, but that's not supported in MobileSafari yet
8578
8665
  // remove hash, all other params *could* trigger a re-request