@depict-ai/ui 3.0.3 → 3.0.5

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/ES10/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { add_to_version_info as $8tj43$add_to_version_info, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, slider_fading_factory as $8tj43$slider_fading_factory, get_session_id as $8tj43$get_session_id, add_version_query_params as $8tj43$add_version_query_params, base_url as $8tj43$base_url, dwarn as $8tj43$dwarn, catchify as $8tj43$catchify1, observer as $8tj43$observer, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, report as $8tj43$report, dlog as $8tj43$dlog, ContainedImage as $8tj43$ContainedImage, use_href_accessor as $8tj43$use_href_accessor1, camelCasifyObject as $8tj43$camelCasifyObject, make_random_classname as $8tj43$make_random_classname, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, queueMacroTask as $8tj43$queueMacroTask, is_safari as $8tj43$is_safari, slider_fractional_factory as $8tj43$slider_fractional_factory, useExpandingContainer as $8tj43$useExpandingContainer, standard_price_format as $8tj43$standard_price_format, hex_to_rgb as $8tj43$hex_to_rgb, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, snakeCasifyObject as $8tj43$snakeCasifyObject, fetch_retry as $8tj43$fetch_retry, make_url_with_query_params as $8tj43$make_url_with_query_params, sort_obj as $8tj43$sort_obj, edit_current_page_meta_tags as $8tj43$edit_current_page_meta_tags, javascript_media_query as $8tj43$javascript_media_query, is_debug as $8tj43$is_debug, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, buildThresholdList as $8tj43$buildThresholdList, deparallelize_no_drop as $8tj43$deparallelize_no_drop, ListenableSet as $8tj43$ListenableSet1, insert_surfaces as $8tj43$insert_surfaces } from "@depict-ai/utilishared/ES10";
1
+ import { add_to_version_info as $8tj43$add_to_version_info, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, slider_fading_factory as $8tj43$slider_fading_factory, get_session_id as $8tj43$get_session_id, add_version_query_params as $8tj43$add_version_query_params, base_url as $8tj43$base_url, dwarn as $8tj43$dwarn, catchify as $8tj43$catchify1, observer as $8tj43$observer, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, report as $8tj43$report, dlog as $8tj43$dlog, ContainedImage as $8tj43$ContainedImage, use_href_accessor as $8tj43$use_href_accessor1, camelCasifyObject as $8tj43$camelCasifyObject, make_random_classname as $8tj43$make_random_classname, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, queueMacroTask as $8tj43$queueMacroTask, is_safari as $8tj43$is_safari, slider_fractional_factory as $8tj43$slider_fractional_factory, useExpandingContainer as $8tj43$useExpandingContainer, standard_price_format as $8tj43$standard_price_format, hex_to_rgb as $8tj43$hex_to_rgb, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, snakeCasifyObject as $8tj43$snakeCasifyObject, fetch_retry as $8tj43$fetch_retry, make_url_with_query_params as $8tj43$make_url_with_query_params, sort_obj as $8tj43$sort_obj, javascript_media_query as $8tj43$javascript_media_query, is_debug as $8tj43$is_debug, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, buildThresholdList as $8tj43$buildThresholdList, deparallelize_no_drop as $8tj43$deparallelize_no_drop, ListenableSet as $8tj43$ListenableSet1, insert_surfaces as $8tj43$insert_surfaces } from "@depict-ai/utilishared/ES10";
2
2
  import { template as $8tj43$template, createComponent as $8tj43$createComponent, mergeProps as $8tj43$mergeProps, Dynamic as $8tj43$Dynamic, memo as $8tj43$memo, getNextElement as $8tj43$getNextElement, insert as $8tj43$insert, effect as $8tj43$effect, setAttribute as $8tj43$setAttribute, spread as $8tj43$spread, runHydrationEvents as $8tj43$runHydrationEvents, use as $8tj43$use, addEventListener as $8tj43$addEventListener, getNextMarker as $8tj43$getNextMarker, delegateEvents as $8tj43$delegateEvents, classList as $8tj43$classList, className as $8tj43$className, style as $8tj43$style, isServer as $8tj43$isServer, setProperty as $8tj43$setProperty } from "solid-js/web";
3
3
  import { createContext as $8tj43$createContext, useContext as $8tj43$useContext, createSignal as $8tj43$createSignal, createSelector as $8tj43$createSelector, getOwner as $8tj43$getOwner, runWithOwner as $8tj43$runWithOwner, Index as $8tj43$Index, createMemo as $8tj43$createMemo, children as $8tj43$children, onCleanup as $8tj43$onCleanup, createEffect as $8tj43$createEffect, untrack as $8tj43$untrack, Show as $8tj43$Show, createUniqueId as $8tj43$createUniqueId, mergeProps as $8tj43$mergeProps1, ErrorBoundary as $8tj43$ErrorBoundary, createResource as $8tj43$createResource, splitProps as $8tj43$splitProps, createRoot as $8tj43$createRoot, createRenderEffect as $8tj43$createRenderEffect, batch as $8tj43$batch, Suspense as $8tj43$Suspense, on as $8tj43$on, For as $8tj43$For, createComputed as $8tj43$createComputed, createReaction as $8tj43$createReaction, mapArray as $8tj43$mapArray } from "solid-js";
4
- import { ListenableSet as $8tj43$ListenableSet, catchify as $8tj43$catchify, use_href_accessor as $8tj43$use_href_accessor } from "@depict-ai/utilishared/ES10";
4
+ import { ListenableSet as $8tj43$ListenableSet, catchify as $8tj43$catchify, use_href_accessor as $8tj43$use_href_accessor, report as $8tj43$report1 } from "@depict-ai/utilishared/ES10";
5
5
  import $8tj43$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
6
6
  import $8tj43$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
7
7
  import $8tj43$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet";
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.3";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.5";
14
14
  const $ca6ab5f08bd28bca$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
15
15
  function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
16
16
  let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -396,12 +396,12 @@ class $ac571292d606f30b$export$7e1297a3a19f10d8 {
396
396
  * Vue has async router that needs to be awaited (it navigates after a microtask)
397
397
  * This standardises waiting for all kinds of routers
398
398
  */
399
- constructor(on_navigation, listing_id_state_key) {
399
+ constructor(on_navigation, listing_query_state_key) {
400
400
  $ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_get_navigation_happened_promise);
401
401
  $ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_dont_attempt_navigation);
402
402
  $ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_throwing_on_navigation);
403
403
  $8tj43$babelruntimehelpersdefineProperty(this, "on_navigation_", void 0);
404
- $8tj43$babelruntimehelpersdefineProperty(this, "listing_id_state_key", void 0);
404
+ $8tj43$babelruntimehelpersdefineProperty(this, "listing_query_state_key", void 0);
405
405
  $8tj43$babelruntimehelpersdefineProperty(this, "navigate_", {
406
406
  /**
407
407
  * Call this if you *just* want to replace the state object in history.state
@@ -425,7 +425,7 @@ class $ac571292d606f30b$export$7e1297a3a19f10d8 {
425
425
  event_: event_,
426
426
  force_spa_navigation_: force_spa_navigation_,
427
427
  is_replace_: is_replace_,
428
- listing_id_: listing_id_,
428
+ listing_query_: listing_query_,
429
429
  scroll = true
430
430
  } = _ref;
431
431
  const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
@@ -446,10 +446,10 @@ class $ac571292d606f30b$export$7e1297a3a19f10d8 {
446
446
  if (force_spa_navigation_ && wants_hard_navigation) {
447
447
  // Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
448
448
  const new_state = history.state;
449
- if (listing_id_) {
449
+ if (listing_query_) {
450
450
  // In JS-UI we need to know the listing_id of the current category, therefore push it into state
451
- if (!this.listing_id_state_key) $8tj43$report(new Error("listing_id_state_key is not set"), "error");
452
- new_state[this.listing_id_state_key] = listing_id_;
451
+ if (!this.listing_query_state_key) $8tj43$report(new Error("listing_query_state_key is not set"), "error");
452
+ new_state[this.listing_query_state_key] = listing_query_;
453
453
  }
454
454
  history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
455
455
  } else $ac571292d606f30b$var$_classPrivateMethodGet(this, $ac571292d606f30b$var$_throwing_on_navigation, $ac571292d606f30b$var$_throwing_on_navigation2).call(this, {
@@ -460,7 +460,7 @@ class $ac571292d606f30b$export$7e1297a3a19f10d8 {
460
460
  await promise;
461
461
  })
462
462
  });
463
- this.listing_id_state_key = listing_id_state_key;
463
+ this.listing_query_state_key = listing_query_state_key;
464
464
  this.on_navigation_ = on_navigation;
465
465
  }
466
466
  }
@@ -966,27 +966,31 @@ function $2d7bad8684bc7f44$export$43f0fb951fcb0c54(_ref) {
966
966
  });
967
967
  }
968
968
  // source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
969
+ // deeply diffs two objects
970
+ // Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
971
+ // Modified futher to bias towards saying objects are equal non-primitive objects differ
969
972
  function $2d7bad8684bc7f44$var$deep_equal(obj1, obj2) {
970
- if (obj1 === obj2) return true;
971
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
972
- if (obj1.length !== obj2.length) return false;
973
- return obj1.every((elem, index) => {
974
- return $2d7bad8684bc7f44$var$deep_equal(elem, obj2[index]);
975
- });
976
- }
977
- if (typeof obj1 === "object" && typeof obj2 === "object" && obj1 !== null && obj2 !== null) {
978
- if (Array.isArray(obj1) || Array.isArray(obj2)) return false;
979
- const keys1 = Object.keys(obj1);
980
- const keys2 = Object.keys(obj2);
981
- if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
982
- for (const key in obj1) {
983
- if ($2d7bad8684bc7f44$var$result_ids.includes(key)) continue; // ignore keys changing with every request
984
- const isEqual = $2d7bad8684bc7f44$var$deep_equal(obj1[key], obj2[key]);
985
- if (!isEqual) return false;
986
- }
987
- return true;
973
+ const stack = [[obj1, obj2]];
974
+ while (stack.length > 0) {
975
+ const [currentObj1, currentObj2] = stack.pop();
976
+ if (currentObj1 === currentObj2) continue;
977
+ if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
978
+ if (currentObj1.length !== currentObj2.length) return false;
979
+ for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
980
+ } else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
981
+ if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
982
+ const keys1 = Object.keys(currentObj1);
983
+ const keys2 = Object.keys(currentObj2);
984
+ if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
985
+ for (let key in currentObj1) {
986
+ if ($2d7bad8684bc7f44$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
987
+ stack.push([currentObj1[key], currentObj2[key]]);
988
+ }
989
+ } else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
990
+ // Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
991
+ return false;
988
992
  }
989
- return false;
993
+ return true;
990
994
  }
991
995
  const $63f1f8dbcd07d3b0$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div>`),
992
996
  $63f1f8dbcd07d3b0$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<style type=text/css>`);
@@ -5757,6 +5761,11 @@ function $ed0fefda39a0f15d$export$967e966fca9515e(api_response) {
5757
5761
  }
5758
5762
  return api_response;
5759
5763
  }
5764
+
5765
+ // Minifiable and tree-shakable enum
5766
+ // Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
5767
+ const $397620a4d7958ed1$export$74ee7529ce0f8a00 = "listingId";
5768
+ const $397620a4d7958ed1$export$5aae649db1b959fc = "externalId";
5760
5769
  function $284849364a6ef73a$var$_classPrivateMethodInitSpec(obj, privateSet) {
5761
5770
  $284849364a6ef73a$var$_checkPrivateRedeclaration(obj, privateSet);
5762
5771
  privateSet.add(obj);
@@ -5865,9 +5874,14 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
5865
5874
  })
5866
5875
  });
5867
5876
  }
5868
- async get_listing(input_req) {
5877
+ async get_listing(_ref) {
5878
+ let {
5879
+ id_type_: id_type_,
5880
+ id_to_query_for_: id_to_query_for_,
5881
+ ...input_req
5882
+ } = _ref;
5869
5883
  return await $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_cached_request, $284849364a6ef73a$var$_cached_request2).call(this, {
5870
- endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + encodeURIComponent(input_req.listing_id),
5884
+ endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + (id_type_ === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_),
5871
5885
  input_req_: input_req,
5872
5886
  fallback_response_: () => ({
5873
5887
  listing_id: "",
@@ -5881,20 +5895,18 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
5881
5895
  "quick_links": [],
5882
5896
  failed: true
5883
5897
  }),
5884
- method_: "GET",
5885
- delete_key_before_sending_: "listing_id" // this goes into the path, but we still need to have it in the request object until the last second as we want to include it as a key when caching requests
5898
+ method_: "GET"
5886
5899
  });
5887
5900
  }
5888
-
5889
- async get_listing_products(input_req) {
5890
- const listing_id = input_req.listing_id; // listing_id goes into the path
5891
- const cloned_request = {
5892
- ...input_req
5893
- };
5894
- delete cloned_request["listing_id"];
5901
+ async get_listing_products(_ref2) {
5902
+ let {
5903
+ id_to_query_for_: id_to_query_for_,
5904
+ id_type_: id_type_,
5905
+ ...input_req_
5906
+ } = _ref2;
5895
5907
  return await $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_cached_request, $284849364a6ef73a$var$_cached_request2).call(this, {
5896
- endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + encodeURIComponent(listing_id) + "/products",
5897
- input_req_: input_req,
5908
+ endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + (id_type_ === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_) + "/products",
5909
+ input_req_: input_req_,
5898
5910
  fallback_response_: () => ({
5899
5911
  "n_hits": 0,
5900
5912
  "displays": [],
@@ -5932,7 +5944,7 @@ async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, mar
5932
5944
  const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
5933
5945
  if (!category_transformer) return response;
5934
5946
  // find category suggestions, run thing with them, and then replace them
5935
- const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "category");
5947
+ const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
5936
5948
  const transformed_category_suggestions = await category_transformer({
5937
5949
  market: market,
5938
5950
  merchant: merchant,
@@ -5978,15 +5990,14 @@ async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchan
5978
5990
  });
5979
5991
  return input_data;
5980
5992
  }
5981
- async function $284849364a6ef73a$var$_cached_request2(_ref) {
5993
+ async function $284849364a6ef73a$var$_cached_request2(_ref3) {
5982
5994
  var _classPrivateFieldGet5, _cache_obj$cache_$bod, _cache_obj$cache_$bod2;
5983
5995
  let {
5984
5996
  endpoint_: endpoint_,
5985
5997
  input_req_: input_req_,
5986
5998
  fallback_response_: fallback_response_,
5987
- method_ = "POST",
5988
- delete_key_before_sending_: delete_key_before_sending_ // only supported for GET requests
5989
- } = _ref;
5999
+ method_ = "POST"
6000
+ } = _ref3;
5990
6001
  const cache_obj = $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_get_cache_obj_for_endpoint, $284849364a6ef73a$var$_get_cache_obj_for_endpoint2).call(this, endpoint_);
5991
6002
  const with_ids = $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $284849364a6ef73a$var$_add_ids_to_request).call(this, input_req_);
5992
6003
  const metaData = await ((_classPrivateFieldGet5 = $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $284849364a6ef73a$var$_get_metadata)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.call(this));
@@ -6003,7 +6014,6 @@ async function $284849364a6ef73a$var$_cached_request2(_ref) {
6003
6014
  cache_obj.in_progress_[body] = new Promise(r => resolve_in_progress = r);
6004
6015
  try {
6005
6016
  const is_post = method_ === "POST";
6006
- if (!is_post && delete_key_before_sending_) delete sorted_request[delete_key_before_sending_];
6007
6017
  const url_to_request = is_post ? endpoint_ : $8tj43$make_url_with_query_params(endpoint_, sorted_request);
6008
6018
  const api_response = await $8tj43$fetch_retry($8tj43$add_version_query_params(url_to_request), {
6009
6019
  method: method_,
@@ -6377,7 +6387,7 @@ function $6d2962bc9370f884$export$5e4aed86c12acdd9(_ref) {
6377
6387
  // After first load, always just load 20 since people might just be browsing the top ones still
6378
6388
  min_products_to_fetch_ : now - last_loaded < 10000 ? min_products_to_fetch_ * 5 : min_products_to_fetch_;
6379
6389
  // dlog("loading ", number_of_results_to_load, "products, because it was", now - last_loaded, "ms since last load");
6380
- const api_response = await depict_api_["listing_id" in base_part ? "get_listing_products" : "query"]({
6390
+ const api_response = await depict_api_["query" in base_part ? "query" : "get_listing_products"]({
6381
6391
  cursor: get_last_cursor(),
6382
6392
  limit: number_of_results_to_load,
6383
6393
  ...base_part
@@ -8111,16 +8121,16 @@ function $52efc9ae4382e25a$export$5646050d516e06bc(_ref) {
8111
8121
  },
8112
8122
  get children() {
8113
8123
  const _el$2 = $8tj43$getNextElement($52efc9ae4382e25a$var$_tmpl$2);
8114
- $8tj43$addEventListener(_el$2, "click", $8tj43$catchify1(ev => {
8115
- var _display_accessor2;
8116
- return router_.navigate_.go_to_({
8117
- new_url_: href(),
8118
- is_replace_: false,
8119
- event_: ev,
8120
- force_spa_navigation_: true,
8121
- listing_id_: (_display_accessor2 = display_accessor()) === null || _display_accessor2 === void 0 ? void 0 : _display_accessor2.listing_id
8122
- });
8123
- }), true);
8124
+ $8tj43$addEventListener(_el$2, "click", $8tj43$catchify1(ev => router_.navigate_.go_to_({
8125
+ new_url_: href(),
8126
+ is_replace_: false,
8127
+ event_: ev,
8128
+ force_spa_navigation_: true,
8129
+ listing_query_: {
8130
+ id: display_accessor().listing_id,
8131
+ type: $397620a4d7958ed1$export$74ee7529ce0f8a00
8132
+ }
8133
+ })), true);
8124
8134
  $8tj43$insert(_el$2, () => display_accessor().title);
8125
8135
  $8tj43$effect(() => $8tj43$setAttribute(_el$2, "href", href()));
8126
8136
  $8tj43$runHydrationEvents();
@@ -8151,11 +8161,12 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
8151
8161
  let {
8152
8162
  quicklinks_data_: quicklinks_data_,
8153
8163
  router_: router_,
8154
- current_listing_id_: current_listing_id_,
8164
+ id_to_query_for_: id_to_query_for_,
8155
8165
  breadcrumb_data_: breadcrumb_data_,
8156
8166
  i18n_: i18n_,
8157
8167
  sorting_query_param_: sorting_query_param_,
8158
- filter_query_param_prefix_: filter_query_param_prefix_
8168
+ filter_query_param_prefix_: filter_query_param_prefix_,
8169
+ id_type_: id_type_
8159
8170
  } = _ref;
8160
8171
  let scrolling_logic_ran_for_listing_id = false;
8161
8172
  let last_scroll_position;
@@ -8163,13 +8174,13 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
8163
8174
  let last_was_placeholder = false;
8164
8175
  let sliding_element;
8165
8176
  $8tj43$createComputed(() => {
8166
- current_listing_id_();
8177
+ id_to_query_for_();
8167
8178
  scrolling_logic_ran_for_listing_id = false;
8168
8179
  });
8169
8180
  const place_holdey_quicklinks_data = $8tj43$createMemo(() => quicklinks_data_() || [,,,]);
8170
8181
  const selected_index = $8tj43$createMemo(() => {
8171
8182
  var _quicklinks_data_;
8172
- return (_quicklinks_data_ = quicklinks_data_()) === null || _quicklinks_data_ === void 0 ? void 0 : _quicklinks_data_.findIndex(item => item.listing_id === current_listing_id_());
8183
+ return (_quicklinks_data_ = quicklinks_data_()) === null || _quicklinks_data_ === void 0 ? void 0 : _quicklinks_data_.findIndex(item => item[id_type_() === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id" : "listing_id"] === id_to_query_for_());
8173
8184
  }); // this will be -1 when viewing child categories
8174
8185
  const scrollpos_per_listing_id = {};
8175
8186
  const mutation_plugins = [function () {
@@ -8179,7 +8190,7 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
8179
8190
  } = this.insert_here;
8180
8191
  if (scrollLeft > 0) {
8181
8192
  last_scroll_position = scrollLeft;
8182
- const current_id = $8tj43$untrack(current_listing_id_);
8193
+ const current_id = $8tj43$untrack(id_to_query_for_);
8183
8194
  // make sure to not save position where selected item isn't in viewport
8184
8195
  const current_selected_index = $8tj43$untrack(selected_index);
8185
8196
  const intersecting_thing = this.intersecting_items_object[current_selected_index];
@@ -8245,7 +8256,7 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
8245
8256
  equals: false
8246
8257
  }), new_data => {
8247
8258
  const quicklinks_data = quicklinks_data_(); // this signal should have updated by now since this is a createEffect
8248
- const current_id = current_listing_id_();
8259
+ const current_id = id_to_query_for_();
8249
8260
  if (!new_data || !quicklinks_data || !current_id) return;
8250
8261
  const owner = $8tj43$getOwner();
8251
8262
  queueMicrotask(() => {
@@ -8295,13 +8306,9 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
8295
8306
  // Solution: instead of not adding the state to the url, add a flag to the link if it's a sibling and then display the toast on load if the flag is set
8296
8307
  const is_sibling = $8tj43$createMemo(() => {
8297
8308
  var _quicklinks_data_2;
8298
- const current_id = current_listing_id_();
8299
- return (_quicklinks_data_2 = quicklinks_data_()) === null || _quicklinks_data_2 === void 0 ? void 0 : _quicklinks_data_2.some(_ref3 => {
8300
- let {
8301
- listing_id: listing_id
8302
- } = _ref3;
8303
- return listing_id === current_id;
8304
- });
8309
+ const current_id = id_to_query_for_();
8310
+ const lookForId = id_type_() === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id" : "listing_id";
8311
+ return (_quicklinks_data_2 = quicklinks_data_()) === null || _quicklinks_data_2 === void 0 ? void 0 : _quicklinks_data_2.some(quickLink => quickLink[lookForId] === current_id);
8305
8312
  });
8306
8313
  const href = $8tj43$createMemo(() => {
8307
8314
  var _display_accessor;
@@ -8321,20 +8328,20 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
8321
8328
  const url = href();
8322
8329
  if (is_selected() && !ev.metaKey && !ev.ctrlKey && !ev.button || !url)
8323
8330
  // allow open currently selected one in new tab but otherwise prevent clicks
8324
- ev.preventDefault();else if (href()) {
8325
- var _display_accessor2;
8326
- router_.navigate_.go_to_({
8327
- new_url_: url,
8328
- is_replace_: false,
8329
- event_: ev,
8330
- force_spa_navigation_: true,
8331
- listing_id_: (_display_accessor2 = display_accessor()) === null || _display_accessor2 === void 0 ? void 0 : _display_accessor2.listing_id
8332
- });
8333
- }
8331
+ ev.preventDefault();else if (href()) router_.navigate_.go_to_({
8332
+ new_url_: url,
8333
+ is_replace_: false,
8334
+ event_: ev,
8335
+ force_spa_navigation_: true,
8336
+ listing_query_: {
8337
+ id: display_accessor().listing_id,
8338
+ type: $397620a4d7958ed1$export$74ee7529ce0f8a00
8339
+ }
8340
+ });
8334
8341
  }), true);
8335
8342
  $8tj43$insert(_el$3, () => {
8336
- var _display_accessor3;
8337
- return ((_display_accessor3 = display_accessor()) === null || _display_accessor3 === void 0 ? void 0 : _display_accessor3.title) || $8tj43$createComponent((0, $ceafb6fb91c6f394$export$89c6019e4baa40b1), {
8343
+ var _display_accessor2;
8344
+ return ((_display_accessor2 = display_accessor()) === null || _display_accessor2 === void 0 ? void 0 : _display_accessor2.title) || $8tj43$createComponent((0, $ceafb6fb91c6f394$export$89c6019e4baa40b1), {
8338
8345
  height: "1em",
8339
8346
  width: "10ch"
8340
8347
  });
@@ -8496,13 +8503,14 @@ let $c3820807ac1e6fd7$export$44dad306455dddf;
8496
8503
  function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
8497
8504
  let {
8498
8505
  crumb_data_: crumb_data_,
8499
- listing_id_: listing_id_,
8506
+ id_to_query_for_: id_to_query_for_,
8500
8507
  i18n_: i18n_,
8501
8508
  selected_filters_: selected_filters_,
8502
8509
  local_filter_cache_: local_filter_cache_,
8503
8510
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
8504
8511
  plp_results_: plp_results_,
8505
- sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
8512
+ sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
8513
+ id_type_: id_type_
8506
8514
  } = _ref;
8507
8515
  // If we just got opened in a new tab, clear filters instantly and remove the flag
8508
8516
  $a4777acaffa35a82$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
@@ -8513,17 +8521,21 @@ function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
8513
8521
  i18n_: i18n_,
8514
8522
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
8515
8523
  });
8516
- // Code below is for when we're already open and the user navigates to a new category
8524
+ // The code below is for when we're already open and the user navigates to a new category
8517
8525
  let previous_crumb_data = $8tj43$untrack(crumb_data_);
8518
- let listing_id_when_we_got_previous_data = $8tj43$untrack(listing_id_);
8526
+ let id_when_we_got_previous_data = {
8527
+ id_: $8tj43$untrack(id_to_query_for_),
8528
+ type_: $8tj43$untrack(id_type_)
8529
+ };
8519
8530
  let allow_filter_clearing = true; // set to false when going backwards/forwards
8520
8531
  // temporarily disable filter clearing when going backwards/forwards
8521
8532
  const handler = () => allow_filter_clearing = false;
8522
8533
  window.addEventListener("popstate", handler); // popstate only gets called when using back/forwards button of browser or the history navigate to achieve the same, but not on pushState or replaceState
8523
8534
  $8tj43$onCleanup(() => window.removeEventListener("popstate", handler));
8524
8535
  $8tj43$createEffect($8tj43$on(crumb_data_, $8tj43$catchify1(new_crumb_data => {
8525
- const listing_id_of_new_data = listing_id_();
8526
- if (allow_filter_clearing && previous_crumb_data && new_crumb_data && listing_id_of_new_data !== listing_id_when_we_got_previous_data) {
8536
+ const id_of_new_data = id_to_query_for_();
8537
+ const type_of_id_of_new_data = id_type_();
8538
+ if (allow_filter_clearing && previous_crumb_data && new_crumb_data && (id_of_new_data !== id_when_we_got_previous_data.id_ || type_of_id_of_new_data !== id_when_we_got_previous_data.type_)) {
8527
8539
  const previous_length = previous_crumb_data.length;
8528
8540
  const new_length = new_crumb_data.length;
8529
8541
  const went_upwards = new_length < previous_length;
@@ -8549,7 +8561,10 @@ function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
8549
8561
  sideways_filter_clearing_flag_[1](false);
8550
8562
  }
8551
8563
  }
8552
- listing_id_when_we_got_previous_data = listing_id_of_new_data;
8564
+ id_when_we_got_previous_data = {
8565
+ id_: id_of_new_data,
8566
+ type_: type_of_id_of_new_data
8567
+ };
8553
8568
  previous_crumb_data = new_crumb_data;
8554
8569
  if (!allow_filter_clearing) allow_filter_clearing = true;
8555
8570
  })));
@@ -8582,7 +8597,7 @@ function $a4777acaffa35a82$var$clear_if_opened_new_tab_with_sideways_url_params_
8582
8597
  });
8583
8598
  tracking_function_for_plp_results(plp_results_);
8584
8599
  }
8585
- const $1145661fd3ca5519$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=statement style=white-space:pre-wrap>No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId.`),
8600
+ const $1145661fd3ca5519$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=statement style=white-space:pre-wrap>No \`id\` specified in \`listingQuery\`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.`),
8586
8601
  $1145661fd3ca5519$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div class=buttons><button class="ok major">`);
8587
8602
  function $1145661fd3ca5519$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8588
8603
  if (!(0, $8tj43$is_debug)) return; // Just to make sure we don't show this in production
@@ -8594,7 +8609,7 @@ function $1145661fd3ca5519$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8594
8609
  return $8tj43$runWithOwner(owner, () => $8tj43$createEffect(() => {
8595
8610
  if (!document.documentElement.contains(element)) return;
8596
8611
  if (!listing_id()) {
8597
- const warning = "No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId.";
8612
+ const warning = "No `id` specified in `listingQuery`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.";
8598
8613
  $8tj43$dwarn(warning);
8599
8614
  const {
8600
8615
  close_toast_: close_toast_
@@ -8654,8 +8669,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8654
8669
  var _on_filters_construct;
8655
8670
  let {
8656
8671
  depict_api_: depict_api_,
8657
- listing_id_: listing_id_,
8658
- meta_title_suffix_: meta_title_suffix_,
8672
+ id_to_query_for_: id_to_query_for_,
8673
+ id_type_: id_type_,
8659
8674
  current_sorting_: current_sorting_,
8660
8675
  min_products_to_fetch_: min_products_to_fetch_,
8661
8676
  category_filters_open_: category_filters_open_,
@@ -8708,7 +8723,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8708
8723
  merchant: merchant_(),
8709
8724
  market: market_(),
8710
8725
  locale: backend_locale_(),
8711
- listing_id: listing_id_(),
8726
+ id_to_query_for_: id_to_query_for_(),
8727
+ id_type_: id_type_(),
8712
8728
  ...(f.length ? {
8713
8729
  filters: f
8714
8730
  } : {}),
@@ -8720,8 +8736,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8720
8736
  // Make "Get products in listing" request to get products in listing
8721
8737
  const [plp_products_] = $8tj43$createResource(products_query_base_,
8722
8738
  // only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
8723
- $8tj43$catchify1(base_query => $5e6abec0dab4e610$export$cc42dd29bf655ab6({
8724
- id_: $8tj43$untrack(listing_id_),
8739
+ $8tj43$catchify(base_query => $5e6abec0dab4e610$export$cc42dd29bf655ab6({
8740
+ id_: $8tj43$untrack(id_to_query_for_),
8725
8741
  scroll_restoration_data_: scroll_restoration_data_,
8726
8742
  min_products_to_fetch_: min_products_to_fetch_,
8727
8743
  make_request_: (limit, cursor) => depict_api_.get_listing_products({
@@ -8736,10 +8752,11 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8736
8752
  merchant: merchant_(),
8737
8753
  market: market_(),
8738
8754
  locale: backend_locale_(),
8739
- listing_id: listing_id_()
8755
+ id_to_query_for_: id_to_query_for_(),
8756
+ id_type_: id_type_()
8740
8757
  }));
8741
8758
  // Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
8742
- const [plp_meta] = $8tj43$createResource(meta_query_base, $8tj43$catchify1(query => depict_api_.get_listing(query)));
8759
+ const [plp_meta] = $8tj43$createResource(meta_query_base, $8tj43$catchify(query => depict_api_.get_listing(query)));
8743
8760
  const available_sortings_ = $8tj43$createMemo(() => {
8744
8761
  var _plp_products_, _plp_products_$sorts;
8745
8762
  return (_plp_products_ = plp_products_()) === null || _plp_products_ === void 0 ? void 0 : (_plp_products_$sorts = _plp_products_.sorts) === null || _plp_products_$sorts === void 0 ? void 0 : _plp_products_$sorts.map(sort => {
@@ -8763,17 +8780,6 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8763
8780
  var _plp_meta2;
8764
8781
  return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
8765
8782
  });
8766
- const meta_tag_data_ = $8tj43$createMemo(() => {
8767
- var _plp_meta3;
8768
- if ((_plp_meta3 = plp_meta()) !== null && _plp_meta3 !== void 0 && _plp_meta3.replace_meta_tags) {
8769
- var _plp_meta4, _plp_meta5;
8770
- return {
8771
- title: ((_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.title) + (meta_title_suffix_() || ""),
8772
- description: (_plp_meta5 = plp_meta()) === null || _plp_meta5 === void 0 ? void 0 : _plp_meta5.description
8773
- };
8774
- }
8775
- });
8776
- $8tj43$edit_current_page_meta_tags(meta_tag_data_);
8777
8783
  const [sort_or_filter_open_, set_sort_or_filter_open_] = $8tj43$createSignal(false);
8778
8784
  const [desktop_filter_elements_, set_desktop_filter_elements] = $8tj43$createSignal();
8779
8785
  const formatted_number_of_results_ = $43fbdca0f726a34b$export$92f2da32c6e7e7ee({
@@ -8847,7 +8853,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8847
8853
  }));
8848
8854
  results_for = make_product_count_();
8849
8855
  } else {
8850
- $8tj43$report(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
8856
+ $8tj43$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
8851
8857
  results_for = $8tj43$getNextElement($4b4b262708b516ee$var$_tmpl$2);
8852
8858
  }
8853
8859
  const filters_opener = $7396052a1484264f$export$d7841e452f2e59a8({
@@ -8869,17 +8875,17 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8869
8875
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
8870
8876
  ...extra_sort_and_filter_args_
8871
8877
  });
8872
- $8tj43$catchify1((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
8878
+ $8tj43$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
8873
8879
  scroll_restoration_data_: scroll_restoration_data_,
8874
8880
  last_result_in_viewport_: last_result_in_viewport_,
8875
- id_: listing_id_,
8881
+ id_: id_to_query_for_,
8876
8882
  can_write_scroll_restoration_: can_write_scroll_restoration_
8877
8883
  });
8878
8884
  (_on_filters_construct = on_filters_constructed_) === null || _on_filters_construct === void 0 || _on_filters_construct();
8879
8885
  $8tj43$createComputed(() => {
8880
8886
  if (plp_products_.loading) set_can_write_scroll_restoration(false);else if (plp_products_()) set_can_write_scroll_restoration(true);
8881
8887
  });
8882
- $8tj43$createRenderEffect($8tj43$catchify1(async () => {
8888
+ $8tj43$createRenderEffect($8tj43$catchify(async () => {
8883
8889
  var _only_show_filters_op;
8884
8890
  const slim = is_slim_();
8885
8891
  const only_show_filters_opener = (_only_show_filters_op = only_show_filters_opener_) === null || _only_show_filters_op === void 0 ? void 0 : _only_show_filters_op();
@@ -8902,14 +8908,15 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8902
8908
  available_filters_: available_filters_
8903
8909
  });
8904
8910
  $a4777acaffa35a82$export$3945d6db2dfd3d12({
8905
- listing_id_: listing_id_,
8911
+ id_to_query_for_: id_to_query_for_,
8906
8912
  crumb_data_: crumb_data_,
8907
8913
  i18n_: i18n_,
8908
8914
  selected_filters_: selected_filters_,
8909
8915
  local_filter_cache_: local_filter_cache_,
8910
8916
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
8911
8917
  plp_results_: plp_products_,
8912
- sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
8918
+ sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
8919
+ id_type_: id_type_
8913
8920
  });
8914
8921
  get_breadcrumb_accessor_ === null || get_breadcrumb_accessor_ === void 0 || get_breadcrumb_accessor_(crumb_data_);
8915
8922
  get_quicklinks_accessor_ === null || get_quicklinks_accessor_ === void 0 || get_quicklinks_accessor_(quicklinks_data_);
@@ -8932,7 +8939,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8932
8939
  [_el$28, _co$11] = $8tj43$getNextMarker(_el$27.nextSibling),
8933
8940
  _el$29 = _el$28.nextSibling,
8934
8941
  [_el$30, _co$12] = $8tj43$getNextMarker(_el$29.nextSibling);
8935
- $8tj43$use(el => process.env.NODE_ENV === "development" && $1145661fd3ca5519$export$7af06a63c5a976c9(el, listing_id_, i18n_), _el$13);
8942
+ $8tj43$use(el => process.env.NODE_ENV === "development" && $1145661fd3ca5519$export$7af06a63c5a976c9(el, id_to_query_for_, i18n_), _el$13);
8936
8943
  $8tj43$insert(_el$14, $8tj43$createComponent((0, $8tj43$Show), {
8937
8944
  get when() {
8938
8945
  return show_breadcrumbs_();
@@ -8954,7 +8961,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8954
8961
  get children() {
8955
8962
  return $8tj43$createComponent((0, $43fbb365ed0ac99e$export$466cdc317043f6cb), {
8956
8963
  quicklinks_data_: quicklinks_data_,
8957
- current_listing_id_: listing_id_,
8964
+ id_to_query_for_: id_to_query_for_,
8965
+ id_type_: id_type_,
8958
8966
  router_: router_,
8959
8967
  breadcrumb_data_: crumb_data_,
8960
8968
  i18n_: i18n_,
@@ -9009,7 +9017,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
9009
9017
  sort_or_filter_open_: sort_or_filter_open_,
9010
9018
  desktop_filter_elements_: desktop_filter_elements_,
9011
9019
  content_blocks_by_row_: content_blocks_by_row_,
9012
- id_currently_querying_for_: listing_id_,
9020
+ id_currently_querying_for_: id_to_query_for_,
9013
9021
  no_results_options_: {
9014
9022
  selected_filters_: selected_filters_,
9015
9023
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
@@ -9058,10 +9066,10 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
9058
9066
  * Adds the current page as last breadcrumb to the breadcrumb trail
9059
9067
  */
9060
9068
  function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta, title) {
9061
- const href_accessor = $8tj43$use_href_accessor1();
9069
+ const href_accessor = $8tj43$use_href_accessor();
9062
9070
  return $8tj43$createMemo(() => {
9063
- var _plp_meta6;
9064
- const api_value = (_plp_meta6 = plp_meta()) === null || _plp_meta6 === void 0 ? void 0 : _plp_meta6.breadcrumbs;
9071
+ var _plp_meta3;
9072
+ const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
9065
9073
  if (!api_value) return api_value;
9066
9074
  return [...api_value, {
9067
9075
  get listing_id() {
@@ -9075,6 +9083,12 @@ function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta, title) {
9075
9083
  },
9076
9084
  get slug() {
9077
9085
  return plp_meta().slug;
9086
+ },
9087
+ get listing_type() {
9088
+ return plp_meta().listing_type;
9089
+ },
9090
+ get external_id() {
9091
+ return plp_meta().external_id;
9078
9092
  }
9079
9093
  }];
9080
9094
  });
@@ -9284,8 +9298,7 @@ var $f5f54892fd0c7d9f$var$_router = /*#__PURE__*/new WeakMap();
9284
9298
  var $f5f54892fd0c7d9f$var$_localization_signal = /*#__PURE__*/new WeakMap();
9285
9299
  var $f5f54892fd0c7d9f$var$_merchant_signal = /*#__PURE__*/new WeakMap();
9286
9300
  var $f5f54892fd0c7d9f$var$_market_signal = /*#__PURE__*/new WeakMap();
9287
- var $f5f54892fd0c7d9f$var$_listing_id_signal = /*#__PURE__*/new WeakMap();
9288
- var $f5f54892fd0c7d9f$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
9301
+ var $f5f54892fd0c7d9f$var$_listing_query_signal = /*#__PURE__*/new WeakMap();
9289
9302
  var $f5f54892fd0c7d9f$var$_disable_override_listing_id = /*#__PURE__*/new WeakMap();
9290
9303
  class $f5f54892fd0c7d9f$export$f34314aa9505732e {
9291
9304
  get localization() {
@@ -9295,11 +9308,11 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
9295
9308
  set localization(locale_obj) {
9296
9309
  $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[1](locale_obj);
9297
9310
  }
9298
- get listing_id() {
9299
- return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_id_signal)[0]();
9311
+ get listing_query() {
9312
+ return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_query_signal)[0]();
9300
9313
  }
9301
- set listing_id(id) {
9302
- $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_id_signal)[1](id);
9314
+ set listing_query(query) {
9315
+ $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_query_signal)[1](query);
9303
9316
  }
9304
9317
  get merchant() {
9305
9318
  return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_merchant_signal)[0]();
@@ -9313,12 +9326,6 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
9313
9326
  set market(market) {
9314
9327
  $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_market_signal)[1](market);
9315
9328
  }
9316
- get meta_title_suffix() {
9317
- return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_)[0]();
9318
- }
9319
- set meta_title_suffix(new_suffix) {
9320
- $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_)[1](new_suffix);
9321
- }
9322
9329
  get disable_override_listing_id() {
9323
9330
  return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_disable_override_listing_id)[0]();
9324
9331
  }
@@ -9338,7 +9345,7 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
9338
9345
  on_navigation: on_navigation,
9339
9346
  display_transformers: display_transformers,
9340
9347
  unique_instance_key_for_state = "",
9341
- listing_id_state_key: listing_id_state_key,
9348
+ listing_query_state_key: listing_query_state_key,
9342
9349
  ...props_on_class
9343
9350
  } = _ref2;
9344
9351
  $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_router, {
@@ -9357,13 +9364,9 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
9357
9364
  writable: true,
9358
9365
  value: $8tj43$createSignal()
9359
9366
  });
9360
- $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_listing_id_signal, {
9361
- writable: true,
9362
- value: $8tj43$createSignal("")
9363
- });
9364
- $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_, {
9367
+ $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_listing_query_signal, {
9365
9368
  writable: true,
9366
- value: $8tj43$createSignal()
9369
+ value: $8tj43$createSignal({})
9367
9370
  });
9368
9371
  $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_disable_override_listing_id, {
9369
9372
  writable: true,
@@ -9376,7 +9379,7 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
9376
9379
  throw new Error("You can only have one instance of DepictCategory with the same uniqueInstanceKeyForState");
9377
9380
  Object.assign(this, props_on_class); // set initial signal values
9378
9381
  $68e6625c8d51f847$export$5162a71f252e6122();
9379
- $8tj43$babelruntimehelpersclassPrivateFieldSet(this, $f5f54892fd0c7d9f$var$_router, new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation", listing_id_state_key));
9382
+ $8tj43$babelruntimehelpersclassPrivateFieldSet(this, $f5f54892fd0c7d9f$var$_router, new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation", listing_query_state_key));
9380
9383
  if (on_navigation) $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_router).on_navigation_ = on_navigation;
9381
9384
  const override_listing_id_query_param_names_ = ["listing_id_" + unique_instance_key_for_state, "listing_id"]; // If you're wondering why this is an array https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7958#note_1511700842
9382
9385
  const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
@@ -9445,14 +9448,16 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
9445
9448
  category_title: category_title
9446
9449
  } = props;
9447
9450
  const shared_properties = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
9451
+ const diffableListingQuery = $8tj43$createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
9448
9452
  return $83e8cf2c0b87a58a$export$23fca46f3143581f(() => {
9449
9453
  $8tj43$createEffect(prev => {
9450
9454
  // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
9451
- const id = depict_category.listing_id; // <- this is a reactive getter
9452
- $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_id_change)(id, prev);
9453
- return id;
9455
+ diffableListingQuery(); // Only re-run this effect when the listing query *actually* changes (not just the object reference)
9456
+ const newId = $8tj43$untrack(() => depict_category.listing_query);
9457
+ $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)(newId, prev);
9458
+ return newId;
9454
9459
  });
9455
- $8tj43$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_id_change)());
9460
+ $8tj43$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)());
9456
9461
  const grid_spacing_override = $8tj43$createMemo(() => {
9457
9462
  const {
9458
9463
  grid_spacing: grid_spacing
@@ -9493,8 +9498,11 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
9493
9498
  depict_api_: depict_api_,
9494
9499
  min_products_to_fetch_: $f5f54892fd0c7d9f$var$min_products_to_fetch_,
9495
9500
  local_filter_cache_: local_filter_cache_,
9496
- listing_id_: $8tj43$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_id),
9497
- meta_title_suffix_: () => depict_category.meta_title_suffix,
9501
+ id_to_query_for_: $8tj43$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
9502
+ id_type_: $8tj43$createMemo(() => {
9503
+ if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $397620a4d7958ed1$export$74ee7529ce0f8a00;
9504
+ return depict_category.listing_query.type;
9505
+ }),
9498
9506
  i18n_: i18n_,
9499
9507
  show_quicklinks_: $8tj43$createMemo(() => {
9500
9508
  var _props$show_quicklink;
@@ -9562,13 +9570,16 @@ function $f5f54892fd0c7d9f$export$de035477d6fef996(_ref4) {
9562
9570
  sorting_query_param_: sorting_query_param_,
9563
9571
  filter_query_param_prefix_: filter_query_param_prefix_
9564
9572
  } = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
9573
+ const id_to_query_for_ = $8tj43$createMemo(() => depict_category.listing_query.id);
9574
+ const id_type_ = $8tj43$createMemo(() => depict_category.listing_query.type);
9565
9575
  return $8tj43$createComponent($f5f54892fd0c7d9f$var$InExternalAreaDiv, {
9566
9576
  get children() {
9567
9577
  return $43fbb365ed0ac99e$export$466cdc317043f6cb({
9568
9578
  i18n_: i18n_,
9569
9579
  quicklinks_data_: quicklinks_data_,
9570
9580
  router_: router_,
9571
- current_listing_id_: () => depict_category.listing_id,
9581
+ id_type_: id_type_,
9582
+ id_to_query_for_: id_to_query_for_,
9572
9583
  breadcrumb_data_: breadcrumb_data_,
9573
9584
  sorting_query_param_: sorting_query_param_,
9574
9585
  filter_query_param_prefix_: filter_query_param_prefix_
@@ -10754,7 +10765,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
10754
10765
  const _el$3 = $8tj43$getNextElement($40dd3f46f55d62ba$var$_tmpl$3);
10755
10766
  $8tj43$insert(_el$3, $8tj43$createMemo(() => {
10756
10767
  if (input_obj().type === "content") return i18n_.content_();
10757
- if (input_obj().category_type === "brand") return i18n_.brand_();
10768
+ if (input_obj().listing_type === "brand") return i18n_.brand_();
10758
10769
  return i18n_.category_();
10759
10770
  }));
10760
10771
  return _el$3;
@@ -11023,7 +11034,7 @@ function $2ebb1d6ae6763f7a$var$actual_navigation_working_on_fake_data(_ref2) {
11023
11034
  url.searchParams.set(search_query_param_name_, title);
11024
11035
  return $76b6e14a50da4597$export$1efe1013da60d0e4(e, url.href);
11025
11036
  }));
11026
- } else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "category" || (selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) === "content") $8tj43$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
11037
+ } else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "listing" || (selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) === "content") $8tj43$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
11027
11038
  const {
11028
11039
  page_url: page_url
11029
11040
  } = selected_entry;
@@ -11575,7 +11586,7 @@ function $754f319a849bfdbc$export$c05a196222ba1302(_ref) {
11575
11586
  } = _ref;
11576
11587
  const category_suggestions_ = $8tj43$createMemo(() => {
11577
11588
  var _suggestions_;
11578
- return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "category");
11589
+ return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "listing");
11579
11590
  });
11580
11591
  return $8tj43$createComponent((0, $8tj43$Show), {
11581
11592
  get when() {