@depict-ai/ui 3.0.3 → 3.0.4
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.cjs +133 -132
- package/ES10/index.d.ts +211 -201
- package/ES10/index.js +135 -134
- package/latest/index.cjs +110 -94
- package/latest/index.d.ts +211 -201
- package/latest/index.js +112 -96
- package/package.json +4 -4
- package/server/ES10/index.cjs +108 -107
- package/server/ES10/index.d.ts +211 -201
- package/server/ES10/index.js +110 -109
- package/server/latest/index.cjs +99 -89
- package/server/latest/index.d.ts +211 -201
- package/server/latest/index.js +101 -91
- package/locales/require.js +0 -1152
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,
|
|
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.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.4";
|
|
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,
|
|
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, "
|
|
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
|
-
|
|
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 (
|
|
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.
|
|
452
|
-
new_state[this.
|
|
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.
|
|
463
|
+
this.listing_query_state_key = listing_query_state_key;
|
|
464
464
|
this.on_navigation_ = on_navigation;
|
|
465
465
|
}
|
|
466
466
|
}
|
|
@@ -5757,6 +5757,8 @@ function $ed0fefda39a0f15d$export$967e966fca9515e(api_response) {
|
|
|
5757
5757
|
}
|
|
5758
5758
|
return api_response;
|
|
5759
5759
|
}
|
|
5760
|
+
const $397620a4d7958ed1$export$74ee7529ce0f8a00 = "listingId";
|
|
5761
|
+
const $397620a4d7958ed1$export$5aae649db1b959fc = "externalId";
|
|
5760
5762
|
function $284849364a6ef73a$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
5761
5763
|
$284849364a6ef73a$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
5762
5764
|
privateSet.add(obj);
|
|
@@ -5865,9 +5867,14 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
5865
5867
|
})
|
|
5866
5868
|
});
|
|
5867
5869
|
}
|
|
5868
|
-
async get_listing(
|
|
5870
|
+
async get_listing(_ref) {
|
|
5871
|
+
let {
|
|
5872
|
+
id_type_: id_type_,
|
|
5873
|
+
id_to_query_for_: id_to_query_for_,
|
|
5874
|
+
...input_req
|
|
5875
|
+
} = _ref;
|
|
5869
5876
|
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(
|
|
5877
|
+
endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + (id_type_ === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_),
|
|
5871
5878
|
input_req_: input_req,
|
|
5872
5879
|
fallback_response_: () => ({
|
|
5873
5880
|
listing_id: "",
|
|
@@ -5881,20 +5888,18 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
5881
5888
|
"quick_links": [],
|
|
5882
5889
|
failed: true
|
|
5883
5890
|
}),
|
|
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
|
|
5891
|
+
method_: "GET"
|
|
5886
5892
|
});
|
|
5887
5893
|
}
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
...
|
|
5893
|
-
};
|
|
5894
|
-
delete cloned_request["listing_id"];
|
|
5894
|
+
async get_listing_products(_ref2) {
|
|
5895
|
+
let {
|
|
5896
|
+
id_to_query_for_: id_to_query_for_,
|
|
5897
|
+
id_type_: id_type_,
|
|
5898
|
+
...input_req_
|
|
5899
|
+
} = _ref2;
|
|
5895
5900
|
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(
|
|
5897
|
-
input_req_:
|
|
5901
|
+
endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + (id_type_ === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_) + "/products",
|
|
5902
|
+
input_req_: input_req_,
|
|
5898
5903
|
fallback_response_: () => ({
|
|
5899
5904
|
"n_hits": 0,
|
|
5900
5905
|
"displays": [],
|
|
@@ -5932,7 +5937,7 @@ async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
5932
5937
|
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
5933
5938
|
if (!category_transformer) return response;
|
|
5934
5939
|
// find category suggestions, run thing with them, and then replace them
|
|
5935
|
-
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "
|
|
5940
|
+
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
|
|
5936
5941
|
const transformed_category_suggestions = await category_transformer({
|
|
5937
5942
|
market: market,
|
|
5938
5943
|
merchant: merchant,
|
|
@@ -5978,15 +5983,14 @@ async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchan
|
|
|
5978
5983
|
});
|
|
5979
5984
|
return input_data;
|
|
5980
5985
|
}
|
|
5981
|
-
async function $284849364a6ef73a$var$_cached_request2(
|
|
5986
|
+
async function $284849364a6ef73a$var$_cached_request2(_ref3) {
|
|
5982
5987
|
var _classPrivateFieldGet5, _cache_obj$cache_$bod, _cache_obj$cache_$bod2;
|
|
5983
5988
|
let {
|
|
5984
5989
|
endpoint_: endpoint_,
|
|
5985
5990
|
input_req_: input_req_,
|
|
5986
5991
|
fallback_response_: fallback_response_,
|
|
5987
|
-
method_ = "POST"
|
|
5988
|
-
|
|
5989
|
-
} = _ref;
|
|
5992
|
+
method_ = "POST"
|
|
5993
|
+
} = _ref3;
|
|
5990
5994
|
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
5995
|
const with_ids = $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $284849364a6ef73a$var$_add_ids_to_request).call(this, input_req_);
|
|
5992
5996
|
const metaData = await ((_classPrivateFieldGet5 = $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $284849364a6ef73a$var$_get_metadata)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.call(this));
|
|
@@ -6003,7 +6007,6 @@ async function $284849364a6ef73a$var$_cached_request2(_ref) {
|
|
|
6003
6007
|
cache_obj.in_progress_[body] = new Promise(r => resolve_in_progress = r);
|
|
6004
6008
|
try {
|
|
6005
6009
|
const is_post = method_ === "POST";
|
|
6006
|
-
if (!is_post && delete_key_before_sending_) delete sorted_request[delete_key_before_sending_];
|
|
6007
6010
|
const url_to_request = is_post ? endpoint_ : $8tj43$make_url_with_query_params(endpoint_, sorted_request);
|
|
6008
6011
|
const api_response = await $8tj43$fetch_retry($8tj43$add_version_query_params(url_to_request), {
|
|
6009
6012
|
method: method_,
|
|
@@ -6377,7 +6380,7 @@ function $6d2962bc9370f884$export$5e4aed86c12acdd9(_ref) {
|
|
|
6377
6380
|
// After first load, always just load 20 since people might just be browsing the top ones still
|
|
6378
6381
|
min_products_to_fetch_ : now - last_loaded < 10000 ? min_products_to_fetch_ * 5 : min_products_to_fetch_;
|
|
6379
6382
|
// 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_["
|
|
6383
|
+
const api_response = await depict_api_["query" in base_part ? "query" : "get_listing_products"]({
|
|
6381
6384
|
cursor: get_last_cursor(),
|
|
6382
6385
|
limit: number_of_results_to_load,
|
|
6383
6386
|
...base_part
|
|
@@ -8111,16 +8114,16 @@ function $52efc9ae4382e25a$export$5646050d516e06bc(_ref) {
|
|
|
8111
8114
|
},
|
|
8112
8115
|
get children() {
|
|
8113
8116
|
const _el$2 = $8tj43$getNextElement($52efc9ae4382e25a$var$_tmpl$2);
|
|
8114
|
-
$8tj43$addEventListener(_el$2, "click", $8tj43$catchify1(ev => {
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
}
|
|
8123
|
-
}), true);
|
|
8117
|
+
$8tj43$addEventListener(_el$2, "click", $8tj43$catchify1(ev => router_.navigate_.go_to_({
|
|
8118
|
+
new_url_: href(),
|
|
8119
|
+
is_replace_: false,
|
|
8120
|
+
event_: ev,
|
|
8121
|
+
force_spa_navigation_: true,
|
|
8122
|
+
listing_query_: {
|
|
8123
|
+
id: display_accessor().listing_id,
|
|
8124
|
+
type: $397620a4d7958ed1$export$74ee7529ce0f8a00
|
|
8125
|
+
}
|
|
8126
|
+
})), true);
|
|
8124
8127
|
$8tj43$insert(_el$2, () => display_accessor().title);
|
|
8125
8128
|
$8tj43$effect(() => $8tj43$setAttribute(_el$2, "href", href()));
|
|
8126
8129
|
$8tj43$runHydrationEvents();
|
|
@@ -8151,11 +8154,12 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
8151
8154
|
let {
|
|
8152
8155
|
quicklinks_data_: quicklinks_data_,
|
|
8153
8156
|
router_: router_,
|
|
8154
|
-
|
|
8157
|
+
id_to_query_for_: id_to_query_for_,
|
|
8155
8158
|
breadcrumb_data_: breadcrumb_data_,
|
|
8156
8159
|
i18n_: i18n_,
|
|
8157
8160
|
sorting_query_param_: sorting_query_param_,
|
|
8158
|
-
filter_query_param_prefix_: filter_query_param_prefix_
|
|
8161
|
+
filter_query_param_prefix_: filter_query_param_prefix_,
|
|
8162
|
+
id_type_: id_type_
|
|
8159
8163
|
} = _ref;
|
|
8160
8164
|
let scrolling_logic_ran_for_listing_id = false;
|
|
8161
8165
|
let last_scroll_position;
|
|
@@ -8163,13 +8167,13 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
8163
8167
|
let last_was_placeholder = false;
|
|
8164
8168
|
let sliding_element;
|
|
8165
8169
|
$8tj43$createComputed(() => {
|
|
8166
|
-
|
|
8170
|
+
id_to_query_for_();
|
|
8167
8171
|
scrolling_logic_ran_for_listing_id = false;
|
|
8168
8172
|
});
|
|
8169
8173
|
const place_holdey_quicklinks_data = $8tj43$createMemo(() => quicklinks_data_() || [,,,]);
|
|
8170
8174
|
const selected_index = $8tj43$createMemo(() => {
|
|
8171
8175
|
var _quicklinks_data_;
|
|
8172
|
-
return (_quicklinks_data_ = quicklinks_data_()) === null || _quicklinks_data_ === void 0 ? void 0 : _quicklinks_data_.findIndex(item => item
|
|
8176
|
+
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
8177
|
}); // this will be -1 when viewing child categories
|
|
8174
8178
|
const scrollpos_per_listing_id = {};
|
|
8175
8179
|
const mutation_plugins = [function () {
|
|
@@ -8179,7 +8183,7 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
8179
8183
|
} = this.insert_here;
|
|
8180
8184
|
if (scrollLeft > 0) {
|
|
8181
8185
|
last_scroll_position = scrollLeft;
|
|
8182
|
-
const current_id = $8tj43$untrack(
|
|
8186
|
+
const current_id = $8tj43$untrack(id_to_query_for_);
|
|
8183
8187
|
// make sure to not save position where selected item isn't in viewport
|
|
8184
8188
|
const current_selected_index = $8tj43$untrack(selected_index);
|
|
8185
8189
|
const intersecting_thing = this.intersecting_items_object[current_selected_index];
|
|
@@ -8245,7 +8249,7 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
8245
8249
|
equals: false
|
|
8246
8250
|
}), new_data => {
|
|
8247
8251
|
const quicklinks_data = quicklinks_data_(); // this signal should have updated by now since this is a createEffect
|
|
8248
|
-
const current_id =
|
|
8252
|
+
const current_id = id_to_query_for_();
|
|
8249
8253
|
if (!new_data || !quicklinks_data || !current_id) return;
|
|
8250
8254
|
const owner = $8tj43$getOwner();
|
|
8251
8255
|
queueMicrotask(() => {
|
|
@@ -8295,13 +8299,9 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
8295
8299
|
// 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
8300
|
const is_sibling = $8tj43$createMemo(() => {
|
|
8297
8301
|
var _quicklinks_data_2;
|
|
8298
|
-
const current_id =
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
listing_id: listing_id
|
|
8302
|
-
} = _ref3;
|
|
8303
|
-
return listing_id === current_id;
|
|
8304
|
-
});
|
|
8302
|
+
const current_id = id_to_query_for_();
|
|
8303
|
+
const lookForId = id_type_() === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id" : "listing_id";
|
|
8304
|
+
return (_quicklinks_data_2 = quicklinks_data_()) === null || _quicklinks_data_2 === void 0 ? void 0 : _quicklinks_data_2.some(quickLink => quickLink[lookForId] === current_id);
|
|
8305
8305
|
});
|
|
8306
8306
|
const href = $8tj43$createMemo(() => {
|
|
8307
8307
|
var _display_accessor;
|
|
@@ -8321,20 +8321,20 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
8321
8321
|
const url = href();
|
|
8322
8322
|
if (is_selected() && !ev.metaKey && !ev.ctrlKey && !ev.button || !url)
|
|
8323
8323
|
// allow open currently selected one in new tab but otherwise prevent clicks
|
|
8324
|
-
ev.preventDefault();else if (href()) {
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
}
|
|
8333
|
-
}
|
|
8324
|
+
ev.preventDefault();else if (href()) router_.navigate_.go_to_({
|
|
8325
|
+
new_url_: url,
|
|
8326
|
+
is_replace_: false,
|
|
8327
|
+
event_: ev,
|
|
8328
|
+
force_spa_navigation_: true,
|
|
8329
|
+
listing_query_: {
|
|
8330
|
+
id: display_accessor().listing_id,
|
|
8331
|
+
type: $397620a4d7958ed1$export$74ee7529ce0f8a00
|
|
8332
|
+
}
|
|
8333
|
+
});
|
|
8334
8334
|
}), true);
|
|
8335
8335
|
$8tj43$insert(_el$3, () => {
|
|
8336
|
-
var
|
|
8337
|
-
return ((
|
|
8336
|
+
var _display_accessor2;
|
|
8337
|
+
return ((_display_accessor2 = display_accessor()) === null || _display_accessor2 === void 0 ? void 0 : _display_accessor2.title) || $8tj43$createComponent((0, $ceafb6fb91c6f394$export$89c6019e4baa40b1), {
|
|
8338
8338
|
height: "1em",
|
|
8339
8339
|
width: "10ch"
|
|
8340
8340
|
});
|
|
@@ -8496,13 +8496,14 @@ let $c3820807ac1e6fd7$export$44dad306455dddf;
|
|
|
8496
8496
|
function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
|
|
8497
8497
|
let {
|
|
8498
8498
|
crumb_data_: crumb_data_,
|
|
8499
|
-
|
|
8499
|
+
id_to_query_for_: id_to_query_for_,
|
|
8500
8500
|
i18n_: i18n_,
|
|
8501
8501
|
selected_filters_: selected_filters_,
|
|
8502
8502
|
local_filter_cache_: local_filter_cache_,
|
|
8503
8503
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8504
8504
|
plp_results_: plp_results_,
|
|
8505
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
8505
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
8506
|
+
id_type_: id_type_
|
|
8506
8507
|
} = _ref;
|
|
8507
8508
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
8508
8509
|
$a4777acaffa35a82$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
@@ -8513,17 +8514,21 @@ function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
|
|
|
8513
8514
|
i18n_: i18n_,
|
|
8514
8515
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
8515
8516
|
});
|
|
8516
|
-
//
|
|
8517
|
+
// The code below is for when we're already open and the user navigates to a new category
|
|
8517
8518
|
let previous_crumb_data = $8tj43$untrack(crumb_data_);
|
|
8518
|
-
let
|
|
8519
|
+
let id_when_we_got_previous_data = {
|
|
8520
|
+
id_: $8tj43$untrack(id_to_query_for_),
|
|
8521
|
+
type_: $8tj43$untrack(id_type_)
|
|
8522
|
+
};
|
|
8519
8523
|
let allow_filter_clearing = true; // set to false when going backwards/forwards
|
|
8520
8524
|
// temporarily disable filter clearing when going backwards/forwards
|
|
8521
8525
|
const handler = () => allow_filter_clearing = false;
|
|
8522
8526
|
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
8527
|
$8tj43$onCleanup(() => window.removeEventListener("popstate", handler));
|
|
8524
8528
|
$8tj43$createEffect($8tj43$on(crumb_data_, $8tj43$catchify1(new_crumb_data => {
|
|
8525
|
-
const
|
|
8526
|
-
|
|
8529
|
+
const id_of_new_data = id_to_query_for_();
|
|
8530
|
+
const type_of_id_of_new_data = id_type_();
|
|
8531
|
+
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
8532
|
const previous_length = previous_crumb_data.length;
|
|
8528
8533
|
const new_length = new_crumb_data.length;
|
|
8529
8534
|
const went_upwards = new_length < previous_length;
|
|
@@ -8549,7 +8554,10 @@ function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
|
|
|
8549
8554
|
sideways_filter_clearing_flag_[1](false);
|
|
8550
8555
|
}
|
|
8551
8556
|
}
|
|
8552
|
-
|
|
8557
|
+
id_when_we_got_previous_data = {
|
|
8558
|
+
id_: id_of_new_data,
|
|
8559
|
+
type_: type_of_id_of_new_data
|
|
8560
|
+
};
|
|
8553
8561
|
previous_crumb_data = new_crumb_data;
|
|
8554
8562
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
8555
8563
|
})));
|
|
@@ -8582,7 +8590,7 @@ function $a4777acaffa35a82$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
8582
8590
|
});
|
|
8583
8591
|
tracking_function_for_plp_results(plp_results_);
|
|
8584
8592
|
}
|
|
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.`),
|
|
8593
|
+
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/externalId.`),
|
|
8586
8594
|
$1145661fd3ca5519$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div class=buttons><button class="ok major">`);
|
|
8587
8595
|
function $1145661fd3ca5519$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
8588
8596
|
if (!(0, $8tj43$is_debug)) return; // Just to make sure we don't show this in production
|
|
@@ -8594,7 +8602,7 @@ function $1145661fd3ca5519$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
|
8594
8602
|
return $8tj43$runWithOwner(owner, () => $8tj43$createEffect(() => {
|
|
8595
8603
|
if (!document.documentElement.contains(element)) return;
|
|
8596
8604
|
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.";
|
|
8605
|
+
const warning = "No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.";
|
|
8598
8606
|
$8tj43$dwarn(warning);
|
|
8599
8607
|
const {
|
|
8600
8608
|
close_toast_: close_toast_
|
|
@@ -8654,8 +8662,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8654
8662
|
var _on_filters_construct;
|
|
8655
8663
|
let {
|
|
8656
8664
|
depict_api_: depict_api_,
|
|
8657
|
-
|
|
8658
|
-
|
|
8665
|
+
id_to_query_for_: id_to_query_for_,
|
|
8666
|
+
id_type_: id_type_,
|
|
8659
8667
|
current_sorting_: current_sorting_,
|
|
8660
8668
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
8661
8669
|
category_filters_open_: category_filters_open_,
|
|
@@ -8708,7 +8716,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8708
8716
|
merchant: merchant_(),
|
|
8709
8717
|
market: market_(),
|
|
8710
8718
|
locale: backend_locale_(),
|
|
8711
|
-
|
|
8719
|
+
id_to_query_for_: id_to_query_for_(),
|
|
8720
|
+
id_type_: id_type_(),
|
|
8712
8721
|
...(f.length ? {
|
|
8713
8722
|
filters: f
|
|
8714
8723
|
} : {}),
|
|
@@ -8720,8 +8729,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8720
8729
|
// Make "Get products in listing" request to get products in listing
|
|
8721
8730
|
const [plp_products_] = $8tj43$createResource(products_query_base_,
|
|
8722
8731
|
// 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$
|
|
8724
|
-
id_: $8tj43$untrack(
|
|
8732
|
+
$8tj43$catchify(base_query => $5e6abec0dab4e610$export$cc42dd29bf655ab6({
|
|
8733
|
+
id_: $8tj43$untrack(id_to_query_for_),
|
|
8725
8734
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8726
8735
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
8727
8736
|
make_request_: (limit, cursor) => depict_api_.get_listing_products({
|
|
@@ -8736,10 +8745,11 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8736
8745
|
merchant: merchant_(),
|
|
8737
8746
|
market: market_(),
|
|
8738
8747
|
locale: backend_locale_(),
|
|
8739
|
-
|
|
8748
|
+
id_to_query_for_: id_to_query_for_(),
|
|
8749
|
+
id_type_: id_type_()
|
|
8740
8750
|
}));
|
|
8741
8751
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
8742
|
-
const [plp_meta] = $8tj43$createResource(meta_query_base, $8tj43$
|
|
8752
|
+
const [plp_meta] = $8tj43$createResource(meta_query_base, $8tj43$catchify(query => depict_api_.get_listing(query)));
|
|
8743
8753
|
const available_sortings_ = $8tj43$createMemo(() => {
|
|
8744
8754
|
var _plp_products_, _plp_products_$sorts;
|
|
8745
8755
|
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 +8773,6 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8763
8773
|
var _plp_meta2;
|
|
8764
8774
|
return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
|
|
8765
8775
|
});
|
|
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
8776
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $8tj43$createSignal(false);
|
|
8778
8777
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $8tj43$createSignal();
|
|
8779
8778
|
const formatted_number_of_results_ = $43fbdca0f726a34b$export$92f2da32c6e7e7ee({
|
|
@@ -8847,7 +8846,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8847
8846
|
}));
|
|
8848
8847
|
results_for = make_product_count_();
|
|
8849
8848
|
} else {
|
|
8850
|
-
$8tj43$
|
|
8849
|
+
$8tj43$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
8851
8850
|
results_for = $8tj43$getNextElement($4b4b262708b516ee$var$_tmpl$2);
|
|
8852
8851
|
}
|
|
8853
8852
|
const filters_opener = $7396052a1484264f$export$d7841e452f2e59a8({
|
|
@@ -8869,17 +8868,17 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8869
8868
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
8870
8869
|
...extra_sort_and_filter_args_
|
|
8871
8870
|
});
|
|
8872
|
-
$8tj43$
|
|
8871
|
+
$8tj43$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
|
|
8873
8872
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8874
8873
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
8875
|
-
id_:
|
|
8874
|
+
id_: id_to_query_for_,
|
|
8876
8875
|
can_write_scroll_restoration_: can_write_scroll_restoration_
|
|
8877
8876
|
});
|
|
8878
8877
|
(_on_filters_construct = on_filters_constructed_) === null || _on_filters_construct === void 0 || _on_filters_construct();
|
|
8879
8878
|
$8tj43$createComputed(() => {
|
|
8880
8879
|
if (plp_products_.loading) set_can_write_scroll_restoration(false);else if (plp_products_()) set_can_write_scroll_restoration(true);
|
|
8881
8880
|
});
|
|
8882
|
-
$8tj43$createRenderEffect($8tj43$
|
|
8881
|
+
$8tj43$createRenderEffect($8tj43$catchify(async () => {
|
|
8883
8882
|
var _only_show_filters_op;
|
|
8884
8883
|
const slim = is_slim_();
|
|
8885
8884
|
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 +8901,15 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8902
8901
|
available_filters_: available_filters_
|
|
8903
8902
|
});
|
|
8904
8903
|
$a4777acaffa35a82$export$3945d6db2dfd3d12({
|
|
8905
|
-
|
|
8904
|
+
id_to_query_for_: id_to_query_for_,
|
|
8906
8905
|
crumb_data_: crumb_data_,
|
|
8907
8906
|
i18n_: i18n_,
|
|
8908
8907
|
selected_filters_: selected_filters_,
|
|
8909
8908
|
local_filter_cache_: local_filter_cache_,
|
|
8910
8909
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8911
8910
|
plp_results_: plp_products_,
|
|
8912
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
8911
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
8912
|
+
id_type_: id_type_
|
|
8913
8913
|
});
|
|
8914
8914
|
get_breadcrumb_accessor_ === null || get_breadcrumb_accessor_ === void 0 || get_breadcrumb_accessor_(crumb_data_);
|
|
8915
8915
|
get_quicklinks_accessor_ === null || get_quicklinks_accessor_ === void 0 || get_quicklinks_accessor_(quicklinks_data_);
|
|
@@ -8932,7 +8932,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8932
8932
|
[_el$28, _co$11] = $8tj43$getNextMarker(_el$27.nextSibling),
|
|
8933
8933
|
_el$29 = _el$28.nextSibling,
|
|
8934
8934
|
[_el$30, _co$12] = $8tj43$getNextMarker(_el$29.nextSibling);
|
|
8935
|
-
$8tj43$use(el => process.env.NODE_ENV === "development" && $1145661fd3ca5519$export$7af06a63c5a976c9(el,
|
|
8935
|
+
$8tj43$use(el => process.env.NODE_ENV === "development" && $1145661fd3ca5519$export$7af06a63c5a976c9(el, id_to_query_for_, i18n_), _el$13);
|
|
8936
8936
|
$8tj43$insert(_el$14, $8tj43$createComponent((0, $8tj43$Show), {
|
|
8937
8937
|
get when() {
|
|
8938
8938
|
return show_breadcrumbs_();
|
|
@@ -8954,7 +8954,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8954
8954
|
get children() {
|
|
8955
8955
|
return $8tj43$createComponent((0, $43fbb365ed0ac99e$export$466cdc317043f6cb), {
|
|
8956
8956
|
quicklinks_data_: quicklinks_data_,
|
|
8957
|
-
|
|
8957
|
+
id_to_query_for_: id_to_query_for_,
|
|
8958
|
+
id_type_: id_type_,
|
|
8958
8959
|
router_: router_,
|
|
8959
8960
|
breadcrumb_data_: crumb_data_,
|
|
8960
8961
|
i18n_: i18n_,
|
|
@@ -9009,7 +9010,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
9009
9010
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
9010
9011
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
9011
9012
|
content_blocks_by_row_: content_blocks_by_row_,
|
|
9012
|
-
id_currently_querying_for_:
|
|
9013
|
+
id_currently_querying_for_: id_to_query_for_,
|
|
9013
9014
|
no_results_options_: {
|
|
9014
9015
|
selected_filters_: selected_filters_,
|
|
9015
9016
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
@@ -9058,10 +9059,10 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
9058
9059
|
* Adds the current page as last breadcrumb to the breadcrumb trail
|
|
9059
9060
|
*/
|
|
9060
9061
|
function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta, title) {
|
|
9061
|
-
const href_accessor = $8tj43$
|
|
9062
|
+
const href_accessor = $8tj43$use_href_accessor();
|
|
9062
9063
|
return $8tj43$createMemo(() => {
|
|
9063
|
-
var
|
|
9064
|
-
const api_value = (
|
|
9064
|
+
var _plp_meta3;
|
|
9065
|
+
const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
|
|
9065
9066
|
if (!api_value) return api_value;
|
|
9066
9067
|
return [...api_value, {
|
|
9067
9068
|
get listing_id() {
|
|
@@ -9075,6 +9076,12 @@ function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta, title) {
|
|
|
9075
9076
|
},
|
|
9076
9077
|
get slug() {
|
|
9077
9078
|
return plp_meta().slug;
|
|
9079
|
+
},
|
|
9080
|
+
get listing_type() {
|
|
9081
|
+
return plp_meta().listing_type;
|
|
9082
|
+
},
|
|
9083
|
+
get external_id() {
|
|
9084
|
+
return plp_meta().external_id;
|
|
9078
9085
|
}
|
|
9079
9086
|
}];
|
|
9080
9087
|
});
|
|
@@ -9284,8 +9291,7 @@ var $f5f54892fd0c7d9f$var$_router = /*#__PURE__*/new WeakMap();
|
|
|
9284
9291
|
var $f5f54892fd0c7d9f$var$_localization_signal = /*#__PURE__*/new WeakMap();
|
|
9285
9292
|
var $f5f54892fd0c7d9f$var$_merchant_signal = /*#__PURE__*/new WeakMap();
|
|
9286
9293
|
var $f5f54892fd0c7d9f$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
9287
|
-
var $f5f54892fd0c7d9f$var$
|
|
9288
|
-
var $f5f54892fd0c7d9f$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
|
|
9294
|
+
var $f5f54892fd0c7d9f$var$_listing_query_signal = /*#__PURE__*/new WeakMap();
|
|
9289
9295
|
var $f5f54892fd0c7d9f$var$_disable_override_listing_id = /*#__PURE__*/new WeakMap();
|
|
9290
9296
|
class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
9291
9297
|
get localization() {
|
|
@@ -9295,11 +9301,11 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
9295
9301
|
set localization(locale_obj) {
|
|
9296
9302
|
$8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[1](locale_obj);
|
|
9297
9303
|
}
|
|
9298
|
-
get
|
|
9299
|
-
return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$
|
|
9304
|
+
get listing_query() {
|
|
9305
|
+
return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_query_signal)[0]();
|
|
9300
9306
|
}
|
|
9301
|
-
set
|
|
9302
|
-
$8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$
|
|
9307
|
+
set listing_query(query) {
|
|
9308
|
+
$8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_query_signal)[1](query);
|
|
9303
9309
|
}
|
|
9304
9310
|
get merchant() {
|
|
9305
9311
|
return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_merchant_signal)[0]();
|
|
@@ -9313,12 +9319,6 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
9313
9319
|
set market(market) {
|
|
9314
9320
|
$8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_market_signal)[1](market);
|
|
9315
9321
|
}
|
|
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
9322
|
get disable_override_listing_id() {
|
|
9323
9323
|
return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_disable_override_listing_id)[0]();
|
|
9324
9324
|
}
|
|
@@ -9338,7 +9338,7 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
9338
9338
|
on_navigation: on_navigation,
|
|
9339
9339
|
display_transformers: display_transformers,
|
|
9340
9340
|
unique_instance_key_for_state = "",
|
|
9341
|
-
|
|
9341
|
+
listing_query_state_key: listing_query_state_key,
|
|
9342
9342
|
...props_on_class
|
|
9343
9343
|
} = _ref2;
|
|
9344
9344
|
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_router, {
|
|
@@ -9357,13 +9357,9 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
9357
9357
|
writable: true,
|
|
9358
9358
|
value: $8tj43$createSignal()
|
|
9359
9359
|
});
|
|
9360
|
-
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$
|
|
9360
|
+
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_listing_query_signal, {
|
|
9361
9361
|
writable: true,
|
|
9362
|
-
value: $8tj43$createSignal(
|
|
9363
|
-
});
|
|
9364
|
-
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_, {
|
|
9365
|
-
writable: true,
|
|
9366
|
-
value: $8tj43$createSignal()
|
|
9362
|
+
value: $8tj43$createSignal({})
|
|
9367
9363
|
});
|
|
9368
9364
|
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_disable_override_listing_id, {
|
|
9369
9365
|
writable: true,
|
|
@@ -9376,7 +9372,7 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
9376
9372
|
throw new Error("You can only have one instance of DepictCategory with the same uniqueInstanceKeyForState");
|
|
9377
9373
|
Object.assign(this, props_on_class); // set initial signal values
|
|
9378
9374
|
$68e6625c8d51f847$export$5162a71f252e6122();
|
|
9379
|
-
$8tj43$babelruntimehelpersclassPrivateFieldSet(this, $f5f54892fd0c7d9f$var$_router, new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation",
|
|
9375
|
+
$8tj43$babelruntimehelpersclassPrivateFieldSet(this, $f5f54892fd0c7d9f$var$_router, new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation", listing_query_state_key));
|
|
9380
9376
|
if (on_navigation) $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_router).on_navigation_ = on_navigation;
|
|
9381
9377
|
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
9378
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
@@ -9445,14 +9441,16 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
9445
9441
|
category_title: category_title
|
|
9446
9442
|
} = props;
|
|
9447
9443
|
const shared_properties = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
|
|
9444
|
+
const diffableListingQuery = $8tj43$createMemo(() => Object.values(depict_category.listing_query).join(""));
|
|
9448
9445
|
return $83e8cf2c0b87a58a$export$23fca46f3143581f(() => {
|
|
9449
9446
|
$8tj43$createEffect(prev => {
|
|
9450
9447
|
// 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
|
-
|
|
9452
|
-
$
|
|
9453
|
-
|
|
9448
|
+
diffableListingQuery(); // Only re-run this effect when the listing query *actually* changes (not just the object reference)
|
|
9449
|
+
const newId = $8tj43$untrack(() => depict_category.listing_query);
|
|
9450
|
+
$01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)(newId, prev);
|
|
9451
|
+
return newId;
|
|
9454
9452
|
});
|
|
9455
|
-
$8tj43$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.
|
|
9453
|
+
$8tj43$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
9456
9454
|
const grid_spacing_override = $8tj43$createMemo(() => {
|
|
9457
9455
|
const {
|
|
9458
9456
|
grid_spacing: grid_spacing
|
|
@@ -9493,8 +9491,8 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
9493
9491
|
depict_api_: depict_api_,
|
|
9494
9492
|
min_products_to_fetch_: $f5f54892fd0c7d9f$var$min_products_to_fetch_,
|
|
9495
9493
|
local_filter_cache_: local_filter_cache_,
|
|
9496
|
-
|
|
9497
|
-
|
|
9494
|
+
id_to_query_for_: $8tj43$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
|
|
9495
|
+
id_type_: $8tj43$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $397620a4d7958ed1$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
|
|
9498
9496
|
i18n_: i18n_,
|
|
9499
9497
|
show_quicklinks_: $8tj43$createMemo(() => {
|
|
9500
9498
|
var _props$show_quicklink;
|
|
@@ -9562,13 +9560,16 @@ function $f5f54892fd0c7d9f$export$de035477d6fef996(_ref4) {
|
|
|
9562
9560
|
sorting_query_param_: sorting_query_param_,
|
|
9563
9561
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
9564
9562
|
} = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
|
|
9563
|
+
const id_to_query_for_ = $8tj43$createMemo(() => depict_category.listing_query.id);
|
|
9564
|
+
const id_type_ = $8tj43$createMemo(() => depict_category.listing_query.type);
|
|
9565
9565
|
return $8tj43$createComponent($f5f54892fd0c7d9f$var$InExternalAreaDiv, {
|
|
9566
9566
|
get children() {
|
|
9567
9567
|
return $43fbb365ed0ac99e$export$466cdc317043f6cb({
|
|
9568
9568
|
i18n_: i18n_,
|
|
9569
9569
|
quicklinks_data_: quicklinks_data_,
|
|
9570
9570
|
router_: router_,
|
|
9571
|
-
|
|
9571
|
+
id_type_: id_type_,
|
|
9572
|
+
id_to_query_for_: id_to_query_for_,
|
|
9572
9573
|
breadcrumb_data_: breadcrumb_data_,
|
|
9573
9574
|
sorting_query_param_: sorting_query_param_,
|
|
9574
9575
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -10754,7 +10755,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
10754
10755
|
const _el$3 = $8tj43$getNextElement($40dd3f46f55d62ba$var$_tmpl$3);
|
|
10755
10756
|
$8tj43$insert(_el$3, $8tj43$createMemo(() => {
|
|
10756
10757
|
if (input_obj().type === "content") return i18n_.content_();
|
|
10757
|
-
if (input_obj().
|
|
10758
|
+
if (input_obj().listing_type === "brand") return i18n_.brand_();
|
|
10758
10759
|
return i18n_.category_();
|
|
10759
10760
|
}));
|
|
10760
10761
|
return _el$3;
|
|
@@ -11023,7 +11024,7 @@ function $2ebb1d6ae6763f7a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
11023
11024
|
url.searchParams.set(search_query_param_name_, title);
|
|
11024
11025
|
return $76b6e14a50da4597$export$1efe1013da60d0e4(e, url.href);
|
|
11025
11026
|
}));
|
|
11026
|
-
} else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "
|
|
11027
|
+
} 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
11028
|
const {
|
|
11028
11029
|
page_url: page_url
|
|
11029
11030
|
} = selected_entry;
|
|
@@ -11575,7 +11576,7 @@ function $754f319a849bfdbc$export$c05a196222ba1302(_ref) {
|
|
|
11575
11576
|
} = _ref;
|
|
11576
11577
|
const category_suggestions_ = $8tj43$createMemo(() => {
|
|
11577
11578
|
var _suggestions_;
|
|
11578
|
-
return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "
|
|
11579
|
+
return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "listing");
|
|
11579
11580
|
});
|
|
11580
11581
|
return $8tj43$createComponent((0, $8tj43$Show), {
|
|
11581
11582
|
get when() {
|