@depict-ai/ui 4.3.0 → 4.3.2
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 +350 -258
- package/ES10/index.d.ts +244 -237
- package/ES10/index.js +384 -292
- package/latest/index.cjs +326 -234
- package/latest/index.d.ts +244 -237
- package/latest/index.js +360 -268
- package/package.json +2 -2
- package/server/ES10/index.cjs +307 -219
- package/server/ES10/index.d.ts +244 -237
- package/server/ES10/index.js +347 -259
- package/server/latest/index.cjs +284 -195
- package/server/latest/index.d.ts +244 -237
- package/server/latest/index.js +324 -235
package/server/latest/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { add_to_version_info as $i7OB2$add_to_version_info, fetch_retry as $i7OB2$fetch_retry, base_url as $i7OB2$base_url, slider_fractional_factory as $i7OB2$slider_fractional_factory, dlog as $i7OB2$dlog, camelCasifyObject as $i7OB2$camelCasifyObject, make_random_classname as $i7OB2$make_random_classname, n_col_styling_with_dist as $i7OB2$n_col_styling_with_dist, catchify as $i7OB2$catchify, 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, slider_fading_factory as $i7OB2$slider_fading_factory, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, observer as $i7OB2$observer, javascript_media_query as $i7OB2$javascript_media_query, queueMacroTask as $i7OB2$queueMacroTask, findMostFrequentItem as $i7OB2$findMostFrequentItem,
|
|
2
|
-
import { ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, ssrStyle as $i7OB2$ssrStyle, escape as $i7OB2$escape, createComponent as $i7OB2$createComponent, mergeProps as $i7OB2$
|
|
3
|
-
import { createSignal as $i7OB2$createSignal, createMemo as $i7OB2$createMemo, createResource as $i7OB2$createResource, Show as $i7OB2$Show, Suspense as $i7OB2$Suspense, untrack as $i7OB2$untrack, createRenderEffect as $i7OB2$createRenderEffect, Index as $i7OB2$Index, createRoot as $i7OB2$createRoot, onCleanup as $i7OB2$onCleanup, For as $i7OB2$For, getOwner as $i7OB2$getOwner, runWithOwner as $i7OB2$runWithOwner,
|
|
1
|
+
import { add_to_version_info as $i7OB2$add_to_version_info, fetch_retry as $i7OB2$fetch_retry, base_url as $i7OB2$base_url, dwarn as $i7OB2$dwarn, slider_fractional_factory as $i7OB2$slider_fractional_factory, dlog as $i7OB2$dlog, camelCasifyObject as $i7OB2$camelCasifyObject, make_random_classname as $i7OB2$make_random_classname, n_col_styling_with_dist as $i7OB2$n_col_styling_with_dist, catchify as $i7OB2$catchify, 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, slider_fading_factory as $i7OB2$slider_fading_factory, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, 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, useExpandingContainer as $i7OB2$useExpandingContainer, 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, ListenableSet as $i7OB2$ListenableSet1, insert_surfaces as $i7OB2$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
|
+
import { ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, ssrStyle as $i7OB2$ssrStyle, escape as $i7OB2$escape, createComponent as $i7OB2$createComponent, mergeProps as $i7OB2$mergeProps1, isServer as $i7OB2$isServer, ssrElement as $i7OB2$ssrElement, ssrClassList as $i7OB2$ssrClassList, insert as $i7OB2$insert, ssrAttribute as $i7OB2$ssrAttribute, spread as $i7OB2$spread, Dynamic as $i7OB2$Dynamic } from "solid-js/web";
|
|
3
|
+
import { createSignal as $i7OB2$createSignal, createMemo as $i7OB2$createMemo, createResource as $i7OB2$createResource, createEffect as $i7OB2$createEffect, mergeProps as $i7OB2$mergeProps, Show as $i7OB2$Show, Suspense as $i7OB2$Suspense, untrack as $i7OB2$untrack, createRenderEffect as $i7OB2$createRenderEffect, Index as $i7OB2$Index, createRoot as $i7OB2$createRoot, onCleanup as $i7OB2$onCleanup, For as $i7OB2$For, getOwner as $i7OB2$getOwner, runWithOwner as $i7OB2$runWithOwner, createContext as $i7OB2$createContext, useContext as $i7OB2$useContext, 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";
|
|
4
4
|
import { ListenableSet as $i7OB2$ListenableSet, catchify as $i7OB2$catchify1, use_href_accessor as $i7OB2$use_href_accessor1, 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.3.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.3.2";
|
|
11
11
|
const $b5cccc8ee7d24677$var$transform_elements = sorted_cols_at_size => {
|
|
12
12
|
const cols_at_size = [];
|
|
13
13
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -414,7 +414,7 @@ var $c8d5ff4524619fcd$var$_tmpl$ = ["<div", ' class="', '">', "</div>"],
|
|
|
414
414
|
$c8d5ff4524619fcd$var$_tmpl$2 = ["<style", ' type="text/css">', "</style>"];
|
|
415
415
|
function $c8d5ff4524619fcd$export$d21e32dfedac04be(props) {
|
|
416
416
|
const container_class = "x" + $i7OB2$createUniqueId();
|
|
417
|
-
const container_element_ = $i7OB2$ssrElement("div", $i7OB2$
|
|
417
|
+
const container_element_ = $i7OB2$ssrElement("div", $i7OB2$mergeProps1(() => props.element_attributes, {
|
|
418
418
|
classList: {
|
|
419
419
|
[container_class]: true
|
|
420
420
|
}
|
|
@@ -606,7 +606,7 @@ function $c4492d24952ed731$export$d41d19e89346fa2({
|
|
|
606
606
|
} = slider;
|
|
607
607
|
const Layout = props => $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, insert_here, true);
|
|
608
608
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
609
|
-
$i7OB2$createComponent(Layout, $i7OB2$
|
|
609
|
+
$i7OB2$createComponent(Layout, $i7OB2$mergeProps1({
|
|
610
610
|
rows: "all",
|
|
611
611
|
layout: "slider"
|
|
612
612
|
}, layout_options_));
|
|
@@ -873,7 +873,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
873
873
|
});
|
|
874
874
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
875
875
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
876
|
-
const [, otherAttributes] = $i7OB2$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
|
|
876
|
+
const [, otherAttributes] = $i7OB2$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
|
|
877
877
|
]);
|
|
878
878
|
|
|
879
879
|
const [hasSetSize, setHasSetSize] = $i7OB2$createSignal(false);
|
|
@@ -889,7 +889,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
889
889
|
if (loading === "force-lazy") return true;
|
|
890
890
|
return loading === "lazy" && !isPrioritisedImage();
|
|
891
891
|
});
|
|
892
|
-
const modifiedOtherAttributes = $i7OB2$
|
|
892
|
+
const modifiedOtherAttributes = $i7OB2$mergeProps(otherAttributes, {
|
|
893
893
|
get loading() {
|
|
894
894
|
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
895
895
|
}
|
|
@@ -929,13 +929,18 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
929
929
|
let hasDecodedFastPath = false;
|
|
930
930
|
let timeoutSet = false;
|
|
931
931
|
let gotCleanedUp = false;
|
|
932
|
+
let srcJustChanged = true;
|
|
932
933
|
img.classList.add("s-responsive-image");
|
|
933
934
|
if (listingContext) {
|
|
934
935
|
let prevValue;
|
|
935
936
|
const aspectRatios = listingContext[$e8ffe11ed01df0fe$export$f8945274f08a3105] ||= new Set();
|
|
936
937
|
const [, setMostPrevalentAspectRatio] = listingContext[$e8ffe11ed01df0fe$export$6066eb417ed2e9f7] ||= $i7OB2$createSignal();
|
|
937
938
|
img.addEventListener("load", $i7OB2$catchify(() => {
|
|
938
|
-
|
|
939
|
+
if (props.keyRatioUpdating) {
|
|
940
|
+
if (!srcJustChanged) return;
|
|
941
|
+
srcJustChanged = false;
|
|
942
|
+
}
|
|
943
|
+
// Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
|
|
939
944
|
const aspectRatio_ = img.naturalWidth / img.naturalHeight;
|
|
940
945
|
if (prevValue) aspectRatios.delete(prevValue);
|
|
941
946
|
const newValue = !isNaN(aspectRatio_) ? {
|
|
@@ -953,7 +958,11 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
953
958
|
$i7OB2$onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
954
959
|
}
|
|
955
960
|
$i7OB2$onCleanup(() => gotCleanedUp = true);
|
|
956
|
-
$i7OB2$spread(img, $i7OB2$
|
|
961
|
+
$i7OB2$spread(img, $i7OB2$mergeProps(modifiedOtherAttributes), false, true);
|
|
962
|
+
$i7OB2$createRenderEffect(() => {
|
|
963
|
+
props.src;
|
|
964
|
+
srcJustChanged = true;
|
|
965
|
+
});
|
|
957
966
|
$i7OB2$createEffect(() => {
|
|
958
967
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
959
968
|
if (timeoutSet) return;
|
|
@@ -1023,48 +1032,22 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
|
|
|
1023
1032
|
const [mostPrevalentAspectRatio] = context ?
|
|
1024
1033
|
// If the context exists we have to create the signal here as getting it here would be too late when it's created by ShopifyResponsiveImg below
|
|
1025
1034
|
context[(0, $e8ffe11ed01df0fe$export$6066eb417ed2e9f7)] ||= $i7OB2$createSignal() : [];
|
|
1026
|
-
const [aspectRatio, setAspectRatio] = $i7OB2$createSignal($i7OB2$untrack(() => props.aspectRatio));
|
|
1027
1035
|
const container = $f18d425032111270$export$94026ee33dbabc26({
|
|
1028
1036
|
// Write getters manually instead of using JSX, so we can do more complex logic in the aspectRatio getter without increasing bundle size
|
|
1029
1037
|
get class() {
|
|
1030
1038
|
return props.class;
|
|
1031
1039
|
},
|
|
1032
1040
|
get aspectRatio() {
|
|
1033
|
-
|
|
1041
|
+
if (props.autoAdjustAspectRatio) {
|
|
1042
|
+
const targetRatio = mostPrevalentAspectRatio?.();
|
|
1043
|
+
if (targetRatio != undefined) return `var(${(0, $bb15dfb548a7666e$export$8a2234b5b1a5ebd4)}, ${targetRatio})`;
|
|
1044
|
+
}
|
|
1045
|
+
return props.aspectRatio;
|
|
1034
1046
|
}
|
|
1035
1047
|
});
|
|
1036
1048
|
const owner = $i7OB2$getOwner();
|
|
1037
1049
|
let createdSizeAccessor = false;
|
|
1038
1050
|
let wasCleanedUp = false;
|
|
1039
|
-
let timeout;
|
|
1040
|
-
$i7OB2$createEffect(() => {
|
|
1041
|
-
const {
|
|
1042
|
-
autoAdjustAspectRatio: autoAdjustAspectRatio
|
|
1043
|
-
} = props;
|
|
1044
|
-
if (autoAdjustAspectRatio) {
|
|
1045
|
-
const targetRatio = mostPrevalentAspectRatio?.();
|
|
1046
|
-
if (targetRatio != undefined) {
|
|
1047
|
-
const targetValue = `var(${(0, $bb15dfb548a7666e$export$8a2234b5b1a5ebd4)}, ${targetRatio})`;
|
|
1048
|
-
const updateAspectRatio = $i7OB2$catchify(() => setAspectRatio(targetValue));
|
|
1049
|
-
if (autoAdjustAspectRatio === "smoothed") {
|
|
1050
|
-
if (!timeout)
|
|
1051
|
-
// If we don't have a timeout yet, also update instantly. This is so that the aspect ratio does get set at the start of a transition, if it changes (when using smoothing).
|
|
1052
|
-
updateAspectRatio();
|
|
1053
|
-
clearTimeout(timeout);
|
|
1054
|
-
timeout = setTimeout(() => {
|
|
1055
|
-
timeout = undefined;
|
|
1056
|
-
updateAspectRatio();
|
|
1057
|
-
}, 500);
|
|
1058
|
-
return;
|
|
1059
|
-
}
|
|
1060
|
-
return updateAspectRatio();
|
|
1061
|
-
}
|
|
1062
|
-
} else {
|
|
1063
|
-
clearTimeout(timeout);
|
|
1064
|
-
timeout = undefined;
|
|
1065
|
-
}
|
|
1066
|
-
setAspectRatio(props.aspectRatio);
|
|
1067
|
-
});
|
|
1068
1051
|
$i7OB2$createEffect(() => {
|
|
1069
1052
|
if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
|
|
1070
1053
|
// ensure we always have a size accessor
|
|
@@ -1078,7 +1061,7 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
|
|
|
1078
1061
|
$i7OB2$queueMacroTask(() => setCurrentImageSize()); // unset the size accessor next event loop iteration, so that all onCleanup's have time to run, since the effects run more aggressively and can create a size accessor with a cleaned up owner otherwise
|
|
1079
1062
|
});
|
|
1080
1063
|
|
|
1081
|
-
$i7OB2$insert(container, $i7OB2$createComponent((0, $e8ffe11ed01df0fe$export$6e5611bc7e57e477), $i7OB2$
|
|
1064
|
+
$i7OB2$insert(container, $i7OB2$createComponent((0, $e8ffe11ed01df0fe$export$6e5611bc7e57e477), $i7OB2$mergeProps1({
|
|
1082
1065
|
get size() {
|
|
1083
1066
|
return $i7OB2$createMemo(() => currentImageSize()?.() || 0);
|
|
1084
1067
|
},
|
|
@@ -1093,7 +1076,7 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
|
|
|
1093
1076
|
return container;
|
|
1094
1077
|
}
|
|
1095
1078
|
function $70bb27cc6be01fc7$export$9d4a4b669b1929ab(props) {
|
|
1096
|
-
return $i7OB2$createComponent((0, $660070e2a394b3c3$export$e4b984597b71e989), $i7OB2$
|
|
1079
|
+
return $i7OB2$createComponent((0, $660070e2a394b3c3$export$e4b984597b71e989), $i7OB2$mergeProps1(props, {
|
|
1097
1080
|
get imgProps() {
|
|
1098
1081
|
return {
|
|
1099
1082
|
...props.imgProps,
|
|
@@ -1110,7 +1093,13 @@ function $70bb27cc6be01fc7$export$9d4a4b669b1929ab(props) {
|
|
|
1110
1093
|
}
|
|
1111
1094
|
}));
|
|
1112
1095
|
}
|
|
1113
|
-
|
|
1096
|
+
function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
|
|
1097
|
+
return $i7OB2$createMemo(() => {
|
|
1098
|
+
const price_formatting = props.price_formatting_;
|
|
1099
|
+
return $i7OB2$standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
var $5a6c386e1bde5665$var$_tmpl$ = ["<div", ' class="img-wrapper">', "</div>"],
|
|
1114
1103
|
$5a6c386e1bde5665$var$_tmpl$2 = ["<span", ' class="d-price original">', "</span>"],
|
|
1115
1104
|
$5a6c386e1bde5665$var$_tmpl$3 = ["<div", ' class="right-part"><div class="text-container"><span class="d-title line-clamp">', '</span><span class="', '">', "</span><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
|
|
1116
1105
|
function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
@@ -1119,26 +1108,28 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1119
1108
|
isExpanded_: isExpanded_,
|
|
1120
1109
|
textFadeInAnimationRunning_: textFadeInAnimationRunning_,
|
|
1121
1110
|
outerRef_: outerRef_,
|
|
1122
|
-
animationDuration_: animationDuration_
|
|
1111
|
+
animationDuration_: animationDuration_,
|
|
1112
|
+
priceFormatting_: priceFormatting_,
|
|
1113
|
+
pseudoRouter_: pseudoRouter_
|
|
1123
1114
|
}) {
|
|
1124
1115
|
const variantToUse = $i7OB2$createMemo(() => {
|
|
1125
1116
|
const display = display_();
|
|
1126
1117
|
return display?.variant_displays[display?.variant_index];
|
|
1127
1118
|
});
|
|
1128
|
-
const
|
|
1129
|
-
const imageUrl = $i7OB2$createMemo(() => imageUrls()?.[0]);
|
|
1130
|
-
const secondaryImageUrl = $i7OB2$createMemo(() => imageUrls()?.[1]);
|
|
1119
|
+
const imageUrl = $i7OB2$createMemo(() => variantToUse()?.image_urls?.[0]);
|
|
1131
1120
|
const [animationIsRunning, setAnimationIsRunning] = textFadeInAnimationRunning_;
|
|
1132
1121
|
const [isExpandedThrottledByOurEffectRun, setIsExpandedThrottledByOurEffectRun] = $i7OB2$createSignal($i7OB2$untrack(isExpanded_));
|
|
1133
1122
|
const [animationEffectExists, setAnimationEffectExists] = $i7OB2$createSignal(false);
|
|
1134
1123
|
const [salePrice] = $i7OB2$createResource(() => variantToUse()?.sale_price);
|
|
1135
1124
|
const [originalPrice] = $i7OB2$createResource(() => variantToUse()?.original_price);
|
|
1136
|
-
const isOnSale = $i7OB2$createMemo(() => salePrice.latest !== originalPrice.latest); // .latest doesn't trigger suspense
|
|
1125
|
+
const isOnSale = $i7OB2$createMemo(() => !salePrice.loading && !originalPrice.loading && salePrice.latest !== originalPrice.latest); // .latest doesn't trigger suspense after the initial load
|
|
1126
|
+
const enableLink = $i7OB2$createMemo(() => isExpanded_() && !animationIsRunning());
|
|
1127
|
+
const href = $i7OB2$createMemo(() => variantToUse()?.page_url);
|
|
1137
1128
|
const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
|
|
1138
|
-
return $i7OB2$ssrElement("a", $i7OB2$
|
|
1129
|
+
return $i7OB2$ssrElement("a", $i7OB2$mergeProps1({
|
|
1139
1130
|
"class": "look-item"
|
|
1140
|
-
}, () =>
|
|
1141
|
-
href:
|
|
1131
|
+
}, () => enableLink() ? {
|
|
1132
|
+
href: href()
|
|
1142
1133
|
} : {}), () => ["<!--$-->", $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1143
1134
|
when: imageUrl,
|
|
1144
1135
|
get fallback() {
|
|
@@ -1165,25 +1156,10 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1165
1156
|
return isExpanded_() ? 0.75 : 1;
|
|
1166
1157
|
},
|
|
1167
1158
|
get autoAdjustAspectRatio() {
|
|
1168
|
-
return isExpanded_()
|
|
1169
|
-
}
|
|
1170
|
-
});
|
|
1171
|
-
}
|
|
1172
|
-
})), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1173
|
-
get when() {
|
|
1174
|
-
return secondaryImageUrl();
|
|
1175
|
-
},
|
|
1176
|
-
get children() {
|
|
1177
|
-
return $i7OB2$createComponent((0, $70bb27cc6be01fc7$export$9d4a4b669b1929ab), {
|
|
1178
|
-
get src() {
|
|
1179
|
-
return secondaryImageUrl();
|
|
1159
|
+
return isExpanded_();
|
|
1180
1160
|
},
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
},
|
|
1184
|
-
"class": "secondary",
|
|
1185
|
-
get autoAdjustAspectRatio() {
|
|
1186
|
-
return isExpanded_() ? "smoothed" : false;
|
|
1161
|
+
imgProps: {
|
|
1162
|
+
keyRatioUpdating: true
|
|
1187
1163
|
}
|
|
1188
1164
|
});
|
|
1189
1165
|
}
|
|
@@ -1197,18 +1173,66 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1197
1173
|
return $i7OB2$ssr($5a6c386e1bde5665$var$_tmpl$3, $i7OB2$ssrHydrationKey(), $i7OB2$escape(variantToUse()?.title) ?? $i7OB2$escape($i7OB2$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
|
|
1198
1174
|
height: "1em",
|
|
1199
1175
|
width: "20ch"
|
|
1200
|
-
})), `d-price ${isOnSale() ? "sale" : ""}`,
|
|
1201
|
-
height: "1em",
|
|
1202
|
-
width: "20ch"
|
|
1203
|
-
})) : $i7OB2$escape(salePrice()), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1176
|
+
})), `d-price ${isOnSale() ? "sale" : ""}`, $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1204
1177
|
get when() {
|
|
1205
|
-
return
|
|
1178
|
+
return variantToUse() && !salePrice.loading;
|
|
1206
1179
|
},
|
|
1207
|
-
get
|
|
1208
|
-
return $i7OB2$
|
|
1180
|
+
get fallback() {
|
|
1181
|
+
return $i7OB2$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
|
|
1209
1182
|
height: "1em",
|
|
1210
1183
|
width: "20ch"
|
|
1211
|
-
})
|
|
1184
|
+
});
|
|
1185
|
+
},
|
|
1186
|
+
get children() {
|
|
1187
|
+
return $i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1188
|
+
get when() {
|
|
1189
|
+
return salePrice.latest;
|
|
1190
|
+
},
|
|
1191
|
+
get children() {
|
|
1192
|
+
return [priceFormatting_().pre_, $i7OB2$createComponent((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
|
|
1193
|
+
get price_() {
|
|
1194
|
+
return salePrice();
|
|
1195
|
+
},
|
|
1196
|
+
get price_formatting_() {
|
|
1197
|
+
return priceFormatting_();
|
|
1198
|
+
}
|
|
1199
|
+
}), priceFormatting_().post_];
|
|
1200
|
+
}
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
})), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1204
|
+
get when() {
|
|
1205
|
+
return isOnSale();
|
|
1206
|
+
},
|
|
1207
|
+
get children() {
|
|
1208
|
+
return $i7OB2$ssr($5a6c386e1bde5665$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1209
|
+
get when() {
|
|
1210
|
+
return variantToUse() && !originalPrice.loading;
|
|
1211
|
+
},
|
|
1212
|
+
get fallback() {
|
|
1213
|
+
return $i7OB2$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
|
|
1214
|
+
height: "1em",
|
|
1215
|
+
width: "20ch"
|
|
1216
|
+
});
|
|
1217
|
+
},
|
|
1218
|
+
get children() {
|
|
1219
|
+
return $i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1220
|
+
get when() {
|
|
1221
|
+
return salePrice.latest;
|
|
1222
|
+
},
|
|
1223
|
+
get children() {
|
|
1224
|
+
return [priceFormatting_().pre_, $i7OB2$createComponent((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
|
|
1225
|
+
get price_() {
|
|
1226
|
+
return originalPrice();
|
|
1227
|
+
},
|
|
1228
|
+
get price_formatting_() {
|
|
1229
|
+
return priceFormatting_();
|
|
1230
|
+
}
|
|
1231
|
+
}), priceFormatting_().post_];
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
}
|
|
1235
|
+
})));
|
|
1212
1236
|
}
|
|
1213
1237
|
})), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1214
1238
|
when: FavoriteButton_,
|
|
@@ -1278,7 +1302,9 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1278
1302
|
userWantsExpandedSignal_: [userWantsExpanded, setUserWantsExpanded],
|
|
1279
1303
|
containerWidth_: containerWidth_,
|
|
1280
1304
|
animationDuration_: animationDuration_,
|
|
1281
|
-
supportsHover_: supportsHover_
|
|
1305
|
+
supportsHover_: supportsHover_,
|
|
1306
|
+
priceFormatting_: priceFormatting_,
|
|
1307
|
+
pseudoRouter_: pseudoRouter_
|
|
1282
1308
|
}) {
|
|
1283
1309
|
let isAffectedByChromeBug = false;
|
|
1284
1310
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1295,7 +1321,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1295
1321
|
return containerWidth_() || !displays_;
|
|
1296
1322
|
},
|
|
1297
1323
|
get children() {
|
|
1298
|
-
return $i7OB2$ssr($7555dcad3b8a4632$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrElement("div", $i7OB2$
|
|
1324
|
+
return $i7OB2$ssr($7555dcad3b8a4632$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrElement("div", $i7OB2$mergeProps1({
|
|
1299
1325
|
get ["class"]() {
|
|
1300
1326
|
return `look-overlay ${userWantsExpanded() ? "expanded" : ""} ${!getSecondPartAnimationRunning() && userWantsExpanded() ? "resting-fully-expanded" : ""}`;
|
|
1301
1327
|
}
|
|
@@ -1309,11 +1335,13 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1309
1335
|
},
|
|
1310
1336
|
children: (display, index) => {
|
|
1311
1337
|
return $i7OB2$createComponent((0, $5a6c386e1bde5665$export$b73ed90f0ee50dc3), {
|
|
1338
|
+
pseudoRouter_: pseudoRouter_,
|
|
1312
1339
|
animationDuration_: animationDuration_,
|
|
1313
1340
|
display_: display,
|
|
1314
1341
|
FavoriteButton_: FavoriteButton_,
|
|
1315
1342
|
isExpanded_: userWantsExpanded,
|
|
1316
1343
|
textFadeInAnimationRunning_: textFadeInAnimationRunning,
|
|
1344
|
+
priceFormatting_: priceFormatting_,
|
|
1317
1345
|
outerRef_: el => $i7OB2$createEffect(() => {
|
|
1318
1346
|
if (index !== 0) return;
|
|
1319
1347
|
const resizeObserver = new ResizeObserver($i7OB2$catchify(records => setLookItemHeight(records.at(-1).contentRect.height)));
|
|
@@ -1354,10 +1382,10 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1354
1382
|
expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
|
|
1355
1383
|
FavoriteButton_: FavoriteButton_,
|
|
1356
1384
|
placeholderImageAspectRatio_: placeholderImageAspectRatio_,
|
|
1357
|
-
animationDuration_: animationDuration_
|
|
1385
|
+
animationDuration_: animationDuration_,
|
|
1386
|
+
priceFormatting_: priceFormatting_,
|
|
1387
|
+
pseudoRouter_: pseudoRouter_
|
|
1358
1388
|
}) {
|
|
1359
|
-
// TODO: shopify, run displayTransformers to get dynamic prices
|
|
1360
|
-
// TODO: format prices
|
|
1361
1389
|
const [coverImage] = display_?.image_urls || [];
|
|
1362
1390
|
const useWantsExpandedSignal_ = $i7OB2$createSignal(false);
|
|
1363
1391
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
@@ -1389,7 +1417,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1389
1417
|
when: display_,
|
|
1390
1418
|
get fallback() {
|
|
1391
1419
|
return $i7OB2$createComponent((0, $7f60f09116a3fe61$export$3f37af283f8fb843), {
|
|
1392
|
-
aspectRatio: placeholderImageAspectRatio_
|
|
1420
|
+
aspectRatio: `var(${(0, $bb15dfb548a7666e$export$8a2234b5b1a5ebd4)}, ${placeholderImageAspectRatio_})`
|
|
1393
1421
|
});
|
|
1394
1422
|
},
|
|
1395
1423
|
get children() {
|
|
@@ -1407,10 +1435,124 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1407
1435
|
containerWidth_: containerWidth_,
|
|
1408
1436
|
animationDuration_: animationDuration_,
|
|
1409
1437
|
supportsHover_: supportsHover_,
|
|
1410
|
-
FavoriteButton_: FavoriteButton_
|
|
1438
|
+
FavoriteButton_: FavoriteButton_,
|
|
1439
|
+
priceFormatting_: priceFormatting_,
|
|
1440
|
+
pseudoRouter_: pseudoRouter_
|
|
1411
1441
|
})]);
|
|
1412
1442
|
return container;
|
|
1413
1443
|
}
|
|
1444
|
+
|
|
1445
|
+
/**
|
|
1446
|
+
* This function is used to determine if the user is trying to open a link in a new tab or window, and we therefore should not single page navigate
|
|
1447
|
+
* @param clickEvent The click event that triggered the navigation
|
|
1448
|
+
*/
|
|
1449
|
+
function $a281666e5c15c2ec$export$29d28dadc2d6b631(clickEvent) {
|
|
1450
|
+
return clickEvent?.button ||
|
|
1451
|
+
// if not zero it's a wheel click which opens in new tab
|
|
1452
|
+
clickEvent?.metaKey ||
|
|
1453
|
+
// if true, cmd button on macOS which opens in new tab
|
|
1454
|
+
clickEvent?.ctrlKey ||
|
|
1455
|
+
// if true, ctrl button on windows or linux which opens in new tab
|
|
1456
|
+
clickEvent?.shiftKey // if true, shift button on windows, linux or macOS which opens in a new window
|
|
1457
|
+
;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
1461
|
+
/**
|
|
1462
|
+
* Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
|
|
1463
|
+
*/ /**
|
|
1464
|
+
* We store listing_id in history.state and do operate on this both here and in js-ui, this is the key to be used which js-ui provides
|
|
1465
|
+
*/
|
|
1466
|
+
#throwing_on_navigation(...args) {
|
|
1467
|
+
const {
|
|
1468
|
+
on_navigation_: on_navigation_
|
|
1469
|
+
} = this;
|
|
1470
|
+
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
1471
|
+
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
1472
|
+
try {
|
|
1473
|
+
return on_navigation_(...args);
|
|
1474
|
+
} catch (e) {
|
|
1475
|
+
queueMicrotask(() => {
|
|
1476
|
+
throw e;
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
1482
|
+
* This standardises waiting for all kinds of routers
|
|
1483
|
+
*/
|
|
1484
|
+
#get_navigation_happened_promise(is_replace) {
|
|
1485
|
+
return new Promise(resolve => {
|
|
1486
|
+
const handler = what_happened => {
|
|
1487
|
+
if (what_happened === (is_replace ? "replaceState" : "pushState")) {
|
|
1488
|
+
resolve();
|
|
1489
|
+
(0, $i7OB2$instant_exec_on_suspect_history_change).delete(handler);
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
(0, $i7OB2$instant_exec_on_suspect_history_change).add(handler);
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
navigate_ = {
|
|
1496
|
+
/**
|
|
1497
|
+
* Call this if you *just* want to replace the state object in history.state
|
|
1498
|
+
*/
|
|
1499
|
+
replace_state_: new_state => {
|
|
1500
|
+
// This doesn't break any router, so we just do this directly for now, since many don't expose an interface for changing the state
|
|
1501
|
+
globalThis?.history?.replaceState(new_state, "");
|
|
1502
|
+
},
|
|
1503
|
+
/**
|
|
1504
|
+
* Call this to change the URL
|
|
1505
|
+
* @param new_url_ new URL to go to
|
|
1506
|
+
* @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
|
|
1507
|
+
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
1508
|
+
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
1509
|
+
* @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
|
|
1510
|
+
*/
|
|
1511
|
+
go_to_: $i7OB2$catchify(async ({
|
|
1512
|
+
new_url_: raw_new_url,
|
|
1513
|
+
event_: event_,
|
|
1514
|
+
force_spa_navigation_: force_spa_navigation_,
|
|
1515
|
+
is_replace_: is_replace_,
|
|
1516
|
+
listing_query_: listing_query_,
|
|
1517
|
+
scroll = true
|
|
1518
|
+
}) => {
|
|
1519
|
+
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
1520
|
+
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
1521
|
+
if ($a281666e5c15c2ec$export$29d28dadc2d6b631(event_)) return;
|
|
1522
|
+
const different_origin = new_url_.origin !== location.origin;
|
|
1523
|
+
if (wants_hard_navigation && (!force_spa_navigation_ || different_origin)) {
|
|
1524
|
+
if (force_spa_navigation_ && different_origin)
|
|
1525
|
+
// If we call history.pushState on a different origin, it will throw an error, so fallback to hard navigations
|
|
1526
|
+
$i7OB2$dwarn("Can't single page navigate to", new_url_.href, "due to different origin, this MIGHT mean you should fix the URLs");
|
|
1527
|
+
if (!event_)
|
|
1528
|
+
// If we haven't gotten an event, nothing will happen by not calling prevent default, so we need to change the URL
|
|
1529
|
+
location.assign(new_url_);
|
|
1530
|
+
return;
|
|
1531
|
+
}
|
|
1532
|
+
event_?.preventDefault();
|
|
1533
|
+
const promise = this.#get_navigation_happened_promise(true);
|
|
1534
|
+
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
1535
|
+
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
1536
|
+
const new_state = history.state;
|
|
1537
|
+
if (listing_query_) {
|
|
1538
|
+
// In JS-UI we need to know the listing_id of the current category, therefore push it into state
|
|
1539
|
+
if (!this.listing_query_state_key) $i7OB2$report(new Error("listing_query_state_key is not set"), "error");
|
|
1540
|
+
new_state[this.listing_query_state_key] = listing_query_;
|
|
1541
|
+
}
|
|
1542
|
+
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
1543
|
+
} else this.#throwing_on_navigation.call(this, {
|
|
1544
|
+
is_replace: is_replace_,
|
|
1545
|
+
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin),
|
|
1546
|
+
scroll: scroll
|
|
1547
|
+
});
|
|
1548
|
+
await promise;
|
|
1549
|
+
})
|
|
1550
|
+
};
|
|
1551
|
+
constructor(on_navigation, listing_query_state_key) {
|
|
1552
|
+
this.listing_query_state_key = listing_query_state_key;
|
|
1553
|
+
this.on_navigation_ = on_navigation;
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1414
1556
|
var $f577edfe2240eec1$var$_tmpl$ = ["<div", ' class="depict recommendations looks" style="', '">', "</div>"];
|
|
1415
1557
|
let $f577edfe2240eec1$var$expandedLooksSignal_;
|
|
1416
1558
|
function $f577edfe2240eec1$export$1935e6bdfc5ed8ce(props) {
|
|
@@ -1419,6 +1561,7 @@ function $f577edfe2240eec1$export$1935e6bdfc5ed8ce(props) {
|
|
|
1419
1561
|
equals: false
|
|
1420
1562
|
});
|
|
1421
1563
|
const expandingAnimationDuration = 240;
|
|
1564
|
+
const pseudoRouter = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation");
|
|
1422
1565
|
const grid_spacing_override = $i7OB2$createMemo(() => {
|
|
1423
1566
|
const {
|
|
1424
1567
|
gridSpacing_: gridSpacing_
|
|
@@ -1444,19 +1587,35 @@ function $f577edfe2240eec1$export$1935e6bdfc5ed8ce(props) {
|
|
|
1444
1587
|
});
|
|
1445
1588
|
const decoded = await response?.json?.().catch(() => false);
|
|
1446
1589
|
if (!decoded)
|
|
1447
|
-
// If network fails, make sure to return empty array
|
|
1590
|
+
// If network fails, make sure to return empty array and SolidRecommendationSlider will remove its elements
|
|
1448
1591
|
return [];
|
|
1449
|
-
|
|
1592
|
+
const {
|
|
1593
|
+
listings: listings
|
|
1594
|
+
} = decoded;
|
|
1595
|
+
const baseData = {
|
|
1596
|
+
merchant: merchant,
|
|
1597
|
+
market: market,
|
|
1598
|
+
locale: locale
|
|
1599
|
+
};
|
|
1600
|
+
return $f577edfe2240eec1$var$runDisplayTransformersForLooks(baseData, listings, props.displayTransformers_);
|
|
1601
|
+
});
|
|
1602
|
+
$i7OB2$createEffect(() => {
|
|
1603
|
+
const {
|
|
1604
|
+
onNavigation_: onNavigation_
|
|
1605
|
+
} = props;
|
|
1606
|
+
if (onNavigation_) pseudoRouter.on_navigation_ = onNavigation_;
|
|
1450
1607
|
});
|
|
1451
1608
|
return $i7OB2$ssr($f577edfe2240eec1$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrStyle(`--animation-duration: ${expandingAnimationDuration}ms`), $i7OB2$escape($i7OB2$createComponent((0, $011607bdf658f807$export$e68cff63f76bd15b), {
|
|
1452
1609
|
get children() {
|
|
1453
1610
|
return $c4492d24952ed731$export$d41d19e89346fa2({
|
|
1454
|
-
product_card_template_:
|
|
1611
|
+
product_card_template_: display => $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
1455
1612
|
display_: display,
|
|
1456
1613
|
FavoriteButton_: props.FavoriteButton_,
|
|
1457
1614
|
placeholderImageAspectRatio_: props.imagePlaceholderAspectRatio_,
|
|
1458
1615
|
animationDuration_: expandingAnimationDuration,
|
|
1459
|
-
expandedLooksSignal_: $f577edfe2240eec1$var$expandedLooksSignal_
|
|
1616
|
+
expandedLooksSignal_: $f577edfe2240eec1$var$expandedLooksSignal_,
|
|
1617
|
+
priceFormatting_: () => props.priceFormatting_,
|
|
1618
|
+
pseudoRouter_: pseudoRouter
|
|
1460
1619
|
}),
|
|
1461
1620
|
recommendations_resource_: looksResource,
|
|
1462
1621
|
title_: () => props.title_,
|
|
@@ -1469,6 +1628,53 @@ function $f577edfe2240eec1$export$1935e6bdfc5ed8ce(props) {
|
|
|
1469
1628
|
})));
|
|
1470
1629
|
}, "LookSlider failed");
|
|
1471
1630
|
}
|
|
1631
|
+
async function $f577edfe2240eec1$var$runDisplayTransformersForLooks(baseData, listings, displayTransformers) {
|
|
1632
|
+
try {
|
|
1633
|
+
const {
|
|
1634
|
+
products: productTransformer,
|
|
1635
|
+
categories: providedListingTransformer
|
|
1636
|
+
} = displayTransformers || {};
|
|
1637
|
+
if (!productTransformer && !providedListingTransformer) return listings;
|
|
1638
|
+
const listingTransformer = providedListingTransformer || (({
|
|
1639
|
+
data: data
|
|
1640
|
+
}) => data);
|
|
1641
|
+
const displaysToTransform = [];
|
|
1642
|
+
const displayIdsPerListingId = {};
|
|
1643
|
+
const transformedListingsPromise = listingTransformer({
|
|
1644
|
+
...baseData,
|
|
1645
|
+
data: listings.map(({
|
|
1646
|
+
displays: displays,
|
|
1647
|
+
...listing
|
|
1648
|
+
}) => {
|
|
1649
|
+
// Populate our displays by id and displayIdToListings object in the .map where we add ancestors to the listings, for peak efficiency
|
|
1650
|
+
for (let i = 0; i < displays.length; i++) {
|
|
1651
|
+
const display = displays[i];
|
|
1652
|
+
const uniqueIdOfDisplay = $16351e4c87b90b3d$export$548d053aba053d79(display);
|
|
1653
|
+
displaysToTransform.push(display);
|
|
1654
|
+
(displayIdsPerListingId[listing.listing_id] ||= []).push(uniqueIdOfDisplay);
|
|
1655
|
+
}
|
|
1656
|
+
return {
|
|
1657
|
+
...listing,
|
|
1658
|
+
ancestors: []
|
|
1659
|
+
};
|
|
1660
|
+
})
|
|
1661
|
+
});
|
|
1662
|
+
// This allows the person providing the displayTransformer to re-order and remove displays
|
|
1663
|
+
const transformedProducts = productTransformer ? await productTransformer({
|
|
1664
|
+
...baseData,
|
|
1665
|
+
displays: displaysToTransform
|
|
1666
|
+
}) : displaysToTransform;
|
|
1667
|
+
const transformedListings = await transformedListingsPromise;
|
|
1668
|
+
const transformedDisplayById = Object.fromEntries(transformedProducts.map(display => [$16351e4c87b90b3d$export$548d053aba053d79(display), display]));
|
|
1669
|
+
return transformedListings.map(listing => $i7OB2$mergeProps(listing, {
|
|
1670
|
+
// use mergeProps because in preview browser we add getters in this object, that would be called too early otherwise
|
|
1671
|
+
displays: (displayIdsPerListingId[listing.listing_id] || []).map(displayId => transformedDisplayById[displayId]).filter(v => v)
|
|
1672
|
+
}));
|
|
1673
|
+
} catch (e) {
|
|
1674
|
+
$i7OB2$dwarn("Displaytransformers threw", e);
|
|
1675
|
+
return [];
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1472
1678
|
const $90980bd87c9960f9$export$3064e1e8c6513da3 = new Set();
|
|
1473
1679
|
let $90980bd87c9960f9$var$has_ran = false;
|
|
1474
1680
|
function $90980bd87c9960f9$export$5162a71f252e6122() {
|
|
@@ -1509,21 +1715,6 @@ function $90980bd87c9960f9$var$starts_with_any_prefix(key) {
|
|
|
1509
1715
|
}
|
|
1510
1716
|
}
|
|
1511
1717
|
|
|
1512
|
-
/**
|
|
1513
|
-
* This function is used to determine if the user is trying to open a link in a new tab or window, and we therefore should not single page navigate
|
|
1514
|
-
* @param clickEvent The click event that triggered the navigation
|
|
1515
|
-
*/
|
|
1516
|
-
function $a281666e5c15c2ec$export$29d28dadc2d6b631(clickEvent) {
|
|
1517
|
-
return clickEvent?.button ||
|
|
1518
|
-
// if not zero it's a wheel click which opens in new tab
|
|
1519
|
-
clickEvent?.metaKey ||
|
|
1520
|
-
// if true, cmd button on macOS which opens in new tab
|
|
1521
|
-
clickEvent?.ctrlKey ||
|
|
1522
|
-
// if true, ctrl button on windows or linux which opens in new tab
|
|
1523
|
-
clickEvent?.shiftKey // if true, shift button on windows, linux or macOS which opens in a new window
|
|
1524
|
-
;
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
1718
|
/**
|
|
1528
1719
|
* Symbol used to identify the version of a SearchModal function. Values right now: 1 = 1st gen classic modal, 2 = second gen modal
|
|
1529
1720
|
*/
|
|
@@ -1563,12 +1754,6 @@ function $d8dbf52fea1773e2$export$f50b88e2a00918b5(fn) {
|
|
|
1563
1754
|
}
|
|
1564
1755
|
};
|
|
1565
1756
|
}
|
|
1566
|
-
function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
|
|
1567
|
-
return $i7OB2$createMemo(() => {
|
|
1568
|
-
const price_formatting = props.price_formatting_;
|
|
1569
|
-
return $i7OB2$standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
1570
|
-
});
|
|
1571
|
-
}
|
|
1572
1757
|
function $f4125ce4984deee6$export$fb40a80c530e5f2b(selectedIndex, groupIndex, indexInGroup) {
|
|
1573
1758
|
const isSelected = $i7OB2$createMemo(() => {
|
|
1574
1759
|
const selectedValue = selectedIndex();
|
|
@@ -1875,7 +2060,7 @@ function $694b7f90501fea4c$export$5d2caaa6b530761c() {
|
|
|
1875
2060
|
}
|
|
1876
2061
|
var $19976a74d273070d$var$_tmpl$ = '<path d="M11.669 10.531l9.156-9.156a.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569A.8.8 0 0 0 20.24 0a.77.77 0 0 0-.569.237l-9.14 9.14-9.14-9.14A.79.79 0 0 0 .807 0a.77.77 0 0 0-.569.237A.78.78 0 0 0 0 .807a.77.77 0 0 0 .237.569l9.156 9.156-9.156 9.14c-.159.157-.237.349-.237.569s.079.412.237.569c.085.085.174.148.268.19a1.095 1.095 0 0 0 .316.048.894.894 0 0 0 .285-.048.84.84 0 0 0 .285-.19l9.139-9.14 9.14 9.14a.894.894 0 0 0 .268.19 1.049 1.049 0 0 0 .301.048.941.941 0 0 0 .301-.048.84.84 0 0 0 .285-.19.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569z"></path>';
|
|
1877
2062
|
function $19976a74d273070d$export$3b621d86b1566b2(props = {}) {
|
|
1878
|
-
return $i7OB2$ssrElement("svg", $i7OB2$
|
|
2063
|
+
return $i7OB2$ssrElement("svg", $i7OB2$mergeProps1({
|
|
1879
2064
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1880
2065
|
width: "21.064",
|
|
1881
2066
|
height: "21.064",
|
|
@@ -1975,7 +2160,7 @@ function $f3213c0640246d58$export$ba17c5b7e6dda39f({
|
|
|
1975
2160
|
}
|
|
1976
2161
|
var $16f0ed5ea30d8d9c$var$_tmpl$ = '<path d="M19.811 20.174l-6.234-6.809a7.96 7.96 0 0 0 .923-1.179c.274-.424.502-.865.687-1.323a8.04 8.04 0 0 0 .42-1.436 7.88 7.88 0 0 0 .144-1.507c0-.526-.051-1.042-.154-1.548-.096-.506-.243-.995-.441-1.466s-.441-.919-.728-1.343a8.28 8.28 0 0 0-.984-1.21 7.86 7.86 0 0 0-1.2-.984A7.56 7.56 0 0 0 10.89.651C10.418.453 9.929.302 9.423.2S8.401.046 7.875.046 6.833.097 6.327.2 5.332.453 4.86.651a7.56 7.56 0 0 0-1.354.718c-.431.287-.831.615-1.2.984a8.28 8.28 0 0 0-.984 1.21 7.73 7.73 0 0 0-.728 1.343c-.198.472-.349.96-.451 1.466A8.31 8.31 0 0 0 0 7.921a8.31 8.31 0 0 0 .144 1.548c.103.506.253.995.451 1.466a8.08 8.08 0 0 0 .728 1.354 7.86 7.86 0 0 0 .984 1.2 7.54 7.54 0 0 0 1.2.995c.431.287.882.53 1.354.728.472.191.96.338 1.466.441a8.31 8.31 0 0 0 1.548.144c.451 0 .896-.038 1.333-.113a7.83 7.83 0 0 0 1.282-.328 7.55 7.55 0 0 0 1.2-.533 8.08 8.08 0 0 0 1.107-.749l6.245 6.809a.45.45 0 0 0 .174.123.55.55 0 0 0 .205.041.61.61 0 0 0 .195-.031c.061-.021.116-.055.164-.102.109-.096.164-.219.164-.369.007-.144-.038-.267-.133-.369zM1.046 7.921c0-.937.178-1.818.533-2.646.362-.834.851-1.559 1.466-2.174.622-.615 1.347-1.101 2.174-1.456.827-.362 1.712-.543 2.656-.543s1.829.181 2.656.543c.827.355 1.548.841 2.164 1.456.622.615 1.111 1.34 1.466 2.174a6.52 6.52 0 0 1 .543 2.646c0 .943-.181 1.829-.543 2.656a6.89 6.89 0 0 1-1.466 2.174c-.615.615-1.336 1.104-2.164 1.466-.827.356-1.712.533-2.656.533s-1.829-.178-2.656-.533c-.827-.362-1.552-.851-2.174-1.466-.615-.622-1.104-1.347-1.466-2.174-.355-.827-.533-1.712-.533-2.656z"></path>';
|
|
1977
2162
|
function $16f0ed5ea30d8d9c$export$82eafebb825fc23f(props = {}) {
|
|
1978
|
-
return $i7OB2$ssrElement("svg", $i7OB2$
|
|
2163
|
+
return $i7OB2$ssrElement("svg", $i7OB2$mergeProps1({
|
|
1979
2164
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1980
2165
|
width: "20",
|
|
1981
2166
|
height: "22",
|
|
@@ -1984,7 +2169,7 @@ function $16f0ed5ea30d8d9c$export$82eafebb825fc23f(props = {}) {
|
|
|
1984
2169
|
}
|
|
1985
2170
|
var $190927650b4840eb$var$_tmpl$ = '<path d="M56 26.455a13.71 13.71 0 0 0-9.578 3.967A13.71 13.71 0 0 0 42.455 40v176a13.71 13.71 0 0 0 3.967 9.578A13.71 13.71 0 0 0 56 229.545h144A13.71 13.71 0 0 0 213.545 216V88a2.456 2.456 0 0 1 0-.002c.001-1.452-.597-2.895-1.623-3.922l-55.998-55.998a5.61 5.61 0 0 0-3.922-1.623 2.456 2.456 0 0 1-.002 0zm0 11.09h88A2.456 2.456 0 0 1 146.455 40v48c0 2.903 2.642 5.545 5.545 5.545h48A2.456 2.456 0 0 1 202.455 96v120a2.456 2.456 0 0 1-2.455 2.455H56A2.456 2.456 0 0 1 53.545 216V40A2.456 2.456 0 0 1 56 37.545zm103.061 11.498a2.456 2.456 0 0 1 2.676.531l28.689 28.689a2.456 2.456 0 0 1-1.736 4.191H160A2.456 2.456 0 0 1 157.545 80V51.311a2.456 2.456 0 0 1 1.516-2.268zM96 130.455c-2.903 0-5.545 2.642-5.545 5.545s2.642 5.545 5.545 5.545h64c2.903 0 5.545-2.642 5.545-5.545s-2.642-5.545-5.545-5.545zm0 32c-2.903 0-5.545 2.642-5.545 5.545s2.642 5.545 5.545 5.545h64c2.903 0 5.545-2.642 5.545-5.545s-2.642-5.545-5.545-5.545z"></path>';
|
|
1986
2171
|
function $190927650b4840eb$export$605674723bcc715c(props = {}) {
|
|
1987
|
-
return $i7OB2$ssrElement("svg", $i7OB2$
|
|
2172
|
+
return $i7OB2$ssrElement("svg", $i7OB2$mergeProps1({
|
|
1988
2173
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1989
2174
|
width: "32",
|
|
1990
2175
|
height: "32",
|
|
@@ -2539,7 +2724,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
2539
2724
|
get children() {
|
|
2540
2725
|
return $i7OB2$ssr($5285d2814d0fac0c$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.back_(), true), false), $i7OB2$escape($i7OB2$createComponent(BackIcon_, {})));
|
|
2541
2726
|
}
|
|
2542
|
-
})), `query ${!!on_back_ ? "has-adjacent-back-button" : ""}`, $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.search_field_field_aria_label_(), true), false) + $i7OB2$ssrAttribute("value", $i7OB2$escape(search_field_value_[0](), true), false) + $i7OB2$ssrAttribute("placeholder", $i7OB2$escape(i18n_.placeholder_text_(), true), false), $i7OB2$ssrAttribute("title", $i7OB2$escape(i18n_.clear_filters_query_sorting_after_submit_(), true), false), $i7OB2$ssrStyle($i7OB2$createMemo(() => search_field_value_[0]() ? "" : "display: none")()), $i7OB2$escape($i7OB2$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {})), $i7OB2$ssrElement("button", $i7OB2$
|
|
2727
|
+
})), `query ${!!on_back_ ? "has-adjacent-back-button" : ""}`, $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.search_field_field_aria_label_(), true), false) + $i7OB2$ssrAttribute("value", $i7OB2$escape(search_field_value_[0](), true), false) + $i7OB2$ssrAttribute("placeholder", $i7OB2$escape(i18n_.placeholder_text_(), true), false), $i7OB2$ssrAttribute("title", $i7OB2$escape(i18n_.clear_filters_query_sorting_after_submit_(), true), false), $i7OB2$ssrStyle($i7OB2$createMemo(() => search_field_value_[0]() ? "" : "display: none")()), $i7OB2$escape($i7OB2$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {})), $i7OB2$ssrElement("button", $i7OB2$mergeProps1({
|
|
2543
2728
|
"class": "submit major",
|
|
2544
2729
|
type: "button"
|
|
2545
2730
|
}, () => isNewModal ? {
|
|
@@ -3058,7 +3243,7 @@ function $4ce5b8892775b62d$export$67152d26d4f56ee8({
|
|
|
3058
3243
|
selected_index_: [read_selected_index_, write_selected_index_]
|
|
3059
3244
|
}) {
|
|
3060
3245
|
const href = $i7OB2$createMemo(() => listing_()?.page_url); // <- could be made reactive getter created in displayTransformers, read it in memo here since it might create computations (for example in the preview-brower), and there's no owner in the onClick handler
|
|
3061
|
-
const LinkToListing = props => $i7OB2$ssrElement("a", $i7OB2$
|
|
3246
|
+
const LinkToListing = props => $i7OB2$ssrElement("a", $i7OB2$mergeProps1(props, {
|
|
3062
3247
|
get href() {
|
|
3063
3248
|
return href();
|
|
3064
3249
|
}
|
|
@@ -3348,7 +3533,7 @@ function $2f3171b02c8f4a5d$export$af1fb307bbba2417({
|
|
|
3348
3533
|
$i7OB2$createComputed($i7OB2$on(search_field_value_[0], () => !suggestions_updating_blocked() && set_selected_index(undefined), {
|
|
3349
3534
|
defer: true
|
|
3350
3535
|
})); // reset autocomplete position if query changes
|
|
3351
|
-
return [$i7OB2$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $i7OB2$
|
|
3536
|
+
return [$i7OB2$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $i7OB2$mergeProps1(sharedSuggestionProps, {
|
|
3352
3537
|
get title_() {
|
|
3353
3538
|
return i18n_.popular_;
|
|
3354
3539
|
},
|
|
@@ -3358,7 +3543,7 @@ function $2f3171b02c8f4a5d$export$af1fb307bbba2417({
|
|
|
3358
3543
|
return itemIndexes_.suggestionsIndex_;
|
|
3359
3544
|
},
|
|
3360
3545
|
showPlaceholders_: () => showPlaceholders() || noResults_() && !noResultsPopularSuggestions.latest
|
|
3361
|
-
})), $i7OB2$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $i7OB2$
|
|
3546
|
+
})), $i7OB2$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $i7OB2$mergeProps1(sharedSuggestionProps, {
|
|
3362
3547
|
get title_() {
|
|
3363
3548
|
return i18n_.previous_;
|
|
3364
3549
|
},
|
|
@@ -3369,7 +3554,7 @@ function $2f3171b02c8f4a5d$export$af1fb307bbba2417({
|
|
|
3369
3554
|
},
|
|
3370
3555
|
extraTitleRowElements_: () => $i7OB2$ssr($2f3171b02c8f4a5d$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(i18n_.clear_all_from_filter_crumbs_())),
|
|
3371
3556
|
showPlaceholders_: () => false
|
|
3372
|
-
})), $i7OB2$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $i7OB2$
|
|
3557
|
+
})), $i7OB2$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $i7OB2$mergeProps1(sharedSuggestionProps, {
|
|
3373
3558
|
get title_() {
|
|
3374
3559
|
return i18n_.content_;
|
|
3375
3560
|
},
|
|
@@ -3770,7 +3955,7 @@ function $024fbc0a2d796fad$export$b2539bed5023c21c(props) {
|
|
|
3770
3955
|
return $i7OB2$createComponent($024fbc0a2d796fad$var$TabsContext.Provider, {
|
|
3771
3956
|
value: new (0, $i7OB2$ListenableSet)(),
|
|
3772
3957
|
get children() {
|
|
3773
|
-
return $i7OB2$createComponent($024fbc0a2d796fad$var$ActualTabs, $i7OB2$
|
|
3958
|
+
return $i7OB2$createComponent($024fbc0a2d796fad$var$ActualTabs, $i7OB2$mergeProps1(props, {
|
|
3774
3959
|
get children() {
|
|
3775
3960
|
return props.children;
|
|
3776
3961
|
}
|
|
@@ -3800,7 +3985,7 @@ function $024fbc0a2d796fad$var$ActualTabs(props) {
|
|
|
3800
3985
|
},
|
|
3801
3986
|
children: item => {
|
|
3802
3987
|
const weSelected = $i7OB2$createMemo(() => isSelected(item().id));
|
|
3803
|
-
return $i7OB2$createComponent((0, $i7OB2$Dynamic), $i7OB2$
|
|
3988
|
+
return $i7OB2$createComponent((0, $i7OB2$Dynamic), $i7OB2$mergeProps1({
|
|
3804
3989
|
get component() {
|
|
3805
3990
|
return props.AnchorComponent;
|
|
3806
3991
|
},
|
|
@@ -3879,7 +4064,7 @@ function $024fbc0a2d796fad$export$3e41faf802a29e71(props) {
|
|
|
3879
4064
|
if (!currentTabs) throw new Error("Tab must be a child of Tabs");
|
|
3880
4065
|
const id = $i7OB2$createUniqueId();
|
|
3881
4066
|
const ourSet = currentTabs;
|
|
3882
|
-
const extendedProps = $i7OB2$
|
|
4067
|
+
const extendedProps = $i7OB2$mergeProps({
|
|
3883
4068
|
id: id
|
|
3884
4069
|
}, props);
|
|
3885
4070
|
ourSet.add(extendedProps);
|
|
@@ -3993,102 +4178,6 @@ function $ca6f574bd8772184$var$history_state_change(signals, entries, state) {
|
|
|
3993
4178
|
}
|
|
3994
4179
|
});
|
|
3995
4180
|
}
|
|
3996
|
-
class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
3997
|
-
/**
|
|
3998
|
-
* Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
|
|
3999
|
-
*/ /**
|
|
4000
|
-
* We store listing_id in history.state and do operate on this both here and in js-ui, this is the key to be used which js-ui provides
|
|
4001
|
-
*/
|
|
4002
|
-
#throwing_on_navigation(...args) {
|
|
4003
|
-
const {
|
|
4004
|
-
on_navigation_: on_navigation_
|
|
4005
|
-
} = this;
|
|
4006
|
-
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
4007
|
-
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
4008
|
-
try {
|
|
4009
|
-
return on_navigation_(...args);
|
|
4010
|
-
} catch (e) {
|
|
4011
|
-
queueMicrotask(() => {
|
|
4012
|
-
throw e;
|
|
4013
|
-
});
|
|
4014
|
-
}
|
|
4015
|
-
}
|
|
4016
|
-
/**
|
|
4017
|
-
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
4018
|
-
* This standardises waiting for all kinds of routers
|
|
4019
|
-
*/
|
|
4020
|
-
#get_navigation_happened_promise(is_replace) {
|
|
4021
|
-
return new Promise(resolve => {
|
|
4022
|
-
const handler = what_happened => {
|
|
4023
|
-
if (what_happened === (is_replace ? "replaceState" : "pushState")) {
|
|
4024
|
-
resolve();
|
|
4025
|
-
(0, $i7OB2$instant_exec_on_suspect_history_change).delete(handler);
|
|
4026
|
-
}
|
|
4027
|
-
};
|
|
4028
|
-
(0, $i7OB2$instant_exec_on_suspect_history_change).add(handler);
|
|
4029
|
-
});
|
|
4030
|
-
}
|
|
4031
|
-
navigate_ = {
|
|
4032
|
-
/**
|
|
4033
|
-
* Call this if you *just* want to replace the state object in history.state
|
|
4034
|
-
*/
|
|
4035
|
-
replace_state_: new_state => {
|
|
4036
|
-
// This doesn't break any router, so we just do this directly for now, since many don't expose an interface for changing the state
|
|
4037
|
-
globalThis?.history?.replaceState(new_state, "");
|
|
4038
|
-
},
|
|
4039
|
-
/**
|
|
4040
|
-
* Call this to change the URL
|
|
4041
|
-
* @param new_url_ new URL to go to
|
|
4042
|
-
* @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
|
|
4043
|
-
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
4044
|
-
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
4045
|
-
* @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
|
|
4046
|
-
*/
|
|
4047
|
-
go_to_: $i7OB2$catchify(async ({
|
|
4048
|
-
new_url_: raw_new_url,
|
|
4049
|
-
event_: event_,
|
|
4050
|
-
force_spa_navigation_: force_spa_navigation_,
|
|
4051
|
-
is_replace_: is_replace_,
|
|
4052
|
-
listing_query_: listing_query_,
|
|
4053
|
-
scroll = true
|
|
4054
|
-
}) => {
|
|
4055
|
-
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
4056
|
-
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
4057
|
-
if ($a281666e5c15c2ec$export$29d28dadc2d6b631(event_)) return;
|
|
4058
|
-
const different_origin = new_url_.origin !== location.origin;
|
|
4059
|
-
if (wants_hard_navigation && (!force_spa_navigation_ || different_origin)) {
|
|
4060
|
-
if (force_spa_navigation_ && different_origin)
|
|
4061
|
-
// If we call history.pushState on a different origin, it will throw an error, so fallback to hard navigations
|
|
4062
|
-
$i7OB2$dwarn("Can't single page navigate to", new_url_.href, "due to different origin, this MIGHT mean you should fix the URLs");
|
|
4063
|
-
if (!event_)
|
|
4064
|
-
// If we haven't gotten an event, nothing will happen by not calling prevent default, so we need to change the URL
|
|
4065
|
-
location.assign(new_url_);
|
|
4066
|
-
return;
|
|
4067
|
-
}
|
|
4068
|
-
event_?.preventDefault();
|
|
4069
|
-
const promise = this.#get_navigation_happened_promise(true);
|
|
4070
|
-
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
4071
|
-
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
4072
|
-
const new_state = history.state;
|
|
4073
|
-
if (listing_query_) {
|
|
4074
|
-
// In JS-UI we need to know the listing_id of the current category, therefore push it into state
|
|
4075
|
-
if (!this.listing_query_state_key) $i7OB2$report(new Error("listing_query_state_key is not set"), "error");
|
|
4076
|
-
new_state[this.listing_query_state_key] = listing_query_;
|
|
4077
|
-
}
|
|
4078
|
-
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
4079
|
-
} else this.#throwing_on_navigation.call(this, {
|
|
4080
|
-
is_replace: is_replace_,
|
|
4081
|
-
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin),
|
|
4082
|
-
scroll: scroll
|
|
4083
|
-
});
|
|
4084
|
-
await promise;
|
|
4085
|
-
})
|
|
4086
|
-
};
|
|
4087
|
-
constructor(on_navigation, listing_query_state_key) {
|
|
4088
|
-
this.listing_query_state_key = listing_query_state_key;
|
|
4089
|
-
this.on_navigation_ = on_navigation;
|
|
4090
|
-
}
|
|
4091
|
-
}
|
|
4092
4181
|
var $2a26c8ff1ef1fe75$var$_tmpl$ = ["<div", ' class="image-container">', "</div>"];
|
|
4093
4182
|
function $2a26c8ff1ef1fe75$export$41e1a079d40a0d58(props) {
|
|
4094
4183
|
const [display] = $i7OB2$createResource(() => ({
|
|
@@ -4182,7 +4271,7 @@ function $3da8afe3ed57cf34$export$7da560f849543dff({
|
|
|
4182
4271
|
get children() {
|
|
4183
4272
|
return $i7OB2$ssr($3da8afe3ed57cf34$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(title()));
|
|
4184
4273
|
}
|
|
4185
|
-
}), $i7OB2$ssr($3da8afe3ed57cf34$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($a458486f22b22f63$export$a2cc176055f8f08()), $i7OB2$escape($i7OB2$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $i7OB2$
|
|
4274
|
+
}), $i7OB2$ssr($3da8afe3ed57cf34$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($a458486f22b22f63$export$a2cc176055f8f08()), $i7OB2$escape($i7OB2$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $i7OB2$mergeProps1({
|
|
4186
4275
|
get rows() {
|
|
4187
4276
|
return rows_object_();
|
|
4188
4277
|
},
|
|
@@ -4466,7 +4555,7 @@ function $8560c919ff763930$var$ActualShopTheLookButton(props) {
|
|
|
4466
4555
|
const button = $i7OB2$ssrElement("button", localProps.buttonAttributes, () => $i7OB2$escape(localProps?.buttonAttributes?.children) || "Shop the look", true);
|
|
4467
4556
|
$i7OB2$createEffect(() => button.style.display = displayStyleValue()); // Set our attributes like this, so we allow total control over the button from the outside via buttonAttributes
|
|
4468
4557
|
$i7OB2$createEffect(() => !hasAnythingToShow() && closeModal()); // close modal if we ever get into the state of having it open and not having anything to show
|
|
4469
|
-
$8560c919ff763930$var$modalProps = $i7OB2$
|
|
4558
|
+
$8560c919ff763930$var$modalProps = $i7OB2$mergeProps(partForModal, {
|
|
4470
4559
|
products_to_shop_: products_to_shop_
|
|
4471
4560
|
});
|
|
4472
4561
|
button.addEventListener("click", openModal);
|
|
@@ -4882,7 +4971,7 @@ const $49b79728e7d9e2a1$export$48513f6b9f8ce62d = props => {
|
|
|
4882
4971
|
};
|
|
4883
4972
|
var $f8a56ba74eedd0c6$var$_tmpl$ = '<path d="M10.173 5.548H5.5V.875c0-.075-.027-.14-.081-.193S5.301.601 5.226.601s-.14.027-.193.081-.081.118-.081.193v4.673H.274c-.075 0-.14.027-.193.081A.27.27 0 0 0 0 5.827c0 .075.027.14.081.193s.118.081.193.081h4.678v4.673c0 .075.027.14.081.193s.118.081.193.081.14-.027.193-.081.081-.118.081-.193V6.101h4.673a.27.27 0 0 0 .199-.081c.054-.054.08-.118.08-.193a.27.27 0 0 0-.279-.279z" fill="#000"></path>';
|
|
4884
4973
|
function $f8a56ba74eedd0c6$export$f21ab0717a89c77f(props) {
|
|
4885
|
-
return $i7OB2$ssrElement("svg", $i7OB2$
|
|
4974
|
+
return $i7OB2$ssrElement("svg", $i7OB2$mergeProps1(props, {
|
|
4886
4975
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4887
4976
|
width: "11",
|
|
4888
4977
|
height: "12"
|
|
@@ -6053,7 +6142,7 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
|
|
|
6053
6142
|
const MakeButton = attributes => {
|
|
6054
6143
|
const label = $i7OB2$createMemo(() => value().name_ || value().value_ + "");
|
|
6055
6144
|
const count_zero = $i7OB2$createMemo(() => value().count_ === 0);
|
|
6056
|
-
return $i7OB2$ssrElement("button", $i7OB2$
|
|
6145
|
+
return $i7OB2$ssrElement("button", $i7OB2$mergeProps1(attributes, {
|
|
6057
6146
|
get disabled() {
|
|
6058
6147
|
return count_zero() && !is_selected();
|
|
6059
6148
|
},
|
|
@@ -6353,7 +6442,7 @@ var $12497d09ef87296e$export$2e2bcd8739ae039 = {
|
|
|
6353
6442
|
};
|
|
6354
6443
|
var $9bc34983fc5f7bdb$var$_tmpl$ = '<path d="M4.617 12.738a.48.48 0 0 1-.164-.027c-.051-.023-.094-.055-.129-.098L.125 8.414A.39.39 0 0 1 0 8.117c0-.113.039-.211.125-.293s.18-.125.293-.125.215.043.297.125l3.902 3.902L16.086.262c.082-.082.18-.125.297-.125s.211.043.293.125.125.184.125.301-.043.215-.125.297L4.914 12.613c-.039.043-.086.078-.141.098s-.102.027-.156.027zm0 0"></path>';
|
|
6355
6444
|
function $9bc34983fc5f7bdb$export$f2ca6fc699ca1fb4(props = {}) {
|
|
6356
|
-
return $i7OB2$ssrElement("svg", $i7OB2$
|
|
6445
|
+
return $i7OB2$ssrElement("svg", $i7OB2$mergeProps1({
|
|
6357
6446
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6358
6447
|
width: "16.8",
|
|
6359
6448
|
height: "14"
|
|
@@ -7276,7 +7365,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
7276
7365
|
// Filter out our transformed ancestors
|
|
7277
7366
|
const transformedAncestors = Object.fromEntries(transformerResult.filter(item => item.is_suggestion === false).map(item => [item.listing_id, item]));
|
|
7278
7367
|
// Add the now transformed ancestors into the ancestors of the listing suggestions
|
|
7279
|
-
const transformedSuggestions = transformerResult.filter(item => item.is_suggestion !== false).map(item => $i7OB2$
|
|
7368
|
+
const transformedSuggestions = transformerResult.filter(item => item.is_suggestion !== false).map(item => $i7OB2$mergeProps(item, {
|
|
7280
7369
|
// Use mergeProps instead of spread since page_url and other properties could be a getter that solid components should call
|
|
7281
7370
|
ancestors: item.ancestors.map(ancestor => {
|
|
7282
7371
|
const newAncestor = transformedAncestors[ancestor.listing_id];
|
|
@@ -7807,7 +7896,7 @@ function $172e1b898d457050$export$7de92c4c2205ebf3({
|
|
|
7807
7896
|
return (0, $7747fe1a8c5652e3$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...possible_num_columns);
|
|
7808
7897
|
});
|
|
7809
7898
|
// Don't tear down elements every time one updates the page - don't put them within <Show>
|
|
7810
|
-
const elements = $i7OB2$ssr($172e1b898d457050$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(i18n_.search_recs_title_()), $i7OB2$escape($a458486f22b22f63$export$a2cc176055f8f08()), $i7OB2$escape($i7OB2$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $i7OB2$
|
|
7899
|
+
const elements = $i7OB2$ssr($172e1b898d457050$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(i18n_.search_recs_title_()), $i7OB2$escape($a458486f22b22f63$export$a2cc176055f8f08()), $i7OB2$escape($i7OB2$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $i7OB2$mergeProps1({
|
|
7811
7900
|
rows: rows_object,
|
|
7812
7901
|
layout: "grid",
|
|
7813
7902
|
element_attributes: {
|
|
@@ -8627,7 +8716,7 @@ var $6dee9211e57ac31a$var$_tmpl$ = ["<style", ' type="text/css">', "</style>"];
|
|
|
8627
8716
|
const $6dee9211e57ac31a$export$c500183c31c2b22e = "--spans-columns";
|
|
8628
8717
|
function $6dee9211e57ac31a$export$ab6b147eec64fea5(props) {
|
|
8629
8718
|
const container_class = "x" + $i7OB2$createUniqueId();
|
|
8630
|
-
const container_element_ = $i7OB2$ssrElement("div", $i7OB2$
|
|
8719
|
+
const container_element_ = $i7OB2$ssrElement("div", $i7OB2$mergeProps1(() => props.element_attributes, {
|
|
8631
8720
|
classList: {
|
|
8632
8721
|
[container_class]: true
|
|
8633
8722
|
}
|
|
@@ -8877,7 +8966,7 @@ function $e7a7eb102ddc0c79$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
8877
8966
|
})));
|
|
8878
8967
|
}
|
|
8879
8968
|
});
|
|
8880
|
-
return $i7OB2$
|
|
8969
|
+
return $i7OB2$mergeProps(block, {
|
|
8881
8970
|
// Create content divs for the blocks with as much fine-grained diffing as possible?
|
|
8882
8971
|
content: () => {
|
|
8883
8972
|
// Sneaky on-demand rendering, so we don't render more blocks than we can show: we have the rendered value here and don't return a function that renders because if our block would be moved around we'd be guaranteed to re-render
|
|
@@ -9112,7 +9201,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
9112
9201
|
} = slider;
|
|
9113
9202
|
const Layout = props => $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, insert_here, true);
|
|
9114
9203
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
9115
|
-
$i7OB2$createComponent(Layout, $i7OB2$
|
|
9204
|
+
$i7OB2$createComponent(Layout, $i7OB2$mergeProps1(layout_options_, {
|
|
9116
9205
|
rows: "all",
|
|
9117
9206
|
get cols_at_size() {
|
|
9118
9207
|
return modified_cols_at_size();
|
|
@@ -9258,7 +9347,7 @@ function $68a258a92b88f02f$export$1f1775a58da589b5({
|
|
|
9258
9347
|
var $e1bb71e65e01a3a0$var$_tmpl$ = '<path d="M6.199 10.254a.35.35 0 0 0-.496 0L3.5 12.453V.348a.35.35 0 0 0-.7 0v12.105L.598 10.254c-.137-.137-.359-.137-.492 0a.35.35 0 0 0 0 .492l2.797 2.801a.35.35 0 0 0 .496 0L6.2 10.746c.137-.137.137-.355 0-.492zM9.449 3.5H8.051a.35.35 0 0 1-.352-.352V1.75c0-.191.156-.352.352-.352h1.398c.195 0 .352.16.352.352v1.398a.35.35 0 0 1-.352.352zm-1.051-.699h.703v-.699h-.703zm0 0"></path>',
|
|
9259
9348
|
$e1bb71e65e01a3a0$var$_tmpl$2 = '<path d="M10.852 6.301H8.051a.35.35 0 0 1-.352-.352V4.551a.35.35 0 0 1 .352-.352h2.801a.35.35 0 0 1 .348.352v1.398a.35.35 0 0 1-.348.352zm-2.453-.699H10.5v-.703H8.398zm3.851 3.5H8.051c-.195 0-.352-.16-.352-.352V7.352A.35.35 0 0 1 8.051 7h4.199c.191 0 .352.156.352.352V8.75c0 .191-.16.352-.352.352zm-3.852-.703h3.5V7.7h-3.5zm5.25 3.499H8.051a.35.35 0 0 1-.352-.348v-1.402a.35.35 0 0 1 .352-.348h5.598a.35.35 0 0 1 .352.348v1.402a.35.35 0 0 1-.352.348zm-5.25-.699H13.3V10.5H8.398zm0 0"></path>';
|
|
9260
9349
|
function $e1bb71e65e01a3a0$export$da32f7add8a22e86(props = {}) {
|
|
9261
|
-
return $i7OB2$ssrElement("svg", $i7OB2$
|
|
9350
|
+
return $i7OB2$ssrElement("svg", $i7OB2$mergeProps1({
|
|
9262
9351
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9263
9352
|
width: "14",
|
|
9264
9353
|
height: "14",
|
|
@@ -9267,7 +9356,7 @@ function $e1bb71e65e01a3a0$export$da32f7add8a22e86(props = {}) {
|
|
|
9267
9356
|
}
|
|
9268
9357
|
var $05fbe84eb34564ec$var$_tmpl$ = '<path d="M6.199 10.254a.35.35 0 0 0-.496 0L3.5 12.453V.348a.35.35 0 0 0-.7 0v12.105L.598 10.254c-.137-.137-.359-.137-.492 0a.35.35 0 0 0 0 .492l2.797 2.801a.35.35 0 0 0 .496 0L6.2 10.746c.137-.137.137-.355 0-.492zm3.25 1.644H8.051a.35.35 0 0 1-.352-.348v-1.402a.35.35 0 0 1 .352-.348h1.398a.35.35 0 0 1 .352.348v1.402a.35.35 0 0 1-.352.348zm-1.051-.699h.703V10.5h-.703zm2.454-2.097H8.051c-.195 0-.352-.16-.352-.352V7.352A.35.35 0 0 1 8.051 7h2.801a.35.35 0 0 1 .348.352V8.75c0 .191-.156.352-.348.352zm-2.453-.703H10.5V7.7H8.398zm3.851-2.098H8.051a.35.35 0 0 1-.352-.352V4.551a.35.35 0 0 1 .352-.352h4.199c.191 0 .352.156.352.352v1.398c0 .195-.16.352-.352.352zm-3.852-.699h3.5v-.703h-3.5zm5.25-2.102H8.051a.35.35 0 0 1-.352-.352V1.75c0-.191.156-.352.352-.352h5.598c.195 0 .352.16.352.352v1.398a.35.35 0 0 1-.352.352zm-5.25-.699H13.3v-.699H8.398zm0 0"></path>';
|
|
9269
9358
|
function $05fbe84eb34564ec$export$d10e63059ddb9fd4(props = {}) {
|
|
9270
|
-
return $i7OB2$ssrElement("svg", $i7OB2$
|
|
9359
|
+
return $i7OB2$ssrElement("svg", $i7OB2$mergeProps1({
|
|
9271
9360
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9272
9361
|
width: "14",
|
|
9273
9362
|
height: "14",
|
|
@@ -9380,7 +9469,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({
|
|
|
9380
9469
|
})));
|
|
9381
9470
|
},
|
|
9382
9471
|
get children() {
|
|
9383
|
-
return $i7OB2$ssr($757dac7f7c6c5241$var$_tmpl$5, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $fab07f52c9861732$export$3f1a388cc0d8fed7), $i7OB2$
|
|
9472
|
+
return $i7OB2$ssr($757dac7f7c6c5241$var$_tmpl$5, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $fab07f52c9861732$export$3f1a388cc0d8fed7), $i7OB2$mergeProps1(args_for_filtering_, {
|
|
9384
9473
|
are_in_modal_: true
|
|
9385
9474
|
}))));
|
|
9386
9475
|
}
|
|
@@ -9936,7 +10025,7 @@ function $b2bf2cdcff8142d8$export$f631859cab12b342({
|
|
|
9936
10025
|
if (content_result_) return $i7OB2$ssrElement("a", attributes, () => $i7OB2$escape(children), true);
|
|
9937
10026
|
return $i7OB2$ssrElement("div", attributes, () => $i7OB2$escape(children), true);
|
|
9938
10027
|
};
|
|
9939
|
-
return $i7OB2$ssr($b2bf2cdcff8142d8$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent(LinkIfPossible, $i7OB2$
|
|
10028
|
+
return $i7OB2$ssr($b2bf2cdcff8142d8$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent(LinkIfPossible, $i7OB2$mergeProps1(make_link_attributes, {
|
|
9940
10029
|
tabIndex: "-1",
|
|
9941
10030
|
get children() {
|
|
9942
10031
|
return $i7OB2$createComponent((0, $190927650b4840eb$export$605674723bcc715c), {
|
|
@@ -9944,7 +10033,7 @@ function $b2bf2cdcff8142d8$export$f631859cab12b342({
|
|
|
9944
10033
|
height: "28"
|
|
9945
10034
|
});
|
|
9946
10035
|
}
|
|
9947
|
-
}))), $i7OB2$escape($i7OB2$createComponent(LinkIfPossible, $i7OB2$
|
|
10036
|
+
}))), $i7OB2$escape($i7OB2$createComponent(LinkIfPossible, $i7OB2$mergeProps1({
|
|
9948
10037
|
"class": "content-title line-clamp"
|
|
9949
10038
|
}, make_link_attributes, {
|
|
9950
10039
|
get title() {
|
|
@@ -10079,7 +10168,7 @@ function $49de9d31aeea1b5e$export$6d0c9c22f6652669({
|
|
|
10079
10168
|
return (0, $f8c929beb82c512b$export$2452208c79fe93ea).content;
|
|
10080
10169
|
},
|
|
10081
10170
|
number_of_results_: num_results
|
|
10082
|
-
})), $i7OB2$escape($i7OB2$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $i7OB2$
|
|
10171
|
+
})), $i7OB2$escape($i7OB2$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $i7OB2$mergeProps1({
|
|
10083
10172
|
layout: "grid",
|
|
10084
10173
|
element_attributes: {
|
|
10085
10174
|
class: "cards"
|
|
@@ -10451,7 +10540,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
10451
10540
|
});
|
|
10452
10541
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $i7OB2$createSignal();
|
|
10453
10542
|
const no_results_text_ = $i7OB2$createMemo(() => (search_results_()?.content_search_links?.length ? i18n_.no_products_ : i18n_.no_results_text_)());
|
|
10454
|
-
const results_for = $i7OB2$createComponent((0, $f8c929beb82c512b$export$9dd50d35b9d94fdf), $i7OB2$
|
|
10543
|
+
const results_for = $i7OB2$createComponent((0, $f8c929beb82c512b$export$9dd50d35b9d94fdf), $i7OB2$mergeProps1({
|
|
10455
10544
|
get type() {
|
|
10456
10545
|
return (0, $f8c929beb82c512b$export$2452208c79fe93ea).products;
|
|
10457
10546
|
},
|
|
@@ -12180,7 +12269,7 @@ function $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta) {
|
|
|
12180
12269
|
return $i7OB2$createMemo(() => {
|
|
12181
12270
|
const api_value = plp_meta()?.breadcrumbs;
|
|
12182
12271
|
if (!api_value) return api_value;
|
|
12183
|
-
return [...api_value, $i7OB2$
|
|
12272
|
+
return [...api_value, $i7OB2$mergeProps(plp_meta(), {
|
|
12184
12273
|
get page_url() {
|
|
12185
12274
|
return href_accessor();
|
|
12186
12275
|
}
|