@depict-ai/ui 4.3.10 → 4.3.12

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.
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
100
100
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
101
101
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
102
102
  /*! Depict.ai search and product listing SDK */
103
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.10";
103
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.12";
104
104
  const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
105
105
  const cols_at_size = [];
106
106
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -704,7 +704,8 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
704
704
  recommendations_resource_: recommendations_resource_,
705
705
  product_card_template_: product_card_template_,
706
706
  layout_options_: layout_options_,
707
- title_: title_
707
+ title_: title_,
708
+ NoResultsFallback_: NoResultsFallback_
708
709
  } = _ref;
709
710
  const is_showing_something = $3hooq$solidjs.createMemo(() => {
710
711
  var _recommendations_reso;
@@ -763,6 +764,9 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
763
764
  get when() {
764
765
  return is_showing_something();
765
766
  },
767
+ get fallback() {
768
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
769
+ },
766
770
  children: slider
767
771
  });
768
772
  }
@@ -1242,7 +1246,7 @@ function $f38f2e64ebe2da86$export$a71e92cfbb498adc(props) {
1242
1246
  }
1243
1247
  var $d66c35b5a6d6d926$var$_tmpl$ = ["<div", ' class="img-wrapper">', "</div>"],
1244
1248
  $d66c35b5a6d6d926$var$_tmpl$2 = ["<span", ' class="d-price original">', "</span>"],
1245
- $d66c35b5a6d6d926$var$_tmpl$3 = ["<div", ' class="right-part"><div class="text-container"><span class="d-title line-clamp">', '</span><span class="', '">', "</span><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
1249
+ $d66c35b5a6d6d926$var$_tmpl$3 = ["<div", ' class="right-part"><div class="text-container">', '<span class="', '">', "</span><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
1246
1250
  function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
1247
1251
  let {
1248
1252
  display_: display_,
@@ -1280,6 +1284,10 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
1280
1284
  return (_variantToUse4 = variantToUse()) === null || _variantToUse4 === void 0 ? void 0 : _variantToUse4.page_url;
1281
1285
  });
1282
1286
  const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
1287
+ const title = $3hooq$solidjs.createMemo(() => {
1288
+ var _variantToUse5;
1289
+ return (_variantToUse5 = variantToUse()) === null || _variantToUse5 === void 0 ? void 0 : _variantToUse5.title;
1290
+ });
1283
1291
  return $3hooq$solidjsweb.ssrElement("a", $3hooq$solidjsweb.mergeProps({
1284
1292
  "class": "look-item"
1285
1293
  }, () => enableLink() ? {
@@ -1324,11 +1332,17 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
1324
1332
  return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : userWantsExpanded()) || animationIsRunning();
1325
1333
  },
1326
1334
  get children() {
1327
- var _$escape2, _variantToUse5;
1328
- return $3hooq$solidjsweb.ssr($d66c35b5a6d6d926$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), (_$escape2 = $3hooq$solidjsweb.escape((_variantToUse5 = variantToUse()) === null || _variantToUse5 === void 0 ? void 0 : _variantToUse5.title)) !== null && _$escape2 !== void 0 ? _$escape2 : $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
1329
- height: "1em",
1330
- width: "20ch"
1331
- })), "d-price ".concat(isOnSale() ? "sale" : ""), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
1335
+ return $3hooq$solidjsweb.ssr($d66c35b5a6d6d926$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrElement("span", $3hooq$solidjsweb.mergeProps({
1336
+ "class": "d-title line-clamp"
1337
+ }, () => title() && {
1338
+ title: title()
1339
+ }), () => {
1340
+ var _$escape2;
1341
+ return (_$escape2 = $3hooq$solidjsweb.escape(title())) !== null && _$escape2 !== void 0 ? _$escape2 : $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
1342
+ height: "1em",
1343
+ width: "20ch"
1344
+ }));
1345
+ }, false), "d-price ".concat(isOnSale() ? "sale" : ""), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
1332
1346
  get when() {
1333
1347
  return variantToUse() && !salePrice.loading;
1334
1348
  },
@@ -1734,7 +1748,8 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
1734
1748
  layout_options_: layout_options_,
1735
1749
  title_: title_,
1736
1750
  max_rows_: max_rows_,
1737
- view_more_button_: view_more_button_
1751
+ view_more_button_: view_more_button_,
1752
+ NoResultsFallback_: NoResultsFallback_
1738
1753
  } = _ref;
1739
1754
  const rows_object_ = $3hooq$solidjs.createMemo(() => {
1740
1755
  var _view_more_button$row;
@@ -1800,6 +1815,9 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
1800
1815
  get when() {
1801
1816
  return is_showing_something();
1802
1817
  },
1818
+ get fallback() {
1819
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
1820
+ },
1803
1821
  children: elements
1804
1822
  });
1805
1823
  }
@@ -1869,7 +1887,8 @@ function $e57cd46536ad992e$export$2c9f9bf2092486aa(props) {
1869
1887
  layout_options_: $3hooq$solidjs.createMemo(() => ({
1870
1888
  cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.columnsAtSize_),
1871
1889
  ...grid_spacing_override()
1872
- }))
1890
+ })),
1891
+ NoResultsFallback_: () => props.NoResultsFallback_
1873
1892
  };
1874
1893
  $3hooq$solidjs.createEffect(() => {
1875
1894
  const {
@@ -5763,40 +5782,13 @@ function $0257c760a99bfacb$var$set_range_with_sanitation(min_, max_, current_ran
5763
5782
  new_value[index] = value_as_number;
5764
5783
  current_range_signal[1](new_value);
5765
5784
  }
5766
- var $ac040bdfeed58ee4$var$_tmpl$ = ["<div", ' class="morphing-sign" role="img"', "><span></span><span></span></div>"];
5785
+ var $ac040bdfeed58ee4$var$_tmpl$ = ["<div", ' class="', '" role="img"', "><span></span><span></span></div>"];
5767
5786
  function $ac040bdfeed58ee4$export$e5c2828934226505(_ref) {
5768
5787
  let {
5769
5788
  expanded_: expanded_,
5770
5789
  i18n_: i18n_
5771
5790
  } = _ref;
5772
- let first_span;
5773
- let second_span;
5774
- const animation_options = {
5775
- fill: "forwards",
5776
- duration: 200
5777
- };
5778
- const outer_div = $3hooq$solidjsweb.ssr($ac040bdfeed58ee4$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("aria-label", expanded_() ? $3hooq$solidjsweb.escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $3hooq$solidjsweb.escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
5779
- const [is_in_dom, set_is_in_dom] = $3hooq$solidjs.createSignal(false);
5780
- (0, $3hooq$depictaiutilishared.observer).wait_for_element(outer_div).then($3hooq$depictaiutilishared.catchify(() => set_is_in_dom(true)));
5781
- $3hooq$solidjs.createEffect(() => {
5782
- if (!is_in_dom())
5783
- // wait for us to being in DOM as animations don't work otherwise
5784
- return;
5785
- try {
5786
- const expanded = expanded_();
5787
- for (const span of [first_span, second_span]) span.animate([{
5788
- transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
5789
- }], animation_options);
5790
- const percentage_value = "".concat(expanded ? 50 : 25, "%");
5791
- second_span.animate([{
5792
- left: percentage_value,
5793
- right: percentage_value
5794
- }], animation_options);
5795
- } catch (e) {
5796
- $3hooq$depictaiutilishared.dlog("partial keyframes probably not supported", e);
5797
- }
5798
- });
5799
- return outer_div;
5791
+ return $3hooq$solidjsweb.ssr($ac040bdfeed58ee4$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "morphing-sign ".concat(expanded_() ? "expanded" : ""), $3hooq$solidjsweb.ssrAttribute("aria-label", expanded_() ? $3hooq$solidjsweb.escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $3hooq$solidjsweb.escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
5800
5792
  }
5801
5793
  var $99472afa7112c427$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"];
5802
5794
  const $99472afa7112c427$var$dont_cut_in_between_less_than_characters = 30;
@@ -10875,7 +10867,7 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
10875
10867
  let {
10876
10868
  search_results_: search_results_,
10877
10869
  router_: router_,
10878
- queries_without_content_results_: queries_without_content_results_,
10870
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
10879
10871
  get_search_query_: get_search_query_
10880
10872
  } = _ref;
10881
10873
  const content_results = $3hooq$solidjs.createMemo(() => {
@@ -10894,7 +10886,11 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
10894
10886
  });
10895
10887
  $3hooq$solidjs.createEffect(() => {
10896
10888
  const results = content_results();
10897
- if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($3hooq$solidjs.untrack(get_search_query_));
10889
+ const numberResults = Array.isArray(results) ? results.length : 0;
10890
+ setNumberContentResultsPerQuery_(prev => {
10891
+ prev.set($3hooq$solidjs.untrack(get_search_query_), numberResults);
10892
+ return prev;
10893
+ });
10898
10894
  });
10899
10895
  return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.For), {
10900
10896
  get each() {
@@ -10912,7 +10908,8 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
10912
10908
  function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
10913
10909
  let {
10914
10910
  content_results_rows_: [get_history_state_content_results_rows],
10915
- cols_at_size_: cols_at_size_
10911
+ cols_at_size_: cols_at_size_,
10912
+ overrideAmount_: overrideAmount_
10916
10913
  } = _ref;
10917
10914
  const colsShowingNow = $478e5a09664da64c$export$a79e666719b3647c(cols_at_size_);
10918
10915
  const largest_column = $3hooq$solidjs.createMemo(() => {
@@ -10925,10 +10922,10 @@ function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
10925
10922
  });
10926
10923
  const num_placeholders = $3hooq$solidjs.createMemo(() => {
10927
10924
  var _get_history_state_co;
10928
- return (
10929
- // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
10930
- ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $eab939d0b95b75ee$export$70ceae36059a1036)) * (colsShowingNow() || largest_column())
10931
- );
10925
+ const override = overrideAmount_();
10926
+ if (override !== undefined) return override;
10927
+ // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
10928
+ return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $eab939d0b95b75ee$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
10932
10929
  });
10933
10930
  return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Index), {
10934
10931
  get each() {
@@ -10967,15 +10964,13 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
10967
10964
  number_: num_results,
10968
10965
  i18n_: i18n_
10969
10966
  });
10970
- const queries_without_content_results_ = new (0, $3hooq$depictaiutilishared.ListenableSet)();
10971
- const [check_query, set_check_query] = $3hooq$solidjs.createSignal(false);
10972
- const placeholders_enabled = $3hooq$solidjs.createMemo(() => {
10973
- // don't show placeholders when the user toggles filters
10974
- check_query();
10975
- return !queries_without_content_results_.has(get_search_query_());
10967
+ const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $3hooq$solidjs.createSignal(new Map(), {
10968
+ equals: false
10976
10969
  });
10970
+ const contentResultsForCurrentQuery = $3hooq$solidjs.createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
10971
+ // Don't show placeholder if we know there will not be any content results and someone is just toggling filters
10972
+ const placeholders_enabled = $3hooq$solidjs.createMemo(() => contentResultsForCurrentQuery() !== 0);
10977
10973
  const rows_object = $eab939d0b95b75ee$var$make_state_saved_rows(content_results_rows_, i18n_);
10978
- for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
10979
10974
  return $3hooq$solidjsweb.ssr($eab939d0b95b75ee$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "display:" + (is_loading_() && placeholders_enabled() || ((_content_results2 = content_results()) === null || _content_results2 === void 0 ? void 0 : _content_results2.length) > 0 ? "" : "none"), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $9870a8a48ee126af$export$9dd50d35b9d94fdf), {
10980
10975
  get_search_query_: get_search_query_,
10981
10976
  i18n_: i18n_,
@@ -10998,14 +10993,15 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
10998
10993
  content_results_rows_: content_results_rows_,
10999
10994
  get cols_at_size_() {
11000
10995
  return $3hooq$solidjs.createMemo(() => layout_options_().cols_at_size);
11001
- }
10996
+ },
10997
+ overrideAmount_: contentResultsForCurrentQuery
11002
10998
  });
11003
10999
  },
11004
11000
  get children() {
11005
11001
  return $3hooq$solidjsweb.createComponent((0, $bf4a8d57aa8dd1c8$export$9ff751cd77687edc), {
11006
11002
  router_: router_,
11007
11003
  search_results_: search_results_,
11008
- queries_without_content_results_: queries_without_content_results_,
11004
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
11009
11005
  get_search_query_: get_search_query_
11010
11006
  });
11011
11007
  }
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "4.3.10";
13
+ export const version = "4.3.12";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
@@ -877,6 +877,7 @@ export function LooksSliderOrGrid(props: {
877
877
  FavoriteButton_?: (props: {
878
878
  display_: Accessor<ModernDisplay | null | undefined>;
879
879
  }) => JSX.Element;
880
+ NoResultsFallback_?: () => JSX.Element;
880
881
  displayTransformers_?: DisplayTransformers<ModernDisplay, ModernDisplayWithPageUrl<ModernDisplay>>;
881
882
  /**
882
883
  * If provided, will render as grid instead of slider
@@ -1398,7 +1399,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1398
1399
  * Open the modal with support for alignment.
1399
1400
  * @returns {void}
1400
1401
  */
1401
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1402
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1402
1403
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1403
1404
  export interface PageReplacer {
1404
1405
  readonly render_: () => Node_Array;
@@ -1476,5 +1477,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1476
1477
  content_blocks_by_row?: ContentBlocksByRow;
1477
1478
  layout?: PossibleLayout;
1478
1479
  filterModalParent_?: HTMLElement | ShadowRoot;
1479
- }): import("@depict-ai/utilishared").Node_Array;
1480
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1480
1481
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
@@ -1,4 +1,4 @@
1
- import { add_to_version_info as $b8hua$add_to_version_info, fetch_retry as $b8hua$fetch_retry, base_url as $b8hua$base_url, dwarn as $b8hua$dwarn, slider_fractional_factory as $b8hua$slider_fractional_factory, dlog as $b8hua$dlog, camelCasifyObject as $b8hua$camelCasifyObject, make_random_classname as $b8hua$make_random_classname, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, catchify as $b8hua$catchify, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, report as $b8hua$report, slider_fading_factory as $b8hua$slider_fading_factory, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, observer as $b8hua$observer, javascript_media_query as $b8hua$javascript_media_query, queueMacroTask as $b8hua$queueMacroTask, findMostFrequentItem as $b8hua$findMostFrequentItem, standard_price_format as $b8hua$standard_price_format, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, deparallelize_no_drop as $b8hua$deparallelize_no_drop, ContainedImage as $b8hua$ContainedImage, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, use_href_accessor as $b8hua$use_href_accessor, get_session_id as $b8hua$get_session_id, add_version_query_params as $b8hua$add_version_query_params, useExpandingContainer as $b8hua$useExpandingContainer, hex_to_rgb as $b8hua$hex_to_rgb, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, snakeCasifyObject as $b8hua$snakeCasifyObject, make_url_with_query_params as $b8hua$make_url_with_query_params, sort_obj as $b8hua$sort_obj, ListenableSet as $b8hua$ListenableSet1, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
1
+ import { add_to_version_info as $b8hua$add_to_version_info, fetch_retry as $b8hua$fetch_retry, base_url as $b8hua$base_url, dwarn as $b8hua$dwarn, slider_fractional_factory as $b8hua$slider_fractional_factory, dlog as $b8hua$dlog, camelCasifyObject as $b8hua$camelCasifyObject, make_random_classname as $b8hua$make_random_classname, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, catchify as $b8hua$catchify, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, report as $b8hua$report, slider_fading_factory as $b8hua$slider_fading_factory, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, observer as $b8hua$observer, javascript_media_query as $b8hua$javascript_media_query, queueMacroTask as $b8hua$queueMacroTask, findMostFrequentItem as $b8hua$findMostFrequentItem, standard_price_format as $b8hua$standard_price_format, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, deparallelize_no_drop as $b8hua$deparallelize_no_drop, ContainedImage as $b8hua$ContainedImage, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, use_href_accessor as $b8hua$use_href_accessor, get_session_id as $b8hua$get_session_id, add_version_query_params as $b8hua$add_version_query_params, useExpandingContainer as $b8hua$useExpandingContainer, hex_to_rgb as $b8hua$hex_to_rgb, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, snakeCasifyObject as $b8hua$snakeCasifyObject, make_url_with_query_params as $b8hua$make_url_with_query_params, sort_obj as $b8hua$sort_obj, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
2
2
  import { ssr as $b8hua$ssr, ssrHydrationKey as $b8hua$ssrHydrationKey, escape as $b8hua$escape, ssrStyle as $b8hua$ssrStyle, createComponent as $b8hua$createComponent, mergeProps as $b8hua$mergeProps, isServer as $b8hua$isServer, ssrElement as $b8hua$ssrElement, ssrClassList as $b8hua$ssrClassList, insert as $b8hua$insert, ssrAttribute as $b8hua$ssrAttribute, spread as $b8hua$spread, Dynamic as $b8hua$Dynamic } from "solid-js/web";
3
3
  import { createSignal as $b8hua$createSignal, createMemo as $b8hua$createMemo, createResource as $b8hua$createResource, createEffect as $b8hua$createEffect, Show as $b8hua$Show, mergeProps as $b8hua$mergeProps1, Suspense as $b8hua$Suspense, untrack as $b8hua$untrack, createRenderEffect as $b8hua$createRenderEffect, Index as $b8hua$Index, createRoot as $b8hua$createRoot, onCleanup as $b8hua$onCleanup, For as $b8hua$For, getOwner as $b8hua$getOwner, runWithOwner as $b8hua$runWithOwner, createContext as $b8hua$createContext, useContext as $b8hua$useContext, createUniqueId as $b8hua$createUniqueId, createComputed as $b8hua$createComputed, ErrorBoundary as $b8hua$ErrorBoundary, splitProps as $b8hua$splitProps, on as $b8hua$on, batch as $b8hua$batch, createSelector as $b8hua$createSelector, children as $b8hua$children, createReaction as $b8hua$createReaction, mapArray as $b8hua$mapArray } from "solid-js";
4
4
  import $b8hua$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.10";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.12";
14
14
  const $a9c7ba6087881ac2$var$transform_elements = sorted_cols_at_size => {
15
15
  const cols_at_size = [];
16
16
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -614,7 +614,8 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
614
614
  recommendations_resource_: recommendations_resource_,
615
615
  product_card_template_: product_card_template_,
616
616
  layout_options_: layout_options_,
617
- title_: title_
617
+ title_: title_,
618
+ NoResultsFallback_: NoResultsFallback_
618
619
  } = _ref;
619
620
  const is_showing_something = $b8hua$createMemo(() => {
620
621
  var _recommendations_reso;
@@ -673,6 +674,9 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
673
674
  get when() {
674
675
  return is_showing_something();
675
676
  },
677
+ get fallback() {
678
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
679
+ },
676
680
  children: slider
677
681
  });
678
682
  }
@@ -1152,7 +1156,7 @@ function $60ec7a29849d81db$export$a71e92cfbb498adc(props) {
1152
1156
  }
1153
1157
  var $0c5b1686f971e5e7$var$_tmpl$ = ["<div", ' class="img-wrapper">', "</div>"],
1154
1158
  $0c5b1686f971e5e7$var$_tmpl$2 = ["<span", ' class="d-price original">', "</span>"],
1155
- $0c5b1686f971e5e7$var$_tmpl$3 = ["<div", ' class="right-part"><div class="text-container"><span class="d-title line-clamp">', '</span><span class="', '">', "</span><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
1159
+ $0c5b1686f971e5e7$var$_tmpl$3 = ["<div", ' class="right-part"><div class="text-container">', '<span class="', '">', "</span><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
1156
1160
  function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
1157
1161
  let {
1158
1162
  display_: display_,
@@ -1190,6 +1194,10 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
1190
1194
  return (_variantToUse4 = variantToUse()) === null || _variantToUse4 === void 0 ? void 0 : _variantToUse4.page_url;
1191
1195
  });
1192
1196
  const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
1197
+ const title = $b8hua$createMemo(() => {
1198
+ var _variantToUse5;
1199
+ return (_variantToUse5 = variantToUse()) === null || _variantToUse5 === void 0 ? void 0 : _variantToUse5.title;
1200
+ });
1193
1201
  return $b8hua$ssrElement("a", $b8hua$mergeProps({
1194
1202
  "class": "look-item"
1195
1203
  }, () => enableLink() ? {
@@ -1234,11 +1242,17 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
1234
1242
  return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : userWantsExpanded()) || animationIsRunning();
1235
1243
  },
1236
1244
  get children() {
1237
- var _$escape2, _variantToUse5;
1238
- return $b8hua$ssr($0c5b1686f971e5e7$var$_tmpl$3, $b8hua$ssrHydrationKey(), (_$escape2 = $b8hua$escape((_variantToUse5 = variantToUse()) === null || _variantToUse5 === void 0 ? void 0 : _variantToUse5.title)) !== null && _$escape2 !== void 0 ? _$escape2 : $b8hua$escape($b8hua$createComponent((0, $ceafb6fb91c6f394$export$89c6019e4baa40b1), {
1239
- height: "1em",
1240
- width: "20ch"
1241
- })), "d-price ".concat(isOnSale() ? "sale" : ""), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
1245
+ return $b8hua$ssr($0c5b1686f971e5e7$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$ssrElement("span", $b8hua$mergeProps({
1246
+ "class": "d-title line-clamp"
1247
+ }, () => title() && {
1248
+ title: title()
1249
+ }), () => {
1250
+ var _$escape2;
1251
+ return (_$escape2 = $b8hua$escape(title())) !== null && _$escape2 !== void 0 ? _$escape2 : $b8hua$escape($b8hua$createComponent((0, $ceafb6fb91c6f394$export$89c6019e4baa40b1), {
1252
+ height: "1em",
1253
+ width: "20ch"
1254
+ }));
1255
+ }, false), "d-price ".concat(isOnSale() ? "sale" : ""), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
1242
1256
  get when() {
1243
1257
  return variantToUse() && !salePrice.loading;
1244
1258
  },
@@ -1644,7 +1658,8 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
1644
1658
  layout_options_: layout_options_,
1645
1659
  title_: title_,
1646
1660
  max_rows_: max_rows_,
1647
- view_more_button_: view_more_button_
1661
+ view_more_button_: view_more_button_,
1662
+ NoResultsFallback_: NoResultsFallback_
1648
1663
  } = _ref;
1649
1664
  const rows_object_ = $b8hua$createMemo(() => {
1650
1665
  var _view_more_button$row;
@@ -1710,6 +1725,9 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
1710
1725
  get when() {
1711
1726
  return is_showing_something();
1712
1727
  },
1728
+ get fallback() {
1729
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
1730
+ },
1713
1731
  children: elements
1714
1732
  });
1715
1733
  }
@@ -1779,7 +1797,8 @@ function $bb34cd283e904784$export$2c9f9bf2092486aa(props) {
1779
1797
  layout_options_: $b8hua$createMemo(() => ({
1780
1798
  cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.columnsAtSize_),
1781
1799
  ...grid_spacing_override()
1782
- }))
1800
+ })),
1801
+ NoResultsFallback_: () => props.NoResultsFallback_
1783
1802
  };
1784
1803
  $b8hua$createEffect(() => {
1785
1804
  const {
@@ -5673,40 +5692,13 @@ function $1e7465a8ffa97f6c$var$set_range_with_sanitation(min_, max_, current_ran
5673
5692
  new_value[index] = value_as_number;
5674
5693
  current_range_signal[1](new_value);
5675
5694
  }
5676
- var $457279ff15864cb9$var$_tmpl$ = ["<div", ' class="morphing-sign" role="img"', "><span></span><span></span></div>"];
5695
+ var $457279ff15864cb9$var$_tmpl$ = ["<div", ' class="', '" role="img"', "><span></span><span></span></div>"];
5677
5696
  function $457279ff15864cb9$export$e5c2828934226505(_ref) {
5678
5697
  let {
5679
5698
  expanded_: expanded_,
5680
5699
  i18n_: i18n_
5681
5700
  } = _ref;
5682
- let first_span;
5683
- let second_span;
5684
- const animation_options = {
5685
- fill: "forwards",
5686
- duration: 200
5687
- };
5688
- const outer_div = $b8hua$ssr($457279ff15864cb9$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("aria-label", expanded_() ? $b8hua$escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $b8hua$escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
5689
- const [is_in_dom, set_is_in_dom] = $b8hua$createSignal(false);
5690
- (0, $b8hua$observer).wait_for_element(outer_div).then($b8hua$catchify(() => set_is_in_dom(true)));
5691
- $b8hua$createEffect(() => {
5692
- if (!is_in_dom())
5693
- // wait for us to being in DOM as animations don't work otherwise
5694
- return;
5695
- try {
5696
- const expanded = expanded_();
5697
- for (const span of [first_span, second_span]) span.animate([{
5698
- transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
5699
- }], animation_options);
5700
- const percentage_value = "".concat(expanded ? 50 : 25, "%");
5701
- second_span.animate([{
5702
- left: percentage_value,
5703
- right: percentage_value
5704
- }], animation_options);
5705
- } catch (e) {
5706
- $b8hua$dlog("partial keyframes probably not supported", e);
5707
- }
5708
- });
5709
- return outer_div;
5701
+ return $b8hua$ssr($457279ff15864cb9$var$_tmpl$, $b8hua$ssrHydrationKey(), "morphing-sign ".concat(expanded_() ? "expanded" : ""), $b8hua$ssrAttribute("aria-label", expanded_() ? $b8hua$escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $b8hua$escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
5710
5702
  }
5711
5703
  var $f3a159279dc1a8fb$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"];
5712
5704
  const $f3a159279dc1a8fb$var$dont_cut_in_between_less_than_characters = 30;
@@ -10785,7 +10777,7 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
10785
10777
  let {
10786
10778
  search_results_: search_results_,
10787
10779
  router_: router_,
10788
- queries_without_content_results_: queries_without_content_results_,
10780
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
10789
10781
  get_search_query_: get_search_query_
10790
10782
  } = _ref;
10791
10783
  const content_results = $b8hua$createMemo(() => {
@@ -10804,7 +10796,11 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
10804
10796
  });
10805
10797
  $b8hua$createEffect(() => {
10806
10798
  const results = content_results();
10807
- if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($b8hua$untrack(get_search_query_));
10799
+ const numberResults = Array.isArray(results) ? results.length : 0;
10800
+ setNumberContentResultsPerQuery_(prev => {
10801
+ prev.set($b8hua$untrack(get_search_query_), numberResults);
10802
+ return prev;
10803
+ });
10808
10804
  });
10809
10805
  return $b8hua$createComponent((0, $b8hua$For), {
10810
10806
  get each() {
@@ -10822,7 +10818,8 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
10822
10818
  function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
10823
10819
  let {
10824
10820
  content_results_rows_: [get_history_state_content_results_rows],
10825
- cols_at_size_: cols_at_size_
10821
+ cols_at_size_: cols_at_size_,
10822
+ overrideAmount_: overrideAmount_
10826
10823
  } = _ref;
10827
10824
  const colsShowingNow = $40e2fa435715a1a0$export$a79e666719b3647c(cols_at_size_);
10828
10825
  const largest_column = $b8hua$createMemo(() => {
@@ -10835,10 +10832,10 @@ function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
10835
10832
  });
10836
10833
  const num_placeholders = $b8hua$createMemo(() => {
10837
10834
  var _get_history_state_co;
10838
- return (
10839
- // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
10840
- ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $d53ebed6f63304e4$export$70ceae36059a1036)) * (colsShowingNow() || largest_column())
10841
- );
10835
+ const override = overrideAmount_();
10836
+ if (override !== undefined) return override;
10837
+ // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
10838
+ return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $d53ebed6f63304e4$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
10842
10839
  });
10843
10840
  return $b8hua$createComponent((0, $b8hua$Index), {
10844
10841
  get each() {
@@ -10877,15 +10874,13 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
10877
10874
  number_: num_results,
10878
10875
  i18n_: i18n_
10879
10876
  });
10880
- const queries_without_content_results_ = new (0, $b8hua$ListenableSet1)();
10881
- const [check_query, set_check_query] = $b8hua$createSignal(false);
10882
- const placeholders_enabled = $b8hua$createMemo(() => {
10883
- // don't show placeholders when the user toggles filters
10884
- check_query();
10885
- return !queries_without_content_results_.has(get_search_query_());
10877
+ const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $b8hua$createSignal(new Map(), {
10878
+ equals: false
10886
10879
  });
10880
+ const contentResultsForCurrentQuery = $b8hua$createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
10881
+ // Don't show placeholder if we know there will not be any content results and someone is just toggling filters
10882
+ const placeholders_enabled = $b8hua$createMemo(() => contentResultsForCurrentQuery() !== 0);
10887
10883
  const rows_object = $d53ebed6f63304e4$var$make_state_saved_rows(content_results_rows_, i18n_);
10888
- for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
10889
10884
  return $b8hua$ssr($d53ebed6f63304e4$var$_tmpl$, $b8hua$ssrHydrationKey(), "display:" + (is_loading_() && placeholders_enabled() || ((_content_results2 = content_results()) === null || _content_results2 === void 0 ? void 0 : _content_results2.length) > 0 ? "" : "none"), $b8hua$escape($b8hua$createComponent((0, $69602b3d8fd54c38$export$9dd50d35b9d94fdf), {
10890
10885
  get_search_query_: get_search_query_,
10891
10886
  i18n_: i18n_,
@@ -10908,14 +10903,15 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
10908
10903
  content_results_rows_: content_results_rows_,
10909
10904
  get cols_at_size_() {
10910
10905
  return $b8hua$createMemo(() => layout_options_().cols_at_size);
10911
- }
10906
+ },
10907
+ overrideAmount_: contentResultsForCurrentQuery
10912
10908
  });
10913
10909
  },
10914
10910
  get children() {
10915
10911
  return $b8hua$createComponent((0, $881e8953a9103f10$export$9ff751cd77687edc), {
10916
10912
  router_: router_,
10917
10913
  search_results_: search_results_,
10918
- queries_without_content_results_: queries_without_content_results_,
10914
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
10919
10915
  get_search_query_: get_search_query_
10920
10916
  });
10921
10917
  }