@depict-ai/ui 1.4.20 → 1.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ES10/index.cjs +5 -3
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +159 -157
- package/latest/index.cjs +5 -3
- package/latest/index.d.ts +1 -1
- package/latest/index.js +159 -157
- package/package.json +1 -1
- package/server/ES10/index.cjs +5 -3
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +100 -98
- package/server/latest/index.cjs +5 -3
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +100 -98
package/server/latest/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { add_to_version_info as $i7OB2$add_to_version_info,
|
|
1
|
+
import { add_to_version_info as $i7OB2$add_to_version_info, catchify as $i7OB2$catchify, is_safari as $i7OB2$is_safari, report as $i7OB2$report, observer as $i7OB2$observer, useExpandingContainer as $i7OB2$useExpandingContainer, standard_price_format as $i7OB2$standard_price_format, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, slider_fading_factory as $i7OB2$slider_fading_factory, make_random_classname as $i7OB2$make_random_classname, dlog as $i7OB2$dlog, hex_to_rgb as $i7OB2$hex_to_rgb, relative_luminance_from_rgb as $i7OB2$relative_luminance_from_rgb, javascript_media_query as $i7OB2$javascript_media_query, n_col_styling_with_dist as $i7OB2$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $i7OB2$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $i7OB2$layout_get_total_rec_amount_for_row, layout_media_query_header as $i7OB2$layout_media_query_header, fetch_recs as $i7OB2$fetch_recs, snakeCasifyObject as $i7OB2$snakeCasifyObject, instant_exec_on_suspect_history_change as $i7OB2$instant_exec_on_suspect_history_change, base_url as $i7OB2$base_url, get_depict_id as $i7OB2$get_depict_id, get_user_id as $i7OB2$get_user_id, get_session_id as $i7OB2$get_session_id, sort_obj as $i7OB2$sort_obj, fetch_retry as $i7OB2$fetch_retry, add_version_query_params as $i7OB2$add_version_query_params, dwarn as $i7OB2$dwarn, make_url_with_query_params as $i7OB2$make_url_with_query_params, edit_current_page_meta_tags as $i7OB2$edit_current_page_meta_tags, use_href_accessor as $i7OB2$use_href_accessor, base64_encode_unicode as $i7OB2$base64_encode_unicode, base64_decode_unicode as $i7OB2$base64_decode_unicode, queueMacroTask as $i7OB2$queueMacroTask, make_asyncIterable_exiter as $i7OB2$make_asyncIterable_exiter, href_change_ipns as $i7OB2$href_change_ipns, ContainedImage as $i7OB2$ContainedImage, deparallelize_no_drop as $i7OB2$deparallelize_no_drop, insert_surfaces as $i7OB2$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
2
|
import { ssrElement as $i7OB2$ssrElement, ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, ssrStyle as $i7OB2$ssrStyle, ssrClassList as $i7OB2$ssrClassList, escape as $i7OB2$escape, insert as $i7OB2$insert, createComponent as $i7OB2$createComponent, ssrAttribute as $i7OB2$ssrAttribute, Dynamic as $i7OB2$Dynamic, isServer as $i7OB2$isServer, mergeProps as $i7OB2$mergeProps } from "solid-js/web";
|
|
3
|
-
import { catchify as $i7OB2$catchify } from "@depict-ai/utilishared/latest/latest";
|
|
4
3
|
import { createSignal as $i7OB2$createSignal, onCleanup as $i7OB2$onCleanup, ErrorBoundary as $i7OB2$ErrorBoundary, createMemo as $i7OB2$createMemo, untrack as $i7OB2$untrack, createEffect as $i7OB2$createEffect, getOwner as $i7OB2$getOwner, Show as $i7OB2$Show, Index as $i7OB2$Index, For as $i7OB2$For, createRenderEffect as $i7OB2$createRenderEffect, createComputed as $i7OB2$createComputed, on as $i7OB2$on, batch as $i7OB2$batch, createRoot as $i7OB2$createRoot, runWithOwner as $i7OB2$runWithOwner, createResource as $i7OB2$createResource, createReaction as $i7OB2$createReaction, Suspense as $i7OB2$Suspense } from "solid-js";
|
|
5
4
|
|
|
6
5
|
/*! Depict.ai search and product listing SDK */
|
|
7
6
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
8
7
|
register_es_version("ui", "latest");
|
|
9
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.
|
|
8
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.22";
|
|
10
9
|
function $e8ffe11ed01df0fe$export$e6fffe67d4cdd848(whatToWatch) {
|
|
11
10
|
const [size, setSize] = $i7OB2$createSignal(0);
|
|
12
11
|
const resizeObserver = new ResizeObserver($i7OB2$catchify(records => {
|
|
@@ -133,15 +132,15 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
133
132
|
$i7OB2$insert(details_, [summary_, $i7OB2$createComponent(ExpandingContainer, {
|
|
134
133
|
children: children
|
|
135
134
|
})], null);
|
|
136
|
-
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(details_).then($i7OB2$
|
|
137
|
-
$i7OB2$createEffect($i7OB2$
|
|
135
|
+
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(details_).then($i7OB2$catchify(() => set_is_in_dom(true)));
|
|
136
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
138
137
|
const is_open = is_open_memo();
|
|
139
138
|
if (!is_in_dom())
|
|
140
139
|
// wait with setting state until we're in DOM, animation won't work otherwise
|
|
141
140
|
return;
|
|
142
141
|
if (dont_animate_if_instant_open_ && fresh_component && !timeout_started) {
|
|
143
142
|
timeout_started = true;
|
|
144
|
-
setTimeout($i7OB2$
|
|
143
|
+
setTimeout($i7OB2$catchify(() => fresh_component = false));
|
|
145
144
|
}
|
|
146
145
|
if (is_open) {
|
|
147
146
|
details_.open = true; // open up the toggle so the animation can happen
|
|
@@ -149,10 +148,10 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
149
148
|
await expand(0, do_duration);
|
|
150
149
|
} else {
|
|
151
150
|
const animation = await collapse();
|
|
152
|
-
animation?.addEventListener("finish", $i7OB2$
|
|
151
|
+
animation?.addEventListener("finish", $i7OB2$catchify(() => details_.open = false));
|
|
153
152
|
}
|
|
154
153
|
}));
|
|
155
|
-
details_.addEventListener("toggle", $i7OB2$
|
|
154
|
+
details_.addEventListener("toggle", $i7OB2$catchify(() => {
|
|
156
155
|
const {
|
|
157
156
|
open: open
|
|
158
157
|
} = details_;
|
|
@@ -162,11 +161,11 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
162
161
|
}) // in case someone somehow toggles it without us intercepting it at least follow suit
|
|
163
162
|
);
|
|
164
163
|
|
|
165
|
-
summary_.addEventListener("click", $i7OB2$
|
|
164
|
+
summary_.addEventListener("click", $i7OB2$catchify(ev => {
|
|
166
165
|
ev.preventDefault();
|
|
167
166
|
toggle();
|
|
168
167
|
}));
|
|
169
|
-
summary_.addEventListener("keydown", $i7OB2$
|
|
168
|
+
summary_.addEventListener("keydown", $i7OB2$catchify(ev => {
|
|
170
169
|
const {
|
|
171
170
|
key: key
|
|
172
171
|
} = ev;
|
|
@@ -427,9 +426,9 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({
|
|
|
427
426
|
});
|
|
428
427
|
const [is_in_dom, set_is_in_dom] = $i7OB2$createSignal(document.documentElement.contains(outmost_element));
|
|
429
428
|
const hidden = $i7OB2$createMemo(() => get_search_filters_open_() || get_search_sorting_open_());
|
|
430
|
-
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(outmost_element).then($i7OB2$
|
|
429
|
+
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(outmost_element).then($i7OB2$catchify(() => set_is_in_dom(true)));
|
|
431
430
|
outmost_element.classList.add("selected-filters");
|
|
432
|
-
$i7OB2$createEffect($i7OB2$
|
|
431
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
433
432
|
if (!is_in_dom())
|
|
434
433
|
// wait with setting state until we're in DOM, animation won't work otherwise
|
|
435
434
|
return;
|
|
@@ -554,7 +553,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
|
|
|
554
553
|
i18n_: i18n_
|
|
555
554
|
}) : []);
|
|
556
555
|
});
|
|
557
|
-
$i7OB2$createEffect($i7OB2$
|
|
556
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
558
557
|
if (!togglable_rest()) {
|
|
559
558
|
await collapse();
|
|
560
559
|
return;
|
|
@@ -636,7 +635,7 @@ function $a6b08770e164eced$export$e0d834a0ad870cda({
|
|
|
636
635
|
});
|
|
637
636
|
$i7OB2$createComputed(() => {
|
|
638
637
|
clearTimeout(debounce_timeout);
|
|
639
|
-
debounce_timeout = setTimeout($i7OB2$
|
|
638
|
+
debounce_timeout = setTimeout($i7OB2$catchify(range => $i7OB2$untrack(() => {
|
|
640
639
|
const default_data = filter_().data;
|
|
641
640
|
const filter_object = {
|
|
642
641
|
op: filter_().op,
|
|
@@ -803,7 +802,7 @@ function $0b6bc2f8309efa8a$export$e5c2828934226505({
|
|
|
803
802
|
};
|
|
804
803
|
const outer_div = $i7OB2$ssr($0b6bc2f8309efa8a$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("aria-label", expanded_() ? $i7OB2$escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $i7OB2$escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
|
|
805
804
|
const [is_in_dom, set_is_in_dom] = $i7OB2$createSignal(false);
|
|
806
|
-
(0, $i7OB2$observer).wait_for_element(outer_div).then($i7OB2$
|
|
805
|
+
(0, $i7OB2$observer).wait_for_element(outer_div).then($i7OB2$catchify(() => set_is_in_dom(true)));
|
|
807
806
|
$i7OB2$createEffect(() => {
|
|
808
807
|
if (!is_in_dom())
|
|
809
808
|
// wait for us to being in DOM as animations don't work otherwise
|
|
@@ -956,7 +955,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({
|
|
|
956
955
|
i18n_: i18n_
|
|
957
956
|
}) : []);
|
|
958
957
|
});
|
|
959
|
-
$i7OB2$createEffect($i7OB2$
|
|
958
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
960
959
|
if (!some_top_level_are_hidden()) {
|
|
961
960
|
await collapse();
|
|
962
961
|
return;
|
|
@@ -997,7 +996,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
997
996
|
return value()?.is_checked_?.[0]?.() ?? false;
|
|
998
997
|
},
|
|
999
998
|
input_ref_: input => {
|
|
1000
|
-
input.addEventListener("change", $i7OB2$
|
|
999
|
+
input.addEventListener("change", $i7OB2$catchify(() => $i7OB2$untrack(() => {
|
|
1001
1000
|
const {
|
|
1002
1001
|
checked: checked
|
|
1003
1002
|
} = input;
|
|
@@ -1069,7 +1068,7 @@ function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
|
1069
1068
|
existing_filter_: existing_filter_
|
|
1070
1069
|
} = props;
|
|
1071
1070
|
let sync_queued = false;
|
|
1072
|
-
const sync_fn = $i7OB2$
|
|
1071
|
+
const sync_fn = $i7OB2$catchify(async () => {
|
|
1073
1072
|
sync_queued = false;
|
|
1074
1073
|
// if we change, update filter state - next microtask, so that "reactions" to the change can process before we send it off to the API
|
|
1075
1074
|
const set_filter = existing_filter_();
|
|
@@ -1126,13 +1125,13 @@ function $1c8cac76cb67e9af$var$create_updating_signal({
|
|
|
1126
1125
|
$i7OB2$createComputed($i7OB2$on(read_checked, trigger_sync_, {
|
|
1127
1126
|
defer: true
|
|
1128
1127
|
}));
|
|
1129
|
-
$i7OB2$createComputed($i7OB2$on(read_checked, $i7OB2$
|
|
1128
|
+
$i7OB2$createComputed($i7OB2$on(read_checked, $i7OB2$catchify(new_value => {
|
|
1130
1129
|
if (updating_blocked) return;
|
|
1131
1130
|
for (const child of child_objects) child.is_checked_[1](new_value);
|
|
1132
1131
|
}), {
|
|
1133
1132
|
defer: true
|
|
1134
1133
|
}));
|
|
1135
|
-
$i7OB2$createEffect($i7OB2$on(get_child_object_values, $i7OB2$
|
|
1134
|
+
$i7OB2$createEffect($i7OB2$on(get_child_object_values, $i7OB2$catchify(() => {
|
|
1136
1135
|
const all_kids_checked = get_child_object_values.every(accessor => accessor());
|
|
1137
1136
|
if (all_kids_checked === read_checked()) return;
|
|
1138
1137
|
updating_blocked = true;
|
|
@@ -1368,7 +1367,7 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
1368
1367
|
i18n_: i18n_
|
|
1369
1368
|
}) : []);
|
|
1370
1369
|
});
|
|
1371
|
-
$i7OB2$createEffect($i7OB2$
|
|
1370
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
1372
1371
|
if (!togglable_rest()) {
|
|
1373
1372
|
await collapse();
|
|
1374
1373
|
set_having_expanding_in_dom(false); // Once animation has finished, remove expanding from DOM
|
|
@@ -1941,7 +1940,7 @@ function $c8d5ff4524619fcd$var$ActualSolidLayout(props, container_element) {
|
|
|
1941
1940
|
return;
|
|
1942
1941
|
}
|
|
1943
1942
|
update_children_count();
|
|
1944
|
-
const mutation_observer = new MutationObserver($i7OB2$
|
|
1943
|
+
const mutation_observer = new MutationObserver($i7OB2$catchify(update_children_count));
|
|
1945
1944
|
mutation_observer.observe(container_element, {
|
|
1946
1945
|
childList: true
|
|
1947
1946
|
});
|
|
@@ -1999,7 +1998,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
1999
1998
|
// Animation broke, close it this time
|
|
2000
1999
|
actually_close();else if (!animation_started && closing_animation) {
|
|
2001
2000
|
animation_started = +new Date();
|
|
2002
|
-
$i7OB2$
|
|
2001
|
+
$i7OB2$catchify(closing_animation)()?.then($i7OB2$catchify(actually_close));
|
|
2003
2002
|
} else actually_close();
|
|
2004
2003
|
};
|
|
2005
2004
|
return search_modal({
|
|
@@ -2040,7 +2039,7 @@ async function $c58717f39bf51647$export$58e808b1db15d3bc({
|
|
|
2040
2039
|
function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, router_) {
|
|
2041
2040
|
const signals = {};
|
|
2042
2041
|
const entries = Object.entries(params_to_default_value);
|
|
2043
|
-
const event_handler = $i7OB2$
|
|
2042
|
+
const event_handler = $i7OB2$catchify((what_happened, args) => {
|
|
2044
2043
|
if (what_happened == "popstate") $ca6f574bd8772184$var$history_state_change(signals, entries, args.state);
|
|
2045
2044
|
});
|
|
2046
2045
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
@@ -2064,8 +2063,8 @@ function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, rout
|
|
|
2064
2063
|
});
|
|
2065
2064
|
// history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
|
|
2066
2065
|
(0, $i7OB2$instant_exec_on_suspect_history_change).add(event_handler);
|
|
2067
|
-
$i7OB2$onCleanup($i7OB2$
|
|
2068
|
-
$i7OB2$createEffect($i7OB2$
|
|
2066
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => (0, $i7OB2$instant_exec_on_suspect_history_change).delete(event_handler)));
|
|
2067
|
+
$i7OB2$createEffect($i7OB2$catchify(() => $i7OB2$untrack($i7OB2$catchify(() => $ca6f574bd8772184$var$history_state_change(signals, entries, history.state))))); // we need this to run after reading the initial state from history.state to write the defaults to history.state
|
|
2069
2068
|
return signals;
|
|
2070
2069
|
}
|
|
2071
2070
|
function $ca6f574bd8772184$var$history_state_change(signals, entries, state) {
|
|
@@ -2178,7 +2177,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2178
2177
|
return this.#cache_objs[endpoint] ||= {
|
|
2179
2178
|
in_progress_: {},
|
|
2180
2179
|
cache_: {},
|
|
2181
|
-
finalization_registry_: this.#supports_finalization_registry ? new FinalizationRegistry($i7OB2$
|
|
2180
|
+
finalization_registry_: this.#supports_finalization_registry ? new FinalizationRegistry($i7OB2$catchify(key => {
|
|
2182
2181
|
const our_cache = this.#cache_objs[endpoint].cache_;
|
|
2183
2182
|
$i7OB2$dlog("[Search API]: removing", key, "from", our_cache);
|
|
2184
2183
|
delete our_cache[key];
|
|
@@ -2326,11 +2325,11 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2326
2325
|
result = $e5014ccd0b76d9f4$export$967e966fca9515e(result);
|
|
2327
2326
|
cache_obj.cache_[body] = new WeakRef(result);
|
|
2328
2327
|
resolve_in_progress(result);
|
|
2329
|
-
setTimeout($i7OB2$
|
|
2328
|
+
setTimeout($i7OB2$catchify(() => {
|
|
2330
2329
|
if (this.#supports_finalization_registry) cache_obj.finalization_registry_.register(result, body); // delete key from cache when value (WeakRefs) are collected
|
|
2331
2330
|
else
|
|
2332
2331
|
// delete things from cache after 5 minutes, so it doesn't get too heavy
|
|
2333
|
-
setTimeout($i7OB2$
|
|
2332
|
+
setTimeout($i7OB2$catchify(() => delete cache_obj.cache_[body]), 300000);
|
|
2334
2333
|
}), 60000 // cache values for at least 60 seconds
|
|
2335
2334
|
);
|
|
2336
2335
|
|
|
@@ -2479,7 +2478,7 @@ function $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({
|
|
|
2479
2478
|
});
|
|
2480
2479
|
}
|
|
2481
2480
|
function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true) {
|
|
2482
|
-
const catchified_handler = $i7OB2$
|
|
2481
|
+
const catchified_handler = $i7OB2$catchify(handler);
|
|
2483
2482
|
const owner = $i7OB2$getOwner();
|
|
2484
2483
|
// 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.
|
|
2485
2484
|
// Use observer in case that this gets called before body exists
|
|
@@ -2596,7 +2595,7 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
|
|
|
2596
2595
|
fill: "forwards",
|
|
2597
2596
|
easing: "ease-in-out"
|
|
2598
2597
|
});
|
|
2599
|
-
animation.addEventListener("finish", $i7OB2$
|
|
2598
|
+
animation.addEventListener("finish", $i7OB2$catchify(() => {
|
|
2600
2599
|
if (unpermit_when_possible) set_permitted_to_show(false);
|
|
2601
2600
|
animation = undefined;
|
|
2602
2601
|
element.style.display = "none";
|
|
@@ -2751,7 +2750,8 @@ function $056f6ac0a6caa919$export$5e4aed86c12acdd9({
|
|
|
2751
2750
|
last_loaded = +new Date();
|
|
2752
2751
|
is_first_load = true;
|
|
2753
2752
|
});
|
|
2754
|
-
|
|
2753
|
+
// percentage_in_view_ has equals: false so it should update even when set to the same value. That is to make sure that if the user bounces around below the "viewport" of our product listing we still start fetching as soon as is_loading_more becomes false again and we get IntersectionObserverEntries
|
|
2754
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
2755
2755
|
const be_above_percentage = is_first_load ? 50 : 75; // if first load, load earlier
|
|
2756
2756
|
if (percentage_in_view_() < be_above_percentage || is_loading_more) return;
|
|
2757
2757
|
if (!get_last_cursor()) {
|
|
@@ -2822,6 +2822,8 @@ function $0e0b96a8dc1ad492$export$63dd0350f8559dda({
|
|
|
2822
2822
|
// No product card in view and not after last card, assume first card
|
|
2823
2823
|
return 0;
|
|
2824
2824
|
return last / displays_by_key_().size * 100;
|
|
2825
|
+
}, undefined, {
|
|
2826
|
+
equals: false
|
|
2825
2827
|
});
|
|
2826
2828
|
}
|
|
2827
2829
|
|
|
@@ -2921,7 +2923,7 @@ function $0449e7d49398c077$export$a1fd619a4743ca08({
|
|
|
2921
2923
|
const target_to_index_map = new Map();
|
|
2922
2924
|
const index_to_target_map_ = new Map();
|
|
2923
2925
|
const currently_intersecting = new Set();
|
|
2924
|
-
const intersection_observer = new IntersectionObserver($i7OB2$
|
|
2926
|
+
const intersection_observer = new IntersectionObserver($i7OB2$catchify(records => {
|
|
2925
2927
|
for (let i = 0; i < records.length; i++) {
|
|
2926
2928
|
const record = records[i];
|
|
2927
2929
|
const {
|
|
@@ -3240,7 +3242,7 @@ function $aea1edf92433e81e$export$fe334901e8bebd57() {
|
|
|
3240
3242
|
offset: 0
|
|
3241
3243
|
}, 1);
|
|
3242
3244
|
animation.pause();
|
|
3243
|
-
const fn = $i7OB2$
|
|
3245
|
+
const fn = $i7OB2$catchify(animation.play.bind(animation));
|
|
3244
3246
|
cleanup_fns.push(fn);
|
|
3245
3247
|
$i7OB2$onCleanup(fn);
|
|
3246
3248
|
} catch (e) {
|
|
@@ -3251,7 +3253,7 @@ function $aea1edf92433e81e$export$fe334901e8bebd57() {
|
|
|
3251
3253
|
const style = element.style;
|
|
3252
3254
|
const original_value = style.overflow;
|
|
3253
3255
|
style.overflow = "hidden";
|
|
3254
|
-
const fn = $i7OB2$
|
|
3256
|
+
const fn = $i7OB2$catchify(() => style.overflow = original_value);
|
|
3255
3257
|
cleanup_fns.push(fn);
|
|
3256
3258
|
$i7OB2$onCleanup(fn);
|
|
3257
3259
|
}
|
|
@@ -3337,7 +3339,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({
|
|
|
3337
3339
|
set_search_sorting_open(true);
|
|
3338
3340
|
}
|
|
3339
3341
|
});
|
|
3340
|
-
$i7OB2$onCleanup($i7OB2$
|
|
3342
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => {
|
|
3341
3343
|
if (!sorting_expanded() && !filters_expanded()) {
|
|
3342
3344
|
set_search_filters_open(false);
|
|
3343
3345
|
set_search_sorting_open(false);
|
|
@@ -3437,7 +3439,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
3437
3439
|
const [sorting_open, set_sorting_open] = search_sorting_open_;
|
|
3438
3440
|
const [get_current_sorting_] = current_sorting_;
|
|
3439
3441
|
const [is_small, set_is_small] = $i7OB2$createSignal(false);
|
|
3440
|
-
const dismiss_modal_ = $i7OB2$
|
|
3442
|
+
const dismiss_modal_ = $i7OB2$catchify(() => {
|
|
3441
3443
|
set_filters_open(false);
|
|
3442
3444
|
set_sorting_open(false);
|
|
3443
3445
|
});
|
|
@@ -3508,7 +3510,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
3508
3510
|
if (filters_open()) set_extra_els_in_results_container_($i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $fab07f52c9861732$export$3f1a388cc0d8fed7), filter_options))));else set_extra_els_in_results_container_($i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $68a258a92b88f02f$export$1f1775a58da589b5), sorting_options))));
|
|
3509
3511
|
}
|
|
3510
3512
|
});
|
|
3511
|
-
$i7OB2$
|
|
3513
|
+
$i7OB2$catchify(async () => {
|
|
3512
3514
|
({
|
|
3513
3515
|
open_modal_: open_modal_,
|
|
3514
3516
|
close_modal_: close_modal_
|
|
@@ -3611,13 +3613,13 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({
|
|
|
3611
3613
|
}) {
|
|
3612
3614
|
let close_toast_;
|
|
3613
3615
|
const stay_open_promise = new Promise(r => close_toast_ = r);
|
|
3614
|
-
$i7OB2$
|
|
3616
|
+
$i7OB2$catchify(async () => {
|
|
3615
3617
|
const closing_animation_duration = 300; // ms
|
|
3616
3618
|
const element = $i7OB2$ssrElement("div", more_attributes, () => $i7OB2$escape(children), true);
|
|
3617
3619
|
const [, set_is_showing_toast] = $bf52d9f9eebd1938$export$22970a0140fc759c;
|
|
3618
3620
|
// if this is a memory leak the garbage collector is stupid - does someone know?
|
|
3619
|
-
for (const ev of ["pointerover", "focusin"]) element.addEventListener(ev, $i7OB2$
|
|
3620
|
-
for (const ev of ["pointerout", "focusout"]) element.addEventListener(ev, $i7OB2$
|
|
3621
|
+
for (const ev of ["pointerover", "focusin"]) element.addEventListener(ev, $i7OB2$catchify(() => closing_animation.pause()));
|
|
3622
|
+
for (const ev of ["pointerout", "focusout"]) element.addEventListener(ev, $i7OB2$catchify(() => closing_animation.play()));
|
|
3621
3623
|
const body = await (0, $i7OB2$observer).wait_for_element("body");
|
|
3622
3624
|
const x_translate = "translateX(-50%) ";
|
|
3623
3625
|
let remove_keyboard_listener;
|
|
@@ -3642,7 +3644,7 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({
|
|
|
3642
3644
|
// let other toasts close us if they open while we're still here
|
|
3643
3645
|
$bf52d9f9eebd1938$var$closing_functions.add(close_toast_);
|
|
3644
3646
|
set_is_showing_toast(true);
|
|
3645
|
-
const handler = $i7OB2$
|
|
3647
|
+
const handler = $i7OB2$catchify(({
|
|
3646
3648
|
key: key
|
|
3647
3649
|
}) => {
|
|
3648
3650
|
if (key === "Escape")
|
|
@@ -3741,7 +3743,7 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
3741
3743
|
}
|
|
3742
3744
|
old_pos = new_pos;
|
|
3743
3745
|
});
|
|
3744
|
-
const touchstart_handler = $i7OB2$
|
|
3746
|
+
const touchstart_handler = $i7OB2$catchify(e => {
|
|
3745
3747
|
is_in_touch_scroll = true;
|
|
3746
3748
|
if (e.touches.length === 1) {
|
|
3747
3749
|
// we had no touches but then we got some. Adding a new touch cancels the inertia. We are in a new touch so do reset the diff
|
|
@@ -3749,12 +3751,12 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
3749
3751
|
diff_over_second_or_touch = 0;
|
|
3750
3752
|
}
|
|
3751
3753
|
});
|
|
3752
|
-
const touchend_handler = $i7OB2$
|
|
3754
|
+
const touchend_handler = $i7OB2$catchify(e => {
|
|
3753
3755
|
if (e.touches.length === 0)
|
|
3754
3756
|
// scroll gesture of any type (pinch can also be used as scroll, etc.) ended
|
|
3755
3757
|
inertia_timeout = setTimeout(
|
|
3756
3758
|
// inertia ends after 500ms (educated guess)
|
|
3757
|
-
$i7OB2$
|
|
3759
|
+
$i7OB2$catchify(() => {
|
|
3758
3760
|
is_in_touch_scroll = false;
|
|
3759
3761
|
diff_over_second_or_touch = 0;
|
|
3760
3762
|
}), 500);
|
|
@@ -3772,9 +3774,9 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
3772
3774
|
const everything_closed = !get_search_filters_open_() && !get_search_sorting_open_();
|
|
3773
3775
|
if (!$i7OB2$untrack(modal_is_closed) && everything_closed)
|
|
3774
3776
|
// I think the point of this is to delay the animation a bit IIRC
|
|
3775
|
-
timeout = setTimeout($i7OB2$
|
|
3777
|
+
timeout = setTimeout($i7OB2$catchify(() => set_if_modal_is_closed(true)), 200);else set_if_modal_is_closed(everything_closed);
|
|
3776
3778
|
});
|
|
3777
|
-
$i7OB2$createComputed($i7OB2$
|
|
3779
|
+
$i7OB2$createComputed($i7OB2$catchify(async () => {
|
|
3778
3780
|
const element = sort_and_filter_element_();
|
|
3779
3781
|
if (!element) return;
|
|
3780
3782
|
await (0, $i7OB2$observer).wait_for_element(element);
|
|
@@ -4057,7 +4059,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
4057
4059
|
}];
|
|
4058
4060
|
$i7OB2$createComputed(() => {
|
|
4059
4061
|
if (place_holdey_quicklinks_data()?.[0]?.query_id) {
|
|
4060
|
-
if (last_was_placeholder) queueMicrotask($i7OB2$
|
|
4062
|
+
if (last_was_placeholder) queueMicrotask($i7OB2$catchify(() => {
|
|
4061
4063
|
sliding_element?.scrollTo({
|
|
4062
4064
|
left: 0
|
|
4063
4065
|
}); // for some reason we land one element to the right after placeholder rendering otherwise
|
|
@@ -4123,7 +4125,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
4123
4125
|
} else if (!(intersecting_items_object[selected_index()]?.intersectionRatio >= 0.95)) {
|
|
4124
4126
|
// negated larger than to handle left side of comparison being undefined
|
|
4125
4127
|
let done_work = false;
|
|
4126
|
-
$i7OB2$runWithOwner(owner, () => $i7OB2$createComputed($i7OB2$
|
|
4128
|
+
$i7OB2$runWithOwner(owner, () => $i7OB2$createComputed($i7OB2$catchify(() => {
|
|
4127
4129
|
if (done_work || !Array.isArray(quicklinks_data_())) return;
|
|
4128
4130
|
const sel_index = selected_index();
|
|
4129
4131
|
const target_element = sel_index >= 0 ? sel_index : 0;
|
|
@@ -4200,7 +4202,7 @@ function $641bba2917fe862b$export$6e49da55e449af7c({
|
|
|
4200
4202
|
}]); // get rid of old data the browser saves the old state and will restore it later on
|
|
4201
4203
|
};
|
|
4202
4204
|
|
|
4203
|
-
$i7OB2$createComputed($i7OB2$
|
|
4205
|
+
$i7OB2$createComputed($i7OB2$catchify(() => {
|
|
4204
4206
|
const last_result = get_last_result_in_viewport_();
|
|
4205
4207
|
if (last_result == undefined || last_result <= 0 || last_result == Infinity) return;
|
|
4206
4208
|
if (isNaN(last_result)) {
|
|
@@ -4227,7 +4229,7 @@ function $641bba2917fe862b$export$6e49da55e449af7c({
|
|
|
4227
4229
|
set_to_later = last_result;
|
|
4228
4230
|
// If a delayed push timeout is already running, just changing the value that will be pushed is sufficient
|
|
4229
4231
|
if (timeout) return;
|
|
4230
|
-
timeout = setTimeout($i7OB2$
|
|
4232
|
+
timeout = setTimeout($i7OB2$catchify(() => {
|
|
4231
4233
|
timeout = undefined;
|
|
4232
4234
|
last_time_history_changed = +new Date();
|
|
4233
4235
|
set_min_results_loaded(set_to_later);
|
|
@@ -4270,7 +4272,7 @@ function $587cd61972788655$export$210f130a61ac1e8d(fn) {
|
|
|
4270
4272
|
let last_queued;
|
|
4271
4273
|
let last_value;
|
|
4272
4274
|
let initial_run = true;
|
|
4273
|
-
$i7OB2$createComputed($i7OB2$
|
|
4275
|
+
$i7OB2$createComputed($i7OB2$catchify(async () => {
|
|
4274
4276
|
last_value = fn();
|
|
4275
4277
|
if (initial_run) {
|
|
4276
4278
|
initial_run = false;
|
|
@@ -4390,7 +4392,7 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
|
4390
4392
|
const handler = () => allow_filter_clearing = false;
|
|
4391
4393
|
window.addEventListener("popstate", handler); // popstate only gets called when using back/forwards button of browser or the history navigate to achieve the same, but not on pushState or replaceState
|
|
4392
4394
|
$i7OB2$onCleanup(() => window.removeEventListener("popstate", handler));
|
|
4393
|
-
$i7OB2$createEffect($i7OB2$on(crumb_data_, $i7OB2$
|
|
4395
|
+
$i7OB2$createEffect($i7OB2$on(crumb_data_, $i7OB2$catchify(new_crumb_data => {
|
|
4394
4396
|
const query_id_of_new_data = query_id_();
|
|
4395
4397
|
if (allow_filter_clearing && previous_crumb_data && new_crumb_data && query_id_of_new_data !== query_id_when_we_got_previous_data) {
|
|
4396
4398
|
const previous_length = previous_crumb_data.length;
|
|
@@ -4541,7 +4543,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
4541
4543
|
});
|
|
4542
4544
|
const [plp_results_] = $i7OB2$createResource(query_base_,
|
|
4543
4545
|
// only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
|
|
4544
|
-
$i7OB2$
|
|
4546
|
+
$i7OB2$catchify(base_query => $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
4545
4547
|
id_: $i7OB2$untrack(query_id_),
|
|
4546
4548
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
4547
4549
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
@@ -4649,7 +4651,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
4649
4651
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
4650
4652
|
...extra_sort_and_filter_args_
|
|
4651
4653
|
});
|
|
4652
|
-
$i7OB2$
|
|
4654
|
+
$i7OB2$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
4653
4655
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
4654
4656
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
4655
4657
|
id_: query_id_,
|
|
@@ -4659,7 +4661,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
4659
4661
|
$i7OB2$createComputed(() => {
|
|
4660
4662
|
if (plp_results_.loading) set_can_write_scroll_restoration(false);else if (plp_results_()) set_can_write_scroll_restoration(true);
|
|
4661
4663
|
});
|
|
4662
|
-
$i7OB2$createRenderEffect($i7OB2$
|
|
4664
|
+
$i7OB2$createRenderEffect($i7OB2$catchify(async () => {
|
|
4663
4665
|
const slim = is_slim_();
|
|
4664
4666
|
const only_show_filters_opener = only_show_filters_opener_?.();
|
|
4665
4667
|
const owner = $i7OB2$getOwner();
|
|
@@ -4866,7 +4868,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
4866
4868
|
const [get_selected_filters_, set_selected_filters] = selected_filters_;
|
|
4867
4869
|
const [get_has_sideways_filter_clearing_flag_, set_has_sideways_filter_clearing_flag] = sideways_filter_clearing_flag_;
|
|
4868
4870
|
const [get_current_href, set_current_href] = $i7OB2$createSignal(globalThis?.location?.href ?? "https://example.com");
|
|
4869
|
-
const history_change_handler = $i7OB2$
|
|
4871
|
+
const history_change_handler = $i7OB2$catchify(() => set_current_href(location.href));
|
|
4870
4872
|
const owner = $i7OB2$getOwner() || $i7OB2$createRoot(() => $i7OB2$getOwner());
|
|
4871
4873
|
const {
|
|
4872
4874
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -5036,7 +5038,7 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
5036
5038
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
5037
5039
|
* @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
|
|
5038
5040
|
*/
|
|
5039
|
-
go_to_: $i7OB2$
|
|
5041
|
+
go_to_: $i7OB2$catchify(async ({
|
|
5040
5042
|
new_url_: raw_new_url,
|
|
5041
5043
|
event_: event_,
|
|
5042
5044
|
force_spa_navigation_: force_spa_navigation_,
|
|
@@ -5428,7 +5430,7 @@ const $a6e23a834336fc19$export$824dde41348efed1 = /*@__PURE__*/(() => {
|
|
|
5428
5430
|
|
|
5429
5431
|
const observe_to_signal = (element, setter) => {
|
|
5430
5432
|
const computed_style = getComputedStyle(element);
|
|
5431
|
-
const resize_observer = new ResizeObserver($i7OB2$
|
|
5433
|
+
const resize_observer = new ResizeObserver($i7OB2$catchify(() => {
|
|
5432
5434
|
setter(element.getBoundingClientRect().width + parseFloat(computed_style.marginLeft) + parseFloat(computed_style.marginRight) + parseFloat(computed_style.borderRightWidth) + parseFloat(computed_style.borderLeftWidth));
|
|
5433
5435
|
}));
|
|
5434
5436
|
resize_observer.observe(element);
|
|
@@ -5622,7 +5624,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
5622
5624
|
let input_element;
|
|
5623
5625
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
5624
5626
|
let field_div;
|
|
5625
|
-
$i7OB2$createEffect($i7OB2$
|
|
5627
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
5626
5628
|
if (disabled_) return;
|
|
5627
5629
|
// we aren't in DOM yet unfortunately, wouldn't even be with onMount
|
|
5628
5630
|
await (0, $i7OB2$observer).wait_for_element(input_element);
|
|
@@ -5728,7 +5730,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
5728
5730
|
};
|
|
5729
5731
|
let ro;
|
|
5730
5732
|
if (one_axies_only !== "top") {
|
|
5731
|
-
ro = new ResizeObserver($i7OB2$
|
|
5733
|
+
ro = new ResizeObserver($i7OB2$catchify(records => {
|
|
5732
5734
|
records.forEach(({
|
|
5733
5735
|
contentRect: {
|
|
5734
5736
|
width: width
|
|
@@ -5749,10 +5751,10 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
5749
5751
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
5750
5752
|
// this works
|
|
5751
5753
|
// keeping resize just in case
|
|
5752
|
-
const resize_resize_observer = new ResizeObserver($i7OB2$
|
|
5754
|
+
const resize_resize_observer = new ResizeObserver($i7OB2$catchify(align_position));
|
|
5753
5755
|
resize_resize_observer.observe(document.documentElement);
|
|
5754
5756
|
(0, $i7OB2$observer).wait_for_element("body").then(resize_resize_observer.observe.bind(resize_resize_observer));
|
|
5755
|
-
$i7OB2$onCleanup($i7OB2$
|
|
5757
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => {
|
|
5756
5758
|
ro?.disconnect();
|
|
5757
5759
|
resize_resize_observer.disconnect();
|
|
5758
5760
|
}));
|
|
@@ -5780,7 +5782,7 @@ function $48d7e4a9707315b6$export$e026af0c7b64ea5f({
|
|
|
5780
5782
|
}, {
|
|
5781
5783
|
defer: true
|
|
5782
5784
|
}));
|
|
5783
|
-
$i7OB2$createComputed($i7OB2$on(get_search_query_, $i7OB2$
|
|
5785
|
+
$i7OB2$createComputed($i7OB2$on(get_search_query_, $i7OB2$catchify(() => {
|
|
5784
5786
|
// when a query was submitted, clear filters if clear was pressed before
|
|
5785
5787
|
const clear_value = $i7OB2$untrack(get_clear_filters_next_submit);
|
|
5786
5788
|
if (clear_value) {
|
|
@@ -5805,11 +5807,11 @@ function $21f51c14cb3f586f$export$84bba84a7b837187(read_search_query) {
|
|
|
5805
5807
|
const key = "depict_searches";
|
|
5806
5808
|
const previous_searches = $i7OB2$createSignal(JSON.parse(ls[key] || "[]"));
|
|
5807
5809
|
const [read_previous_searches, write_previous_searches] = previous_searches;
|
|
5808
|
-
$i7OB2$createEffect($i7OB2$
|
|
5810
|
+
$i7OB2$createEffect($i7OB2$catchify(() => {
|
|
5809
5811
|
const json_encoded = JSON.stringify(read_previous_searches());
|
|
5810
5812
|
if (ls[key] !== json_encoded) ls[key] = json_encoded;
|
|
5811
5813
|
}));
|
|
5812
|
-
$i7OB2$createComputed($i7OB2$
|
|
5814
|
+
$i7OB2$createComputed($i7OB2$catchify(() => {
|
|
5813
5815
|
const searches = $i7OB2$untrack(read_previous_searches);
|
|
5814
5816
|
const current_query = read_search_query();
|
|
5815
5817
|
if (!current_query)
|
|
@@ -5943,13 +5945,13 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
|
5943
5945
|
// don't wait if it's the first request
|
|
5944
5946
|
write_current_instant_query(value);
|
|
5945
5947
|
clearTimeout(timeout);
|
|
5946
|
-
timeout = setTimeout($i7OB2$
|
|
5948
|
+
timeout = setTimeout($i7OB2$catchify(() => write_current_instant_query(value)), 250);
|
|
5947
5949
|
});
|
|
5948
5950
|
const [search_results] = $i7OB2$createResource($i7OB2$createMemo(() => ({
|
|
5949
5951
|
tenant: tenant_(),
|
|
5950
5952
|
market: market_(),
|
|
5951
5953
|
query: read_current_instant_query()
|
|
5952
|
-
})), $i7OB2$
|
|
5954
|
+
})), $i7OB2$catchify(variable_data => {
|
|
5953
5955
|
return depict_api_.query({
|
|
5954
5956
|
// here it is (unfortunately) important that the keys in the object are in the same order as in SearchPage.tsx, because when JSON-encoding them to compare for caching the strings will be different otherwise
|
|
5955
5957
|
limit: $i7OB2$untrack(has_sort_or_filters_) ? max_cards : min_products_to_fetch_,
|
|
@@ -6015,7 +6017,7 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({
|
|
|
6015
6017
|
const [get_current_href, set_current_href] = $i7OB2$createSignal(location.href);
|
|
6016
6018
|
const [exit_iterable, exitable_iterable] = $i7OB2$make_asyncIterable_exiter((0, $i7OB2$href_change_ipns));
|
|
6017
6019
|
$i7OB2$onCleanup(exit_iterable);
|
|
6018
|
-
$i7OB2$
|
|
6020
|
+
$i7OB2$catchify(async () => {
|
|
6019
6021
|
for await (const href of exitable_iterable)
|
|
6020
6022
|
// use native links so ppl can cmdclick/right click and open in new tab and see target URL
|
|
6021
6023
|
set_current_href(href);
|
|
@@ -6401,7 +6403,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
|
|
|
6401
6403
|
if (!$i7OB2$untrack(() => read_updating_blocked())) previous_value = sfv;
|
|
6402
6404
|
});
|
|
6403
6405
|
const owner = $i7OB2$getOwner();
|
|
6404
|
-
const handler = $i7OB2$
|
|
6406
|
+
const handler = $i7OB2$catchify(({
|
|
6405
6407
|
keyCode: keyCode
|
|
6406
6408
|
}) => $i7OB2$untrack(() => {
|
|
6407
6409
|
const up = keyCode === 38;
|
|
@@ -6461,7 +6463,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
|
|
|
6461
6463
|
const el = element_();
|
|
6462
6464
|
if (!el) return;
|
|
6463
6465
|
el.addEventListener("keyup", handler);
|
|
6464
|
-
$i7OB2$onCleanup($i7OB2$
|
|
6466
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => el.removeEventListener("keyup", handler)));
|
|
6465
6467
|
});
|
|
6466
6468
|
}
|
|
6467
6469
|
function $1ae0eaca6ada9753$export$af0124069c150252({
|
|
@@ -6659,7 +6661,7 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
|
6659
6661
|
if (process.env.GA === "false") return;
|
|
6660
6662
|
let debounce_timeout;
|
|
6661
6663
|
const stop_timeout = () => clearTimeout(debounce_timeout);
|
|
6662
|
-
const send_to_ga = $i7OB2$
|
|
6664
|
+
const send_to_ga = $i7OB2$catchify(() => {
|
|
6663
6665
|
const fake_url = new URL(location.href);
|
|
6664
6666
|
const {
|
|
6665
6667
|
searchParams: searchParams
|
|
@@ -6672,12 +6674,12 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
|
6672
6674
|
$i7OB2$onCleanup(() => {
|
|
6673
6675
|
setTimeout(
|
|
6674
6676
|
// do it next event loop because search_field_value_ is wrong this one and search_query might be too because we want the old value to be put into the history entry and a framework like NextJS might take some time to navigate
|
|
6675
|
-
$i7OB2$
|
|
6677
|
+
$i7OB2$catchify(() => {
|
|
6676
6678
|
if ($i7OB2$untrack(get_search_query_) === $i7OB2$untrack(get_search_field_value_)) stop_timeout();
|
|
6677
6679
|
}));
|
|
6678
6680
|
});
|
|
6679
6681
|
let first_call = true;
|
|
6680
|
-
$i7OB2$createEffect($i7OB2$
|
|
6682
|
+
$i7OB2$createEffect($i7OB2$catchify(() => {
|
|
6681
6683
|
get_search_field_value_();
|
|
6682
6684
|
if (first_call) {
|
|
6683
6685
|
// we only want to do stuff when it changes
|
|
@@ -6747,7 +6749,7 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({
|
|
|
6747
6749
|
const [input_field, set_input_field] = $i7OB2$createSignal();
|
|
6748
6750
|
const [get_search_field_value_] = search_field_value_;
|
|
6749
6751
|
const [get_modal_search_results, set_modal_search_results_] = $i7OB2$createSignal();
|
|
6750
|
-
const close_on_escape_handler = $i7OB2$
|
|
6752
|
+
const close_on_escape_handler = $i7OB2$catchify(({
|
|
6751
6753
|
key: key
|
|
6752
6754
|
}) => {
|
|
6753
6755
|
if (key === "Escape") close_modal_();
|
|
@@ -6762,7 +6764,7 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({
|
|
|
6762
6764
|
if (disable_scrolling_) $aea1edf92433e81e$export$fe334901e8bebd57();
|
|
6763
6765
|
$fabfda1230351b1a$var$close_modal_when_navigating_away(close_modal_, search_query_url_param_name_);
|
|
6764
6766
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
6765
|
-
$i7OB2$onCleanup($i7OB2$
|
|
6767
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => window.removeEventListener("keydown", close_on_escape_handler)));
|
|
6766
6768
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
6767
6769
|
$c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
6768
6770
|
get_search_field_value_: get_search_field_value_,
|
|
@@ -6867,8 +6869,8 @@ function $fabfda1230351b1a$var$close_modal_when_navigating_away(close_modal, sea
|
|
|
6867
6869
|
let set_initial_values = false;
|
|
6868
6870
|
let old_pathname;
|
|
6869
6871
|
let old_param_value;
|
|
6870
|
-
$i7OB2$onCleanup($i7OB2$
|
|
6871
|
-
$i7OB2$
|
|
6872
|
+
$i7OB2$onCleanup($i7OB2$catchify(exit_iterable));
|
|
6873
|
+
$i7OB2$catchify(async () => {
|
|
6872
6874
|
for await (const href of exitable_iterable) {
|
|
6873
6875
|
const u_o = new URL(href);
|
|
6874
6876
|
const new_pathname = u_o.pathname;
|
|
@@ -6933,7 +6935,7 @@ function $f8c929beb82c512b$export$9dd50d35b9d94fdf({
|
|
|
6933
6935
|
number_of_results_: number_of_results_,
|
|
6934
6936
|
type: type
|
|
6935
6937
|
}) {
|
|
6936
|
-
const contents = $i7OB2$createMemo($i7OB2$
|
|
6938
|
+
const contents = $i7OB2$createMemo($i7OB2$catchify(() => {
|
|
6937
6939
|
const q = get_search_query_();
|
|
6938
6940
|
return i18n_[type === $f8c929beb82c512b$export$2452208c79fe93ea.content ? "get_showing_pages_for_" : "get_showing_results_for_"]()($i7OB2$ssr($f8c929beb82c512b$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(q)), $i7OB2$ssr($f8c929beb82c512b$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(formatted_number_of_results_())), !!q, number_of_results_());
|
|
6939
6941
|
}));
|
|
@@ -7191,7 +7193,7 @@ function $b2bf2cdcff8142d8$export$f631859cab12b342({
|
|
|
7191
7193
|
if (!result) return;
|
|
7192
7194
|
return {
|
|
7193
7195
|
href: result.page_url,
|
|
7194
|
-
onClick: $i7OB2$
|
|
7196
|
+
onClick: $i7OB2$catchify(ev => router_.navigate_.go_to_({
|
|
7195
7197
|
new_url_: result.page_url,
|
|
7196
7198
|
is_replace_: false,
|
|
7197
7199
|
event_: ev
|
|
@@ -7444,7 +7446,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7444
7446
|
} : {})
|
|
7445
7447
|
};
|
|
7446
7448
|
});
|
|
7447
|
-
const [search_results_] = $i7OB2$createResource(search_query_base_, $i7OB2$
|
|
7449
|
+
const [search_results_] = $i7OB2$createResource(search_query_base_, $i7OB2$catchify(async base_query => {
|
|
7448
7450
|
set_all_products_loaded(false);
|
|
7449
7451
|
// only first page of results
|
|
7450
7452
|
return await $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
@@ -7472,7 +7474,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7472
7474
|
const available_filters_ = $i7OB2$createMemo(() => search_results_()?.filters);
|
|
7473
7475
|
const modal_body_style = $i7OB2$createSignal({});
|
|
7474
7476
|
const [get_search_field_elements, set_search_field_elements] = $i7OB2$createSignal();
|
|
7475
|
-
const SafeSearchField = $i7OB2$
|
|
7477
|
+
const SafeSearchField = $i7OB2$catchify((0, $5285d2814d0fac0c$export$b94867ecbd698f21));
|
|
7476
7478
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $i7OB2$createSignal(false);
|
|
7477
7479
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $i7OB2$createSignal();
|
|
7478
7480
|
const n_hits = $i7OB2$createMemo(() => search_results_()?.n_hits);
|
|
@@ -7520,7 +7522,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7520
7522
|
$i7OB2$runWithOwner(owner, () => results_filters[1](matches ? [results_for, filters_opener] : $i7OB2$ssr($7097477c78a89208$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(results_for), $i7OB2$escape(filters_opener))));
|
|
7521
7523
|
}).remove);
|
|
7522
7524
|
$2ab89d64b7f1d5ef$export$d31a1a1a83ad9413(search_results_, selected_filters_);
|
|
7523
|
-
$i7OB2$
|
|
7525
|
+
$i7OB2$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
7524
7526
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7525
7527
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
7526
7528
|
id_: get_search_query_,
|
|
@@ -7558,8 +7560,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7558
7560
|
if (!search_field) break add_input_field;
|
|
7559
7561
|
modal_body_style[1]({});
|
|
7560
7562
|
modal_body_style_ref_?.(modal_body_style);
|
|
7561
|
-
const align_position = $i7OB2$
|
|
7562
|
-
div_with_field_class.addEventListener("click", $i7OB2$
|
|
7563
|
+
const align_position = $i7OB2$catchify((0, $b6d5529b253681aa$export$b3ad617e9036868))(modal_body_style, search_field, undefined, true);
|
|
7564
|
+
div_with_field_class.addEventListener("click", $i7OB2$catchify(e => {
|
|
7563
7565
|
const target = e.target;
|
|
7564
7566
|
const sel = ".submit";
|
|
7565
7567
|
if (target?.matches?.(sel) || target?.closest?.(sel))
|
|
@@ -7719,7 +7721,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7719
7721
|
function $4ca91518c9a35379$export$828dcdd425fd3231(aligner) {
|
|
7720
7722
|
const style_element = document.createElement("style");
|
|
7721
7723
|
document.head.append(style_element);
|
|
7722
|
-
const resize_observer = new ResizeObserver($i7OB2$
|
|
7724
|
+
const resize_observer = new ResizeObserver($i7OB2$catchify(() => {
|
|
7723
7725
|
const styles = $926b1b5ba2239356$export$1233ca167bf71f9a({
|
|
7724
7726
|
".depict.plp .depict-search-modal .search-field": {
|
|
7725
7727
|
"height": `${aligner?.clientHeight}px`
|
|
@@ -7882,7 +7884,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
7882
7884
|
selected_filters_: selected_filters_
|
|
7883
7885
|
});
|
|
7884
7886
|
$90980bd87c9960f9$export$5162a71f252e6122();
|
|
7885
|
-
$i7OB2$
|
|
7887
|
+
$i7OB2$catchify(async () => {
|
|
7886
7888
|
const {
|
|
7887
7889
|
open_modal_: open_modal_,
|
|
7888
7890
|
close_modal_: close_modal_
|
|
@@ -8149,7 +8151,7 @@ function $806c97b931758897$export$316f6f283ae64765(props) {
|
|
|
8149
8151
|
const style_props_ = $i7OB2$createSignal({
|
|
8150
8152
|
position: "fixed"
|
|
8151
8153
|
});
|
|
8152
|
-
const defaultHandler = $i7OB2$
|
|
8154
|
+
const defaultHandler = $i7OB2$catchify(() => {
|
|
8153
8155
|
// When selecting text in the SearchField that's in the page we want the same selection to persist. It doesn't by itself, since the SearchModal has an entirely different SearchField. Therefore, we manually copy the selection over.
|
|
8154
8156
|
const selected_text_range_ = [input_element.selectionStart, input_element.selectionEnd];
|
|
8155
8157
|
const {
|
|
@@ -8237,7 +8239,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
|
|
|
8237
8239
|
}, dispose_aligner];
|
|
8238
8240
|
};
|
|
8239
8241
|
function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
8240
|
-
const handler = $i7OB2$
|
|
8242
|
+
const handler = $i7OB2$catchify(e => {
|
|
8241
8243
|
const {
|
|
8242
8244
|
key: key,
|
|
8243
8245
|
target: target
|
|
@@ -8256,7 +8258,7 @@ function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
|
8256
8258
|
function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
8257
8259
|
let old_url;
|
|
8258
8260
|
let disconnect_link_observer;
|
|
8259
|
-
const link_handler = $i7OB2$
|
|
8261
|
+
const link_handler = $i7OB2$catchify(e => {
|
|
8260
8262
|
const link = e.currentTarget || e.target;
|
|
8261
8263
|
if (link.href === old_url) {
|
|
8262
8264
|
history.pushState(history.state, "", link.href);
|
|
@@ -8265,7 +8267,7 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
8265
8267
|
});
|
|
8266
8268
|
let remove_added_listeners;
|
|
8267
8269
|
let resolve_remove_added_listeners;
|
|
8268
|
-
pr.addEventListener("open", $i7OB2$
|
|
8270
|
+
pr.addEventListener("open", $i7OB2$catchify(() => {
|
|
8269
8271
|
remove_added_listeners = new Promise(r => resolve_remove_added_listeners = r);
|
|
8270
8272
|
disconnect_link_observer = (0, $i7OB2$observer).onexists("a", async ({
|
|
8271
8273
|
element: element
|
|
@@ -8275,11 +8277,11 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
8275
8277
|
element.removeEventListener("click", link_handler);
|
|
8276
8278
|
});
|
|
8277
8279
|
}));
|
|
8278
|
-
pr.addEventListener("close", $i7OB2$
|
|
8280
|
+
pr.addEventListener("close", $i7OB2$catchify(() => {
|
|
8279
8281
|
disconnect_link_observer?.();
|
|
8280
8282
|
resolve_remove_added_listeners?.();
|
|
8281
8283
|
}));
|
|
8282
|
-
$i7OB2$
|
|
8284
|
+
$i7OB2$catchify(async () => {
|
|
8283
8285
|
for await (const href of (0, $i7OB2$href_change_ipns)) if (!pr.is_page_(new URL(href))) old_url = href;
|
|
8284
8286
|
})();
|
|
8285
8287
|
}
|
|
@@ -8291,7 +8293,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8291
8293
|
static #reverting_permitted = true;
|
|
8292
8294
|
static #visited_urls = (() => {
|
|
8293
8295
|
// Keep track of all URLs that have been visited since the document that was initially loaded (loaded means the process where the browser creates a new `document` and `window` object).
|
|
8294
|
-
$i7OB2$
|
|
8296
|
+
$i7OB2$catchify(async () => {
|
|
8295
8297
|
// Static initialization blocks aren't supported in MobileSafari yet, otherwise this would be one.
|
|
8296
8298
|
// I don't think we want to ship a library that users are *forced* to transpile, it should run in the newest version of all major browsers. So we'll just use a function wrapper for now (adding "last 1 ios version" to the build target does a bunch of other unneeded transpilations).
|
|
8297
8299
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks
|
|
@@ -8309,7 +8311,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8309
8311
|
async #listen() {
|
|
8310
8312
|
const [exit_ipns, exitable_ipns] = $i7OB2$make_asyncIterable_exiter((0, $i7OB2$href_change_ipns));
|
|
8311
8313
|
this.#stop_listening = exit_ipns;
|
|
8312
|
-
const caught_page_check_fn = $i7OB2$
|
|
8314
|
+
const caught_page_check_fn = $i7OB2$catchify(this.is_page_, "page check failed");
|
|
8313
8315
|
for await (const href of exitable_ipns) {
|
|
8314
8316
|
const url = new URL(href);
|
|
8315
8317
|
if (!caught_page_check_fn(url)) {
|
|
@@ -8327,17 +8329,17 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8327
8329
|
this.addEventListener("close", dispose, {
|
|
8328
8330
|
once: true
|
|
8329
8331
|
});
|
|
8330
|
-
return $i7OB2$
|
|
8332
|
+
return $i7OB2$catchify(this.render_, "rendering failed")() || [];
|
|
8331
8333
|
});
|
|
8332
8334
|
}
|
|
8333
|
-
#unload = $i7OB2$
|
|
8335
|
+
#unload = $i7OB2$catchify(() => {
|
|
8334
8336
|
if (!this.#is_open) return;
|
|
8335
8337
|
this.#disconnect_observer?.();
|
|
8336
8338
|
if ($753e9b2889a47c89$export$3ccaa27d81dd8556.#reverting_permitted) while (this.#revert_fns.length) this.#revert_fns.pop()?.();
|
|
8337
8339
|
this.#is_open = false;
|
|
8338
8340
|
this.dispatchEvent(new CustomEvent("close"));
|
|
8339
8341
|
}, "failed to close page");
|
|
8340
|
-
#load = $i7OB2$
|
|
8342
|
+
#load = $i7OB2$catchify(async els => {
|
|
8341
8343
|
this.#is_open = true;
|
|
8342
8344
|
// So that #load doesn't get called again
|
|
8343
8345
|
let set_should_stay_inserted;
|