@depict-ai/ui 4.7.24 → 4.7.25
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 +112 -33
- package/ES10/index.d.ts +5 -1
- package/ES10/index.js +330 -252
- package/latest/index.cjs +112 -33
- package/latest/index.d.ts +5 -1
- package/latest/index.js +330 -252
- package/package.json +1 -1
- package/server/ES10/index.cjs +83 -20
- package/server/ES10/index.d.ts +5 -1
- package/server/ES10/index.js +219 -157
- package/server/latest/index.cjs +83 -20
- package/server/latest/index.d.ts +5 -1
- package/server/latest/index.js +219 -157
package/server/latest/index.js
CHANGED
|
@@ -1,13 +1,74 @@
|
|
|
1
|
-
import { add_to_version_info as $i7OB2$add_to_version_info, slider_fading_factory as $i7OB2$slider_fading_factory, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, catchify as $i7OB2$
|
|
2
|
-
import {
|
|
1
|
+
import { add_to_version_info as $i7OB2$add_to_version_info, slider_fading_factory as $i7OB2$slider_fading_factory, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, catchify as $i7OB2$catchify1, dlog as $i7OB2$dlog1, camelCasifyObject as $i7OB2$camelCasifyObject, useExpandingContainer as $i7OB2$useExpandingContainer, fetch_retry as $i7OB2$fetch_retry, base_url as $i7OB2$base_url, dwarn as $i7OB2$dwarn, slider_fractional_factory as $i7OB2$slider_fractional_factory, make_random_classname as $i7OB2$make_random_classname, 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, report as $i7OB2$report, observer as $i7OB2$observer, javascript_media_query as $i7OB2$javascript_media_query, queueMacroTask as $i7OB2$queueMacroTask, findMostFrequentItem as $i7OB2$findMostFrequentItem, standard_price_format as $i7OB2$standard_price_format, instant_exec_on_suspect_history_change as $i7OB2$instant_exec_on_suspect_history_change, deparallelize_no_drop as $i7OB2$deparallelize_no_drop, ContainedImage as $i7OB2$ContainedImage, make_asyncIterable_exiter as $i7OB2$make_asyncIterable_exiter, href_change_ipns as $i7OB2$href_change_ipns, base64_encode_unicode as $i7OB2$base64_encode_unicode, base64_decode_unicode as $i7OB2$base64_decode_unicode, use_href_accessor as $i7OB2$use_href_accessor, get_session_id as $i7OB2$get_session_id, add_version_query_params as $i7OB2$add_version_query_params, hex_to_rgb as $i7OB2$hex_to_rgb, relative_luminance_from_rgb as $i7OB2$relative_luminance_from_rgb, snakeCasifyObject as $i7OB2$snakeCasifyObject, sort_obj as $i7OB2$sort_obj, make_url_with_query_params as $i7OB2$make_url_with_query_params, insert_surfaces as $i7OB2$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
|
+
import { dlog as $i7OB2$dlog, catchify as $i7OB2$catchify, ListenableSet as $i7OB2$ListenableSet, use_href_accessor as $i7OB2$use_href_accessor1, queueMacroTask as $i7OB2$queueMacroTask1, report as $i7OB2$report1 } from "@depict-ai/utilishared/latest";
|
|
3
|
+
import { createRoot as $i7OB2$createRoot, createSignal as $i7OB2$createSignal, createEffect as $i7OB2$createEffect, onCleanup as $i7OB2$onCleanup, createContext as $i7OB2$createContext, Show as $i7OB2$Show, useContext as $i7OB2$useContext, createMemo as $i7OB2$createMemo, untrack as $i7OB2$untrack, For as $i7OB2$For, getOwner as $i7OB2$getOwner, createResource as $i7OB2$createResource, runWithOwner as $i7OB2$runWithOwner, mergeProps as $i7OB2$mergeProps1, Suspense as $i7OB2$Suspense, createRenderEffect as $i7OB2$createRenderEffect, Index as $i7OB2$Index, createUniqueId as $i7OB2$createUniqueId, createComputed as $i7OB2$createComputed, ErrorBoundary as $i7OB2$ErrorBoundary, splitProps as $i7OB2$splitProps, on as $i7OB2$on, batch as $i7OB2$batch, createSelector as $i7OB2$createSelector, children as $i7OB2$children, createReaction as $i7OB2$createReaction, mapArray as $i7OB2$mapArray } from "solid-js";
|
|
3
4
|
import { ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, escape as $i7OB2$escape, createComponent as $i7OB2$createComponent, isServer as $i7OB2$isServer, insert as $i7OB2$insert, ssrAttribute as $i7OB2$ssrAttribute, ssrStyle as $i7OB2$ssrStyle, mergeProps as $i7OB2$mergeProps, ssrElement as $i7OB2$ssrElement, ssrClassList as $i7OB2$ssrClassList, spread as $i7OB2$spread, Dynamic as $i7OB2$Dynamic } from "solid-js/web";
|
|
4
|
-
import { ListenableSet as $i7OB2$ListenableSet, catchify as $i7OB2$catchify1, use_href_accessor as $i7OB2$use_href_accessor1, queueMacroTask as $i7OB2$queueMacroTask1, report as $i7OB2$report1 } from "@depict-ai/utilishared/latest";
|
|
5
5
|
import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from "solid-js/store";
|
|
6
6
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.25";
|
|
11
|
+
let $4eb0a704f8f30273$var$elementsHoveredSignal;
|
|
12
|
+
let $4eb0a704f8f30273$var$consumersSignal;
|
|
13
|
+
function $4eb0a704f8f30273$export$d4d96868197be50e() {
|
|
14
|
+
if (!$4eb0a704f8f30273$var$elementsHoveredSignal || !$4eb0a704f8f30273$var$consumersSignal) $i7OB2$createRoot(dispose => {
|
|
15
|
+
$4eb0a704f8f30273$var$elementsHoveredSignal = $i7OB2$createSignal(new Set());
|
|
16
|
+
$4eb0a704f8f30273$var$consumersSignal = $i7OB2$createSignal(0);
|
|
17
|
+
const [consumers] = $4eb0a704f8f30273$var$consumersSignal;
|
|
18
|
+
// No matter how often useMobileHover is called, only add one listener and get hovered elements once per touchmove event, for efficiency
|
|
19
|
+
$4eb0a704f8f30273$var$doHeavyCalculations();
|
|
20
|
+
$i7OB2$createEffect(() => {
|
|
21
|
+
// No-one needs information anymore, stop listening
|
|
22
|
+
const users = consumers();
|
|
23
|
+
if (users < 1) {
|
|
24
|
+
$i7OB2$dlog("Stopping to listen for mobile hover");
|
|
25
|
+
dispose();
|
|
26
|
+
$4eb0a704f8f30273$var$elementsHoveredSignal = undefined;
|
|
27
|
+
$4eb0a704f8f30273$var$consumersSignal = undefined;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
const [elementsHovered] = $4eb0a704f8f30273$var$elementsHoveredSignal;
|
|
32
|
+
const [, setConsumers] = $4eb0a704f8f30273$var$consumersSignal;
|
|
33
|
+
setConsumers(prev => prev + 1);
|
|
34
|
+
$i7OB2$onCleanup(() => setConsumers(prev => prev - 1));
|
|
35
|
+
return elementsHovered;
|
|
36
|
+
}
|
|
37
|
+
function $4eb0a704f8f30273$var$doHeavyCalculations() {
|
|
38
|
+
$i7OB2$dlog("Starting to listen for mobile hover");
|
|
39
|
+
const [, setElementsHovered] = $4eb0a704f8f30273$var$elementsHoveredSignal;
|
|
40
|
+
const elementAtTouch = new Map();
|
|
41
|
+
const updateSet = () => setElementsHovered(new Set([...elementAtTouch.values()].filter(v => v)));
|
|
42
|
+
const setPositionHandler = $i7OB2$catchify(evt => {
|
|
43
|
+
for (const touch of evt.changedTouches) elementAtTouch.set(touch.identifier, $4eb0a704f8f30273$var$getElementAtTouch(touch));
|
|
44
|
+
updateSet();
|
|
45
|
+
});
|
|
46
|
+
const deleteTouchHandler = $i7OB2$catchify(evt => {
|
|
47
|
+
for (const touch of evt.changedTouches) elementAtTouch.delete(touch.identifier);
|
|
48
|
+
updateSet();
|
|
49
|
+
});
|
|
50
|
+
addEventListener("touchstart", setPositionHandler, {
|
|
51
|
+
passive: true
|
|
52
|
+
});
|
|
53
|
+
addEventListener("touchmove", setPositionHandler, {
|
|
54
|
+
passive: true
|
|
55
|
+
});
|
|
56
|
+
addEventListener("touchend", deleteTouchHandler, {
|
|
57
|
+
passive: true
|
|
58
|
+
});
|
|
59
|
+
addEventListener("touchcancel", deleteTouchHandler, {
|
|
60
|
+
passive: true
|
|
61
|
+
});
|
|
62
|
+
$i7OB2$onCleanup(() => {
|
|
63
|
+
removeEventListener("touchstart", setPositionHandler);
|
|
64
|
+
removeEventListener("touchmove", setPositionHandler);
|
|
65
|
+
removeEventListener("touchend", deleteTouchHandler);
|
|
66
|
+
removeEventListener("touchcancel", deleteTouchHandler);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function $4eb0a704f8f30273$var$getElementAtTouch(touch) {
|
|
70
|
+
return document.elementFromPoint(touch.clientX, touch.clientY);
|
|
71
|
+
}
|
|
11
72
|
function $5e3d278ef4c80cd7$export$54299a3c81f5425() {
|
|
12
73
|
const d = document;
|
|
13
74
|
const [isVisible, setIsVisible] = $i7OB2$createSignal(d.visibilityState !== "hidden");
|
|
@@ -251,7 +312,7 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({
|
|
|
251
312
|
} catch (e) {
|
|
252
313
|
if (!$29ec7cddbe1d3484$var$printedCloneError) {
|
|
253
314
|
$29ec7cddbe1d3484$var$printedCloneError = true;
|
|
254
|
-
$i7OB2$
|
|
315
|
+
$i7OB2$dlog1("Can't clone display", display, " (uncloneable objects in it), make sure you don't mutate it in the template since we cache.", e);
|
|
255
316
|
}
|
|
256
317
|
}
|
|
257
318
|
let renderingResult;
|
|
@@ -350,7 +411,7 @@ function $f091294da861020c$export$4a14175d33d81a96({
|
|
|
350
411
|
};
|
|
351
412
|
// The following sets up an intersection observer to determine which results are in the viewport, used for the ScrollStatus indicator, knowing when to load more and any other consumer of the useProductCardIsVisible hook.
|
|
352
413
|
const shouldObserve = $i7OB2$createMemo(() => alwaysObserveCards_ || listenersForIntersecting() > 0);
|
|
353
|
-
const intersection_observer = new IntersectionObserver($i7OB2$
|
|
414
|
+
const intersection_observer = new IntersectionObserver($i7OB2$catchify1(records => {
|
|
354
415
|
const intersectingValue = currentlyIntersecting();
|
|
355
416
|
for (let i = 0; i < records.length; i++) {
|
|
356
417
|
const record = records[i];
|
|
@@ -695,7 +756,7 @@ function $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, container_element, ins
|
|
|
695
756
|
}
|
|
696
757
|
update_children_count();
|
|
697
758
|
if (!(0, $i7OB2$isServer)) {
|
|
698
|
-
const mutation_observer = new MutationObserver($i7OB2$
|
|
759
|
+
const mutation_observer = new MutationObserver($i7OB2$catchify1(update_children_count));
|
|
699
760
|
mutation_observer.observe(container_element, {
|
|
700
761
|
childList: true
|
|
701
762
|
});
|
|
@@ -973,7 +1034,7 @@ function $4ea56971d92eb0cd$export$2972b890694ced75(callback, {
|
|
|
973
1034
|
}
|
|
974
1035
|
function $e8ffe11ed01df0fe$export$e6fffe67d4cdd848(whatToWatch) {
|
|
975
1036
|
const [size, setSize] = $i7OB2$createSignal(0);
|
|
976
|
-
const resizeObserver = new ResizeObserver($i7OB2$
|
|
1037
|
+
const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => {
|
|
977
1038
|
for (let j = 0; j < records.length; j++) {
|
|
978
1039
|
const {
|
|
979
1040
|
width: width
|
|
@@ -986,7 +1047,7 @@ function $e8ffe11ed01df0fe$export$e6fffe67d4cdd848(whatToWatch) {
|
|
|
986
1047
|
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
987
1048
|
const disconnect = (0, $i7OB2$observer).onexists(whatToWatch, ({
|
|
988
1049
|
element: element
|
|
989
|
-
}) => requestAnimationFrame($i7OB2$
|
|
1050
|
+
}) => requestAnimationFrame($i7OB2$catchify1(() => resizeObserver.observe(element))));
|
|
990
1051
|
$i7OB2$onCleanup(() => {
|
|
991
1052
|
resizeObserver.disconnect();
|
|
992
1053
|
disconnect();
|
|
@@ -1043,7 +1104,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1043
1104
|
if (existingStack) return existingStack.add(fn);
|
|
1044
1105
|
const newStack = new Set([fn]);
|
|
1045
1106
|
if (listingContext) listingContext[$e8ffe11ed01df0fe$var$onIdleFunctionsSymbol] = newStack;
|
|
1046
|
-
const processStackWhenIdle = () => $4ea56971d92eb0cd$export$2972b890694ced75($i7OB2$
|
|
1107
|
+
const processStackWhenIdle = () => $4ea56971d92eb0cd$export$2972b890694ced75($i7OB2$catchify1(deadline => {
|
|
1047
1108
|
const start = performance.now();
|
|
1048
1109
|
const thirdDeadlineTime = deadline.timeRemaining() / 3; // observers coming after this take up 2-3x the time so don't use all of it
|
|
1049
1110
|
for (const fn of newStack) {
|
|
@@ -1075,7 +1136,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1075
1136
|
let prevValue;
|
|
1076
1137
|
const aspectRatios = listingContext[$e8ffe11ed01df0fe$export$f8945274f08a3105] ||= new Set();
|
|
1077
1138
|
const [, setMostPrevalentAspectRatio] = listingContext[$e8ffe11ed01df0fe$export$6066eb417ed2e9f7] ||= $i7OB2$createSignal();
|
|
1078
|
-
img.addEventListener("load", $i7OB2$
|
|
1139
|
+
img.addEventListener("load", $i7OB2$catchify1(() => {
|
|
1079
1140
|
if (props.keyRatioUpdating) {
|
|
1080
1141
|
if (!srcJustChanged) return;
|
|
1081
1142
|
srcJustChanged = false;
|
|
@@ -1106,7 +1167,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1106
1167
|
$i7OB2$createEffect(() => {
|
|
1107
1168
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
1108
1169
|
if (timeoutSet) return;
|
|
1109
|
-
const handler = $i7OB2$
|
|
1170
|
+
const handler = $i7OB2$catchify1(() => {
|
|
1110
1171
|
if (gotCleanedUp) return;
|
|
1111
1172
|
img.sizes = sizePX(); // use latest available value of props.size
|
|
1112
1173
|
if (!sizeSetFastPath) {
|
|
@@ -1240,10 +1301,10 @@ function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
|
|
|
1240
1301
|
return $i7OB2$standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
1241
1302
|
});
|
|
1242
1303
|
}
|
|
1243
|
-
var $
|
|
1244
|
-
$
|
|
1245
|
-
$
|
|
1246
|
-
function $
|
|
1304
|
+
var $08a49ecdcd5beaca$var$_tmpl$ = ["<div", ' class="img-wrapper">', "</div>"],
|
|
1305
|
+
$08a49ecdcd5beaca$var$_tmpl$2 = ["<span", ' class="d-price original">', "</span>"],
|
|
1306
|
+
$08a49ecdcd5beaca$var$_tmpl$3 = ["<div", ' class="right-part"><div class="text-container">', '<span class="', '">', "</span><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
|
|
1307
|
+
function $08a49ecdcd5beaca$export$b73ed90f0ee50dc3({
|
|
1247
1308
|
display_: display_,
|
|
1248
1309
|
FavoriteButton_: FavoriteButton_,
|
|
1249
1310
|
userWantsExpandedSignal_: [userWantsExpanded, setUserWantsExpanded],
|
|
@@ -1280,7 +1341,7 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1280
1341
|
});
|
|
1281
1342
|
},
|
|
1282
1343
|
get children() {
|
|
1283
|
-
return $i7OB2$ssr($
|
|
1344
|
+
return $i7OB2$ssr($08a49ecdcd5beaca$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1284
1345
|
get when() {
|
|
1285
1346
|
return imageUrl();
|
|
1286
1347
|
},
|
|
@@ -1312,7 +1373,7 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1312
1373
|
return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : userWantsExpanded()) || animationIsRunning();
|
|
1313
1374
|
},
|
|
1314
1375
|
get children() {
|
|
1315
|
-
return $i7OB2$ssr($
|
|
1376
|
+
return $i7OB2$ssr($08a49ecdcd5beaca$var$_tmpl$3, $i7OB2$ssrHydrationKey(), $i7OB2$ssrElement("span", $i7OB2$mergeProps({
|
|
1316
1377
|
"class": "d-title line-clamp"
|
|
1317
1378
|
}, () => title() && {
|
|
1318
1379
|
title: title()
|
|
@@ -1351,7 +1412,7 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1351
1412
|
return isOnSale();
|
|
1352
1413
|
},
|
|
1353
1414
|
get children() {
|
|
1354
|
-
return $i7OB2$ssr($
|
|
1415
|
+
return $i7OB2$ssr($08a49ecdcd5beaca$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1355
1416
|
get when() {
|
|
1356
1417
|
return variantToUse() && !originalPrice.loading;
|
|
1357
1418
|
},
|
|
@@ -1405,7 +1466,7 @@ async function $1f9a34ca8a87d49f$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1405
1466
|
const waitAFrame = () => new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)));
|
|
1406
1467
|
const timeoutPromise = new Promise(r => {
|
|
1407
1468
|
resolveTimeoutPromise = r;
|
|
1408
|
-
setTimeout($i7OB2$
|
|
1469
|
+
setTimeout($i7OB2$catchify1(() => {
|
|
1409
1470
|
r();
|
|
1410
1471
|
div.remove();
|
|
1411
1472
|
}), 500);
|
|
@@ -1437,12 +1498,12 @@ async function $1f9a34ca8a87d49f$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1437
1498
|
});
|
|
1438
1499
|
await timeoutPromise;
|
|
1439
1500
|
} catch (e) {
|
|
1440
|
-
$i7OB2$
|
|
1501
|
+
$i7OB2$dlog1("Failed to check if affected by chrome bug 326498383", e);
|
|
1441
1502
|
}
|
|
1442
1503
|
return isAffected;
|
|
1443
1504
|
}
|
|
1444
|
-
var $
|
|
1445
|
-
function $
|
|
1505
|
+
var $11fb4b33b36ecfac$var$_tmpl$ = ["<div", ' class="scroll-padding"><div class="', '" style="', '">', "</div></div>"];
|
|
1506
|
+
function $11fb4b33b36ecfac$export$ebf0b1d4f90c09ae({
|
|
1446
1507
|
displays_: displays_,
|
|
1447
1508
|
FavoriteButton_: FavoriteButton_,
|
|
1448
1509
|
userWantsExpandedSignal_: userWantsExpandedSignal_,
|
|
@@ -1461,6 +1522,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1461
1522
|
const textFadeInAnimationRunning = $i7OB2$createSignal(false);
|
|
1462
1523
|
const [getSecondPartAnimationRunning] = textFadeInAnimationRunning;
|
|
1463
1524
|
const [userWantsExpanded, setUserWantsExpanded] = userWantsExpandedSignal_;
|
|
1525
|
+
//const elementsHovered = useMobileHover();
|
|
1464
1526
|
$1f9a34ca8a87d49f$export$7b9a0e99f0aeb2f3().then(is => isAffectedByChromeBug = is);
|
|
1465
1527
|
return $i7OB2$createComponent((0, $011607bdf658f807$export$e68cff63f76bd15b), {
|
|
1466
1528
|
get children() {
|
|
@@ -1469,7 +1531,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1469
1531
|
return containerWidth_() || !displays_();
|
|
1470
1532
|
},
|
|
1471
1533
|
get children() {
|
|
1472
|
-
return $i7OB2$ssr($
|
|
1534
|
+
return $i7OB2$ssr($11fb4b33b36ecfac$var$_tmpl$, $i7OB2$ssrHydrationKey(), `look-overlay ${userWantsExpanded() ? "expanded" : ""} ${!getSecondPartAnimationRunning() && userWantsExpanded() ? "resting-fully-expanded" : ""}`, $i7OB2$ssrStyle(displays_() &&
|
|
1473
1535
|
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1474
1536
|
`--look-card-width:${containerWidth_()}px;--look-card-height:${containerHeight_()}px;--look-item-height:${lookItemHeight() || 200}px`), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Index), {
|
|
1475
1537
|
get each() {
|
|
@@ -1478,7 +1540,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1478
1540
|
});
|
|
1479
1541
|
},
|
|
1480
1542
|
children: (display, index) => {
|
|
1481
|
-
return $i7OB2$createComponent((0, $
|
|
1543
|
+
return $i7OB2$createComponent((0, $08a49ecdcd5beaca$export$b73ed90f0ee50dc3), {
|
|
1482
1544
|
pseudoRouter_: pseudoRouter_,
|
|
1483
1545
|
animationDuration_: animationDuration_,
|
|
1484
1546
|
display_: display,
|
|
@@ -1488,7 +1550,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1488
1550
|
priceFormatting_: priceFormatting_,
|
|
1489
1551
|
outerRef_: el => $i7OB2$createEffect(() => {
|
|
1490
1552
|
if (index !== 0) return;
|
|
1491
|
-
const resizeObserver = new ResizeObserver($i7OB2$
|
|
1553
|
+
const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => setLookItemHeight(records.at(-1).contentRect.height)));
|
|
1492
1554
|
resizeObserver.observe(el);
|
|
1493
1555
|
$i7OB2$onCleanup(() => resizeObserver.disconnect());
|
|
1494
1556
|
})
|
|
@@ -1503,11 +1565,11 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1503
1565
|
/**
|
|
1504
1566
|
* Workaround for Chrome bug 326498383, adapted version of https://stackoverflow.com/a/39494245
|
|
1505
1567
|
*/
|
|
1506
|
-
function $
|
|
1568
|
+
function $11fb4b33b36ecfac$var$scrollingFunctionForChrome(element, targetScrollY, duration) {
|
|
1507
1569
|
let start;
|
|
1508
1570
|
const startingY = element.scrollTop;
|
|
1509
1571
|
const diff = targetScrollY - startingY;
|
|
1510
|
-
const step = $i7OB2$
|
|
1572
|
+
const step = $i7OB2$catchify1(timestamp => {
|
|
1511
1573
|
if (!start) start = timestamp;
|
|
1512
1574
|
// Elapsed milliseconds since start of scrolling.
|
|
1513
1575
|
const time = timestamp - start;
|
|
@@ -1520,8 +1582,8 @@ function $7555dcad3b8a4632$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1520
1582
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1521
1583
|
requestAnimationFrame(step);
|
|
1522
1584
|
}
|
|
1523
|
-
var $
|
|
1524
|
-
function $
|
|
1585
|
+
var $e9d1d09be9e6471e$var$_tmpl$ = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
|
|
1586
|
+
function $e9d1d09be9e6471e$export$44809a8a3e867e30({
|
|
1525
1587
|
display_: display_,
|
|
1526
1588
|
expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
|
|
1527
1589
|
FavoriteButton_: FavoriteButton_,
|
|
@@ -1538,7 +1600,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1538
1600
|
const index = $b6440e72ed83671a$export$e3faf4d95300054f();
|
|
1539
1601
|
const [containerWidth_, setContainerWidth] = $i7OB2$createSignal();
|
|
1540
1602
|
const [containerHeight_, setContainerHeight] = $i7OB2$createSignal();
|
|
1541
|
-
const clickHandler = $i7OB2$
|
|
1603
|
+
const clickHandler = $i7OB2$catchify1(({
|
|
1542
1604
|
target: target
|
|
1543
1605
|
}) => {
|
|
1544
1606
|
if (target !== container && !container.contains(target))
|
|
@@ -1577,7 +1639,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1577
1639
|
}
|
|
1578
1640
|
// Close us if another look expands
|
|
1579
1641
|
$i7OB2$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1580
|
-
return $i7OB2$ssr($
|
|
1642
|
+
return $i7OB2$ssr($e9d1d09be9e6471e$var$_tmpl$, $i7OB2$ssrHydrationKey(), `look-card ${!display_() ? "placeholder" : ""}`, $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1581
1643
|
get when() {
|
|
1582
1644
|
return display_();
|
|
1583
1645
|
},
|
|
@@ -1595,7 +1657,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1595
1657
|
autoAdjustAspectRatio: true
|
|
1596
1658
|
});
|
|
1597
1659
|
}
|
|
1598
|
-
})), $i7OB2$escape($i7OB2$createComponent((0, $
|
|
1660
|
+
})), $i7OB2$escape($i7OB2$createComponent((0, $11fb4b33b36ecfac$export$ebf0b1d4f90c09ae), {
|
|
1599
1661
|
displays_: () => display_()?.displays,
|
|
1600
1662
|
userWantsExpandedSignal_: useWantsExpandedSignal_,
|
|
1601
1663
|
containerWidth_: containerWidth_,
|
|
@@ -1674,7 +1736,7 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
1674
1736
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
1675
1737
|
* @param listing_id_ If you are navigating to a category and know the listing_id of, please provide it. This is for making a better devEx in js-ui
|
|
1676
1738
|
*/
|
|
1677
|
-
go_to_: $i7OB2$
|
|
1739
|
+
go_to_: $i7OB2$catchify1(async ({
|
|
1678
1740
|
new_url_: raw_new_url,
|
|
1679
1741
|
event_: event_,
|
|
1680
1742
|
force_spa_navigation_: force_spa_navigation_,
|
|
@@ -1853,7 +1915,7 @@ function $07ef910e8ef6b783$export$2c9f9bf2092486aa(props) {
|
|
|
1853
1915
|
return $07ef910e8ef6b783$var$runDisplayTransformersForLooks(baseData, listings, props.displayTransformers_);
|
|
1854
1916
|
});
|
|
1855
1917
|
const sharedOptions = {
|
|
1856
|
-
product_card_template_: display => $
|
|
1918
|
+
product_card_template_: display => $e9d1d09be9e6471e$export$44809a8a3e867e30({
|
|
1857
1919
|
display_: () => display,
|
|
1858
1920
|
FavoriteButton_: props.FavoriteButton_,
|
|
1859
1921
|
placeholderImageAspectRatio_: props.imagePlaceholderAspectRatio_,
|
|
@@ -2162,7 +2224,7 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
|
2162
2224
|
// don't wait if it's the first request
|
|
2163
2225
|
write_current_instant_query(value);
|
|
2164
2226
|
clearTimeout(timeout);
|
|
2165
|
-
timeout = setTimeout($i7OB2$
|
|
2227
|
+
timeout = setTimeout($i7OB2$catchify1(() => write_current_instant_query(value)), 250);
|
|
2166
2228
|
});
|
|
2167
2229
|
const [search_results] = $i7OB2$createResource($i7OB2$createMemo(() => ({
|
|
2168
2230
|
// <-- key order important, see comment below
|
|
@@ -2170,7 +2232,7 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
|
2170
2232
|
market: market_(),
|
|
2171
2233
|
locale: i18n_.backend_locale_(),
|
|
2172
2234
|
query: read_current_instant_query()
|
|
2173
|
-
})), $i7OB2$
|
|
2235
|
+
})), $i7OB2$catchify1(async variable_data => {
|
|
2174
2236
|
return depict_api_.query({
|
|
2175
2237
|
// 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
|
|
2176
2238
|
limit: $i7OB2$untrack(has_sort_or_filters_) ? max_cards : min_products_to_fetch_,
|
|
@@ -2261,7 +2323,7 @@ function $d78eea1e8707dc2d$export$c7e181728ad525f(url) {
|
|
|
2261
2323
|
return;
|
|
2262
2324
|
$d78eea1e8707dc2d$var$last_sent_value = new_value;
|
|
2263
2325
|
const args = ["depict.send", "pageview", new_value];
|
|
2264
|
-
$i7OB2$
|
|
2326
|
+
$i7OB2$dlog1("Calling ga with args", ...args);
|
|
2265
2327
|
// @ts-ignore
|
|
2266
2328
|
ga(...args);
|
|
2267
2329
|
}
|
|
@@ -2275,7 +2337,7 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
|
2275
2337
|
if (process.env.GA === "false") return;
|
|
2276
2338
|
let debounce_timeout;
|
|
2277
2339
|
const stop_timeout = () => clearTimeout(debounce_timeout);
|
|
2278
|
-
const send_to_ga = $i7OB2$
|
|
2340
|
+
const send_to_ga = $i7OB2$catchify1(() => {
|
|
2279
2341
|
const fake_url = new URL(location.href);
|
|
2280
2342
|
const {
|
|
2281
2343
|
searchParams: searchParams
|
|
@@ -2288,12 +2350,12 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
|
2288
2350
|
$i7OB2$onCleanup(() => {
|
|
2289
2351
|
setTimeout(
|
|
2290
2352
|
// 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
|
|
2291
|
-
$i7OB2$
|
|
2353
|
+
$i7OB2$catchify1(() => {
|
|
2292
2354
|
if ($i7OB2$untrack(get_search_query_) === $i7OB2$untrack(get_search_field_value_)) stop_timeout();
|
|
2293
2355
|
}));
|
|
2294
2356
|
});
|
|
2295
2357
|
let first_call = true;
|
|
2296
|
-
$i7OB2$createEffect($i7OB2$
|
|
2358
|
+
$i7OB2$createEffect($i7OB2$catchify1(() => {
|
|
2297
2359
|
get_search_field_value_();
|
|
2298
2360
|
if (first_call) {
|
|
2299
2361
|
// we only want to do stuff when it changes
|
|
@@ -2312,7 +2374,7 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({
|
|
|
2312
2374
|
const [get_current_href, set_current_href] = $i7OB2$createSignal(location.href);
|
|
2313
2375
|
const [exit_iterable, exitable_iterable] = $i7OB2$make_asyncIterable_exiter((0, $i7OB2$href_change_ipns));
|
|
2314
2376
|
$i7OB2$onCleanup(exit_iterable);
|
|
2315
|
-
$i7OB2$
|
|
2377
|
+
$i7OB2$catchify1(async () => {
|
|
2316
2378
|
for await (const href of exitable_iterable)
|
|
2317
2379
|
// use native links so ppl can cmdclick/right click and open in new tab and see target URL
|
|
2318
2380
|
set_current_href(href);
|
|
@@ -2705,7 +2767,7 @@ function $6ef2e4ea23810f23$var$actual_navigation_working_on_fake_data({
|
|
|
2705
2767
|
if (!$i7OB2$untrack(() => read_updating_blocked())) previous_value = sfv;
|
|
2706
2768
|
});
|
|
2707
2769
|
const owner = $i7OB2$getOwner();
|
|
2708
|
-
const handler = $i7OB2$
|
|
2770
|
+
const handler = $i7OB2$catchify1(({
|
|
2709
2771
|
keyCode: keyCode
|
|
2710
2772
|
}) => $i7OB2$untrack(() => {
|
|
2711
2773
|
const up = keyCode === 38;
|
|
@@ -2769,7 +2831,7 @@ function $6ef2e4ea23810f23$var$actual_navigation_working_on_fake_data({
|
|
|
2769
2831
|
const el = element_();
|
|
2770
2832
|
if (!el) return;
|
|
2771
2833
|
el.addEventListener("keyup", handler);
|
|
2772
|
-
$i7OB2$onCleanup($i7OB2$
|
|
2834
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => el.removeEventListener("keyup", handler)));
|
|
2773
2835
|
});
|
|
2774
2836
|
}
|
|
2775
2837
|
function $1ae0eaca6ada9753$export$af0124069c150252({
|
|
@@ -2966,7 +3028,7 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
2966
3028
|
|
|
2967
3029
|
function $2449872a62a75a20$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
2968
3030
|
const [width, setWidth] = $i7OB2$createSignal();
|
|
2969
|
-
const resizeObserver = new ResizeObserver($i7OB2$
|
|
3031
|
+
const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => {
|
|
2970
3032
|
for (let j = 0; j < records.length; j++) {
|
|
2971
3033
|
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
2972
3034
|
setWidth(width);
|
|
@@ -2976,7 +3038,7 @@ function $2449872a62a75a20$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
|
2976
3038
|
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
2977
3039
|
const disconnect = (0, $i7OB2$observer).onexists(what_to_watch, ({
|
|
2978
3040
|
element: element
|
|
2979
|
-
}) => requestAnimationFrame($i7OB2$
|
|
3041
|
+
}) => requestAnimationFrame($i7OB2$catchify1(() => {
|
|
2980
3042
|
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
2981
3043
|
if (current_size)
|
|
2982
3044
|
// If element has size, set signal to that. ResizeObserver only triggers when the content is visible in some cases, but it might already have a size. This reduces size filter expanding animation jank in chrome.
|
|
@@ -3020,7 +3082,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
3020
3082
|
let input_element;
|
|
3021
3083
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
3022
3084
|
let field_div;
|
|
3023
|
-
$i7OB2$createEffect($i7OB2$
|
|
3085
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
3024
3086
|
if (disabled_) return;
|
|
3025
3087
|
// we aren't in DOM yet unfortunately, wouldn't even be with onMount
|
|
3026
3088
|
await (0, $i7OB2$observer).wait_for_element(input_element);
|
|
@@ -3097,18 +3159,18 @@ function $aea1edf92433e81e$export$fe334901e8bebd57() {
|
|
|
3097
3159
|
offset: 0
|
|
3098
3160
|
}, 1);
|
|
3099
3161
|
animation.pause();
|
|
3100
|
-
const fn = $i7OB2$
|
|
3162
|
+
const fn = $i7OB2$catchify1(animation.play.bind(animation));
|
|
3101
3163
|
cleanup_fns.push(fn);
|
|
3102
3164
|
$i7OB2$onCleanup(fn);
|
|
3103
3165
|
} catch (e) {
|
|
3104
|
-
$i7OB2$
|
|
3166
|
+
$i7OB2$dlog1("Probably partial keyframe error", e);
|
|
3105
3167
|
}
|
|
3106
3168
|
if (getComputedStyle(element).overflow !== "hidden") {
|
|
3107
3169
|
// safari gets special hacky treatment
|
|
3108
3170
|
const style = element.style;
|
|
3109
3171
|
const original_value = style.overflow;
|
|
3110
3172
|
style.overflow = "hidden";
|
|
3111
|
-
const fn = $i7OB2$
|
|
3173
|
+
const fn = $i7OB2$catchify1(() => style.overflow = original_value);
|
|
3112
3174
|
cleanup_fns.push(fn);
|
|
3113
3175
|
$i7OB2$onCleanup(fn);
|
|
3114
3176
|
}
|
|
@@ -3131,8 +3193,8 @@ function $512b994d501f412b$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
|
|
|
3131
3193
|
let set_initial_values = false;
|
|
3132
3194
|
let old_pathname;
|
|
3133
3195
|
let old_param_value;
|
|
3134
|
-
$i7OB2$onCleanup($i7OB2$
|
|
3135
|
-
$i7OB2$
|
|
3196
|
+
$i7OB2$onCleanup($i7OB2$catchify1(exit_iterable));
|
|
3197
|
+
$i7OB2$catchify1(async () => {
|
|
3136
3198
|
for await (const href of exitable_iterable) {
|
|
3137
3199
|
const u_o = new URL(href);
|
|
3138
3200
|
const new_pathname = u_o.pathname;
|
|
@@ -3203,7 +3265,7 @@ function $42912431795f188e$var$RawClassicSearchModal({
|
|
|
3203
3265
|
} = alignmentSignals_ || {};
|
|
3204
3266
|
const [bodyAlignmentStyle] = bodyAlignmentSignal;
|
|
3205
3267
|
const [get_modal_search_results, set_modal_search_results_] = $i7OB2$createSignal();
|
|
3206
|
-
const close_on_escape_handler = $i7OB2$
|
|
3268
|
+
const close_on_escape_handler = $i7OB2$catchify1(({
|
|
3207
3269
|
key: key
|
|
3208
3270
|
}) => {
|
|
3209
3271
|
if (key === "Escape") close_modal_();
|
|
@@ -3228,7 +3290,7 @@ function $42912431795f188e$var$RawClassicSearchModal({
|
|
|
3228
3290
|
if (disable_scrolling_) $aea1edf92433e81e$export$fe334901e8bebd57();
|
|
3229
3291
|
$512b994d501f412b$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
3230
3292
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
3231
|
-
$i7OB2$onCleanup($i7OB2$
|
|
3293
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => window.removeEventListener("keydown", close_on_escape_handler)));
|
|
3232
3294
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
3233
3295
|
$c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
3234
3296
|
get_search_field_value_: get_search_field_value_,
|
|
@@ -3433,7 +3495,7 @@ function $4147651646da990a$var$decode_filter_data(op, encoded_data) {
|
|
|
3433
3495
|
try {
|
|
3434
3496
|
return JSON.parse($i7OB2$base64_decode_unicode(encoded_data));
|
|
3435
3497
|
} catch (e) {
|
|
3436
|
-
$i7OB2$
|
|
3498
|
+
$i7OB2$dlog1("Failed to fallback parse filter data", op, encoded_data, e);
|
|
3437
3499
|
}
|
|
3438
3500
|
return null;
|
|
3439
3501
|
}
|
|
@@ -3491,7 +3553,7 @@ function $4147651646da990a$export$766e9676e74997d3(search_params, sorting_query_
|
|
|
3491
3553
|
field: encoded_sorting.slice(0, -$4147651646da990a$var$descending_token.length),
|
|
3492
3554
|
order: "desc"
|
|
3493
3555
|
};
|
|
3494
|
-
$i7OB2$
|
|
3556
|
+
$i7OB2$dlog1("Invalid sorting query param value", encoded_sorting);
|
|
3495
3557
|
return;
|
|
3496
3558
|
}
|
|
3497
3559
|
function $4147651646da990a$export$916e6850778505f6(search_params, filter_query_param_prefix, sorting_query_param) {
|
|
@@ -4048,7 +4110,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
4048
4110
|
const random_classname_body = $i7OB2$make_random_classname();
|
|
4049
4111
|
const backdropRandomClassname = $i7OB2$make_random_classname();
|
|
4050
4112
|
const [get_modal_search_results_, set_modal_search_results_] = $i7OB2$createSignal();
|
|
4051
|
-
const close_on_escape_handler = $i7OB2$
|
|
4113
|
+
const close_on_escape_handler = $i7OB2$catchify1(evt => {
|
|
4052
4114
|
if (evt.key === "Escape") {
|
|
4053
4115
|
evt.preventDefault(); // Prevent the browser from closing/cancelling the modal so our animations have time to run
|
|
4054
4116
|
close_modal_();
|
|
@@ -4144,7 +4206,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
4144
4206
|
$i7OB2$createEffect($i7OB2$on(get_search_field_value_, () => {
|
|
4145
4207
|
setShowStaleListingSuggestions(true);
|
|
4146
4208
|
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
4147
|
-
listingSuggestionsDebounceTimeout = setTimeout($i7OB2$
|
|
4209
|
+
listingSuggestionsDebounceTimeout = setTimeout($i7OB2$catchify1(() => setShowStaleListingSuggestions(false)), 350);
|
|
4148
4210
|
}, {
|
|
4149
4211
|
defer: true
|
|
4150
4212
|
}));
|
|
@@ -4279,7 +4341,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
4279
4341
|
}
|
|
4280
4342
|
});
|
|
4281
4343
|
if (setSearchFieldOuterWidth_) {
|
|
4282
|
-
const resizeObserver = new ResizeObserver($i7OB2$
|
|
4344
|
+
const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));
|
|
4283
4345
|
resizeObserver.observe(search_field);
|
|
4284
4346
|
$i7OB2$onCleanup(() => resizeObserver.disconnect());
|
|
4285
4347
|
}
|
|
@@ -4329,7 +4391,7 @@ function $024fbc0a2d796fad$var$ActualTabs(props) {
|
|
|
4329
4391
|
});
|
|
4330
4392
|
const isSelected = $i7OB2$createSelector(currentlySelected);
|
|
4331
4393
|
const owner = $i7OB2$getOwner();
|
|
4332
|
-
const updateTabsSignal = $i7OB2$
|
|
4394
|
+
const updateTabsSignal = $i7OB2$catchify(() => $i7OB2$runWithOwner(owner, () => setTabsReactive([...ourTabsSet])));
|
|
4333
4395
|
const ourTabsSet = $024fbc0a2d796fad$var$useTabs();
|
|
4334
4396
|
const location = $i7OB2$use_href_accessor1();
|
|
4335
4397
|
const linkWithChangedHash = hash => {
|
|
@@ -4432,7 +4494,7 @@ function $024fbc0a2d796fad$export$3e41faf802a29e71(props) {
|
|
|
4432
4494
|
async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_opts, parent) {
|
|
4433
4495
|
const body = parent || document.body || (await (0, $i7OB2$observer).wait_for_element("body"));
|
|
4434
4496
|
let dispose_and_remove;
|
|
4435
|
-
const open_modal_ = $i7OB2$
|
|
4497
|
+
const open_modal_ = $i7OB2$catchify1(async (extra_options_for_modal = {}, on_dispose) => {
|
|
4436
4498
|
// Below await is very intentional,
|
|
4437
4499
|
// The reason is that effects don't run in <Suspense> boundaries before they've resolved and this carries even through roots created, but if a modal is opened from a suspense boundary we still want the effects in it to run
|
|
4438
4500
|
// This is because the suspense is for the content in the page and not the modal (the modal goes above it)
|
|
@@ -4462,7 +4524,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
4462
4524
|
// Animation broke, close it this time
|
|
4463
4525
|
actually_close();else if (!animation_started && closing_animation) {
|
|
4464
4526
|
animation_started = +new Date();
|
|
4465
|
-
$i7OB2$
|
|
4527
|
+
$i7OB2$catchify1(closing_animation)()?.then($i7OB2$catchify1(actually_close));
|
|
4466
4528
|
} else actually_close();
|
|
4467
4529
|
};
|
|
4468
4530
|
return search_modal({
|
|
@@ -4475,7 +4537,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
4475
4537
|
});
|
|
4476
4538
|
body.append(...modal_els);
|
|
4477
4539
|
});
|
|
4478
|
-
const close_modal_ = $i7OB2$
|
|
4540
|
+
const close_modal_ = $i7OB2$catchify1(() => {
|
|
4479
4541
|
if (dispose_and_remove) {
|
|
4480
4542
|
// modal is open
|
|
4481
4543
|
const dispose_fn = dispose_and_remove;
|
|
@@ -4492,7 +4554,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
4492
4554
|
function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, router_) {
|
|
4493
4555
|
const signals = {};
|
|
4494
4556
|
const entries = Object.entries(params_to_default_value);
|
|
4495
|
-
const event_handler = $i7OB2$
|
|
4557
|
+
const event_handler = $i7OB2$catchify1((what_happened, args) => {
|
|
4496
4558
|
// Intentionally always update our signals to the history state to allow external control of SDK state for doing things like https://linear.app/depictai/issue/X-1432/is-this-possible-with-the-depict-sdk
|
|
4497
4559
|
if (what_happened !== "popstate") return;
|
|
4498
4560
|
// Had to undo the comment above,but leaving the history. Doing this because discovering why it doesn't work is a deja-vu and I don't want to have to discover it again.
|
|
@@ -4523,8 +4585,8 @@ function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, rout
|
|
|
4523
4585
|
});
|
|
4524
4586
|
// 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
|
|
4525
4587
|
(0, $i7OB2$instant_exec_on_suspect_history_change).add(event_handler);
|
|
4526
|
-
$i7OB2$onCleanup($i7OB2$
|
|
4527
|
-
$i7OB2$createEffect($i7OB2$
|
|
4588
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => (0, $i7OB2$instant_exec_on_suspect_history_change).delete(event_handler)));
|
|
4589
|
+
$i7OB2$createEffect($i7OB2$catchify1(() => $i7OB2$untrack($i7OB2$catchify1(() => $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
|
|
4528
4590
|
return signals;
|
|
4529
4591
|
}
|
|
4530
4592
|
function $ca6f574bd8772184$var$history_state_change(signals, entries, state) {
|
|
@@ -4658,7 +4720,7 @@ function $45d4ed34a22ab90c$export$6b35356958ae5587(props) {
|
|
|
4658
4720
|
// If someone clicks on a product card in the shop the look modal, close the modal the next time the href changes
|
|
4659
4721
|
for (const item of resolved()) {
|
|
4660
4722
|
if (!(item instanceof Element)) return;
|
|
4661
|
-
item.addEventListener("click", $i7OB2$
|
|
4723
|
+
item.addEventListener("click", $i7OB2$catchify1(() =>
|
|
4662
4724
|
// run with modal owner so we don't do stuff after the modal closes
|
|
4663
4725
|
// can't have the owner of the product card as that gets disposed if the productId changes which might be too early (before location.href has changed)
|
|
4664
4726
|
$i7OB2$runWithOwner(props.modalOwner_, () => $i7OB2$createEffect($i7OB2$on(hrefWithoutHash, props.actually_close_modal_, {
|
|
@@ -4867,7 +4929,7 @@ function $8560c919ff763930$var$actualSetupModal() {
|
|
|
4867
4929
|
(0, $90980bd87c9960f9$export$3064e1e8c6513da3).add(history_key);
|
|
4868
4930
|
const actually_close_modal_ = () => set_history_value(false);
|
|
4869
4931
|
const owner = $i7OB2$getOwner();
|
|
4870
|
-
$i7OB2$
|
|
4932
|
+
$i7OB2$catchify1(async () => {
|
|
4871
4933
|
const {
|
|
4872
4934
|
open_modal_: open_modal_,
|
|
4873
4935
|
close_modal_: close_modal_
|
|
@@ -4940,15 +5002,15 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
4940
5002
|
$i7OB2$insert(details_, [summary_, $i7OB2$createComponent(ExpandingContainer, {
|
|
4941
5003
|
children: children
|
|
4942
5004
|
})], null);
|
|
4943
|
-
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(details_).then($i7OB2$
|
|
4944
|
-
$i7OB2$createEffect($i7OB2$
|
|
5005
|
+
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(details_).then($i7OB2$catchify1(() => set_is_in_dom(true)));
|
|
5006
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
4945
5007
|
const is_open = is_open_memo();
|
|
4946
5008
|
if (!is_in_dom())
|
|
4947
5009
|
// wait with setting state until we're in DOM, animation won't work otherwise
|
|
4948
5010
|
return;
|
|
4949
5011
|
if (dont_animate_if_instant_open_ && fresh_component && !timeout_started) {
|
|
4950
5012
|
timeout_started = true;
|
|
4951
|
-
setTimeout($i7OB2$
|
|
5013
|
+
setTimeout($i7OB2$catchify1(() => fresh_component = false));
|
|
4952
5014
|
}
|
|
4953
5015
|
if (is_open) {
|
|
4954
5016
|
details_.open = true; // open up the toggle so the animation can happen
|
|
@@ -4956,10 +5018,10 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
4956
5018
|
await expand(0, do_duration);
|
|
4957
5019
|
} else {
|
|
4958
5020
|
const animation = await collapse();
|
|
4959
|
-
animation?.addEventListener("finish", $i7OB2$
|
|
5021
|
+
animation?.addEventListener("finish", $i7OB2$catchify1(() => details_.open = false));
|
|
4960
5022
|
}
|
|
4961
5023
|
}));
|
|
4962
|
-
details_.addEventListener("toggle", $i7OB2$
|
|
5024
|
+
details_.addEventListener("toggle", $i7OB2$catchify1(() => {
|
|
4963
5025
|
const {
|
|
4964
5026
|
open: open
|
|
4965
5027
|
} = details_;
|
|
@@ -4969,11 +5031,11 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
4969
5031
|
}) // in case someone somehow toggles it without us intercepting it at least follow suit
|
|
4970
5032
|
);
|
|
4971
5033
|
|
|
4972
|
-
summary_.addEventListener("click", $i7OB2$
|
|
5034
|
+
summary_.addEventListener("click", $i7OB2$catchify1(ev => {
|
|
4973
5035
|
ev.preventDefault();
|
|
4974
5036
|
toggle();
|
|
4975
5037
|
}));
|
|
4976
|
-
summary_.addEventListener("keydown", $i7OB2$
|
|
5038
|
+
summary_.addEventListener("keydown", $i7OB2$catchify1(ev => {
|
|
4977
5039
|
const {
|
|
4978
5040
|
key: key
|
|
4979
5041
|
} = ev;
|
|
@@ -5196,9 +5258,9 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({
|
|
|
5196
5258
|
});
|
|
5197
5259
|
const [is_in_dom, set_is_in_dom] = $i7OB2$createSignal(document.documentElement.contains(outmost_element));
|
|
5198
5260
|
const hidden = $i7OB2$createMemo(() => get_search_filters_open_() || get_search_sorting_open_());
|
|
5199
|
-
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(outmost_element).then($i7OB2$
|
|
5261
|
+
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(outmost_element).then($i7OB2$catchify1(() => set_is_in_dom(true)));
|
|
5200
5262
|
outmost_element.classList.add("selected-filters");
|
|
5201
|
-
$i7OB2$createEffect($i7OB2$
|
|
5263
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
5202
5264
|
if (!is_in_dom())
|
|
5203
5265
|
// wait with setting state until we're in DOM, animation won't work otherwise
|
|
5204
5266
|
return;
|
|
@@ -5345,7 +5407,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
|
|
|
5345
5407
|
}) : []);
|
|
5346
5408
|
});
|
|
5347
5409
|
$i7OB2$onCleanup(() => set_view_more_button_below_group_());
|
|
5348
|
-
$i7OB2$createEffect($i7OB2$
|
|
5410
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
5349
5411
|
if (!togglable_rest()) {
|
|
5350
5412
|
await collapse();
|
|
5351
5413
|
return;
|
|
@@ -5457,7 +5519,7 @@ function $a6b08770e164eced$export$e0d834a0ad870cda({
|
|
|
5457
5519
|
});
|
|
5458
5520
|
$i7OB2$createComputed(() => {
|
|
5459
5521
|
clearTimeout(debounce_timeout);
|
|
5460
|
-
debounce_timeout = setTimeout($i7OB2$
|
|
5522
|
+
debounce_timeout = setTimeout($i7OB2$catchify1(range => $i7OB2$untrack(() => {
|
|
5461
5523
|
const default_data = defaultRange();
|
|
5462
5524
|
const filter_object = {
|
|
5463
5525
|
op: filter_().op,
|
|
@@ -5984,7 +6046,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({
|
|
|
5984
6046
|
}
|
|
5985
6047
|
while (execute_when_structure_finished.length) execute_when_structure_finished.pop()();
|
|
5986
6048
|
$1c8cac76cb67e9af$var$expand_until_choice(data_structure);
|
|
5987
|
-
$i7OB2$
|
|
6049
|
+
$i7OB2$dlog1("CheckboxHierarchicalFilter: Recomputed structured_categories", data_structure);
|
|
5988
6050
|
return data_structure;
|
|
5989
6051
|
});
|
|
5990
6052
|
const some_top_level_are_hidden = $i7OB2$createMemo(() => Object.keys(structured_categories()).length > $1c8cac76cb67e9af$var$max_visible_without_collapsing);
|
|
@@ -6014,7 +6076,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({
|
|
|
6014
6076
|
}) : []);
|
|
6015
6077
|
});
|
|
6016
6078
|
$i7OB2$onCleanup(() => set_view_more_button_below_group());
|
|
6017
|
-
$i7OB2$createEffect($i7OB2$
|
|
6079
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
6018
6080
|
if (!some_top_level_are_hidden()) {
|
|
6019
6081
|
await collapse();
|
|
6020
6082
|
return;
|
|
@@ -6074,7 +6136,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_, filter
|
|
|
6074
6136
|
return value()?.is_checked_?.[0]?.() ?? false;
|
|
6075
6137
|
},
|
|
6076
6138
|
input_ref_: input => {
|
|
6077
|
-
input.addEventListener("change", $i7OB2$
|
|
6139
|
+
input.addEventListener("change", $i7OB2$catchify1(() => $i7OB2$untrack(() => {
|
|
6078
6140
|
const {
|
|
6079
6141
|
checked: checked
|
|
6080
6142
|
} = input;
|
|
@@ -6149,7 +6211,7 @@ function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
|
6149
6211
|
existing_filter_: existing_filter_
|
|
6150
6212
|
} = props;
|
|
6151
6213
|
let sync_queued = false;
|
|
6152
|
-
const sync_fn = $i7OB2$
|
|
6214
|
+
const sync_fn = $i7OB2$catchify1(async () => {
|
|
6153
6215
|
sync_queued = false;
|
|
6154
6216
|
// if we change, update filter state - next microtask, so that "reactions" to the change can process before we send it off to the API
|
|
6155
6217
|
const set_filter = existing_filter_();
|
|
@@ -6173,7 +6235,7 @@ function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
|
6173
6235
|
...base_object,
|
|
6174
6236
|
data: data
|
|
6175
6237
|
};
|
|
6176
|
-
$i7OB2$
|
|
6238
|
+
$i7OB2$dlog1("CheckboxHierarchicalFilter: Updating API state", filter_object);
|
|
6177
6239
|
const selected_filters = [...selected_filters_[0]()];
|
|
6178
6240
|
if (set_filter) selected_filters.splice(selected_filters.indexOf(set_filter), 1);
|
|
6179
6241
|
if (filter_object.data.length) selected_filters.push(filter_object);
|
|
@@ -6206,13 +6268,13 @@ function $1c8cac76cb67e9af$var$create_updating_signal({
|
|
|
6206
6268
|
$i7OB2$createComputed($i7OB2$on(read_checked, trigger_sync_, {
|
|
6207
6269
|
defer: true
|
|
6208
6270
|
}));
|
|
6209
|
-
$i7OB2$createComputed($i7OB2$on(read_checked, $i7OB2$
|
|
6271
|
+
$i7OB2$createComputed($i7OB2$on(read_checked, $i7OB2$catchify1(new_value => {
|
|
6210
6272
|
if (updating_blocked) return;
|
|
6211
6273
|
for (const child of child_objects) child.is_checked_[1](new_value);
|
|
6212
6274
|
}), {
|
|
6213
6275
|
defer: true
|
|
6214
6276
|
}));
|
|
6215
|
-
$i7OB2$createEffect($i7OB2$on(get_child_object_values, $i7OB2$
|
|
6277
|
+
$i7OB2$createEffect($i7OB2$on(get_child_object_values, $i7OB2$catchify1(() => {
|
|
6216
6278
|
const all_kids_checked = get_child_object_values.every(accessor => accessor());
|
|
6217
6279
|
if (all_kids_checked === read_checked()) return;
|
|
6218
6280
|
updating_blocked = true;
|
|
@@ -6637,7 +6699,7 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
6637
6699
|
}) : []);
|
|
6638
6700
|
});
|
|
6639
6701
|
$i7OB2$onCleanup(() => set_view_more_button_below_group_());
|
|
6640
|
-
$i7OB2$createEffect($i7OB2$
|
|
6702
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
6641
6703
|
if (!togglable_rest()) {
|
|
6642
6704
|
await collapse();
|
|
6643
6705
|
set_having_expanding_in_dom(false); // Once animation has finished, remove expanding from DOM
|
|
@@ -7270,13 +7332,13 @@ async function $a0f0e923bad68a9b$export$58e808b1db15d3bc(options) {
|
|
|
7270
7332
|
headers: headers
|
|
7271
7333
|
} : {}),
|
|
7272
7334
|
method: "POST"
|
|
7273
|
-
}).catch(e => $i7OB2$
|
|
7335
|
+
}).catch(e => $i7OB2$dlog1("fetch_retry threw", e)).then(async maybe_response => {
|
|
7274
7336
|
if (!maybe_response) return [];
|
|
7275
7337
|
let decoded;
|
|
7276
7338
|
try {
|
|
7277
7339
|
decoded = await maybe_response.json();
|
|
7278
7340
|
} catch (e) {
|
|
7279
|
-
$i7OB2$
|
|
7341
|
+
$i7OB2$dlog1("Failed to decode JSON", e);
|
|
7280
7342
|
}
|
|
7281
7343
|
return decoded?.displays || [];
|
|
7282
7344
|
});
|
|
@@ -7320,7 +7382,7 @@ const $a6e23a834336fc19$export$824dde41348efed1 = /*@__PURE__*/(() => {
|
|
|
7320
7382
|
|
|
7321
7383
|
const observe_to_signal = (element, setter) => {
|
|
7322
7384
|
const computed_style = getComputedStyle(element);
|
|
7323
|
-
const resize_observer = new ResizeObserver($i7OB2$
|
|
7385
|
+
const resize_observer = new ResizeObserver($i7OB2$catchify1(() => {
|
|
7324
7386
|
setter(element.getBoundingClientRect().width + parseFloat(computed_style.marginLeft) + parseFloat(computed_style.marginRight) + parseFloat(computed_style.borderRightWidth) + parseFloat(computed_style.borderLeftWidth));
|
|
7325
7387
|
}));
|
|
7326
7388
|
resize_observer.observe(element);
|
|
@@ -7374,7 +7436,7 @@ async function $4b2134398dfa83fa$export$c1a6b039e689a58e(merchant, market, local
|
|
|
7374
7436
|
const in_ls = localStorage[localstorage_key];
|
|
7375
7437
|
if (in_ls) localstorage_value = JSON.parse(in_ls);
|
|
7376
7438
|
} catch (e) {
|
|
7377
|
-
$i7OB2$
|
|
7439
|
+
$i7OB2$dlog1("Failed parsing JSON from localStorage", e);
|
|
7378
7440
|
}
|
|
7379
7441
|
const updated = localstorage_value?.updated;
|
|
7380
7442
|
const now = +new Date();
|
|
@@ -7418,12 +7480,12 @@ async function $4b2134398dfa83fa$var$download_categories(merchant, market, local
|
|
|
7418
7480
|
if (!fetched) return [];
|
|
7419
7481
|
try {
|
|
7420
7482
|
if (fetched.status !== 200) {
|
|
7421
|
-
$i7OB2$
|
|
7483
|
+
$i7OB2$dlog1("failed to fetch queries, server responded with", fetched.status, fetched, await fetched.text());
|
|
7422
7484
|
return [];
|
|
7423
7485
|
}
|
|
7424
7486
|
return await fetched.json();
|
|
7425
7487
|
} catch (e) {
|
|
7426
|
-
$i7OB2$
|
|
7488
|
+
$i7OB2$dlog1("failed to decode queries json", fetched, e);
|
|
7427
7489
|
return [];
|
|
7428
7490
|
}
|
|
7429
7491
|
}
|
|
@@ -7558,9 +7620,9 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
7558
7620
|
return this.#cache_objs[endpoint] ||= {
|
|
7559
7621
|
in_progress_: {},
|
|
7560
7622
|
cache_: {},
|
|
7561
|
-
finalization_registry_: this.#supports_finalization_registry ? new FinalizationRegistry($i7OB2$
|
|
7623
|
+
finalization_registry_: this.#supports_finalization_registry ? new FinalizationRegistry($i7OB2$catchify1(key => {
|
|
7562
7624
|
const our_cache = this.#cache_objs[endpoint].cache_;
|
|
7563
|
-
$i7OB2$
|
|
7625
|
+
$i7OB2$dlog1("[Search API]: removing", key, "from", our_cache);
|
|
7564
7626
|
delete our_cache[key];
|
|
7565
7627
|
})) : undefined
|
|
7566
7628
|
};
|
|
@@ -7706,11 +7768,11 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
7706
7768
|
result = $e5014ccd0b76d9f4$export$967e966fca9515e(result);
|
|
7707
7769
|
cache_obj.cache_[body] = new WeakRef(result);
|
|
7708
7770
|
resolve_in_progress(result);
|
|
7709
|
-
setTimeout($i7OB2$
|
|
7771
|
+
setTimeout($i7OB2$catchify1(() => {
|
|
7710
7772
|
if (this.#supports_finalization_registry) cache_obj.finalization_registry_.register(result, body); // delete key from cache when value (WeakRefs) are collected
|
|
7711
7773
|
else
|
|
7712
7774
|
// delete things from cache after 5 minutes, so it doesn't get too heavy
|
|
7713
|
-
setTimeout($i7OB2$
|
|
7775
|
+
setTimeout($i7OB2$catchify1(() => delete cache_obj.cache_[body]), 300000);
|
|
7714
7776
|
}), 60000 // cache values for at least 60 seconds
|
|
7715
7777
|
);
|
|
7716
7778
|
|
|
@@ -7840,7 +7902,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
7840
7902
|
const [get_selected_filters_, set_selected_filters] = selected_filters_;
|
|
7841
7903
|
const [get_has_sideways_filter_clearing_flag_, set_has_sideways_filter_clearing_flag] = sideways_filter_clearing_flag_;
|
|
7842
7904
|
const [get_current_href, set_current_href] = $i7OB2$createSignal(globalThis?.location?.href ?? "https://example.com");
|
|
7843
|
-
const history_change_handler = $i7OB2$
|
|
7905
|
+
const history_change_handler = $i7OB2$catchify1(() => set_current_href(location.href));
|
|
7844
7906
|
const owner = $i7OB2$getOwner() || $i7OB2$createRoot(() => $i7OB2$getOwner());
|
|
7845
7907
|
const {
|
|
7846
7908
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -7881,7 +7943,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
7881
7943
|
if (override_listing_id_query_param_names_) {
|
|
7882
7944
|
const found_override_listing_id = override_listing_id_query_param_names_.map(n => searchParams.get(n)).find(n => n);
|
|
7883
7945
|
set_override_listing_id(found_override_listing_id || null);
|
|
7884
|
-
if (found_override_listing_id) $i7OB2$
|
|
7946
|
+
if (found_override_listing_id) $i7OB2$dlog1("Found override query id:", found_override_listing_id); // This stuff might get confusing so better log it
|
|
7885
7947
|
}
|
|
7886
7948
|
|
|
7887
7949
|
if (hash === (0, $4147651646da990a$export$84daa4fa1471698b)) set_has_sideways_filter_clearing_flag(true);
|
|
@@ -8208,13 +8270,13 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({
|
|
|
8208
8270
|
}) {
|
|
8209
8271
|
let close_toast_;
|
|
8210
8272
|
const stay_open_promise = new Promise(r => close_toast_ = r);
|
|
8211
|
-
$i7OB2$
|
|
8273
|
+
$i7OB2$catchify1(async () => {
|
|
8212
8274
|
const closing_animation_duration = 300; // ms
|
|
8213
8275
|
const element = $i7OB2$ssrElement("div", more_attributes, () => $i7OB2$escape(children), true);
|
|
8214
8276
|
const [, set_is_showing_toast] = $bf52d9f9eebd1938$export$22970a0140fc759c;
|
|
8215
8277
|
// if this is a memory leak the garbage collector is stupid - does someone know?
|
|
8216
|
-
for (const ev of ["pointerover", "focusin"]) element.addEventListener(ev, $i7OB2$
|
|
8217
|
-
for (const ev of ["pointerout", "focusout"]) element.addEventListener(ev, $i7OB2$
|
|
8278
|
+
for (const ev of ["pointerover", "focusin"]) element.addEventListener(ev, $i7OB2$catchify1(() => closing_animation.pause()));
|
|
8279
|
+
for (const ev of ["pointerout", "focusout"]) element.addEventListener(ev, $i7OB2$catchify1(() => closing_animation.play()));
|
|
8218
8280
|
const body = await (0, $i7OB2$observer).wait_for_element("body");
|
|
8219
8281
|
const x_translate = "translateX(-50%) ";
|
|
8220
8282
|
let remove_keyboard_listener;
|
|
@@ -8239,7 +8301,7 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({
|
|
|
8239
8301
|
// let other toasts close us if they open while we're still here
|
|
8240
8302
|
$bf52d9f9eebd1938$var$closing_functions.add(close_toast_);
|
|
8241
8303
|
set_is_showing_toast(true);
|
|
8242
|
-
const handler = $i7OB2$
|
|
8304
|
+
const handler = $i7OB2$catchify1(({
|
|
8243
8305
|
key: key
|
|
8244
8306
|
}) => {
|
|
8245
8307
|
if (key === "Escape")
|
|
@@ -8372,7 +8434,7 @@ function $48d7e4a9707315b6$export$e026af0c7b64ea5f({
|
|
|
8372
8434
|
}, {
|
|
8373
8435
|
defer: true
|
|
8374
8436
|
}));
|
|
8375
|
-
$i7OB2$createComputed($i7OB2$on(get_search_query_, $i7OB2$
|
|
8437
|
+
$i7OB2$createComputed($i7OB2$on(get_search_query_, $i7OB2$catchify1(() => {
|
|
8376
8438
|
// when a query was submitted, clear filters if clear was pressed before
|
|
8377
8439
|
const clear_value = $i7OB2$untrack(get_clear_filters_next_submit);
|
|
8378
8440
|
if (clear_value) {
|
|
@@ -8399,11 +8461,11 @@ function $21f51c14cb3f586f$export$84bba84a7b837187(read_search_query) {
|
|
|
8399
8461
|
const key = "depict_searches";
|
|
8400
8462
|
const previous_searches = $i7OB2$createSignal(JSON.parse(ls[key] || "[]"));
|
|
8401
8463
|
const [read_previous_searches, write_previous_searches] = previous_searches;
|
|
8402
|
-
$i7OB2$createEffect($i7OB2$
|
|
8464
|
+
$i7OB2$createEffect($i7OB2$catchify1(() => {
|
|
8403
8465
|
const json_encoded = JSON.stringify(read_previous_searches());
|
|
8404
8466
|
if (ls[key] !== json_encoded) ls[key] = json_encoded;
|
|
8405
8467
|
}));
|
|
8406
|
-
$i7OB2$createComputed($i7OB2$
|
|
8468
|
+
$i7OB2$createComputed($i7OB2$catchify1(() => {
|
|
8407
8469
|
const searches = $i7OB2$untrack(read_previous_searches);
|
|
8408
8470
|
const current_query = read_search_query();
|
|
8409
8471
|
if (!current_query)
|
|
@@ -8446,7 +8508,7 @@ async function $bfd908d13d90934c$export$e16630ecb9644a1c({
|
|
|
8446
8508
|
after_submit_?.();
|
|
8447
8509
|
}
|
|
8448
8510
|
function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true, override_element) {
|
|
8449
|
-
const catchified_handler = $i7OB2$
|
|
8511
|
+
const catchified_handler = $i7OB2$catchify1(handler);
|
|
8450
8512
|
const owner = $i7OB2$getOwner();
|
|
8451
8513
|
// 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.
|
|
8452
8514
|
// Use observer in case that this gets called before body exists
|
|
@@ -8488,7 +8550,7 @@ function $d68658730065de95$export$181cceed5c91919e(callback, alsoRaF, passiveLis
|
|
|
8488
8550
|
$i7OB2$createEffect(() => {
|
|
8489
8551
|
if (alsoRaF?.()) {
|
|
8490
8552
|
let disposed = false;
|
|
8491
|
-
const fn = $i7OB2$
|
|
8553
|
+
const fn = $i7OB2$catchify1(() => {
|
|
8492
8554
|
if (disposed) return;
|
|
8493
8555
|
probablyCallCallback();
|
|
8494
8556
|
requestAnimationFrame(fn);
|
|
@@ -8501,10 +8563,10 @@ function $d68658730065de95$export$181cceed5c91919e(callback, alsoRaF, passiveLis
|
|
|
8501
8563
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
8502
8564
|
// this works
|
|
8503
8565
|
// keeping resize just in case
|
|
8504
|
-
const resize_resize_observer = new ResizeObserver($i7OB2$
|
|
8566
|
+
const resize_resize_observer = new ResizeObserver($i7OB2$catchify1(probablyCallCallback));
|
|
8505
8567
|
resize_resize_observer.observe(document.documentElement);
|
|
8506
8568
|
(0, $i7OB2$observer).wait_for_element("body").then(resize_resize_observer.observe.bind(resize_resize_observer));
|
|
8507
|
-
$i7OB2$onCleanup($i7OB2$
|
|
8569
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => resize_resize_observer.disconnect()));
|
|
8508
8570
|
return probablyCallCallback;
|
|
8509
8571
|
}
|
|
8510
8572
|
const $b6d5529b253681aa$export$3f238c96c45e6cc6 = 1;
|
|
@@ -8535,7 +8597,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868({
|
|
|
8535
8597
|
}, pollAlignment);
|
|
8536
8598
|
let ro;
|
|
8537
8599
|
if (alignment & $b6d5529b253681aa$export$902f8b4a7dae5d78 || alignment & $b6d5529b253681aa$export$5097308c5200105a) {
|
|
8538
|
-
ro = new ResizeObserver($i7OB2$
|
|
8600
|
+
ro = new ResizeObserver($i7OB2$catchify1(records => {
|
|
8539
8601
|
records.forEach(({
|
|
8540
8602
|
contentRect: {
|
|
8541
8603
|
width: width
|
|
@@ -8558,7 +8620,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868({
|
|
|
8558
8620
|
}));
|
|
8559
8621
|
ro.observe(input_field);
|
|
8560
8622
|
}
|
|
8561
|
-
$i7OB2$onCleanup($i7OB2$
|
|
8623
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => ro?.disconnect()));
|
|
8562
8624
|
return ensureAlignedPosition;
|
|
8563
8625
|
}
|
|
8564
8626
|
const $fc5a12f3a857ca30$var$get_available_range = (available_filters_, search_for_field) => {
|
|
@@ -8758,7 +8820,7 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
|
|
|
8758
8820
|
fill: "forwards",
|
|
8759
8821
|
easing: "ease-in-out"
|
|
8760
8822
|
});
|
|
8761
|
-
animation.addEventListener("finish", $i7OB2$
|
|
8823
|
+
animation.addEventListener("finish", $i7OB2$catchify1(() => {
|
|
8762
8824
|
if (unpermit_when_possible) set_permitted_to_show(false);
|
|
8763
8825
|
animation = undefined;
|
|
8764
8826
|
element.style.display = "none";
|
|
@@ -8823,7 +8885,7 @@ function $056f6ac0a6caa919$export$5e4aed86c12acdd9({
|
|
|
8823
8885
|
is_first_load = true;
|
|
8824
8886
|
});
|
|
8825
8887
|
// 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
|
|
8826
|
-
$i7OB2$createEffect($i7OB2$
|
|
8888
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
8827
8889
|
const be_above_percentage = is_first_load ? 50 : 75; // if first load, load earlier
|
|
8828
8890
|
if (percentage_in_view_() < be_above_percentage || is_loading_more) return;
|
|
8829
8891
|
if (!get_last_cursor()) {
|
|
@@ -9513,7 +9575,7 @@ function $f8c929beb82c512b$export$9dd50d35b9d94fdf({
|
|
|
9513
9575
|
number_of_results_: number_of_results_,
|
|
9514
9576
|
type: type
|
|
9515
9577
|
}) {
|
|
9516
|
-
const contents = $i7OB2$createMemo($i7OB2$
|
|
9578
|
+
const contents = $i7OB2$createMemo($i7OB2$catchify1(() => {
|
|
9517
9579
|
const q = get_search_query_();
|
|
9518
9580
|
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_());
|
|
9519
9581
|
}));
|
|
@@ -9660,7 +9722,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({
|
|
|
9660
9722
|
set_search_sorting_open(true);
|
|
9661
9723
|
}
|
|
9662
9724
|
});
|
|
9663
|
-
$i7OB2$onCleanup($i7OB2$
|
|
9725
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => {
|
|
9664
9726
|
if (!sorting_expanded() && !filters_expanded()) {
|
|
9665
9727
|
set_search_filters_open(false);
|
|
9666
9728
|
set_search_sorting_open(false);
|
|
@@ -9769,7 +9831,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
9769
9831
|
const [sorting_open, set_sorting_open] = search_sorting_open_;
|
|
9770
9832
|
const [get_current_sorting_] = current_sorting_;
|
|
9771
9833
|
const [is_small, set_is_small] = $i7OB2$createSignal(false);
|
|
9772
|
-
const dismiss_modal_ = $i7OB2$
|
|
9834
|
+
const dismiss_modal_ = $i7OB2$catchify1(() => {
|
|
9773
9835
|
set_filters_open(false);
|
|
9774
9836
|
set_sorting_open(false);
|
|
9775
9837
|
});
|
|
@@ -9855,7 +9917,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
9855
9917
|
}));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))));
|
|
9856
9918
|
}
|
|
9857
9919
|
});
|
|
9858
|
-
$i7OB2$
|
|
9920
|
+
$i7OB2$catchify1(async () => {
|
|
9859
9921
|
({
|
|
9860
9922
|
open_modal_: open_modal_,
|
|
9861
9923
|
close_modal_: close_modal_
|
|
@@ -10021,7 +10083,7 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
10021
10083
|
}
|
|
10022
10084
|
old_pos = new_pos;
|
|
10023
10085
|
});
|
|
10024
|
-
const touchstart_handler = $i7OB2$
|
|
10086
|
+
const touchstart_handler = $i7OB2$catchify1(e => {
|
|
10025
10087
|
is_in_touch_scroll = true;
|
|
10026
10088
|
if (e.touches.length === 1) {
|
|
10027
10089
|
// 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
|
|
@@ -10029,12 +10091,12 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
10029
10091
|
diff_over_second_or_touch = 0;
|
|
10030
10092
|
}
|
|
10031
10093
|
});
|
|
10032
|
-
const touchend_handler = $i7OB2$
|
|
10094
|
+
const touchend_handler = $i7OB2$catchify1(e => {
|
|
10033
10095
|
if (e.touches.length === 0)
|
|
10034
10096
|
// scroll gesture of any type (pinch can also be used as scroll, etc.) ended
|
|
10035
10097
|
inertia_timeout = setTimeout(
|
|
10036
10098
|
// inertia ends after 500ms (educated guess)
|
|
10037
|
-
$i7OB2$
|
|
10099
|
+
$i7OB2$catchify1(() => {
|
|
10038
10100
|
is_in_touch_scroll = false;
|
|
10039
10101
|
diff_over_second_or_touch = 0;
|
|
10040
10102
|
}), 500);
|
|
@@ -10052,9 +10114,9 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
10052
10114
|
const everything_closed = !get_search_filters_open_() && !get_search_sorting_open_();
|
|
10053
10115
|
if (!$i7OB2$untrack(modal_is_closed) && everything_closed)
|
|
10054
10116
|
// I think the point of this is to delay the animation a bit IIRC
|
|
10055
|
-
timeout = setTimeout($i7OB2$
|
|
10117
|
+
timeout = setTimeout($i7OB2$catchify1(() => set_if_modal_is_closed(true)), 200);else set_if_modal_is_closed(everything_closed);
|
|
10056
10118
|
});
|
|
10057
|
-
$i7OB2$createComputed($i7OB2$
|
|
10119
|
+
$i7OB2$createComputed($i7OB2$catchify1(async () => {
|
|
10058
10120
|
const element = sort_and_filter_element_();
|
|
10059
10121
|
if (!element) return;
|
|
10060
10122
|
await (0, $i7OB2$observer).wait_for_element(element);
|
|
@@ -10073,7 +10135,7 @@ function $587cd61972788655$export$210f130a61ac1e8d(fn) {
|
|
|
10073
10135
|
let last_queued;
|
|
10074
10136
|
let last_value;
|
|
10075
10137
|
let initial_run = true;
|
|
10076
|
-
$i7OB2$createComputed($i7OB2$
|
|
10138
|
+
$i7OB2$createComputed($i7OB2$catchify1(async () => {
|
|
10077
10139
|
last_value = fn();
|
|
10078
10140
|
if (initial_run) {
|
|
10079
10141
|
initial_run = false;
|
|
@@ -10120,7 +10182,7 @@ function $641bba2917fe862b$export$6e49da55e449af7c({
|
|
|
10120
10182
|
}]); // get rid of old data the browser saves the old state and will restore it later on
|
|
10121
10183
|
};
|
|
10122
10184
|
|
|
10123
|
-
$i7OB2$createComputed($i7OB2$
|
|
10185
|
+
$i7OB2$createComputed($i7OB2$catchify1(() => {
|
|
10124
10186
|
const last_result = get_last_result_in_viewport_();
|
|
10125
10187
|
if (last_result == undefined || last_result <= 0 || last_result == Infinity) return;
|
|
10126
10188
|
if (isNaN(last_result)) {
|
|
@@ -10147,7 +10209,7 @@ function $641bba2917fe862b$export$6e49da55e449af7c({
|
|
|
10147
10209
|
set_to_later = last_result;
|
|
10148
10210
|
// If a delayed push timeout is already running, just changing the value that will be pushed is sufficient
|
|
10149
10211
|
if (timeout) return;
|
|
10150
|
-
timeout = setTimeout($i7OB2$
|
|
10212
|
+
timeout = setTimeout($i7OB2$catchify1(() => {
|
|
10151
10213
|
timeout = undefined;
|
|
10152
10214
|
last_time_history_changed = +new Date();
|
|
10153
10215
|
set_min_results_loaded(set_to_later);
|
|
@@ -10249,7 +10311,7 @@ function $b2bf2cdcff8142d8$export$f631859cab12b342({
|
|
|
10249
10311
|
if (!result) return;
|
|
10250
10312
|
return {
|
|
10251
10313
|
href: result.page_url,
|
|
10252
|
-
onClick: $i7OB2$
|
|
10314
|
+
onClick: $i7OB2$catchify1(ev => router_.navigate_.go_to_({
|
|
10253
10315
|
new_url_: result.page_url,
|
|
10254
10316
|
is_replace_: false,
|
|
10255
10317
|
event_: ev
|
|
@@ -10610,7 +10672,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
10610
10672
|
// We might only have changed the left position which align_field doesn't know about, make it poll the position for a while
|
|
10611
10673
|
setPollAlignment_(true);
|
|
10612
10674
|
if (disableResizePollingTimeout) clearTimeout(disableResizePollingTimeout);
|
|
10613
|
-
disableResizePollingTimeout = setTimeout($i7OB2$
|
|
10675
|
+
disableResizePollingTimeout = setTimeout($i7OB2$catchify1(() => {
|
|
10614
10676
|
setPollAlignment_(false);
|
|
10615
10677
|
disableResizePollingTimeout = undefined;
|
|
10616
10678
|
}), 1000);
|
|
@@ -10742,7 +10804,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
10742
10804
|
} : {})
|
|
10743
10805
|
};
|
|
10744
10806
|
});
|
|
10745
|
-
const [search_results_] = $i7OB2$createResource(search_query_base_, $i7OB2$
|
|
10807
|
+
const [search_results_] = $i7OB2$createResource(search_query_base_, $i7OB2$catchify1(async base_query => {
|
|
10746
10808
|
set_all_products_loaded(false);
|
|
10747
10809
|
// only first page of results
|
|
10748
10810
|
return await $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
@@ -10781,7 +10843,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
10781
10843
|
const [, setModalFieldStyle] = modal_field_style;
|
|
10782
10844
|
const [, setModalBackdropStyle] = modal_backdrop_style;
|
|
10783
10845
|
const [get_search_field_elements, set_search_field_elements] = $i7OB2$createSignal();
|
|
10784
|
-
const SafeSearchField = $i7OB2$
|
|
10846
|
+
const SafeSearchField = $i7OB2$catchify1((0, $5285d2814d0fac0c$export$b94867ecbd698f21));
|
|
10785
10847
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $i7OB2$createSignal(false);
|
|
10786
10848
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $i7OB2$createSignal();
|
|
10787
10849
|
const n_hits = $i7OB2$createMemo(() => search_results_()?.n_hits);
|
|
@@ -10831,7 +10893,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
10831
10893
|
$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))));
|
|
10832
10894
|
}).remove);
|
|
10833
10895
|
$2ab89d64b7f1d5ef$export$d31a1a1a83ad9413(search_results_, selected_filters_);
|
|
10834
|
-
$i7OB2$
|
|
10896
|
+
$i7OB2$catchify1((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
10835
10897
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
10836
10898
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
10837
10899
|
id_: get_search_query_,
|
|
@@ -10877,8 +10939,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
10877
10939
|
setModalBodyStyle({});
|
|
10878
10940
|
modalAlignmentSignalsRef_?.(alignmentSignals_);
|
|
10879
10941
|
const [pollAlignment, setPollAlignment_] = $i7OB2$createSignal(false);
|
|
10880
|
-
const align_position = $i7OB2$
|
|
10881
|
-
div_with_field_class.addEventListener("click", $i7OB2$
|
|
10942
|
+
const align_position = $i7OB2$catchify1((0, $b6d5529b253681aa$export$b3ad617e9036868))(alignmentSignals_, search_field, (0, $b6d5529b253681aa$export$3f238c96c45e6cc6) | (0, $b6d5529b253681aa$export$7895aadd1956b1c7) | (modalVersionUsed_ === 1 ? (0, $b6d5529b253681aa$export$902f8b4a7dae5d78) : (0, $b6d5529b253681aa$export$6060bc6bee850eb6) | (0, $b6d5529b253681aa$export$5097308c5200105a)), true, pollAlignment);
|
|
10943
|
+
div_with_field_class.addEventListener("click", $i7OB2$catchify1(e => {
|
|
10882
10944
|
const target = e.target;
|
|
10883
10945
|
const sel = ".submit";
|
|
10884
10946
|
if (target?.matches?.(sel) || target?.closest?.(sel))
|
|
@@ -11215,7 +11277,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
11215
11277
|
BackIcon_: BackIcon_
|
|
11216
11278
|
});
|
|
11217
11279
|
$90980bd87c9960f9$export$5162a71f252e6122();
|
|
11218
|
-
$i7OB2$
|
|
11280
|
+
$i7OB2$catchify1(async () => {
|
|
11219
11281
|
const {
|
|
11220
11282
|
open_modal_: open_modal_,
|
|
11221
11283
|
close_modal_: close_modal_
|
|
@@ -11456,7 +11518,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
|
11456
11518
|
function $4ca91518c9a35379$export$828dcdd425fd3231(aligner) {
|
|
11457
11519
|
const style_element = document.createElement("style");
|
|
11458
11520
|
document.head.append(style_element);
|
|
11459
|
-
const resize_observer = new ResizeObserver($i7OB2$
|
|
11521
|
+
const resize_observer = new ResizeObserver($i7OB2$catchify1(() => {
|
|
11460
11522
|
const styles = $926b1b5ba2239356$export$1233ca167bf71f9a({
|
|
11461
11523
|
".depict.plp .depict-search-modal .search-field": {
|
|
11462
11524
|
"height": `${aligner?.clientHeight}px`
|
|
@@ -11525,7 +11587,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
|
|
|
11525
11587
|
}, dispose_aligner];
|
|
11526
11588
|
};
|
|
11527
11589
|
function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
11528
|
-
const handler = $i7OB2$
|
|
11590
|
+
const handler = $i7OB2$catchify1(e => {
|
|
11529
11591
|
const {
|
|
11530
11592
|
key: key,
|
|
11531
11593
|
target: target
|
|
@@ -11544,7 +11606,7 @@ function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
|
11544
11606
|
function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
11545
11607
|
let old_url;
|
|
11546
11608
|
let disconnect_link_observer;
|
|
11547
|
-
const link_handler = $i7OB2$
|
|
11609
|
+
const link_handler = $i7OB2$catchify1(e => {
|
|
11548
11610
|
const link = e.currentTarget || e.target;
|
|
11549
11611
|
if (link.href === old_url) {
|
|
11550
11612
|
history.pushState(history.state, "", link.href);
|
|
@@ -11553,7 +11615,7 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
11553
11615
|
});
|
|
11554
11616
|
let remove_added_listeners;
|
|
11555
11617
|
let resolve_remove_added_listeners;
|
|
11556
|
-
pr.addEventListener("open", $i7OB2$
|
|
11618
|
+
pr.addEventListener("open", $i7OB2$catchify1(() => {
|
|
11557
11619
|
remove_added_listeners = new Promise(r => resolve_remove_added_listeners = r);
|
|
11558
11620
|
disconnect_link_observer = (0, $i7OB2$observer).onexists("a", async ({
|
|
11559
11621
|
element: element
|
|
@@ -11563,11 +11625,11 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
11563
11625
|
element.removeEventListener("click", link_handler);
|
|
11564
11626
|
});
|
|
11565
11627
|
}));
|
|
11566
|
-
pr.addEventListener("close", $i7OB2$
|
|
11628
|
+
pr.addEventListener("close", $i7OB2$catchify1(() => {
|
|
11567
11629
|
disconnect_link_observer?.();
|
|
11568
11630
|
resolve_remove_added_listeners?.();
|
|
11569
11631
|
}));
|
|
11570
|
-
$i7OB2$
|
|
11632
|
+
$i7OB2$catchify1(async () => {
|
|
11571
11633
|
for await (const href of (0, $i7OB2$href_change_ipns)) if (!pr.is_page_(new URL(href))) old_url = href;
|
|
11572
11634
|
})();
|
|
11573
11635
|
}
|
|
@@ -11579,7 +11641,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11579
11641
|
static #reverting_permitted = true;
|
|
11580
11642
|
static #visited_urls = /*@__PURE__*/(() => {
|
|
11581
11643
|
// 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).
|
|
11582
|
-
$i7OB2$
|
|
11644
|
+
$i7OB2$catchify1(async () => {
|
|
11583
11645
|
// Static initialization blocks aren't supported in MobileSafari yet, otherwise this would be one.
|
|
11584
11646
|
// 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).
|
|
11585
11647
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks
|
|
@@ -11597,7 +11659,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11597
11659
|
async #listen() {
|
|
11598
11660
|
const [exit_ipns, exitable_ipns] = $i7OB2$make_asyncIterable_exiter((0, $i7OB2$href_change_ipns));
|
|
11599
11661
|
this.#stop_listening = exit_ipns;
|
|
11600
|
-
const caught_page_check_fn = $i7OB2$
|
|
11662
|
+
const caught_page_check_fn = $i7OB2$catchify1(this.is_page_, "page check failed");
|
|
11601
11663
|
for await (const href of exitable_ipns) {
|
|
11602
11664
|
const url = new URL(href);
|
|
11603
11665
|
if (!caught_page_check_fn(url)) {
|
|
@@ -11615,17 +11677,17 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11615
11677
|
this.addEventListener("close", dispose, {
|
|
11616
11678
|
once: true
|
|
11617
11679
|
});
|
|
11618
|
-
return $i7OB2$
|
|
11680
|
+
return $i7OB2$catchify1(this.render_, "rendering failed")() || [];
|
|
11619
11681
|
});
|
|
11620
11682
|
}
|
|
11621
|
-
#unload = /*@__PURE__*/$i7OB2$
|
|
11683
|
+
#unload = /*@__PURE__*/$i7OB2$catchify1(() => {
|
|
11622
11684
|
if (!this.#is_open) return;
|
|
11623
11685
|
this.#disconnect_observer?.();
|
|
11624
11686
|
if ($753e9b2889a47c89$export$3ccaa27d81dd8556.#reverting_permitted) while (this.#revert_fns.length) this.#revert_fns.pop()?.();
|
|
11625
11687
|
this.#is_open = false;
|
|
11626
11688
|
this.dispatchEvent(new CustomEvent("close"));
|
|
11627
11689
|
}, "failed to close page");
|
|
11628
|
-
#load = /*@__PURE__*/$i7OB2$
|
|
11690
|
+
#load = /*@__PURE__*/$i7OB2$catchify1(async els => {
|
|
11629
11691
|
this.#is_open = true;
|
|
11630
11692
|
// So that #load doesn't get called again
|
|
11631
11693
|
let set_should_stay_inserted;
|
|
@@ -11675,7 +11737,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11675
11737
|
}, "failed to open page");
|
|
11676
11738
|
#empty_page_bugfix() {
|
|
11677
11739
|
// Called when a "page" is "opened" using PageReplacer
|
|
11678
|
-
const on_maybe_popstate = $i7OB2$
|
|
11740
|
+
const on_maybe_popstate = $i7OB2$catchify1(what_happened => {
|
|
11679
11741
|
if (what_happened !== "popstate") return;
|
|
11680
11742
|
const cleaned_current_url = $753e9b2889a47c89$var$clean_url(location.href);
|
|
11681
11743
|
if (!$753e9b2889a47c89$export$3ccaa27d81dd8556.#visited_urls.has(cleaned_current_url)) {
|
|
@@ -11699,7 +11761,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11699
11761
|
PageReplacer unload itself and reveals the original document - it is expected to be the one under https://ehandel.spendrups.se/Product/1104201, but actually it is the one under /start/search - a white page.
|
|
11700
11762
|
The fix: is to remember all pages that we have visited since the creation of `window` (we do that by having a static property on PageReplacer since we assume the PageReplacer source code will only exist once on the page and will be loaded at page load, the latter assumption might be wrong, but I hope not). If we get a "popstate" event (meaning back or forwards button, not new page being pushed) to an unknown page we reload.
|
|
11701
11763
|
*/
|
|
11702
|
-
$i7OB2$
|
|
11764
|
+
$i7OB2$dlog1("PageReplacer: ", cleaned_current_url, " hasn't been visited since document was created, reloading since we won't be able to show this page otherwise");
|
|
11703
11765
|
location.reload();
|
|
11704
11766
|
$753e9b2889a47c89$export$3ccaa27d81dd8556.#reverting_permitted = false; // Disallow any reverting since we can't - it would flash a white page until the reload has finished.
|
|
11705
11767
|
this.#unload(); // Call unload to "kill" the solid-js stuff quicker so that it stops updating - the user is expecting the next thing that happens to be a navigation to the actual page the URL says they're on.
|
|
@@ -11777,7 +11839,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
|
|
|
11777
11839
|
field_: $i7OB2$createSignal({}),
|
|
11778
11840
|
backdrop_: backdropAlignmentSignal_
|
|
11779
11841
|
};
|
|
11780
|
-
const defaultHandler = $i7OB2$
|
|
11842
|
+
const defaultHandler = $i7OB2$catchify1(e => {
|
|
11781
11843
|
const {
|
|
11782
11844
|
modalVersionUsed_: modalVersionUsed_
|
|
11783
11845
|
} = shared_properties;
|
|
@@ -11904,7 +11966,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
11904
11966
|
}];
|
|
11905
11967
|
$i7OB2$createComputed(() => {
|
|
11906
11968
|
if (place_holdey_quicklinks_data()?.[0]?.listing_id) {
|
|
11907
|
-
if (last_was_placeholder) queueMicrotask($i7OB2$
|
|
11969
|
+
if (last_was_placeholder) queueMicrotask($i7OB2$catchify1(() => {
|
|
11908
11970
|
sliding_element?.scrollTo({
|
|
11909
11971
|
left: 0
|
|
11910
11972
|
}); // for some reason we land one element to the right after placeholder rendering otherwise
|
|
@@ -11970,7 +12032,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
11970
12032
|
} else if (!(intersecting_items_object[selected_index()]?.intersectionRatio >= 0.95)) {
|
|
11971
12033
|
// negated larger than to handle left side of comparison being undefined
|
|
11972
12034
|
let done_work = false;
|
|
11973
|
-
$i7OB2$runWithOwner(owner, () => $i7OB2$createComputed($i7OB2$
|
|
12035
|
+
$i7OB2$runWithOwner(owner, () => $i7OB2$createComputed($i7OB2$catchify1(() => {
|
|
11974
12036
|
if (done_work || !Array.isArray(quicklinks_data_())) return;
|
|
11975
12037
|
const sel_index = selected_index();
|
|
11976
12038
|
const target_element = sel_index >= 0 ? sel_index : 0;
|
|
@@ -12115,7 +12177,7 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
|
12115
12177
|
const handler = () => allow_filter_clearing = false;
|
|
12116
12178
|
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
|
|
12117
12179
|
$i7OB2$onCleanup(() => window.removeEventListener("popstate", handler));
|
|
12118
|
-
$i7OB2$createEffect($i7OB2$on(crumb_data_, $i7OB2$
|
|
12180
|
+
$i7OB2$createEffect($i7OB2$on(crumb_data_, $i7OB2$catchify1(new_crumb_data => {
|
|
12119
12181
|
const id_of_new_data = id_to_query_for_();
|
|
12120
12182
|
const type_of_id_of_new_data = id_type_();
|
|
12121
12183
|
if (allow_filter_clearing && previous_crumb_data && new_crumb_data && (id_of_new_data !== id_when_we_got_previous_data.id_ || type_of_id_of_new_data !== id_when_we_got_previous_data.type_)) {
|
|
@@ -12165,7 +12227,7 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
12165
12227
|
// 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
|
|
12166
12228
|
if (!$i7OB2$untrack(get_sideways_filter_clearing_flag_)) return;
|
|
12167
12229
|
set_sideways_filter_clearing_flag_(false);
|
|
12168
|
-
$i7OB2$
|
|
12230
|
+
$i7OB2$dlog1("Flag to clear filters was set, clearing filters");
|
|
12169
12231
|
$i7OB2$queueMacroTask(() => {
|
|
12170
12232
|
// Do it next task so that all the filters have time to populate
|
|
12171
12233
|
$e9342fb3ac73a54a$export$8895d39404bd2bb1({
|
|
@@ -12256,7 +12318,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12256
12318
|
// Make "Get products in listing" request to get products in listing
|
|
12257
12319
|
const [plp_products_] = $i7OB2$createResource(products_query_base_,
|
|
12258
12320
|
// 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)
|
|
12259
|
-
$i7OB2$
|
|
12321
|
+
$i7OB2$catchify(base_query => $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
12260
12322
|
id_: $i7OB2$untrack(id_to_query_for_),
|
|
12261
12323
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
12262
12324
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
@@ -12276,7 +12338,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12276
12338
|
id_type_: id_type_()
|
|
12277
12339
|
}));
|
|
12278
12340
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
12279
|
-
const [plp_meta] = $i7OB2$createResource(meta_query_base, $i7OB2$
|
|
12341
|
+
const [plp_meta] = $i7OB2$createResource(meta_query_base, $i7OB2$catchify(query => depict_api_.get_listing(query)));
|
|
12280
12342
|
const available_sortings_ = $i7OB2$createMemo(() => plp_products_()?.sorts?.map(sort => ({
|
|
12281
12343
|
...sort,
|
|
12282
12344
|
order: sort.order ?? "desc"
|
|
@@ -12385,7 +12447,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12385
12447
|
filterModalParent_: filterModalParent_,
|
|
12386
12448
|
...extra_sort_and_filter_args_
|
|
12387
12449
|
});
|
|
12388
|
-
$i7OB2$
|
|
12450
|
+
$i7OB2$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
12389
12451
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
12390
12452
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
12391
12453
|
id_: id_to_query_for_,
|
|
@@ -12398,7 +12460,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12398
12460
|
$i7OB2$createComputed(() => {
|
|
12399
12461
|
if (plp_products_.loading) set_can_write_scroll_restoration(false);else if (plp_products_()) set_can_write_scroll_restoration(true);
|
|
12400
12462
|
});
|
|
12401
|
-
$i7OB2$createRenderEffect($i7OB2$
|
|
12463
|
+
$i7OB2$createRenderEffect($i7OB2$catchify(async () => {
|
|
12402
12464
|
const slim = is_slim_();
|
|
12403
12465
|
const only_show_filters_opener = only_show_filters_opener_?.();
|
|
12404
12466
|
const owner = $i7OB2$getOwner();
|
|
@@ -12643,4 +12705,4 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
|
|
|
12643
12705
|
}, "Entire CategoryPage failed");
|
|
12644
12706
|
}
|
|
12645
12707
|
$i7OB2$add_to_version_info("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
|
|
12646
|
-
export { $5e3d278ef4c80cd7$export$54299a3c81f5425 as useVisibilityState, $f32e14878e75af51$export$eaa625fb39439e37 as useSlidableInformation, $f091294da861020c$export$80bb7300ce6a8be3 as useProductCardIsVisible, $f091294da861020c$export$f223d69ed12f5fb7 as CurrentlyIntersectingContext, $24e27fab9c821b86$export$5bad61ecde080b1f as useExpandingContainerReactive, $07ef910e8ef6b783$export$2c9f9bf2092486aa as LooksSliderOrGrid, $
|
|
12708
|
+
export { $4eb0a704f8f30273$export$d4d96868197be50e as useMobileHover, $5e3d278ef4c80cd7$export$54299a3c81f5425 as useVisibilityState, $f32e14878e75af51$export$eaa625fb39439e37 as useSlidableInformation, $f091294da861020c$export$80bb7300ce6a8be3 as useProductCardIsVisible, $f091294da861020c$export$f223d69ed12f5fb7 as CurrentlyIntersectingContext, $24e27fab9c821b86$export$5bad61ecde080b1f as useExpandingContainerReactive, $07ef910e8ef6b783$export$2c9f9bf2092486aa as LooksSliderOrGrid, $e9d1d09be9e6471e$export$44809a8a3e867e30 as LookCard, $4fd2ba03703a7d92$export$7e1297a3a19f10d8 as PseudoRouter, $de6ccd37192b5fc2$export$83bb9af5671e1dbe as promiseSafeStructuredClone, $90980bd87c9960f9$export$5162a71f252e6122 as preserve_items_in_history_dot_state, $90980bd87c9960f9$export$3064e1e8c6513da3 as prefixes_to_preserve_in_history_dot_state, $a281666e5c15c2ec$export$29d28dadc2d6b631 as allowNativeNavigation, $66db7a014e20802e$export$1ea76ea778b880dd as modalVersionSymbol, $136f1d4d6c7ba6ac$export$e417c49320921907 as createDeparallelizedNoDropResource, $d8dbf52fea1773e2$export$f50b88e2a00918b5 as throw_globally, $42912431795f188e$export$9265e66f26f8e383 as ClassicSearchModal, $500a16dd18ee5a71$export$b0c55aa2e87c4be7 as SearchModalV2, $70bb27cc6be01fc7$export$9d4a4b669b1929ab as ModernResponsiveContainedImage, $024fbc0a2d796fad$export$3e41faf802a29e71 as Tab, $024fbc0a2d796fad$export$b2539bed5023c21c as Tabs, $8560c919ff763930$export$d4973c31938cbfd1 as ShopTheLookButton, $ca6f574bd8772184$export$e183a13865960371 as history_dot_state_to_state, $4147651646da990a$export$916e6850778505f6 as strip_encoded_filter_and_sort, $4147651646da990a$export$58aa3f171519b6d7 as encode_filters, $4147651646da990a$export$f934fa24c3a86811 as decode_filters, $4147651646da990a$export$62acb285a7579555 as encode_sorting, $4147651646da990a$export$766e9676e74997d3 as decode_sorting, $660070e2a394b3c3$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $011607bdf658f807$export$e68cff63f76bd15b as ListingProvider, $011607bdf658f807$export$8d0c4fdbb05a2f2e as useListing, $b6440e72ed83671a$export$11354f017ddc9790 as ProductCardIndexProvider, $b6440e72ed83671a$export$e3faf4d95300054f as useProductCardIndex, $660070e2a394b3c3$export$e4b984597b71e989 as ShopifyContainedImage, $f32e14878e75af51$export$6649caad96ef8870 as SlidableItems, $2449872a62a75a20$export$ebdc3711f7e02ccd as make_accurate_width_accessor, $ee116da074deb002$export$9574e176201e5e8d as RecommendationSlider, $9ea5383493360761$export$9756467d34d91cdb as RecommendationGrid, $e8ffe11ed01df0fe$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $e8ffe11ed01df0fe$export$e6fffe67d4cdd848 as makeSizeAccessor, $f18d425032111270$export$94026ee33dbabc26 as ImageContainer, $b7436a6d1fd64e3b$export$b69d0d92862de18b as SentryErrorBoundary, $b7436a6d1fd64e3b$export$240ecf5363d76c0f as ExtraSentryContextProvider, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d as ExpandingDetails, $c16e74cfe125bb05$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $1adfe60f3a14a1d7$export$fecbb157621501bd as SelectedFilters, $fab07f52c9861732$export$3f1a388cc0d8fed7 as FilterBody, $5efb5894079b220e$export$b288c38ae3fddb56 as create_modified_filters, $c8d5ff4524619fcd$export$d21e32dfedac04be as SolidLayout, $c8d5ff4524619fcd$export$445d8d3f5f706a40 as SolidLayoutWithProvidedElement, $194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $a0f0e923bad68a9b$export$58e808b1db15d3bc as fetchDepictRecommendations, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $4b2134398dfa83fa$export$c1a6b039e689a58e as get_listings, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b6d5529b253681aa$export$3f238c96c45e6cc6 as ALIGN_TOP, $b6d5529b253681aa$export$902f8b4a7dae5d78 as ALIGN_WIDTH_ON_MODAL, $b6d5529b253681aa$export$7895aadd1956b1c7 as ALIGN_LEFT, $b6d5529b253681aa$export$6060bc6bee850eb6 as SET_CENTERED_LEFT, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version, $58b3487626e85ece$export$316f6f283ae64765 as SearchField, $feffae76d8dc0135$export$5b7c3ce0ebe51f86 as BreadCrumbs, $feffae76d8dc0135$export$de035477d6fef996 as QuickLinks, $442f32a4d80abbde$export$e2bf8ce7779e827e as CategoryPage };
|