@depict-ai/ui 1.4.2 → 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 +326 -629
- package/dist/client/module.js +327 -630
- package/dist/index.d.ts +8 -4
- package/dist/server/main.cjs +308 -445
- package/dist/server/module.js +309 -446
- package/package.json +4 -4
package/dist/server/main.cjs
CHANGED
|
@@ -49,9 +49,7 @@ $parcel$export(module.exports, "defaultGridSpacing", () => $a3280f0aad997933$exp
|
|
|
49
49
|
$parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$export$c3834fa86c616831);
|
|
50
50
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
51
51
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
52
|
-
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.4.
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.4.3";
|
|
55
53
|
|
|
56
54
|
|
|
57
55
|
|
|
@@ -61,11 +59,11 @@ $parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fb
|
|
|
61
59
|
|
|
62
60
|
|
|
63
61
|
function $4b455f60dadde8b8$export$5bad61ecde080b1f(...params) {
|
|
64
|
-
const { collapse: collapse
|
|
62
|
+
const { collapse: collapse, expand: expand, ExpandingContainer: ExpandingContainer } = (0, $diwD4$depictaiutilishared.useExpandingContainer)(...params);
|
|
65
63
|
return {
|
|
66
64
|
collapse: collapse,
|
|
67
65
|
expand: expand,
|
|
68
|
-
ExpandingContainer: ({ children: children
|
|
66
|
+
ExpandingContainer: ({ children: children })=>{
|
|
69
67
|
// get reactive signals/solid's jsx elements into `ExpandingContainer`
|
|
70
68
|
const fake_div = document.createElement("div");
|
|
71
69
|
const outer_expanding = (0, $diwD4$solidjsweb.createComponent)(ExpandingContainer, {
|
|
@@ -86,8 +84,8 @@ const $a69e505a12a77874$var$has_new_animate = /*@__PURE__*/ $a69e505a12a77874$ex
|
|
|
86
84
|
function $a69e505a12a77874$export$6c6d7a51fa9aa15d(props) {
|
|
87
85
|
let fresh_component = true;
|
|
88
86
|
let timeout_started = false;
|
|
89
|
-
const { details_: details_
|
|
90
|
-
const { expand: expand
|
|
87
|
+
const { details_: details_, summary_: summary_, children: children, duration_: duration_, delay_: delay_, dont_animate_if_instant_open_: dont_animate_if_instant_open_ = true } = props;
|
|
88
|
+
const { expand: expand, ExpandingContainer: ExpandingContainer, collapse: collapse } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
91
89
|
duration: duration_ ?? 250,
|
|
92
90
|
delay: delay_ ?? 0
|
|
93
91
|
});
|
|
@@ -120,7 +118,7 @@ function $a69e505a12a77874$export$6c6d7a51fa9aa15d(props) {
|
|
|
120
118
|
}
|
|
121
119
|
}));
|
|
122
120
|
details_.addEventListener("toggle", (0, $diwD4$depictaiutilishared.catchify)(()=>{
|
|
123
|
-
const { open: open
|
|
121
|
+
const { open: open } = details_;
|
|
124
122
|
if (open !== (0, $diwD4$solidjs.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
|
|
125
123
|
props.is_open_[1](open);
|
|
126
124
|
}) // in case someone somehow toggles it without us intercepting it at least follow suit
|
|
@@ -130,7 +128,7 @@ function $a69e505a12a77874$export$6c6d7a51fa9aa15d(props) {
|
|
|
130
128
|
toggle();
|
|
131
129
|
}));
|
|
132
130
|
summary_.addEventListener("keydown", (0, $diwD4$depictaiutilishared.catchify)((ev)=>{
|
|
133
|
-
const { key: key
|
|
131
|
+
const { key: key } = ev;
|
|
134
132
|
if (key === "Enter" || key === " ") {
|
|
135
133
|
ev.preventDefault();
|
|
136
134
|
toggle();
|
|
@@ -170,9 +168,6 @@ function $0785f4c9947d9b5f$export$f091cbac892643a4(obj) {
|
|
|
170
168
|
|
|
171
169
|
|
|
172
170
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
171
|
function $d659702496cb72ea$export$a71e92cfbb498adc(props) {
|
|
177
172
|
return (0, $diwD4$solidjs.createMemo)(()=>{
|
|
178
173
|
const price_formatting = props.price_formatting_;
|
|
@@ -186,13 +181,6 @@ function $d659702496cb72ea$export$a71e92cfbb498adc(props) {
|
|
|
186
181
|
|
|
187
182
|
|
|
188
183
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
184
|
const $0f313083912e447a$var$_tmpl$ = [
|
|
197
185
|
"<svg",
|
|
198
186
|
' xmlns="http://www.w3.org/2000/svg"',
|
|
@@ -208,7 +196,7 @@ const $a0e53f99354809d9$var$_tmpl$ = [
|
|
|
208
196
|
">",
|
|
209
197
|
"</div>"
|
|
210
198
|
];
|
|
211
|
-
function $a0e53f99354809d9$export$6649caad96ef8870({ children: children
|
|
199
|
+
function $a0e53f99354809d9$export$6649caad96ef8870({ children: children, slider_ref_: slider_ref_, faded_opacity_: faded_opacity_ = 0.7, mutation_plugins_: mutation_plugins_ = [] }) {
|
|
212
200
|
const slider = new (0, $diwD4$depictaiutilishared.Amazing_Slider)({
|
|
213
201
|
button_contents: {
|
|
214
202
|
left: [
|
|
@@ -237,7 +225,6 @@ function $a0e53f99354809d9$export$6649caad96ef8870({ children: children , slider
|
|
|
237
225
|
|
|
238
226
|
|
|
239
227
|
|
|
240
|
-
|
|
241
228
|
const $c77c68e559a1506c$var$_tmpl$ = '<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>';
|
|
242
229
|
function $c77c68e559a1506c$export$3b621d86b1566b2(props = {}) {
|
|
243
230
|
return (0, $diwD4$solidjsweb.ssrElement)("svg", ()=>({
|
|
@@ -275,10 +262,10 @@ const $235a2771a44e28e9$var$_tmpl$ = [
|
|
|
275
262
|
"<!--/--><span>",
|
|
276
263
|
"</span></button>"
|
|
277
264
|
];
|
|
278
|
-
function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_
|
|
279
|
-
const { price_formatting_: price_formatting_
|
|
265
|
+
function $235a2771a44e28e9$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_ }) {
|
|
266
|
+
const { price_formatting_: price_formatting_ } = i18n_;
|
|
280
267
|
const [read_selected_filters, write_selected_filters] = selected_filters_;
|
|
281
|
-
const { collapse: collapse
|
|
268
|
+
const { collapse: collapse, expand: expand, ExpandingContainer: ExpandingContainer } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
282
269
|
duration: 200
|
|
283
270
|
});
|
|
284
271
|
const owner = (0, $diwD4$solidjs.getOwner)();
|
|
@@ -302,7 +289,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
302
289
|
const matching_filter = (0, $diwD4$solidjs.createMemo)(()=>read_local_filter_cache().find((hay)=>hay.field === filter().field && hay.op === filter().op));
|
|
303
290
|
const meta = (0, $diwD4$solidjs.createMemo)(()=>matching_filter()?.meta);
|
|
304
291
|
const iterable_selected_filter_data = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
305
|
-
const { data: data
|
|
292
|
+
const { data: data } = filter();
|
|
306
293
|
if (Array.isArray(data)) return data;
|
|
307
294
|
else return [
|
|
308
295
|
data
|
|
@@ -311,7 +298,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
311
298
|
const data_structure_if_hierarchical = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
312
299
|
const m = meta();
|
|
313
300
|
if (m?.type !== "checkbox-hierarchical") return;
|
|
314
|
-
const { values: values
|
|
301
|
+
const { values: values } = m;
|
|
315
302
|
const data_structure = {};
|
|
316
303
|
for(let i = 0; i < values.length; i++){
|
|
317
304
|
const value = values[i];
|
|
@@ -416,7 +403,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
416
403
|
if (siblings) return [
|
|
417
404
|
parent,
|
|
418
405
|
...Object.values(siblings)
|
|
419
|
-
].every(({ value_: value_
|
|
406
|
+
].every(({ value_: value_ })=>iterable_selected_filter_data()?.some((v)=>Array.isArray(v) && v.length === value_.length && value_.every((val, index)=>v[index] === val)));
|
|
420
407
|
return false;
|
|
421
408
|
});
|
|
422
409
|
return (0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
@@ -470,16 +457,6 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
470
457
|
|
|
471
458
|
|
|
472
459
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
460
|
const $b3cf6ca8dc0e9998$var$_tmpl$ = [
|
|
484
461
|
"<span",
|
|
485
462
|
' class="count">',
|
|
@@ -516,10 +493,6 @@ const $b3cf6ca8dc0e9998$export$48513f6b9f8ce62d = (props)=>{
|
|
|
516
493
|
|
|
517
494
|
|
|
518
495
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
496
|
const $cc43b6428000c4bf$var$_tmpl$ = '<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>';
|
|
524
497
|
function $cc43b6428000c4bf$export$f21ab0717a89c77f(props) {
|
|
525
498
|
return (0, $diwD4$solidjsweb.ssrElement)("svg", ()=>({
|
|
@@ -538,7 +511,7 @@ const $0fe1e7efdf4200d6$var$_tmpl$ = [
|
|
|
538
511
|
"<!--/--><span>",
|
|
539
512
|
"</span></button>"
|
|
540
513
|
];
|
|
541
|
-
function $0fe1e7efdf4200d6$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras]
|
|
514
|
+
function $0fe1e7efdf4200d6$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras], i18n_: i18n_ }) {
|
|
542
515
|
return (0, $diwD4$solidjsweb.ssr)($0fe1e7efdf4200d6$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), `expand-filter ${get_show_extras() ? "expanded" : ""}`, (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $cc43b6428000c4bf$export$f21ab0717a89c77f), {})), get_show_extras() ? (0, $diwD4$solidjsweb.escape)(i18n_.view_less_()) : (0, $diwD4$solidjsweb.escape)(i18n_.view_more_()));
|
|
543
516
|
}
|
|
544
517
|
|
|
@@ -551,10 +524,10 @@ const $d94869c80e337a3d$var$_tmpl$ = [
|
|
|
551
524
|
];
|
|
552
525
|
const $d94869c80e337a3d$var$max_visible_without_collapsing = 7;
|
|
553
526
|
const $d94869c80e337a3d$var$show_non_collapsible_when_collapsed = 4;
|
|
554
|
-
function $d94869c80e337a3d$export$dd948f91abc3a1c4({ filter_: filter_
|
|
527
|
+
function $d94869c80e337a3d$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_] }) {
|
|
555
528
|
const existing_filter = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
556
|
-
const { field: field
|
|
557
|
-
return get_selected_filters().find(({ field: checking_field
|
|
529
|
+
const { field: field, op: op } = filter_();
|
|
530
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
558
531
|
});
|
|
559
532
|
let form;
|
|
560
533
|
const checkboxes = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
@@ -585,7 +558,7 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
585
558
|
const show_extras_signal = (0, $diwD4$solidjs.createSignal)(false);
|
|
586
559
|
const [get_show_extras] = show_extras_signal;
|
|
587
560
|
const togglable_rest = (0, $diwD4$solidjs.createMemo)(()=>checkboxes().length > $d94869c80e337a3d$var$max_visible_without_collapsing);
|
|
588
|
-
const { expand: expand
|
|
561
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
589
562
|
duration: 200
|
|
590
563
|
});
|
|
591
564
|
const expanding_container_els = (0, $diwD4$solidjsweb.createComponent)(ExpandingContainer, {
|
|
@@ -631,10 +604,6 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
631
604
|
|
|
632
605
|
|
|
633
606
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
607
|
const $c1dc1554c1b94233$var$_tmpl$ = [
|
|
639
608
|
"<form",
|
|
640
609
|
' class="radios">',
|
|
@@ -653,11 +622,11 @@ const $c1dc1554c1b94233$var$_tmpl$ = [
|
|
|
653
622
|
"<!--/--></div><!--#-->",
|
|
654
623
|
"<!--/--></label>"
|
|
655
624
|
];
|
|
656
|
-
function $c1dc1554c1b94233$export$430444115f70a734({ selected_filters_: selected_filters_
|
|
625
|
+
function $c1dc1554c1b94233$export$430444115f70a734({ selected_filters_: selected_filters_, filter_: filter_ }) {
|
|
657
626
|
const radio_name = (0, $diwD4$depictaiutilishared.make_random_classname)();
|
|
658
627
|
const existing_filter = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
659
|
-
const { op: op
|
|
660
|
-
return selected_filters_[0]().find(({ field: checking_field
|
|
628
|
+
const { op: op, field: field } = filter_();
|
|
629
|
+
return selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
661
630
|
});
|
|
662
631
|
return (0, $diwD4$solidjsweb.ssr)($c1dc1554c1b94233$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Index), {
|
|
663
632
|
get each () {
|
|
@@ -693,11 +662,6 @@ function $c1dc1554c1b94233$export$430444115f70a734({ selected_filters_: selected
|
|
|
693
662
|
|
|
694
663
|
|
|
695
664
|
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
665
|
const $0b7222ba8a8bb72f$var$_tmpl$ = [
|
|
702
666
|
"<div",
|
|
703
667
|
' class="range"><div class="input-group"><div class="field"><input type="number"',
|
|
@@ -722,9 +686,9 @@ const $0b7222ba8a8bb72f$var$_tmpl$ = [
|
|
|
722
686
|
' type="range"',
|
|
723
687
|
' step="any"></div>'
|
|
724
688
|
];
|
|
725
|
-
function $0b7222ba8a8bb72f$export$e0d834a0ad870cda({ filter_: filter_
|
|
689
|
+
function $0b7222ba8a8bb72f$export$e0d834a0ad870cda({ filter_: filter_, selected_filters_: selected_filters_, i18n_: i18n_ }) {
|
|
726
690
|
const current_range = (0, $diwD4$solidjs.createSignal)((0, $diwD4$solidjs.untrack)(()=>filter_().data));
|
|
727
|
-
const selected_filter = (0, $diwD4$solidjs.createMemo)(()=>selected_filters_[0]().find(({ field: checking_field
|
|
691
|
+
const selected_filter = (0, $diwD4$solidjs.createMemo)(()=>selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === filter_().field && checking_op === filter_().op));
|
|
728
692
|
let debounce_timeout;
|
|
729
693
|
(0, $diwD4$solidjs.onCleanup)(()=>clearTimeout(debounce_timeout));
|
|
730
694
|
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
@@ -775,7 +739,7 @@ function $0b7222ba8a8bb72f$export$e0d834a0ad870cda({ filter_: filter_ , selected
|
|
|
775
739
|
}
|
|
776
740
|
});
|
|
777
741
|
}
|
|
778
|
-
function $0b7222ba8a8bb72f$var$RangeSelector({ max_: max_
|
|
742
|
+
function $0b7222ba8a8bb72f$var$RangeSelector({ max_: max_, min_: min_, current_range_: current_range_, price_formatting_: price_formatting_, i18n_: i18n_ }) {
|
|
779
743
|
let price_input_1;
|
|
780
744
|
let price_input_2;
|
|
781
745
|
const [get_current_range] = current_range_;
|
|
@@ -802,7 +766,7 @@ function $0b7222ba8a8bb72f$var$RangeSelector({ max_: max_ , min_: min_ , current
|
|
|
802
766
|
}
|
|
803
767
|
})), (0, $diwD4$solidjsweb.escape)(post_price()));
|
|
804
768
|
}
|
|
805
|
-
function $0b7222ba8a8bb72f$var$ExponentialSlider({ current_range_: current_range_
|
|
769
|
+
function $0b7222ba8a8bb72f$var$ExponentialSlider({ current_range_: current_range_, min_: min_, i18n_: i18n_, max_: max_ }) {
|
|
806
770
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
807
771
|
const transform_linear_to_nonlinear = ([smaller, larger])=>[
|
|
808
772
|
Math.sqrt(smaller),
|
|
@@ -840,7 +804,7 @@ function $0b7222ba8a8bb72f$var$ExponentialSlider({ current_range_: current_range
|
|
|
840
804
|
i18n_: i18n_
|
|
841
805
|
});
|
|
842
806
|
}
|
|
843
|
-
function $0b7222ba8a8bb72f$var$LinearSlider({ max_: max_
|
|
807
|
+
function $0b7222ba8a8bb72f$var$LinearSlider({ max_: max_, min_: min_, current_range_: current_range_, offset_value_calculator_: offset_value_calculator_, i18n_: i18n_ }) {
|
|
844
808
|
let range_input_1;
|
|
845
809
|
let range_input_2;
|
|
846
810
|
let clickable_slider;
|
|
@@ -896,18 +860,12 @@ function $0b7222ba8a8bb72f$var$set_range_with_sanitation(min_, max_, current_ran
|
|
|
896
860
|
|
|
897
861
|
|
|
898
862
|
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
863
|
const $7567511a7c3e4bd7$var$_tmpl$ = [
|
|
906
864
|
"<div",
|
|
907
865
|
' class="morphing-sign" role="img"',
|
|
908
866
|
"><span></span><span></span></div>"
|
|
909
867
|
];
|
|
910
|
-
function $7567511a7c3e4bd7$export$e5c2828934226505({ expanded_: expanded_
|
|
868
|
+
function $7567511a7c3e4bd7$export$e5c2828934226505({ expanded_: expanded_, i18n_: i18n_ }) {
|
|
911
869
|
let first_span;
|
|
912
870
|
let second_span;
|
|
913
871
|
const animation_options = {
|
|
@@ -971,11 +929,11 @@ const $3bdc00a1353c1150$var$_tmpl$ = [
|
|
|
971
929
|
];
|
|
972
930
|
const $3bdc00a1353c1150$var$max_visible_without_collapsing = 7;
|
|
973
931
|
const $3bdc00a1353c1150$var$show_non_collapsible_when_collapsed = 4;
|
|
974
|
-
function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_
|
|
932
|
+
function $3bdc00a1353c1150$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_ }) {
|
|
975
933
|
let form;
|
|
976
934
|
const existing_filter = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
977
|
-
const { field: field
|
|
978
|
-
return selected_filters_[0]().find(({ field: checking_field
|
|
935
|
+
const { field: field, op: op } = filter_();
|
|
936
|
+
return selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
979
937
|
});
|
|
980
938
|
const show_extras = (0, $diwD4$solidjs.createSignal)(false);
|
|
981
939
|
const trigger_sync_ = $3bdc00a1353c1150$var$batching_filter_state_syncer({
|
|
@@ -988,7 +946,7 @@ function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
988
946
|
});
|
|
989
947
|
const structured_categories = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
990
948
|
const execute_when_structure_finished = [];
|
|
991
|
-
const { values: values
|
|
949
|
+
const { values: values, names: names, counts: counts } = filter_().meta;
|
|
992
950
|
const data_structure = {};
|
|
993
951
|
for(let i = 0; i < values.length; i++){
|
|
994
952
|
const value = values[i];
|
|
@@ -1010,7 +968,7 @@ function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
1010
968
|
value_: value_as_string,
|
|
1011
969
|
children_: {}
|
|
1012
970
|
};
|
|
1013
|
-
const { signal_: signal_
|
|
971
|
+
const { signal_: signal_, on_structure_complete_: on_structure_complete_ } = $3bdc00a1353c1150$var$create_updating_signal({
|
|
1014
972
|
self_: created_obj,
|
|
1015
973
|
existing_filter_: (0, $diwD4$solidjs.untrack)(existing_filter),
|
|
1016
974
|
trigger_sync_: trigger_sync_
|
|
@@ -1053,7 +1011,7 @@ function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
1053
1011
|
return data_structure;
|
|
1054
1012
|
});
|
|
1055
1013
|
const some_top_level_are_hidden = (0, $diwD4$solidjs.createMemo)(()=>Object.keys(structured_categories()).length > $3bdc00a1353c1150$var$max_visible_without_collapsing);
|
|
1056
|
-
const { expand: expand
|
|
1014
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
1057
1015
|
duration: 200
|
|
1058
1016
|
});
|
|
1059
1017
|
const expanding_container_els = (0, $diwD4$solidjsweb.createComponent)(ExpandingContainer, {
|
|
@@ -1117,7 +1075,7 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1117
1075
|
},
|
|
1118
1076
|
input_ref_: (input)=>{
|
|
1119
1077
|
input.addEventListener("change", (0, $diwD4$depictaiutilishared.catchify)(()=>(0, $diwD4$solidjs.untrack)(()=>{
|
|
1120
|
-
const { checked: checked
|
|
1078
|
+
const { checked: checked } = input;
|
|
1121
1079
|
if (checked) value()?.is_expanded_.set_user_expanded_(true);
|
|
1122
1080
|
value()?.is_checked_[1](checked);
|
|
1123
1081
|
})));
|
|
@@ -1158,7 +1116,7 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1158
1116
|
const v = value();
|
|
1159
1117
|
if (!v) // only to prevent cleanup errors
|
|
1160
1118
|
return (0, $diwD4$solidjs.createSignal)(false);
|
|
1161
|
-
const { is_expanded_: { ui_should_show_expanded_: ui_should_show_expanded_
|
|
1119
|
+
const { is_expanded_: { ui_should_show_expanded_: ui_should_show_expanded_, set_user_expanded_: set_user_expanded_ } } = v;
|
|
1162
1120
|
return [
|
|
1163
1121
|
ui_should_show_expanded_,
|
|
1164
1122
|
set_user_expanded_
|
|
@@ -1177,13 +1135,13 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1177
1135
|
});
|
|
1178
1136
|
}
|
|
1179
1137
|
function $3bdc00a1353c1150$var$batching_filter_state_syncer(props) {
|
|
1180
|
-
const { filter_: filter_
|
|
1138
|
+
const { filter_: filter_, selected_filters_: selected_filters_, existing_filter_: existing_filter_ } = props;
|
|
1181
1139
|
let sync_queued = false;
|
|
1182
1140
|
const sync_fn = (0, $diwD4$depictaiutilishared.catchify)(async ()=>{
|
|
1183
1141
|
sync_queued = false;
|
|
1184
1142
|
// if we change, update filter state - next microtask, so that "reactions" to the change can process before we send it off to the API
|
|
1185
1143
|
const set_filter = existing_filter_();
|
|
1186
|
-
const { field: field
|
|
1144
|
+
const { field: field, op: op } = filter_();
|
|
1187
1145
|
const base_object = set_filter ? set_filter : {
|
|
1188
1146
|
op: op,
|
|
1189
1147
|
field: field
|
|
@@ -1216,7 +1174,7 @@ function $3bdc00a1353c1150$var$batching_filter_state_syncer(props) {
|
|
|
1216
1174
|
};
|
|
1217
1175
|
return trigger_sync;
|
|
1218
1176
|
}
|
|
1219
|
-
function $3bdc00a1353c1150$var$create_updating_signal({ self_: self_
|
|
1177
|
+
function $3bdc00a1353c1150$var$create_updating_signal({ self_: self_, existing_filter_: existing_filter_, trigger_sync_: trigger_sync_ }) {
|
|
1220
1178
|
const signal_ = [];
|
|
1221
1179
|
const on_structure_complete_ = ()=>{
|
|
1222
1180
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
@@ -1225,7 +1183,7 @@ function $3bdc00a1353c1150$var$create_updating_signal({ self_: self_ , existing_
|
|
|
1225
1183
|
signal_.push(...(0, $diwD4$solidjs.createSignal)(index_of_us_in_selected_filter >= 0 ? true : false));
|
|
1226
1184
|
const [read_checked, write_checked] = signal_;
|
|
1227
1185
|
const child_objects = Object.values(self_.children_);
|
|
1228
|
-
const get_child_object_values = child_objects.map(({ is_checked_: [read_is_checked]
|
|
1186
|
+
const get_child_object_values = child_objects.map(({ is_checked_: [read_is_checked] })=>read_is_checked);
|
|
1229
1187
|
(0, $diwD4$solidjs.createComputed)((0, $diwD4$solidjs.on)(read_checked, trigger_sync_, {
|
|
1230
1188
|
defer: true
|
|
1231
1189
|
}));
|
|
@@ -1260,8 +1218,8 @@ function $3bdc00a1353c1150$var$create_updating_signal({ self_: self_ , existing_
|
|
|
1260
1218
|
on_structure_complete_: on_structure_complete_
|
|
1261
1219
|
};
|
|
1262
1220
|
}
|
|
1263
|
-
function $3bdc00a1353c1150$var$make_expanded_signal({ expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters]
|
|
1264
|
-
const index_in_expanded_filters = (0, $diwD4$solidjs.createMemo)(()=>read_expanded_hierarchical_filters().findIndex(({ value_: value_
|
|
1221
|
+
function $3bdc00a1353c1150$var$make_expanded_signal({ expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters], filter_value_: filter_value_ }) {
|
|
1222
|
+
const index_in_expanded_filters = (0, $diwD4$solidjs.createMemo)(()=>read_expanded_hierarchical_filters().findIndex(({ value_: value_ })=>value_.length === filter_value_.length && value_.every((item, index)=>filter_value_[index] === item)), undefined, {
|
|
1265
1223
|
equals: false
|
|
1266
1224
|
} // we always want this to update so that we can make updates of the object on this index depend on this memo
|
|
1267
1225
|
);
|
|
@@ -1325,9 +1283,6 @@ function $3bdc00a1353c1150$var$expand_until_choice(data_structure) {
|
|
|
1325
1283
|
|
|
1326
1284
|
|
|
1327
1285
|
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
1286
|
const $0ef1681699140f1a$var$_tmpl$ = [
|
|
1332
1287
|
"<div",
|
|
1333
1288
|
' class="checkbox-grid">',
|
|
@@ -1338,10 +1293,10 @@ const $0ef1681699140f1a$var$_tmpl$ = [
|
|
|
1338
1293
|
'">',
|
|
1339
1294
|
"</button>"
|
|
1340
1295
|
];
|
|
1341
|
-
const $0ef1681699140f1a$export$414f6a19d38e655c = ({ filter_: filter_
|
|
1296
|
+
const $0ef1681699140f1a$export$414f6a19d38e655c = ({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters] })=>{
|
|
1342
1297
|
const existing_filter = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
1343
|
-
const { field: field
|
|
1344
|
-
return get_selected_filters().find(({ field: checking_field
|
|
1298
|
+
const { field: field, op: op } = filter_();
|
|
1299
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1345
1300
|
});
|
|
1346
1301
|
const buttons = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
1347
1302
|
const meta = filter_().meta;
|
|
@@ -1371,12 +1326,9 @@ const $0ef1681699140f1a$export$414f6a19d38e655c = ({ filter_: filter_ , selected
|
|
|
1371
1326
|
|
|
1372
1327
|
|
|
1373
1328
|
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
1329
|
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
1378
1330
|
const signal = (0, $diwD4$solidjs.createSignal)(false);
|
|
1379
|
-
(0, $diwD4$solidjs.onCleanup)((0, $diwD4$depictaiutilishared.javascript_media_query)(media_query, ({ matches: matches
|
|
1331
|
+
(0, $diwD4$solidjs.onCleanup)((0, $diwD4$depictaiutilishared.javascript_media_query)(media_query, ({ matches: matches })=>signal[1](matches)).remove);
|
|
1380
1332
|
return signal[0];
|
|
1381
1333
|
}
|
|
1382
1334
|
|
|
@@ -1389,27 +1341,29 @@ const $b51a2b8b9355e66c$var$_tmpl$ = [
|
|
|
1389
1341
|
];
|
|
1390
1342
|
const $b51a2b8b9355e66c$var$max_visible_without_collapsing = 14;
|
|
1391
1343
|
const $b51a2b8b9355e66c$var$show_non_collapsible_when_collapsed = 8;
|
|
1392
|
-
function $b51a2b8b9355e66c$export$82ed4b28ecb67608({ filter_: filter_
|
|
1344
|
+
function $b51a2b8b9355e66c$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_] }) {
|
|
1393
1345
|
const supports_hover = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("not all and (hover: none)");
|
|
1394
1346
|
// same as in CheckboxFilter, maybe we should make this DRY at some point
|
|
1395
1347
|
const existing_filter = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
1396
|
-
const { field: field
|
|
1397
|
-
return get_selected_filters().find(({ field: checking_field
|
|
1348
|
+
const { field: field, op: op } = filter_();
|
|
1349
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1398
1350
|
});
|
|
1399
1351
|
let form;
|
|
1400
1352
|
const checkboxes = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
1401
1353
|
const meta = filter_().meta;
|
|
1402
|
-
return meta.values.map((value_, index)
|
|
1403
|
-
|
|
1354
|
+
return meta.values.map((value_, index)=>{
|
|
1355
|
+
return {
|
|
1404
1356
|
value_: value_,
|
|
1405
1357
|
name_: meta.names?.[index],
|
|
1406
|
-
count_: meta.counts?.[index]
|
|
1407
|
-
|
|
1408
|
-
|
|
1358
|
+
count_: meta.counts?.[index]
|
|
1359
|
+
};
|
|
1360
|
+
});
|
|
1409
1361
|
});
|
|
1410
1362
|
const render_checkbox = (checkbox)=>{
|
|
1411
|
-
|
|
1412
|
-
const
|
|
1363
|
+
const color_name = (0, $diwD4$solidjs.createMemo)(()=>checkbox().value_.split(";")?.[0] || "");
|
|
1364
|
+
const hex_color = (0, $diwD4$solidjs.createMemo)(()=>checkbox().value_.split(";")?.[1] || "");
|
|
1365
|
+
const rgb_color = (0, $diwD4$solidjs.createMemo)(()=>(0, $diwD4$depictaiutilishared.hex_to_rgb)(hex_color()));
|
|
1366
|
+
const black_contrast_better = (0, $diwD4$solidjs.createMemo)(()=>rgb_color() ? $b51a2b8b9355e66c$var$does_black_contrast_better(rgb_color()) : true);
|
|
1413
1367
|
const input_row = (0, $diwD4$solidjsweb.createComponent)((0, $b3cf6ca8dc0e9998$export$48513f6b9f8ce62d), {
|
|
1414
1368
|
get value_ () {
|
|
1415
1369
|
return checkbox().value_;
|
|
@@ -1424,51 +1378,22 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
1424
1378
|
return existing_filter()?.data?.includes(checkbox().value_);
|
|
1425
1379
|
},
|
|
1426
1380
|
custom_indicator_ref: (span)=>{
|
|
1427
|
-
const { classList: classList
|
|
1428
|
-
// create some memos for diffing
|
|
1429
|
-
const hue = (0, $diwD4$solidjs.createMemo)(()=>checkbox().color_[0]);
|
|
1430
|
-
const saturation = (0, $diwD4$solidjs.createMemo)(()=>checkbox().color_[1]);
|
|
1431
|
-
const lightness = (0, $diwD4$solidjs.createMemo)(()=>checkbox().color_[2]);
|
|
1432
|
-
const special_type = (0, $diwD4$solidjs.createMemo)(()=>checkbox().color_[3]);
|
|
1381
|
+
const { classList: classList, style: style } = span;
|
|
1433
1382
|
classList.add("color");
|
|
1434
1383
|
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
// to generate darkened gradient, this was used:
|
|
1439
|
-
// $change: -5%;
|
|
1440
|
-
// background: linear-gradient(
|
|
1441
|
-
// 180deg,
|
|
1442
|
-
// color.adjust(#ff0000, $lightness: $change) 0%,
|
|
1443
|
-
// color.adjust(#ff6e00, $lightness: $change) 17.71%,
|
|
1444
|
-
// color.adjust(#ffff00, $lightness: $change) 33.33%,
|
|
1445
|
-
// color.adjust(#1eb41e, $lightness: $change) 50.52%,
|
|
1446
|
-
// color.adjust(#00d2ff, $lightness: $change) 67.71%,
|
|
1447
|
-
// color.adjust(#3737c8, $lightness: $change) 83.85%,
|
|
1448
|
-
// color.adjust(#d200ff, $lightness: $change) 100%
|
|
1449
|
-
// );
|
|
1450
|
-
classList.toggle("check-multi", true);
|
|
1451
|
-
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%)`;
|
|
1452
|
-
} else {
|
|
1453
|
-
const is_light = lightness() > 50;
|
|
1454
|
-
// lighten or darken (+/- 10) depending on it's over or under 50 lightness
|
|
1455
|
-
// lighten under 25 lightness by 20
|
|
1456
|
-
const target_lightness = is_hovered ? is_light ? lightness() - 10 : lightness() < 25 ? lightness() + 20 : lightness() + 10 : lightness();
|
|
1457
|
-
classList.toggle("check-dark", $b51a2b8b9355e66c$var$black_contrast_better(hue(), saturation(), lightness())); // Decide between black/white checkmark based on which one has better contrast according to WCAG contrast guidelines
|
|
1458
|
-
style.backgroundColor = `hsl(${hue()}, ${saturation()}%, ${target_lightness}%)`;
|
|
1459
|
-
}
|
|
1384
|
+
style.background = hex_color();
|
|
1385
|
+
span.dataset.colorName = color_name();
|
|
1386
|
+
classList.toggle("black-check", black_contrast_better());
|
|
1460
1387
|
});
|
|
1461
1388
|
}
|
|
1462
1389
|
});
|
|
1463
|
-
input_row.addEventListener("mouseover", (0, $diwD4$depictaiutilishared.catchify)(()=>set_is_hovered(true)));
|
|
1464
|
-
input_row.addEventListener("mouseout", (0, $diwD4$depictaiutilishared.catchify)(()=>set_is_hovered(false)));
|
|
1465
1390
|
return input_row;
|
|
1466
1391
|
};
|
|
1467
1392
|
const show_extras_signal = (0, $diwD4$solidjs.createSignal)(false);
|
|
1468
1393
|
const [get_show_extras] = show_extras_signal;
|
|
1469
1394
|
const togglable_rest = (0, $diwD4$solidjs.createMemo)(()=>checkboxes().length > $b51a2b8b9355e66c$var$max_visible_without_collapsing);
|
|
1470
1395
|
const expand_animation_duration = 200;
|
|
1471
|
-
const { expand: expand
|
|
1396
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
1472
1397
|
duration: expand_animation_duration
|
|
1473
1398
|
});
|
|
1474
1399
|
const [get_having_expanding_in_dom, set_having_expanding_in_dom] = (0, $diwD4$solidjs.createSignal)((0, $diwD4$solidjs.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
|
|
@@ -1524,9 +1449,9 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
1524
1449
|
children: expanding_container_els
|
|
1525
1450
|
})));
|
|
1526
1451
|
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
const luminance_color = (0, $diwD4$depictaiutilishared.relative_luminance_from_rgb)(...
|
|
1452
|
+
// Daniel's magic https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7648#note_1468373350
|
|
1453
|
+
function $b51a2b8b9355e66c$var$does_black_contrast_better(rgb) {
|
|
1454
|
+
const luminance_color = (0, $diwD4$depictaiutilishared.relative_luminance_from_rgb)(...rgb);
|
|
1530
1455
|
const luminance_white = 1;
|
|
1531
1456
|
const luminance_black = 0;
|
|
1532
1457
|
const contrast_ratio_if_white = (luminance_white + 0.05) / (luminance_color + 0.05);
|
|
@@ -1551,10 +1476,6 @@ var $a636ca15e3d3570d$export$2e2bcd8739ae039 = {
|
|
|
1551
1476
|
|
|
1552
1477
|
|
|
1553
1478
|
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
1479
|
const $0f4656eaf6c22d1d$var$_tmpl$ = '<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>';
|
|
1559
1480
|
function $0f4656eaf6c22d1d$export$f2ca6fc699ca1fb4(props = {}) {
|
|
1560
1481
|
return (0, $diwD4$solidjsweb.ssrElement)("svg", ()=>({
|
|
@@ -1572,17 +1493,17 @@ const $b064919833b3e80b$var$_tmpl$ = [
|
|
|
1572
1493
|
"</span><!--#-->",
|
|
1573
1494
|
"<!--/--></span>"
|
|
1574
1495
|
];
|
|
1575
|
-
function $b064919833b3e80b$export$53c59af873b303c9({ selected_filters_in_group_: selected_filters_in_group_
|
|
1496
|
+
function $b064919833b3e80b$export$53c59af873b303c9({ selected_filters_in_group_: selected_filters_in_group_, i18n_: { price_formatting_: price_formatting_ } }) {
|
|
1576
1497
|
const [show_tick_icon, set_show_tick_icon] = (0, $diwD4$solidjs.createSignal)(false);
|
|
1577
1498
|
const text = (0, $diwD4$solidjs.createMemo)(()=>(0, $diwD4$solidjs.batch)(()=>{
|
|
1578
1499
|
set_show_tick_icon(false);
|
|
1579
|
-
let { size: size
|
|
1500
|
+
let { size: size } = selected_filters_in_group_();
|
|
1580
1501
|
try_specific: {
|
|
1581
1502
|
if (size > 1) break try_specific;
|
|
1582
1503
|
for (const [selected_filter, filter_data] of selected_filters_in_group_()){
|
|
1583
1504
|
// we're intentionally not looping in this statement since we always just want to show the first thing in the filter group
|
|
1584
|
-
const { meta: meta
|
|
1585
|
-
const { type: type
|
|
1505
|
+
const { meta: meta } = filter_data;
|
|
1506
|
+
const { type: type } = meta;
|
|
1586
1507
|
if (type === "range") return [
|
|
1587
1508
|
price_formatting_().pre_,
|
|
1588
1509
|
(0, $diwD4$solidjsweb.createComponent)((0, $d659702496cb72ea$export$a71e92cfbb498adc), {
|
|
@@ -1607,7 +1528,7 @@ function $b064919833b3e80b$export$53c59af873b303c9({ selected_filters_in_group_:
|
|
|
1607
1528
|
price_formatting_().post_
|
|
1608
1529
|
];
|
|
1609
1530
|
else {
|
|
1610
|
-
const { data: data
|
|
1531
|
+
const { data: data } = selected_filter;
|
|
1611
1532
|
const data_is_array = Array.isArray(data);
|
|
1612
1533
|
if (data_is_array && data.length !== 1) {
|
|
1613
1534
|
size = data.length;
|
|
@@ -1686,9 +1607,6 @@ function $8c939a05b87fbbbc$export$ab34afce88557c0e(props) {
|
|
|
1686
1607
|
|
|
1687
1608
|
|
|
1688
1609
|
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
1610
|
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
1693
1611
|
class $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 extends Error {
|
|
1694
1612
|
}
|
|
@@ -1710,7 +1628,7 @@ const $edafe91daf3091d7$var$_tmpl$ = [
|
|
|
1710
1628
|
function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
1711
1629
|
return (0, $diwD4$solidjs.ErrorBoundary)({
|
|
1712
1630
|
fallback (err, retry) {
|
|
1713
|
-
const { message_: message_
|
|
1631
|
+
const { message_: message_, severity_: severity_ } = props;
|
|
1714
1632
|
let message = message_;
|
|
1715
1633
|
if (err instanceof (0, $7dd1edb2ee2b43ad$export$aa14a9f43128f61f)) {
|
|
1716
1634
|
console.error(err.cause);
|
|
@@ -1734,10 +1652,6 @@ function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
|
1734
1652
|
|
|
1735
1653
|
|
|
1736
1654
|
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
1655
|
const $9fe9883b1d8ecccc$var$_tmpl$ = [
|
|
1742
1656
|
"<span",
|
|
1743
1657
|
' class="',
|
|
@@ -1752,7 +1666,7 @@ function $9fe9883b1d8ecccc$export$acb3eaade4b23afd(props) {
|
|
|
1752
1666
|
|
|
1753
1667
|
function $061ff5b4c3d36171$export$89c6019e4baa40b1(props) {
|
|
1754
1668
|
const style = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
1755
|
-
const { style: style
|
|
1669
|
+
const { style: style, height: height, width: width } = props;
|
|
1756
1670
|
return {
|
|
1757
1671
|
...style || {},
|
|
1758
1672
|
height: height ?? "1em",
|
|
@@ -2000,7 +1914,7 @@ function $aff9a96d30ed3563$var$ActualFilterBody(props) {
|
|
|
2000
1914
|
|
|
2001
1915
|
|
|
2002
1916
|
|
|
2003
|
-
function $70482f04605572e2$export$b288c38ae3fddb56({ available_filters_: available_filters_
|
|
1917
|
+
function $70482f04605572e2$export$b288c38ae3fddb56({ available_filters_: available_filters_, local_filter_cache_: [read_local_cache, write_local_cache], selected_filters_: [read_selected_filters] }) {
|
|
2004
1918
|
let last_remote_state;
|
|
2005
1919
|
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
2006
1920
|
const remote_filters = Object.fromEntries(available_filters_()?.map((filter)=>[
|
|
@@ -2087,14 +2001,14 @@ function $70482f04605572e2$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
2087
2001
|
}).map((key)=>data_objs_in_local[key]),
|
|
2088
2002
|
...Object.values(data_objs_in_remote)
|
|
2089
2003
|
];
|
|
2090
|
-
const new_values = new_data.map(({ value_: value_
|
|
2004
|
+
const new_values = new_data.map(({ value_: value_ })=>value_);
|
|
2091
2005
|
const result = {
|
|
2092
2006
|
...remote_filter,
|
|
2093
2007
|
meta: {
|
|
2094
2008
|
...remote_filter.meta,
|
|
2095
2009
|
values: new_values,
|
|
2096
|
-
names: new_data.map(({ name_: name_
|
|
2097
|
-
counts: new_data.map(({ count_: count_
|
|
2010
|
+
names: new_data.map(({ name_: name_ })=>name_),
|
|
2011
|
+
counts: new_data.map(({ count_: count_ })=>count_)
|
|
2098
2012
|
}
|
|
2099
2013
|
};
|
|
2100
2014
|
new_local_filter_state.push(result);
|
|
@@ -2152,10 +2066,6 @@ function $70482f04605572e2$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
2152
2066
|
|
|
2153
2067
|
|
|
2154
2068
|
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
2069
|
function $5f7d55c710fd1bc2$export$2f0cbfbb4354bb52(elements) {
|
|
2160
2070
|
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
2161
2071
|
return (0, $diwD4$solidjs.createMemo)(()=>$5f7d55c710fd1bc2$var$unwrapping_helper(elements));
|
|
@@ -2239,7 +2149,7 @@ function $f48d0fbb00835aaa$var$ActualSolidLayout(props, container_element) {
|
|
|
2239
2149
|
(0, $diwD4$solidjs.onCleanup)(()=>mutation_observer.disconnect());
|
|
2240
2150
|
set_styling(// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
2241
2151
|
()=>(0, $diwD4$solidjs.createMemo)(()=>{
|
|
2242
|
-
const { rows_per_click: rows_per_click
|
|
2152
|
+
const { rows_per_click: rows_per_click, max_rows: max_rows = -1 } = rows_or_empty_object();
|
|
2243
2153
|
const rows_visible = get_rows_visible();
|
|
2244
2154
|
const children_count = get_children_count();
|
|
2245
2155
|
return col_styling() + props.cols_at_size.map((options)=>{
|
|
@@ -2321,7 +2231,7 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2321
2231
|
|
|
2322
2232
|
|
|
2323
2233
|
|
|
2324
|
-
async function $bc91d938b8c601b4$export$58e808b1db15d3bc({ merchant: merchant
|
|
2234
|
+
async function $bc91d938b8c601b4$export$58e808b1db15d3bc({ merchant: merchant, market: market, headers: headers, ...fetch_recs_options }) {
|
|
2325
2235
|
return await (0, $diwD4$depictaiutilishared.fetch_recs)({
|
|
2326
2236
|
tenant: merchant,
|
|
2327
2237
|
market: market
|
|
@@ -2333,10 +2243,6 @@ async function $bc91d938b8c601b4$export$58e808b1db15d3bc({ merchant: merchant ,
|
|
|
2333
2243
|
|
|
2334
2244
|
|
|
2335
2245
|
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
2246
|
function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value, router_) {
|
|
2341
2247
|
const signals = {};
|
|
2342
2248
|
const entries = Object.entries(params_to_default_value);
|
|
@@ -2346,7 +2252,7 @@ function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value, rout
|
|
|
2346
2252
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
2347
2253
|
(0, $diwD4$solidjs.createRenderEffect)(()=>{
|
|
2348
2254
|
let signal_changed = false;
|
|
2349
|
-
let { state: state
|
|
2255
|
+
let { state: state } = globalThis?.history || {
|
|
2350
2256
|
state: {}
|
|
2351
2257
|
}; // cloning isn't necessary because we're calling replaceState on it anyway
|
|
2352
2258
|
if (state === null || typeof state != "object") state = {};
|
|
@@ -2377,7 +2283,7 @@ function $6e22b5314fb52f4c$var$history_state_change(signals, entries, state) {
|
|
|
2377
2283
|
}
|
|
2378
2284
|
|
|
2379
2285
|
|
|
2380
|
-
function $26a56f6b44703084$export$9862539c89138352({ get_default_values_: get_default_values_
|
|
2286
|
+
function $26a56f6b44703084$export$9862539c89138352({ get_default_values_: get_default_values_, router_: router_, prefix_: prefix_ }) {
|
|
2381
2287
|
const get_prefixed_default_values_ = ()=>{
|
|
2382
2288
|
const default_values = get_default_values_();
|
|
2383
2289
|
return Object.fromEntries(Object.entries(default_values).map(([key, value])=>[
|
|
@@ -2406,6 +2312,38 @@ function $26a56f6b44703084$export$9862539c89138352({ get_default_values_: get_de
|
|
|
2406
2312
|
|
|
2407
2313
|
|
|
2408
2314
|
|
|
2315
|
+
/**
|
|
2316
|
+
* 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.
|
|
2317
|
+
* Backend supports accepting group_title as field, so we just pretend it was field in the whole app to avoid major refactoring.
|
|
2318
|
+
* 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.
|
|
2319
|
+
*
|
|
2320
|
+
* 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).
|
|
2321
|
+
*/ function $67dc366d96177e70$export$967e966fca9515e(api_response) {
|
|
2322
|
+
if ("filters" in api_response) {
|
|
2323
|
+
const filters = api_response.filters;
|
|
2324
|
+
if (!filters) return api_response;
|
|
2325
|
+
const new_filters = [];
|
|
2326
|
+
for(let i = 0; i < filters.length; i++){
|
|
2327
|
+
const filter = filters[i];
|
|
2328
|
+
const group_title = filter.meta?.group_title?.toLowerCase();
|
|
2329
|
+
const new_filter = {
|
|
2330
|
+
...filter
|
|
2331
|
+
};
|
|
2332
|
+
if (group_title) {
|
|
2333
|
+
new_filter.field = group_title;
|
|
2334
|
+
new_filter.actual_field = filter.field;
|
|
2335
|
+
}
|
|
2336
|
+
new_filters.push(new_filter);
|
|
2337
|
+
}
|
|
2338
|
+
return {
|
|
2339
|
+
...api_response,
|
|
2340
|
+
filters: new_filters
|
|
2341
|
+
};
|
|
2342
|
+
}
|
|
2343
|
+
return api_response;
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2346
|
+
|
|
2409
2347
|
const $e1d6c0f3d89d531c$var$v2_base_url = (0, $diwD4$depictaiutilishared.base_url) + "/v2/";
|
|
2410
2348
|
const $e1d6c0f3d89d531c$var$search_base_url = $e1d6c0f3d89d531c$var$v2_base_url + "search/";
|
|
2411
2349
|
class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
@@ -2461,7 +2399,7 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
2461
2399
|
Object.defineProperties(category_suggestions.pop(), Object.getOwnPropertyDescriptors(page_urls.pop()));
|
|
2462
2400
|
return response;
|
|
2463
2401
|
}
|
|
2464
|
-
async #run_url_creator_for_rest(
|
|
2402
|
+
async #run_url_creator_for_rest(merchant, market, input_data) {
|
|
2465
2403
|
if (!this.page_url_creator) return input_data;
|
|
2466
2404
|
const displays = input_data.displays;
|
|
2467
2405
|
const breadcrumb = input_data.breadcrumb;
|
|
@@ -2469,8 +2407,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
2469
2407
|
if (displays) {
|
|
2470
2408
|
const page_urls = await this.page_url_creator({
|
|
2471
2409
|
type: "products",
|
|
2472
|
-
merchant:
|
|
2473
|
-
market:
|
|
2410
|
+
merchant: merchant,
|
|
2411
|
+
market: market,
|
|
2474
2412
|
displays: [
|
|
2475
2413
|
...input_data.displays
|
|
2476
2414
|
]
|
|
@@ -2497,8 +2435,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
2497
2435
|
if (!category_display_array) continue;
|
|
2498
2436
|
const page_urls = await this.page_url_creator({
|
|
2499
2437
|
type: "categories",
|
|
2500
|
-
merchant:
|
|
2501
|
-
market:
|
|
2438
|
+
merchant: merchant,
|
|
2439
|
+
market: market,
|
|
2502
2440
|
data: [
|
|
2503
2441
|
...category_display_array
|
|
2504
2442
|
]
|
|
@@ -2509,8 +2447,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
2509
2447
|
}
|
|
2510
2448
|
return input_data;
|
|
2511
2449
|
}
|
|
2512
|
-
async #cached_post_request(
|
|
2513
|
-
const cache_obj = this.#get_cache_obj_for_endpoint(
|
|
2450
|
+
async #cached_post_request(endpoint, input_req, fallback_response) {
|
|
2451
|
+
const cache_obj = this.#get_cache_obj_for_endpoint(endpoint);
|
|
2514
2452
|
const with_ids = this.#add_ids_to_request(input_req);
|
|
2515
2453
|
const metaData = await this.#get_metadata?.();
|
|
2516
2454
|
const request = metaData ? Object.assign(with_ids, {
|
|
@@ -2524,7 +2462,7 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
2524
2462
|
let resolve_in_progress;
|
|
2525
2463
|
cache_obj.in_progress_[body] = new Promise((r)=>resolve_in_progress = r);
|
|
2526
2464
|
try {
|
|
2527
|
-
const api_response = await (0, $diwD4$depictaiutilishared.fetch_retry)((0, $diwD4$depictaiutilishared.add_version_query_params)(
|
|
2465
|
+
const api_response = await (0, $diwD4$depictaiutilishared.fetch_retry)((0, $diwD4$depictaiutilishared.add_version_query_params)(endpoint), {
|
|
2528
2466
|
method: "POST",
|
|
2529
2467
|
body: body
|
|
2530
2468
|
});
|
|
@@ -2538,6 +2476,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
2538
2476
|
(0, $diwD4$depictaiutilishared.dwarn)("URL creator or json decoding failed", e);
|
|
2539
2477
|
break return_successfully;
|
|
2540
2478
|
}
|
|
2479
|
+
// Here result actually becomes O
|
|
2480
|
+
result = (0, $67dc366d96177e70$export$967e966fca9515e)(result);
|
|
2541
2481
|
cache_obj.cache_[body] = new WeakRef(result);
|
|
2542
2482
|
resolve_in_progress(result);
|
|
2543
2483
|
setTimeout((0, $diwD4$depictaiutilishared.catchify)(()=>{
|
|
@@ -2557,7 +2497,7 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
2557
2497
|
}
|
|
2558
2498
|
}
|
|
2559
2499
|
constructor(options){
|
|
2560
|
-
const { get_metadata: get_metadata
|
|
2500
|
+
const { get_metadata: get_metadata, get_user_id: get_user_id, get_session_id: get_session_id, page_url_creator: page_url_creator } = options ?? {};
|
|
2561
2501
|
this.#get_metadata = get_metadata;
|
|
2562
2502
|
this.#get_user_id = get_user_id;
|
|
2563
2503
|
this.#get_session_id = get_session_id;
|
|
@@ -2622,18 +2562,14 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
2622
2562
|
|
|
2623
2563
|
|
|
2624
2564
|
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
2565
|
const $6b384adf40a5f4d7$var$get_available_range = (available_filters_, search_for_field)=>{
|
|
2630
|
-
const maybe_meta = (0, $diwD4$solidjs.untrack)(available_filters_)?.find(({ op: op
|
|
2566
|
+
const maybe_meta = (0, $diwD4$solidjs.untrack)(available_filters_)?.find(({ op: op, field: field })=>field === search_for_field && op === "inrange")?.meta;
|
|
2631
2567
|
if (maybe_meta?.min != undefined && maybe_meta?.max != undefined) return [
|
|
2632
2568
|
maybe_meta.min,
|
|
2633
2569
|
maybe_meta.max
|
|
2634
2570
|
];
|
|
2635
2571
|
};
|
|
2636
|
-
function $6b384adf40a5f4d7$export$e702733a056c40d6({ available_filters_: available_filters_
|
|
2572
|
+
function $6b384adf40a5f4d7$export$e702733a056c40d6({ available_filters_: available_filters_, selected_filters_: selected_filters_ }) {
|
|
2637
2573
|
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
2638
2574
|
// 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
|
|
2639
2575
|
available_filters_();
|
|
@@ -2643,7 +2579,7 @@ function $6b384adf40a5f4d7$export$e702733a056c40d6({ available_filters_: availab
|
|
|
2643
2579
|
});
|
|
2644
2580
|
});
|
|
2645
2581
|
}
|
|
2646
|
-
function $6b384adf40a5f4d7$var$correct_range_filter_range_once({ selected_filters_: [read_selected_filters_, write_selected_filters_]
|
|
2582
|
+
function $6b384adf40a5f4d7$var$correct_range_filter_range_once({ selected_filters_: [read_selected_filters_, write_selected_filters_], available_filters_: available_filters_ }) {
|
|
2647
2583
|
const selected_filters = (0, $diwD4$solidjs.untrack)(read_selected_filters_);
|
|
2648
2584
|
if (!selected_filters) return;
|
|
2649
2585
|
for(let i = 0; i < selected_filters.length; i++){
|
|
@@ -2686,7 +2622,7 @@ function $6b384adf40a5f4d7$var$correct_range_filter_range_once({ selected_filter
|
|
|
2686
2622
|
|
|
2687
2623
|
|
|
2688
2624
|
|
|
2689
|
-
function $0f400c3f7248d5f1$export$92f2da32c6e7e7ee({ search_results_: search_results_
|
|
2625
|
+
function $0f400c3f7248d5f1$export$92f2da32c6e7e7ee({ search_results_: search_results_, i18n_: i18n_ }) {
|
|
2690
2626
|
return (0, $diwD4$solidjs.createMemo)(()=>{
|
|
2691
2627
|
const n_hits = search_results_()?.n_hits;
|
|
2692
2628
|
if (isNaN(n_hits)) return "";
|
|
@@ -2703,15 +2639,12 @@ function $0f400c3f7248d5f1$export$92f2da32c6e7e7ee({ search_results_: search_res
|
|
|
2703
2639
|
|
|
2704
2640
|
|
|
2705
2641
|
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
2642
|
function $76b6ac05693f5c71$export$205efb947c7ffd78(handler, passive = true) {
|
|
2710
2643
|
const catchified_handler = (0, $diwD4$depictaiutilishared.catchify)(handler);
|
|
2711
2644
|
const owner = (0, $diwD4$solidjs.getOwner)();
|
|
2712
2645
|
// 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.
|
|
2713
2646
|
// Use observer in case that this gets called before body exists
|
|
2714
|
-
const disconnect = (0, $diwD4$depictaiutilishared.observer).onexists("body", ({ element: element
|
|
2647
|
+
const disconnect = (0, $diwD4$depictaiutilishared.observer).onexists("body", ({ element: element })=>{
|
|
2715
2648
|
element.addEventListener("scroll", catchified_handler, {
|
|
2716
2649
|
passive: passive
|
|
2717
2650
|
});
|
|
@@ -2731,7 +2664,6 @@ function $76b6ac05693f5c71$export$205efb947c7ffd78(handler, passive = true) {
|
|
|
2731
2664
|
}
|
|
2732
2665
|
|
|
2733
2666
|
|
|
2734
|
-
|
|
2735
2667
|
const $401aee5f33dca9e2$var$_tmpl$ = [
|
|
2736
2668
|
"<div",
|
|
2737
2669
|
' class="scroll-status" style="display:none"><span class="text"><b>',
|
|
@@ -2740,7 +2672,7 @@ const $401aee5f33dca9e2$var$_tmpl$ = [
|
|
|
2740
2672
|
"<!--/--> <b>",
|
|
2741
2673
|
"</b></span></div>"
|
|
2742
2674
|
];
|
|
2743
|
-
function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_
|
|
2675
|
+
function $401aee5f33dca9e2$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_ } }) {
|
|
2744
2676
|
if (0, $diwD4$solidjsweb.isServer) return; // won't show in initial render and need scroll position
|
|
2745
2677
|
const [first_to_show, set_first_to_show] = (0, $diwD4$solidjs.createSignal)(0);
|
|
2746
2678
|
const [last_to_show, set_last_to_show] = (0, $diwD4$solidjs.createSignal)(0);
|
|
@@ -2855,12 +2787,6 @@ function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
2855
2787
|
|
|
2856
2788
|
|
|
2857
2789
|
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
2790
|
const $0d0b172488865048$var$_tmpl$ = [
|
|
2865
2791
|
"<a",
|
|
2866
2792
|
' class="hint" href="javascript:void(0)">',
|
|
@@ -2871,7 +2797,7 @@ const $0d0b172488865048$var$_tmpl$ = [
|
|
|
2871
2797
|
"</div><!--#-->",
|
|
2872
2798
|
"<!--/--></div>"
|
|
2873
2799
|
];
|
|
2874
|
-
function $0d0b172488865048$export$ef6006467f04ee41({ i18n_: i18n_
|
|
2800
|
+
function $0d0b172488865048$export$ef6006467f04ee41({ i18n_: i18n_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_ }) {
|
|
2875
2801
|
const root = (0, $diwD4$solidjs.getOwner)();
|
|
2876
2802
|
return [
|
|
2877
2803
|
(0, $diwD4$solidjsweb.ssr)($0d0b172488865048$var$_tmpl$2, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)(i18n_.no_results_text_()), (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
@@ -2899,7 +2825,7 @@ function $fc23d7668ae0011d$export$a2cc176055f8f08() {
|
|
|
2899
2825
|
|
|
2900
2826
|
let $0caf87eaa19079da$var$cached_placeholder_element;
|
|
2901
2827
|
let $0caf87eaa19079da$var$rendering_cached_placeholder_element;
|
|
2902
|
-
function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: product_card_template_
|
|
2828
|
+
function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: product_card_template_, num_placeholders_: num_placeholders_ }) {
|
|
2903
2829
|
const [get_elements, set_elements] = (0, $diwD4$solidjs.createSignal)([]);
|
|
2904
2830
|
let existing_num = 0;
|
|
2905
2831
|
if (0, $diwD4$solidjsweb.isServer) // want to render simple placeholders on server, effects don't run there
|
|
@@ -2930,7 +2856,7 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: pro
|
|
|
2930
2856
|
}
|
|
2931
2857
|
/**
|
|
2932
2858
|
* Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
|
|
2933
|
-
*/ function $0caf87eaa19079da$var$Placeholder({ product_card_template_: product_card_template_
|
|
2859
|
+
*/ function $0caf87eaa19079da$var$Placeholder({ product_card_template_: product_card_template_ }) {
|
|
2934
2860
|
const get_cloned_placeholders = (element_to_clone = $0caf87eaa19079da$var$cached_placeholder_element)=>Array.isArray(element_to_clone) ? element_to_clone.map((el)=>el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
|
|
2935
2861
|
if ($0caf87eaa19079da$var$cached_placeholder_element) return get_cloned_placeholders();
|
|
2936
2862
|
let dispose_original_copy;
|
|
@@ -2983,7 +2909,7 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: pro
|
|
|
2983
2909
|
|
|
2984
2910
|
|
|
2985
2911
|
|
|
2986
|
-
function $3f08fe2992a2a8ca$export$5e4aed86c12acdd9({ percentage_in_view_: percentage_in_view_
|
|
2912
|
+
function $3f08fe2992a2a8ca$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_ }) {
|
|
2987
2913
|
let last_loaded = +new Date();
|
|
2988
2914
|
let is_loading_more = false;
|
|
2989
2915
|
let is_first_load = true;
|
|
@@ -3033,7 +2959,7 @@ function $3f08fe2992a2a8ca$export$5e4aed86c12acdd9({ percentage_in_view_: percen
|
|
|
3033
2959
|
|
|
3034
2960
|
|
|
3035
2961
|
|
|
3036
|
-
function $4117463e2939f5f4$export$63dd0350f8559dda({ displays_by_key_: displays_by_key_
|
|
2962
|
+
function $4117463e2939f5f4$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 }) {
|
|
3037
2963
|
const [get_has_rendered_toggle, set_has_rendered_toggle] = (0, $diwD4$solidjs.createSignal)(false);
|
|
3038
2964
|
(0, $diwD4$solidjs.createEffect)(()=>{
|
|
3039
2965
|
// We need this to run after the "render phase"
|
|
@@ -3094,7 +3020,7 @@ function $a73063cc642f3e5f$export$7f8bd308237ab5a5(get_displays_) {
|
|
|
3094
3020
|
});
|
|
3095
3021
|
return displays_by_key_;
|
|
3096
3022
|
}
|
|
3097
|
-
function $a73063cc642f3e5f$export$43f0fb951fcb0c54({ displays_by_key_: displays_by_key_
|
|
3023
|
+
function $a73063cc642f3e5f$export$43f0fb951fcb0c54({ displays_by_key_: displays_by_key_, merchant_: merchant_, market_: market_, product_card_template_: product_card_template_, do_per_elements_: do_per_elements_ }) {
|
|
3098
3024
|
return (0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.For), {
|
|
3099
3025
|
get each () {
|
|
3100
3026
|
return [
|
|
@@ -3126,8 +3052,8 @@ function $a73063cc642f3e5f$export$43f0fb951fcb0c54({ displays_by_key_: displays_
|
|
|
3126
3052
|
elements.push(element);
|
|
3127
3053
|
// Add tracking ids
|
|
3128
3054
|
if (!(element instanceof HTMLElement)) continue; // Apparently only HTMLElements have dataset
|
|
3129
|
-
const { dataset: dataset
|
|
3130
|
-
const { search_result_id: search_result_id
|
|
3055
|
+
const { dataset: dataset } = element;
|
|
3056
|
+
const { search_result_id: search_result_id, product_listing_result_id: product_listing_result_id, recommendation_id: recommendation_id } = display;
|
|
3131
3057
|
if (search_result_id) dataset.searchResultId = search_result_id;
|
|
3132
3058
|
else if (product_listing_result_id) dataset.productListingResultId = product_listing_result_id;
|
|
3133
3059
|
else if (recommendation_id) dataset.recommendationId = recommendation_id;
|
|
@@ -3140,7 +3066,7 @@ function $a73063cc642f3e5f$export$43f0fb951fcb0c54({ displays_by_key_: displays_
|
|
|
3140
3066
|
}
|
|
3141
3067
|
|
|
3142
3068
|
|
|
3143
|
-
function $ac167f6af6a48fc3$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
3069
|
+
function $ac167f6af6a48fc3$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_ }) {
|
|
3144
3070
|
// 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
|
|
3145
3071
|
const target_to_index_map = new Map();
|
|
3146
3072
|
const index_to_target_map_ = new Map();
|
|
@@ -3148,7 +3074,7 @@ function $ac167f6af6a48fc3$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
3148
3074
|
const intersection_observer = new IntersectionObserver((0, $diwD4$depictaiutilishared.catchify)((records)=>{
|
|
3149
3075
|
for(let i = 0; i < records.length; i++){
|
|
3150
3076
|
const record = records[i];
|
|
3151
|
-
const { target: target
|
|
3077
|
+
const { target: target, intersectionRatio: intersectionRatio } = record;
|
|
3152
3078
|
const index_of_target = target_to_index_map.get(target);
|
|
3153
3079
|
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.
|
|
3154
3080
|
const is_in_set = currently_intersecting.has(index_of_target);
|
|
@@ -3218,7 +3144,7 @@ const $fe76fb463cc60b89$var$_tmpl$ = [
|
|
|
3218
3144
|
"<!--/--><!--#-->",
|
|
3219
3145
|
"<!--/--></div>"
|
|
3220
3146
|
];
|
|
3221
|
-
function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
3147
|
+
function $fe76fb463cc60b89$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_ }) {
|
|
3222
3148
|
// 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
|
|
3223
3149
|
const is_loading_ = (0, $diwD4$solidjs.createMemo)(()=>plp_results_.loading || query_base_.loading);
|
|
3224
3150
|
const merchant_ = (0, $diwD4$solidjs.createMemo)(()=>query_base_().tenant);
|
|
@@ -3263,7 +3189,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3263
3189
|
product_card_template_: product_card_template_,
|
|
3264
3190
|
num_placeholders_: (0, $diwD4$solidjs.createMemo)(()=>{
|
|
3265
3191
|
// 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
|
|
3266
|
-
return (0, $aec24316ed262dc0$export$6c9030e511152266) + (get_scroll_restoration_data().find(({ for_id: for_id
|
|
3192
|
+
return (0, $aec24316ed262dc0$export$6c9030e511152266) + (get_scroll_restoration_data().find(({ for_id: for_id })=>for_id === id_currently_querying_for_())?.min_results_loaded ?? min_products_to_fetch_);
|
|
3267
3193
|
})
|
|
3268
3194
|
}) : undefined);
|
|
3269
3195
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = (0, $diwD4$solidjs.createSignal)(false);
|
|
@@ -3366,7 +3292,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3366
3292
|
/**
|
|
3367
3293
|
* Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
|
|
3368
3294
|
* This function is special to the actual PLPResults.
|
|
3369
|
-
*/ function $fe76fb463cc60b89$var$make_modified_cols_at_size({ layout_options_: layout_options_
|
|
3295
|
+
*/ function $fe76fb463cc60b89$var$make_modified_cols_at_size({ layout_options_: layout_options_, sort_or_filter_open_: sort_or_filter_open_ }) {
|
|
3370
3296
|
return (0, $diwD4$solidjs.createMemo)(()=>{
|
|
3371
3297
|
const layout_options = layout_options_();
|
|
3372
3298
|
// Add grid styling that changes when filters get opened/closed
|
|
@@ -3400,15 +3326,6 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3400
3326
|
|
|
3401
3327
|
|
|
3402
3328
|
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
3329
|
|
|
3413
3330
|
const $be89be42ce9ea60f$var$_tmpl$ = [
|
|
3414
3331
|
"<div",
|
|
@@ -3430,7 +3347,7 @@ const $be89be42ce9ea60f$var$_tmpl$ = [
|
|
|
3430
3347
|
'><span class="custom-indicator"></span><!--#-->',
|
|
3431
3348
|
"<!--/--></label></div>"
|
|
3432
3349
|
];
|
|
3433
|
-
function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: available_sortings_
|
|
3350
|
+
function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: available_sortings_, current_sorting_: [get_current_sorting, set_current_sorting], meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_ }) {
|
|
3434
3351
|
const title_radio_name = (0, $diwD4$depictaiutilishared.make_random_classname)();
|
|
3435
3352
|
const order_radio_name = (0, $diwD4$depictaiutilishared.make_random_classname)();
|
|
3436
3353
|
return (0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
@@ -3491,12 +3408,6 @@ function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: availa
|
|
|
3491
3408
|
|
|
3492
3409
|
|
|
3493
3410
|
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
3411
|
function $ca1176b694a6ee2e$export$fe334901e8bebd57() {
|
|
3501
3412
|
const cleanup_fns = [];
|
|
3502
3413
|
const cleanup = ()=>cleanup_fns.forEach((f)=>f());
|
|
@@ -3540,7 +3451,6 @@ function $ca1176b694a6ee2e$export$fe334901e8bebd57() {
|
|
|
3540
3451
|
|
|
3541
3452
|
|
|
3542
3453
|
|
|
3543
|
-
|
|
3544
3454
|
const $f958b5ac0e4a78da$var$_tmpl$ = '<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>', $f958b5ac0e4a78da$var$_tmpl$2 = '<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>';
|
|
3545
3455
|
function $f958b5ac0e4a78da$export$da32f7add8a22e86(props = {}) {
|
|
3546
3456
|
return (0, $diwD4$solidjsweb.ssrElement)("svg", ()=>({
|
|
@@ -3557,7 +3467,6 @@ function $f958b5ac0e4a78da$export$da32f7add8a22e86(props = {}) {
|
|
|
3557
3467
|
|
|
3558
3468
|
|
|
3559
3469
|
|
|
3560
|
-
|
|
3561
3470
|
const $046db47e0326c715$var$_tmpl$ = '<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>';
|
|
3562
3471
|
function $046db47e0326c715$export$d10e63059ddb9fd4(props = {}) {
|
|
3563
3472
|
return (0, $diwD4$solidjsweb.ssrElement)("svg", ()=>({
|
|
@@ -3571,7 +3480,6 @@ function $046db47e0326c715$export$d10e63059ddb9fd4(props = {}) {
|
|
|
3571
3480
|
|
|
3572
3481
|
|
|
3573
3482
|
|
|
3574
|
-
|
|
3575
3483
|
const $02215fefc955d01e$var$_tmpl$ = [
|
|
3576
3484
|
"<svg",
|
|
3577
3485
|
' 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>'
|
|
@@ -3617,7 +3525,7 @@ const $1872ceb56ede7a52$var$_tmpl$ = [
|
|
|
3617
3525
|
"</b>"
|
|
3618
3526
|
];
|
|
3619
3527
|
const $1872ceb56ede7a52$var$no_go_selector = ".range .range-group";
|
|
3620
|
-
function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for_sorting_
|
|
3528
|
+
function $1872ceb56ede7a52$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_ }) {
|
|
3621
3529
|
(0, $ca1176b694a6ee2e$export$fe334901e8bebd57)();
|
|
3622
3530
|
let modal;
|
|
3623
3531
|
let modal_body;
|
|
@@ -3715,7 +3623,6 @@ function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
3715
3623
|
|
|
3716
3624
|
|
|
3717
3625
|
|
|
3718
|
-
|
|
3719
3626
|
const $f49857214f7675b1$var$_tmpl$ = [
|
|
3720
3627
|
"<svg",
|
|
3721
3628
|
' 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>'
|
|
@@ -3728,7 +3635,6 @@ function $f49857214f7675b1$export$cb808a3c41736d8e() {
|
|
|
3728
3635
|
|
|
3729
3636
|
|
|
3730
3637
|
|
|
3731
|
-
|
|
3732
3638
|
const $f8f64d05c525825b$var$_tmpl$ = [
|
|
3733
3639
|
"<div",
|
|
3734
3640
|
' class="filters"><div class="body">',
|
|
@@ -3767,7 +3673,7 @@ const $f8f64d05c525825b$var$_tmpl$ = [
|
|
|
3767
3673
|
"</span><!--#-->",
|
|
3768
3674
|
"<!--/--></button>"
|
|
3769
3675
|
];
|
|
3770
|
-
function $f8f64d05c525825b$export$d7841e452f2e59a8({ current_sorting_: current_sorting_
|
|
3676
|
+
function $f8f64d05c525825b$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_ }) {
|
|
3771
3677
|
const Self = ()=>{
|
|
3772
3678
|
// 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
|
|
3773
3679
|
(0, $70482f04605572e2$export$b288c38ae3fddb56)({
|
|
@@ -3853,7 +3759,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
3853
3759
|
}
|
|
3854
3760
|
});
|
|
3855
3761
|
(0, $diwD4$depictaiutilishared.catchify)(async ()=>{
|
|
3856
|
-
({ open_modal_: open_modal_
|
|
3762
|
+
({ open_modal_: open_modal_, close_modal_: close_modal_ } = await (0, $9abb0a35d4b60ed3$export$79b1565500412d9b)((0, $1872ceb56ede7a52$export$9bf11afa910f536e), {
|
|
3857
3763
|
args_for_sorting_: sorting_options,
|
|
3858
3764
|
args_for_filtering_: filter_options,
|
|
3859
3765
|
search_filters_open_: search_filters_open_,
|
|
@@ -3862,7 +3768,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
3862
3768
|
dismiss_modal_: dismiss_modal_,
|
|
3863
3769
|
i18n_: i18n_
|
|
3864
3770
|
}));
|
|
3865
|
-
const { remove: remove
|
|
3771
|
+
const { remove: remove } = (0, $diwD4$depictaiutilishared.javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches));
|
|
3866
3772
|
cleanup_promise.then(remove);
|
|
3867
3773
|
})();
|
|
3868
3774
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
@@ -3877,7 +3783,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
3877
3783
|
}
|
|
3878
3784
|
});
|
|
3879
3785
|
}
|
|
3880
|
-
function $f8f64d05c525825b$var$OpenFiltersButton({ i18n_: i18n_
|
|
3786
|
+
function $f8f64d05c525825b$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] }) {
|
|
3881
3787
|
const filters_closed = (0, $diwD4$solidjs.createMemo)(()=>!search_filters_open_[0]());
|
|
3882
3788
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
3883
3789
|
return (0, $diwD4$solidjsweb.ssr)($f8f64d05c525825b$var$_tmpl$5, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
@@ -3901,7 +3807,7 @@ function $f8f64d05c525825b$var$OpenFiltersButton({ i18n_: i18n_ , search_filters
|
|
|
3901
3807
|
}
|
|
3902
3808
|
})), (0, $diwD4$solidjsweb.escape)(i18n_.filter_text_()));
|
|
3903
3809
|
}
|
|
3904
|
-
function $f8f64d05c525825b$var$OpenSortingButton({ i18n_: i18n_
|
|
3810
|
+
function $f8f64d05c525825b$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_ }) {
|
|
3905
3811
|
const sorting_closed = (0, $diwD4$solidjs.createMemo)(()=>!search_sorting_open_[0]());
|
|
3906
3812
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
3907
3813
|
return (0, $diwD4$solidjsweb.ssr)($f8f64d05c525825b$var$_tmpl$6, (0, $diwD4$solidjsweb.ssrHydrationKey)(), `${!sorting_closed() ? "major" : ""} ${sorting_closed() ? "minor" : ""} toggle-button for-sorting major-minor-transition`, (0, $diwD4$solidjsweb.ssrAttribute)("tabindex", (0, $diwD4$solidjsweb.escape)(tabindex_, true), false) + (0, $diwD4$solidjsweb.ssrAttribute)("aria-label", (0, $diwD4$solidjsweb.escape)((sorting_closed() ? i18n_.open_sorting_ : i18n_.close_sorting_)(), true), false), (0, $diwD4$solidjsweb.ssrStyle)(sort_button_width_?.() ? {
|
|
@@ -3929,14 +3835,9 @@ function $f8f64d05c525825b$var$OpenSortingButton({ i18n_: i18n_ , get_current_so
|
|
|
3929
3835
|
|
|
3930
3836
|
|
|
3931
3837
|
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
3838
|
const $ee498ec5e7dc2bba$var$closing_functions = /*@__PURE__*/ new Set();
|
|
3938
3839
|
const $ee498ec5e7dc2bba$export$22970a0140fc759c = /*@__PURE__*/ (0, $diwD4$solidjs.createSignal)(false);
|
|
3939
|
-
function $ee498ec5e7dc2bba$export$5196e4c01fa56fcb({ children: children
|
|
3840
|
+
function $ee498ec5e7dc2bba$export$5196e4c01fa56fcb({ children: children, on_close_: on_close_, close_after_: close_after_, ...more_attributes }) {
|
|
3940
3841
|
let close_toast_;
|
|
3941
3842
|
const stay_open_promise = new Promise((r)=>close_toast_ = r);
|
|
3942
3843
|
(0, $diwD4$depictaiutilishared.catchify)(async ()=>{
|
|
@@ -3982,7 +3883,7 @@ function $ee498ec5e7dc2bba$export$5196e4c01fa56fcb({ children: children , on_clo
|
|
|
3982
3883
|
// let other toasts close us if they open while we're still here
|
|
3983
3884
|
$ee498ec5e7dc2bba$var$closing_functions.add(close_toast_);
|
|
3984
3885
|
set_is_showing_toast(true);
|
|
3985
|
-
const handler = (0, $diwD4$depictaiutilishared.catchify)(({ key: key
|
|
3886
|
+
const handler = (0, $diwD4$depictaiutilishared.catchify)(({ key: key })=>{
|
|
3986
3887
|
if (key === "Escape") // make pressing escape close the toast
|
|
3987
3888
|
close_toast_();
|
|
3988
3889
|
});
|
|
@@ -4038,7 +3939,6 @@ function $ee498ec5e7dc2bba$export$5196e4c01fa56fcb({ children: children , on_clo
|
|
|
4038
3939
|
|
|
4039
3940
|
|
|
4040
3941
|
|
|
4041
|
-
|
|
4042
3942
|
const $084b6a0ee1d481de$var$_tmpl$ = [
|
|
4043
3943
|
"<svg",
|
|
4044
3944
|
' 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>'
|
|
@@ -4048,7 +3948,6 @@ function $084b6a0ee1d481de$export$2624c5890f1bbcf7() {
|
|
|
4048
3948
|
}
|
|
4049
3949
|
|
|
4050
3950
|
|
|
4051
|
-
|
|
4052
3951
|
const $2fb324fbcc7b4a7b$var$_tmpl$ = [
|
|
4053
3952
|
"<div",
|
|
4054
3953
|
' class="',
|
|
@@ -4063,7 +3962,7 @@ const $2fb324fbcc7b4a7b$var$_tmpl$ = [
|
|
|
4063
3962
|
function $2fb324fbcc7b4a7b$export$b23abd26de154ede(props) {
|
|
4064
3963
|
if (0, $diwD4$solidjsweb.isServer) return; // won't show in initial render and need scroll position
|
|
4065
3964
|
const [is_small, set_is_small] = (0, $diwD4$solidjs.createSignal)(true);
|
|
4066
|
-
(0, $diwD4$solidjs.onCleanup)((0, $diwD4$depictaiutilishared.javascript_media_query)("(max-width:651px)", ({ matches: matches
|
|
3965
|
+
(0, $diwD4$solidjs.onCleanup)((0, $diwD4$depictaiutilishared.javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches)).remove);
|
|
4067
3966
|
return (0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
4068
3967
|
get when () {
|
|
4069
3968
|
return is_small();
|
|
@@ -4073,7 +3972,7 @@ function $2fb324fbcc7b4a7b$export$b23abd26de154ede(props) {
|
|
|
4073
3972
|
}
|
|
4074
3973
|
});
|
|
4075
3974
|
}
|
|
4076
|
-
function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [get_search_filters_open_, set_search_filters_open_]
|
|
3975
|
+
function $2fb324fbcc7b4a7b$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_ }) {
|
|
4077
3976
|
let old_pos = scrollY;
|
|
4078
3977
|
let diff_over_second_or_touch = 0; // for things not supporting touch events
|
|
4079
3978
|
let timeout;
|
|
@@ -4152,10 +4051,9 @@ function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4152
4051
|
|
|
4153
4052
|
|
|
4154
4053
|
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4054
|
+
const $1ab22f2cd39b3061$var$fallback_operator = "in";
|
|
4055
|
+
const $1ab22f2cd39b3061$var$fallback_token = "";
|
|
4056
|
+
const $1ab22f2cd39b3061$var$legacy_filter_prefix = "filter_";
|
|
4159
4057
|
const $1ab22f2cd39b3061$var$operator_map = {
|
|
4160
4058
|
"eq": "≡",
|
|
4161
4059
|
"neq": "≠",
|
|
@@ -4171,6 +4069,10 @@ const $1ab22f2cd39b3061$var$range_delimiter = "-";
|
|
|
4171
4069
|
const $1ab22f2cd39b3061$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
|
|
4172
4070
|
const $1ab22f2cd39b3061$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
|
|
4173
4071
|
const $1ab22f2cd39b3061$var$empty_item_replacement = "0️⃣";
|
|
4072
|
+
const $1ab22f2cd39b3061$var$op_to_token = (op)=>{
|
|
4073
|
+
if (op === $1ab22f2cd39b3061$var$fallback_operator) return $1ab22f2cd39b3061$var$fallback_token;
|
|
4074
|
+
return $1ab22f2cd39b3061$var$operator_map[op];
|
|
4075
|
+
};
|
|
4174
4076
|
/**
|
|
4175
4077
|
* 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.
|
|
4176
4078
|
* The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
|
|
@@ -4234,35 +4136,40 @@ function $1ab22f2cd39b3061$var$decode_filter_data(op, encoded_data) {
|
|
|
4234
4136
|
}
|
|
4235
4137
|
function $1ab22f2cd39b3061$export$58aa3f171519b6d7(filters, search_params, filter_query_param_prefix) {
|
|
4236
4138
|
for (const filter of filters){
|
|
4237
|
-
const { field: field
|
|
4139
|
+
const { field: field, op: op, data: data } = filter;
|
|
4238
4140
|
const encoded_data = $1ab22f2cd39b3061$var$encode_filter_data(op, data);
|
|
4239
|
-
search_params.set(filter_query_param_prefix + field + $1ab22f2cd39b3061$var$
|
|
4141
|
+
search_params.set(filter_query_param_prefix + field + $1ab22f2cd39b3061$var$op_to_token(op), encoded_data);
|
|
4240
4142
|
}
|
|
4241
4143
|
}
|
|
4242
4144
|
function $1ab22f2cd39b3061$export$f934fa24c3a86811(search_params, filter_query_param_prefix) {
|
|
4243
4145
|
const found_filters = [];
|
|
4244
4146
|
for (const key of search_params.keys()){
|
|
4245
|
-
|
|
4147
|
+
// Allow for backwards compatibility with the old filter query param prefix
|
|
4148
|
+
let chosen_prefix = filter_query_param_prefix;
|
|
4149
|
+
if (!key.startsWith(chosen_prefix)) {
|
|
4150
|
+
chosen_prefix = $1ab22f2cd39b3061$var$legacy_filter_prefix;
|
|
4151
|
+
if (!key.startsWith(chosen_prefix)) continue;
|
|
4152
|
+
}
|
|
4246
4153
|
const encoded_data = search_params.get(key);
|
|
4247
4154
|
if (!encoded_data) continue;
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
}
|
|
4155
|
+
const [op, token] = Object.entries($1ab22f2cd39b3061$var$operator_map).find(([, token])=>key.endsWith(token)) || [
|
|
4156
|
+
$1ab22f2cd39b3061$var$fallback_operator,
|
|
4157
|
+
$1ab22f2cd39b3061$var$fallback_token
|
|
4158
|
+
];
|
|
4159
|
+
const data = $1ab22f2cd39b3061$var$decode_filter_data(op, encoded_data);
|
|
4160
|
+
if (!data) continue;
|
|
4161
|
+
const field = key.slice(chosen_prefix.length, token ? -token.length : undefined);
|
|
4162
|
+
found_filters.push({
|
|
4163
|
+
field: field,
|
|
4164
|
+
op: op,
|
|
4165
|
+
data: data
|
|
4166
|
+
});
|
|
4260
4167
|
}
|
|
4261
4168
|
return found_filters;
|
|
4262
4169
|
}
|
|
4263
4170
|
function $1ab22f2cd39b3061$export$62acb285a7579555(sorting, search_params, sorting_query_param) {
|
|
4264
4171
|
if (!sorting) return;
|
|
4265
|
-
const { field: field
|
|
4172
|
+
const { field: field, order: order } = sorting;
|
|
4266
4173
|
const ascending = order === "asc";
|
|
4267
4174
|
search_params.set(sorting_query_param, field + (ascending ? $1ab22f2cd39b3061$var$ascending_token : $1ab22f2cd39b3061$var$descending_token));
|
|
4268
4175
|
}
|
|
@@ -4285,14 +4192,14 @@ function $1ab22f2cd39b3061$export$916e6850778505f6(search_params, filter_query_p
|
|
|
4285
4192
|
const keys = [
|
|
4286
4193
|
...search_params.keys()
|
|
4287
4194
|
];
|
|
4288
|
-
for (const key of keys)if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param) search_params.delete(key);
|
|
4195
|
+
for (const key of keys)if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param || key.startsWith($1ab22f2cd39b3061$var$legacy_filter_prefix)) search_params.delete(key);
|
|
4289
4196
|
}
|
|
4290
4197
|
const $1ab22f2cd39b3061$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
4291
|
-
function $1ab22f2cd39b3061$export$43cd1e747fecd42e({ to_url_: to_url_
|
|
4198
|
+
function $1ab22f2cd39b3061$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_ }) {
|
|
4292
4199
|
if (!to_url_) return to_url_;
|
|
4293
4200
|
const was_url_object = to_url_ instanceof URL;
|
|
4294
4201
|
const url_object = was_url_object ? to_url_ : new URL(to_url_, location.origin);
|
|
4295
|
-
const { searchParams: searchParams
|
|
4202
|
+
const { searchParams: searchParams } = url_object;
|
|
4296
4203
|
if (set_clearing_flag_) searchParams.set($1ab22f2cd39b3061$export$cf5feb2102aec7f2, "true");
|
|
4297
4204
|
if (from_search_params_.has(sorting_query_param_)) searchParams.set(sorting_query_param_, from_search_params_.get(sorting_query_param_));
|
|
4298
4205
|
for (const key of from_search_params_.keys())if (key.startsWith(filter_query_param_prefix_)) searchParams.set(key, from_search_params_.get(key));
|
|
@@ -4317,7 +4224,7 @@ const $e53b2e7e632ac4cb$var$_tmpl$ = [
|
|
|
4317
4224
|
' class="separator">',
|
|
4318
4225
|
"</span>"
|
|
4319
4226
|
];
|
|
4320
|
-
function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data
|
|
4227
|
+
function $e53b2e7e632ac4cb$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_ }) {
|
|
4321
4228
|
const placeholder_crumb_data = [
|
|
4322
4229
|
,
|
|
4323
4230
|
,
|
|
@@ -4375,10 +4282,6 @@ function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
|
|
|
4375
4282
|
|
|
4376
4283
|
|
|
4377
4284
|
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
4285
|
const $8cceb1d3a967f369$var$_tmpl$ = [
|
|
4383
4286
|
"<nav",
|
|
4384
4287
|
' class="quicklinks"',
|
|
@@ -4394,7 +4297,7 @@ const $8cceb1d3a967f369$var$_tmpl$ = [
|
|
|
4394
4297
|
">",
|
|
4395
4298
|
"</a>"
|
|
4396
4299
|
];
|
|
4397
|
-
function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_
|
|
4300
|
+
function $8cceb1d3a967f369$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_ }) {
|
|
4398
4301
|
let scrolling_logic_ran_for_query_id = false;
|
|
4399
4302
|
let last_scroll_position;
|
|
4400
4303
|
let scroll_to_element_on_dom_insertion;
|
|
@@ -4414,7 +4317,7 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4414
4317
|
const mutation_plugins = [
|
|
4415
4318
|
function() {
|
|
4416
4319
|
if (!scrolling_logic_ran_for_query_id) return;
|
|
4417
|
-
const { scrollLeft: scrollLeft
|
|
4320
|
+
const { scrollLeft: scrollLeft } = this.insert_here;
|
|
4418
4321
|
if (scrollLeft > 0) {
|
|
4419
4322
|
last_scroll_position = scrollLeft;
|
|
4420
4323
|
const current_id = (0, $diwD4$solidjs.untrack)(current_query_id_);
|
|
@@ -4452,9 +4355,9 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4452
4355
|
faded_opacity_: 0.5,
|
|
4453
4356
|
mutation_plugins_: mutation_plugins,
|
|
4454
4357
|
slider_ref_: (slider)=>{
|
|
4455
|
-
const { insert_here: insert_here
|
|
4358
|
+
const { insert_here: insert_here, intersecting_items_object: intersecting_items_object } = slider;
|
|
4456
4359
|
sliding_element = insert_here;
|
|
4457
|
-
(0, $diwD4$depictaiutilishared.observer).onexists(insert_here, ({ element: element
|
|
4360
|
+
(0, $diwD4$depictaiutilishared.observer).onexists(insert_here, ({ element: element })=>{
|
|
4458
4361
|
if (scroll_to_element_on_dom_insertion == undefined) {
|
|
4459
4362
|
if (!element.scrollLeft) {
|
|
4460
4363
|
const target_position = last_scroll_position;
|
|
@@ -4525,7 +4428,7 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4525
4428
|
// 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
|
|
4526
4429
|
const is_sibling = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
4527
4430
|
const current_id = current_query_id_();
|
|
4528
|
-
return quicklinks_data_()?.some(({ query_id: query_id
|
|
4431
|
+
return quicklinks_data_()?.some(({ query_id: query_id })=>query_id === current_id);
|
|
4529
4432
|
});
|
|
4530
4433
|
const href = (0, $diwD4$solidjs.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
|
|
4531
4434
|
(0, $1ab22f2cd39b3061$export$43cd1e747fecd42e)({
|
|
@@ -4551,7 +4454,7 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4551
4454
|
|
|
4552
4455
|
const $276380e4607fb9fb$var$max_history_change_frequency = 300;
|
|
4553
4456
|
const $276380e4607fb9fb$var$api_max_products_per_request = 100;
|
|
4554
|
-
function $276380e4607fb9fb$export$6e49da55e449af7c({ scroll_restoration_data_: [, set_scroll_restoration_data]
|
|
4457
|
+
function $276380e4607fb9fb$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_ }) {
|
|
4555
4458
|
// store last actually seen (within viewport) product in history.state
|
|
4556
4459
|
let last_time_history_changed = 0;
|
|
4557
4460
|
let set_to_later;
|
|
@@ -4600,8 +4503,8 @@ function $276380e4607fb9fb$export$6e49da55e449af7c({ scroll_restoration_data_: [
|
|
|
4600
4503
|
}));
|
|
4601
4504
|
(0, $diwD4$solidjs.onCleanup)(()=>clearTimeout(timeout)); // could cause weird bugs otherwise
|
|
4602
4505
|
}
|
|
4603
|
-
async function $276380e4607fb9fb$export$cc42dd29bf655ab6({ scroll_restoration_data_: [get_scroll_restoration_data]
|
|
4604
|
-
const to_fetch_according_to_state = (0, $diwD4$solidjs.untrack)(get_scroll_restoration_data).find(({ for_id: for_id
|
|
4506
|
+
async function $276380e4607fb9fb$export$cc42dd29bf655ab6({ scroll_restoration_data_: [get_scroll_restoration_data], make_request_: make_request_, min_products_to_fetch_: min_products_to_fetch_, id_: id_ }) {
|
|
4507
|
+
const to_fetch_according_to_state = (0, $diwD4$solidjs.untrack)(get_scroll_restoration_data).find(({ for_id: for_id })=>for_id === id_)?.min_results_loaded ?? 0;
|
|
4605
4508
|
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.
|
|
4606
4509
|
if (total_products_to_fetch <= $276380e4607fb9fb$var$api_max_products_per_request) return await make_request_(total_products_to_fetch);
|
|
4607
4510
|
const displays = [];
|
|
@@ -4673,8 +4576,6 @@ let $0b6e2070a98de347$export$44dad306455dddf;
|
|
|
4673
4576
|
|
|
4674
4577
|
|
|
4675
4578
|
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
4579
|
const $47e2cc552c02110c$var$_tmpl$ = [
|
|
4679
4580
|
"<div",
|
|
4680
4581
|
' class="statement">',
|
|
@@ -4692,7 +4593,7 @@ function $47e2cc552c02110c$export$8895d39404bd2bb1(props) {
|
|
|
4692
4593
|
// if we get called to close the toast before it has shown, never show it
|
|
4693
4594
|
show_configured_toast = ()=>{};
|
|
4694
4595
|
};
|
|
4695
|
-
const { user_triggered_: user_triggered_
|
|
4596
|
+
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;
|
|
4696
4597
|
const previous_selected_filters = (0, $diwD4$solidjs.untrack)(get_selected_filters);
|
|
4697
4598
|
if (!previous_selected_filters.length) {
|
|
4698
4599
|
// no filters selected, still clear sorting if applicable but don't display a toast for that since it's very minor
|
|
@@ -4724,7 +4625,7 @@ function $47e2cc552c02110c$export$8895d39404bd2bb1(props) {
|
|
|
4724
4625
|
}));
|
|
4725
4626
|
});
|
|
4726
4627
|
let show_configured_toast = ()=>{
|
|
4727
|
-
({ close_toast_: close_toast_
|
|
4628
|
+
({ close_toast_: close_toast_ } = (0, $ee498ec5e7dc2bba$export$5196e4c01fa56fcb)({
|
|
4728
4629
|
class: "cleared_filters",
|
|
4729
4630
|
close_after_: 30000,
|
|
4730
4631
|
on_close_: on_toast_hidden,
|
|
@@ -4739,7 +4640,7 @@ function $47e2cc552c02110c$export$8895d39404bd2bb1(props) {
|
|
|
4739
4640
|
}
|
|
4740
4641
|
|
|
4741
4642
|
|
|
4742
|
-
function $ef972f5c10b1c5b4$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_
|
|
4643
|
+
function $ef972f5c10b1c5b4$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_ }) {
|
|
4743
4644
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
4744
4645
|
$ef972f5c10b1c5b4$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
4745
4646
|
plp_results_: plp_results_,
|
|
@@ -4766,7 +4667,7 @@ function $ef972f5c10b1c5b4$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4766
4667
|
const went_downwards = previous_length < new_length;
|
|
4767
4668
|
const shorter_array = went_upwards ? new_crumb_data : previous_crumb_data;
|
|
4768
4669
|
const longer_array = went_upwards ? previous_crumb_data : new_crumb_data;
|
|
4769
|
-
if (!((went_upwards || went_downwards) && shorter_array.every(({ query_id: query_id
|
|
4670
|
+
if (!((went_upwards || went_downwards) && shorter_array.every(({ query_id: query_id }, index)=>longer_array[index].query_id === query_id))) {
|
|
4770
4671
|
// We went sideways, not up or down. Clear filters.
|
|
4771
4672
|
(0, $47e2cc552c02110c$export$8895d39404bd2bb1)({
|
|
4772
4673
|
user_triggered_: false,
|
|
@@ -4785,7 +4686,7 @@ function $ef972f5c10b1c5b4$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4785
4686
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
4786
4687
|
})));
|
|
4787
4688
|
}
|
|
4788
|
-
function $ef972f5c10b1c5b4$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_
|
|
4689
|
+
function $ef972f5c10b1c5b4$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_] }) {
|
|
4789
4690
|
const tracking_function_for_plp_results = (0, $diwD4$solidjs.createReaction)(()=>{
|
|
4790
4691
|
// 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
|
|
4791
4692
|
if (!(0, $diwD4$solidjs.untrack)(get_sideways_filter_clearing_flag_)) return;
|
|
@@ -4808,10 +4709,36 @@ function $ef972f5c10b1c5b4$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
4808
4709
|
|
|
4809
4710
|
|
|
4810
4711
|
|
|
4811
|
-
|
|
4812
4712
|
const $6b502b1b2155a0bc$export$5c28802497c8a83c = /*@__PURE__*/ Symbol("category_title_type");
|
|
4813
4713
|
|
|
4814
4714
|
|
|
4715
|
+
|
|
4716
|
+
function $6a8e766e914723d8$export$d31a1a1a83ad9413(plp_results_, [get_selected_filters, set_selected_filters]) {
|
|
4717
|
+
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
4718
|
+
const available_filters = plp_results_()?.filters;
|
|
4719
|
+
if (!available_filters) return;
|
|
4720
|
+
const selected_filters = get_selected_filters();
|
|
4721
|
+
if (!selected_filters) return;
|
|
4722
|
+
const new_filters = [];
|
|
4723
|
+
let modified_filters = false;
|
|
4724
|
+
for(let i = 0; i < selected_filters.length; i++){
|
|
4725
|
+
const selected_filter = selected_filters[i];
|
|
4726
|
+
const available_filter = available_filters.find((available_filter)=>available_filter.field === selected_filter.field && available_filter.op === selected_filter.op);
|
|
4727
|
+
const available_filter_old_filter_link = available_filters.find((available_filter)=>available_filter.actual_field === selected_filter.field && available_filter.op === selected_filter.op);
|
|
4728
|
+
if (!available_filter && available_filter_old_filter_link) {
|
|
4729
|
+
new_filters.push({
|
|
4730
|
+
...selected_filter,
|
|
4731
|
+
field: available_filter_old_filter_link.field
|
|
4732
|
+
}); // <- Change the field to be the new field which actually is group_title
|
|
4733
|
+
modified_filters = true;
|
|
4734
|
+
} else new_filters.push(selected_filter);
|
|
4735
|
+
}
|
|
4736
|
+
if (modified_filters) // This will unfortunately trigger a refetch which isn't great UX but it's the best we can do for now
|
|
4737
|
+
set_selected_filters(new_filters);
|
|
4738
|
+
});
|
|
4739
|
+
}
|
|
4740
|
+
|
|
4741
|
+
|
|
4815
4742
|
const $840d88a04b2d22a7$var$_tmpl$ = [
|
|
4816
4743
|
"<div",
|
|
4817
4744
|
' class="product-count"><!--#-->',
|
|
@@ -4837,7 +4764,7 @@ const $840d88a04b2d22a7$var$_tmpl$ = [
|
|
|
4837
4764
|
"<!--/--><!--#-->",
|
|
4838
4765
|
"<!--/--></div>"
|
|
4839
4766
|
];
|
|
4840
|
-
function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_
|
|
4767
|
+
function $840d88a04b2d22a7$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_ }) {
|
|
4841
4768
|
let results_for;
|
|
4842
4769
|
let only_show_filters_opener_;
|
|
4843
4770
|
let middle_elements_;
|
|
@@ -4929,6 +4856,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4929
4856
|
return i18n_.product_();
|
|
4930
4857
|
}
|
|
4931
4858
|
})));
|
|
4859
|
+
(0, $6a8e766e914723d8$export$d31a1a1a83ad9413)(plp_results_, selected_filters_);
|
|
4932
4860
|
// 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
|
|
4933
4861
|
if (category_title_type === "simple") {
|
|
4934
4862
|
const CategoryTitleComponent = category_title_;
|
|
@@ -4941,7 +4869,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4941
4869
|
}
|
|
4942
4870
|
});
|
|
4943
4871
|
} else if (category_title_type == "interactive") {
|
|
4944
|
-
({ middle_elements_: middle_elements_
|
|
4872
|
+
({ middle_elements_: middle_elements_, only_show_filters_opener_: only_show_filters_opener_, on_filters_constructed_: on_filters_constructed_ } = category_title_({
|
|
4945
4873
|
make_product_count_: make_product_count_,
|
|
4946
4874
|
is_slim_: is_slim_,
|
|
4947
4875
|
set_observed_results_filters_elements_: set_observed_results_filters_elements_,
|
|
@@ -5260,12 +5188,12 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5260
5188
|
const [get_current_href, set_current_href] = (0, $diwD4$solidjs.createSignal)(globalThis?.location?.href ?? "https://example.com");
|
|
5261
5189
|
const history_change_handler = (0, $diwD4$depictaiutilishared.catchify)(()=>set_current_href(location.href));
|
|
5262
5190
|
const owner = (0, $diwD4$solidjs.getOwner)() || (0, $diwD4$solidjs.createRoot)(()=>(0, $diwD4$solidjs.getOwner)());
|
|
5263
|
-
const { sorting_query_param_: sorting_query_param_
|
|
5191
|
+
const { sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = options;
|
|
5264
5192
|
let writer_started = false;
|
|
5265
5193
|
(0, $diwD4$depictaiutilishared.instant_exec_on_suspect_history_change).add(history_change_handler);
|
|
5266
5194
|
(0, $diwD4$solidjs.onCleanup)(()=>(0, $diwD4$depictaiutilishared.instant_exec_on_suspect_history_change).delete(history_change_handler));
|
|
5267
5195
|
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
5268
|
-
const { searchParams: searchParams
|
|
5196
|
+
const { searchParams: searchParams } = new URL(get_current_href());
|
|
5269
5197
|
(0, $diwD4$solidjs.batch)(()=>{
|
|
5270
5198
|
const found_sorting = (0, $1ab22f2cd39b3061$export$766e9676e74997d3)(searchParams, sorting_query_param_);
|
|
5271
5199
|
if (found_sorting) {
|
|
@@ -5275,7 +5203,7 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5275
5203
|
} else set_sorting();
|
|
5276
5204
|
const found_filters = (0, $1ab22f2cd39b3061$export$f934fa24c3a86811)(searchParams, filter_query_param_prefix_);
|
|
5277
5205
|
const selected_filters = (0, $diwD4$solidjs.untrack)(get_selected_filters_);
|
|
5278
|
-
const found_filters_map = new Map(found_filters.map(({ field: field
|
|
5206
|
+
const found_filters_map = new Map(found_filters.map(({ field: field, op: op, data: data })=>[
|
|
5279
5207
|
JSON.stringify([
|
|
5280
5208
|
field,
|
|
5281
5209
|
op
|
|
@@ -5283,7 +5211,7 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5283
5211
|
data
|
|
5284
5212
|
]));
|
|
5285
5213
|
// Sorry for this diffing algorithm lol. Looking forwards to Records and Tuples.
|
|
5286
|
-
if (selected_filters.length !== found_filters.length || !selected_filters.every(({ field: field
|
|
5214
|
+
if (selected_filters.length !== found_filters.length || !selected_filters.every(({ field: field, op: op, data: data })=>JSON.stringify(found_filters_map.get(JSON.stringify([
|
|
5287
5215
|
field,
|
|
5288
5216
|
op
|
|
5289
5217
|
]))) === JSON.stringify(data))) set_selected_filters(found_filters);
|
|
@@ -5319,7 +5247,7 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5319
5247
|
}
|
|
5320
5248
|
/**
|
|
5321
5249
|
* Writes the sorting and filters to the URL query parameters when they change.
|
|
5322
|
-
*/ function $c79fd10a3ab7d6e0$var$start_href_writer({ get_sorting_: get_sorting_
|
|
5250
|
+
*/ function $c79fd10a3ab7d6e0$var$start_href_writer({ get_sorting_: get_sorting_, get_selected_filters_: get_selected_filters_, router_: router_, get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
5323
5251
|
(0, $diwD4$solidjs.createEffect)((0, $diwD4$solidjs.on)([
|
|
5324
5252
|
get_sorting_,
|
|
5325
5253
|
get_selected_filters_,
|
|
@@ -5327,7 +5255,7 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5327
5255
|
], ([sorting, filters, has_sideways_filter_clearing_flag])=>{
|
|
5328
5256
|
const current_href = location.href;
|
|
5329
5257
|
const url_object = new URL(current_href);
|
|
5330
|
-
const { searchParams: searchParams
|
|
5258
|
+
const { searchParams: searchParams } = url_object;
|
|
5331
5259
|
(0, $1ab22f2cd39b3061$export$916e6850778505f6)(searchParams, filter_query_param_prefix_, sorting_query_param_);
|
|
5332
5260
|
(0, $1ab22f2cd39b3061$export$62acb285a7579555)(sorting, searchParams, sorting_query_param_);
|
|
5333
5261
|
(0, $1ab22f2cd39b3061$export$58aa3f171519b6d7)(filters, searchParams, filter_query_param_prefix_);
|
|
@@ -5364,7 +5292,7 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
5364
5292
|
*/ /**
|
|
5365
5293
|
* 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
|
|
5366
5294
|
*/ #throwing_on_navigation(...args) {
|
|
5367
|
-
const { on_navigation_: on_navigation_
|
|
5295
|
+
const { on_navigation_: on_navigation_ } = this;
|
|
5368
5296
|
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
5369
5297
|
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
5370
5298
|
try {
|
|
@@ -5408,7 +5336,7 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
5408
5336
|
* @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
|
|
5409
5337
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
5410
5338
|
* @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
|
|
5411
|
-
*/ go_to_: (0, $diwD4$depictaiutilishared.catchify)(async ({ new_url_: raw_new_url
|
|
5339
|
+
*/ go_to_: (0, $diwD4$depictaiutilishared.catchify)(async ({ new_url_: raw_new_url, event_: event_, force_spa_navigation_: force_spa_navigation_, is_replace_: is_replace_, category_query_id_: category_query_id_, scroll: scroll = true })=>{
|
|
5412
5340
|
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
5413
5341
|
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
5414
5342
|
if (this.#dont_attempt_navigation(event_)) return;
|
|
@@ -5446,7 +5374,6 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
5446
5374
|
}
|
|
5447
5375
|
|
|
5448
5376
|
|
|
5449
|
-
|
|
5450
5377
|
const $48567ac5b39bac56$var$_tmpl$ = [
|
|
5451
5378
|
"<div",
|
|
5452
5379
|
' class="depict plp category">',
|
|
@@ -5454,7 +5381,7 @@ const $48567ac5b39bac56$var$_tmpl$ = [
|
|
|
5454
5381
|
];
|
|
5455
5382
|
const $48567ac5b39bac56$var$min_products_to_fetch_ = 20;
|
|
5456
5383
|
const $48567ac5b39bac56$var$privately_shared_properties = /*@__PURE__*/ new WeakMap();
|
|
5457
|
-
const $48567ac5b39bac56$var$InExternalAreaDiv = ({ children: children
|
|
5384
|
+
const $48567ac5b39bac56$var$InExternalAreaDiv = ({ children: children })=>(0, $diwD4$solidjsweb.ssr)($48567ac5b39bac56$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)() + (0, $diwD4$solidjsweb.ssrAttribute)("id", (0, $diwD4$solidjsweb.escape)((0, $0b6e2070a98de347$export$44dad306455dddf).PLP_CATEGORY, true), false), (0, $diwD4$solidjsweb.escape)(children));
|
|
5458
5385
|
class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
5459
5386
|
#router;
|
|
5460
5387
|
#locale_signal = (0, $diwD4$solidjs.createSignal)();
|
|
@@ -5501,7 +5428,7 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
5501
5428
|
set on_navigation(new_function) {
|
|
5502
5429
|
this.#router.on_navigation_ = new_function;
|
|
5503
5430
|
}
|
|
5504
|
-
constructor({ api: api
|
|
5431
|
+
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 }){
|
|
5505
5432
|
const owner = (0, $diwD4$solidjs.getOwner)() || (0, $diwD4$solidjs.createRoot)(()=>(0, $diwD4$solidjs.getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
5506
5433
|
(0, $diwD4$solidjs.runWithOwner)(owner, ()=>{
|
|
5507
5434
|
if ($48567ac5b39bac56$export$f34314aa9505732e.#keys_constructed_with.has(unique_instance_key_for_state) && !(0, $diwD4$solidjsweb.isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
@@ -5511,8 +5438,8 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
5511
5438
|
this.#router = new (0, $e96dd13889871fc0$export$7e1297a3a19f10d8)("hard_navigation", query_id_state_key);
|
|
5512
5439
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
5513
5440
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
5514
|
-
const filter_query_param_prefix_ = "
|
|
5515
|
-
const { selected_filters_: selected_filters_
|
|
5441
|
+
const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
|
|
5442
|
+
const { selected_filters_: selected_filters_, current_sorting_: current_sorting_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ } = (0, $c79fd10a3ab7d6e0$export$477caf01aecaeb2a)({
|
|
5516
5443
|
router_: this.#router,
|
|
5517
5444
|
sorting_query_param_: sorting_query_param_,
|
|
5518
5445
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -5553,11 +5480,11 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
5553
5480
|
}
|
|
5554
5481
|
}
|
|
5555
5482
|
function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
5556
|
-
const { depict_category: depict_category
|
|
5483
|
+
const { depict_category: depict_category, product_card_template: product_card_template, category_title: category_title } = props;
|
|
5557
5484
|
const shared_properties = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
5558
5485
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
5559
5486
|
const grid_spacing_override = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
5560
|
-
const { grid_spacing: grid_spacing
|
|
5487
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
5561
5488
|
return typeof grid_spacing === "string" ? {
|
|
5562
5489
|
grid_spacing: grid_spacing
|
|
5563
5490
|
} : {
|
|
@@ -5565,7 +5492,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
5565
5492
|
grid_spacing: grid_spacing.horizontal
|
|
5566
5493
|
};
|
|
5567
5494
|
});
|
|
5568
|
-
const { state_: { local_filter_cache: local_filter_cache_
|
|
5495
|
+
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;
|
|
5569
5496
|
(0, $diwD4$solidjs.onCleanup)(reset_history_state_);
|
|
5570
5497
|
return (0, $840d88a04b2d22a7$export$f7d2f673fc2f091d)({
|
|
5571
5498
|
tenant_: ()=>depict_category.merchant,
|
|
@@ -5600,8 +5527,8 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
5600
5527
|
});
|
|
5601
5528
|
}, "Entire CategoryPage failed");
|
|
5602
5529
|
}
|
|
5603
|
-
function $48567ac5b39bac56$export$5b7c3ce0ebe51f86({ depict_category: depict_category
|
|
5604
|
-
const { i18n_: i18n_
|
|
5530
|
+
function $48567ac5b39bac56$export$5b7c3ce0ebe51f86({ depict_category: depict_category }) {
|
|
5531
|
+
const { i18n_: i18n_, breadcrumb_signal_: [crumb_data_], router_: router_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
5605
5532
|
return (0, $diwD4$solidjsweb.createComponent)($48567ac5b39bac56$var$InExternalAreaDiv, {
|
|
5606
5533
|
get children () {
|
|
5607
5534
|
return (0, $e53b2e7e632ac4cb$export$5646050d516e06bc)({
|
|
@@ -5614,8 +5541,8 @@ function $48567ac5b39bac56$export$5b7c3ce0ebe51f86({ depict_category: depict_cat
|
|
|
5614
5541
|
}
|
|
5615
5542
|
});
|
|
5616
5543
|
}
|
|
5617
|
-
function $48567ac5b39bac56$export$de035477d6fef996({ depict_category: depict_category
|
|
5618
|
-
const { i18n_: i18n_
|
|
5544
|
+
function $48567ac5b39bac56$export$de035477d6fef996({ depict_category: depict_category }) {
|
|
5545
|
+
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_ } = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
5619
5546
|
return (0, $diwD4$solidjsweb.createComponent)($48567ac5b39bac56$var$InExternalAreaDiv, {
|
|
5620
5547
|
get children () {
|
|
5621
5548
|
return (0, $8cceb1d3a967f369$export$466cdc317043f6cb)({
|
|
@@ -5640,10 +5567,6 @@ function $48567ac5b39bac56$var$get_shared_properties(depict_category) {
|
|
|
5640
5567
|
|
|
5641
5568
|
|
|
5642
5569
|
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
5570
|
const $0b23bfd073d9a4e8$var$_tmpl$ = [
|
|
5648
5571
|
"<div",
|
|
5649
5572
|
' class="category-title"><h1 class="title">',
|
|
@@ -5651,7 +5574,7 @@ const $0b23bfd073d9a4e8$var$_tmpl$ = [
|
|
|
5651
5574
|
"<!--/--></span></div>"
|
|
5652
5575
|
];
|
|
5653
5576
|
const $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
5654
|
-
const actual_function = ({ category_title_: category_title_
|
|
5577
|
+
const actual_function = ({ category_title_: category_title_, product_count_: product_count_ })=>{
|
|
5655
5578
|
return (0, $diwD4$solidjsweb.ssr)($0b23bfd073d9a4e8$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)(category_title_()) || (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
|
|
5656
5579
|
height: "1em",
|
|
5657
5580
|
width: "10ch"
|
|
@@ -5667,8 +5590,6 @@ const $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
|
5667
5590
|
|
|
5668
5591
|
|
|
5669
5592
|
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
5593
|
const $85b747260aa175c9$var$_tmpl$ = [
|
|
5673
5594
|
"<div",
|
|
5674
5595
|
' 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"><!--#-->',
|
|
@@ -5677,7 +5598,7 @@ const $85b747260aa175c9$var$_tmpl$ = [
|
|
|
5677
5598
|
"<!--/--></div></div></div>"
|
|
5678
5599
|
];
|
|
5679
5600
|
const $85b747260aa175c9$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
5680
|
-
const actual_function = ({ make_product_count_: make_product_count_
|
|
5601
|
+
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_ })=>{
|
|
5681
5602
|
// 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
|
|
5682
5603
|
let extra_sort_button_;
|
|
5683
5604
|
let extra_filter_button_;
|
|
@@ -5834,16 +5755,9 @@ async function $63b10c9f461e0ef6$var$download_categories(tenant, market, type) {
|
|
|
5834
5755
|
|
|
5835
5756
|
|
|
5836
5757
|
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
5758
|
function $3bc4a89b971a3af5$export$3f37af283f8fb843(props) {
|
|
5845
5759
|
const style = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
5846
|
-
const { style: style
|
|
5760
|
+
const { style: style, height: height, width: width, aspectRatio: aspectRatio } = props;
|
|
5847
5761
|
const is_image = aspectRatio != undefined;
|
|
5848
5762
|
const size_data = is_image ? {
|
|
5849
5763
|
width: "100%",
|
|
@@ -5888,10 +5802,6 @@ function $6f604560873e4f69$export$ee1733d9a8495996() {
|
|
|
5888
5802
|
|
|
5889
5803
|
|
|
5890
5804
|
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
5805
|
const $dae23104ba8bb78c$var$_tmpl$ = [
|
|
5896
5806
|
"<span",
|
|
5897
5807
|
' class="parent-title">',
|
|
@@ -5903,7 +5813,7 @@ const $dae23104ba8bb78c$var$_tmpl$ = [
|
|
|
5903
5813
|
"</span><!--#-->",
|
|
5904
5814
|
"<!--/--></a>"
|
|
5905
5815
|
];
|
|
5906
|
-
function $dae23104ba8bb78c$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_
|
|
5816
|
+
function $dae23104ba8bb78c$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_, router_: router_ }) {
|
|
5907
5817
|
return (0, $diwD4$solidjsweb.ssr)($dae23104ba8bb78c$var$_tmpl$2, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.ssrAttribute)("href", (0, $diwD4$solidjsweb.escape)(category_suggestion_().page_url, true), false), (0, $diwD4$solidjsweb.escape)(category_suggestion_().title), (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
5908
5818
|
get when () {
|
|
5909
5819
|
return typeof category_suggestion_().parent_title === "string";
|
|
@@ -5919,12 +5829,6 @@ function $dae23104ba8bb78c$export$d757d54550ebfb3d({ category_suggestion_: categ
|
|
|
5919
5829
|
|
|
5920
5830
|
|
|
5921
5831
|
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
5832
|
const $3df11fc61432d1fd$var$_tmpl$ = [
|
|
5929
5833
|
"<svg",
|
|
5930
5834
|
' 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>'
|
|
@@ -5936,7 +5840,6 @@ function $3df11fc61432d1fd$export$1c641004b5485fed() {
|
|
|
5936
5840
|
|
|
5937
5841
|
|
|
5938
5842
|
|
|
5939
|
-
|
|
5940
5843
|
const $87d7574e1d89d69b$var$_tmpl$ = '<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>';
|
|
5941
5844
|
function $87d7574e1d89d69b$export$82eafebb825fc23f(props = {}) {
|
|
5942
5845
|
return (0, $diwD4$solidjsweb.ssrElement)("svg", ()=>({
|
|
@@ -5965,7 +5868,7 @@ const $66b8b9a9613c141d$var$_tmpl$ = [
|
|
|
5965
5868
|
">",
|
|
5966
5869
|
"</button></div>"
|
|
5967
5870
|
];
|
|
5968
|
-
function $66b8b9a9613c141d$export$b94867ecbd698f21({ search_field_value_: search_field_value_
|
|
5871
|
+
function $66b8b9a9613c141d$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_ }) {
|
|
5969
5872
|
let input_element;
|
|
5970
5873
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
5971
5874
|
let field_div;
|
|
@@ -5993,10 +5896,6 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
5993
5896
|
|
|
5994
5897
|
|
|
5995
5898
|
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
5899
|
const $fb29c6201c369e39$var$_tmpl$ = [
|
|
6001
5900
|
"<div",
|
|
6002
5901
|
' class="search-recs"><h3 class="search-recs-title">',
|
|
@@ -6009,7 +5908,7 @@ const $fb29c6201c369e39$var$_tmpl$ = [
|
|
|
6009
5908
|
"</button>"
|
|
6010
5909
|
];
|
|
6011
5910
|
const $fb29c6201c369e39$export$1c8c715550dc689d = 2;
|
|
6012
|
-
function $fb29c6201c369e39$export$7de92c4c2205ebf3({ depict_api_: depict_api_
|
|
5911
|
+
function $fb29c6201c369e39$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_ }) {
|
|
6013
5912
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6014
5913
|
const rows_object = view_more_button_ ? $fb29c6201c369e39$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6015
5914
|
const [recommendations_resource] = (0, $diwD4$solidjs.createResource)(search_query_base_, (query)=>depict_api_.get_recommended(query).then((r)=>r.displays));
|
|
@@ -6095,7 +5994,7 @@ function $fd463ff0edb29915$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6095
5994
|
let ro;
|
|
6096
5995
|
if (one_axies_only !== "top") {
|
|
6097
5996
|
ro = new ResizeObserver((0, $diwD4$depictaiutilishared.catchify)((records)=>{
|
|
6098
|
-
records.forEach(({ contentRect: { width: width
|
|
5997
|
+
records.forEach(({ contentRect: { width: width } })=>{
|
|
6099
5998
|
if (width_transformer) width = width_transformer(width);
|
|
6100
5999
|
modal_body_style[1]((old_value)=>({
|
|
6101
6000
|
...old_value,
|
|
@@ -6125,7 +6024,7 @@ function $fd463ff0edb29915$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6125
6024
|
|
|
6126
6025
|
|
|
6127
6026
|
|
|
6128
|
-
function $b34ce0b89e6db4e1$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_
|
|
6027
|
+
function $b34ce0b89e6db4e1$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_ }) {
|
|
6129
6028
|
const [get_selected_filters] = selected_filters_;
|
|
6130
6029
|
// Possible values:
|
|
6131
6030
|
// 0 - we should not clear next submit
|
|
@@ -6190,7 +6089,7 @@ function $2b7a005a65221045$export$84bba84a7b837187(read_search_query) {
|
|
|
6190
6089
|
|
|
6191
6090
|
|
|
6192
6091
|
|
|
6193
|
-
async function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
6092
|
+
async function $f328bd45f8ede33c$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 }) {
|
|
6194
6093
|
const new_search_query = get_new_query();
|
|
6195
6094
|
const previous_query = (0, $diwD4$solidjs.untrack)(get_search_query_);
|
|
6196
6095
|
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
@@ -6221,14 +6120,6 @@ async function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchan
|
|
|
6221
6120
|
|
|
6222
6121
|
|
|
6223
6122
|
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
6123
|
/**
|
|
6233
6124
|
* Expand an object where every value in the top-level is an accessor into a normal object. Used for converting solid_i18n objects into external i18n typed objects.
|
|
6234
6125
|
*/ const $639c124c22b6cbaa$export$27b710c08412a7ad = (obj)=>{
|
|
@@ -6244,10 +6135,6 @@ async function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchan
|
|
|
6244
6135
|
|
|
6245
6136
|
|
|
6246
6137
|
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
6138
|
const $6ae613870d3380fc$var$_tmpl$ = [
|
|
6252
6139
|
"<span",
|
|
6253
6140
|
' class="orig price"><!--#-->',
|
|
@@ -6272,7 +6159,7 @@ const $6ae613870d3380fc$var$_tmpl$ = [
|
|
|
6272
6159
|
' class="tagline">',
|
|
6273
6160
|
"</div>"
|
|
6274
6161
|
];
|
|
6275
|
-
const $6ae613870d3380fc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n
|
|
6162
|
+
const $6ae613870d3380fc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n }, router_)=>{
|
|
6276
6163
|
const search_result_id = (0, $diwD4$solidjs.createMemo)(()=>display_or_variant_container().search_result_id);
|
|
6277
6164
|
const display = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
6278
6165
|
const display = display_or_variant_container();
|
|
@@ -6337,7 +6224,7 @@ const $6ae556e536054e87$var$_tmpl$ = [
|
|
|
6337
6224
|
' class="instant-results">',
|
|
6338
6225
|
"</div>"
|
|
6339
6226
|
];
|
|
6340
|
-
function $6ae556e536054e87$export$62f101a8aa597bf8({ depict_api_: depict_api_
|
|
6227
|
+
function $6ae556e536054e87$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_ }) {
|
|
6341
6228
|
const max_cards = 4;
|
|
6342
6229
|
const [read_current_instant_query, write_current_instant_query] = (0, $diwD4$solidjs.createSignal)("");
|
|
6343
6230
|
let timeout;
|
|
@@ -6410,11 +6297,7 @@ function $6ae556e536054e87$export$62f101a8aa597bf8({ depict_api_: depict_api_ ,
|
|
|
6410
6297
|
|
|
6411
6298
|
|
|
6412
6299
|
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_ , value_: value_ , url_transformer_: url_transformer_ }) {
|
|
6300
|
+
function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_, value_: value_, url_transformer_: url_transformer_ }) {
|
|
6418
6301
|
const [get_current_href, set_current_href] = (0, $diwD4$solidjs.createSignal)(location.href);
|
|
6419
6302
|
const [exit_iterable, exitable_iterable] = (0, $diwD4$depictaiutilishared.make_asyncIterable_exiter)((0, $diwD4$depictaiutilishared.href_change_ipns));
|
|
6420
6303
|
(0, $diwD4$solidjs.onCleanup)(exit_iterable);
|
|
@@ -6433,7 +6316,6 @@ function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_ , value_: va
|
|
|
6433
6316
|
|
|
6434
6317
|
|
|
6435
6318
|
|
|
6436
|
-
|
|
6437
6319
|
const $9e30168c4b1661d2$var$_tmpl$ = [
|
|
6438
6320
|
"<svg",
|
|
6439
6321
|
' 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>'
|
|
@@ -6459,7 +6341,7 @@ const $9a268bf73b31a717$var$_tmpl$ = [
|
|
|
6459
6341
|
">",
|
|
6460
6342
|
"</button></a>"
|
|
6461
6343
|
];
|
|
6462
|
-
function $9a268bf73b31a717$export$a146ac6fa8346a25({ text_: text_
|
|
6344
|
+
function $9a268bf73b31a717$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_ }) {
|
|
6463
6345
|
const has_entries = (0, $diwD4$solidjs.createMemo)(()=>previous_searches_().length >= 1);
|
|
6464
6346
|
currently_showing_suggestions_[1]((value)=>{
|
|
6465
6347
|
value[0] = (0, $diwD4$solidjs.createMemo)(()=>previous_searches_().map((result)=>({
|
|
@@ -6502,12 +6384,6 @@ function $9a268bf73b31a717$export$a146ac6fa8346a25({ text_: text_ , previous_sea
|
|
|
6502
6384
|
|
|
6503
6385
|
|
|
6504
6386
|
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
6387
|
const $d023ed916c84e75d$var$_tmpl$ = [
|
|
6512
6388
|
"<span",
|
|
6513
6389
|
' class="highlighted-part">',
|
|
@@ -6518,7 +6394,7 @@ const $d023ed916c84e75d$var$_tmpl$ = [
|
|
|
6518
6394
|
'">',
|
|
6519
6395
|
"</span>"
|
|
6520
6396
|
];
|
|
6521
|
-
function $d023ed916c84e75d$export$ba17c5b7e6dda39f({ whole_text_to_display_: whole_text_to_display_memo
|
|
6397
|
+
function $d023ed916c84e75d$export$ba17c5b7e6dda39f({ whole_text_to_display_: whole_text_to_display_memo, searching_for_value_: searching_for_value_memo, class_: class_ }) {
|
|
6522
6398
|
const [get_has_highlighted, set_has_highlighted] = (0, $diwD4$solidjs.createSignal)(false);
|
|
6523
6399
|
const text_itself = (0, $diwD4$solidjs.createMemo)(()=>(0, $diwD4$solidjs.batch)(()=>{
|
|
6524
6400
|
set_has_highlighted(false);
|
|
@@ -6609,10 +6485,10 @@ const $6b65ba8af12c5a26$var$_tmpl$ = [
|
|
|
6609
6485
|
"<!--/--><!--#-->",
|
|
6610
6486
|
"<!--/--></div>"
|
|
6611
6487
|
];
|
|
6612
|
-
function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_
|
|
6613
|
-
const queries_memo = (0, $diwD4$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type
|
|
6488
|
+
function $6b65ba8af12c5a26$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_ }) {
|
|
6489
|
+
const queries_memo = (0, $diwD4$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type, title: title })=>type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
|
|
6614
6490
|
));
|
|
6615
|
-
const not_queries_memo = (0, $diwD4$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type
|
|
6491
|
+
const not_queries_memo = (0, $diwD4$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type })=>type !== (0, $3ec9e21d6b6debdd$export$3cf9497e790da491)));
|
|
6616
6492
|
const render_entry = (input_obj, autocomplete_data_index, index, is_history = false)=>{
|
|
6617
6493
|
const is_query = (0, $diwD4$solidjs.createMemo)(()=>input_obj().type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491));
|
|
6618
6494
|
const href_with_changed_params_accessor = (0, $diwD4$solidjs.createMemo)(()=>is_query() ? (0, $496cde876b53ce1e$export$91c3b6774e8be0f5)({
|
|
@@ -6747,14 +6623,11 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
6747
6623
|
|
|
6748
6624
|
|
|
6749
6625
|
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
6626
|
const $6a374b16bfe947d0$var$_tmpl$ = [
|
|
6754
6627
|
"<a",
|
|
6755
6628
|
' target="_blank"></a>'
|
|
6756
6629
|
];
|
|
6757
|
-
function $6a374b16bfe947d0$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index]
|
|
6630
|
+
function $6a374b16bfe947d0$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index], currently_showing_suggestions_: [read_currently_showing_suggestions], ...rest_of_props }) {
|
|
6758
6631
|
const last_suggestion_index_ = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
6759
6632
|
const currently_showing_suggestions = read_currently_showing_suggestions();
|
|
6760
6633
|
let total_length = 0;
|
|
@@ -6809,13 +6682,13 @@ function $6a374b16bfe947d0$export$217899a935ef803b({ selected_index_: [read_sele
|
|
|
6809
6682
|
write_selected_fake_index_: write_selected_fake_index_
|
|
6810
6683
|
});
|
|
6811
6684
|
}
|
|
6812
|
-
function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_: element_
|
|
6685
|
+
function $6a374b16bfe947d0$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_ }) {
|
|
6813
6686
|
let previous_value;
|
|
6814
6687
|
(0, $diwD4$solidjs.createEffect)(()=>{
|
|
6815
6688
|
const sfv = get_search_field_value();
|
|
6816
6689
|
if (!(0, $diwD4$solidjs.untrack)(()=>read_updating_blocked())) previous_value = sfv;
|
|
6817
6690
|
});
|
|
6818
|
-
const handler = (0, $diwD4$depictaiutilishared.catchify)(({ keyCode: keyCode
|
|
6691
|
+
const handler = (0, $diwD4$depictaiutilishared.catchify)(({ keyCode: keyCode })=>(0, $diwD4$solidjs.untrack)(()=>{
|
|
6819
6692
|
const up = keyCode === 38;
|
|
6820
6693
|
const down = keyCode === 40;
|
|
6821
6694
|
if (!up && !down) return;
|
|
@@ -6842,7 +6715,7 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_
|
|
|
6842
6715
|
};
|
|
6843
6716
|
// update text field value if needed
|
|
6844
6717
|
if (selected_entry?.type == "query") {
|
|
6845
|
-
const { title: title
|
|
6718
|
+
const { title: title } = selected_entry;
|
|
6846
6719
|
block_updating_for_one_change();
|
|
6847
6720
|
set_search_field_value(title);
|
|
6848
6721
|
override_on_enter_for_this_entry((e)=>{
|
|
@@ -6854,7 +6727,7 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_
|
|
|
6854
6727
|
return $6a374b16bfe947d0$var$open_link_on_cmd_pressed(e, url.href);
|
|
6855
6728
|
});
|
|
6856
6729
|
} else if (selected_entry?.type == "category") override_on_enter_for_this_entry((e)=>{
|
|
6857
|
-
const { page_url: page_url
|
|
6730
|
+
const { page_url: page_url } = selected_entry;
|
|
6858
6731
|
if (!$6a374b16bfe947d0$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
|
|
6859
6732
|
router_.navigate_.go_to_({
|
|
6860
6733
|
new_url_: page_url,
|
|
@@ -6888,7 +6761,7 @@ function $6a374b16bfe947d0$var$open_link_on_cmd_pressed(e, href) {
|
|
|
6888
6761
|
|
|
6889
6762
|
|
|
6890
6763
|
const $3ec9e21d6b6debdd$export$3cf9497e790da491 = "query";
|
|
6891
|
-
function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_
|
|
6764
|
+
function $3ec9e21d6b6debdd$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_ }) {
|
|
6892
6765
|
const [searching_for_value, set_searching_for_value] = (0, $diwD4$solidjs.createSignal)();
|
|
6893
6766
|
const [read_search_field_value] = search_field_value_;
|
|
6894
6767
|
const updating_blocked = (0, $diwD4$solidjs.createSignal)(false);
|
|
@@ -6902,7 +6775,7 @@ function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
6902
6775
|
write_suggestion_signal([]);
|
|
6903
6776
|
return;
|
|
6904
6777
|
}
|
|
6905
|
-
const new_value = api_response.suggestions.sort(({ type: a_type
|
|
6778
|
+
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
|
|
6906
6779
|
)=>a_type === $3ec9e21d6b6debdd$export$3cf9497e790da491 && b_type === $3ec9e21d6b6debdd$export$3cf9497e790da491 || a_type !== $3ec9e21d6b6debdd$export$3cf9497e790da491 && b_type !== $3ec9e21d6b6debdd$export$3cf9497e790da491 ? 0 : a_type === $3ec9e21d6b6debdd$export$3cf9497e790da491 ? -1 : 1);
|
|
6907
6780
|
write_suggestion_signal(new_value);
|
|
6908
6781
|
selected_index_[1](undefined); // reset selected index on new results
|
|
@@ -6947,7 +6820,7 @@ function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
6947
6820
|
search_query_param_name_: search_query_url_param_name_,
|
|
6948
6821
|
text_: previous_searches_text_,
|
|
6949
6822
|
get previous_searches_ () {
|
|
6950
|
-
return (0, $diwD4$solidjs.createMemo)(()=>filtered_previous_searches().slice(0,
|
|
6823
|
+
return (0, $diwD4$solidjs.createMemo)(()=>filtered_previous_searches().slice(0, 3));
|
|
6951
6824
|
},
|
|
6952
6825
|
selected_index_: selected_index_,
|
|
6953
6826
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
@@ -6964,7 +6837,7 @@ function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
6964
6837
|
const value = searching_for_value()?.toLowerCase();
|
|
6965
6838
|
if (!value) return false;
|
|
6966
6839
|
return search.includes(value) || value.includes(search);
|
|
6967
|
-
}).slice(0,
|
|
6840
|
+
}).slice(0, 2);
|
|
6968
6841
|
});
|
|
6969
6842
|
},
|
|
6970
6843
|
on_previous_searches_page_: show_previous_searches_component,
|
|
@@ -7006,14 +6879,14 @@ function $341a019928b8b91e$export$c7e181728ad525f(url) {
|
|
|
7006
6879
|
}
|
|
7007
6880
|
|
|
7008
6881
|
|
|
7009
|
-
function $036d367ce3058351$export$3340fdd8259bd4fd({ get_search_field_value_: get_search_field_value_
|
|
6882
|
+
function $036d367ce3058351$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_ }) {
|
|
7010
6883
|
// @ts-ignore
|
|
7011
6884
|
if (process.env.GA === "false") return;
|
|
7012
6885
|
let debounce_timeout;
|
|
7013
6886
|
const stop_timeout = ()=>clearTimeout(debounce_timeout);
|
|
7014
6887
|
const send_to_ga = (0, $diwD4$depictaiutilishared.catchify)(()=>{
|
|
7015
6888
|
const fake_url = new URL(location.href);
|
|
7016
|
-
const { searchParams: searchParams
|
|
6889
|
+
const { searchParams: searchParams } = fake_url;
|
|
7017
6890
|
searchParams.set(search_query_url_param_name_, (0, $diwD4$solidjs.untrack)(get_search_field_value_));
|
|
7018
6891
|
searchParams.set("instant_result", "true");
|
|
7019
6892
|
url_transformer_?.(fake_url);
|
|
@@ -7041,7 +6914,6 @@ function $036d367ce3058351$export$3340fdd8259bd4fd({ get_search_field_value_: ge
|
|
|
7041
6914
|
|
|
7042
6915
|
|
|
7043
6916
|
|
|
7044
|
-
|
|
7045
6917
|
const $2be658935c4043a9$export$af8311b651139246 = (css_properties)=>{
|
|
7046
6918
|
return Object.entries(css_properties).map(([key, value])=>`${key}: ${value};`).join(" ");
|
|
7047
6919
|
};
|
|
@@ -7089,7 +6961,7 @@ const $f40a47a30a358305$var$_tmpl$ = [
|
|
|
7089
6961
|
'"><div class="depict-search-modal-backdrop"></div><!--#-->',
|
|
7090
6962
|
"<!--/--></div>"
|
|
7091
6963
|
];
|
|
7092
|
-
function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: props_search_field_value
|
|
6964
|
+
function $f40a47a30a358305$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, $diwD4$solidjs.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_ }) {
|
|
7093
6965
|
let on_enter_in_search_field_function;
|
|
7094
6966
|
// 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.
|
|
7095
6967
|
// 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
|
|
@@ -7107,7 +6979,7 @@ function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
7107
6979
|
const [get_search_field_value_] = search_field_value_;
|
|
7108
6980
|
const [elements_outside_scrollable, set_elements_outside_scrollable] = (0, $diwD4$solidjs.createSignal)();
|
|
7109
6981
|
const [elements_inside_scrollable, set_elements_inside_scrollable] = (0, $diwD4$solidjs.createSignal)();
|
|
7110
|
-
const close_on_escape_handler = (0, $diwD4$depictaiutilishared.catchify)(({ key: key
|
|
6982
|
+
const close_on_escape_handler = (0, $diwD4$depictaiutilishared.catchify)(({ key: key })=>{
|
|
7111
6983
|
if (key === "Escape") close_modal_();
|
|
7112
6984
|
});
|
|
7113
6985
|
const [get_num_results_accessor, set_num_results_accessor_] = (0, $diwD4$solidjs.createSignal)();
|
|
@@ -7120,7 +6992,7 @@ function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
7120
6992
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
7121
6993
|
(0, $diwD4$solidjs.onCleanup)((0, $diwD4$depictaiutilishared.catchify)(()=>window.removeEventListener("keydown", close_on_escape_handler)));
|
|
7122
6994
|
const owner = (0, $diwD4$solidjs.getOwner)();
|
|
7123
|
-
(0, $diwD4$solidjs.onCleanup)((0, $diwD4$depictaiutilishared.javascript_media_query)("(max-height:700px)", ({ matches: matches
|
|
6995
|
+
(0, $diwD4$solidjs.onCleanup)((0, $diwD4$depictaiutilishared.javascript_media_query)("(max-height:700px)", ({ matches: matches })=>(0, $diwD4$solidjs.runWithOwner)(owner, ()=>{
|
|
7124
6996
|
// the if below is reactive so we need an owner
|
|
7125
6997
|
(matches ? set_elements_outside_scrollable : set_elements_inside_scrollable)("");
|
|
7126
6998
|
(matches ? set_elements_inside_scrollable : set_elements_outside_scrollable)((0, $diwD4$solidjsweb.ssr)($f40a47a30a358305$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), get_search_field_value_() ? (0, $diwD4$solidjsweb.escape)(i18n_.modal_view_all_results_()((0, $diwD4$solidjsweb.ssr)($f40a47a30a358305$var$_tmpl$2, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)(get_num_results_accessor?.())))) : (0, $diwD4$solidjsweb.escape)(i18n_.modal_discover_more_())));
|
|
@@ -7243,13 +7115,6 @@ function $f40a47a30a358305$var$close_modal_when_navigating_away(close_modal, sea
|
|
|
7243
7115
|
|
|
7244
7116
|
|
|
7245
7117
|
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
7118
|
const $04048c1bef16c249$var$_tmpl$ = [
|
|
7254
7119
|
"<div",
|
|
7255
7120
|
' class="category-suggestions">',
|
|
@@ -7259,7 +7124,7 @@ const $04048c1bef16c249$var$_tmpl$ = [
|
|
|
7259
7124
|
' class="category-suggestion">',
|
|
7260
7125
|
"</div>"
|
|
7261
7126
|
];
|
|
7262
|
-
function $04048c1bef16c249$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
7127
|
+
function $04048c1bef16c249$export$c05a196222ba1302({ suggestions_: suggestions_, children: children }) {
|
|
7263
7128
|
const category_suggestions_ = (0, $diwD4$solidjs.createMemo)(()=>suggestions_()?.suggestions.filter((s)=>s.type === "category"));
|
|
7264
7129
|
return (0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
7265
7130
|
get when () {
|
|
@@ -7304,8 +7169,6 @@ function $04048c1bef16c249$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
|
7304
7169
|
|
|
7305
7170
|
|
|
7306
7171
|
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
7172
|
const $65a0c4b1c2eb5d0b$var$_tmpl$ = [
|
|
7310
7173
|
"<b",
|
|
7311
7174
|
">",
|
|
@@ -7315,7 +7178,7 @@ const $65a0c4b1c2eb5d0b$var$_tmpl$ = [
|
|
|
7315
7178
|
' class="results-for">',
|
|
7316
7179
|
"</div>"
|
|
7317
7180
|
];
|
|
7318
|
-
function $65a0c4b1c2eb5d0b$export$9dd50d35b9d94fdf({ get_search_query_: get_search_query_
|
|
7181
|
+
function $65a0c4b1c2eb5d0b$export$9dd50d35b9d94fdf({ get_search_query_: get_search_query_, i18n_: i18n_, formatted_number_of_results_: formatted_number_of_results_ }) {
|
|
7319
7182
|
const contents = (0, $diwD4$solidjs.createMemo)((0, $diwD4$depictaiutilishared.catchify)(()=>{
|
|
7320
7183
|
const q = get_search_query_();
|
|
7321
7184
|
return i18n_.get_showing_results_for_()((0, $diwD4$solidjsweb.ssr)($65a0c4b1c2eb5d0b$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)(q)), (0, $diwD4$solidjsweb.ssr)($65a0c4b1c2eb5d0b$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)(formatted_number_of_results_())));
|
|
@@ -7332,7 +7195,7 @@ function $65a0c4b1c2eb5d0b$export$9dd50d35b9d94fdf({ get_search_query_: get_sear
|
|
|
7332
7195
|
|
|
7333
7196
|
|
|
7334
7197
|
|
|
7335
|
-
function $2005eec80e40088f$export$41b4894022a3580f({ style_props_: style_props_ = (0, $diwD4$solidjs.createSignal)({})
|
|
7198
|
+
function $2005eec80e40088f$export$41b4894022a3580f({ style_props_: style_props_ = (0, $diwD4$solidjs.createSignal)({}) } = {}) {
|
|
7336
7199
|
const [, set_style_props] = style_props_;
|
|
7337
7200
|
const supports_hover = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
|
|
7338
7201
|
const desktop_short = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
@@ -7368,7 +7231,7 @@ const $f1d7cb69f839a526$var$_tmpl$ = [
|
|
|
7368
7231
|
"<!--/--><!--#-->",
|
|
7369
7232
|
"<!--/--></div>"
|
|
7370
7233
|
];
|
|
7371
|
-
function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_
|
|
7234
|
+
function $f1d7cb69f839a526$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_ }) {
|
|
7372
7235
|
const [get_sorting] = current_sorting_;
|
|
7373
7236
|
const all_products_loaded_ = (0, $diwD4$solidjs.createSignal)(false);
|
|
7374
7237
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -7455,7 +7318,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
7455
7318
|
});
|
|
7456
7319
|
const results_filters = (0, $diwD4$solidjs.createSignal)();
|
|
7457
7320
|
const owner = (0, $diwD4$solidjs.getOwner)();
|
|
7458
|
-
(0, $diwD4$solidjs.onCleanup)((0, $diwD4$depictaiutilishared.javascript_media_query)("(max-width:600px)", async ({ matches: matches
|
|
7321
|
+
(0, $diwD4$solidjs.onCleanup)((0, $diwD4$depictaiutilishared.javascript_media_query)("(max-width:600px)", async ({ matches: matches })=>{
|
|
7459
7322
|
results_filters[1]();
|
|
7460
7323
|
await new Promise((r)=>queueMicrotask(r));
|
|
7461
7324
|
(0, $diwD4$solidjs.runWithOwner)(owner, ()=>results_filters[1](matches ? [
|
|
@@ -7463,6 +7326,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
7463
7326
|
filters_opener
|
|
7464
7327
|
] : (0, $diwD4$solidjsweb.ssr)($f1d7cb69f839a526$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)(), (0, $diwD4$solidjsweb.escape)(results_for), (0, $diwD4$solidjsweb.escape)(filters_opener))));
|
|
7465
7328
|
}).remove);
|
|
7329
|
+
(0, $6a8e766e914723d8$export$d31a1a1a83ad9413)(search_results_, selected_filters_);
|
|
7466
7330
|
(0, $diwD4$depictaiutilishared.catchify)((0, $276380e4607fb9fb$export$6e49da55e449af7c))({
|
|
7467
7331
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7468
7332
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
@@ -7676,7 +7540,6 @@ function $d8e94ea381ab57fa$export$828dcdd425fd3231(aligner) {
|
|
|
7676
7540
|
|
|
7677
7541
|
|
|
7678
7542
|
|
|
7679
|
-
|
|
7680
7543
|
const $2c61e4cd8229c49a$var$_tmpl$ = [
|
|
7681
7544
|
"<div",
|
|
7682
7545
|
' class="depict plp search">',
|
|
@@ -7694,8 +7557,8 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7694
7557
|
#modal_open_signal = (0, $diwD4$solidjs.createSignal)(false);
|
|
7695
7558
|
static #keys_constructed_with = new Set();
|
|
7696
7559
|
#router = new (0, $e96dd13889871fc0$export$7e1297a3a19f10d8)("hard_navigation");
|
|
7697
|
-
constructor({ unique_instance_key_for_state: unique_instance_key_for_state = ""
|
|
7698
|
-
disable_scrolling_during_modal = true
|
|
7560
|
+
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
|
|
7561
|
+
disable_scrolling_during_modal = true, api: api, bottom_distance_under_modal: bottom_distance_under_modal, render_instant_card: render_instant_card, ...props_on_class }){
|
|
7699
7562
|
const owner = (0, $diwD4$solidjs.getOwner)() || (0, $diwD4$solidjs.createRoot)(()=>(0, $diwD4$solidjs.getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
7700
7563
|
(0, $diwD4$solidjs.runWithOwner)(owner, ()=>{
|
|
7701
7564
|
if ($2c61e4cd8229c49a$export$ac6237957a15b3f0.#keys_constructed_with.has(unique_instance_key_for_state) && !(0, $diwD4$solidjsweb.isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
@@ -7703,8 +7566,8 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7703
7566
|
Object.assign(this, props_on_class);
|
|
7704
7567
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
7705
7568
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
7706
|
-
const filter_query_param_prefix_ = "
|
|
7707
|
-
const { current_sorting_: current_sorting_
|
|
7569
|
+
const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
|
|
7570
|
+
const { current_sorting_: current_sorting_, selected_filters_: selected_filters_, search_query_accessor_: raw_search_query_accessor } = (0, $c79fd10a3ab7d6e0$export$477caf01aecaeb2a)({
|
|
7708
7571
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
7709
7572
|
router_: this.#router,
|
|
7710
7573
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -7776,7 +7639,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7776
7639
|
});
|
|
7777
7640
|
(0, $d84fe647b84b5dc5$export$5162a71f252e6122)();
|
|
7778
7641
|
(0, $diwD4$depictaiutilishared.catchify)(async ()=>{
|
|
7779
|
-
const { open_modal_: open_modal_
|
|
7642
|
+
const { open_modal_: open_modal_, close_modal_: close_modal_ } = await (0, $9abb0a35d4b60ed3$export$79b1565500412d9b)((...args)=>{
|
|
7780
7643
|
(0, $diwD4$solidjs.onCleanup)(()=>this.modal_open = false);
|
|
7781
7644
|
return (0, $f40a47a30a358305$export$1c593cbd6f1e10bc)(...args);
|
|
7782
7645
|
}, {
|
|
@@ -7812,7 +7675,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7812
7675
|
close_modal_();
|
|
7813
7676
|
return;
|
|
7814
7677
|
}
|
|
7815
|
-
const { search_page_aligned_modal_body_style_signal_: search_page_aligned_modal_body_style_signal_
|
|
7678
|
+
const { search_page_aligned_modal_body_style_signal_: search_page_aligned_modal_body_style_signal_ } = $2c61e4cd8229c49a$var$privately_shared_properties.get(this);
|
|
7816
7679
|
if (signal_value_is_options && open_signal_value[0]?.style_props_) {
|
|
7817
7680
|
// They know what they're doing, just call the modal with the provided options
|
|
7818
7681
|
open_modal_(...open_signal_value);
|
|
@@ -7886,7 +7749,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7886
7749
|
this.#market_signal[1](market);
|
|
7887
7750
|
}
|
|
7888
7751
|
async fetchSearchResults(query, filters, maxResults = 48) {
|
|
7889
|
-
const { depict_api_: depict_api_
|
|
7752
|
+
const { depict_api_: depict_api_ } = $2c61e4cd8229c49a$var$privately_shared_properties.get(this);
|
|
7890
7753
|
const result = await depict_api_.query({
|
|
7891
7754
|
tenant: this.merchant,
|
|
7892
7755
|
market: this.market,
|
|
@@ -7904,12 +7767,12 @@ function $2c61e4cd8229c49a$var$get_shared_properties(depict_search) {
|
|
|
7904
7767
|
return shared_properties;
|
|
7905
7768
|
}
|
|
7906
7769
|
function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
7907
|
-
const { depict_search: depict_search
|
|
7770
|
+
const { depict_search: depict_search, product_card_template: product_card_template } = props;
|
|
7908
7771
|
const shared_properties = $2c61e4cd8229c49a$var$get_shared_properties(depict_search);
|
|
7909
7772
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
7910
|
-
const { state_: state_
|
|
7773
|
+
const { state_: state_ } = shared_properties;
|
|
7911
7774
|
const grid_spacing_override = (0, $diwD4$solidjs.createMemo)(()=>{
|
|
7912
|
-
const { grid_spacing: grid_spacing
|
|
7775
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
7913
7776
|
return typeof grid_spacing === "string" ? {
|
|
7914
7777
|
grid_spacing: grid_spacing
|
|
7915
7778
|
} : {
|
|
@@ -7967,7 +7830,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
7967
7830
|
...grid_spacing_override()
|
|
7968
7831
|
})),
|
|
7969
7832
|
recommendations_layout_options_: (0, $diwD4$solidjs.createMemo)(()=>{
|
|
7970
|
-
const { extra_depict_options: extra_depict_options
|
|
7833
|
+
const { extra_depict_options: extra_depict_options } = props;
|
|
7971
7834
|
return extra_depict_options?.recommendations_cols_at_size ? {
|
|
7972
7835
|
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
|
|
7973
7836
|
...grid_spacing_override()
|
|
@@ -7978,7 +7841,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
7978
7841
|
}, "Entire SearchPage failed");
|
|
7979
7842
|
}
|
|
7980
7843
|
function $2c61e4cd8229c49a$export$316f6f283ae64765(props) {
|
|
7981
|
-
const { depict_search: depict_search
|
|
7844
|
+
const { depict_search: depict_search, modal_dispose_handler: modal_dispose_handler, click_handler: click_handler } = props;
|
|
7982
7845
|
const shared_properties = $2c61e4cd8229c49a$var$get_shared_properties(depict_search);
|
|
7983
7846
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
7984
7847
|
let input_element;
|
|
@@ -8007,7 +7870,7 @@ function $2c61e4cd8229c49a$export$316f6f283ae64765(props) {
|
|
|
8007
7870
|
input_element.selectionStart,
|
|
8008
7871
|
input_element.selectionEnd
|
|
8009
7872
|
];
|
|
8010
|
-
const { cleanup: cleanup
|
|
7873
|
+
const { cleanup: cleanup } = $2c61e4cd8229c49a$var$align_field_modal(style_props_, search_field, ()=>props.aligner_ref);
|
|
8011
7874
|
const complete_modal_dispose_handler = ()=>{
|
|
8012
7875
|
modal_dispose_handler?.();
|
|
8013
7876
|
cleanup();
|
|
@@ -8039,7 +7902,7 @@ function $2c61e4cd8229c49a$var$align_field_modal(style_props_, input, aligner_re
|
|
|
8039
7902
|
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, input);
|
|
8040
7903
|
return;
|
|
8041
7904
|
}
|
|
8042
|
-
const { cleanup: cleanup
|
|
7905
|
+
const { cleanup: cleanup } = (0, $d8e94ea381ab57fa$export$828dcdd425fd3231)(aligner_ref);
|
|
8043
7906
|
(0, $diwD4$solidjs.onCleanup)(cleanup);
|
|
8044
7907
|
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
|
|
8045
7908
|
});
|
|
@@ -8055,7 +7918,7 @@ function $2c61e4cd8229c49a$var$align_field_modal(style_props_, input, aligner_re
|
|
|
8055
7918
|
|
|
8056
7919
|
|
|
8057
7920
|
const $9c143d25df1fc2a2$export$d86a33413558014e = (openModalParams)=>{
|
|
8058
|
-
const { search: search
|
|
7921
|
+
const { search: search, makesNewSearch: makesNewSearch = true } = openModalParams;
|
|
8059
7922
|
openModalParams.location ||= "centered";
|
|
8060
7923
|
if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
|
|
8061
7924
|
if (openModalParams.location !== "aligned") {
|
|
@@ -8077,7 +7940,7 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = (openModalParams)=>{
|
|
|
8077
7940
|
];
|
|
8078
7941
|
return;
|
|
8079
7942
|
}
|
|
8080
|
-
const { cleanup: cleanup
|
|
7943
|
+
const { cleanup: cleanup } = (0, $d8e94ea381ab57fa$export$828dcdd425fd3231)(openModalParams.element);
|
|
8081
7944
|
let dispose_aligner;
|
|
8082
7945
|
/**
|
|
8083
7946
|
* Setting position to fixed is important to make the modal work with align_field.
|
|
@@ -8109,8 +7972,8 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = (openModalParams)=>{
|
|
|
8109
7972
|
|
|
8110
7973
|
function $5ab706c0a6d61264$export$d0596b5cae35ad4(open_search) {
|
|
8111
7974
|
const handler = (0, $diwD4$depictaiutilishared.catchify)((e)=>{
|
|
8112
|
-
const { key: key
|
|
8113
|
-
const { body: body
|
|
7975
|
+
const { key: key, target: target } = e;
|
|
7976
|
+
const { body: body } = document;
|
|
8114
7977
|
if (key === "/" && (target === body || !body.contains(target))) {
|
|
8115
7978
|
open_search();
|
|
8116
7979
|
e.preventDefault();
|
|
@@ -8138,7 +8001,7 @@ function $08e7f10b1831645f$export$689e204eadb33baf(pr) {
|
|
|
8138
8001
|
let resolve_remove_added_listeners;
|
|
8139
8002
|
pr.addEventListener("open", (0, $diwD4$depictaiutilishared.catchify)(()=>{
|
|
8140
8003
|
remove_added_listeners = new Promise((r)=>resolve_remove_added_listeners = r);
|
|
8141
|
-
disconnect_link_observer = (0, $diwD4$depictaiutilishared.observer).onexists("a", async ({ element: element
|
|
8004
|
+
disconnect_link_observer = (0, $diwD4$depictaiutilishared.observer).onexists("a", async ({ element: element })=>{
|
|
8142
8005
|
element.addEventListener("click", link_handler);
|
|
8143
8006
|
await remove_added_listeners;
|
|
8144
8007
|
element.removeEventListener("click", link_handler);
|
|
@@ -8236,13 +8099,13 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8236
8099
|
try_forever: true
|
|
8237
8100
|
});
|
|
8238
8101
|
const first_element_found = new Promise((r)=>{
|
|
8239
|
-
this.#disconnect_observer = (0, $diwD4$depictaiutilishared.observer).onexists(this.selector_, ({ element: element
|
|
8102
|
+
this.#disconnect_observer = (0, $diwD4$depictaiutilishared.observer).onexists(this.selector_, ({ element: element, disconnector: disconnector })=>{
|
|
8240
8103
|
r();
|
|
8241
8104
|
if (this.append_instead_of_replace_) {
|
|
8242
8105
|
disconnector();
|
|
8243
8106
|
return;
|
|
8244
8107
|
}
|
|
8245
|
-
const { style: style
|
|
8108
|
+
const { style: style } = element;
|
|
8246
8109
|
const old_display_value = style.display;
|
|
8247
8110
|
style.setProperty("display", "none", "important");
|
|
8248
8111
|
this.#revert_fns.push(()=>{
|
|
@@ -8251,7 +8114,7 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8251
8114
|
});
|
|
8252
8115
|
});
|
|
8253
8116
|
await first_element_found;
|
|
8254
|
-
const { title: title
|
|
8117
|
+
const { title: title } = document;
|
|
8255
8118
|
if (this.title_) {
|
|
8256
8119
|
document.title = this.title_;
|
|
8257
8120
|
this.#revert_fns.push(()=>document.title = title);
|
|
@@ -8299,7 +8162,7 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8299
8162
|
this.#unload();
|
|
8300
8163
|
this.#stop_listening?.();
|
|
8301
8164
|
}
|
|
8302
|
-
constructor({ is_spa_: is_spa_
|
|
8165
|
+
constructor({ is_spa_: is_spa_, ...options }){
|
|
8303
8166
|
super();
|
|
8304
8167
|
Object.assign(this, options);
|
|
8305
8168
|
this.#listen().catch((e)=>(0, $diwD4$depictaiutilishared.report)([
|