@depict-ai/ui 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/main.cjs +343 -644
- package/dist/client/module.js +344 -645
- package/dist/index.d.ts +8 -4
- package/dist/server/main.cjs +319 -454
- package/dist/server/module.js +320 -455
- package/package.json +4 -4
package/dist/client/module.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {add_to_version_info as $gco9i$add_to_version_info, observer as $gco9i$observer, catchify as $gco9i$catchify, useExpandingContainer as $gco9i$useExpandingContainer, standard_price_format as $gco9i$standard_price_format, Amazing_Slider as $gco9i$Amazing_Slider, slider_snap_css as $gco9i$slider_snap_css, slider_fading_factory as $gco9i$slider_fading_factory, make_random_classname as $gco9i$make_random_classname, dlog as $gco9i$dlog,
|
|
1
|
+
import {add_to_version_info as $gco9i$add_to_version_info, observer as $gco9i$observer, catchify as $gco9i$catchify, useExpandingContainer as $gco9i$useExpandingContainer, standard_price_format as $gco9i$standard_price_format, Amazing_Slider as $gco9i$Amazing_Slider, slider_snap_css as $gco9i$slider_snap_css, slider_fading_factory as $gco9i$slider_fading_factory, make_random_classname as $gco9i$make_random_classname, dlog as $gco9i$dlog, hex_to_rgb as $gco9i$hex_to_rgb, report as $gco9i$report, relative_luminance_from_rgb as $gco9i$relative_luminance_from_rgb, javascript_media_query as $gco9i$javascript_media_query, n_col_styling_with_dist as $gco9i$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $gco9i$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $gco9i$layout_get_total_rec_amount_for_row, layout_media_query_header as $gco9i$layout_media_query_header, fetch_recs as $gco9i$fetch_recs, snakeCasifyObject as $gco9i$snakeCasifyObject, instant_exec_on_suspect_history_change as $gco9i$instant_exec_on_suspect_history_change, base_url as $gco9i$base_url, get_depict_id as $gco9i$get_depict_id, get_user_id as $gco9i$get_user_id, get_session_id as $gco9i$get_session_id, sort_obj as $gco9i$sort_obj, fetch_retry as $gco9i$fetch_retry, add_version_query_params as $gco9i$add_version_query_params, dwarn as $gco9i$dwarn, make_url_with_query_params as $gco9i$make_url_with_query_params, base64_encode_unicode as $gco9i$base64_encode_unicode, base64_decode_unicode as $gco9i$base64_decode_unicode, queueMacroTask as $gco9i$queueMacroTask, is_debug as $gco9i$is_debug, make_asyncIterable_exiter as $gco9i$make_asyncIterable_exiter, href_change_ipns as $gco9i$href_change_ipns, ContainedImage as $gco9i$ContainedImage, buildThresholdList as $gco9i$buildThresholdList, deparallelize_no_drop as $gco9i$deparallelize_no_drop, insert_surfaces as $gco9i$insert_surfaces} from "@depict-ai/utilishared";
|
|
2
2
|
import {insert as $gco9i$insert, createComponent as $gco9i$createComponent, template as $gco9i$template, getNextElement as $gco9i$getNextElement, getNextMarker as $gco9i$getNextMarker, addEventListener as $gco9i$addEventListener, runHydrationEvents as $gco9i$runHydrationEvents, memo as $gco9i$memo, delegateEvents as $gco9i$delegateEvents, effect as $gco9i$effect, setAttribute as $gco9i$setAttribute, spread as $gco9i$spread, mergeProps as $gco9i$mergeProps, Dynamic as $gco9i$Dynamic, use as $gco9i$use, style as $gco9i$style, classList as $gco9i$classList, className as $gco9i$className, isServer as $gco9i$isServer} from "solid-js/web";
|
|
3
3
|
import {createSignal as $gco9i$createSignal, createMemo as $gco9i$createMemo, untrack as $gco9i$untrack, createEffect as $gco9i$createEffect, getOwner as $gco9i$getOwner, Show as $gco9i$Show, runWithOwner as $gco9i$runWithOwner, Index as $gco9i$Index, onCleanup as $gco9i$onCleanup, createRoot as $gco9i$createRoot, on as $gco9i$on, For as $gco9i$For, createRenderEffect as $gco9i$createRenderEffect, createComputed as $gco9i$createComputed, batch as $gco9i$batch, ErrorBoundary as $gco9i$ErrorBoundary, createResource as $gco9i$createResource, createReaction as $gco9i$createReaction, Suspense as $gco9i$Suspense} from "solid-js";
|
|
4
4
|
|
|
5
|
-
/*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.3";
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
|
|
@@ -14,11 +12,11 @@ import {createSignal as $gco9i$createSignal, createMemo as $gco9i$createMemo, un
|
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
function $24e27fab9c821b86$export$5bad61ecde080b1f(...params) {
|
|
17
|
-
const { collapse: collapse
|
|
15
|
+
const { collapse: collapse, expand: expand, ExpandingContainer: ExpandingContainer } = (0, $gco9i$useExpandingContainer)(...params);
|
|
18
16
|
return {
|
|
19
17
|
collapse: collapse,
|
|
20
18
|
expand: expand,
|
|
21
|
-
ExpandingContainer: ({ children: children
|
|
19
|
+
ExpandingContainer: ({ children: children })=>{
|
|
22
20
|
// get reactive signals/solid's jsx elements into `ExpandingContainer`
|
|
23
21
|
const fake_div = document.createElement("div");
|
|
24
22
|
const outer_expanding = (0, $gco9i$createComponent)(ExpandingContainer, {
|
|
@@ -39,8 +37,8 @@ const $6bb0a0c563dff4bb$var$has_new_animate = /*@__PURE__*/ $6bb0a0c563dff4bb$ex
|
|
|
39
37
|
function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
40
38
|
let fresh_component = true;
|
|
41
39
|
let timeout_started = false;
|
|
42
|
-
const { details_: details_
|
|
43
|
-
const { expand: expand
|
|
40
|
+
const { details_: details_, summary_: summary_, children: children, duration_: duration_, delay_: delay_, dont_animate_if_instant_open_: dont_animate_if_instant_open_ = true } = props;
|
|
41
|
+
const { expand: expand, ExpandingContainer: ExpandingContainer, collapse: collapse } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
44
42
|
duration: duration_ ?? 250,
|
|
45
43
|
delay: delay_ ?? 0
|
|
46
44
|
});
|
|
@@ -73,7 +71,7 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
73
71
|
}
|
|
74
72
|
}));
|
|
75
73
|
details_.addEventListener("toggle", (0, $gco9i$catchify)(()=>{
|
|
76
|
-
const { open: open
|
|
74
|
+
const { open: open } = details_;
|
|
77
75
|
if (open !== (0, $gco9i$untrack)(()=>props.is_open_[0]())) // diffing here since the two items in is_open might be setters and getters that aren't part of one signal like in CheckboxHierarchicalFilter
|
|
78
76
|
props.is_open_[1](open);
|
|
79
77
|
}) // in case someone somehow toggles it without us intercepting it at least follow suit
|
|
@@ -83,7 +81,7 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
83
81
|
toggle();
|
|
84
82
|
}));
|
|
85
83
|
summary_.addEventListener("keydown", (0, $gco9i$catchify)((ev)=>{
|
|
86
|
-
const { key: key
|
|
84
|
+
const { key: key } = ev;
|
|
87
85
|
if (key === "Enter" || key === " ") {
|
|
88
86
|
ev.preventDefault();
|
|
89
87
|
toggle();
|
|
@@ -123,14 +121,6 @@ function $c16e74cfe125bb05$export$f091cbac892643a4(obj) {
|
|
|
123
121
|
|
|
124
122
|
|
|
125
123
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
124
|
function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
|
|
135
125
|
return (0, $gco9i$createMemo)(()=>{
|
|
136
126
|
const price_formatting = props.price_formatting_;
|
|
@@ -144,13 +134,6 @@ function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
|
|
|
144
134
|
|
|
145
135
|
|
|
146
136
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
137
|
const $fbbadcb080ad1d4a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$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"></path></svg>`, 4);
|
|
155
138
|
function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
|
|
156
139
|
return (()=>{
|
|
@@ -170,7 +153,7 @@ function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
|
|
|
170
153
|
|
|
171
154
|
|
|
172
155
|
const $f32e14878e75af51$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div></div>`, 2);
|
|
173
|
-
function $f32e14878e75af51$export$6649caad96ef8870({ children: children
|
|
156
|
+
function $f32e14878e75af51$export$6649caad96ef8870({ children: children, slider_ref_: slider_ref_, faded_opacity_: faded_opacity_ = 0.7, mutation_plugins_: mutation_plugins_ = [] }) {
|
|
174
157
|
const slider = new (0, $gco9i$Amazing_Slider)({
|
|
175
158
|
button_contents: {
|
|
176
159
|
left: [
|
|
@@ -211,19 +194,10 @@ function $f32e14878e75af51$export$6649caad96ef8870({ children: children , slider
|
|
|
211
194
|
|
|
212
195
|
|
|
213
196
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
197
|
const $bf52d9f9eebd1938$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div></div>`, 2);
|
|
224
198
|
const $bf52d9f9eebd1938$var$closing_functions = /*@__PURE__*/ new Set();
|
|
225
199
|
const $bf52d9f9eebd1938$export$22970a0140fc759c = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$createSignal)(false);
|
|
226
|
-
function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({ children: children
|
|
200
|
+
function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({ children: children, on_close_: on_close_, close_after_: close_after_, ...more_attributes }) {
|
|
227
201
|
let close_toast_;
|
|
228
202
|
const stay_open_promise = new Promise((r)=>close_toast_ = r);
|
|
229
203
|
(0, $gco9i$catchify)(async ()=>{
|
|
@@ -275,7 +249,7 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({ children: children , on_clo
|
|
|
275
249
|
// let other toasts close us if they open while we're still here
|
|
276
250
|
$bf52d9f9eebd1938$var$closing_functions.add(close_toast_);
|
|
277
251
|
set_is_showing_toast(true);
|
|
278
|
-
const handler = (0, $gco9i$catchify)(({ key: key
|
|
252
|
+
const handler = (0, $gco9i$catchify)(({ key: key })=>{
|
|
279
253
|
if (key === "Escape") // make pressing escape close the toast
|
|
280
254
|
close_toast_();
|
|
281
255
|
});
|
|
@@ -335,7 +309,7 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
|
|
|
335
309
|
// if we get called to close the toast before it has shown, never show it
|
|
336
310
|
show_configured_toast = ()=>{};
|
|
337
311
|
};
|
|
338
|
-
const { user_triggered_: user_triggered_
|
|
312
|
+
const { user_triggered_: user_triggered_, i18n_: i18n_, also_clear_sorting_: also_clear_sorting_, local_filter_cache_: [get_local_filter_cache, set_local_filter_cache], selected_filters_: [get_selected_filters, set_selected_filters], expanded_hierarchical_filters_: [get_expanded_hierarchical_filters, set_expanded_hierarchical_filters], delay_toast_: delay_toast_ } = props;
|
|
339
313
|
const previous_selected_filters = (0, $gco9i$untrack)(get_selected_filters);
|
|
340
314
|
if (!previous_selected_filters.length) {
|
|
341
315
|
// no filters selected, still clear sorting if applicable but don't display a toast for that since it's very minor
|
|
@@ -367,7 +341,7 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
|
|
|
367
341
|
}));
|
|
368
342
|
});
|
|
369
343
|
let show_configured_toast = ()=>{
|
|
370
|
-
({ close_toast_: close_toast_
|
|
344
|
+
({ close_toast_: close_toast_ } = (0, $bf52d9f9eebd1938$export$5196e4c01fa56fcb)({
|
|
371
345
|
class: "cleared_filters",
|
|
372
346
|
close_after_: 30000,
|
|
373
347
|
on_close_: on_toast_hidden,
|
|
@@ -407,10 +381,6 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
|
|
|
407
381
|
|
|
408
382
|
|
|
409
383
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
384
|
const $19976a74d273070d$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg><path d="M11.669 10.531l9.156-9.156a.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569A.8.8 0 0 0 20.24 0a.77.77 0 0 0-.569.237l-9.14 9.14-9.14-9.14A.79.79 0 0 0 .807 0a.77.77 0 0 0-.569.237A.78.78 0 0 0 0 .807a.77.77 0 0 0 .237.569l9.156 9.156-9.156 9.14c-.159.157-.237.349-.237.569s.079.412.237.569c.085.085.174.148.268.19a1.095 1.095 0 0 0 .316.048.894.894 0 0 0 .285-.048.84.84 0 0 0 .285-.19l9.139-9.14 9.14 9.14a.894.894 0 0 0 .268.19 1.049 1.049 0 0 0 .301.048.941.941 0 0 0 .301-.048.84.84 0 0 0 .285-.19.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569z"></path></svg>`, 4);
|
|
415
385
|
function $19976a74d273070d$export$3b621d86b1566b2(props = {}) {
|
|
416
386
|
return (()=>{
|
|
@@ -428,10 +398,10 @@ function $19976a74d273070d$export$3b621d86b1566b2(props = {}) {
|
|
|
428
398
|
|
|
429
399
|
|
|
430
400
|
const $1adfe60f3a14a1d7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button class="clear-all-filters minor"></button>`, 2), $1adfe60f3a14a1d7$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="inner"><span class="title"><!#><!/>: </span><!#><!/></div>`, 8), $1adfe60f3a14a1d7$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button class="clear-filter major"><!#><!/><span><!#><!/><!#><!/><!#><!/> – <!#><!/><!#><!/><!#><!/></span></button>`, 18), $1adfe60f3a14a1d7$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button class="clear-filter major"><!#><!/><span></span></button>`, 6);
|
|
431
|
-
function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_
|
|
432
|
-
const { price_formatting_: price_formatting_
|
|
401
|
+
function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_, i18n_: i18n_, selected_filters_: selected_filters_, local_filter_cache_: [read_local_filter_cache], get_search_filters_open_: get_search_filters_open_, get_search_sorting_open_: get_search_sorting_open_, local_filter_cache_: local_filter_cache_, expanded_hierarchical_filters_: expanded_hierarchical_filters_ }) {
|
|
402
|
+
const { price_formatting_: price_formatting_ } = i18n_;
|
|
433
403
|
const [read_selected_filters, write_selected_filters] = selected_filters_;
|
|
434
|
-
const { collapse: collapse
|
|
404
|
+
const { collapse: collapse, expand: expand, ExpandingContainer: ExpandingContainer } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
435
405
|
duration: 200
|
|
436
406
|
});
|
|
437
407
|
const owner = (0, $gco9i$getOwner)();
|
|
@@ -471,7 +441,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
471
441
|
const matching_filter = (0, $gco9i$createMemo)(()=>read_local_filter_cache().find((hay)=>hay.field === filter().field && hay.op === filter().op));
|
|
472
442
|
const meta = (0, $gco9i$createMemo)(()=>matching_filter()?.meta);
|
|
473
443
|
const iterable_selected_filter_data = (0, $gco9i$createMemo)(()=>{
|
|
474
|
-
const { data: data
|
|
444
|
+
const { data: data } = filter();
|
|
475
445
|
if (Array.isArray(data)) return data;
|
|
476
446
|
else return [
|
|
477
447
|
data
|
|
@@ -480,7 +450,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
480
450
|
const data_structure_if_hierarchical = (0, $gco9i$createMemo)(()=>{
|
|
481
451
|
const m = meta();
|
|
482
452
|
if (m?.type !== "checkbox-hierarchical") return;
|
|
483
|
-
const { values: values
|
|
453
|
+
const { values: values } = m;
|
|
484
454
|
const data_structure = {};
|
|
485
455
|
for(let i = 0; i < values.length; i++){
|
|
486
456
|
const value = values[i];
|
|
@@ -603,7 +573,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
603
573
|
if (siblings) return [
|
|
604
574
|
parent,
|
|
605
575
|
...Object.values(siblings)
|
|
606
|
-
].every(({ value_: value_
|
|
576
|
+
].every(({ value_: value_ })=>iterable_selected_filter_data()?.some((v)=>Array.isArray(v) && v.length === value_.length && value_.every((val, index)=>v[index] === val)));
|
|
607
577
|
return false;
|
|
608
578
|
});
|
|
609
579
|
return (0, $gco9i$createComponent)((0, $gco9i$Show), {
|
|
@@ -636,7 +606,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
636
606
|
const recursive_kids = Object.values(in_structure.children_);
|
|
637
607
|
while(recursive_kids.length){
|
|
638
608
|
const kid = recursive_kids.pop();
|
|
639
|
-
const { value_: value_
|
|
609
|
+
const { value_: value_ } = kid;
|
|
640
610
|
const index_to_remove = cloned_data.findIndex((item)=>Array.isArray(item) && item.length === value_.length && value_.every((val, index)=>item[index] === val));
|
|
641
611
|
if (index_to_remove >= 0) cloned_data.splice(index_to_remove, 1);
|
|
642
612
|
recursive_kids.push(...Object.values(kid.children_));
|
|
@@ -703,28 +673,6 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
703
673
|
|
|
704
674
|
|
|
705
675
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
676
|
const $87c712b5b33f24f7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span class="count"></span>`, 2), $87c712b5b33f24f7$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<label class="input-row"><div class="left"><input type="checkbox"><span class="custom-indicator"></span><span class="text"></span></div><!#><!/></label>`, 11);
|
|
729
677
|
const $87c712b5b33f24f7$export$48513f6b9f8ce62d = (props)=>{
|
|
730
678
|
// It seems like there's no diffing without memos here (since we often just have computations in the getters above that update to the same result often because their dependencies change with unrelated changes often), so put memos here to avoid unneeded DOM changes
|
|
@@ -780,19 +728,6 @@ const $87c712b5b33f24f7$export$48513f6b9f8ce62d = (props)=>{
|
|
|
780
728
|
|
|
781
729
|
|
|
782
730
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
731
|
const $f8a56ba74eedd0c6$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg><path d="M10.173 5.548H5.5V.875c0-.075-.027-.14-.081-.193S5.301.601 5.226.601s-.14.027-.193.081-.081.118-.081.193v4.673H.274c-.075 0-.14.027-.193.081A.27.27 0 0 0 0 5.827c0 .075.027.14.081.193s.118.081.193.081h4.678v4.673c0 .075.027.14.081.193s.118.081.193.081.14-.027.193-.081.081-.118.081-.193V6.101h4.673a.27.27 0 0 0 .199-.081c.054-.054.08-.118.08-.193a.27.27 0 0 0-.279-.279z" fill="#000"></path></svg>`, 4);
|
|
797
732
|
function $f8a56ba74eedd0c6$export$f21ab0717a89c77f(props) {
|
|
798
733
|
return (()=>{
|
|
@@ -809,7 +744,7 @@ function $f8a56ba74eedd0c6$export$f21ab0717a89c77f(props) {
|
|
|
809
744
|
|
|
810
745
|
|
|
811
746
|
const $67b173f9db427028$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button type="button" class="expand-filter"><!#><!/><span></span></button>`, 6);
|
|
812
|
-
function $67b173f9db427028$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras]
|
|
747
|
+
function $67b173f9db427028$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras], i18n_: i18n_ }) {
|
|
813
748
|
return (()=>{
|
|
814
749
|
const _el$ = (0, $gco9i$getNextElement)($67b173f9db427028$var$_tmpl$), _el$3 = _el$.firstChild, [_el$4, _co$] = (0, $gco9i$getNextMarker)(_el$3.nextSibling), _el$2 = _el$4.nextSibling;
|
|
815
750
|
(0, $gco9i$addEventListener)(_el$, "click", (0, $gco9i$catchify)(()=>set_show_extras((p)=>!p)), true);
|
|
@@ -831,10 +766,10 @@ function $67b173f9db427028$export$ca21a16d65b3dd8({ show_extras_: [get_show_extr
|
|
|
831
766
|
const $a4601e6bea3ed1e6$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<form class="checkboxes"><!#><!/><!#><!/></form>`, 6);
|
|
832
767
|
const $a4601e6bea3ed1e6$var$max_visible_without_collapsing = 7;
|
|
833
768
|
const $a4601e6bea3ed1e6$var$show_non_collapsible_when_collapsed = 4;
|
|
834
|
-
function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_
|
|
769
|
+
function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters], i18n_: i18n_, view_more_button_below_group_: [, set_view_more_button_below_group_] }) {
|
|
835
770
|
const existing_filter = (0, $gco9i$createMemo)(()=>{
|
|
836
|
-
const { field: field
|
|
837
|
-
return get_selected_filters().find(({ field: checking_field
|
|
771
|
+
const { field: field, op: op } = filter_();
|
|
772
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
838
773
|
});
|
|
839
774
|
let form;
|
|
840
775
|
const checkboxes = (0, $gco9i$createMemo)(()=>{
|
|
@@ -865,7 +800,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
865
800
|
const show_extras_signal = (0, $gco9i$createSignal)(false);
|
|
866
801
|
const [get_show_extras] = show_extras_signal;
|
|
867
802
|
const togglable_rest = (0, $gco9i$createMemo)(()=>checkboxes().length > $a4601e6bea3ed1e6$var$max_visible_without_collapsing);
|
|
868
|
-
const { expand: expand
|
|
803
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
869
804
|
duration: 200
|
|
870
805
|
});
|
|
871
806
|
const expanding_container_els = (0, $gco9i$createComponent)(ExpandingContainer, {
|
|
@@ -903,7 +838,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
903
838
|
const _el$ = (0, $gco9i$getNextElement)($a4601e6bea3ed1e6$var$_tmpl$), _el$2 = _el$.firstChild, [_el$3, _co$] = (0, $gco9i$getNextMarker)(_el$2.nextSibling), _el$4 = _el$3.nextSibling, [_el$5, _co$2] = (0, $gco9i$getNextMarker)(_el$4.nextSibling);
|
|
904
839
|
(0, $gco9i$addEventListener)(_el$, "change", (0, $gco9i$catchify)(()=>{
|
|
905
840
|
const set_filter = existing_filter();
|
|
906
|
-
const { field: field
|
|
841
|
+
const { field: field, op: op } = filter_();
|
|
907
842
|
const base_object = set_filter ? set_filter : {
|
|
908
843
|
op: op,
|
|
909
844
|
field: field
|
|
@@ -938,19 +873,12 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
938
873
|
|
|
939
874
|
|
|
940
875
|
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
876
|
const $eb8d9bf3b5700c26$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<form class="radios"></form>`, 2), $eb8d9bf3b5700c26$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span class="count"></span>`, 2), $eb8d9bf3b5700c26$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<label class="input-row"><div class="left"><input type="radio"><span class="custom-indicator"></span><!#><!/></div><!#><!/></label>`, 11);
|
|
949
|
-
function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected_filters_
|
|
877
|
+
function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected_filters_, filter_: filter_ }) {
|
|
950
878
|
const radio_name = (0, $gco9i$make_random_classname)();
|
|
951
879
|
const existing_filter = (0, $gco9i$createMemo)(()=>{
|
|
952
|
-
const { op: op
|
|
953
|
-
return selected_filters_[0]().find(({ field: checking_field
|
|
880
|
+
const { op: op, field: field } = filter_();
|
|
881
|
+
return selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
954
882
|
});
|
|
955
883
|
return (()=>{
|
|
956
884
|
const _el$ = (0, $gco9i$getNextElement)($eb8d9bf3b5700c26$var$_tmpl$);
|
|
@@ -1016,21 +944,10 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected
|
|
|
1016
944
|
|
|
1017
945
|
|
|
1018
946
|
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
947
|
const $a6b08770e164eced$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="range"><div class="input-group"><div class="field"><input type="number"></div><div class="separator">-</div><div class="field"><input type="number"></div></div><!#><!/><div class="value-text"><span class="min"><!#><!/><!#><!/><!#><!/></span><span class="max"><!#><!/><!#><!/><!#><!/></span></div></div>`, 32), $a6b08770e164eced$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="slider"><div class="progress"></div></div>`, 4), $a6b08770e164eced$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="range-group"><input type="range" step="any"><input type="range" step="any"></div>`, 4);
|
|
1031
|
-
function $a6b08770e164eced$export$e0d834a0ad870cda({ filter_: filter_
|
|
948
|
+
function $a6b08770e164eced$export$e0d834a0ad870cda({ filter_: filter_, selected_filters_: selected_filters_, i18n_: i18n_ }) {
|
|
1032
949
|
const current_range = (0, $gco9i$createSignal)((0, $gco9i$untrack)(()=>filter_().data));
|
|
1033
|
-
const selected_filter = (0, $gco9i$createMemo)(()=>selected_filters_[0]().find(({ field: checking_field
|
|
950
|
+
const selected_filter = (0, $gco9i$createMemo)(()=>selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === filter_().field && checking_op === filter_().op));
|
|
1034
951
|
let debounce_timeout;
|
|
1035
952
|
(0, $gco9i$onCleanup)(()=>clearTimeout(debounce_timeout));
|
|
1036
953
|
(0, $gco9i$createComputed)(()=>{
|
|
@@ -1081,7 +998,7 @@ function $a6b08770e164eced$export$e0d834a0ad870cda({ filter_: filter_ , selected
|
|
|
1081
998
|
}
|
|
1082
999
|
});
|
|
1083
1000
|
}
|
|
1084
|
-
function $a6b08770e164eced$var$RangeSelector({ max_: max_
|
|
1001
|
+
function $a6b08770e164eced$var$RangeSelector({ max_: max_, min_: min_, current_range_: current_range_, price_formatting_: price_formatting_, i18n_: i18n_ }) {
|
|
1085
1002
|
let price_input_1;
|
|
1086
1003
|
let price_input_2;
|
|
1087
1004
|
const [get_current_range] = current_range_;
|
|
@@ -1091,13 +1008,13 @@ function $a6b08770e164eced$var$RangeSelector({ max_: max_ , min_: min_ , current
|
|
|
1091
1008
|
const _el$ = (0, $gco9i$getNextElement)($a6b08770e164eced$var$_tmpl$), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$23 = _el$2.nextSibling, [_el$24, _co$7] = (0, $gco9i$getNextMarker)(_el$23.nextSibling), _el$8 = _el$24.nextSibling, _el$9 = _el$8.firstChild, _el$10 = _el$9.firstChild, [_el$11, _co$] = (0, $gco9i$getNextMarker)(_el$10.nextSibling), _el$12 = _el$11.nextSibling, [_el$13, _co$2] = (0, $gco9i$getNextMarker)(_el$12.nextSibling), _el$14 = _el$13.nextSibling, [_el$15, _co$3] = (0, $gco9i$getNextMarker)(_el$14.nextSibling), _el$16 = _el$9.nextSibling, _el$17 = _el$16.firstChild, [_el$18, _co$4] = (0, $gco9i$getNextMarker)(_el$17.nextSibling), _el$19 = _el$18.nextSibling, [_el$20, _co$5] = (0, $gco9i$getNextMarker)(_el$19.nextSibling), _el$21 = _el$20.nextSibling, [_el$22, _co$6] = (0, $gco9i$getNextMarker)(_el$21.nextSibling);
|
|
1092
1009
|
const _ref$ = price_input_1;
|
|
1093
1010
|
typeof _ref$ === "function" ? (0, $gco9i$use)(_ref$, _el$4) : price_input_1 = _el$4;
|
|
1094
|
-
(0, $gco9i$addEventListener)(_el$4, "keydown", (0, $gco9i$catchify)(({ key: key
|
|
1011
|
+
(0, $gco9i$addEventListener)(_el$4, "keydown", (0, $gco9i$catchify)(({ key: key })=>{
|
|
1095
1012
|
if (key === "Enter") $a6b08770e164eced$var$set_range_with_sanitation(min_, max_, current_range_, 0, price_input_1);
|
|
1096
1013
|
}), true);
|
|
1097
1014
|
(0, $gco9i$addEventListener)(_el$4, "blur", (0, $gco9i$catchify)(()=>$a6b08770e164eced$var$set_range_with_sanitation(min_, max_, current_range_, 0, price_input_1)));
|
|
1098
1015
|
const _ref$2 = price_input_2;
|
|
1099
1016
|
typeof _ref$2 === "function" ? (0, $gco9i$use)(_ref$2, _el$7) : price_input_2 = _el$7;
|
|
1100
|
-
(0, $gco9i$addEventListener)(_el$7, "keydown", (0, $gco9i$catchify)(({ key: key
|
|
1017
|
+
(0, $gco9i$addEventListener)(_el$7, "keydown", (0, $gco9i$catchify)(({ key: key })=>{
|
|
1101
1018
|
if (key === "Enter") $a6b08770e164eced$var$set_range_with_sanitation(min_, max_, current_range_, 1, price_input_2);
|
|
1102
1019
|
}), true);
|
|
1103
1020
|
(0, $gco9i$addEventListener)(_el$7, "blur", (0, $gco9i$catchify)(()=>$a6b08770e164eced$var$set_range_with_sanitation(min_, max_, current_range_, 1, price_input_2)));
|
|
@@ -1150,7 +1067,7 @@ function $a6b08770e164eced$var$RangeSelector({ max_: max_ , min_: min_ , current
|
|
|
1150
1067
|
return _el$;
|
|
1151
1068
|
})();
|
|
1152
1069
|
}
|
|
1153
|
-
function $a6b08770e164eced$var$ExponentialSlider({ current_range_: current_range_
|
|
1070
|
+
function $a6b08770e164eced$var$ExponentialSlider({ current_range_: current_range_, min_: min_, i18n_: i18n_, max_: max_ }) {
|
|
1154
1071
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
1155
1072
|
const transform_linear_to_nonlinear = ([smaller, larger])=>[
|
|
1156
1073
|
Math.sqrt(smaller),
|
|
@@ -1188,7 +1105,7 @@ function $a6b08770e164eced$var$ExponentialSlider({ current_range_: current_range
|
|
|
1188
1105
|
i18n_: i18n_
|
|
1189
1106
|
});
|
|
1190
1107
|
}
|
|
1191
|
-
function $a6b08770e164eced$var$LinearSlider({ max_: max_
|
|
1108
|
+
function $a6b08770e164eced$var$LinearSlider({ max_: max_, min_: min_, current_range_: current_range_, offset_value_calculator_: offset_value_calculator_, i18n_: i18n_ }) {
|
|
1192
1109
|
let range_input_1;
|
|
1193
1110
|
let range_input_2;
|
|
1194
1111
|
let clickable_slider;
|
|
@@ -1308,19 +1225,8 @@ function $a6b08770e164eced$var$set_range_with_sanitation(min_, max_, current_ran
|
|
|
1308
1225
|
|
|
1309
1226
|
|
|
1310
1227
|
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
1228
|
const $0b6bc2f8309efa8a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="morphing-sign" role="img"><span></span><span></span></div>`, 6);
|
|
1323
|
-
function $0b6bc2f8309efa8a$export$e5c2828934226505({ expanded_: expanded_
|
|
1229
|
+
function $0b6bc2f8309efa8a$export$e5c2828934226505({ expanded_: expanded_, i18n_: i18n_ }) {
|
|
1324
1230
|
let first_span;
|
|
1325
1231
|
let second_span;
|
|
1326
1232
|
const animation_options = {
|
|
@@ -1372,11 +1278,11 @@ function $0b6bc2f8309efa8a$export$e5c2828934226505({ expanded_: expanded_ , i18n
|
|
|
1372
1278
|
const $1c8cac76cb67e9af$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<form class="checkboxes hierarchical"><!#><!/><!#><!/></form>`, 6), $1c8cac76cb67e9af$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="checkbox-details"><!#><!/><!#><!/></div>`, 6), $1c8cac76cb67e9af$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<details></details>`, 2), $1c8cac76cb67e9af$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<summary class="category-parent"><div class="summary"><span class="count"></span><!#><!/></div></summary>`, 8);
|
|
1373
1279
|
const $1c8cac76cb67e9af$var$max_visible_without_collapsing = 7;
|
|
1374
1280
|
const $1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed = 4;
|
|
1375
|
-
function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_
|
|
1281
|
+
function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_, selected_filters_: selected_filters_, i18n_: i18n_, view_more_button_below_group_: view_more_button_below_group_, expanded_hierarchical_filters_: expanded_hierarchical_filters_ }) {
|
|
1376
1282
|
let form;
|
|
1377
1283
|
const existing_filter = (0, $gco9i$createMemo)(()=>{
|
|
1378
|
-
const { field: field
|
|
1379
|
-
return selected_filters_[0]().find(({ field: checking_field
|
|
1284
|
+
const { field: field, op: op } = filter_();
|
|
1285
|
+
return selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1380
1286
|
});
|
|
1381
1287
|
const show_extras = (0, $gco9i$createSignal)(false);
|
|
1382
1288
|
const trigger_sync_ = $1c8cac76cb67e9af$var$batching_filter_state_syncer({
|
|
@@ -1389,7 +1295,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
1389
1295
|
});
|
|
1390
1296
|
const structured_categories = (0, $gco9i$createMemo)(()=>{
|
|
1391
1297
|
const execute_when_structure_finished = [];
|
|
1392
|
-
const { values: values
|
|
1298
|
+
const { values: values, names: names, counts: counts } = filter_().meta;
|
|
1393
1299
|
const data_structure = {};
|
|
1394
1300
|
for(let i = 0; i < values.length; i++){
|
|
1395
1301
|
const value = values[i];
|
|
@@ -1411,7 +1317,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
1411
1317
|
value_: value_as_string,
|
|
1412
1318
|
children_: {}
|
|
1413
1319
|
};
|
|
1414
|
-
const { signal_: signal_
|
|
1320
|
+
const { signal_: signal_, on_structure_complete_: on_structure_complete_ } = $1c8cac76cb67e9af$var$create_updating_signal({
|
|
1415
1321
|
self_: created_obj,
|
|
1416
1322
|
existing_filter_: (0, $gco9i$untrack)(existing_filter),
|
|
1417
1323
|
trigger_sync_: trigger_sync_
|
|
@@ -1454,7 +1360,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
1454
1360
|
return data_structure;
|
|
1455
1361
|
});
|
|
1456
1362
|
const some_top_level_are_hidden = (0, $gco9i$createMemo)(()=>Object.keys(structured_categories()).length > $1c8cac76cb67e9af$var$max_visible_without_collapsing);
|
|
1457
|
-
const { expand: expand
|
|
1363
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
1458
1364
|
duration: 200
|
|
1459
1365
|
});
|
|
1460
1366
|
const expanding_container_els = (0, $gco9i$createComponent)(ExpandingContainer, {
|
|
@@ -1528,7 +1434,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1528
1434
|
},
|
|
1529
1435
|
input_ref_: (input)=>{
|
|
1530
1436
|
input.addEventListener("change", (0, $gco9i$catchify)(()=>(0, $gco9i$untrack)(()=>{
|
|
1531
|
-
const { checked: checked
|
|
1437
|
+
const { checked: checked } = input;
|
|
1532
1438
|
if (checked) value()?.is_expanded_.set_user_expanded_(true);
|
|
1533
1439
|
value()?.is_checked_[1](checked);
|
|
1534
1440
|
})));
|
|
@@ -1575,7 +1481,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1575
1481
|
const v = value();
|
|
1576
1482
|
if (!v) // only to prevent cleanup errors
|
|
1577
1483
|
return (0, $gco9i$createSignal)(false);
|
|
1578
|
-
const { is_expanded_: { ui_should_show_expanded_: ui_should_show_expanded_
|
|
1484
|
+
const { is_expanded_: { ui_should_show_expanded_: ui_should_show_expanded_, set_user_expanded_: set_user_expanded_ } } = v;
|
|
1579
1485
|
return [
|
|
1580
1486
|
ui_should_show_expanded_,
|
|
1581
1487
|
set_user_expanded_
|
|
@@ -1597,13 +1503,13 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1597
1503
|
});
|
|
1598
1504
|
}
|
|
1599
1505
|
function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
1600
|
-
const { filter_: filter_
|
|
1506
|
+
const { filter_: filter_, selected_filters_: selected_filters_, existing_filter_: existing_filter_ } = props;
|
|
1601
1507
|
let sync_queued = false;
|
|
1602
1508
|
const sync_fn = (0, $gco9i$catchify)(async ()=>{
|
|
1603
1509
|
sync_queued = false;
|
|
1604
1510
|
// if we change, update filter state - next microtask, so that "reactions" to the change can process before we send it off to the API
|
|
1605
1511
|
const set_filter = existing_filter_();
|
|
1606
|
-
const { field: field
|
|
1512
|
+
const { field: field, op: op } = filter_();
|
|
1607
1513
|
const base_object = set_filter ? set_filter : {
|
|
1608
1514
|
op: op,
|
|
1609
1515
|
field: field
|
|
@@ -1636,7 +1542,7 @@ function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
|
1636
1542
|
};
|
|
1637
1543
|
return trigger_sync;
|
|
1638
1544
|
}
|
|
1639
|
-
function $1c8cac76cb67e9af$var$create_updating_signal({ self_: self_
|
|
1545
|
+
function $1c8cac76cb67e9af$var$create_updating_signal({ self_: self_, existing_filter_: existing_filter_, trigger_sync_: trigger_sync_ }) {
|
|
1640
1546
|
const signal_ = [];
|
|
1641
1547
|
const on_structure_complete_ = ()=>{
|
|
1642
1548
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
@@ -1645,7 +1551,7 @@ function $1c8cac76cb67e9af$var$create_updating_signal({ self_: self_ , existing_
|
|
|
1645
1551
|
signal_.push(...(0, $gco9i$createSignal)(index_of_us_in_selected_filter >= 0 ? true : false));
|
|
1646
1552
|
const [read_checked, write_checked] = signal_;
|
|
1647
1553
|
const child_objects = Object.values(self_.children_);
|
|
1648
|
-
const get_child_object_values = child_objects.map(({ is_checked_: [read_is_checked]
|
|
1554
|
+
const get_child_object_values = child_objects.map(({ is_checked_: [read_is_checked] })=>read_is_checked);
|
|
1649
1555
|
(0, $gco9i$createComputed)((0, $gco9i$on)(read_checked, trigger_sync_, {
|
|
1650
1556
|
defer: true
|
|
1651
1557
|
}));
|
|
@@ -1680,8 +1586,8 @@ function $1c8cac76cb67e9af$var$create_updating_signal({ self_: self_ , existing_
|
|
|
1680
1586
|
on_structure_complete_: on_structure_complete_
|
|
1681
1587
|
};
|
|
1682
1588
|
}
|
|
1683
|
-
function $1c8cac76cb67e9af$var$make_expanded_signal({ expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters]
|
|
1684
|
-
const index_in_expanded_filters = (0, $gco9i$createMemo)(()=>read_expanded_hierarchical_filters().findIndex(({ value_: value_
|
|
1589
|
+
function $1c8cac76cb67e9af$var$make_expanded_signal({ expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters], filter_value_: filter_value_ }) {
|
|
1590
|
+
const index_in_expanded_filters = (0, $gco9i$createMemo)(()=>read_expanded_hierarchical_filters().findIndex(({ value_: value_ })=>value_.length === filter_value_.length && value_.every((item, index)=>filter_value_[index] === item)), undefined, {
|
|
1685
1591
|
equals: false
|
|
1686
1592
|
} // we always want this to update so that we can make updates of the object on this index depend on this memo
|
|
1687
1593
|
);
|
|
@@ -1746,18 +1652,11 @@ function $1c8cac76cb67e9af$var$expand_until_choice(data_structure) {
|
|
|
1746
1652
|
|
|
1747
1653
|
|
|
1748
1654
|
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
1655
|
const $93716a9ad0dea854$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="checkbox-grid"></div>`, 2), $93716a9ad0dea854$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button class="major-minor-transition"></button>`, 2);
|
|
1757
|
-
const $93716a9ad0dea854$export$414f6a19d38e655c = ({ filter_: filter_
|
|
1656
|
+
const $93716a9ad0dea854$export$414f6a19d38e655c = ({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters] })=>{
|
|
1758
1657
|
const existing_filter = (0, $gco9i$createMemo)(()=>{
|
|
1759
|
-
const { field: field
|
|
1760
|
-
return get_selected_filters().find(({ field: checking_field
|
|
1658
|
+
const { field: field, op: op } = filter_();
|
|
1659
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1761
1660
|
});
|
|
1762
1661
|
const buttons = (0, $gco9i$createMemo)(()=>{
|
|
1763
1662
|
const meta = filter_().meta;
|
|
@@ -1779,7 +1678,7 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({ filter_: filter_ , selected
|
|
|
1779
1678
|
const _el$2 = (0, $gco9i$getNextElement)($93716a9ad0dea854$var$_tmpl$2);
|
|
1780
1679
|
(0, $gco9i$addEventListener)(_el$2, "click", (0, $gco9i$catchify)(()=>{
|
|
1781
1680
|
const set_filter = existing_filter();
|
|
1782
|
-
const { field: field
|
|
1681
|
+
const { field: field, op: op } = filter_();
|
|
1783
1682
|
const base_object = set_filter ? set_filter : {
|
|
1784
1683
|
op: op,
|
|
1785
1684
|
field: field
|
|
@@ -1837,16 +1736,9 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({ filter_: filter_ , selected
|
|
|
1837
1736
|
|
|
1838
1737
|
|
|
1839
1738
|
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
1739
|
function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
1848
1740
|
const signal = (0, $gco9i$createSignal)(false);
|
|
1849
|
-
(0, $gco9i$onCleanup)((0, $gco9i$javascript_media_query)(media_query, ({ matches: matches
|
|
1741
|
+
(0, $gco9i$onCleanup)((0, $gco9i$javascript_media_query)(media_query, ({ matches: matches })=>signal[1](matches)).remove);
|
|
1850
1742
|
return signal[0];
|
|
1851
1743
|
}
|
|
1852
1744
|
|
|
@@ -1854,27 +1746,29 @@ function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
|
1854
1746
|
const $e731d52d97444b7c$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<form class="checkbox-color"><!#><!/><!#><!/></form>`, 6);
|
|
1855
1747
|
const $e731d52d97444b7c$var$max_visible_without_collapsing = 14;
|
|
1856
1748
|
const $e731d52d97444b7c$var$show_non_collapsible_when_collapsed = 8;
|
|
1857
|
-
function $e731d52d97444b7c$export$82ed4b28ecb67608({ filter_: filter_
|
|
1749
|
+
function $e731d52d97444b7c$export$82ed4b28ecb67608({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters], i18n_: i18n_, view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_] }) {
|
|
1858
1750
|
const supports_hover = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("not all and (hover: none)");
|
|
1859
1751
|
// same as in CheckboxFilter, maybe we should make this DRY at some point
|
|
1860
1752
|
const existing_filter = (0, $gco9i$createMemo)(()=>{
|
|
1861
|
-
const { field: field
|
|
1862
|
-
return get_selected_filters().find(({ field: checking_field
|
|
1753
|
+
const { field: field, op: op } = filter_();
|
|
1754
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1863
1755
|
});
|
|
1864
1756
|
let form;
|
|
1865
1757
|
const checkboxes = (0, $gco9i$createMemo)(()=>{
|
|
1866
1758
|
const meta = filter_().meta;
|
|
1867
|
-
return meta.values.map((value_, index)
|
|
1868
|
-
|
|
1759
|
+
return meta.values.map((value_, index)=>{
|
|
1760
|
+
return {
|
|
1869
1761
|
value_: value_,
|
|
1870
1762
|
name_: meta.names?.[index],
|
|
1871
|
-
count_: meta.counts?.[index]
|
|
1872
|
-
|
|
1873
|
-
|
|
1763
|
+
count_: meta.counts?.[index]
|
|
1764
|
+
};
|
|
1765
|
+
});
|
|
1874
1766
|
});
|
|
1875
1767
|
const render_checkbox = (checkbox)=>{
|
|
1876
|
-
|
|
1877
|
-
const
|
|
1768
|
+
const color_name = (0, $gco9i$createMemo)(()=>checkbox().value_.split(";")?.[0] || "");
|
|
1769
|
+
const hex_color = (0, $gco9i$createMemo)(()=>checkbox().value_.split(";")?.[1] || "");
|
|
1770
|
+
const rgb_color = (0, $gco9i$createMemo)(()=>(0, $gco9i$hex_to_rgb)(hex_color()));
|
|
1771
|
+
const black_contrast_better = (0, $gco9i$createMemo)(()=>rgb_color() ? $e731d52d97444b7c$var$does_black_contrast_better(rgb_color()) : true);
|
|
1878
1772
|
const input_row = (0, $gco9i$createComponent)((0, $87c712b5b33f24f7$export$48513f6b9f8ce62d), {
|
|
1879
1773
|
get value_ () {
|
|
1880
1774
|
return checkbox().value_;
|
|
@@ -1889,51 +1783,22 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
1889
1783
|
return existing_filter()?.data?.includes(checkbox().value_);
|
|
1890
1784
|
},
|
|
1891
1785
|
custom_indicator_ref: (span)=>{
|
|
1892
|
-
const { classList: classList
|
|
1893
|
-
// create some memos for diffing
|
|
1894
|
-
const hue = (0, $gco9i$createMemo)(()=>checkbox().color_[0]);
|
|
1895
|
-
const saturation = (0, $gco9i$createMemo)(()=>checkbox().color_[1]);
|
|
1896
|
-
const lightness = (0, $gco9i$createMemo)(()=>checkbox().color_[2]);
|
|
1897
|
-
const special_type = (0, $gco9i$createMemo)(()=>checkbox().color_[3]);
|
|
1786
|
+
const { classList: classList, style: style } = span;
|
|
1898
1787
|
classList.add("color");
|
|
1899
1788
|
(0, $gco9i$createComputed)(()=>{
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
// to generate darkened gradient, this was used:
|
|
1904
|
-
// $change: -5%;
|
|
1905
|
-
// background: linear-gradient(
|
|
1906
|
-
// 180deg,
|
|
1907
|
-
// color.adjust(#ff0000, $lightness: $change) 0%,
|
|
1908
|
-
// color.adjust(#ff6e00, $lightness: $change) 17.71%,
|
|
1909
|
-
// color.adjust(#ffff00, $lightness: $change) 33.33%,
|
|
1910
|
-
// color.adjust(#1eb41e, $lightness: $change) 50.52%,
|
|
1911
|
-
// color.adjust(#00d2ff, $lightness: $change) 67.71%,
|
|
1912
|
-
// color.adjust(#3737c8, $lightness: $change) 83.85%,
|
|
1913
|
-
// color.adjust(#d200ff, $lightness: $change) 100%
|
|
1914
|
-
// );
|
|
1915
|
-
classList.toggle("check-multi", true);
|
|
1916
|
-
style.backgroundImage = is_hovered ? `linear-gradient(#e60000 0%, #e66300 17.71%, #e6e600 33.33%, #1a9e1a 50.52%, #00bde6 67.71%, #3232b4 83.85%, #bd00e6 100%)` : `linear-gradient(180deg, #FF0000 0%, #FF6E00 17.71%, #FFFF00 33.33%, #1EB41E 50.52%, #00D2FF 67.71%, #3737C8 83.85%, #D200FF 100%)`;
|
|
1917
|
-
} else {
|
|
1918
|
-
const is_light = lightness() > 50;
|
|
1919
|
-
// lighten or darken (+/- 10) depending on it's over or under 50 lightness
|
|
1920
|
-
// lighten under 25 lightness by 20
|
|
1921
|
-
const target_lightness = is_hovered ? is_light ? lightness() - 10 : lightness() < 25 ? lightness() + 20 : lightness() + 10 : lightness();
|
|
1922
|
-
classList.toggle("check-dark", $e731d52d97444b7c$var$black_contrast_better(hue(), saturation(), lightness())); // Decide between black/white checkmark based on which one has better contrast according to WCAG contrast guidelines
|
|
1923
|
-
style.backgroundColor = `hsl(${hue()}, ${saturation()}%, ${target_lightness}%)`;
|
|
1924
|
-
}
|
|
1789
|
+
style.background = hex_color();
|
|
1790
|
+
span.dataset.colorName = color_name();
|
|
1791
|
+
classList.toggle("black-check", black_contrast_better());
|
|
1925
1792
|
});
|
|
1926
1793
|
}
|
|
1927
1794
|
});
|
|
1928
|
-
input_row.addEventListener("mouseover", (0, $gco9i$catchify)(()=>set_is_hovered(true)));
|
|
1929
|
-
input_row.addEventListener("mouseout", (0, $gco9i$catchify)(()=>set_is_hovered(false)));
|
|
1930
1795
|
return input_row;
|
|
1931
1796
|
};
|
|
1932
1797
|
const show_extras_signal = (0, $gco9i$createSignal)(false);
|
|
1933
1798
|
const [get_show_extras] = show_extras_signal;
|
|
1934
1799
|
const togglable_rest = (0, $gco9i$createMemo)(()=>checkboxes().length > $e731d52d97444b7c$var$max_visible_without_collapsing);
|
|
1935
1800
|
const expand_animation_duration = 200;
|
|
1936
|
-
const { expand: expand
|
|
1801
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
1937
1802
|
duration: expand_animation_duration
|
|
1938
1803
|
});
|
|
1939
1804
|
const [get_having_expanding_in_dom, set_having_expanding_in_dom] = (0, $gco9i$createSignal)((0, $gco9i$untrack)(togglable_rest)); // We need to remove the expanding els from the DOM if they're empty, otherwise the flexbox makes a weird gap to the right of the last item sometimes
|
|
@@ -1981,7 +1846,7 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
1981
1846
|
const _el$ = (0, $gco9i$getNextElement)($e731d52d97444b7c$var$_tmpl$), _el$2 = _el$.firstChild, [_el$3, _co$] = (0, $gco9i$getNextMarker)(_el$2.nextSibling), _el$4 = _el$3.nextSibling, [_el$5, _co$2] = (0, $gco9i$getNextMarker)(_el$4.nextSibling);
|
|
1982
1847
|
(0, $gco9i$addEventListener)(_el$, "change", (0, $gco9i$catchify)(()=>{
|
|
1983
1848
|
const set_filter = existing_filter();
|
|
1984
|
-
const { field: field
|
|
1849
|
+
const { field: field, op: op } = filter_();
|
|
1985
1850
|
const base_object = set_filter ? set_filter : {
|
|
1986
1851
|
op: op,
|
|
1987
1852
|
field: field
|
|
@@ -2016,9 +1881,9 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
2016
1881
|
return _el$;
|
|
2017
1882
|
})();
|
|
2018
1883
|
}
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
const luminance_color = (0, $gco9i$relative_luminance_from_rgb)(...
|
|
1884
|
+
// Daniel's magic https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7648#note_1468373350
|
|
1885
|
+
function $e731d52d97444b7c$var$does_black_contrast_better(rgb) {
|
|
1886
|
+
const luminance_color = (0, $gco9i$relative_luminance_from_rgb)(...rgb);
|
|
2022
1887
|
const luminance_white = 1;
|
|
2023
1888
|
const luminance_black = 0;
|
|
2024
1889
|
const contrast_ratio_if_white = (luminance_white + 0.05) / (luminance_color + 0.05);
|
|
@@ -2043,14 +1908,6 @@ var $12497d09ef87296e$export$2e2bcd8739ae039 = {
|
|
|
2043
1908
|
|
|
2044
1909
|
|
|
2045
1910
|
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
1911
|
const $9bc34983fc5f7bdb$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg xmlns="http://www.w3.org/2000/svg" width="16.8" height="14"><path d="M4.617 12.738a.48.48 0 0 1-.164-.027c-.051-.023-.094-.055-.129-.098L.125 8.414A.39.39 0 0 1 0 8.117c0-.113.039-.211.125-.293s.18-.125.293-.125.215.043.297.125l3.902 3.902L16.086.262c.082-.082.18-.125.297-.125s.211.043.293.125.125.184.125.301-.043.215-.125.297L4.914 12.613c-.039.043-.086.078-.141.098s-.102.027-.156.027zm0 0"></path></svg>`, 4);
|
|
2055
1912
|
function $9bc34983fc5f7bdb$export$f2ca6fc699ca1fb4(props = {}) {
|
|
2056
1913
|
return (()=>{
|
|
@@ -2063,17 +1920,17 @@ function $9bc34983fc5f7bdb$export$f2ca6fc699ca1fb4(props = {}) {
|
|
|
2063
1920
|
|
|
2064
1921
|
|
|
2065
1922
|
const $a7b58cb3bcffd156$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span class="show-selected" aria-hidden="true"><span></span><!#><!/></span>`, 6);
|
|
2066
|
-
function $a7b58cb3bcffd156$export$53c59af873b303c9({ selected_filters_in_group_: selected_filters_in_group_
|
|
1923
|
+
function $a7b58cb3bcffd156$export$53c59af873b303c9({ selected_filters_in_group_: selected_filters_in_group_, i18n_: { price_formatting_: price_formatting_ } }) {
|
|
2067
1924
|
const [show_tick_icon, set_show_tick_icon] = (0, $gco9i$createSignal)(false);
|
|
2068
1925
|
const text = (0, $gco9i$createMemo)(()=>(0, $gco9i$batch)(()=>{
|
|
2069
1926
|
set_show_tick_icon(false);
|
|
2070
|
-
let { size: size
|
|
1927
|
+
let { size: size } = selected_filters_in_group_();
|
|
2071
1928
|
try_specific: {
|
|
2072
1929
|
if (size > 1) break try_specific;
|
|
2073
1930
|
for (const [selected_filter, filter_data] of selected_filters_in_group_()){
|
|
2074
1931
|
// we're intentionally not looping in this statement since we always just want to show the first thing in the filter group
|
|
2075
|
-
const { meta: meta
|
|
2076
|
-
const { type: type
|
|
1932
|
+
const { meta: meta } = filter_data;
|
|
1933
|
+
const { type: type } = meta;
|
|
2077
1934
|
if (type === "range") return [
|
|
2078
1935
|
(0, $gco9i$memo)(()=>price_formatting_().pre_),
|
|
2079
1936
|
(0, $gco9i$createComponent)((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
|
|
@@ -2098,7 +1955,7 @@ function $a7b58cb3bcffd156$export$53c59af873b303c9({ selected_filters_in_group_:
|
|
|
2098
1955
|
(0, $gco9i$memo)(()=>price_formatting_().post_)
|
|
2099
1956
|
];
|
|
2100
1957
|
else {
|
|
2101
|
-
const { data: data
|
|
1958
|
+
const { data: data } = selected_filter;
|
|
2102
1959
|
const data_is_array = Array.isArray(data);
|
|
2103
1960
|
if (data_is_array && data.length !== 1) {
|
|
2104
1961
|
size = data.length;
|
|
@@ -2182,10 +2039,6 @@ function $84d6cd10bb7b1589$export$ab34afce88557c0e(props) {
|
|
|
2182
2039
|
|
|
2183
2040
|
|
|
2184
2041
|
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
2042
|
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
2190
2043
|
class $4fd48cb976bf1789$export$e1d52e4f0c7557a1 extends Error {
|
|
2191
2044
|
}
|
|
@@ -2202,7 +2055,7 @@ const $b7436a6d1fd64e3b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$templ
|
|
|
2202
2055
|
function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
|
|
2203
2056
|
return (0, $gco9i$ErrorBoundary)({
|
|
2204
2057
|
fallback (err, retry) {
|
|
2205
|
-
const { message_: message_
|
|
2058
|
+
const { message_: message_, severity_: severity_ } = props;
|
|
2206
2059
|
let message = message_;
|
|
2207
2060
|
if (err instanceof (0, $4fd48cb976bf1789$export$aa14a9f43128f61f)) {
|
|
2208
2061
|
console.error(err.cause);
|
|
@@ -2232,11 +2085,6 @@ function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
|
|
|
2232
2085
|
|
|
2233
2086
|
|
|
2234
2087
|
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
2088
|
const $d20eff0aadc28983$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span></span>`, 2);
|
|
2241
2089
|
function $d20eff0aadc28983$export$acb3eaade4b23afd(props) {
|
|
2242
2090
|
return (()=>{
|
|
@@ -2258,7 +2106,7 @@ function $d20eff0aadc28983$export$acb3eaade4b23afd(props) {
|
|
|
2258
2106
|
|
|
2259
2107
|
function $d134eae24341b4a1$export$89c6019e4baa40b1(props) {
|
|
2260
2108
|
const style = (0, $gco9i$createMemo)(()=>{
|
|
2261
|
-
const { style: style
|
|
2109
|
+
const { style: style, height: height, width: width } = props;
|
|
2262
2110
|
return {
|
|
2263
2111
|
...style || {},
|
|
2264
2112
|
height: height ?? "1em",
|
|
@@ -2430,7 +2278,7 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
|
|
|
2430
2278
|
...props.selected_filters_[0]()
|
|
2431
2279
|
];
|
|
2432
2280
|
for (const filter of filter_array_()){
|
|
2433
|
-
const index = new_filter_obj.findIndex(({ op: op
|
|
2281
|
+
const index = new_filter_obj.findIndex(({ op: op, field: field })=>op === filter.op && field === filter.field);
|
|
2434
2282
|
if (index >= 0) new_filter_obj.splice(index, 1);
|
|
2435
2283
|
}
|
|
2436
2284
|
props.selected_filters_[1](new_filter_obj);
|
|
@@ -2516,7 +2364,7 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
|
|
|
2516
2364
|
|
|
2517
2365
|
|
|
2518
2366
|
|
|
2519
|
-
function $5efb5894079b220e$export$b288c38ae3fddb56({ available_filters_: available_filters_
|
|
2367
|
+
function $5efb5894079b220e$export$b288c38ae3fddb56({ available_filters_: available_filters_, local_filter_cache_: [read_local_cache, write_local_cache], selected_filters_: [read_selected_filters] }) {
|
|
2520
2368
|
let last_remote_state;
|
|
2521
2369
|
(0, $gco9i$createComputed)(()=>{
|
|
2522
2370
|
const remote_filters = Object.fromEntries(available_filters_()?.map((filter)=>[
|
|
@@ -2603,14 +2451,14 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
2603
2451
|
}).map((key)=>data_objs_in_local[key]),
|
|
2604
2452
|
...Object.values(data_objs_in_remote)
|
|
2605
2453
|
];
|
|
2606
|
-
const new_values = new_data.map(({ value_: value_
|
|
2454
|
+
const new_values = new_data.map(({ value_: value_ })=>value_);
|
|
2607
2455
|
const result = {
|
|
2608
2456
|
...remote_filter,
|
|
2609
2457
|
meta: {
|
|
2610
2458
|
...remote_filter.meta,
|
|
2611
2459
|
values: new_values,
|
|
2612
|
-
names: new_data.map(({ name_: name_
|
|
2613
|
-
counts: new_data.map(({ count_: count_
|
|
2460
|
+
names: new_data.map(({ name_: name_ })=>name_),
|
|
2461
|
+
counts: new_data.map(({ count_: count_ })=>count_)
|
|
2614
2462
|
}
|
|
2615
2463
|
};
|
|
2616
2464
|
new_local_filter_state.push(result);
|
|
@@ -2668,16 +2516,6 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
2668
2516
|
|
|
2669
2517
|
|
|
2670
2518
|
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
2519
|
function $a52235d12ccf9c88$export$2f0cbfbb4354bb52(elements) {
|
|
2682
2520
|
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
2683
2521
|
return (0, $gco9i$createMemo)(()=>$a52235d12ccf9c88$var$unwrapping_helper(elements));
|
|
@@ -2697,17 +2535,24 @@ function $a52235d12ccf9c88$var$unwrapping_helper(elements) {
|
|
|
2697
2535
|
|
|
2698
2536
|
const $c8d5ff4524619fcd$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div></div>`, 2), $c8d5ff4524619fcd$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<style type="text/css"></style>`, 2);
|
|
2699
2537
|
function $c8d5ff4524619fcd$export$d21e32dfedac04be(props) {
|
|
2538
|
+
const container_element_ = (()=>{
|
|
2539
|
+
const _el$ = (0, $gco9i$getNextElement)($c8d5ff4524619fcd$var$_tmpl$);
|
|
2540
|
+
(0, $gco9i$spread)(_el$, (0, $gco9i$mergeProps)(()=>props.element_attributes), false, true);
|
|
2541
|
+
(0, $gco9i$insert)(_el$, ()=>props.children);
|
|
2542
|
+
(0, $gco9i$runHydrationEvents)();
|
|
2543
|
+
return _el$;
|
|
2544
|
+
})(); // Don't want this in the error boundary below, it should only be for the actual layouting
|
|
2700
2545
|
return (0, $gco9i$createComponent)((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
|
|
2701
2546
|
get message_ () {
|
|
2702
2547
|
return "Failed calculating " + props.layout + " layout";
|
|
2703
2548
|
},
|
|
2704
2549
|
severity_: "error",
|
|
2705
2550
|
get children () {
|
|
2706
|
-
return $c8d5ff4524619fcd$var$ActualSolidLayout(props);
|
|
2551
|
+
return $c8d5ff4524619fcd$var$ActualSolidLayout(props, container_element_);
|
|
2707
2552
|
}
|
|
2708
2553
|
});
|
|
2709
2554
|
}
|
|
2710
|
-
function $c8d5ff4524619fcd$var$ActualSolidLayout(props) {
|
|
2555
|
+
function $c8d5ff4524619fcd$var$ActualSolidLayout(props, container_element) {
|
|
2711
2556
|
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
2712
2557
|
const show_all_rows = (0, $gco9i$createMemo)(()=>props.rows === "all");
|
|
2713
2558
|
const rows_or_empty_object = (0, $gco9i$createMemo)(()=>show_all_rows() ? {} : props.rows);
|
|
@@ -2719,13 +2564,6 @@ function $c8d5ff4524619fcd$var$ActualSolidLayout(props) {
|
|
|
2719
2564
|
const [get_styling, set_styling] = (0, $gco9i$createSignal)();
|
|
2720
2565
|
const container_class = (0, $gco9i$make_random_classname)();
|
|
2721
2566
|
const selector_beginning = `.depict .${container_class}>`; // class so ppl can have id if needed
|
|
2722
|
-
const container_element = (()=>{
|
|
2723
|
-
const _el$ = (0, $gco9i$getNextElement)($c8d5ff4524619fcd$var$_tmpl$);
|
|
2724
|
-
(0, $gco9i$spread)(_el$, (0, $gco9i$mergeProps)(()=>props.element_attributes), false, true);
|
|
2725
|
-
(0, $gco9i$insert)(_el$, ()=>props.children);
|
|
2726
|
-
(0, $gco9i$runHydrationEvents)();
|
|
2727
|
-
return _el$;
|
|
2728
|
-
})();
|
|
2729
2567
|
const [get_children_count, set_children_count] = (0, $gco9i$createSignal)(0);
|
|
2730
2568
|
const update_children_count = ()=>set_children_count(container_element.children.length);
|
|
2731
2569
|
const col_styling = (0, $gco9i$createMemo)(()=>(0, $gco9i$n_col_styling_with_dist)(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
|
|
@@ -2765,7 +2603,7 @@ function $c8d5ff4524619fcd$var$ActualSolidLayout(props) {
|
|
|
2765
2603
|
(0, $gco9i$onCleanup)(()=>mutation_observer.disconnect());
|
|
2766
2604
|
set_styling(// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
2767
2605
|
()=>(0, $gco9i$createMemo)(()=>{
|
|
2768
|
-
const { rows_per_click: rows_per_click
|
|
2606
|
+
const { rows_per_click: rows_per_click, max_rows: max_rows = -1 } = rows_or_empty_object();
|
|
2769
2607
|
const rows_visible = get_rows_visible();
|
|
2770
2608
|
const children_count = get_children_count();
|
|
2771
2609
|
return col_styling() + props.cols_at_size.map((options)=>{
|
|
@@ -2854,7 +2692,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2854
2692
|
|
|
2855
2693
|
|
|
2856
2694
|
|
|
2857
|
-
async function $c58717f39bf51647$export$58e808b1db15d3bc({ merchant: merchant
|
|
2695
|
+
async function $c58717f39bf51647$export$58e808b1db15d3bc({ merchant: merchant, market: market, headers: headers, ...fetch_recs_options }) {
|
|
2858
2696
|
return await (0, $gco9i$fetch_recs)({
|
|
2859
2697
|
tenant: merchant,
|
|
2860
2698
|
market: market
|
|
@@ -2866,11 +2704,6 @@ async function $c58717f39bf51647$export$58e808b1db15d3bc({ merchant: merchant ,
|
|
|
2866
2704
|
|
|
2867
2705
|
|
|
2868
2706
|
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
2707
|
function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, router_) {
|
|
2875
2708
|
const signals = {};
|
|
2876
2709
|
const entries = Object.entries(params_to_default_value);
|
|
@@ -2880,7 +2713,7 @@ function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, rout
|
|
|
2880
2713
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
2881
2714
|
(0, $gco9i$createRenderEffect)(()=>{
|
|
2882
2715
|
let signal_changed = false;
|
|
2883
|
-
let { state: state
|
|
2716
|
+
let { state: state } = globalThis?.history || {
|
|
2884
2717
|
state: {}
|
|
2885
2718
|
}; // cloning isn't necessary because we're calling replaceState on it anyway
|
|
2886
2719
|
if (state === null || typeof state != "object") state = {};
|
|
@@ -2911,7 +2744,7 @@ function $ca6f574bd8772184$var$history_state_change(signals, entries, state) {
|
|
|
2911
2744
|
}
|
|
2912
2745
|
|
|
2913
2746
|
|
|
2914
|
-
function $a8fa7302d6f93c0b$export$9862539c89138352({ get_default_values_: get_default_values_
|
|
2747
|
+
function $a8fa7302d6f93c0b$export$9862539c89138352({ get_default_values_: get_default_values_, router_: router_, prefix_: prefix_ }) {
|
|
2915
2748
|
const get_prefixed_default_values_ = ()=>{
|
|
2916
2749
|
const default_values = get_default_values_();
|
|
2917
2750
|
return Object.fromEntries(Object.entries(default_values).map(([key, value])=>[
|
|
@@ -2940,6 +2773,38 @@ function $a8fa7302d6f93c0b$export$9862539c89138352({ get_default_values_: get_de
|
|
|
2940
2773
|
|
|
2941
2774
|
|
|
2942
2775
|
|
|
2776
|
+
/**
|
|
2777
|
+
* We use group_title for more beautiful urls if possible, this function modifies the search filters in an API response to have group_title as field, when possible.
|
|
2778
|
+
* Backend supports accepting group_title as field, so we just pretend it was field in the whole app to avoid major refactoring.
|
|
2779
|
+
* But also because it would be a lot more code since it's not guaranteed for group_title to exist. So at all places where we take `field` to send it to the API we'd have to check if group_title exists and use that instead and at all places where we try to pair filters sent from the API and filters set we'd have to both check if `op` and `field` match or if `op` and `group_title` match.
|
|
2780
|
+
*
|
|
2781
|
+
* This way it's just much simpler - group_title _is_ field for all intents and purposes if it exists, and we don't have to change anything/add lots of if-statements. The only reason we need the old field (actual_field) is for the compatibility with the old filters (see fix_old_filter_links).
|
|
2782
|
+
*/ function $e5014ccd0b76d9f4$export$967e966fca9515e(api_response) {
|
|
2783
|
+
if ("filters" in api_response) {
|
|
2784
|
+
const filters = api_response.filters;
|
|
2785
|
+
if (!filters) return api_response;
|
|
2786
|
+
const new_filters = [];
|
|
2787
|
+
for(let i = 0; i < filters.length; i++){
|
|
2788
|
+
const filter = filters[i];
|
|
2789
|
+
const group_title = filter.meta?.group_title?.toLowerCase();
|
|
2790
|
+
const new_filter = {
|
|
2791
|
+
...filter
|
|
2792
|
+
};
|
|
2793
|
+
if (group_title) {
|
|
2794
|
+
new_filter.field = group_title;
|
|
2795
|
+
new_filter.actual_field = filter.field;
|
|
2796
|
+
}
|
|
2797
|
+
new_filters.push(new_filter);
|
|
2798
|
+
}
|
|
2799
|
+
return {
|
|
2800
|
+
...api_response,
|
|
2801
|
+
filters: new_filters
|
|
2802
|
+
};
|
|
2803
|
+
}
|
|
2804
|
+
return api_response;
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
|
|
2943
2808
|
const $7fa23e2a0079eca4$var$v2_base_url = (0, $gco9i$base_url) + "/v2/";
|
|
2944
2809
|
const $7fa23e2a0079eca4$var$search_base_url = $7fa23e2a0079eca4$var$v2_base_url + "search/";
|
|
2945
2810
|
class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
@@ -2995,7 +2860,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2995
2860
|
Object.defineProperties(category_suggestions.pop(), Object.getOwnPropertyDescriptors(page_urls.pop()));
|
|
2996
2861
|
return response;
|
|
2997
2862
|
}
|
|
2998
|
-
async #run_url_creator_for_rest(
|
|
2863
|
+
async #run_url_creator_for_rest(merchant, market, input_data) {
|
|
2999
2864
|
if (!this.page_url_creator) return input_data;
|
|
3000
2865
|
const displays = input_data.displays;
|
|
3001
2866
|
const breadcrumb = input_data.breadcrumb;
|
|
@@ -3003,8 +2868,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
3003
2868
|
if (displays) {
|
|
3004
2869
|
const page_urls = await this.page_url_creator({
|
|
3005
2870
|
type: "products",
|
|
3006
|
-
merchant:
|
|
3007
|
-
market:
|
|
2871
|
+
merchant: merchant,
|
|
2872
|
+
market: market,
|
|
3008
2873
|
displays: [
|
|
3009
2874
|
...input_data.displays
|
|
3010
2875
|
]
|
|
@@ -3031,8 +2896,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
3031
2896
|
if (!category_display_array) continue;
|
|
3032
2897
|
const page_urls = await this.page_url_creator({
|
|
3033
2898
|
type: "categories",
|
|
3034
|
-
merchant:
|
|
3035
|
-
market:
|
|
2899
|
+
merchant: merchant,
|
|
2900
|
+
market: market,
|
|
3036
2901
|
data: [
|
|
3037
2902
|
...category_display_array
|
|
3038
2903
|
]
|
|
@@ -3043,8 +2908,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
3043
2908
|
}
|
|
3044
2909
|
return input_data;
|
|
3045
2910
|
}
|
|
3046
|
-
async #cached_post_request(
|
|
3047
|
-
const cache_obj = this.#get_cache_obj_for_endpoint(
|
|
2911
|
+
async #cached_post_request(endpoint, input_req, fallback_response) {
|
|
2912
|
+
const cache_obj = this.#get_cache_obj_for_endpoint(endpoint);
|
|
3048
2913
|
const with_ids = this.#add_ids_to_request(input_req);
|
|
3049
2914
|
const metaData = await this.#get_metadata?.();
|
|
3050
2915
|
const request = metaData ? Object.assign(with_ids, {
|
|
@@ -3058,7 +2923,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
3058
2923
|
let resolve_in_progress;
|
|
3059
2924
|
cache_obj.in_progress_[body] = new Promise((r)=>resolve_in_progress = r);
|
|
3060
2925
|
try {
|
|
3061
|
-
const api_response = await (0, $gco9i$fetch_retry)((0, $gco9i$add_version_query_params)(
|
|
2926
|
+
const api_response = await (0, $gco9i$fetch_retry)((0, $gco9i$add_version_query_params)(endpoint), {
|
|
3062
2927
|
method: "POST",
|
|
3063
2928
|
body: body
|
|
3064
2929
|
});
|
|
@@ -3072,6 +2937,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
3072
2937
|
(0, $gco9i$dwarn)("URL creator or json decoding failed", e);
|
|
3073
2938
|
break return_successfully;
|
|
3074
2939
|
}
|
|
2940
|
+
// Here result actually becomes O
|
|
2941
|
+
result = (0, $e5014ccd0b76d9f4$export$967e966fca9515e)(result);
|
|
3075
2942
|
cache_obj.cache_[body] = new WeakRef(result);
|
|
3076
2943
|
resolve_in_progress(result);
|
|
3077
2944
|
setTimeout((0, $gco9i$catchify)(()=>{
|
|
@@ -3091,7 +2958,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
3091
2958
|
}
|
|
3092
2959
|
}
|
|
3093
2960
|
constructor(options){
|
|
3094
|
-
const { get_metadata: get_metadata
|
|
2961
|
+
const { get_metadata: get_metadata, get_user_id: get_user_id, get_session_id: get_session_id, page_url_creator: page_url_creator } = options ?? {};
|
|
3095
2962
|
this.#get_metadata = get_metadata;
|
|
3096
2963
|
this.#get_user_id = get_user_id;
|
|
3097
2964
|
this.#get_session_id = get_session_id;
|
|
@@ -3156,21 +3023,14 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
3156
3023
|
|
|
3157
3024
|
|
|
3158
3025
|
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
3026
|
const $fc5a12f3a857ca30$var$get_available_range = (available_filters_, search_for_field)=>{
|
|
3167
|
-
const maybe_meta = (0, $gco9i$untrack)(available_filters_)?.find(({ op: op
|
|
3027
|
+
const maybe_meta = (0, $gco9i$untrack)(available_filters_)?.find(({ op: op, field: field })=>field === search_for_field && op === "inrange")?.meta;
|
|
3168
3028
|
if (maybe_meta?.min != undefined && maybe_meta?.max != undefined) return [
|
|
3169
3029
|
maybe_meta.min,
|
|
3170
3030
|
maybe_meta.max
|
|
3171
3031
|
];
|
|
3172
3032
|
};
|
|
3173
|
-
function $fc5a12f3a857ca30$export$e702733a056c40d6({ available_filters_: available_filters_
|
|
3033
|
+
function $fc5a12f3a857ca30$export$e702733a056c40d6({ available_filters_: available_filters_, selected_filters_: selected_filters_ }) {
|
|
3174
3034
|
(0, $gco9i$createComputed)(()=>{
|
|
3175
3035
|
// we don't want to update (as selected_filters change) as navigating will change the selected range before the available range changes and we might ruin a perfectly valid filter range
|
|
3176
3036
|
available_filters_();
|
|
@@ -3180,7 +3040,7 @@ function $fc5a12f3a857ca30$export$e702733a056c40d6({ available_filters_: availab
|
|
|
3180
3040
|
});
|
|
3181
3041
|
});
|
|
3182
3042
|
}
|
|
3183
|
-
function $fc5a12f3a857ca30$var$correct_range_filter_range_once({ selected_filters_: [read_selected_filters_, write_selected_filters_]
|
|
3043
|
+
function $fc5a12f3a857ca30$var$correct_range_filter_range_once({ selected_filters_: [read_selected_filters_, write_selected_filters_], available_filters_: available_filters_ }) {
|
|
3184
3044
|
const selected_filters = (0, $gco9i$untrack)(read_selected_filters_);
|
|
3185
3045
|
if (!selected_filters) return;
|
|
3186
3046
|
for(let i = 0; i < selected_filters.length; i++){
|
|
@@ -3223,7 +3083,7 @@ function $fc5a12f3a857ca30$var$correct_range_filter_range_once({ selected_filter
|
|
|
3223
3083
|
|
|
3224
3084
|
|
|
3225
3085
|
|
|
3226
|
-
function $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({ search_results_: search_results_
|
|
3086
|
+
function $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({ search_results_: search_results_, i18n_: i18n_ }) {
|
|
3227
3087
|
return (0, $gco9i$createMemo)(()=>{
|
|
3228
3088
|
const n_hits = search_results_()?.n_hits;
|
|
3229
3089
|
if (isNaN(n_hits)) return "";
|
|
@@ -3240,17 +3100,12 @@ function $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({ search_results_: search_res
|
|
|
3240
3100
|
|
|
3241
3101
|
|
|
3242
3102
|
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
3103
|
function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true) {
|
|
3249
3104
|
const catchified_handler = (0, $gco9i$catchify)(handler);
|
|
3250
3105
|
const owner = (0, $gco9i$getOwner)();
|
|
3251
3106
|
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
3252
3107
|
// Use observer in case that this gets called before body exists
|
|
3253
|
-
const disconnect = (0, $gco9i$observer).onexists("body", ({ element: element
|
|
3108
|
+
const disconnect = (0, $gco9i$observer).onexists("body", ({ element: element })=>{
|
|
3254
3109
|
element.addEventListener("scroll", catchified_handler, {
|
|
3255
3110
|
passive: passive
|
|
3256
3111
|
});
|
|
@@ -3270,9 +3125,8 @@ function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true) {
|
|
|
3270
3125
|
}
|
|
3271
3126
|
|
|
3272
3127
|
|
|
3273
|
-
|
|
3274
3128
|
const $6db49ca163afa2c3$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="scroll-status" style="display:none"><span class="text"><b></b> – <b></b> <!#><!/> <b></b></span></div>`, 12);
|
|
3275
|
-
function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_
|
|
3129
|
+
function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_, first_result_in_viewport_: [get_first_result_in_viewport], last_result_in_viewport_: [get_last_result_in_viewport], number_of_results_: number_of_results_, i18n_: { price_formatting_: price_formatting_, of_: of_ } }) {
|
|
3276
3130
|
if (0, $gco9i$isServer) return; // won't show in initial render and need scroll position
|
|
3277
3131
|
const [first_to_show, set_first_to_show] = (0, $gco9i$createSignal)(0);
|
|
3278
3132
|
const [last_to_show, set_last_to_show] = (0, $gco9i$createSignal)(0);
|
|
@@ -3397,22 +3251,9 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
3397
3251
|
|
|
3398
3252
|
|
|
3399
3253
|
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
3254
|
|
|
3414
3255
|
const $598245ecfe38f34b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<a class="hint" href="javascript:void(0)"></a>`, 2), $598245ecfe38f34b$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="no-results"><div class="text"></div><!#><!/></div>`, 6);
|
|
3415
|
-
function $598245ecfe38f34b$export$ef6006467f04ee41({ i18n_: i18n_
|
|
3256
|
+
function $598245ecfe38f34b$export$ef6006467f04ee41({ i18n_: i18n_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_ }) {
|
|
3416
3257
|
const root = (0, $gco9i$getOwner)();
|
|
3417
3258
|
return [
|
|
3418
3259
|
(()=>{
|
|
@@ -3459,7 +3300,7 @@ function $a458486f22b22f63$export$a2cc176055f8f08() {
|
|
|
3459
3300
|
|
|
3460
3301
|
let $6e41f1fde994db72$var$cached_placeholder_element;
|
|
3461
3302
|
let $6e41f1fde994db72$var$rendering_cached_placeholder_element;
|
|
3462
|
-
function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: product_card_template_
|
|
3303
|
+
function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: product_card_template_, num_placeholders_: num_placeholders_ }) {
|
|
3463
3304
|
const [get_elements, set_elements] = (0, $gco9i$createSignal)([]);
|
|
3464
3305
|
let existing_num = 0;
|
|
3465
3306
|
if (0, $gco9i$isServer) // want to render simple placeholders on server, effects don't run there
|
|
@@ -3490,7 +3331,7 @@ function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: pro
|
|
|
3490
3331
|
}
|
|
3491
3332
|
/**
|
|
3492
3333
|
* Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
|
|
3493
|
-
*/ function $6e41f1fde994db72$var$Placeholder({ product_card_template_: product_card_template_
|
|
3334
|
+
*/ function $6e41f1fde994db72$var$Placeholder({ product_card_template_: product_card_template_ }) {
|
|
3494
3335
|
const get_cloned_placeholders = (element_to_clone = $6e41f1fde994db72$var$cached_placeholder_element)=>Array.isArray(element_to_clone) ? element_to_clone.map((el)=>el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
|
|
3495
3336
|
if ($6e41f1fde994db72$var$cached_placeholder_element) return get_cloned_placeholders();
|
|
3496
3337
|
let dispose_original_copy;
|
|
@@ -3543,7 +3384,7 @@ function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: pro
|
|
|
3543
3384
|
|
|
3544
3385
|
|
|
3545
3386
|
|
|
3546
|
-
function $056f6ac0a6caa919$export$5e4aed86c12acdd9({ percentage_in_view_: percentage_in_view_
|
|
3387
|
+
function $056f6ac0a6caa919$export$5e4aed86c12acdd9({ percentage_in_view_: percentage_in_view_, set_extra_displays_: set_extra_displays_, all_products_loaded_: all_products_loaded_, plp_results_: plp_results_, min_products_to_fetch_: min_products_to_fetch_, query_base_: query_base_, depict_api_: depict_api_ }) {
|
|
3547
3388
|
let last_loaded = +new Date();
|
|
3548
3389
|
let is_loading_more = false;
|
|
3549
3390
|
let is_first_load = true;
|
|
@@ -3593,7 +3434,7 @@ function $056f6ac0a6caa919$export$5e4aed86c12acdd9({ percentage_in_view_: percen
|
|
|
3593
3434
|
|
|
3594
3435
|
|
|
3595
3436
|
|
|
3596
|
-
function $0e0b96a8dc1ad492$export$63dd0350f8559dda({ displays_by_key_: displays_by_key_
|
|
3437
|
+
function $0e0b96a8dc1ad492$export$63dd0350f8559dda({ displays_by_key_: displays_by_key_, get_last_result_in_viewport_: get_last_result_in_viewport_, index_to_target_map_: index_to_target_map_, is_loading_: is_loading_, get_extra_displays: get_extra_displays }) {
|
|
3597
3438
|
const [get_has_rendered_toggle, set_has_rendered_toggle] = (0, $gco9i$createSignal)(false);
|
|
3598
3439
|
(0, $gco9i$createEffect)(()=>{
|
|
3599
3440
|
// We need this to run after the "render phase"
|
|
@@ -3654,7 +3495,7 @@ function $29ec7cddbe1d3484$export$7f8bd308237ab5a5(get_displays_) {
|
|
|
3654
3495
|
});
|
|
3655
3496
|
return displays_by_key_;
|
|
3656
3497
|
}
|
|
3657
|
-
function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({ displays_by_key_: displays_by_key_
|
|
3498
|
+
function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({ displays_by_key_: displays_by_key_, merchant_: merchant_, market_: market_, product_card_template_: product_card_template_, do_per_elements_: do_per_elements_ }) {
|
|
3658
3499
|
return (0, $gco9i$createComponent)((0, $gco9i$For), {
|
|
3659
3500
|
get each () {
|
|
3660
3501
|
return [
|
|
@@ -3686,8 +3527,8 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({ displays_by_key_: displays_
|
|
|
3686
3527
|
elements.push(element);
|
|
3687
3528
|
// Add tracking ids
|
|
3688
3529
|
if (!(element instanceof HTMLElement)) continue; // Apparently only HTMLElements have dataset
|
|
3689
|
-
const { dataset: dataset
|
|
3690
|
-
const { search_result_id: search_result_id
|
|
3530
|
+
const { dataset: dataset } = element;
|
|
3531
|
+
const { search_result_id: search_result_id, product_listing_result_id: product_listing_result_id, recommendation_id: recommendation_id } = display;
|
|
3691
3532
|
if (search_result_id) dataset.searchResultId = search_result_id;
|
|
3692
3533
|
else if (product_listing_result_id) dataset.productListingResultId = product_listing_result_id;
|
|
3693
3534
|
else if (recommendation_id) dataset.recommendationId = recommendation_id;
|
|
@@ -3700,7 +3541,7 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({ displays_by_key_: displays_
|
|
|
3700
3541
|
}
|
|
3701
3542
|
|
|
3702
3543
|
|
|
3703
|
-
function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
3544
|
+
function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_, product_card_template_: product_card_template_, first_result_in_viewport_: [, set_first_result_in_viewport], last_result_in_viewport_: [get_last_result_in_viewport_, set_last_result_in_viewport], merchant_: merchant_, market_: market_, all_products_loaded_: all_products_loaded_, min_products_to_fetch_: min_products_to_fetch_, query_base_: query_base_, depict_api_: depict_api_, is_loading_: is_loading_ }) {
|
|
3704
3545
|
// The following sets up an intersection observer to determine which results are in the viewport, used for the ScrollStatus indicator and knowing when to load more
|
|
3705
3546
|
const target_to_index_map = new Map();
|
|
3706
3547
|
const index_to_target_map_ = new Map();
|
|
@@ -3708,7 +3549,7 @@ function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
3708
3549
|
const intersection_observer = new IntersectionObserver((0, $gco9i$catchify)((records)=>{
|
|
3709
3550
|
for(let i = 0; i < records.length; i++){
|
|
3710
3551
|
const record = records[i];
|
|
3711
|
-
const { target: target
|
|
3552
|
+
const { target: target, intersectionRatio: intersectionRatio } = record;
|
|
3712
3553
|
const index_of_target = target_to_index_map.get(target);
|
|
3713
3554
|
if (index_of_target == undefined) return; // It seems like it can happen that we get IntersectionObserverEntries after the onCleanup function for a recommendation card has run, in Firefox. Probably a bug in Firefox? If I understood the bug correctly, this is a workaround.
|
|
3714
3555
|
const is_in_set = currently_intersecting.has(index_of_target);
|
|
@@ -3772,7 +3613,7 @@ function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
3772
3613
|
|
|
3773
3614
|
|
|
3774
3615
|
const $2d25e42846eac370$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="PLP-results"><!#><!/><!#><!/></div>`, 6);
|
|
3775
|
-
function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
3616
|
+
function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_, depict_api_: depict_api_, all_products_loaded_: all_products_loaded_, min_products_to_fetch_: min_products_to_fetch_, query_base_: query_base_, first_result_in_viewport_: first_result_in_viewport_, last_result_in_viewport_: last_result_in_viewport_, scroll_restoration_data_: [get_scroll_restoration_data], no_results_options_: no_results_options_, desktop_filter_elements_: desktop_filter_elements_, sort_or_filter_open_: sort_or_filter_open_, product_card_template_: product_card_template_, layout_options_: layout_options_, id_currently_querying_for_: id_currently_querying_for_ }) {
|
|
3776
3617
|
// The plp_results_ resource will be delayed because we're using createBatchedMemo to not make triplicate API requests, but we need to show the placeholders before already to match Chrome and Firefox's "content has to be there, ready for scroll restoration, before all popstate tasks have been completed"-requirement
|
|
3777
3618
|
const is_loading_ = (0, $gco9i$createMemo)(()=>plp_results_.loading || query_base_.loading);
|
|
3778
3619
|
const merchant_ = (0, $gco9i$createMemo)(()=>query_base_().tenant);
|
|
@@ -3819,7 +3660,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3819
3660
|
product_card_template_: product_card_template_,
|
|
3820
3661
|
num_placeholders_: (0, $gco9i$createMemo)(()=>{
|
|
3821
3662
|
// Can't use the data out of request_base for the id because request_base is too late, we need the correct amount of placeholders before the browser has restored the scroll state after processing all popstate events
|
|
3822
|
-
return (0, $7747fe1a8c5652e3$export$6c9030e511152266) + (get_scroll_restoration_data().find(({ for_id: for_id
|
|
3663
|
+
return (0, $7747fe1a8c5652e3$export$6c9030e511152266) + (get_scroll_restoration_data().find(({ for_id: for_id })=>for_id === id_currently_querying_for_())?.min_results_loaded ?? min_products_to_fetch_);
|
|
3823
3664
|
})
|
|
3824
3665
|
}) : undefined);
|
|
3825
3666
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = (0, $gco9i$createSignal)(false);
|
|
@@ -3926,7 +3767,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3926
3767
|
/**
|
|
3927
3768
|
* Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
|
|
3928
3769
|
* This function is special to the actual PLPResults.
|
|
3929
|
-
*/ function $2d25e42846eac370$var$make_modified_cols_at_size({ layout_options_: layout_options_
|
|
3770
|
+
*/ function $2d25e42846eac370$var$make_modified_cols_at_size({ layout_options_: layout_options_, sort_or_filter_open_: sort_or_filter_open_ }) {
|
|
3930
3771
|
return (0, $gco9i$createMemo)(()=>{
|
|
3931
3772
|
const layout_options = layout_options_();
|
|
3932
3773
|
// Add grid styling that changes when filters get opened/closed
|
|
@@ -3960,29 +3801,9 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3960
3801
|
|
|
3961
3802
|
|
|
3962
3803
|
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
3804
|
|
|
3984
3805
|
const $68a258a92b88f02f$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="sorting-attributes"></div>`, 2), $68a258a92b88f02f$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="sorting-direction"></div>`, 2), $68a258a92b88f02f$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div><div class="input-row"><input type="radio"><span class="custom-indicator"></span><!#><!/></div></div>`, 9), $68a258a92b88f02f$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div><label class="input-row"><input type="radio"><span class="custom-indicator"></span><!#><!/></label></div>`, 9);
|
|
3985
|
-
function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: available_sortings_
|
|
3806
|
+
function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: available_sortings_, current_sorting_: [get_current_sorting, set_current_sorting], meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_ }) {
|
|
3986
3807
|
const title_radio_name = (0, $gco9i$make_random_classname)();
|
|
3987
3808
|
const order_radio_name = (0, $gco9i$make_random_classname)();
|
|
3988
3809
|
return (0, $gco9i$createComponent)((0, $gco9i$Show), {
|
|
@@ -4072,19 +3893,6 @@ function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: availa
|
|
|
4072
3893
|
|
|
4073
3894
|
|
|
4074
3895
|
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
3896
|
|
|
4089
3897
|
|
|
4090
3898
|
|
|
@@ -4132,9 +3940,6 @@ function $aea1edf92433e81e$export$fe334901e8bebd57() {
|
|
|
4132
3940
|
|
|
4133
3941
|
|
|
4134
3942
|
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
3943
|
const $e1bb71e65e01a3a0$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" class="sort-icon"><path d="M6.199 10.254a.35.35 0 0 0-.496 0L3.5 12.453V.348a.35.35 0 0 0-.7 0v12.105L.598 10.254c-.137-.137-.359-.137-.492 0a.35.35 0 0 0 0 .492l2.797 2.801a.35.35 0 0 0 .496 0L6.2 10.746c.137-.137.137-.355 0-.492zM9.449 3.5H8.051a.35.35 0 0 1-.352-.352V1.75c0-.191.156-.352.352-.352h1.398c.195 0 .352.16.352.352v1.398a.35.35 0 0 1-.352.352zm-1.051-.699h.703v-.699h-.703zm0 0"></path><path d="M10.852 6.301H8.051a.35.35 0 0 1-.352-.352V4.551a.35.35 0 0 1 .352-.352h2.801a.35.35 0 0 1 .348.352v1.398a.35.35 0 0 1-.348.352zm-2.453-.699H10.5v-.703H8.398zm3.851 3.5H8.051c-.195 0-.352-.16-.352-.352V7.352A.35.35 0 0 1 8.051 7h4.199c.191 0 .352.156.352.352V8.75c0 .191-.16.352-.352.352zm-3.852-.703h3.5V7.7h-3.5zm5.25 3.499H8.051a.35.35 0 0 1-.352-.348v-1.402a.35.35 0 0 1 .352-.348h5.598a.35.35 0 0 1 .352.348v1.402a.35.35 0 0 1-.352.348zm-5.25-.699H13.3V10.5H8.398zm0 0"></path></svg>`, 6);
|
|
4139
3944
|
function $e1bb71e65e01a3a0$export$da32f7add8a22e86(props = {}) {
|
|
4140
3945
|
return (()=>{
|
|
@@ -4147,9 +3952,6 @@ function $e1bb71e65e01a3a0$export$da32f7add8a22e86(props = {}) {
|
|
|
4147
3952
|
|
|
4148
3953
|
|
|
4149
3954
|
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
3955
|
const $05fbe84eb34564ec$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" class="sort-icon"><path d="M6.199 10.254a.35.35 0 0 0-.496 0L3.5 12.453V.348a.35.35 0 0 0-.7 0v12.105L.598 10.254c-.137-.137-.359-.137-.492 0a.35.35 0 0 0 0 .492l2.797 2.801a.35.35 0 0 0 .496 0L6.2 10.746c.137-.137.137-.355 0-.492zm3.25 1.644H8.051a.35.35 0 0 1-.352-.348v-1.402a.35.35 0 0 1 .352-.348h1.398a.35.35 0 0 1 .352.348v1.402a.35.35 0 0 1-.352.348zm-1.051-.699h.703V10.5h-.703zm2.454-2.097H8.051c-.195 0-.352-.16-.352-.352V7.352A.35.35 0 0 1 8.051 7h2.801a.35.35 0 0 1 .348.352V8.75c0 .191-.156.352-.348.352zm-2.453-.703H10.5V7.7H8.398zm3.851-2.098H8.051a.35.35 0 0 1-.352-.352V4.551a.35.35 0 0 1 .352-.352h4.199c.191 0 .352.156.352.352v1.398c0 .195-.16.352-.352.352zm-3.852-.699h3.5v-.703h-3.5zm5.25-2.102H8.051a.35.35 0 0 1-.352-.352V1.75c0-.191.156-.352.352-.352h5.598c.195 0 .352.16.352.352v1.398a.35.35 0 0 1-.352.352zm-5.25-.699H13.3v-.699H8.398zm0 0"></path></svg>`, 4);
|
|
4154
3956
|
function $05fbe84eb34564ec$export$d10e63059ddb9fd4(props = {}) {
|
|
4155
3957
|
return (()=>{
|
|
@@ -4162,7 +3964,6 @@ function $05fbe84eb34564ec$export$d10e63059ddb9fd4(props = {}) {
|
|
|
4162
3964
|
|
|
4163
3965
|
|
|
4164
3966
|
|
|
4165
|
-
|
|
4166
3967
|
const $b9bf7fce0ae60241$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="15" class="filter-icon"><path d="M1.75 14.697c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246V8.75c0-.096.034-.178.103-.246s.15-.103.246-.103.178.034.246.103.103.15.103.246v5.599c0 .096-.034.178-.103.246s-.15.103-.246.103zm0-9.796c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246v-3.5c0-.1.034-.185.103-.253s.15-.103.246-.103.178.034.246.103.103.153.103.253v3.5c0 .096-.034.178-.103.246s-.15.103-.246.103zm.697 2.796H1.053c-.292 0-.54-.103-.745-.308S0 6.938 0 6.651s.103-.54.308-.745.453-.308.745-.308h1.395c.292 0 .54.103.745.308s.308.453.308.745-.103.533-.308.738-.453.308-.745.308zM1.053 6.303c-.1 0-.185.034-.253.103s-.103.15-.103.246.034.178.103.246S.952 7 1.053 7h1.395c.1 0 .185-.034.253-.103s.103-.15.103-.246-.034-.178-.103-.246-.153-.103-.253-.103H1.053zm5.599 8.395c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246v-2.796c0-.1.034-.184.103-.253s.15-.102.246-.102.178.034.246.102.103.153.103.253v2.796c0 .096-.034.178-.103.246s-.15.103-.246.103zm0-7c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246V1.053c0-.1.034-.185.103-.253s.15-.103.246-.103.178.034.246.103S7 .952 7 1.053v6.296c0 .096-.034.178-.103.246s-.15.103-.246.103zm.697 2.803H5.947c-.287 0-.533-.102-.738-.308s-.308-.453-.308-.745.103-.533.308-.738.451-.308.738-.308h1.401c.292 0 .54.103.745.308s.308.451.308.738-.103.54-.308.745-.453.308-.745.308zM5.947 9.099c-.096 0-.178.034-.246.103s-.103.15-.103.246.034.185.103.253.15.103.246.103h1.401c.096 0 .178-.034.246-.103s.103-.153.103-.253-.034-.178-.103-.246-.15-.103-.246-.103H5.947zm5.605 5.599c-.1 0-.184-.034-.253-.103s-.102-.15-.102-.246v-7c0-.096.034-.178.102-.246S11.453 7 11.553 7s.178.034.246.103.103.15.103.246v7c0 .096-.034.178-.103.246s-.15.103-.246.103zm0-11.197c-.1 0-.184-.034-.253-.103s-.102-.15-.102-.246V1.053c0-.1.034-.185.102-.253s.153-.103.253-.103.178.034.246.103.103.153.103.253v2.099c0 .096-.034.178-.103.246s-.15.103-.246.103zm.697 2.803h-1.401c-.287 0-.533-.103-.738-.308s-.308-.453-.308-.745.103-.54.308-.745.451-.308.738-.308h1.401c.292 0 .54.103.745.308s.308.453.308.745-.102.54-.308.745-.453.308-.745.308zm-1.401-1.401c-.096 0-.178.034-.246.103s-.102.15-.102.246.034.178.102.246.15.103.246.103h1.401c.096 0 .178-.034.246-.103s.102-.15.102-.246-.034-.178-.102-.246-.15-.103-.246-.103h-1.401z"></path></svg>`, 4);
|
|
4167
3968
|
function $b9bf7fce0ae60241$export$28f6150e232898de() {
|
|
4168
3969
|
return (0, $gco9i$getNextElement)($b9bf7fce0ae60241$var$_tmpl$);
|
|
@@ -4171,7 +3972,7 @@ function $b9bf7fce0ae60241$export$28f6150e232898de() {
|
|
|
4171
3972
|
|
|
4172
3973
|
const $757dac7f7c6c5241$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button class="clear minor"></button>`, 2), $757dac7f7c6c5241$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="depict plp" id="depict-filter-sort-mobile-modal-container"><div class="depict-filter-sort-modal-backdrop"></div><button class="dismiss-modal"></button><div class="filter-sort-modal"><div class="body"><!#><!/><!#><!/></div><div class="bottom-row"><!#><!/><button class="show-results major"></button></div></div></div>`, 20), $757dac7f7c6c5241$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<details class="sorting"></details>`, 2), $757dac7f7c6c5241$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<summary class="sort-filter-summary"><div class="summary"><div class="left-els"><!#><!/><span></span></div><!#><!/></div></summary>`, 12), $757dac7f7c6c5241$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="body"></div>`, 2), $757dac7f7c6c5241$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<details class="filters"></details>`, 2), $757dac7f7c6c5241$var$_tmpl$7 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<b></b>`, 2);
|
|
4173
3974
|
const $757dac7f7c6c5241$var$no_go_selector = ".range .range-group";
|
|
4174
|
-
function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for_sorting_
|
|
3975
|
+
function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for_sorting_, args_for_filtering_: args_for_filtering_, search_filters_open_: [get_search_filters_open, set_search_filters_open], search_sorting_open_: [get_search_sorting_open, set_search_sorting_open], dismiss_modal_: dismiss_modal_, register_closing_animation_: register_closing_animation_, formatted_number_of_results_: formatted_number_of_results_, i18n_: i18n_ }) {
|
|
4175
3976
|
(0, $aea1edf92433e81e$export$fe334901e8bebd57)();
|
|
4176
3977
|
let modal;
|
|
4177
3978
|
let modal_body;
|
|
@@ -4237,7 +4038,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4237
4038
|
}, _el$3);
|
|
4238
4039
|
(0, $gco9i$addEventListener)(_el$3, "click", dismiss_modal_, true);
|
|
4239
4040
|
(0, $gco9i$insert)(_el$3, (0, $gco9i$createComponent)((0, $19976a74d273070d$export$3b621d86b1566b2), {}));
|
|
4240
|
-
_el$4.$$touchstart = ({ changedTouches: changedTouches
|
|
4041
|
+
_el$4.$$touchstart = ({ changedTouches: changedTouches, target: target })=>{
|
|
4241
4042
|
// touchstart should always only have one changed touch, track it here
|
|
4242
4043
|
if (touches >= 1) {
|
|
4243
4044
|
(0, $gco9i$dlog)("Got new touch", changedTouches, "ignoring"); // only support 1 touch for now
|
|
@@ -4250,7 +4051,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4250
4051
|
set_modal_style("transition", "unset");
|
|
4251
4052
|
set_background_style("transition", "unset");
|
|
4252
4053
|
set_button_style("transition", "unset");
|
|
4253
|
-
const [{ identifier: our_fingers_identifier
|
|
4054
|
+
const [{ identifier: our_fingers_identifier, pageY: start_page_y }] = changedTouches;
|
|
4254
4055
|
let gesture_starting_page_y = start_page_y;
|
|
4255
4056
|
const start_time = +new Date();
|
|
4256
4057
|
let total_distance_travelled = 0;
|
|
@@ -4263,7 +4064,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4263
4064
|
return;
|
|
4264
4065
|
modal_scrolling_prevented[1](false);
|
|
4265
4066
|
const velocity = total_distance_travelled / (+new Date() - start_time); // px/ms
|
|
4266
|
-
const { offsetHeight: offsetHeight
|
|
4067
|
+
const { offsetHeight: offsetHeight } = modal;
|
|
4267
4068
|
if (e?.type === "touchend" && distance_from_start_of_gesture > offsetHeight / 3 || velocity > 1.5 && distance_from_start_of_gesture > offsetHeight / 10 // I think this is a good magic number
|
|
4268
4069
|
) dismiss_modal_();
|
|
4269
4070
|
else if (e) {
|
|
@@ -4280,10 +4081,10 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4280
4081
|
modal.removeEventListener("touchmove", move_handler);
|
|
4281
4082
|
});
|
|
4282
4083
|
const move_handler = (0, $gco9i$catchify)((e)=>{
|
|
4283
|
-
const { changedTouches: changedTouches
|
|
4084
|
+
const { changedTouches: changedTouches } = e;
|
|
4284
4085
|
let called_prevent_default = false;
|
|
4285
4086
|
for(let i = 0; i < changedTouches.length; i++){
|
|
4286
|
-
const { pageY: this_move_page_y
|
|
4087
|
+
const { pageY: this_move_page_y, clientY: clientY, identifier: identifier_of_a_touch } = changedTouches[i];
|
|
4287
4088
|
// unrelated to this functionality, we want to block that the site behind is being scrolled when swiping on this if the modal isn't scrollable
|
|
4288
4089
|
const scroll_top_max = modal_body.scrollTopMax || modal_body.scrollHeight - modal_body.clientHeight;
|
|
4289
4090
|
if (scroll_top_max === 0) {
|
|
@@ -4444,7 +4245,6 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4444
4245
|
|
|
4445
4246
|
|
|
4446
4247
|
|
|
4447
|
-
|
|
4448
4248
|
const $11d594c749b76228$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14"><path d="M12.949 7.699H.352A.35.35 0 0 1 0 7.352.35.35 0 0 1 .352 7h12.598a.35.35 0 0 1 .352.352.35.35 0 0 1-.352.348zm0 0"></path></svg>`, 4);
|
|
4449
4249
|
function $11d594c749b76228$export$cb808a3c41736d8e() {
|
|
4450
4250
|
return (0, $gco9i$getNextElement)($11d594c749b76228$var$_tmpl$);
|
|
@@ -4454,9 +4254,8 @@ function $11d594c749b76228$export$cb808a3c41736d8e() {
|
|
|
4454
4254
|
|
|
4455
4255
|
|
|
4456
4256
|
|
|
4457
|
-
|
|
4458
4257
|
const $cdea4cf8c5c071ef$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="filters"><div class="body"></div></div>`, 4), $cdea4cf8c5c071ef$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="sorting"><div class="body"></div></div>`, 4), $cdea4cf8c5c071ef$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="sort-and-filter-buttons"><div class="outer"><div class="inner"><!#><!/><!#><!/><!#><!/></div></div></div>`, 12), $cdea4cf8c5c071ef$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span class="num-filters"></span>`, 2), $cdea4cf8c5c071ef$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="open-filters-button-container"><!#><!/><button type="button"><!#><!/><span></span></button></div>`, 10), $cdea4cf8c5c071ef$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button class="toggle-button for-sorting major-minor-transition"><span></span><!#><!/></button>`, 6);
|
|
4459
|
-
function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_sorting_
|
|
4258
|
+
function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_sorting_, set_extra_els_in_results_container_: set_extra_els_in_results_container_, search_filters_open_: search_filters_open_, search_sorting_open_: search_sorting_open_, set_sort_or_filter_open_: set_sort_or_filter_open_, i18n_: i18n_, available_sortings_: available_sortings_, available_filters_: available_filters_, expanded_filters_: expanded_filters_, middle_elements_: middle_elements_, input_modal_open_: input_modal_open_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_, set_sort_and_filter_element_: set_sort_and_filter_element_, formatted_number_of_results_: formatted_number_of_results_, filter_button_width_: filter_button_width_, sort_button_width_: sort_button_width_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_, get_extra_filters_button_: get_extra_filters_button_, get_extra_sorting_button_: get_extra_sorting_button_ }) {
|
|
4460
4259
|
const Self = ()=>{
|
|
4461
4260
|
// This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
|
|
4462
4261
|
(0, $5efb5894079b220e$export$b288c38ae3fddb56)({
|
|
@@ -4550,7 +4349,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
4550
4349
|
}
|
|
4551
4350
|
});
|
|
4552
4351
|
(0, $gco9i$catchify)(async ()=>{
|
|
4553
|
-
({ open_modal_: open_modal_
|
|
4352
|
+
({ open_modal_: open_modal_, close_modal_: close_modal_ } = await (0, $194bd6b8e4c59830$export$79b1565500412d9b)((0, $757dac7f7c6c5241$export$9bf11afa910f536e), {
|
|
4554
4353
|
args_for_sorting_: sorting_options,
|
|
4555
4354
|
args_for_filtering_: filter_options,
|
|
4556
4355
|
search_filters_open_: search_filters_open_,
|
|
@@ -4559,7 +4358,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
4559
4358
|
dismiss_modal_: dismiss_modal_,
|
|
4560
4359
|
i18n_: i18n_
|
|
4561
4360
|
}));
|
|
4562
|
-
const { remove: remove
|
|
4361
|
+
const { remove: remove } = (0, $gco9i$javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches));
|
|
4563
4362
|
cleanup_promise.then(remove);
|
|
4564
4363
|
})();
|
|
4565
4364
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
@@ -4582,7 +4381,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
4582
4381
|
}
|
|
4583
4382
|
});
|
|
4584
4383
|
}
|
|
4585
|
-
function $cdea4cf8c5c071ef$var$OpenFiltersButton({ i18n_: i18n_
|
|
4384
|
+
function $cdea4cf8c5c071ef$var$OpenFiltersButton({ i18n_: i18n_, search_filters_open_: search_filters_open_, search_sorting_open_: search_sorting_open_, filter_button_width_: filter_button_width_, tabindex_: tabindex_, number_of_rendered_selected_filters_items_: [num_selected_filters] }) {
|
|
4586
4385
|
const filters_closed = (0, $gco9i$createMemo)(()=>!search_filters_open_[0]());
|
|
4587
4386
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
4588
4387
|
return (()=>{
|
|
@@ -4639,7 +4438,7 @@ function $cdea4cf8c5c071ef$var$OpenFiltersButton({ i18n_: i18n_ , search_filters
|
|
|
4639
4438
|
return _el$14;
|
|
4640
4439
|
})();
|
|
4641
4440
|
}
|
|
4642
|
-
function $cdea4cf8c5c071ef$var$OpenSortingButton({ i18n_: i18n_
|
|
4441
|
+
function $cdea4cf8c5c071ef$var$OpenSortingButton({ i18n_: i18n_, get_current_sorting_: get_current_sorting_, search_filters_open_: search_filters_open_, available_sortings_: available_sortings_, search_sorting_open_: search_sorting_open_, sort_button_width_: sort_button_width_, tabindex_: tabindex_, meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_ }) {
|
|
4643
4442
|
const sorting_closed = (0, $gco9i$createMemo)(()=>!search_sorting_open_[0]());
|
|
4644
4443
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
4645
4444
|
return (()=>{
|
|
@@ -4703,16 +4502,6 @@ function $cdea4cf8c5c071ef$var$OpenSortingButton({ i18n_: i18n_ , get_current_so
|
|
|
4703
4502
|
|
|
4704
4503
|
|
|
4705
4504
|
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
4505
|
|
|
4717
4506
|
const $f9182ab2348d1080$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14"><path d="M6.402.453L2.203 4.652a.35.35 0 0 0 0 .496c.137.137.359.137.492 0l3.605-3.605v11.406a.35.35 0 0 0 .348.352.35.35 0 0 0 .352-.352V1.543l3.602 3.605a.35.35 0 0 0 .496 0c.066-.07.102-.16.102-.25a.35.35 0 0 0-.102-.246L6.895.453c-.133-.137-.355-.137-.492 0zm0 0"></path></svg>`, 4);
|
|
4718
4507
|
function $f9182ab2348d1080$export$2624c5890f1bbcf7() {
|
|
@@ -4720,12 +4509,11 @@ function $f9182ab2348d1080$export$2624c5890f1bbcf7() {
|
|
|
4720
4509
|
}
|
|
4721
4510
|
|
|
4722
4511
|
|
|
4723
|
-
|
|
4724
4512
|
const $0b0380f75d729d63$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="floating-buttons"><button class="filter"><div></div></button><button class="sort"><div></div></button><button class="up"><div></div></button></div>`, 14);
|
|
4725
4513
|
function $0b0380f75d729d63$export$b23abd26de154ede(props) {
|
|
4726
4514
|
if (0, $gco9i$isServer) return; // won't show in initial render and need scroll position
|
|
4727
4515
|
const [is_small, set_is_small] = (0, $gco9i$createSignal)(true);
|
|
4728
|
-
(0, $gco9i$onCleanup)((0, $gco9i$javascript_media_query)("(max-width:651px)", ({ matches: matches
|
|
4516
|
+
(0, $gco9i$onCleanup)((0, $gco9i$javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches)).remove);
|
|
4729
4517
|
return (0, $gco9i$createComponent)((0, $gco9i$Show), {
|
|
4730
4518
|
get when () {
|
|
4731
4519
|
return is_small();
|
|
@@ -4735,7 +4523,7 @@ function $0b0380f75d729d63$export$b23abd26de154ede(props) {
|
|
|
4735
4523
|
}
|
|
4736
4524
|
});
|
|
4737
4525
|
}
|
|
4738
|
-
function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [get_search_filters_open_, set_search_filters_open_]
|
|
4526
|
+
function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [get_search_filters_open_, set_search_filters_open_], search_sorting_open_: [get_search_sorting_open_, set_search_sorting_open_], current_sorting_: current_sorting_, sort_and_filter_element_: sort_and_filter_element_, i18n_: i18n_ }) {
|
|
4739
4527
|
let old_pos = scrollY;
|
|
4740
4528
|
let diff_over_second_or_touch = 0; // for things not supporting touch events
|
|
4741
4529
|
let timeout;
|
|
@@ -4853,14 +4641,9 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4853
4641
|
|
|
4854
4642
|
|
|
4855
4643
|
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4644
|
+
const $4147651646da990a$var$fallback_operator = "in";
|
|
4645
|
+
const $4147651646da990a$var$fallback_token = "";
|
|
4646
|
+
const $4147651646da990a$var$legacy_filter_prefix = "filter_";
|
|
4864
4647
|
const $4147651646da990a$var$operator_map = {
|
|
4865
4648
|
"eq": "≡",
|
|
4866
4649
|
"neq": "≠",
|
|
@@ -4876,6 +4659,10 @@ const $4147651646da990a$var$range_delimiter = "-";
|
|
|
4876
4659
|
const $4147651646da990a$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
|
|
4877
4660
|
const $4147651646da990a$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
|
|
4878
4661
|
const $4147651646da990a$var$empty_item_replacement = "0️⃣";
|
|
4662
|
+
const $4147651646da990a$var$op_to_token = (op)=>{
|
|
4663
|
+
if (op === $4147651646da990a$var$fallback_operator) return $4147651646da990a$var$fallback_token;
|
|
4664
|
+
return $4147651646da990a$var$operator_map[op];
|
|
4665
|
+
};
|
|
4879
4666
|
/**
|
|
4880
4667
|
* Checks if a given array of filter data can be neatly serialized into an URL query parameter, or if it should fall back to JSON+base64.
|
|
4881
4668
|
* The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
|
|
@@ -4939,35 +4726,40 @@ function $4147651646da990a$var$decode_filter_data(op, encoded_data) {
|
|
|
4939
4726
|
}
|
|
4940
4727
|
function $4147651646da990a$export$58aa3f171519b6d7(filters, search_params, filter_query_param_prefix) {
|
|
4941
4728
|
for (const filter of filters){
|
|
4942
|
-
const { field: field
|
|
4729
|
+
const { field: field, op: op, data: data } = filter;
|
|
4943
4730
|
const encoded_data = $4147651646da990a$var$encode_filter_data(op, data);
|
|
4944
|
-
search_params.set(filter_query_param_prefix + field + $4147651646da990a$var$
|
|
4731
|
+
search_params.set(filter_query_param_prefix + field + $4147651646da990a$var$op_to_token(op), encoded_data);
|
|
4945
4732
|
}
|
|
4946
4733
|
}
|
|
4947
4734
|
function $4147651646da990a$export$f934fa24c3a86811(search_params, filter_query_param_prefix) {
|
|
4948
4735
|
const found_filters = [];
|
|
4949
4736
|
for (const key of search_params.keys()){
|
|
4950
|
-
|
|
4737
|
+
// Allow for backwards compatibility with the old filter query param prefix
|
|
4738
|
+
let chosen_prefix = filter_query_param_prefix;
|
|
4739
|
+
if (!key.startsWith(chosen_prefix)) {
|
|
4740
|
+
chosen_prefix = $4147651646da990a$var$legacy_filter_prefix;
|
|
4741
|
+
if (!key.startsWith(chosen_prefix)) continue;
|
|
4742
|
+
}
|
|
4951
4743
|
const encoded_data = search_params.get(key);
|
|
4952
4744
|
if (!encoded_data) continue;
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
}
|
|
4745
|
+
const [op, token] = Object.entries($4147651646da990a$var$operator_map).find(([, token])=>key.endsWith(token)) || [
|
|
4746
|
+
$4147651646da990a$var$fallback_operator,
|
|
4747
|
+
$4147651646da990a$var$fallback_token
|
|
4748
|
+
];
|
|
4749
|
+
const data = $4147651646da990a$var$decode_filter_data(op, encoded_data);
|
|
4750
|
+
if (!data) continue;
|
|
4751
|
+
const field = key.slice(chosen_prefix.length, token ? -token.length : undefined);
|
|
4752
|
+
found_filters.push({
|
|
4753
|
+
field: field,
|
|
4754
|
+
op: op,
|
|
4755
|
+
data: data
|
|
4756
|
+
});
|
|
4965
4757
|
}
|
|
4966
4758
|
return found_filters;
|
|
4967
4759
|
}
|
|
4968
4760
|
function $4147651646da990a$export$62acb285a7579555(sorting, search_params, sorting_query_param) {
|
|
4969
4761
|
if (!sorting) return;
|
|
4970
|
-
const { field: field
|
|
4762
|
+
const { field: field, order: order } = sorting;
|
|
4971
4763
|
const ascending = order === "asc";
|
|
4972
4764
|
search_params.set(sorting_query_param, field + (ascending ? $4147651646da990a$var$ascending_token : $4147651646da990a$var$descending_token));
|
|
4973
4765
|
}
|
|
@@ -4990,14 +4782,14 @@ function $4147651646da990a$export$916e6850778505f6(search_params, filter_query_p
|
|
|
4990
4782
|
const keys = [
|
|
4991
4783
|
...search_params.keys()
|
|
4992
4784
|
];
|
|
4993
|
-
for (const key of keys)if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param) search_params.delete(key);
|
|
4785
|
+
for (const key of keys)if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param || key.startsWith($4147651646da990a$var$legacy_filter_prefix)) search_params.delete(key);
|
|
4994
4786
|
}
|
|
4995
4787
|
const $4147651646da990a$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
4996
|
-
function $4147651646da990a$export$43cd1e747fecd42e({ to_url_: to_url_
|
|
4788
|
+
function $4147651646da990a$export$43cd1e747fecd42e({ to_url_: to_url_, set_clearing_flag_: set_clearing_flag_, from_search_params_: from_search_params_ = new URLSearchParams(location.search), sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
4997
4789
|
if (!to_url_) return to_url_;
|
|
4998
4790
|
const was_url_object = to_url_ instanceof URL;
|
|
4999
4791
|
const url_object = was_url_object ? to_url_ : new URL(to_url_, location.origin);
|
|
5000
|
-
const { searchParams: searchParams
|
|
4792
|
+
const { searchParams: searchParams } = url_object;
|
|
5001
4793
|
if (set_clearing_flag_) searchParams.set($4147651646da990a$export$cf5feb2102aec7f2, "true");
|
|
5002
4794
|
if (from_search_params_.has(sorting_query_param_)) searchParams.set(sorting_query_param_, from_search_params_.get(sorting_query_param_));
|
|
5003
4795
|
for (const key of from_search_params_.keys())if (key.startsWith(filter_query_param_prefix_)) searchParams.set(key, from_search_params_.get(key));
|
|
@@ -5008,7 +4800,7 @@ function $4147651646da990a$export$43cd1e747fecd42e({ to_url_: to_url_ , set_clea
|
|
|
5008
4800
|
|
|
5009
4801
|
|
|
5010
4802
|
const $dfa5b6f7c5e421df$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<nav class="crumbs"></nav>`, 2), $dfa5b6f7c5e421df$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<a class="crumb"></a>`, 2), $dfa5b6f7c5e421df$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span class="separator"></span>`, 2);
|
|
5011
|
-
function $dfa5b6f7c5e421df$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data
|
|
4803
|
+
function $dfa5b6f7c5e421df$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data, router_: router_, i18n_: i18n_, filter_query_param_prefix_: filter_query_param_prefix_, sorting_query_param_: sorting_query_param_ }) {
|
|
5012
4804
|
const placeholder_crumb_data = [
|
|
5013
4805
|
,
|
|
5014
4806
|
,
|
|
@@ -5085,16 +4877,8 @@ function $dfa5b6f7c5e421df$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
|
|
|
5085
4877
|
|
|
5086
4878
|
|
|
5087
4879
|
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
4880
|
const $06edf3aec9073663$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<nav class="quicklinks"></nav>`, 2), $06edf3aec9073663$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div>QuickLinks failed</div>`, 2), $06edf3aec9073663$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<a class="quicklink"></a>`, 2);
|
|
5097
|
-
function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_
|
|
4881
|
+
function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_, router_: router_, current_query_id_: current_query_id_, breadcrumb_data_: breadcrumb_data_, i18n_: i18n_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
5098
4882
|
let scrolling_logic_ran_for_query_id = false;
|
|
5099
4883
|
let last_scroll_position;
|
|
5100
4884
|
let scroll_to_element_on_dom_insertion;
|
|
@@ -5114,7 +4898,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
5114
4898
|
const mutation_plugins = [
|
|
5115
4899
|
function() {
|
|
5116
4900
|
if (!scrolling_logic_ran_for_query_id) return;
|
|
5117
|
-
const { scrollLeft: scrollLeft
|
|
4901
|
+
const { scrollLeft: scrollLeft } = this.insert_here;
|
|
5118
4902
|
if (scrollLeft > 0) {
|
|
5119
4903
|
last_scroll_position = scrollLeft;
|
|
5120
4904
|
const current_id = (0, $gco9i$untrack)(current_query_id_);
|
|
@@ -5153,9 +4937,9 @@ function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
5153
4937
|
faded_opacity_: 0.5,
|
|
5154
4938
|
mutation_plugins_: mutation_plugins,
|
|
5155
4939
|
slider_ref_: (slider)=>{
|
|
5156
|
-
const { insert_here: insert_here
|
|
4940
|
+
const { insert_here: insert_here, intersecting_items_object: intersecting_items_object } = slider;
|
|
5157
4941
|
sliding_element = insert_here;
|
|
5158
|
-
(0, $gco9i$observer).onexists(insert_here, ({ element: element
|
|
4942
|
+
(0, $gco9i$observer).onexists(insert_here, ({ element: element })=>{
|
|
5159
4943
|
if (scroll_to_element_on_dom_insertion == undefined) {
|
|
5160
4944
|
if (!element.scrollLeft) {
|
|
5161
4945
|
const target_position = last_scroll_position;
|
|
@@ -5226,7 +5010,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
5226
5010
|
// 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
|
|
5227
5011
|
const is_sibling = (0, $gco9i$createMemo)(()=>{
|
|
5228
5012
|
const current_id = current_query_id_();
|
|
5229
|
-
return quicklinks_data_()?.some(({ query_id: query_id
|
|
5013
|
+
return quicklinks_data_()?.some(({ query_id: query_id })=>query_id === current_id);
|
|
5230
5014
|
});
|
|
5231
5015
|
const href = (0, $gco9i$createMemo)(()=>// We don't want these links to delete the sort and filter state by default, only if `clear_filters_when_going_sideways` explicitly clears them
|
|
5232
5016
|
(0, $4147651646da990a$export$43cd1e747fecd42e)({
|
|
@@ -5283,7 +5067,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
5283
5067
|
|
|
5284
5068
|
const $641bba2917fe862b$var$max_history_change_frequency = 300;
|
|
5285
5069
|
const $641bba2917fe862b$var$api_max_products_per_request = 100;
|
|
5286
|
-
function $641bba2917fe862b$export$6e49da55e449af7c({ scroll_restoration_data_: [, set_scroll_restoration_data]
|
|
5070
|
+
function $641bba2917fe862b$export$6e49da55e449af7c({ scroll_restoration_data_: [, set_scroll_restoration_data], last_result_in_viewport_: [get_last_result_in_viewport_], id_: id_, can_write_scroll_restoration_: can_write_scroll_restoration_ }) {
|
|
5287
5071
|
// store last actually seen (within viewport) product in history.state
|
|
5288
5072
|
let last_time_history_changed = 0;
|
|
5289
5073
|
let set_to_later;
|
|
@@ -5332,8 +5116,8 @@ function $641bba2917fe862b$export$6e49da55e449af7c({ scroll_restoration_data_: [
|
|
|
5332
5116
|
}));
|
|
5333
5117
|
(0, $gco9i$onCleanup)(()=>clearTimeout(timeout)); // could cause weird bugs otherwise
|
|
5334
5118
|
}
|
|
5335
|
-
async function $641bba2917fe862b$export$cc42dd29bf655ab6({ scroll_restoration_data_: [get_scroll_restoration_data]
|
|
5336
|
-
const to_fetch_according_to_state = (0, $gco9i$untrack)(get_scroll_restoration_data).find(({ for_id: for_id
|
|
5119
|
+
async function $641bba2917fe862b$export$cc42dd29bf655ab6({ scroll_restoration_data_: [get_scroll_restoration_data], make_request_: make_request_, min_products_to_fetch_: min_products_to_fetch_, id_: id_ }) {
|
|
5120
|
+
const to_fetch_according_to_state = (0, $gco9i$untrack)(get_scroll_restoration_data).find(({ for_id: for_id })=>for_id === id_)?.min_results_loaded ?? 0;
|
|
5337
5121
|
const total_products_to_fetch = to_fetch_according_to_state < min_products_to_fetch_ ? min_products_to_fetch_ : to_fetch_according_to_state + 20; // if we fetch according to state, fetch some more in case that the screen size increased, there's some in-accuracy or for the user to scroll. Sometimes the load more post processor will trigger to fetch more after this, but I think that's ok.
|
|
5338
5122
|
if (total_products_to_fetch <= $641bba2917fe862b$var$api_max_products_per_request) return await make_request_(total_products_to_fetch);
|
|
5339
5123
|
const displays = [];
|
|
@@ -5403,7 +5187,7 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
5403
5187
|
|
|
5404
5188
|
|
|
5405
5189
|
|
|
5406
|
-
function $e7fce80abe608e01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_
|
|
5190
|
+
function $e7fce80abe608e01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_, query_id_: query_id_, i18n_: i18n_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, plp_results_: plp_results_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ }) {
|
|
5407
5191
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
5408
5192
|
$e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
5409
5193
|
plp_results_: plp_results_,
|
|
@@ -5430,7 +5214,7 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
5430
5214
|
const went_downwards = previous_length < new_length;
|
|
5431
5215
|
const shorter_array = went_upwards ? new_crumb_data : previous_crumb_data;
|
|
5432
5216
|
const longer_array = went_upwards ? previous_crumb_data : new_crumb_data;
|
|
5433
|
-
if (!((went_upwards || went_downwards) && shorter_array.every(({ query_id: query_id
|
|
5217
|
+
if (!((went_upwards || went_downwards) && shorter_array.every(({ query_id: query_id }, index)=>longer_array[index].query_id === query_id))) {
|
|
5434
5218
|
// We went sideways, not up or down. Clear filters.
|
|
5435
5219
|
(0, $e9342fb3ac73a54a$export$8895d39404bd2bb1)({
|
|
5436
5220
|
user_triggered_: false,
|
|
@@ -5449,7 +5233,7 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
5449
5233
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
5450
5234
|
})));
|
|
5451
5235
|
}
|
|
5452
|
-
function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_
|
|
5236
|
+
function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, i18n_: i18n_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_, sideways_filter_clearing_flag_: [get_sideways_filter_clearing_flag_, set_sideways_filter_clearing_flag_] }) {
|
|
5453
5237
|
const tracking_function_for_plp_results = (0, $gco9i$createReaction)(()=>{
|
|
5454
5238
|
// On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
|
|
5455
5239
|
if (!(0, $gco9i$untrack)(get_sideways_filter_clearing_flag_)) return;
|
|
@@ -5475,20 +5259,16 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
5475
5259
|
|
|
5476
5260
|
|
|
5477
5261
|
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
5262
|
const $9f5cb586f34c14e6$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="statement" style="white-space:pre-wrap">No category ID specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a category ID in your Depict Provider.</div>`, 2), $9f5cb586f34c14e6$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="buttons"><button class="ok major"></button></div>`, 4);
|
|
5483
5263
|
function $9f5cb586f34c14e6$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
|
|
5484
5264
|
if (!(0, $gco9i$is_debug)) return; // Just to make sure we don't show this in production
|
|
5485
5265
|
const owner = (0, $gco9i$getOwner)();
|
|
5486
|
-
const disconnect = (0, $gco9i$observer).onexists(el, ({ element: element
|
|
5266
|
+
const disconnect = (0, $gco9i$observer).onexists(el, ({ element: element })=>(0, $gco9i$runWithOwner)(owner, ()=>(0, $gco9i$createEffect)(()=>{
|
|
5487
5267
|
if (!document.documentElement.contains(element)) return;
|
|
5488
5268
|
if (!query_id_()) {
|
|
5489
5269
|
const warning = "No category ID specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a category ID in your Depict Provider.";
|
|
5490
5270
|
(0, $gco9i$dwarn)(warning);
|
|
5491
|
-
const { close_toast_: close_toast_
|
|
5271
|
+
const { close_toast_: close_toast_ } = (0, $bf52d9f9eebd1938$export$5196e4c01fa56fcb)({
|
|
5492
5272
|
class: "warning",
|
|
5493
5273
|
close_after_: 120000,
|
|
5494
5274
|
style: {
|
|
@@ -5515,12 +5295,38 @@ function $9f5cb586f34c14e6$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
|
|
|
5515
5295
|
|
|
5516
5296
|
|
|
5517
5297
|
|
|
5518
|
-
|
|
5519
5298
|
const $4fb3a1cf207a7d5c$export$5c28802497c8a83c = /*@__PURE__*/ Symbol("category_title_type");
|
|
5520
5299
|
|
|
5521
5300
|
|
|
5301
|
+
|
|
5302
|
+
function $2ab89d64b7f1d5ef$export$d31a1a1a83ad9413(plp_results_, [get_selected_filters, set_selected_filters]) {
|
|
5303
|
+
(0, $gco9i$createComputed)(()=>{
|
|
5304
|
+
const available_filters = plp_results_()?.filters;
|
|
5305
|
+
if (!available_filters) return;
|
|
5306
|
+
const selected_filters = get_selected_filters();
|
|
5307
|
+
if (!selected_filters) return;
|
|
5308
|
+
const new_filters = [];
|
|
5309
|
+
let modified_filters = false;
|
|
5310
|
+
for(let i = 0; i < selected_filters.length; i++){
|
|
5311
|
+
const selected_filter = selected_filters[i];
|
|
5312
|
+
const available_filter = available_filters.find((available_filter)=>available_filter.field === selected_filter.field && available_filter.op === selected_filter.op);
|
|
5313
|
+
const available_filter_old_filter_link = available_filters.find((available_filter)=>available_filter.actual_field === selected_filter.field && available_filter.op === selected_filter.op);
|
|
5314
|
+
if (!available_filter && available_filter_old_filter_link) {
|
|
5315
|
+
new_filters.push({
|
|
5316
|
+
...selected_filter,
|
|
5317
|
+
field: available_filter_old_filter_link.field
|
|
5318
|
+
}); // <- Change the field to be the new field which actually is group_title
|
|
5319
|
+
modified_filters = true;
|
|
5320
|
+
} else new_filters.push(selected_filter);
|
|
5321
|
+
}
|
|
5322
|
+
if (modified_filters) // This will unfortunately trigger a refetch which isn't great UX but it's the best we can do for now
|
|
5323
|
+
set_selected_filters(new_filters);
|
|
5324
|
+
});
|
|
5325
|
+
}
|
|
5326
|
+
|
|
5327
|
+
|
|
5522
5328
|
const $df5d81d0fe61ff21$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="product-count"><!#><!/> <!#><!/></div>`, 6), $df5d81d0fe61ff21$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div></div>`, 2), $df5d81d0fe61ff21$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="filter-results-for-one-row"><!#><!/><!#><!/></div>`, 6), $df5d81d0fe61ff21$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="depict plp category"><div class="listing-page"><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/></div><!#><!/><!#><!/></div>`, 20);
|
|
5523
|
-
function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_
|
|
5329
|
+
function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_, query_id_: query_id_, listing_type_: listing_type_, current_sorting_: current_sorting_, min_products_to_fetch_: min_products_to_fetch_, category_filters_open_: category_filters_open_, category_sorting_open_: category_sorting_open_, expanded_filters_: expanded_filters_, selected_filters_: selected_filters_, get_quicklinks_accessor_: get_quicklinks_accessor_, i18n_: incoming_i18n, get_breadcrumb_accessor_: get_breadcrumb_accessor_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, local_filter_cache_: local_filter_cache_, tenant_: tenant_, market_: market_, router_: router_, show_quicklinks_: show_quicklinks_, category_title_: category_title_, show_breadcrumbs_: show_breadcrumbs_, layout_options_: layout_options_, scroll_restoration_data_: scroll_restoration_data_, product_card_template_: product_card_template_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
5524
5330
|
let results_for;
|
|
5525
5331
|
let only_show_filters_opener_;
|
|
5526
5332
|
let middle_elements_;
|
|
@@ -5617,6 +5423,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5617
5423
|
}), _el$6, _co$2);
|
|
5618
5424
|
return _el$;
|
|
5619
5425
|
})();
|
|
5426
|
+
(0, $2ab89d64b7f1d5ef$export$d31a1a1a83ad9413)(plp_results_, selected_filters_);
|
|
5620
5427
|
// aiming to have as little unneeded functionality in the bundle as possible, therefore we have two kinds of components that can "plug in" here depending on if there should be a title in the category page along with the count in a row above the buttons on mobile or if it should merge between the buttons when possible
|
|
5621
5428
|
if (category_title_type === "simple") {
|
|
5622
5429
|
const CategoryTitleComponent = category_title_;
|
|
@@ -5629,7 +5436,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5629
5436
|
}
|
|
5630
5437
|
});
|
|
5631
5438
|
} else if (category_title_type == "interactive") {
|
|
5632
|
-
({ middle_elements_: middle_elements_
|
|
5439
|
+
({ middle_elements_: middle_elements_, only_show_filters_opener_: only_show_filters_opener_, on_filters_constructed_: on_filters_constructed_ } = category_title_({
|
|
5633
5440
|
make_product_count_: make_product_count_,
|
|
5634
5441
|
is_slim_: is_slim_,
|
|
5635
5442
|
set_observed_results_filters_elements_: set_observed_results_filters_elements_,
|
|
@@ -5966,12 +5773,12 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
5966
5773
|
const [get_current_href, set_current_href] = (0, $gco9i$createSignal)(globalThis?.location?.href ?? "https://example.com");
|
|
5967
5774
|
const history_change_handler = (0, $gco9i$catchify)(()=>set_current_href(location.href));
|
|
5968
5775
|
const owner = (0, $gco9i$getOwner)() || (0, $gco9i$createRoot)(()=>(0, $gco9i$getOwner)());
|
|
5969
|
-
const { sorting_query_param_: sorting_query_param_
|
|
5776
|
+
const { sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = options;
|
|
5970
5777
|
let writer_started = false;
|
|
5971
5778
|
(0, $gco9i$instant_exec_on_suspect_history_change).add(history_change_handler);
|
|
5972
5779
|
(0, $gco9i$onCleanup)(()=>(0, $gco9i$instant_exec_on_suspect_history_change).delete(history_change_handler));
|
|
5973
5780
|
(0, $gco9i$createComputed)(()=>{
|
|
5974
|
-
const { searchParams: searchParams
|
|
5781
|
+
const { searchParams: searchParams } = new URL(get_current_href());
|
|
5975
5782
|
(0, $gco9i$batch)(()=>{
|
|
5976
5783
|
const found_sorting = (0, $4147651646da990a$export$766e9676e74997d3)(searchParams, sorting_query_param_);
|
|
5977
5784
|
if (found_sorting) {
|
|
@@ -5981,7 +5788,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
5981
5788
|
} else set_sorting();
|
|
5982
5789
|
const found_filters = (0, $4147651646da990a$export$f934fa24c3a86811)(searchParams, filter_query_param_prefix_);
|
|
5983
5790
|
const selected_filters = (0, $gco9i$untrack)(get_selected_filters_);
|
|
5984
|
-
const found_filters_map = new Map(found_filters.map(({ field: field
|
|
5791
|
+
const found_filters_map = new Map(found_filters.map(({ field: field, op: op, data: data })=>[
|
|
5985
5792
|
JSON.stringify([
|
|
5986
5793
|
field,
|
|
5987
5794
|
op
|
|
@@ -5989,7 +5796,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
5989
5796
|
data
|
|
5990
5797
|
]));
|
|
5991
5798
|
// Sorry for this diffing algorithm lol. Looking forwards to Records and Tuples.
|
|
5992
|
-
if (selected_filters.length !== found_filters.length || !selected_filters.every(({ field: field
|
|
5799
|
+
if (selected_filters.length !== found_filters.length || !selected_filters.every(({ field: field, op: op, data: data })=>JSON.stringify(found_filters_map.get(JSON.stringify([
|
|
5993
5800
|
field,
|
|
5994
5801
|
op
|
|
5995
5802
|
]))) === JSON.stringify(data))) set_selected_filters(found_filters);
|
|
@@ -6025,7 +5832,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
6025
5832
|
}
|
|
6026
5833
|
/**
|
|
6027
5834
|
* Writes the sorting and filters to the URL query parameters when they change.
|
|
6028
|
-
*/ function $ccd5db07a3a069c5$var$start_href_writer({ get_sorting_: get_sorting_
|
|
5835
|
+
*/ function $ccd5db07a3a069c5$var$start_href_writer({ get_sorting_: get_sorting_, get_selected_filters_: get_selected_filters_, router_: router_, get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
6029
5836
|
(0, $gco9i$createEffect)((0, $gco9i$on)([
|
|
6030
5837
|
get_sorting_,
|
|
6031
5838
|
get_selected_filters_,
|
|
@@ -6033,7 +5840,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
6033
5840
|
], ([sorting, filters, has_sideways_filter_clearing_flag])=>{
|
|
6034
5841
|
const current_href = location.href;
|
|
6035
5842
|
const url_object = new URL(current_href);
|
|
6036
|
-
const { searchParams: searchParams
|
|
5843
|
+
const { searchParams: searchParams } = url_object;
|
|
6037
5844
|
(0, $4147651646da990a$export$916e6850778505f6)(searchParams, filter_query_param_prefix_, sorting_query_param_);
|
|
6038
5845
|
(0, $4147651646da990a$export$62acb285a7579555)(sorting, searchParams, sorting_query_param_);
|
|
6039
5846
|
(0, $4147651646da990a$export$58aa3f171519b6d7)(filters, searchParams, filter_query_param_prefix_);
|
|
@@ -6070,7 +5877,7 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
6070
5877
|
*/ /**
|
|
6071
5878
|
* We store query_id in history.state and do operate on this both here and in js-ui, this is the key to be used which js-ui provides
|
|
6072
5879
|
*/ #throwing_on_navigation(...args) {
|
|
6073
|
-
const { on_navigation_: on_navigation_
|
|
5880
|
+
const { on_navigation_: on_navigation_ } = this;
|
|
6074
5881
|
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
6075
5882
|
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
6076
5883
|
try {
|
|
@@ -6114,7 +5921,7 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
6114
5921
|
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
6115
5922
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
6116
5923
|
* @param category_query_id_ If you are navigating to a category and know the query_id of, please provide it. This is for making a better devEx in js-ui
|
|
6117
|
-
*/ go_to_: (0, $gco9i$catchify)(async ({ new_url_: raw_new_url
|
|
5924
|
+
*/ go_to_: (0, $gco9i$catchify)(async ({ new_url_: raw_new_url, event_: event_, force_spa_navigation_: force_spa_navigation_, is_replace_: is_replace_, category_query_id_: category_query_id_, scroll: scroll = true })=>{
|
|
6118
5925
|
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
6119
5926
|
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
6120
5927
|
if (this.#dont_attempt_navigation(event_)) return;
|
|
@@ -6152,11 +5959,10 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
6152
5959
|
}
|
|
6153
5960
|
|
|
6154
5961
|
|
|
6155
|
-
|
|
6156
5962
|
const $961b5c64bef4662f$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="depict plp category"></div>`, 2);
|
|
6157
5963
|
const $961b5c64bef4662f$var$min_products_to_fetch_ = 20;
|
|
6158
5964
|
const $961b5c64bef4662f$var$privately_shared_properties = /*@__PURE__*/ new WeakMap();
|
|
6159
|
-
const $961b5c64bef4662f$var$InExternalAreaDiv = ({ children: children
|
|
5965
|
+
const $961b5c64bef4662f$var$InExternalAreaDiv = ({ children: children })=>(()=>{
|
|
6160
5966
|
const _el$ = (0, $gco9i$getNextElement)($961b5c64bef4662f$var$_tmpl$);
|
|
6161
5967
|
(0, $gco9i$insert)(_el$, children);
|
|
6162
5968
|
(0, $gco9i$effect)(()=>(0, $gco9i$setAttribute)(_el$, "id", (0, $f86ba724282f6690$export$44dad306455dddf).PLP_CATEGORY));
|
|
@@ -6169,7 +5975,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
6169
5975
|
#market_signal = (0, $gco9i$createSignal)();
|
|
6170
5976
|
#query_id_signal = (0, $gco9i$createSignal)("");
|
|
6171
5977
|
#listing_type_signal = (0, $gco9i$createSignal)();
|
|
6172
|
-
static #keys_constructed_with =
|
|
5978
|
+
static #keys_constructed_with = new Set();
|
|
6173
5979
|
get localization() {
|
|
6174
5980
|
// allow reactive access
|
|
6175
5981
|
return this.#locale_signal[0]();
|
|
@@ -6208,18 +6014,18 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
6208
6014
|
set on_navigation(new_function) {
|
|
6209
6015
|
this.#router.on_navigation_ = new_function;
|
|
6210
6016
|
}
|
|
6211
|
-
constructor({ api: api
|
|
6017
|
+
constructor({ api: api, on_navigation: on_navigation, page_url_creator: page_url_creator, unique_instance_key_for_state: unique_instance_key_for_state = "", query_id_state_key: query_id_state_key, ...props_on_class }){
|
|
6212
6018
|
const owner = (0, $gco9i$getOwner)() || (0, $gco9i$createRoot)(()=>(0, $gco9i$getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
6213
6019
|
(0, $gco9i$runWithOwner)(owner, ()=>{
|
|
6214
|
-
if ($961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.
|
|
6020
|
+
if ($961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.has(unique_instance_key_for_state) && !(0, $gco9i$isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
6215
6021
|
throw new Error("You can only have one instance of DepictCategory with the same uniqueInstanceKeyForState");
|
|
6216
6022
|
Object.assign(this, props_on_class); // set initial signal values
|
|
6217
6023
|
(0, $90980bd87c9960f9$export$5162a71f252e6122)();
|
|
6218
6024
|
this.#router = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation", query_id_state_key);
|
|
6219
6025
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
6220
6026
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
6221
|
-
const filter_query_param_prefix_ = "
|
|
6222
|
-
const { selected_filters_: selected_filters_
|
|
6027
|
+
const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
|
|
6028
|
+
const { selected_filters_: selected_filters_, current_sorting_: current_sorting_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ } = (0, $ccd5db07a3a069c5$export$477caf01aecaeb2a)({
|
|
6223
6029
|
router_: this.#router,
|
|
6224
6030
|
sorting_query_param_: sorting_query_param_,
|
|
6225
6031
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -6254,16 +6060,17 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
6254
6060
|
sorting_query_param_: sorting_query_param_,
|
|
6255
6061
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
6256
6062
|
});
|
|
6257
|
-
$961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.
|
|
6063
|
+
$961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.add(unique_instance_key_for_state);
|
|
6064
|
+
(0, $gco9i$onCleanup)(()=>$961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.delete(unique_instance_key_for_state));
|
|
6258
6065
|
});
|
|
6259
6066
|
}
|
|
6260
6067
|
}
|
|
6261
6068
|
function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
6262
|
-
const { depict_category: depict_category
|
|
6069
|
+
const { depict_category: depict_category, product_card_template: product_card_template, category_title: category_title } = props;
|
|
6263
6070
|
const shared_properties = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
6264
6071
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
6265
6072
|
const grid_spacing_override = (0, $gco9i$createMemo)(()=>{
|
|
6266
|
-
const { grid_spacing: grid_spacing
|
|
6073
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
6267
6074
|
return typeof grid_spacing === "string" ? {
|
|
6268
6075
|
grid_spacing: grid_spacing
|
|
6269
6076
|
} : {
|
|
@@ -6271,7 +6078,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
6271
6078
|
grid_spacing: grid_spacing.horizontal
|
|
6272
6079
|
};
|
|
6273
6080
|
});
|
|
6274
|
-
const { state_: { local_filter_cache: local_filter_cache_
|
|
6081
|
+
const { state_: { local_filter_cache: local_filter_cache_, filters_open: category_filters_open_, sorting_open: category_sorting_open_, expanded_filters: expanded_filters_, expanded_hierarchical_filters: expanded_hierarchical_filters_, scroll_restoration_data: scroll_restoration_data_ }, current_sorting_: current_sorting_, selected_filters_: selected_filters_, reset_history_state_: reset_history_state_, depict_api_: depict_api_, i18n_: i18n_, router_: router_, breadcrumb_signal_: breadcrumb_signal_, quicklinks_signal_: quicklinks_signal_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = shared_properties;
|
|
6275
6082
|
(0, $gco9i$onCleanup)(reset_history_state_);
|
|
6276
6083
|
return (0, $df5d81d0fe61ff21$export$f7d2f673fc2f091d)({
|
|
6277
6084
|
tenant_: ()=>depict_category.merchant,
|
|
@@ -6306,8 +6113,8 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
6306
6113
|
});
|
|
6307
6114
|
}, "Entire CategoryPage failed");
|
|
6308
6115
|
}
|
|
6309
|
-
function $961b5c64bef4662f$export$5b7c3ce0ebe51f86({ depict_category: depict_category
|
|
6310
|
-
const { i18n_: i18n_
|
|
6116
|
+
function $961b5c64bef4662f$export$5b7c3ce0ebe51f86({ depict_category: depict_category }) {
|
|
6117
|
+
const { i18n_: i18n_, breadcrumb_signal_: [crumb_data_], router_: router_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
6311
6118
|
return (0, $gco9i$createComponent)($961b5c64bef4662f$var$InExternalAreaDiv, {
|
|
6312
6119
|
get children () {
|
|
6313
6120
|
return (0, $dfa5b6f7c5e421df$export$5646050d516e06bc)({
|
|
@@ -6320,8 +6127,8 @@ function $961b5c64bef4662f$export$5b7c3ce0ebe51f86({ depict_category: depict_cat
|
|
|
6320
6127
|
}
|
|
6321
6128
|
});
|
|
6322
6129
|
}
|
|
6323
|
-
function $961b5c64bef4662f$export$de035477d6fef996({ depict_category: depict_category
|
|
6324
|
-
const { i18n_: i18n_
|
|
6130
|
+
function $961b5c64bef4662f$export$de035477d6fef996({ depict_category: depict_category }) {
|
|
6131
|
+
const { i18n_: i18n_, quicklinks_signal_: [quicklinks_data_], breadcrumb_signal_: [breadcrumb_data_], router_: router_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
6325
6132
|
return (0, $gco9i$createComponent)($961b5c64bef4662f$var$InExternalAreaDiv, {
|
|
6326
6133
|
get children () {
|
|
6327
6134
|
return (0, $06edf3aec9073663$export$466cdc317043f6cb)({
|
|
@@ -6346,14 +6153,9 @@ function $961b5c64bef4662f$var$get_shared_properties(depict_category) {
|
|
|
6346
6153
|
|
|
6347
6154
|
|
|
6348
6155
|
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
6156
|
const $e4615ecd1849548f$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="category-title"><h1 class="title"></h1><span class="explanation"> — <!#><!/></span></div>`, 8);
|
|
6355
6157
|
const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
6356
|
-
const actual_function = ({ category_title_: category_title_
|
|
6158
|
+
const actual_function = ({ category_title_: category_title_, product_count_: product_count_ })=>{
|
|
6357
6159
|
return (()=>{
|
|
6358
6160
|
const _el$ = (0, $gco9i$getNextElement)($e4615ecd1849548f$var$_tmpl$), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, [_el$6, _co$] = (0, $gco9i$getNextMarker)(_el$5.nextSibling);
|
|
6359
6161
|
(0, $gco9i$insert)(_el$2, ()=>category_title_() || (0, $gco9i$createComponent)((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
|
|
@@ -6374,12 +6176,9 @@ const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
|
6374
6176
|
|
|
6375
6177
|
|
|
6376
6178
|
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
6179
|
const $a6e23a834336fc19$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="sort-and-filter-buttons fake" aria-hidden="true" style="position:absolute;z-index:-1;pointer-events:none;opacity:0"><div class="outer"><div class="inner"><!#><!/><!#><!/><!#><!/></div></div></div>`, 12);
|
|
6381
6180
|
const $a6e23a834336fc19$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
6382
|
-
const actual_function = ({ make_product_count_: make_product_count_
|
|
6181
|
+
const actual_function = ({ make_product_count_: make_product_count_, set_observed_results_filters_elements_: set_observed_results_filters_elements_, is_slim_: is_slim_, sort_and_filter_element_: sort_and_filter_element_, extra_sort_and_filter_args_: extra_sort_and_filter_args_ })=>{
|
|
6383
6182
|
// this does two things: make the sorting and filters button the same width and move the number of products out of the SortAndFilter middle_elements_ if it doesn't fit
|
|
6384
6183
|
let extra_sort_button_;
|
|
6385
6184
|
let extra_filter_button_;
|
|
@@ -6542,16 +6341,9 @@ async function $c9312089e8983364$var$download_categories(tenant, market, type) {
|
|
|
6542
6341
|
|
|
6543
6342
|
|
|
6544
6343
|
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
6344
|
function $7f60f09116a3fe61$export$3f37af283f8fb843(props) {
|
|
6553
6345
|
const style = (0, $gco9i$createMemo)(()=>{
|
|
6554
|
-
const { style: style
|
|
6346
|
+
const { style: style, height: height, width: width, aspectRatio: aspectRatio } = props;
|
|
6555
6347
|
const is_image = aspectRatio != undefined;
|
|
6556
6348
|
const size_data = is_image ? {
|
|
6557
6349
|
width: "100%",
|
|
@@ -6597,17 +6389,8 @@ function $bb15dfb548a7666e$export$ee1733d9a8495996() {
|
|
|
6597
6389
|
|
|
6598
6390
|
|
|
6599
6391
|
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
6392
|
const $897bd4a76f611b38$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span class="parent-title"></span>`, 2), $897bd4a76f611b38$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<a class="category-suggestion"><span class="title"></span><!#><!/></a>`, 6);
|
|
6610
|
-
function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_
|
|
6393
|
+
function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_, router_: router_ }) {
|
|
6611
6394
|
return (()=>{
|
|
6612
6395
|
const _el$ = (0, $gco9i$getNextElement)($897bd4a76f611b38$var$_tmpl$2), _el$2 = _el$.firstChild, _el$4 = _el$2.nextSibling, [_el$5, _co$] = (0, $gco9i$getNextMarker)(_el$4.nextSibling);
|
|
6613
6396
|
(0, $gco9i$addEventListener)(_el$, "click", (0, $gco9i$catchify)((e)=>{
|
|
@@ -6642,18 +6425,6 @@ function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: categ
|
|
|
6642
6425
|
|
|
6643
6426
|
|
|
6644
6427
|
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
6428
|
const $22e59517c2ec94d3$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="16"><path d="M.773 7.371L7.98.176C8.098.059 8.238 0 8.402 0s.305.059.422.176S9 .434 9 .598s-.059.305-.176.422L2.648 7.195h19.547a.59.59 0 0 1 .609.609c0 .172-.059.305-.176.422s-.262.176-.434.176H2.648l6.176 6.176a.59.59 0 0 1 .176.426c0 .16-.059.301-.176.422-.055.059-.121.109-.199.137s-.148.039-.223.039-.156-.012-.234-.039a.54.54 0 0 1-.187-.137L.773 8.227c-.117-.117-.176-.258-.176-.422a.6.6 0 0 1 .176-.434zm0 0"></path></svg>`, 4);
|
|
6658
6429
|
function $22e59517c2ec94d3$export$1c641004b5485fed() {
|
|
6659
6430
|
return (0, $gco9i$getNextElement)($22e59517c2ec94d3$var$_tmpl$);
|
|
@@ -6662,10 +6433,6 @@ function $22e59517c2ec94d3$export$1c641004b5485fed() {
|
|
|
6662
6433
|
|
|
6663
6434
|
|
|
6664
6435
|
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
6436
|
const $16f0ed5ea30d8d9c$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg><path d="M19.811 20.174l-6.234-6.809a7.96 7.96 0 0 0 .923-1.179c.274-.424.502-.865.687-1.323a8.04 8.04 0 0 0 .42-1.436 7.88 7.88 0 0 0 .144-1.507c0-.526-.051-1.042-.154-1.548-.096-.506-.243-.995-.441-1.466s-.441-.919-.728-1.343a8.28 8.28 0 0 0-.984-1.21 7.86 7.86 0 0 0-1.2-.984A7.56 7.56 0 0 0 10.89.651C10.418.453 9.929.302 9.423.2S8.401.046 7.875.046 6.833.097 6.327.2 5.332.453 4.86.651a7.56 7.56 0 0 0-1.354.718c-.431.287-.831.615-1.2.984a8.28 8.28 0 0 0-.984 1.21 7.73 7.73 0 0 0-.728 1.343c-.198.472-.349.96-.451 1.466A8.31 8.31 0 0 0 0 7.921a8.31 8.31 0 0 0 .144 1.548c.103.506.253.995.451 1.466a8.08 8.08 0 0 0 .728 1.354 7.86 7.86 0 0 0 .984 1.2 7.54 7.54 0 0 0 1.2.995c.431.287.882.53 1.354.728.472.191.96.338 1.466.441a8.31 8.31 0 0 0 1.548.144c.451 0 .896-.038 1.333-.113a7.83 7.83 0 0 0 1.282-.328 7.55 7.55 0 0 0 1.2-.533 8.08 8.08 0 0 0 1.107-.749l6.245 6.809a.45.45 0 0 0 .174.123.55.55 0 0 0 .205.041.61.61 0 0 0 .195-.031c.061-.021.116-.055.164-.102.109-.096.164-.219.164-.369.007-.144-.038-.267-.133-.369zM1.046 7.921c0-.937.178-1.818.533-2.646.362-.834.851-1.559 1.466-2.174.622-.615 1.347-1.101 2.174-1.456.827-.362 1.712-.543 2.656-.543s1.829.181 2.656.543c.827.355 1.548.841 2.164 1.456.622.615 1.111 1.34 1.466 2.174a6.52 6.52 0 0 1 .543 2.646c0 .943-.181 1.829-.543 2.656a6.89 6.89 0 0 1-1.466 2.174c-.615.615-1.336 1.104-2.164 1.466-.827.356-1.712.533-2.656.533s-1.829-.178-2.656-.533c-.827-.362-1.552-.851-2.174-1.466-.615-.622-1.104-1.347-1.466-2.174-.355-.827-.533-1.712-.533-2.656z"></path></svg>`, 4);
|
|
6670
6437
|
function $16f0ed5ea30d8d9c$export$82eafebb825fc23f(props = {}) {
|
|
6671
6438
|
return (()=>{
|
|
@@ -6682,7 +6449,7 @@ function $16f0ed5ea30d8d9c$export$82eafebb825fc23f(props = {}) {
|
|
|
6682
6449
|
|
|
6683
6450
|
|
|
6684
6451
|
const $5285d2814d0fac0c$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button class="back" type="button"></button>`, 2), $5285d2814d0fac0c$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="search-field"><!#><!/><div class="field"><input class="query" tabindex="0"><button type="button" class="clear"></button></div><button class="submit major" type="button"></button></div>`, 11);
|
|
6685
|
-
function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search_field_value_
|
|
6452
|
+
function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search_field_value_, input_field_ref_: input_field_ref_, field_element_ref_: field_element_ref_, submit_query_: submit_query_, override_on_enter_: override_on_enter_, clear_filters_: clear_filters_, disabled_: disabled_ = false, on_back_: on_back_, i18n_: i18n_, after_focusing_: after_focusing_ }) {
|
|
6686
6453
|
let input_element;
|
|
6687
6454
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
6688
6455
|
let field_div;
|
|
@@ -6711,10 +6478,10 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
6711
6478
|
field_div = el;
|
|
6712
6479
|
field_element_ref_?.(el);
|
|
6713
6480
|
}, _el$3);
|
|
6714
|
-
_el$4.$$pointerdown = ({ pointerType: pointerType
|
|
6481
|
+
_el$4.$$pointerdown = ({ pointerType: pointerType })=>{
|
|
6715
6482
|
// When selecting text with a mouse we want a SearchField to be focussed even when releasing the mouse outside the .field element (we assume the event listener which opens the modal is attached to that).
|
|
6716
6483
|
if (pointerType === "mouse") {
|
|
6717
|
-
const handler = (0, $gco9i$catchify)(({ pointerType: pointerType
|
|
6484
|
+
const handler = (0, $gco9i$catchify)(({ pointerType: pointerType, target: target })=>{
|
|
6718
6485
|
if (pointerType !== "mouse" || !(target instanceof Node) || target === field_div || field_div.contains(target)) return;
|
|
6719
6486
|
input_element.click();
|
|
6720
6487
|
});
|
|
@@ -6734,7 +6501,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
6734
6501
|
});
|
|
6735
6502
|
}));
|
|
6736
6503
|
(0, $gco9i$addEventListener)(_el$4, "input", (0, $gco9i$catchify)(()=>{
|
|
6737
|
-
const { value: value
|
|
6504
|
+
const { value: value } = input_element;
|
|
6738
6505
|
if (!disabled_ && !value.length) clear_filters_(false); // if the user clears the whole field, reset filters on next submit
|
|
6739
6506
|
search_field_value_[1](value);
|
|
6740
6507
|
}), true);
|
|
@@ -6796,14 +6563,9 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
6796
6563
|
|
|
6797
6564
|
|
|
6798
6565
|
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
6566
|
const $172e1b898d457050$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="search-recs"><h3 class="search-recs-title"></h3><!#><!/><!#><!/></div>`, 8), $172e1b898d457050$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button class="show-more major" type="button"></button>`, 2);
|
|
6805
6567
|
const $172e1b898d457050$export$1c8c715550dc689d = 2;
|
|
6806
|
-
function $172e1b898d457050$export$7de92c4c2205ebf3({ depict_api_: depict_api_
|
|
6568
|
+
function $172e1b898d457050$export$7de92c4c2205ebf3({ depict_api_: depict_api_, i18n_: i18n_, search_query_base_: search_query_base_, product_card_template_: product_card_template_, showing_recommendation_rows_: showing_recommendation_rows_, view_more_button_: view_more_button_ = true, layout_options_: layout_options_ }) {
|
|
6807
6569
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6808
6570
|
const rows_object = view_more_button_ ? $172e1b898d457050$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6809
6571
|
const [recommendations_resource] = (0, $gco9i$createResource)(search_query_base_, (query)=>depict_api_.get_recommended(query).then((r)=>r.displays));
|
|
@@ -6897,7 +6659,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6897
6659
|
let ro;
|
|
6898
6660
|
if (one_axies_only !== "top") {
|
|
6899
6661
|
ro = new ResizeObserver((0, $gco9i$catchify)((records)=>{
|
|
6900
|
-
records.forEach(({ contentRect: { width: width
|
|
6662
|
+
records.forEach(({ contentRect: { width: width } })=>{
|
|
6901
6663
|
if (width_transformer) width = width_transformer(width);
|
|
6902
6664
|
modal_body_style[1]((old_value)=>({
|
|
6903
6665
|
...old_value,
|
|
@@ -6927,7 +6689,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6927
6689
|
|
|
6928
6690
|
|
|
6929
6691
|
|
|
6930
|
-
function $48d7e4a9707315b6$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_
|
|
6692
|
+
function $48d7e4a9707315b6$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_, get_search_query_: get_search_query_, current_sorting_: current_sorting_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, i18n_: i18n_, local_filter_cache_: local_filter_cache_ }) {
|
|
6931
6693
|
const [get_selected_filters] = selected_filters_;
|
|
6932
6694
|
// Possible values:
|
|
6933
6695
|
// 0 - we should not clear next submit
|
|
@@ -6992,7 +6754,7 @@ function $21f51c14cb3f586f$export$84bba84a7b837187(read_search_query) {
|
|
|
6992
6754
|
|
|
6993
6755
|
|
|
6994
6756
|
|
|
6995
|
-
async function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
6757
|
+
async function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_, search_param_name_: search_param_name_, set_search_field_value_: set_search_field_value_, get_search_query_: get_search_query_, url_transformer_: url_transformer_, router_: router_, after_submit_: after_submit_, get_new_query: get_new_query }) {
|
|
6996
6758
|
const new_search_query = get_new_query();
|
|
6997
6759
|
const previous_query = (0, $gco9i$untrack)(get_search_query_);
|
|
6998
6760
|
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
@@ -7019,21 +6781,6 @@ async function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchan
|
|
|
7019
6781
|
|
|
7020
6782
|
|
|
7021
6783
|
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
6784
|
|
|
7038
6785
|
|
|
7039
6786
|
|
|
@@ -7053,18 +6800,8 @@ async function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchan
|
|
|
7053
6800
|
|
|
7054
6801
|
|
|
7055
6802
|
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
6803
|
const $e003be2a50d9e5bc$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span class="orig price"><!#><!/><!#><!/><!#><!/></span>`, 8), $e003be2a50d9e5bc$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<a class="instant-card"><div class="img-part"></div><div class="right-part"><div class="title-brand-tagline"><span class="brand"></span><span class="title"></span><!#><!/></div><div class="price-container"><!#><!/><span class="price"><!#><!/><!#><!/><!#><!/></span></div></div></a>`, 26), $e003be2a50d9e5bc$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="tagline"></div>`, 2);
|
|
7067
|
-
const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n
|
|
6804
|
+
const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n }, router_)=>{
|
|
7068
6805
|
const search_result_id = (0, $gco9i$createMemo)(()=>display_or_variant_container().search_result_id);
|
|
7069
6806
|
const display = (0, $gco9i$createMemo)(()=>{
|
|
7070
6807
|
const display = display_or_variant_container();
|
|
@@ -7167,7 +6904,7 @@ const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = (display_or_variant_container,
|
|
|
7167
6904
|
|
|
7168
6905
|
|
|
7169
6906
|
const $eea41f703612261b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="instant-results"></div>`, 2);
|
|
7170
|
-
function $eea41f703612261b$export$62f101a8aa597bf8({ depict_api_: depict_api_
|
|
6907
|
+
function $eea41f703612261b$export$62f101a8aa597bf8({ depict_api_: depict_api_, search_field_value_: [get_search_field_value], tenant_: tenant_, market_: market_, render_instant_card_: render_instant_card_, render_instant_card_placeholder_: render_instant_card_placeholder_, min_products_to_fetch_: min_products_to_fetch_, has_sort_or_filters_: has_sort_or_filters_, set_num_results_accessor_: set_num_results_accessor_, i18n_: i18n_, router_: router_ }) {
|
|
7171
6908
|
const max_cards = 4;
|
|
7172
6909
|
const [read_current_instant_query, write_current_instant_query] = (0, $gco9i$createSignal)("");
|
|
7173
6910
|
let timeout;
|
|
@@ -7239,7 +6976,6 @@ function $eea41f703612261b$export$62f101a8aa597bf8({ depict_api_: depict_api_ ,
|
|
|
7239
6976
|
|
|
7240
6977
|
|
|
7241
6978
|
|
|
7242
|
-
|
|
7243
6979
|
const $4ceabea39c9a56ac$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div style="position:absolute;z-index:-1;pointer-events:none;width:100%;height:200%;top:-100%;"></div>`, 2), $4ceabea39c9a56ac$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div style="position:absolute;z-index:-1;pointer-events:none;width:100%;height:200%;"></div>`, 2);
|
|
7244
6980
|
function $4ceabea39c9a56ac$export$50b90be27d8502d9(el, [get_style_props, set_style_props], bottom_distance) {
|
|
7245
6981
|
const overflow_style_beginning = "position:absolute;z-index:-1;pointer-events:none;width:100%;height:200%;";
|
|
@@ -7279,15 +7015,7 @@ function $4ceabea39c9a56ac$export$50b90be27d8502d9(el, [get_style_props, set_sty
|
|
|
7279
7015
|
|
|
7280
7016
|
|
|
7281
7017
|
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: value_ , url_transformer_: url_transformer_ }) {
|
|
7018
|
+
function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_, value_: value_, url_transformer_: url_transformer_ }) {
|
|
7291
7019
|
const [get_current_href, set_current_href] = (0, $gco9i$createSignal)(location.href);
|
|
7292
7020
|
const [exit_iterable, exitable_iterable] = (0, $gco9i$make_asyncIterable_exiter)((0, $gco9i$href_change_ipns));
|
|
7293
7021
|
(0, $gco9i$onCleanup)(exit_iterable);
|
|
@@ -7306,7 +7034,6 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: va
|
|
|
7306
7034
|
|
|
7307
7035
|
|
|
7308
7036
|
|
|
7309
|
-
|
|
7310
7037
|
const $694b7f90501fea4c$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="13"><path d="M6 12.598a5.88 5.88 0 0 1-1.611-.223c-.52-.145-1.008-.352-1.465-.621s-.875-.605-1.254-.996-.693-.83-.955-1.318c-.039-.07-.047-.145-.023-.223s.072-.143.146-.182.145-.047.223-.023.143.072.182.146a5.54 5.54 0 0 0 .861 1.184c.34.352.715.65 1.125.897s.85.435 1.318.568A5.5 5.5 0 0 0 6 12a5.24 5.24 0 0 0 2.098-.422c.656-.285 1.229-.672 1.717-1.16s.879-1.061 1.16-1.717a5.22 5.22 0 0 0 .428-2.104c0-.742-.143-1.441-.428-2.098s-.668-1.229-1.16-1.717a5.42 5.42 0 0 0-1.717-1.154A5.18 5.18 0 0 0 6 1.201c-.496 0-.979.066-1.447.199s-.904.316-1.318.563-.785.539-1.125.891a5.31 5.31 0 0 0-.855 1.172.32.32 0 0 1-.164.141c-.066.023-.135.023-.205 0a.3.3 0 0 1-.158-.135C.691 3.965.682 3.895.697 3.82l.51-2.385c.016-.078.059-.141.129-.187a.28.28 0 0 1 .229-.041c.078.016.141.059.188.129a.28.28 0 0 1 .041.229l-.211.973a5.91 5.91 0 0 1 .926-.814 5.78 5.78 0 0 1 1.066-.609A5.79 5.79 0 0 1 4.746.732C5.156.643 5.574.598 6 .598c.402 0 .795.039 1.178.117s.76.191 1.119.34a5.95 5.95 0 0 1 1.031.551c.328.219.633.469.914.75s.535.592.75.92a5.77 5.77 0 0 1 .551 1.025 5.53 5.53 0 0 1 .34 1.119c.078.387.117.779.117 1.178s-.039.797-.117 1.184-.187.754-.34 1.113a5.96 5.96 0 0 1-.551 1.031 5.56 5.56 0 0 1-.75.914c-.281.285-.586.537-.914.756a5.95 5.95 0 0 1-1.031.551c-.359.148-.732.26-1.119.334s-.775.117-1.178.117zm0-5.695c-.023 0-.049-.004-.076-.012s-.047-.018-.07-.029l-2.701-1.5c-.07-.039-.117-.098-.141-.176a.29.29 0 0 1 .023-.229c.043-.074.104-.123.182-.146s.158-.014.229.029l2.543 1.412 3.152-2.004c.07-.047.145-.061.223-.041a.29.29 0 0 1 .188.135c.047.066.061.141.041.223a.27.27 0 0 1-.129.188L6.158 6.855a.27.27 0 0 1-.076.035c-.027.008-.055.012-.082.012z" fill="#0f0f0f"></path></svg>`, 4);
|
|
7311
7038
|
function $694b7f90501fea4c$export$5d2caaa6b530761c() {
|
|
7312
7039
|
return (0, $gco9i$getNextElement)($694b7f90501fea4c$var$_tmpl$);
|
|
@@ -7315,7 +7042,7 @@ function $694b7f90501fea4c$export$5d2caaa6b530761c() {
|
|
|
7315
7042
|
|
|
7316
7043
|
|
|
7317
7044
|
const $7ad3a93cbe6fa208$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="previous-searches"><h2 class="text"></h2><div class="list"></div></div>`, 6), $7ad3a93cbe6fa208$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<a class="item"><div class="left"><!#><!/><span></span></div><button class="delete"></button></a>`, 10);
|
|
7318
|
-
function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({ text_: text_
|
|
7045
|
+
function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({ text_: text_, previous_searches_: previous_searches_, search_query_param_name_: search_query_param_name_, currently_showing_suggestions_: currently_showing_suggestions_, set_unfiltered_previous_searches_: set_unfiltered_previous_searches_, selected_index_: [read_selected_index_, write_selected_index_], url_transformer_: url_transformer_, i18n_: i18n_, submit_query_: submit_query_ }) {
|
|
7319
7046
|
const has_entries = (0, $gco9i$createMemo)(()=>previous_searches_().length >= 1);
|
|
7320
7047
|
currently_showing_suggestions_[1]((value)=>{
|
|
7321
7048
|
value[0] = (0, $gco9i$createMemo)(()=>previous_searches_().map((result)=>({
|
|
@@ -7403,25 +7130,11 @@ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({ text_: text_ , previous_sea
|
|
|
7403
7130
|
|
|
7404
7131
|
|
|
7405
7132
|
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
7133
|
|
|
7421
7134
|
|
|
7422
7135
|
|
|
7423
7136
|
const $f3213c0640246d58$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span class="highlighted-part"></span>`, 2), $f3213c0640246d58$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span></span>`, 2);
|
|
7424
|
-
function $f3213c0640246d58$export$ba17c5b7e6dda39f({ whole_text_to_display_: whole_text_to_display_memo
|
|
7137
|
+
function $f3213c0640246d58$export$ba17c5b7e6dda39f({ whole_text_to_display_: whole_text_to_display_memo, searching_for_value_: searching_for_value_memo, class_: class_ }) {
|
|
7425
7138
|
const [get_has_highlighted, set_has_highlighted] = (0, $gco9i$createSignal)(false);
|
|
7426
7139
|
const text_itself = (0, $gco9i$createMemo)(()=>(0, $gco9i$batch)(()=>{
|
|
7427
7140
|
set_has_highlighted(false);
|
|
@@ -7483,10 +7196,10 @@ function $f3213c0640246d58$export$ba17c5b7e6dda39f({ whole_text_to_display_: who
|
|
|
7483
7196
|
|
|
7484
7197
|
|
|
7485
7198
|
const $cea52f6b24092f05$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<a class="suggestion"></a>`, 2), $cea52f6b24092f05$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="search-icon"></div>`, 2), $cea52f6b24092f05$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<span class="type"></span>`, 2), $cea52f6b24092f05$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div><!#><!/><span class="value"></span></div>`, 6), $cea52f6b24092f05$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<h2 class="text"></h2>`, 2), $cea52f6b24092f05$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="suggestion-container query"><!#><!/><!#><!/></div>`, 6), $cea52f6b24092f05$var$_tmpl$7 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="suggestion-container page"></div>`, 2), $cea52f6b24092f05$var$_tmpl$8 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="suggestions"><!#><!/><!#><!/><!#><!/></div>`, 8);
|
|
7486
|
-
function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_
|
|
7487
|
-
const queries_memo = (0, $gco9i$createMemo)(()=>suggestion_memo_().filter(({ type: type
|
|
7199
|
+
function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_, search_query_url_param_name_: search_query_url_param_name_, selected_index_: [read_selected_index_, write_selected_index_], url_transformer_: url_transformer_, filtered_previous_searches_: filtered_previous_searches_, currently_showing_suggestions_: currently_showing_suggestions_, on_previous_searches_page_: on_previous_searches_page_, i18n_: i18n_, include_category_suggestions_: include_category_suggestions_, searching_for_value_: searching_for_value_, router_: router_, submit_query_: submit_query_ }) {
|
|
7200
|
+
const queries_memo = (0, $gco9i$createMemo)(()=>suggestion_memo_().filter(({ type: type, title: title })=>type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
|
|
7488
7201
|
));
|
|
7489
|
-
const not_queries_memo = (0, $gco9i$createMemo)(()=>suggestion_memo_().filter(({ type: type
|
|
7202
|
+
const not_queries_memo = (0, $gco9i$createMemo)(()=>suggestion_memo_().filter(({ type: type })=>type !== (0, $a0eb8b431ec1f87b$export$3cf9497e790da491)));
|
|
7490
7203
|
const render_entry = (input_obj, autocomplete_data_index, index, is_history = false)=>{
|
|
7491
7204
|
const is_query = (0, $gco9i$createMemo)(()=>input_obj().type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491));
|
|
7492
7205
|
const href_with_changed_params_accessor = (0, $gco9i$createMemo)(()=>is_query() ? (0, $a36cbc4f68bfd590$export$91c3b6774e8be0f5)({
|
|
@@ -7689,10 +7402,8 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
7689
7402
|
|
|
7690
7403
|
|
|
7691
7404
|
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
7405
|
const $15f380f0ce2812cc$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<a target="_blank"></a>`, 2);
|
|
7695
|
-
function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index]
|
|
7406
|
+
function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index], currently_showing_suggestions_: [read_currently_showing_suggestions], ...rest_of_props }) {
|
|
7696
7407
|
const last_suggestion_index_ = (0, $gco9i$createMemo)(()=>{
|
|
7697
7408
|
const currently_showing_suggestions = read_currently_showing_suggestions();
|
|
7698
7409
|
let total_length = 0;
|
|
@@ -7747,13 +7458,13 @@ function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_sele
|
|
|
7747
7458
|
write_selected_fake_index_: write_selected_fake_index_
|
|
7748
7459
|
});
|
|
7749
7460
|
}
|
|
7750
|
-
function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_: element_
|
|
7461
|
+
function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_: element_, search_field_value_: [get_search_field_value, set_search_field_value], updating_blocked_: [read_updating_blocked, write_updating_blocked], last_suggestion_index_: last_suggestion_index_, read_selected_fake_index_: read_selected_fake_index_, write_selected_fake_index_: write_selected_fake_index_, set_override_on_enter_fn_: set_override_on_enter_fn_, url_transformer_: url_transformer_, search_query_param_name_: search_query_param_name_, router_: router_ }) {
|
|
7751
7462
|
let previous_value;
|
|
7752
7463
|
(0, $gco9i$createEffect)(()=>{
|
|
7753
7464
|
const sfv = get_search_field_value();
|
|
7754
7465
|
if (!(0, $gco9i$untrack)(()=>read_updating_blocked())) previous_value = sfv;
|
|
7755
7466
|
});
|
|
7756
|
-
const handler = (0, $gco9i$catchify)(({ keyCode: keyCode
|
|
7467
|
+
const handler = (0, $gco9i$catchify)(({ keyCode: keyCode })=>(0, $gco9i$untrack)(()=>{
|
|
7757
7468
|
const up = keyCode === 38;
|
|
7758
7469
|
const down = keyCode === 40;
|
|
7759
7470
|
if (!up && !down) return;
|
|
@@ -7780,7 +7491,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_
|
|
|
7780
7491
|
};
|
|
7781
7492
|
// update text field value if needed
|
|
7782
7493
|
if (selected_entry?.type == "query") {
|
|
7783
|
-
const { title: title
|
|
7494
|
+
const { title: title } = selected_entry;
|
|
7784
7495
|
block_updating_for_one_change();
|
|
7785
7496
|
set_search_field_value(title);
|
|
7786
7497
|
override_on_enter_for_this_entry((e)=>{
|
|
@@ -7792,7 +7503,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_
|
|
|
7792
7503
|
return $15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, url.href);
|
|
7793
7504
|
});
|
|
7794
7505
|
} else if (selected_entry?.type == "category") override_on_enter_for_this_entry((e)=>{
|
|
7795
|
-
const { page_url: page_url
|
|
7506
|
+
const { page_url: page_url } = selected_entry;
|
|
7796
7507
|
if (!$15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, page_url)) // Above fn will return true if it opened a new tab, and we won't make these checks anymore
|
|
7797
7508
|
router_.navigate_.go_to_({
|
|
7798
7509
|
new_url_: page_url,
|
|
@@ -7830,7 +7541,7 @@ function $15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, href) {
|
|
|
7830
7541
|
|
|
7831
7542
|
|
|
7832
7543
|
const $a0eb8b431ec1f87b$export$3cf9497e790da491 = "query";
|
|
7833
|
-
function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_
|
|
7544
|
+
function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_, get_search_query_: get_search_query_, search_query_url_param_name_: search_query_url_param_name_, previous_searches_: unfiltered_previous_searches, previous_searches_text_: previous_searches_text_, depict_api_: depict_api_, tenant_: tenant_, market_: market_, input_field_: input_field_, url_transformer_: url_transformer_, currently_showing_suggestions_: currently_showing_suggestions_, set_override_on_enter_fn_: set_override_on_enter_fn_, selected_index_: selected_index_, i18n_: i18n_, include_category_suggestions_: include_category_suggestions_, submit_query_: submit_query_, router_: router_ }) {
|
|
7834
7545
|
const [searching_for_value, set_searching_for_value] = (0, $gco9i$createSignal)();
|
|
7835
7546
|
const [read_search_field_value] = search_field_value_;
|
|
7836
7547
|
const updating_blocked = (0, $gco9i$createSignal)(false);
|
|
@@ -7844,7 +7555,7 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7844
7555
|
write_suggestion_signal([]);
|
|
7845
7556
|
return;
|
|
7846
7557
|
}
|
|
7847
|
-
const new_value = api_response.suggestions.sort(({ type: a_type
|
|
7558
|
+
const new_value = api_response.suggestions.sort(({ type: a_type }, { type: b_type } // this is probably stupid? But in the UI we show query suggestions first so for the keyboard suggestions to make sense with the index we sort them first here
|
|
7848
7559
|
)=>a_type === $a0eb8b431ec1f87b$export$3cf9497e790da491 && b_type === $a0eb8b431ec1f87b$export$3cf9497e790da491 || a_type !== $a0eb8b431ec1f87b$export$3cf9497e790da491 && b_type !== $a0eb8b431ec1f87b$export$3cf9497e790da491 ? 0 : a_type === $a0eb8b431ec1f87b$export$3cf9497e790da491 ? -1 : 1);
|
|
7849
7560
|
write_suggestion_signal(new_value);
|
|
7850
7561
|
selected_index_[1](undefined); // reset selected index on new results
|
|
@@ -7889,7 +7600,7 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7889
7600
|
search_query_param_name_: search_query_url_param_name_,
|
|
7890
7601
|
text_: previous_searches_text_,
|
|
7891
7602
|
get previous_searches_ () {
|
|
7892
|
-
return (0, $gco9i$createMemo)(()=>filtered_previous_searches().slice(0,
|
|
7603
|
+
return (0, $gco9i$createMemo)(()=>filtered_previous_searches().slice(0, 3));
|
|
7893
7604
|
},
|
|
7894
7605
|
selected_index_: selected_index_,
|
|
7895
7606
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
@@ -7906,7 +7617,7 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7906
7617
|
const value = searching_for_value()?.toLowerCase();
|
|
7907
7618
|
if (!value) return false;
|
|
7908
7619
|
return search.includes(value) || value.includes(search);
|
|
7909
|
-
}).slice(0,
|
|
7620
|
+
}).slice(0, 2);
|
|
7910
7621
|
});
|
|
7911
7622
|
},
|
|
7912
7623
|
on_previous_searches_page_: show_previous_searches_component,
|
|
@@ -7948,14 +7659,14 @@ function $d78eea1e8707dc2d$export$c7e181728ad525f(url) {
|
|
|
7948
7659
|
}
|
|
7949
7660
|
|
|
7950
7661
|
|
|
7951
|
-
function $c64d28ca12452b21$export$3340fdd8259bd4fd({ get_search_field_value_: get_search_field_value_
|
|
7662
|
+
function $c64d28ca12452b21$export$3340fdd8259bd4fd({ get_search_field_value_: get_search_field_value_, search_query_url_param_name_: search_query_url_param_name_, url_transformer_: url_transformer_, get_search_query_: get_search_query_ }) {
|
|
7952
7663
|
// @ts-ignore
|
|
7953
7664
|
if (process.env.GA === "false") return;
|
|
7954
7665
|
let debounce_timeout;
|
|
7955
7666
|
const stop_timeout = ()=>clearTimeout(debounce_timeout);
|
|
7956
7667
|
const send_to_ga = (0, $gco9i$catchify)(()=>{
|
|
7957
7668
|
const fake_url = new URL(location.href);
|
|
7958
|
-
const { searchParams: searchParams
|
|
7669
|
+
const { searchParams: searchParams } = fake_url;
|
|
7959
7670
|
searchParams.set(search_query_url_param_name_, (0, $gco9i$untrack)(get_search_field_value_));
|
|
7960
7671
|
searchParams.set("instant_result", "true");
|
|
7961
7672
|
url_transformer_?.(fake_url);
|
|
@@ -7983,8 +7694,6 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({ get_search_field_value_: ge
|
|
|
7983
7694
|
|
|
7984
7695
|
|
|
7985
7696
|
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
7697
|
const $926b1b5ba2239356$export$af8311b651139246 = (css_properties)=>{
|
|
7989
7698
|
return Object.entries(css_properties).map(([key, value])=>`${key}: ${value};`).join(" ");
|
|
7990
7699
|
};
|
|
@@ -8008,7 +7717,7 @@ function $19f1f3e588d63502$export$f021bdedd3ec901a(props) {
|
|
|
8008
7717
|
|
|
8009
7718
|
|
|
8010
7719
|
const $fabfda1230351b1a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="discover-more"><button class="major" type="button"></button></div>`, 4), $fabfda1230351b1a$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<b></b>`, 2), $fabfda1230351b1a$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="depict-search-modal"><div class="body"><!#><!/><div class="padded"><!#><!/><!#><!/><!#><!/></div><!#><!/></div><!#><!/></div>`, 18), $fabfda1230351b1a$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="depict plp search"><div class="depict-search-modal-backdrop"></div><!#><!/></div>`, 6);
|
|
8011
|
-
function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: props_search_field_value
|
|
7720
|
+
function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: props_search_field_value, get_search_query_: get_search_query_, search_query_url_param_name_: search_query_url_param_name_, previous_searches_: previous_searches_, close_modal_: close_modal_, style_props_: style_props_ = (0, $gco9i$createSignal)({}), depict_api_: depict_api_, tenant_: tenant_, market_: market_, submit_query_: props_submit_query, instant_results_options_: instant_results_options_, register_closing_animation_: register_closing_animation_, url_transformer_: url_transformer_, closing_animation_: closing_animation_, clear_filters_: clear_filters_, i18n_: i18n_, disable_scrolling_: disable_scrolling_ = true, enable_category_suggestions_: enable_category_suggestions_, class_list_: class_list_, bottom_distance_under_modal_: bottom_distance_under_modal_, selected_text_range_: selected_text_range_, dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_ = false, router_: router_ }) {
|
|
8012
7721
|
let on_enter_in_search_field_function;
|
|
8013
7722
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
8014
7723
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
@@ -8026,7 +7735,7 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
8026
7735
|
const [get_search_field_value_] = search_field_value_;
|
|
8027
7736
|
const [elements_outside_scrollable, set_elements_outside_scrollable] = (0, $gco9i$createSignal)();
|
|
8028
7737
|
const [elements_inside_scrollable, set_elements_inside_scrollable] = (0, $gco9i$createSignal)();
|
|
8029
|
-
const close_on_escape_handler = (0, $gco9i$catchify)(({ key: key
|
|
7738
|
+
const close_on_escape_handler = (0, $gco9i$catchify)(({ key: key })=>{
|
|
8030
7739
|
if (key === "Escape") close_modal_();
|
|
8031
7740
|
});
|
|
8032
7741
|
const [get_num_results_accessor, set_num_results_accessor_] = (0, $gco9i$createSignal)();
|
|
@@ -8039,7 +7748,7 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
8039
7748
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
8040
7749
|
(0, $gco9i$onCleanup)((0, $gco9i$catchify)(()=>window.removeEventListener("keydown", close_on_escape_handler)));
|
|
8041
7750
|
const owner = (0, $gco9i$getOwner)();
|
|
8042
|
-
(0, $gco9i$onCleanup)((0, $gco9i$javascript_media_query)("(max-height:700px)", ({ matches: matches
|
|
7751
|
+
(0, $gco9i$onCleanup)((0, $gco9i$javascript_media_query)("(max-height:700px)", ({ matches: matches })=>(0, $gco9i$runWithOwner)(owner, ()=>{
|
|
8043
7752
|
// the if below is reactive so we need an owner
|
|
8044
7753
|
(matches ? set_elements_outside_scrollable : set_elements_inside_scrollable)("");
|
|
8045
7754
|
(matches ? set_elements_inside_scrollable : set_elements_outside_scrollable)((()=>{
|
|
@@ -8094,7 +7803,7 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
8094
7803
|
search_field.classList.add("in-modal");
|
|
8095
7804
|
const modal_element = (()=>{
|
|
8096
7805
|
const _el$4 = (0, $gco9i$getNextElement)($fabfda1230351b1a$var$_tmpl$3), _el$5 = _el$4.firstChild, _el$13 = _el$5.firstChild, [_el$14, _co$4] = (0, $gco9i$getNextMarker)(_el$13.nextSibling), _el$6 = _el$14.nextSibling, _el$7 = _el$6.firstChild, [_el$8, _co$] = (0, $gco9i$getNextMarker)(_el$7.nextSibling), _el$9 = _el$8.nextSibling, [_el$10, _co$2] = (0, $gco9i$getNextMarker)(_el$9.nextSibling), _el$11 = _el$10.nextSibling, [_el$12, _co$3] = (0, $gco9i$getNextMarker)(_el$11.nextSibling), _el$15 = _el$6.nextSibling, [_el$16, _co$5] = (0, $gco9i$getNextMarker)(_el$15.nextSibling), _el$17 = _el$5.nextSibling, [_el$18, _co$6] = (0, $gco9i$getNextMarker)(_el$17.nextSibling);
|
|
8097
|
-
(0, $gco9i$addEventListener)(_el$4, "click", (0, $gco9i$catchify)(({ target: target
|
|
7806
|
+
(0, $gco9i$addEventListener)(_el$4, "click", (0, $gco9i$catchify)(({ target: target })=>{
|
|
8098
7807
|
if (target === modal_element) close_modal_();
|
|
8099
7808
|
}), true);
|
|
8100
7809
|
(0, $gco9i$insert)(_el$5, search_field, _el$14, _co$4);
|
|
@@ -8209,18 +7918,9 @@ function $fabfda1230351b1a$var$close_modal_when_navigating_away(close_modal, sea
|
|
|
8209
7918
|
|
|
8210
7919
|
|
|
8211
7920
|
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
7921
|
|
|
8222
7922
|
const $793905995512612d$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="category-suggestions"></div>`, 2), $793905995512612d$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="category-suggestion"></div>`, 2);
|
|
8223
|
-
function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
7923
|
+
function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_, children: children }) {
|
|
8224
7924
|
const category_suggestions_ = (0, $gco9i$createMemo)(()=>suggestions_()?.suggestions.filter((s)=>s.type === "category"));
|
|
8225
7925
|
return (0, $gco9i$createComponent)((0, $gco9i$Show), {
|
|
8226
7926
|
get when () {
|
|
@@ -8271,10 +7971,8 @@ function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
|
8271
7971
|
|
|
8272
7972
|
|
|
8273
7973
|
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
7974
|
const $f8c929beb82c512b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<b></b>`, 2), $f8c929beb82c512b$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="results-for"></div>`, 2);
|
|
8277
|
-
function $f8c929beb82c512b$export$9dd50d35b9d94fdf({ get_search_query_: get_search_query_
|
|
7975
|
+
function $f8c929beb82c512b$export$9dd50d35b9d94fdf({ get_search_query_: get_search_query_, i18n_: i18n_, formatted_number_of_results_: formatted_number_of_results_ }) {
|
|
8278
7976
|
const contents = (0, $gco9i$createMemo)((0, $gco9i$catchify)(()=>{
|
|
8279
7977
|
const q = get_search_query_();
|
|
8280
7978
|
return i18n_.get_showing_results_for_()((()=>{
|
|
@@ -8303,7 +8001,7 @@ function $f8c929beb82c512b$export$9dd50d35b9d94fdf({ get_search_query_: get_sear
|
|
|
8303
8001
|
|
|
8304
8002
|
|
|
8305
8003
|
|
|
8306
|
-
function $1801dbce7adb3f19$export$41b4894022a3580f({ style_props_: style_props_ = (0, $gco9i$createSignal)({})
|
|
8004
|
+
function $1801dbce7adb3f19$export$41b4894022a3580f({ style_props_: style_props_ = (0, $gco9i$createSignal)({}) } = {}) {
|
|
8307
8005
|
const [, set_style_props] = style_props_;
|
|
8308
8006
|
const supports_hover = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
|
|
8309
8007
|
const desktop_short = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
@@ -8323,7 +8021,7 @@ function $1801dbce7adb3f19$export$41b4894022a3580f({ style_props_: style_props_
|
|
|
8323
8021
|
|
|
8324
8022
|
|
|
8325
8023
|
const $7097477c78a89208$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="filter-results-for-one-row"><!#><!/><!#><!/></div>`, 6), $7097477c78a89208$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="depict plp search"><div class="listing-page"><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/></div><!#><!/><!#><!/></div>`, 20);
|
|
8326
|
-
function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_
|
|
8024
|
+
function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_, search_field_value_: search_field_value_, get_search_query_: get_search_query_, open_modal_: open_modal_, submit_query_: submit_query_, current_sorting_: current_sorting_, min_products_to_fetch_: min_products_to_fetch_, search_filters_open_: search_filters_open_, search_sorting_open_: search_sorting_open_, expanded_filters_: expanded_filters_, input_modal_open_: input_modal_open_, selected_filters_: selected_filters_, i18n_: i18n_, make_category_suggestion_card_: make_category_suggestion_card_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, clear_filters_on_next_submit_: clear_filters_on_next_submit_, local_filter_cache_: local_filter_cache_, include_input_field_: include_input_field_, tenant_: tenant_, market_: market_, showing_recommendation_rows_: showing_recommendation_rows_, search_recs_view_more_: search_recs_view_more_, disable_search_recommendations_: disable_search_recommendations_, layout_options_: layout_options_, recommendations_layout_options_: recommendations_layout_options_, scroll_restoration_data_: scroll_restoration_data_, product_card_template_: product_card_template_, modal_body_style_ref_: modal_body_style_ref_ }) {
|
|
8327
8025
|
const [get_sorting] = current_sorting_;
|
|
8328
8026
|
const all_products_loaded_ = (0, $gco9i$createSignal)(false);
|
|
8329
8027
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -8410,7 +8108,7 @@ function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
8410
8108
|
});
|
|
8411
8109
|
const results_filters = (0, $gco9i$createSignal)();
|
|
8412
8110
|
const owner = (0, $gco9i$getOwner)();
|
|
8413
|
-
(0, $gco9i$onCleanup)((0, $gco9i$javascript_media_query)("(max-width:600px)", async ({ matches: matches
|
|
8111
|
+
(0, $gco9i$onCleanup)((0, $gco9i$javascript_media_query)("(max-width:600px)", async ({ matches: matches })=>{
|
|
8414
8112
|
results_filters[1]();
|
|
8415
8113
|
await new Promise((r)=>queueMicrotask(r));
|
|
8416
8114
|
(0, $gco9i$runWithOwner)(owner, ()=>results_filters[1](matches ? [
|
|
@@ -8423,6 +8121,7 @@ function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
8423
8121
|
return _el$;
|
|
8424
8122
|
})()));
|
|
8425
8123
|
}).remove);
|
|
8124
|
+
(0, $2ab89d64b7f1d5ef$export$d31a1a1a83ad9413)(search_results_, selected_filters_);
|
|
8426
8125
|
(0, $gco9i$catchify)((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
8427
8126
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8428
8127
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
@@ -8648,7 +8347,6 @@ function $4ca91518c9a35379$export$828dcdd425fd3231(aligner) {
|
|
|
8648
8347
|
|
|
8649
8348
|
|
|
8650
8349
|
|
|
8651
|
-
|
|
8652
8350
|
const $806c97b931758897$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="depict plp search"></div>`, 2);
|
|
8653
8351
|
/**
|
|
8654
8352
|
* Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
@@ -8660,19 +8358,19 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
8660
8358
|
#merchant_signal = (0, $gco9i$createSignal)();
|
|
8661
8359
|
#market_signal = (0, $gco9i$createSignal)();
|
|
8662
8360
|
#modal_open_signal = (0, $gco9i$createSignal)(false);
|
|
8663
|
-
static #keys_constructed_with =
|
|
8361
|
+
static #keys_constructed_with = new Set();
|
|
8664
8362
|
#router = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation");
|
|
8665
|
-
constructor({ unique_instance_key_for_state: unique_instance_key_for_state = ""
|
|
8666
|
-
disable_scrolling_during_modal = true
|
|
8363
|
+
constructor({ unique_instance_key_for_state: unique_instance_key_for_state = "", search_query_url_param_name: search_query_url_param_name_ = "query" + unique_instance_key_for_state, url_transformer: url_transformer, on_navigation: on_navigation, enable_category_suggestions: enable_category_suggestions = true, page_url_creator: page_url_creator, disable_scrolling_during_modal: // Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
8364
|
+
disable_scrolling_during_modal = true, api: api, bottom_distance_under_modal: bottom_distance_under_modal, render_instant_card: render_instant_card, ...props_on_class }){
|
|
8667
8365
|
const owner = (0, $gco9i$getOwner)() || (0, $gco9i$createRoot)(()=>(0, $gco9i$getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
8668
8366
|
(0, $gco9i$runWithOwner)(owner, ()=>{
|
|
8669
|
-
if ($806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.
|
|
8367
|
+
if ($806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.has(unique_instance_key_for_state) && !(0, $gco9i$isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
8670
8368
|
throw new Error("You can only have one instance of DepictSearch with the same uniqueInstanceKeyForState");
|
|
8671
8369
|
Object.assign(this, props_on_class);
|
|
8672
8370
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
8673
8371
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
8674
|
-
const filter_query_param_prefix_ = "
|
|
8675
|
-
const { current_sorting_: current_sorting_
|
|
8372
|
+
const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
|
|
8373
|
+
const { current_sorting_: current_sorting_, selected_filters_: selected_filters_, search_query_accessor_: raw_search_query_accessor } = (0, $ccd5db07a3a069c5$export$477caf01aecaeb2a)({
|
|
8676
8374
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
8677
8375
|
router_: this.#router,
|
|
8678
8376
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -8744,7 +8442,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
8744
8442
|
});
|
|
8745
8443
|
(0, $90980bd87c9960f9$export$5162a71f252e6122)();
|
|
8746
8444
|
(0, $gco9i$catchify)(async ()=>{
|
|
8747
|
-
const { open_modal_: open_modal_
|
|
8445
|
+
const { open_modal_: open_modal_, close_modal_: close_modal_ } = await (0, $194bd6b8e4c59830$export$79b1565500412d9b)((...args)=>{
|
|
8748
8446
|
(0, $gco9i$onCleanup)(()=>this.modal_open = false);
|
|
8749
8447
|
return (0, $fabfda1230351b1a$export$1c593cbd6f1e10bc)(...args);
|
|
8750
8448
|
}, {
|
|
@@ -8780,7 +8478,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
8780
8478
|
close_modal_();
|
|
8781
8479
|
return;
|
|
8782
8480
|
}
|
|
8783
|
-
const { search_page_aligned_modal_body_style_signal_: search_page_aligned_modal_body_style_signal_
|
|
8481
|
+
const { search_page_aligned_modal_body_style_signal_: search_page_aligned_modal_body_style_signal_ } = $806c97b931758897$var$privately_shared_properties.get(this);
|
|
8784
8482
|
if (signal_value_is_options && open_signal_value[0]?.style_props_) {
|
|
8785
8483
|
// They know what they're doing, just call the modal with the provided options
|
|
8786
8484
|
open_modal_(...open_signal_value);
|
|
@@ -8817,7 +8515,8 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
8817
8515
|
};
|
|
8818
8516
|
(0, $gco9i$runWithOwner)(owner, ()=>(0, $gco9i$createEffect)(modal_opening_effect));
|
|
8819
8517
|
})();
|
|
8820
|
-
$806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.
|
|
8518
|
+
$806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.add(unique_instance_key_for_state);
|
|
8519
|
+
(0, $gco9i$onCleanup)(()=>$806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.delete(unique_instance_key_for_state));
|
|
8821
8520
|
});
|
|
8822
8521
|
}
|
|
8823
8522
|
get on_navigation() {
|
|
@@ -8853,7 +8552,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
8853
8552
|
this.#market_signal[1](market);
|
|
8854
8553
|
}
|
|
8855
8554
|
async fetchSearchResults(query, filters, maxResults = 48) {
|
|
8856
|
-
const { depict_api_: depict_api_
|
|
8555
|
+
const { depict_api_: depict_api_ } = $806c97b931758897$var$privately_shared_properties.get(this);
|
|
8857
8556
|
const result = await depict_api_.query({
|
|
8858
8557
|
tenant: this.merchant,
|
|
8859
8558
|
market: this.market,
|
|
@@ -8871,12 +8570,12 @@ function $806c97b931758897$var$get_shared_properties(depict_search) {
|
|
|
8871
8570
|
return shared_properties;
|
|
8872
8571
|
}
|
|
8873
8572
|
function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
8874
|
-
const { depict_search: depict_search
|
|
8573
|
+
const { depict_search: depict_search, product_card_template: product_card_template } = props;
|
|
8875
8574
|
const shared_properties = $806c97b931758897$var$get_shared_properties(depict_search);
|
|
8876
8575
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
8877
|
-
const { state_: state_
|
|
8576
|
+
const { state_: state_ } = shared_properties;
|
|
8878
8577
|
const grid_spacing_override = (0, $gco9i$createMemo)(()=>{
|
|
8879
|
-
const { grid_spacing: grid_spacing
|
|
8578
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
8880
8579
|
return typeof grid_spacing === "string" ? {
|
|
8881
8580
|
grid_spacing: grid_spacing
|
|
8882
8581
|
} : {
|
|
@@ -8934,7 +8633,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
|
8934
8633
|
...grid_spacing_override()
|
|
8935
8634
|
})),
|
|
8936
8635
|
recommendations_layout_options_: (0, $gco9i$createMemo)(()=>{
|
|
8937
|
-
const { extra_depict_options: extra_depict_options
|
|
8636
|
+
const { extra_depict_options: extra_depict_options } = props;
|
|
8938
8637
|
return extra_depict_options?.recommendations_cols_at_size ? {
|
|
8939
8638
|
cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
|
|
8940
8639
|
...grid_spacing_override()
|
|
@@ -8945,7 +8644,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
|
8945
8644
|
}, "Entire SearchPage failed");
|
|
8946
8645
|
}
|
|
8947
8646
|
function $806c97b931758897$export$316f6f283ae64765(props) {
|
|
8948
|
-
const { depict_search: depict_search
|
|
8647
|
+
const { depict_search: depict_search, modal_dispose_handler: modal_dispose_handler, click_handler: click_handler } = props;
|
|
8949
8648
|
const shared_properties = $806c97b931758897$var$get_shared_properties(depict_search);
|
|
8950
8649
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
8951
8650
|
let input_element;
|
|
@@ -8974,7 +8673,7 @@ function $806c97b931758897$export$316f6f283ae64765(props) {
|
|
|
8974
8673
|
input_element.selectionStart,
|
|
8975
8674
|
input_element.selectionEnd
|
|
8976
8675
|
];
|
|
8977
|
-
const { cleanup: cleanup
|
|
8676
|
+
const { cleanup: cleanup } = $806c97b931758897$var$align_field_modal(style_props_, search_field, ()=>props.aligner_ref);
|
|
8978
8677
|
const complete_modal_dispose_handler = ()=>{
|
|
8979
8678
|
modal_dispose_handler?.();
|
|
8980
8679
|
cleanup();
|
|
@@ -9010,7 +8709,7 @@ function $806c97b931758897$var$align_field_modal(style_props_, input, aligner_re
|
|
|
9010
8709
|
(0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, input);
|
|
9011
8710
|
return;
|
|
9012
8711
|
}
|
|
9013
|
-
const { cleanup: cleanup
|
|
8712
|
+
const { cleanup: cleanup } = (0, $4ca91518c9a35379$export$828dcdd425fd3231)(aligner_ref);
|
|
9014
8713
|
(0, $gco9i$onCleanup)(cleanup);
|
|
9015
8714
|
(0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
|
|
9016
8715
|
});
|
|
@@ -9026,7 +8725,7 @@ function $806c97b931758897$var$align_field_modal(style_props_, input, aligner_re
|
|
|
9026
8725
|
|
|
9027
8726
|
|
|
9028
8727
|
const $6891c018a834cfdd$export$d86a33413558014e = (openModalParams)=>{
|
|
9029
|
-
const { search: search
|
|
8728
|
+
const { search: search, makesNewSearch: makesNewSearch = true } = openModalParams;
|
|
9030
8729
|
openModalParams.location ||= "centered";
|
|
9031
8730
|
if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
|
|
9032
8731
|
if (openModalParams.location !== "aligned") {
|
|
@@ -9048,7 +8747,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = (openModalParams)=>{
|
|
|
9048
8747
|
];
|
|
9049
8748
|
return;
|
|
9050
8749
|
}
|
|
9051
|
-
const { cleanup: cleanup
|
|
8750
|
+
const { cleanup: cleanup } = (0, $4ca91518c9a35379$export$828dcdd425fd3231)(openModalParams.element);
|
|
9052
8751
|
let dispose_aligner;
|
|
9053
8752
|
/**
|
|
9054
8753
|
* Setting position to fixed is important to make the modal work with align_field.
|
|
@@ -9080,8 +8779,8 @@ const $6891c018a834cfdd$export$d86a33413558014e = (openModalParams)=>{
|
|
|
9080
8779
|
|
|
9081
8780
|
function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
9082
8781
|
const handler = (0, $gco9i$catchify)((e)=>{
|
|
9083
|
-
const { key: key
|
|
9084
|
-
const { body: body
|
|
8782
|
+
const { key: key, target: target } = e;
|
|
8783
|
+
const { body: body } = document;
|
|
9085
8784
|
if (key === "/" && (target === body || !body.contains(target))) {
|
|
9086
8785
|
open_search();
|
|
9087
8786
|
e.preventDefault();
|
|
@@ -9109,7 +8808,7 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
9109
8808
|
let resolve_remove_added_listeners;
|
|
9110
8809
|
pr.addEventListener("open", (0, $gco9i$catchify)(()=>{
|
|
9111
8810
|
remove_added_listeners = new Promise((r)=>resolve_remove_added_listeners = r);
|
|
9112
|
-
disconnect_link_observer = (0, $gco9i$observer).onexists("a", async ({ element: element
|
|
8811
|
+
disconnect_link_observer = (0, $gco9i$observer).onexists("a", async ({ element: element })=>{
|
|
9113
8812
|
element.addEventListener("click", link_handler);
|
|
9114
8813
|
await remove_added_listeners;
|
|
9115
8814
|
element.removeEventListener("click", link_handler);
|
|
@@ -9207,13 +8906,13 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
9207
8906
|
try_forever: true
|
|
9208
8907
|
});
|
|
9209
8908
|
const first_element_found = new Promise((r)=>{
|
|
9210
|
-
this.#disconnect_observer = (0, $gco9i$observer).onexists(this.selector_, ({ element: element
|
|
8909
|
+
this.#disconnect_observer = (0, $gco9i$observer).onexists(this.selector_, ({ element: element, disconnector: disconnector })=>{
|
|
9211
8910
|
r();
|
|
9212
8911
|
if (this.append_instead_of_replace_) {
|
|
9213
8912
|
disconnector();
|
|
9214
8913
|
return;
|
|
9215
8914
|
}
|
|
9216
|
-
const { style: style
|
|
8915
|
+
const { style: style } = element;
|
|
9217
8916
|
const old_display_value = style.display;
|
|
9218
8917
|
style.setProperty("display", "none", "important");
|
|
9219
8918
|
this.#revert_fns.push(()=>{
|
|
@@ -9222,7 +8921,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
9222
8921
|
});
|
|
9223
8922
|
});
|
|
9224
8923
|
await first_element_found;
|
|
9225
|
-
const { title: title
|
|
8924
|
+
const { title: title } = document;
|
|
9226
8925
|
if (this.title_) {
|
|
9227
8926
|
document.title = this.title_;
|
|
9228
8927
|
this.#revert_fns.push(()=>document.title = title);
|
|
@@ -9270,7 +8969,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
9270
8969
|
this.#unload();
|
|
9271
8970
|
this.#stop_listening?.();
|
|
9272
8971
|
}
|
|
9273
|
-
constructor({ is_spa_: is_spa_
|
|
8972
|
+
constructor({ is_spa_: is_spa_, ...options }){
|
|
9274
8973
|
super();
|
|
9275
8974
|
Object.assign(this, options);
|
|
9276
8975
|
this.#listen().catch((e)=>(0, $gco9i$report)([
|