@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.cjs +162 -151
- package/ES10/index.d.ts +211 -201
- package/ES10/index.js +164 -153
- package/latest/index.cjs +139 -113
- package/latest/index.d.ts +211 -201
- package/latest/index.js +141 -115
- package/package.json +4 -4
- package/server/ES10/index.cjs +137 -126
- package/server/ES10/index.d.ts +211 -201
- package/server/ES10/index.js +139 -128
- package/server/latest/index.cjs +128 -108
- package/server/latest/index.d.ts +211 -201
- package/server/latest/index.js +130 -110
package/ES10/index.cjs
CHANGED
|
@@ -83,7 +83,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
|
|
|
83
83
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
|
|
84
84
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
85
85
|
/*! Depict.ai search and product listing SDK */
|
|
86
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.
|
|
86
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.5";
|
|
87
87
|
const $9d19451330d04c3c$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.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>`);
|
|
88
88
|
function $9d19451330d04c3c$export$8be2714ec7f169ee() {
|
|
89
89
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -469,12 +469,12 @@ class $73014ff36186a4dd$export$7e1297a3a19f10d8 {
|
|
|
469
469
|
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
470
470
|
* This standardises waiting for all kinds of routers
|
|
471
471
|
*/
|
|
472
|
-
constructor(on_navigation,
|
|
472
|
+
constructor(on_navigation, listing_query_state_key) {
|
|
473
473
|
$73014ff36186a4dd$var$_classPrivateMethodInitSpec(this, $73014ff36186a4dd$var$_get_navigation_happened_promise);
|
|
474
474
|
$73014ff36186a4dd$var$_classPrivateMethodInitSpec(this, $73014ff36186a4dd$var$_dont_attempt_navigation);
|
|
475
475
|
$73014ff36186a4dd$var$_classPrivateMethodInitSpec(this, $73014ff36186a4dd$var$_throwing_on_navigation);
|
|
476
476
|
$parcel$interopDefault($52FdA$babelruntimehelpersdefineProperty)(this, "on_navigation_", void 0);
|
|
477
|
-
$parcel$interopDefault($52FdA$babelruntimehelpersdefineProperty)(this, "
|
|
477
|
+
$parcel$interopDefault($52FdA$babelruntimehelpersdefineProperty)(this, "listing_query_state_key", void 0);
|
|
478
478
|
$parcel$interopDefault($52FdA$babelruntimehelpersdefineProperty)(this, "navigate_", {
|
|
479
479
|
/**
|
|
480
480
|
* Call this if you *just* want to replace the state object in history.state
|
|
@@ -498,7 +498,7 @@ class $73014ff36186a4dd$export$7e1297a3a19f10d8 {
|
|
|
498
498
|
event_: event_,
|
|
499
499
|
force_spa_navigation_: force_spa_navigation_,
|
|
500
500
|
is_replace_: is_replace_,
|
|
501
|
-
|
|
501
|
+
listing_query_: listing_query_,
|
|
502
502
|
scroll = true
|
|
503
503
|
} = _ref;
|
|
504
504
|
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
@@ -519,10 +519,10 @@ class $73014ff36186a4dd$export$7e1297a3a19f10d8 {
|
|
|
519
519
|
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
520
520
|
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
521
521
|
const new_state = history.state;
|
|
522
|
-
if (
|
|
522
|
+
if (listing_query_) {
|
|
523
523
|
// In JS-UI we need to know the listing_id of the current category, therefore push it into state
|
|
524
|
-
if (!this.
|
|
525
|
-
new_state[this.
|
|
524
|
+
if (!this.listing_query_state_key) $52FdA$depictaiutilishared.report(new Error("listing_query_state_key is not set"), "error");
|
|
525
|
+
new_state[this.listing_query_state_key] = listing_query_;
|
|
526
526
|
}
|
|
527
527
|
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
528
528
|
} else $73014ff36186a4dd$var$_classPrivateMethodGet(this, $73014ff36186a4dd$var$_throwing_on_navigation, $73014ff36186a4dd$var$_throwing_on_navigation2).call(this, {
|
|
@@ -533,7 +533,7 @@ class $73014ff36186a4dd$export$7e1297a3a19f10d8 {
|
|
|
533
533
|
await promise;
|
|
534
534
|
})
|
|
535
535
|
});
|
|
536
|
-
this.
|
|
536
|
+
this.listing_query_state_key = listing_query_state_key;
|
|
537
537
|
this.on_navigation_ = on_navigation;
|
|
538
538
|
}
|
|
539
539
|
}
|
|
@@ -1039,27 +1039,31 @@ function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
|
|
|
1039
1039
|
});
|
|
1040
1040
|
}
|
|
1041
1041
|
// source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
|
|
1042
|
+
// deeply diffs two objects
|
|
1043
|
+
// Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
|
|
1044
|
+
// Modified futher to bias towards saying objects are equal non-primitive objects differ
|
|
1042
1045
|
function $76012c4468a53d1f$var$deep_equal(obj1, obj2) {
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1046
|
+
const stack = [[obj1, obj2]];
|
|
1047
|
+
while (stack.length > 0) {
|
|
1048
|
+
const [currentObj1, currentObj2] = stack.pop();
|
|
1049
|
+
if (currentObj1 === currentObj2) continue;
|
|
1050
|
+
if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
|
|
1051
|
+
if (currentObj1.length !== currentObj2.length) return false;
|
|
1052
|
+
for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
|
|
1053
|
+
} else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
|
|
1054
|
+
if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
|
|
1055
|
+
const keys1 = Object.keys(currentObj1);
|
|
1056
|
+
const keys2 = Object.keys(currentObj2);
|
|
1057
|
+
if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
|
|
1058
|
+
for (let key in currentObj1) {
|
|
1059
|
+
if ($76012c4468a53d1f$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
|
|
1060
|
+
stack.push([currentObj1[key], currentObj2[key]]);
|
|
1061
|
+
}
|
|
1062
|
+
} else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
|
|
1063
|
+
// 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?
|
|
1064
|
+
return false;
|
|
1061
1065
|
}
|
|
1062
|
-
return
|
|
1066
|
+
return true;
|
|
1063
1067
|
}
|
|
1064
1068
|
const $6c2c739b113a8ddf$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div>`),
|
|
1065
1069
|
$6c2c739b113a8ddf$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<style type=text/css>`);
|
|
@@ -5830,6 +5834,11 @@ function $b3dc12c672c9df24$export$967e966fca9515e(api_response) {
|
|
|
5830
5834
|
}
|
|
5831
5835
|
return api_response;
|
|
5832
5836
|
}
|
|
5837
|
+
|
|
5838
|
+
// Minifiable and tree-shakable enum
|
|
5839
|
+
// Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
|
|
5840
|
+
const $c3739e86187f2054$export$74ee7529ce0f8a00 = "listingId";
|
|
5841
|
+
const $c3739e86187f2054$export$5aae649db1b959fc = "externalId";
|
|
5833
5842
|
function $e270e9f953fcbc58$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
5834
5843
|
$e270e9f953fcbc58$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
5835
5844
|
privateSet.add(obj);
|
|
@@ -5938,9 +5947,14 @@ class $e270e9f953fcbc58$export$e015ed2f2950f2e3 {
|
|
|
5938
5947
|
})
|
|
5939
5948
|
});
|
|
5940
5949
|
}
|
|
5941
|
-
async get_listing(
|
|
5950
|
+
async get_listing(_ref) {
|
|
5951
|
+
let {
|
|
5952
|
+
id_type_: id_type_,
|
|
5953
|
+
id_to_query_for_: id_to_query_for_,
|
|
5954
|
+
...input_req
|
|
5955
|
+
} = _ref;
|
|
5942
5956
|
return await $e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_cached_request, $e270e9f953fcbc58$var$_cached_request2).call(this, {
|
|
5943
|
-
endpoint_: $e270e9f953fcbc58$var$v3_base_url + "listings/" + encodeURIComponent(
|
|
5957
|
+
endpoint_: $e270e9f953fcbc58$var$v3_base_url + "listings/" + (id_type_ === $c3739e86187f2054$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_),
|
|
5944
5958
|
input_req_: input_req,
|
|
5945
5959
|
fallback_response_: () => ({
|
|
5946
5960
|
listing_id: "",
|
|
@@ -5954,20 +5968,18 @@ class $e270e9f953fcbc58$export$e015ed2f2950f2e3 {
|
|
|
5954
5968
|
"quick_links": [],
|
|
5955
5969
|
failed: true
|
|
5956
5970
|
}),
|
|
5957
|
-
method_: "GET"
|
|
5958
|
-
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
|
|
5971
|
+
method_: "GET"
|
|
5959
5972
|
});
|
|
5960
5973
|
}
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
...
|
|
5966
|
-
};
|
|
5967
|
-
delete cloned_request["listing_id"];
|
|
5974
|
+
async get_listing_products(_ref2) {
|
|
5975
|
+
let {
|
|
5976
|
+
id_to_query_for_: id_to_query_for_,
|
|
5977
|
+
id_type_: id_type_,
|
|
5978
|
+
...input_req_
|
|
5979
|
+
} = _ref2;
|
|
5968
5980
|
return await $e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_cached_request, $e270e9f953fcbc58$var$_cached_request2).call(this, {
|
|
5969
|
-
endpoint_: $e270e9f953fcbc58$var$v3_base_url + "listings/" + encodeURIComponent(
|
|
5970
|
-
input_req_:
|
|
5981
|
+
endpoint_: $e270e9f953fcbc58$var$v3_base_url + "listings/" + (id_type_ === $c3739e86187f2054$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_) + "/products",
|
|
5982
|
+
input_req_: input_req_,
|
|
5971
5983
|
fallback_response_: () => ({
|
|
5972
5984
|
"n_hits": 0,
|
|
5973
5985
|
"displays": [],
|
|
@@ -6005,7 +6017,7 @@ async function $e270e9f953fcbc58$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
6005
6017
|
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
6006
6018
|
if (!category_transformer) return response;
|
|
6007
6019
|
// find category suggestions, run thing with them, and then replace them
|
|
6008
|
-
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "
|
|
6020
|
+
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
|
|
6009
6021
|
const transformed_category_suggestions = await category_transformer({
|
|
6010
6022
|
market: market,
|
|
6011
6023
|
merchant: merchant,
|
|
@@ -6051,15 +6063,14 @@ async function $e270e9f953fcbc58$var$_run_display_transformers_for_rest2(merchan
|
|
|
6051
6063
|
});
|
|
6052
6064
|
return input_data;
|
|
6053
6065
|
}
|
|
6054
|
-
async function $e270e9f953fcbc58$var$_cached_request2(
|
|
6066
|
+
async function $e270e9f953fcbc58$var$_cached_request2(_ref3) {
|
|
6055
6067
|
var _classPrivateFieldGet5, _cache_obj$cache_$bod, _cache_obj$cache_$bod2;
|
|
6056
6068
|
let {
|
|
6057
6069
|
endpoint_: endpoint_,
|
|
6058
6070
|
input_req_: input_req_,
|
|
6059
6071
|
fallback_response_: fallback_response_,
|
|
6060
|
-
method_ = "POST"
|
|
6061
|
-
|
|
6062
|
-
} = _ref;
|
|
6072
|
+
method_ = "POST"
|
|
6073
|
+
} = _ref3;
|
|
6063
6074
|
const cache_obj = $e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_get_cache_obj_for_endpoint, $e270e9f953fcbc58$var$_get_cache_obj_for_endpoint2).call(this, endpoint_);
|
|
6064
6075
|
const with_ids = $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $e270e9f953fcbc58$var$_add_ids_to_request).call(this, input_req_);
|
|
6065
6076
|
const metaData = await ((_classPrivateFieldGet5 = $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $e270e9f953fcbc58$var$_get_metadata)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.call(this));
|
|
@@ -6076,7 +6087,6 @@ async function $e270e9f953fcbc58$var$_cached_request2(_ref) {
|
|
|
6076
6087
|
cache_obj.in_progress_[body] = new Promise(r => resolve_in_progress = r);
|
|
6077
6088
|
try {
|
|
6078
6089
|
const is_post = method_ === "POST";
|
|
6079
|
-
if (!is_post && delete_key_before_sending_) delete sorted_request[delete_key_before_sending_];
|
|
6080
6090
|
const url_to_request = is_post ? endpoint_ : $52FdA$depictaiutilishared.make_url_with_query_params(endpoint_, sorted_request);
|
|
6081
6091
|
const api_response = await $52FdA$depictaiutilishared.fetch_retry($52FdA$depictaiutilishared.add_version_query_params(url_to_request), {
|
|
6082
6092
|
method: method_,
|
|
@@ -6450,7 +6460,7 @@ function $19438fea513c9d01$export$5e4aed86c12acdd9(_ref) {
|
|
|
6450
6460
|
// After first load, always just load 20 since people might just be browsing the top ones still
|
|
6451
6461
|
min_products_to_fetch_ : now - last_loaded < 10000 ? min_products_to_fetch_ * 5 : min_products_to_fetch_;
|
|
6452
6462
|
// dlog("loading ", number_of_results_to_load, "products, because it was", now - last_loaded, "ms since last load");
|
|
6453
|
-
const api_response = await depict_api_["
|
|
6463
|
+
const api_response = await depict_api_["query" in base_part ? "query" : "get_listing_products"]({
|
|
6454
6464
|
cursor: get_last_cursor(),
|
|
6455
6465
|
limit: number_of_results_to_load,
|
|
6456
6466
|
...base_part
|
|
@@ -8184,16 +8194,16 @@ function $1c819dc9d820a149$export$5646050d516e06bc(_ref) {
|
|
|
8184
8194
|
},
|
|
8185
8195
|
get children() {
|
|
8186
8196
|
const _el$2 = $52FdA$solidjsweb.getNextElement($1c819dc9d820a149$var$_tmpl$2);
|
|
8187
|
-
$52FdA$solidjsweb.addEventListener(_el$2, "click", $52FdA$depictaiutilishared.catchify(ev => {
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
}
|
|
8196
|
-
}), true);
|
|
8197
|
+
$52FdA$solidjsweb.addEventListener(_el$2, "click", $52FdA$depictaiutilishared.catchify(ev => router_.navigate_.go_to_({
|
|
8198
|
+
new_url_: href(),
|
|
8199
|
+
is_replace_: false,
|
|
8200
|
+
event_: ev,
|
|
8201
|
+
force_spa_navigation_: true,
|
|
8202
|
+
listing_query_: {
|
|
8203
|
+
id: display_accessor().listing_id,
|
|
8204
|
+
type: $c3739e86187f2054$export$74ee7529ce0f8a00
|
|
8205
|
+
}
|
|
8206
|
+
})), true);
|
|
8197
8207
|
$52FdA$solidjsweb.insert(_el$2, () => display_accessor().title);
|
|
8198
8208
|
$52FdA$solidjsweb.effect(() => $52FdA$solidjsweb.setAttribute(_el$2, "href", href()));
|
|
8199
8209
|
$52FdA$solidjsweb.runHydrationEvents();
|
|
@@ -8224,11 +8234,12 @@ function $21a004c2e7bd4c16$export$466cdc317043f6cb(_ref) {
|
|
|
8224
8234
|
let {
|
|
8225
8235
|
quicklinks_data_: quicklinks_data_,
|
|
8226
8236
|
router_: router_,
|
|
8227
|
-
|
|
8237
|
+
id_to_query_for_: id_to_query_for_,
|
|
8228
8238
|
breadcrumb_data_: breadcrumb_data_,
|
|
8229
8239
|
i18n_: i18n_,
|
|
8230
8240
|
sorting_query_param_: sorting_query_param_,
|
|
8231
|
-
filter_query_param_prefix_: filter_query_param_prefix_
|
|
8241
|
+
filter_query_param_prefix_: filter_query_param_prefix_,
|
|
8242
|
+
id_type_: id_type_
|
|
8232
8243
|
} = _ref;
|
|
8233
8244
|
let scrolling_logic_ran_for_listing_id = false;
|
|
8234
8245
|
let last_scroll_position;
|
|
@@ -8236,13 +8247,13 @@ function $21a004c2e7bd4c16$export$466cdc317043f6cb(_ref) {
|
|
|
8236
8247
|
let last_was_placeholder = false;
|
|
8237
8248
|
let sliding_element;
|
|
8238
8249
|
$52FdA$solidjs.createComputed(() => {
|
|
8239
|
-
|
|
8250
|
+
id_to_query_for_();
|
|
8240
8251
|
scrolling_logic_ran_for_listing_id = false;
|
|
8241
8252
|
});
|
|
8242
8253
|
const place_holdey_quicklinks_data = $52FdA$solidjs.createMemo(() => quicklinks_data_() || [,,,]);
|
|
8243
8254
|
const selected_index = $52FdA$solidjs.createMemo(() => {
|
|
8244
8255
|
var _quicklinks_data_;
|
|
8245
|
-
return (_quicklinks_data_ = quicklinks_data_()) === null || _quicklinks_data_ === void 0 ? void 0 : _quicklinks_data_.findIndex(item => item
|
|
8256
|
+
return (_quicklinks_data_ = quicklinks_data_()) === null || _quicklinks_data_ === void 0 ? void 0 : _quicklinks_data_.findIndex(item => item[id_type_() === $c3739e86187f2054$export$5aae649db1b959fc ? "external_id" : "listing_id"] === id_to_query_for_());
|
|
8246
8257
|
}); // this will be -1 when viewing child categories
|
|
8247
8258
|
const scrollpos_per_listing_id = {};
|
|
8248
8259
|
const mutation_plugins = [function () {
|
|
@@ -8252,7 +8263,7 @@ function $21a004c2e7bd4c16$export$466cdc317043f6cb(_ref) {
|
|
|
8252
8263
|
} = this.insert_here;
|
|
8253
8264
|
if (scrollLeft > 0) {
|
|
8254
8265
|
last_scroll_position = scrollLeft;
|
|
8255
|
-
const current_id = $52FdA$solidjs.untrack(
|
|
8266
|
+
const current_id = $52FdA$solidjs.untrack(id_to_query_for_);
|
|
8256
8267
|
// make sure to not save position where selected item isn't in viewport
|
|
8257
8268
|
const current_selected_index = $52FdA$solidjs.untrack(selected_index);
|
|
8258
8269
|
const intersecting_thing = this.intersecting_items_object[current_selected_index];
|
|
@@ -8318,7 +8329,7 @@ function $21a004c2e7bd4c16$export$466cdc317043f6cb(_ref) {
|
|
|
8318
8329
|
equals: false
|
|
8319
8330
|
}), new_data => {
|
|
8320
8331
|
const quicklinks_data = quicklinks_data_(); // this signal should have updated by now since this is a createEffect
|
|
8321
|
-
const current_id =
|
|
8332
|
+
const current_id = id_to_query_for_();
|
|
8322
8333
|
if (!new_data || !quicklinks_data || !current_id) return;
|
|
8323
8334
|
const owner = $52FdA$solidjs.getOwner();
|
|
8324
8335
|
queueMicrotask(() => {
|
|
@@ -8368,13 +8379,9 @@ function $21a004c2e7bd4c16$export$466cdc317043f6cb(_ref) {
|
|
|
8368
8379
|
// 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
|
|
8369
8380
|
const is_sibling = $52FdA$solidjs.createMemo(() => {
|
|
8370
8381
|
var _quicklinks_data_2;
|
|
8371
|
-
const current_id =
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
listing_id: listing_id
|
|
8375
|
-
} = _ref3;
|
|
8376
|
-
return listing_id === current_id;
|
|
8377
|
-
});
|
|
8382
|
+
const current_id = id_to_query_for_();
|
|
8383
|
+
const lookForId = id_type_() === $c3739e86187f2054$export$5aae649db1b959fc ? "external_id" : "listing_id";
|
|
8384
|
+
return (_quicklinks_data_2 = quicklinks_data_()) === null || _quicklinks_data_2 === void 0 ? void 0 : _quicklinks_data_2.some(quickLink => quickLink[lookForId] === current_id);
|
|
8378
8385
|
});
|
|
8379
8386
|
const href = $52FdA$solidjs.createMemo(() => {
|
|
8380
8387
|
var _display_accessor;
|
|
@@ -8394,20 +8401,20 @@ function $21a004c2e7bd4c16$export$466cdc317043f6cb(_ref) {
|
|
|
8394
8401
|
const url = href();
|
|
8395
8402
|
if (is_selected() && !ev.metaKey && !ev.ctrlKey && !ev.button || !url)
|
|
8396
8403
|
// allow open currently selected one in new tab but otherwise prevent clicks
|
|
8397
|
-
ev.preventDefault();else if (href()) {
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
}
|
|
8406
|
-
}
|
|
8404
|
+
ev.preventDefault();else if (href()) router_.navigate_.go_to_({
|
|
8405
|
+
new_url_: url,
|
|
8406
|
+
is_replace_: false,
|
|
8407
|
+
event_: ev,
|
|
8408
|
+
force_spa_navigation_: true,
|
|
8409
|
+
listing_query_: {
|
|
8410
|
+
id: display_accessor().listing_id,
|
|
8411
|
+
type: $c3739e86187f2054$export$74ee7529ce0f8a00
|
|
8412
|
+
}
|
|
8413
|
+
});
|
|
8407
8414
|
}), true);
|
|
8408
8415
|
$52FdA$solidjsweb.insert(_el$3, () => {
|
|
8409
|
-
var
|
|
8410
|
-
return ((
|
|
8416
|
+
var _display_accessor2;
|
|
8417
|
+
return ((_display_accessor2 = display_accessor()) === null || _display_accessor2 === void 0 ? void 0 : _display_accessor2.title) || $52FdA$solidjsweb.createComponent((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
|
|
8411
8418
|
height: "1em",
|
|
8412
8419
|
width: "10ch"
|
|
8413
8420
|
});
|
|
@@ -8569,13 +8576,14 @@ let $c95c6dd9e93acd82$export$44dad306455dddf;
|
|
|
8569
8576
|
function $8b366fdb0c76194d$export$3945d6db2dfd3d12(_ref) {
|
|
8570
8577
|
let {
|
|
8571
8578
|
crumb_data_: crumb_data_,
|
|
8572
|
-
|
|
8579
|
+
id_to_query_for_: id_to_query_for_,
|
|
8573
8580
|
i18n_: i18n_,
|
|
8574
8581
|
selected_filters_: selected_filters_,
|
|
8575
8582
|
local_filter_cache_: local_filter_cache_,
|
|
8576
8583
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8577
8584
|
plp_results_: plp_results_,
|
|
8578
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
8585
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
8586
|
+
id_type_: id_type_
|
|
8579
8587
|
} = _ref;
|
|
8580
8588
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
8581
8589
|
$8b366fdb0c76194d$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
@@ -8586,17 +8594,21 @@ function $8b366fdb0c76194d$export$3945d6db2dfd3d12(_ref) {
|
|
|
8586
8594
|
i18n_: i18n_,
|
|
8587
8595
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
8588
8596
|
});
|
|
8589
|
-
//
|
|
8597
|
+
// The code below is for when we're already open and the user navigates to a new category
|
|
8590
8598
|
let previous_crumb_data = $52FdA$solidjs.untrack(crumb_data_);
|
|
8591
|
-
let
|
|
8599
|
+
let id_when_we_got_previous_data = {
|
|
8600
|
+
id_: $52FdA$solidjs.untrack(id_to_query_for_),
|
|
8601
|
+
type_: $52FdA$solidjs.untrack(id_type_)
|
|
8602
|
+
};
|
|
8592
8603
|
let allow_filter_clearing = true; // set to false when going backwards/forwards
|
|
8593
8604
|
// temporarily disable filter clearing when going backwards/forwards
|
|
8594
8605
|
const handler = () => allow_filter_clearing = false;
|
|
8595
8606
|
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
|
|
8596
8607
|
$52FdA$solidjs.onCleanup(() => window.removeEventListener("popstate", handler));
|
|
8597
8608
|
$52FdA$solidjs.createEffect($52FdA$solidjs.on(crumb_data_, $52FdA$depictaiutilishared.catchify(new_crumb_data => {
|
|
8598
|
-
const
|
|
8599
|
-
|
|
8609
|
+
const id_of_new_data = id_to_query_for_();
|
|
8610
|
+
const type_of_id_of_new_data = id_type_();
|
|
8611
|
+
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_)) {
|
|
8600
8612
|
const previous_length = previous_crumb_data.length;
|
|
8601
8613
|
const new_length = new_crumb_data.length;
|
|
8602
8614
|
const went_upwards = new_length < previous_length;
|
|
@@ -8622,7 +8634,10 @@ function $8b366fdb0c76194d$export$3945d6db2dfd3d12(_ref) {
|
|
|
8622
8634
|
sideways_filter_clearing_flag_[1](false);
|
|
8623
8635
|
}
|
|
8624
8636
|
}
|
|
8625
|
-
|
|
8637
|
+
id_when_we_got_previous_data = {
|
|
8638
|
+
id_: id_of_new_data,
|
|
8639
|
+
type_: type_of_id_of_new_data
|
|
8640
|
+
};
|
|
8626
8641
|
previous_crumb_data = new_crumb_data;
|
|
8627
8642
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
8628
8643
|
})));
|
|
@@ -8655,7 +8670,7 @@ function $8b366fdb0c76194d$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
8655
8670
|
});
|
|
8656
8671
|
tracking_function_for_plp_results(plp_results_);
|
|
8657
8672
|
}
|
|
8658
|
-
const $c3a7faae6f2b93c9$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=statement style=white-space:pre-wrap>No
|
|
8673
|
+
const $c3a7faae6f2b93c9$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.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.`),
|
|
8659
8674
|
$c3a7faae6f2b93c9$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=buttons><button class="ok major">`);
|
|
8660
8675
|
function $c3a7faae6f2b93c9$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
8661
8676
|
if (!(0, $52FdA$depictaiutilishared.is_debug)) return; // Just to make sure we don't show this in production
|
|
@@ -8667,7 +8682,7 @@ function $c3a7faae6f2b93c9$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
|
8667
8682
|
return $52FdA$solidjs.runWithOwner(owner, () => $52FdA$solidjs.createEffect(() => {
|
|
8668
8683
|
if (!document.documentElement.contains(element)) return;
|
|
8669
8684
|
if (!listing_id()) {
|
|
8670
|
-
const warning = "No
|
|
8685
|
+
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.";
|
|
8671
8686
|
$52FdA$depictaiutilishared.dwarn(warning);
|
|
8672
8687
|
const {
|
|
8673
8688
|
close_toast_: close_toast_
|
|
@@ -8727,8 +8742,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8727
8742
|
var _on_filters_construct;
|
|
8728
8743
|
let {
|
|
8729
8744
|
depict_api_: depict_api_,
|
|
8730
|
-
|
|
8731
|
-
|
|
8745
|
+
id_to_query_for_: id_to_query_for_,
|
|
8746
|
+
id_type_: id_type_,
|
|
8732
8747
|
current_sorting_: current_sorting_,
|
|
8733
8748
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
8734
8749
|
category_filters_open_: category_filters_open_,
|
|
@@ -8781,7 +8796,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8781
8796
|
merchant: merchant_(),
|
|
8782
8797
|
market: market_(),
|
|
8783
8798
|
locale: backend_locale_(),
|
|
8784
|
-
|
|
8799
|
+
id_to_query_for_: id_to_query_for_(),
|
|
8800
|
+
id_type_: id_type_(),
|
|
8785
8801
|
...(f.length ? {
|
|
8786
8802
|
filters: f
|
|
8787
8803
|
} : {}),
|
|
@@ -8793,8 +8809,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8793
8809
|
// Make "Get products in listing" request to get products in listing
|
|
8794
8810
|
const [plp_products_] = $52FdA$solidjs.createResource(products_query_base_,
|
|
8795
8811
|
// 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)
|
|
8796
|
-
$52FdA$
|
|
8797
|
-
id_: $52FdA$solidjs.untrack(
|
|
8812
|
+
$52FdA$depictaiutilisharedlatest.catchify(base_query => $fef4890f1f8e0544$export$cc42dd29bf655ab6({
|
|
8813
|
+
id_: $52FdA$solidjs.untrack(id_to_query_for_),
|
|
8798
8814
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8799
8815
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
8800
8816
|
make_request_: (limit, cursor) => depict_api_.get_listing_products({
|
|
@@ -8809,10 +8825,11 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8809
8825
|
merchant: merchant_(),
|
|
8810
8826
|
market: market_(),
|
|
8811
8827
|
locale: backend_locale_(),
|
|
8812
|
-
|
|
8828
|
+
id_to_query_for_: id_to_query_for_(),
|
|
8829
|
+
id_type_: id_type_()
|
|
8813
8830
|
}));
|
|
8814
8831
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
8815
|
-
const [plp_meta] = $52FdA$solidjs.createResource(meta_query_base, $52FdA$
|
|
8832
|
+
const [plp_meta] = $52FdA$solidjs.createResource(meta_query_base, $52FdA$depictaiutilisharedlatest.catchify(query => depict_api_.get_listing(query)));
|
|
8816
8833
|
const available_sortings_ = $52FdA$solidjs.createMemo(() => {
|
|
8817
8834
|
var _plp_products_, _plp_products_$sorts;
|
|
8818
8835
|
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 => {
|
|
@@ -8836,17 +8853,6 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8836
8853
|
var _plp_meta2;
|
|
8837
8854
|
return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
|
|
8838
8855
|
});
|
|
8839
|
-
const meta_tag_data_ = $52FdA$solidjs.createMemo(() => {
|
|
8840
|
-
var _plp_meta3;
|
|
8841
|
-
if ((_plp_meta3 = plp_meta()) !== null && _plp_meta3 !== void 0 && _plp_meta3.replace_meta_tags) {
|
|
8842
|
-
var _plp_meta4, _plp_meta5;
|
|
8843
|
-
return {
|
|
8844
|
-
title: ((_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.title) + (meta_title_suffix_() || ""),
|
|
8845
|
-
description: (_plp_meta5 = plp_meta()) === null || _plp_meta5 === void 0 ? void 0 : _plp_meta5.description
|
|
8846
|
-
};
|
|
8847
|
-
}
|
|
8848
|
-
});
|
|
8849
|
-
$52FdA$depictaiutilishared.edit_current_page_meta_tags(meta_tag_data_);
|
|
8850
8856
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $52FdA$solidjs.createSignal(false);
|
|
8851
8857
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $52FdA$solidjs.createSignal();
|
|
8852
8858
|
const formatted_number_of_results_ = $068bde7fa83ac02c$export$92f2da32c6e7e7ee({
|
|
@@ -8920,7 +8926,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8920
8926
|
}));
|
|
8921
8927
|
results_for = make_product_count_();
|
|
8922
8928
|
} else {
|
|
8923
|
-
$52FdA$
|
|
8929
|
+
$52FdA$depictaiutilisharedlatest.report(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
8924
8930
|
results_for = $52FdA$solidjsweb.getNextElement($ede6c70ecdca46fe$var$_tmpl$2);
|
|
8925
8931
|
}
|
|
8926
8932
|
const filters_opener = $f70cc6dfcadf0fd5$export$d7841e452f2e59a8({
|
|
@@ -8942,17 +8948,17 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8942
8948
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
8943
8949
|
...extra_sort_and_filter_args_
|
|
8944
8950
|
});
|
|
8945
|
-
$52FdA$
|
|
8951
|
+
$52FdA$depictaiutilisharedlatest.catchify((0, $fef4890f1f8e0544$export$6e49da55e449af7c))({
|
|
8946
8952
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8947
8953
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
8948
|
-
id_:
|
|
8954
|
+
id_: id_to_query_for_,
|
|
8949
8955
|
can_write_scroll_restoration_: can_write_scroll_restoration_
|
|
8950
8956
|
});
|
|
8951
8957
|
(_on_filters_construct = on_filters_constructed_) === null || _on_filters_construct === void 0 || _on_filters_construct();
|
|
8952
8958
|
$52FdA$solidjs.createComputed(() => {
|
|
8953
8959
|
if (plp_products_.loading) set_can_write_scroll_restoration(false);else if (plp_products_()) set_can_write_scroll_restoration(true);
|
|
8954
8960
|
});
|
|
8955
|
-
$52FdA$solidjs.createRenderEffect($52FdA$
|
|
8961
|
+
$52FdA$solidjs.createRenderEffect($52FdA$depictaiutilisharedlatest.catchify(async () => {
|
|
8956
8962
|
var _only_show_filters_op;
|
|
8957
8963
|
const slim = is_slim_();
|
|
8958
8964
|
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();
|
|
@@ -8975,14 +8981,15 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
8975
8981
|
available_filters_: available_filters_
|
|
8976
8982
|
});
|
|
8977
8983
|
$8b366fdb0c76194d$export$3945d6db2dfd3d12({
|
|
8978
|
-
|
|
8984
|
+
id_to_query_for_: id_to_query_for_,
|
|
8979
8985
|
crumb_data_: crumb_data_,
|
|
8980
8986
|
i18n_: i18n_,
|
|
8981
8987
|
selected_filters_: selected_filters_,
|
|
8982
8988
|
local_filter_cache_: local_filter_cache_,
|
|
8983
8989
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8984
8990
|
plp_results_: plp_products_,
|
|
8985
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
8991
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
8992
|
+
id_type_: id_type_
|
|
8986
8993
|
});
|
|
8987
8994
|
get_breadcrumb_accessor_ === null || get_breadcrumb_accessor_ === void 0 || get_breadcrumb_accessor_(crumb_data_);
|
|
8988
8995
|
get_quicklinks_accessor_ === null || get_quicklinks_accessor_ === void 0 || get_quicklinks_accessor_(quicklinks_data_);
|
|
@@ -9005,7 +9012,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
9005
9012
|
[_el$28, _co$11] = $52FdA$solidjsweb.getNextMarker(_el$27.nextSibling),
|
|
9006
9013
|
_el$29 = _el$28.nextSibling,
|
|
9007
9014
|
[_el$30, _co$12] = $52FdA$solidjsweb.getNextMarker(_el$29.nextSibling);
|
|
9008
|
-
$52FdA$solidjsweb.use(el => process.env.NODE_ENV === "development" && $c3a7faae6f2b93c9$export$7af06a63c5a976c9(el,
|
|
9015
|
+
$52FdA$solidjsweb.use(el => process.env.NODE_ENV === "development" && $c3a7faae6f2b93c9$export$7af06a63c5a976c9(el, id_to_query_for_, i18n_), _el$13);
|
|
9009
9016
|
$52FdA$solidjsweb.insert(_el$14, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
9010
9017
|
get when() {
|
|
9011
9018
|
return show_breadcrumbs_();
|
|
@@ -9027,7 +9034,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
9027
9034
|
get children() {
|
|
9028
9035
|
return $52FdA$solidjsweb.createComponent((0, $21a004c2e7bd4c16$export$466cdc317043f6cb), {
|
|
9029
9036
|
quicklinks_data_: quicklinks_data_,
|
|
9030
|
-
|
|
9037
|
+
id_to_query_for_: id_to_query_for_,
|
|
9038
|
+
id_type_: id_type_,
|
|
9031
9039
|
router_: router_,
|
|
9032
9040
|
breadcrumb_data_: crumb_data_,
|
|
9033
9041
|
i18n_: i18n_,
|
|
@@ -9082,7 +9090,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
9082
9090
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
9083
9091
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
9084
9092
|
content_blocks_by_row_: content_blocks_by_row_,
|
|
9085
|
-
id_currently_querying_for_:
|
|
9093
|
+
id_currently_querying_for_: id_to_query_for_,
|
|
9086
9094
|
no_results_options_: {
|
|
9087
9095
|
selected_filters_: selected_filters_,
|
|
9088
9096
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
@@ -9131,10 +9139,10 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
9131
9139
|
* Adds the current page as last breadcrumb to the breadcrumb trail
|
|
9132
9140
|
*/
|
|
9133
9141
|
function $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta, title) {
|
|
9134
|
-
const href_accessor = $52FdA$
|
|
9142
|
+
const href_accessor = $52FdA$depictaiutilisharedlatest.use_href_accessor();
|
|
9135
9143
|
return $52FdA$solidjs.createMemo(() => {
|
|
9136
|
-
var
|
|
9137
|
-
const api_value = (
|
|
9144
|
+
var _plp_meta3;
|
|
9145
|
+
const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
|
|
9138
9146
|
if (!api_value) return api_value;
|
|
9139
9147
|
return [...api_value, {
|
|
9140
9148
|
get listing_id() {
|
|
@@ -9148,6 +9156,12 @@ function $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta, title) {
|
|
|
9148
9156
|
},
|
|
9149
9157
|
get slug() {
|
|
9150
9158
|
return plp_meta().slug;
|
|
9159
|
+
},
|
|
9160
|
+
get listing_type() {
|
|
9161
|
+
return plp_meta().listing_type;
|
|
9162
|
+
},
|
|
9163
|
+
get external_id() {
|
|
9164
|
+
return plp_meta().external_id;
|
|
9151
9165
|
}
|
|
9152
9166
|
}];
|
|
9153
9167
|
});
|
|
@@ -9357,8 +9371,7 @@ var $9cbefc32b9dab36d$var$_router = /*#__PURE__*/new WeakMap();
|
|
|
9357
9371
|
var $9cbefc32b9dab36d$var$_localization_signal = /*#__PURE__*/new WeakMap();
|
|
9358
9372
|
var $9cbefc32b9dab36d$var$_merchant_signal = /*#__PURE__*/new WeakMap();
|
|
9359
9373
|
var $9cbefc32b9dab36d$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
9360
|
-
var $9cbefc32b9dab36d$var$
|
|
9361
|
-
var $9cbefc32b9dab36d$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
|
|
9374
|
+
var $9cbefc32b9dab36d$var$_listing_query_signal = /*#__PURE__*/new WeakMap();
|
|
9362
9375
|
var $9cbefc32b9dab36d$var$_disable_override_listing_id = /*#__PURE__*/new WeakMap();
|
|
9363
9376
|
class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
9364
9377
|
get localization() {
|
|
@@ -9368,11 +9381,11 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
9368
9381
|
set localization(locale_obj) {
|
|
9369
9382
|
$parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_localization_signal)[1](locale_obj);
|
|
9370
9383
|
}
|
|
9371
|
-
get
|
|
9372
|
-
return $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$
|
|
9384
|
+
get listing_query() {
|
|
9385
|
+
return $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_listing_query_signal)[0]();
|
|
9373
9386
|
}
|
|
9374
|
-
set
|
|
9375
|
-
$parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$
|
|
9387
|
+
set listing_query(query) {
|
|
9388
|
+
$parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_listing_query_signal)[1](query);
|
|
9376
9389
|
}
|
|
9377
9390
|
get merchant() {
|
|
9378
9391
|
return $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_merchant_signal)[0]();
|
|
@@ -9386,12 +9399,6 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
9386
9399
|
set market(market) {
|
|
9387
9400
|
$parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_market_signal)[1](market);
|
|
9388
9401
|
}
|
|
9389
|
-
get meta_title_suffix() {
|
|
9390
|
-
return $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_meta_title_suffix_)[0]();
|
|
9391
|
-
}
|
|
9392
|
-
set meta_title_suffix(new_suffix) {
|
|
9393
|
-
$parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_meta_title_suffix_)[1](new_suffix);
|
|
9394
|
-
}
|
|
9395
9402
|
get disable_override_listing_id() {
|
|
9396
9403
|
return $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_disable_override_listing_id)[0]();
|
|
9397
9404
|
}
|
|
@@ -9411,7 +9418,7 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
9411
9418
|
on_navigation: on_navigation,
|
|
9412
9419
|
display_transformers: display_transformers,
|
|
9413
9420
|
unique_instance_key_for_state = "",
|
|
9414
|
-
|
|
9421
|
+
listing_query_state_key: listing_query_state_key,
|
|
9415
9422
|
...props_on_class
|
|
9416
9423
|
} = _ref2;
|
|
9417
9424
|
$9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_router, {
|
|
@@ -9430,13 +9437,9 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
9430
9437
|
writable: true,
|
|
9431
9438
|
value: $52FdA$solidjs.createSignal()
|
|
9432
9439
|
});
|
|
9433
|
-
$9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$
|
|
9434
|
-
writable: true,
|
|
9435
|
-
value: $52FdA$solidjs.createSignal("")
|
|
9436
|
-
});
|
|
9437
|
-
$9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_meta_title_suffix_, {
|
|
9440
|
+
$9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_listing_query_signal, {
|
|
9438
9441
|
writable: true,
|
|
9439
|
-
value: $52FdA$solidjs.createSignal()
|
|
9442
|
+
value: $52FdA$solidjs.createSignal({})
|
|
9440
9443
|
});
|
|
9441
9444
|
$9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_disable_override_listing_id, {
|
|
9442
9445
|
writable: true,
|
|
@@ -9449,7 +9452,7 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
9449
9452
|
throw new Error("You can only have one instance of DepictCategory with the same uniqueInstanceKeyForState");
|
|
9450
9453
|
Object.assign(this, props_on_class); // set initial signal values
|
|
9451
9454
|
$cfcd56242923775d$export$5162a71f252e6122();
|
|
9452
|
-
$parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldSet)(this, $9cbefc32b9dab36d$var$_router, new (0, $73014ff36186a4dd$export$7e1297a3a19f10d8)("hard_navigation",
|
|
9455
|
+
$parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldSet)(this, $9cbefc32b9dab36d$var$_router, new (0, $73014ff36186a4dd$export$7e1297a3a19f10d8)("hard_navigation", listing_query_state_key));
|
|
9453
9456
|
if (on_navigation) $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_router).on_navigation_ = on_navigation;
|
|
9454
9457
|
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
|
|
9455
9458
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
@@ -9518,14 +9521,16 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
9518
9521
|
category_title: category_title
|
|
9519
9522
|
} = props;
|
|
9520
9523
|
const shared_properties = $9cbefc32b9dab36d$var$get_shared_properties(depict_category);
|
|
9524
|
+
const diffableListingQuery = $52FdA$solidjs.createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
|
|
9521
9525
|
return $d05611ff6b8c8357$export$23fca46f3143581f(() => {
|
|
9522
9526
|
$52FdA$solidjs.createEffect(prev => {
|
|
9523
9527
|
// 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
|
|
9524
|
-
|
|
9525
|
-
$
|
|
9526
|
-
|
|
9528
|
+
diffableListingQuery(); // Only re-run this effect when the listing query *actually* changes (not just the object reference)
|
|
9529
|
+
const newId = $52FdA$solidjs.untrack(() => depict_category.listing_query);
|
|
9530
|
+
$bdea39a75c454f4f$export$f50b88e2a00918b5(props.on_listing_query_change)(newId, prev);
|
|
9531
|
+
return newId;
|
|
9527
9532
|
});
|
|
9528
|
-
$52FdA$solidjs.onCleanup(() => $bdea39a75c454f4f$export$f50b88e2a00918b5(props.
|
|
9533
|
+
$52FdA$solidjs.onCleanup(() => $bdea39a75c454f4f$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
9529
9534
|
const grid_spacing_override = $52FdA$solidjs.createMemo(() => {
|
|
9530
9535
|
const {
|
|
9531
9536
|
grid_spacing: grid_spacing
|
|
@@ -9566,8 +9571,11 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
9566
9571
|
depict_api_: depict_api_,
|
|
9567
9572
|
min_products_to_fetch_: $9cbefc32b9dab36d$var$min_products_to_fetch_,
|
|
9568
9573
|
local_filter_cache_: local_filter_cache_,
|
|
9569
|
-
|
|
9570
|
-
|
|
9574
|
+
id_to_query_for_: $52FdA$solidjs.createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
|
|
9575
|
+
id_type_: $52FdA$solidjs.createMemo(() => {
|
|
9576
|
+
if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $c3739e86187f2054$export$74ee7529ce0f8a00;
|
|
9577
|
+
return depict_category.listing_query.type;
|
|
9578
|
+
}),
|
|
9571
9579
|
i18n_: i18n_,
|
|
9572
9580
|
show_quicklinks_: $52FdA$solidjs.createMemo(() => {
|
|
9573
9581
|
var _props$show_quicklink;
|
|
@@ -9635,13 +9643,16 @@ function $9cbefc32b9dab36d$export$de035477d6fef996(_ref4) {
|
|
|
9635
9643
|
sorting_query_param_: sorting_query_param_,
|
|
9636
9644
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
9637
9645
|
} = $9cbefc32b9dab36d$var$get_shared_properties(depict_category);
|
|
9646
|
+
const id_to_query_for_ = $52FdA$solidjs.createMemo(() => depict_category.listing_query.id);
|
|
9647
|
+
const id_type_ = $52FdA$solidjs.createMemo(() => depict_category.listing_query.type);
|
|
9638
9648
|
return $52FdA$solidjsweb.createComponent($9cbefc32b9dab36d$var$InExternalAreaDiv, {
|
|
9639
9649
|
get children() {
|
|
9640
9650
|
return $21a004c2e7bd4c16$export$466cdc317043f6cb({
|
|
9641
9651
|
i18n_: i18n_,
|
|
9642
9652
|
quicklinks_data_: quicklinks_data_,
|
|
9643
9653
|
router_: router_,
|
|
9644
|
-
|
|
9654
|
+
id_type_: id_type_,
|
|
9655
|
+
id_to_query_for_: id_to_query_for_,
|
|
9645
9656
|
breadcrumb_data_: breadcrumb_data_,
|
|
9646
9657
|
sorting_query_param_: sorting_query_param_,
|
|
9647
9658
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -10827,7 +10838,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
10827
10838
|
const _el$3 = $52FdA$solidjsweb.getNextElement($0677d509ad208e22$var$_tmpl$3);
|
|
10828
10839
|
$52FdA$solidjsweb.insert(_el$3, $52FdA$solidjs.createMemo(() => {
|
|
10829
10840
|
if (input_obj().type === "content") return i18n_.content_();
|
|
10830
|
-
if (input_obj().
|
|
10841
|
+
if (input_obj().listing_type === "brand") return i18n_.brand_();
|
|
10831
10842
|
return i18n_.category_();
|
|
10832
10843
|
}));
|
|
10833
10844
|
return _el$3;
|
|
@@ -11096,7 +11107,7 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
11096
11107
|
url.searchParams.set(search_query_param_name_, title);
|
|
11097
11108
|
return $1730e5b4d47679a3$export$1efe1013da60d0e4(e, url.href);
|
|
11098
11109
|
}));
|
|
11099
|
-
} else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "
|
|
11110
|
+
} 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") $52FdA$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
11100
11111
|
const {
|
|
11101
11112
|
page_url: page_url
|
|
11102
11113
|
} = selected_entry;
|
|
@@ -11648,7 +11659,7 @@ function $e3ac79dbd744c1c1$export$c05a196222ba1302(_ref) {
|
|
|
11648
11659
|
} = _ref;
|
|
11649
11660
|
const category_suggestions_ = $52FdA$solidjs.createMemo(() => {
|
|
11650
11661
|
var _suggestions_;
|
|
11651
|
-
return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "
|
|
11662
|
+
return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "listing");
|
|
11652
11663
|
});
|
|
11653
11664
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
11654
11665
|
get when() {
|