@depict-ai/ui 2.1.11 → 2.1.13

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.
@@ -1,6 +1,6 @@
1
1
  import { add_to_version_info as $b8hua$add_to_version_info, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, dlog as $b8hua$dlog, queueMacroTask as $b8hua$queueMacroTask, catchify as $b8hua$catchify, is_safari as $b8hua$is_safari, observer as $b8hua$observer, dwarn as $b8hua$dwarn, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, slider_fading_factory as $b8hua$slider_fading_factory, slider_fractional_factory as $b8hua$slider_fractional_factory, camelCasifyObject as $b8hua$camelCasifyObject, make_random_classname as $b8hua$make_random_classname, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, 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, useExpandingContainer as $b8hua$useExpandingContainer, standard_price_format as $b8hua$standard_price_format, hex_to_rgb as $b8hua$hex_to_rgb, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, fetch_recs as $b8hua$fetch_recs, snakeCasifyObject as $b8hua$snakeCasifyObject, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, base_url as $b8hua$base_url, get_depict_id as $b8hua$get_depict_id, get_user_id as $b8hua$get_user_id, get_session_id as $b8hua$get_session_id, make_url_with_query_params as $b8hua$make_url_with_query_params, fetch_retry as $b8hua$fetch_retry, add_version_query_params as $b8hua$add_version_query_params, sort_obj as $b8hua$sort_obj, edit_current_page_meta_tags as $b8hua$edit_current_page_meta_tags, javascript_media_query as $b8hua$javascript_media_query, use_href_accessor as $b8hua$use_href_accessor, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, ContainedImage as $b8hua$ContainedImage, deparallelize_no_drop as $b8hua$deparallelize_no_drop, ListenableSet as $b8hua$ListenableSet, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
2
2
  import { createComponent as $b8hua$createComponent, insert as $b8hua$insert, ssr as $b8hua$ssr, ssrHydrationKey as $b8hua$ssrHydrationKey, ssrStyle as $b8hua$ssrStyle, spread as $b8hua$spread, escape as $b8hua$escape, ssrAttribute as $b8hua$ssrAttribute, mergeProps as $b8hua$mergeProps1, isServer as $b8hua$isServer, ssrElement as $b8hua$ssrElement, ssrClassList as $b8hua$ssrClassList, Dynamic as $b8hua$Dynamic } from "solid-js/web";
3
- import { createSignal as $b8hua$createSignal, getOwner as $b8hua$getOwner, createEffect as $b8hua$createEffect, runWithOwner as $b8hua$runWithOwner, onCleanup as $b8hua$onCleanup, createMemo as $b8hua$createMemo, createContext as $b8hua$createContext, useContext as $b8hua$useContext, mergeProps as $b8hua$mergeProps, Show as $b8hua$Show, createResource as $b8hua$createResource, Suspense as $b8hua$Suspense, untrack as $b8hua$untrack, createRenderEffect as $b8hua$createRenderEffect, Index as $b8hua$Index, createRoot as $b8hua$createRoot, For as $b8hua$For, createUniqueId as $b8hua$createUniqueId, createComputed as $b8hua$createComputed, ErrorBoundary as $b8hua$ErrorBoundary, on as $b8hua$on, batch as $b8hua$batch, createReaction as $b8hua$createReaction, mapArray as $b8hua$mapArray } from "solid-js";
3
+ import { createSignal as $b8hua$createSignal, getOwner as $b8hua$getOwner, createEffect as $b8hua$createEffect, runWithOwner as $b8hua$runWithOwner, onCleanup as $b8hua$onCleanup, createMemo as $b8hua$createMemo, createContext as $b8hua$createContext, useContext as $b8hua$useContext, mergeProps as $b8hua$mergeProps, Show as $b8hua$Show, createResource as $b8hua$createResource, Suspense as $b8hua$Suspense, untrack as $b8hua$untrack, createRenderEffect as $b8hua$createRenderEffect, Index as $b8hua$Index, createRoot as $b8hua$createRoot, For as $b8hua$For, createUniqueId as $b8hua$createUniqueId, createComputed as $b8hua$createComputed, ErrorBoundary as $b8hua$ErrorBoundary, batch as $b8hua$batch, on as $b8hua$on, createReaction as $b8hua$createReaction, mapArray as $b8hua$mapArray } from "solid-js";
4
4
  import $b8hua$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
5
5
  import $b8hua$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet";
6
6
  import $b8hua$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
@@ -9,7 +9,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
9
9
  /*! Depict.ai search and product listing SDK */
10
10
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
11
11
  register_es_version("ui", "ES10");
12
- const $8db9a15135765c11$export$83d89fbfd8236492 = "2.1.11";
12
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "2.1.13";
13
13
  const $2855bffe06ef7a03$var$fallback_operator = "in";
14
14
  const $2855bffe06ef7a03$var$fallback_token = "";
15
15
  const $2855bffe06ef7a03$var$legacy_filter_prefix = "filter_";
@@ -439,13 +439,13 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
439
439
 
440
440
  /** @jsxImportSource solid-js */
441
441
 
442
- function $0dc044cffe1e825b$export$9f191182275e9ef(what_to_watch) {
443
- const [size, setSize] = $b8hua$createSignal();
442
+ function $fc830a7ee59416ef$export$ebdc3711f7e02ccd(what_to_watch) {
443
+ const [width, setWidth] = $b8hua$createSignal();
444
444
  const resizeObserver = new ResizeObserver($b8hua$catchify(records => {
445
445
  for (let j = 0; j < records.length; j++) {
446
446
  var _records$j$borderBoxS, _records$j$borderBoxS2, _records$j$borderBoxS3;
447
447
  const width = (_records$j$borderBoxS = (_records$j$borderBoxS2 = records[j].borderBoxSize) === null || _records$j$borderBoxS2 === void 0 ? void 0 : (_records$j$borderBoxS3 = _records$j$borderBoxS2[0]) === null || _records$j$borderBoxS3 === void 0 ? void 0 : _records$j$borderBoxS3.inlineSize) !== null && _records$j$borderBoxS !== void 0 ? _records$j$borderBoxS : what_to_watch.getBoundingClientRect().width;
448
- setSize(width);
448
+ setWidth(width);
449
449
  }
450
450
  }));
451
451
  // If we start observing elements before they're in the DOM Chrome (Version 117.0.5938.92 (Official Build) (arm64)) sometimes gives us a resize event with a width of 0 and then doesn't dispatch one with the actual width once it's in the DOM. So we wait until the element is in the DOM before we start observing it.
@@ -454,13 +454,19 @@ function $0dc044cffe1e825b$export$9f191182275e9ef(what_to_watch) {
454
454
  let {
455
455
  element: element
456
456
  } = _ref;
457
- return requestAnimationFrame($b8hua$catchify(() => resizeObserver.observe(element)));
457
+ return requestAnimationFrame($b8hua$catchify(() => {
458
+ const current_size = what_to_watch.getBoundingClientRect().width;
459
+ if (current_size)
460
+ // If element has size, set signal to that. ResizeObserver only triggers when the content is visible in some cases, but it might already have a size. This reduces size filter expanding animation jank in chrome.
461
+ setWidth(current_size);
462
+ resizeObserver.observe(element);
463
+ }));
458
464
  });
459
465
  $b8hua$onCleanup(() => {
460
466
  resizeObserver.disconnect();
461
467
  disconnect();
462
468
  });
463
- return size;
469
+ return width;
464
470
  }
465
471
  const $a9c7ba6087881ac2$var$transform_elements = sorted_cols_at_size => {
466
472
  const cols_at_size = [];
@@ -761,11 +767,11 @@ class $f3b7124b76123e44$export$aa14a9f43128f61f extends $f3b7124b76123e44$export
761
767
  });
762
768
  }
763
769
  }
764
- const $74777e8fe65b3dcb$var$_tmpl$ = ["<div", ' class="', '">', "</div>"];
770
+ const $74777e8fe65b3dcb$var$_tmpl$ = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
765
771
  function $74777e8fe65b3dcb$export$b69d0d92862de18b(props) {
766
772
  return $b8hua$ErrorBoundary({
767
773
  fallback(err, retry) {
768
- var _props$on_error_, _props$class_list_;
774
+ var _props$class_list_, _props$on_error_;
769
775
  const {
770
776
  message_: message_,
771
777
  severity_: severity_
@@ -775,8 +781,7 @@ function $74777e8fe65b3dcb$export$b69d0d92862de18b(props) {
775
781
  console.error(err.cause);
776
782
  message = "".concat(message, ": ").concat(err.message);
777
783
  } else $b8hua$report([err, message_], severity_);
778
- (_props$on_error_ = props.on_error_) === null || _props$on_error_ === void 0 || _props$on_error_.call(props, retry);
779
- return $b8hua$ssr($74777e8fe65b3dcb$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$ssrClassList(Object.fromEntries(((_props$class_list_ = props.class_list_) === null || _props$class_list_ === void 0 ? void 0 : _props$class_list_.map(c => [c, true])) || [])), $b8hua$escape(message));
784
+ return $b8hua$ssr($74777e8fe65b3dcb$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$ssrClassList(Object.fromEntries(((_props$class_list_ = props.class_list_) === null || _props$class_list_ === void 0 ? void 0 : _props$class_list_.map(c => [c, true])) || [])), $b8hua$escape(message), $b8hua$escape((_props$on_error_ = props.on_error_) === null || _props$on_error_ === void 0 ? void 0 : _props$on_error_.call(props, retry)));
780
785
  },
781
786
  get children() {
782
787
  return props.children;
@@ -1258,12 +1263,12 @@ function $60ec7a29849d81db$export$a71e92cfbb498adc(props) {
1258
1263
  const $9783d437ad61594c$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>';
1259
1264
  function $9783d437ad61594c$export$3b621d86b1566b2() {
1260
1265
  let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1261
- return $b8hua$ssrElement("svg", $b8hua$mergeProps1(props, {
1266
+ return $b8hua$ssrElement("svg", $b8hua$mergeProps1({
1262
1267
  xmlns: "http://www.w3.org/2000/svg",
1263
1268
  width: "21.064",
1264
1269
  height: "21.047",
1265
1270
  viewBox: "0 0 21.064 21.064"
1266
- }), () => $b8hua$ssr($9783d437ad61594c$var$_tmpl$), true);
1271
+ }, props), () => $b8hua$ssr($9783d437ad61594c$var$_tmpl$), true);
1267
1272
  }
1268
1273
 
1269
1274
  /**
@@ -1491,7 +1496,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
1491
1496
  const $19e828709c7723a0$var$_tmpl$ = ["<span", ' class="count">', "</span>"],
1492
1497
  $19e828709c7723a0$var$_tmpl$2 = ["<label", ' class="', '"', '><div class="left"><input type="checkbox"', "", "", '><span class="custom-indicator"></span><span class="text line-clamp">', "</span></div><!--$-->", "<!--/--></label>"];
1493
1498
  const $19e828709c7723a0$export$48513f6b9f8ce62d = props => {
1494
- // It seems like there's no diffing without memos here (since we often just have computations in the getters above that update to the same result often because their dependencies change with unrelated changes often), so put memos here to avoid unneeded DOM changes
1499
+ /* don't destructure props, it could have reactive getters */ // It seems like there's no diffing without memos here (since we often just have computations in the getters above that update to the same result often because their dependencies change with unrelated changes often), so put memos here to avoid unneeded DOM changes
1495
1500
  const count = $b8hua$createMemo(() => props.count_);
1496
1501
  const label = $b8hua$createMemo(() => props.label_);
1497
1502
  const checked = $b8hua$createMemo(() => props.checked_);
@@ -1524,6 +1529,60 @@ function $3e850b2f2cca761f$export$ca21a16d65b3dd8(_ref) {
1524
1529
  } = _ref;
1525
1530
  return $b8hua$ssr($3e850b2f2cca761f$var$_tmpl$, $b8hua$ssrHydrationKey(), "expand-filter ".concat(get_show_extras() ? "expanded" : ""), $b8hua$escape($b8hua$createComponent((0, $ff3225aef892a467$export$f21ab0717a89c77f), {})), get_show_extras() ? $b8hua$escape(i18n_.view_less_()) : $b8hua$escape(i18n_.view_more_()));
1526
1531
  }
1532
+ const $02b6641aa50ce528$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"],
1533
+ $02b6641aa50ce528$var$_tmpl$2 = ["<span", ' class="', '"', ">", "</span>"];
1534
+ function $02b6641aa50ce528$export$ba17c5b7e6dda39f(_ref) {
1535
+ let {
1536
+ whole_text_to_display_: whole_text_to_display_memo,
1537
+ searching_for_value_: searching_for_value_memo,
1538
+ class_: class_
1539
+ } = _ref;
1540
+ const [get_has_highlighted, set_has_highlighted] = $b8hua$createSignal(false);
1541
+ const text_itself = $b8hua$createMemo(() => $b8hua$batch(() => {
1542
+ set_has_highlighted(false);
1543
+ const searching_for_value = searching_for_value_memo();
1544
+ const whole_text_to_display_ = whole_text_to_display_memo();
1545
+ let for_black = "";
1546
+ let pushed_grey = false;
1547
+ const search_q = searching_for_value;
1548
+ if (!search_q) return whole_text_to_display_;
1549
+ const output = [];
1550
+ const searching_for = search_q.toLowerCase();
1551
+ const push_black = () => {
1552
+ if (for_black) {
1553
+ set_has_highlighted(true);
1554
+ output.push($b8hua$ssr($02b6641aa50ce528$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape(for_black))); // "black"
1555
+ for_black = "";
1556
+ }
1557
+ };
1558
+ for (let i = 0; i < whole_text_to_display_.length;) {
1559
+ let is_whole_word = true;
1560
+ let searching_for_but_with_texts_casing = "";
1561
+ const i_at_start = i;
1562
+ for (let j = 0; j < searching_for.length; i++, j++) {
1563
+ const letter_in_suggestion = whole_text_to_display_[i];
1564
+ if ((letter_in_suggestion === null || letter_in_suggestion === void 0 ? void 0 : letter_in_suggestion.toLowerCase()) !== searching_for[j]) {
1565
+ is_whole_word = false;
1566
+ i = i_at_start;
1567
+ break;
1568
+ }
1569
+ searching_for_but_with_texts_casing += letter_in_suggestion;
1570
+ }
1571
+ if (is_whole_word) {
1572
+ push_black();
1573
+ output.push(searching_for_but_with_texts_casing);
1574
+ pushed_grey = true;
1575
+ } else for_black += whole_text_to_display_[i++];
1576
+ }
1577
+ push_black();
1578
+ if (!pushed_grey) {
1579
+ set_has_highlighted(false);
1580
+ return whole_text_to_display_;
1581
+ }
1582
+ return output;
1583
+ }));
1584
+ return $b8hua$ssr($02b6641aa50ce528$var$_tmpl$2, $b8hua$ssrHydrationKey(), "".concat($b8hua$escape(class_, true) || "", " ").concat(get_has_highlighted() ? "has-match" : ""), $b8hua$ssrAttribute("title", $b8hua$escape(whole_text_to_display_memo(), true), false), $b8hua$escape(text_itself()));
1585
+ }
1527
1586
  const $133484ef10e4e954$var$_tmpl$ = ["<form", ' class="checkboxes"><!--$-->', "<!--/--><!--$-->", "<!--/--></form>"];
1528
1587
  const $133484ef10e4e954$var$max_visible_without_collapsing = 15;
1529
1588
  const $133484ef10e4e954$var$show_non_collapsible_when_collapsed = 4;
@@ -1532,7 +1591,8 @@ function $133484ef10e4e954$export$dd948f91abc3a1c4(_ref) {
1532
1591
  filter_: filter_,
1533
1592
  selected_filters_: [get_selected_filters, set_selected_filters],
1534
1593
  i18n_: i18n_,
1535
- view_more_button_below_group_: [, set_view_more_button_below_group_]
1594
+ view_more_button_below_group_: [, set_view_more_button_below_group_],
1595
+ filter_query_: filter_query_
1536
1596
  } = _ref;
1537
1597
  const existing_filter = $b8hua$createMemo(() => {
1538
1598
  const {
@@ -1567,12 +1627,18 @@ function $133484ef10e4e954$export$dd948f91abc3a1c4(_ref) {
1567
1627
  const value = $af5d8e0b7d97a7f6$export$325f75597868c4f0(checkbox().value_);
1568
1628
  return !!(data !== null && data !== void 0 && data.some(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === value));
1569
1629
  });
1630
+ const value = $b8hua$createMemo(() => checkbox().value_);
1570
1631
  return $b8hua$createComponent((0, $19e828709c7723a0$export$48513f6b9f8ce62d), {
1571
1632
  get value_() {
1572
- return checkbox().value_;
1633
+ return value();
1573
1634
  },
1574
1635
  get label_() {
1575
- return checkbox().name_;
1636
+ return $b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
1637
+ get whole_text_to_display_() {
1638
+ return $b8hua$createMemo(() => checkbox().name_ || value());
1639
+ },
1640
+ searching_for_value_: () => filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_()
1641
+ });
1576
1642
  },
1577
1643
  get count_() {
1578
1644
  return checkbox().count_;
@@ -1635,7 +1701,8 @@ const $b54fc842e721c9eb$var$_tmpl$ = ["<form", ' class="radios">', "</form>"],
1635
1701
  function $b54fc842e721c9eb$export$430444115f70a734(_ref) {
1636
1702
  let {
1637
1703
  selected_filters_: selected_filters_,
1638
- filter_: filter_
1704
+ filter_: filter_,
1705
+ filter_query_: filter_query_
1639
1706
  } = _ref;
1640
1707
  const radio_name = $b8hua$make_random_classname();
1641
1708
  const existing_filter = $b8hua$createMemo(() => {
@@ -1661,19 +1728,23 @@ function $b54fc842e721c9eb$export$430444115f70a734(_ref) {
1661
1728
  var _counts;
1662
1729
  return (_counts = filter_().meta.counts) === null || _counts === void 0 ? void 0 : _counts[index];
1663
1730
  });
1731
+ const label = $b8hua$createMemo(() => {
1732
+ var _filter_$meta, _filter_$meta$names;
1733
+ const name = (_filter_$meta = filter_().meta) === null || _filter_$meta === void 0 ? void 0 : (_filter_$meta$names = _filter_$meta.names) === null || _filter_$meta$names === void 0 ? void 0 : _filter_$meta$names[index];
1734
+ if (name) return name;
1735
+ const v = value();
1736
+ return Array.isArray(v) ? v.join(" - ") : v + "";
1737
+ });
1664
1738
  return $b8hua$ssr($b54fc842e721c9eb$var$_tmpl$3, $b8hua$ssrHydrationKey(), "input-row ".concat(count() === 0 ? "count-0" : ""), $b8hua$ssrAttribute("for", $b8hua$escape(random_selector, true), false), $b8hua$ssrAttribute("id", $b8hua$escape(random_selector, true), false) + $b8hua$ssrAttribute("name", $b8hua$escape(radio_name, true), false), $b8hua$ssrAttribute("checked", $b8hua$createMemo(() => {
1665
1739
  var _existing_filter;
1666
1740
  const v = value();
1667
1741
  const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
1668
1742
  if ($af5d8e0b7d97a7f6$export$325f75597868c4f0(data) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(v)) return true;
1669
1743
  return Array.isArray(data) && data.every((item, index) => item === v[index]);
1670
- })(), true), $b8hua$escape($b8hua$createMemo(() => {
1671
- var _filter_$meta, _filter_$meta$names;
1672
- const name = (_filter_$meta = filter_().meta) === null || _filter_$meta === void 0 ? void 0 : (_filter_$meta$names = _filter_$meta.names) === null || _filter_$meta$names === void 0 ? void 0 : _filter_$meta$names[index];
1673
- if (name) return name;
1674
- const v = value();
1675
- return Array.isArray(v) ? v.join(" - ") : v;
1676
- })()), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
1744
+ })(), true), $b8hua$escape($b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
1745
+ whole_text_to_display_: label,
1746
+ searching_for_value_: () => filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_()
1747
+ })), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
1677
1748
  get when() {
1678
1749
  return count() != undefined;
1679
1750
  },
@@ -1691,7 +1762,8 @@ function $1e7465a8ffa97f6c$export$e0d834a0ad870cda(_ref) {
1691
1762
  let {
1692
1763
  filter_: filter_,
1693
1764
  selected_filters_: selected_filters_,
1694
- i18n_: i18n_
1765
+ i18n_: i18n_,
1766
+ filter_query_: filter_query_
1695
1767
  } = _ref;
1696
1768
  // If you ever attempt to implement that one can drag one range "knob" over the other like on prisjakt, see https://gitlab.com/depict-ai/depict.ai/-/merge_requests/8458/diffs?commit_id=c52dbdd15ca073489bee138b15d27bb6bf2992df
1697
1769
  // The issue with it is that one wants to discard the changes to the lower value as soon as the lower value has become the upper value when dragging the initially lower knob over the initially upper knob
@@ -1922,158 +1994,422 @@ function $457279ff15864cb9$export$e5c2828934226505(_ref) {
1922
1994
  });
1923
1995
  return outer_div;
1924
1996
  }
1925
- const $0ae614c5c7babb43$var$_tmpl$ = ["<form", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></form>"],
1926
- $0ae614c5c7babb43$var$_tmpl$2 = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
1927
- $0ae614c5c7babb43$var$_tmpl$3 = ["<details", "></details>"],
1928
- $0ae614c5c7babb43$var$_tmpl$4 = ["<summary", ' class="category-parent"><div class="summary"><span class="', '">', "</span><!--$-->", "<!--/--></div></summary>"];
1929
- const $0ae614c5c7babb43$var$max_visible_without_collapsing = 15;
1930
- const $0ae614c5c7babb43$var$show_non_collapsible_when_collapsed = 4;
1931
- function $0ae614c5c7babb43$export$a32086fa6616eafd(_ref) {
1997
+ const $f3a159279dc1a8fb$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"];
1998
+ const $f3a159279dc1a8fb$var$dont_cut_in_between_less_than_characters = 30;
1999
+ function $f3a159279dc1a8fb$export$e1a98a189fd2c0e7(_ref) {
1932
2000
  let {
1933
- filter_: filter_,
1934
- selected_filters_: selected_filters_,
1935
- i18n_: i18n_,
1936
- view_more_button_below_group_: view_more_button_below_group_,
1937
- expanded_hierarchical_filters_: expanded_hierarchical_filters_
2001
+ content_result_: content_result_,
2002
+ key_: key_,
2003
+ cut_when_possible_: cut_when_possible_
1938
2004
  } = _ref;
1939
- let form;
1940
- const existing_filter = $b8hua$createMemo(() => {
1941
- const {
1942
- field: field,
1943
- op: op
1944
- } = filter_();
1945
- return selected_filters_[0]().find(_ref2 => {
1946
- let {
1947
- field: checking_field,
1948
- op: checking_op
1949
- } = _ref2;
1950
- return checking_field === field && checking_op === op;
1951
- });
1952
- });
1953
- const show_extras = $b8hua$createSignal(false);
1954
- const trigger_sync_ = $0ae614c5c7babb43$var$batching_filter_state_syncer({
1955
- filter_: filter_,
1956
- existing_filter_: existing_filter,
1957
- selected_filters_: selected_filters_,
1958
- get category_structure_() {
1959
- return structured_categories();
1960
- }
1961
- });
1962
- const structured_categories = $b8hua$createMemo(() => {
1963
- const execute_when_structure_finished = [];
1964
- const {
1965
- values: values,
1966
- names: names,
1967
- counts: counts
1968
- } = filter_().meta;
1969
- const data_structure = {};
1970
- for (let i = 0; i < values.length; i++) {
1971
- const value = values[i];
1972
- let pointer = data_structure;
1973
- let parent_ = {};
1974
- let created_an_object = false;
1975
- for (let j = 0; j < value.length; j++) {
1976
- var _pointer;
1977
- const this_categories_name = value[j];
1978
- const obj = (_pointer = pointer)[this_categories_name] || (_pointer[this_categories_name] = (() => {
1979
- const value_as_string = value.map(v => typeof v === "number" ? v + "" : v); // don't think backend will ever send numbers but technically it's allowed;
1980
- const created_obj = {
1981
- name_: names[i],
1982
- count_: counts === null || counts === void 0 ? void 0 : counts[i],
1983
- parent_: parent_,
1984
- is_expanded_: $0ae614c5c7babb43$var$make_expanded_signal({
1985
- expanded_hierarchical_filters_: expanded_hierarchical_filters_,
1986
- filter_value_: value_as_string
1987
- }),
1988
- value_: value_as_string,
1989
- children_: {}
1990
- };
1991
- const {
1992
- signal_: signal_,
1993
- on_structure_complete_: on_structure_complete_
1994
- } = $0ae614c5c7babb43$var$create_updating_signal({
1995
- self_: created_obj,
1996
- existing_filter_: $b8hua$untrack(existing_filter),
1997
- trigger_sync_: trigger_sync_
1998
- });
1999
- execute_when_structure_finished.push(on_structure_complete_);
2000
- created_obj.is_checked_ = signal_;
2001
- parent_ = created_obj;
2002
- created_an_object = true;
2003
- return created_obj;
2004
- })());
2005
- pointer = obj.children_;
2006
- parent_ = obj;
2007
- }
2008
- if (!created_an_object && "value_" in parent_) {
2009
- // if an object was created for our "depth" in the hierarchy but not for our specific entry this means that the entry array was unsorted and looked something like
2010
- // [
2011
- // ["Öl", "IPA"],
2012
- // ["Öl", "Pale Ale"],
2013
- // ["Öl", "Ale"],
2014
- // ["Öl", "Mörk Lager"],
2015
- // ["Öl", "Suröl"],
2016
- // ["Öl", "Veteöl"],
2017
- // ["Öl", "Stout och Porter"],
2018
- // ["Öl"], // <- We are here, our `hierarchical_data_structure[string]`-object was created when we iterated over ["Öl", "IPA"]
2019
- // ["Öl", "Ljus Lager"],
2020
- // ];
2021
- // In this case we want to just correct the name and value of the already created object, which will be in parent_
2022
- parent_.value_ = value.map(v => v + "");
2023
- parent_.name_ = names[i];
2024
- parent_.count_ = counts[i];
2025
- parent_.is_expanded_ = $0ae614c5c7babb43$var$make_expanded_signal({
2026
- expanded_hierarchical_filters_: expanded_hierarchical_filters_,
2027
- filter_value_: parent_.value_
2028
- });
2029
- }
2030
- }
2031
- while (execute_when_structure_finished.length) execute_when_structure_finished.pop()();
2032
- $0ae614c5c7babb43$var$expand_until_choice(data_structure);
2033
- $b8hua$dlog("CheckboxHierarchicalFilter: Recomputed structured_categories", data_structure);
2034
- return data_structure;
2005
+ const matched_tokens = $b8hua$createMemo(() => {
2006
+ var _content_result_$high, _content_result_$high2;
2007
+ return (_content_result_$high = content_result_().highlights) === null || _content_result_$high === void 0 ? void 0 : (_content_result_$high2 = _content_result_$high.find(highlight => highlight.field == key_)) === null || _content_result_$high2 === void 0 ? void 0 : _content_result_$high2.matched_tokens;
2035
2008
  });
2036
- const some_top_level_are_hidden = $b8hua$createMemo(() => Object.keys(structured_categories()).length > $0ae614c5c7babb43$var$max_visible_without_collapsing);
2037
- const {
2038
- expand: expand,
2039
- collapse: collapse,
2040
- ExpandingContainer: ExpandingContainer
2041
- } = $8e8b179489080711$export$5bad61ecde080b1f({
2042
- duration: 200
2009
+ const full_value = $b8hua$createMemo(() => {
2010
+ var _content_result_$key_;
2011
+ return (_content_result_$key_ = content_result_()[key_]) === null || _content_result_$key_ === void 0 ? void 0 : _content_result_$key_.replaceAll("\n", " ");
2043
2012
  });
2044
- const expanding_container_els = $b8hua$createComponent(ExpandingContainer, {
2013
+ return $b8hua$createComponent((0, $b8hua$Show), {
2014
+ get when() {
2015
+ var _matched_tokens;
2016
+ return (_matched_tokens = matched_tokens()) === null || _matched_tokens === void 0 ? void 0 : _matched_tokens.length;
2017
+ },
2018
+ get fallback() {
2019
+ return full_value();
2020
+ },
2045
2021
  get children() {
2046
- return $b8hua$createComponent((0, $b8hua$Show), {
2047
- get when() {
2048
- return some_top_level_are_hidden();
2049
- },
2050
- get children() {
2051
- return $0ae614c5c7babb43$var$render_stuff($b8hua$createMemo(() => Object.fromEntries(Object.entries(structured_categories()).slice($0ae614c5c7babb43$var$show_non_collapsible_when_collapsed))), existing_filter, i18n_);
2052
- }
2053
- });
2022
+ return (() => {
2023
+ const segmented_cut_text = $b8hua$createMemo(() => {
2024
+ const segmented_text = $f3a159279dc1a8fb$export$1b00d74faf266c56(full_value(), matched_tokens());
2025
+ if (cut_when_possible_) $f3a159279dc1a8fb$var$cut_text(segmented_text);
2026
+ return segmented_text;
2027
+ });
2028
+ return $b8hua$createComponent((0, $b8hua$Index), {
2029
+ get each() {
2030
+ return segmented_cut_text();
2031
+ },
2032
+ children: item => {
2033
+ return $b8hua$createComponent((0, $b8hua$Show), {
2034
+ get when() {
2035
+ return item().highlighted_;
2036
+ },
2037
+ get fallback() {
2038
+ return item().text_;
2039
+ },
2040
+ get children() {
2041
+ return $b8hua$ssr($f3a159279dc1a8fb$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape(item().text_));
2042
+ }
2043
+ });
2044
+ }
2045
+ });
2046
+ })();
2054
2047
  }
2055
2048
  });
2056
- $b8hua$createRenderEffect(() => {
2057
- view_more_button_below_group_[1](some_top_level_are_hidden() ? $b8hua$createComponent((0, $3e850b2f2cca761f$export$ca21a16d65b3dd8), {
2058
- show_extras_: show_extras,
2059
- i18n_: i18n_
2060
- }) : []);
2061
- });
2062
- $b8hua$createEffect($b8hua$catchify(async () => {
2063
- if (!some_top_level_are_hidden()) {
2064
- await collapse();
2065
- return;
2066
- }
2067
- if (show_extras[0]()) await expand();else await collapse();
2068
- }));
2069
- return $b8hua$ssr($0ae614c5c7babb43$var$_tmpl$, $b8hua$ssrHydrationKey(), "checkboxes hierarchical ".concat(Object.values(structured_categories()).some(category => Object.keys(category.children_).length) ? "any-expandable" : ""), $b8hua$escape($0ae614c5c7babb43$var$render_stuff($b8hua$createMemo(() => some_top_level_are_hidden() ? Object.fromEntries(Object.entries(structured_categories()).slice(0, $0ae614c5c7babb43$var$show_non_collapsible_when_collapsed)) : structured_categories()), existing_filter, i18n_)), $b8hua$escape(expanding_container_els));
2070
2049
  }
2071
- function $0ae614c5c7babb43$var$render_stuff(data, existing_filter, i18n_) {
2072
- const keys = $b8hua$createMemo(() => Object.keys(data()));
2073
- return $b8hua$createComponent((0, $b8hua$For), {
2074
- get each() {
2075
- return keys();
2076
- },
2050
+ function $f3a159279dc1a8fb$var$cut_text(segmented_text) {
2051
+ // cut away chunks of text that are not highlighted to give a google-like overview of the content
2052
+ const highlighted_segments = segmented_text === null || segmented_text === void 0 ? void 0 : segmented_text.filter(segment => segment.highlighted_);
2053
+ if (!segmented_text || !(highlighted_segments !== null && highlighted_segments !== void 0 && highlighted_segments.length)) return;
2054
+ // We have one or more highlighted segments
2055
+ if (highlighted_segments.length === 1) {
2056
+ // cut away from the left until the start of the highlighted sentence if just one sentence is highlighted
2057
+ $f3a159279dc1a8fb$var$cut_start(segmented_text.indexOf(highlighted_segments[0]), segmented_text);
2058
+ return;
2059
+ }
2060
+ // We have two or more highlighted segments, take the two biggest chunks and show them + a bit text around
2061
+ const sorted_highlighted_segments = [...highlighted_segments].sort((a, b) => b.text_.trim().length - a.text_.trim().length // trim to avoid unfair comparisons due to whitespace
2062
+ );
2063
+
2064
+ const [longest_segment, next_longest_segment] = sorted_highlighted_segments;
2065
+ // We need to cut before the first segment - possibly through other segments - and maybe between segments
2066
+ let [index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
2067
+ $f3a159279dc1a8fb$var$cut_start(index_of_first_segment, segmented_text);
2068
+ // update indexes since we might have removed segments
2069
+ [index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
2070
+ let number_of_characters_between_segments = 0;
2071
+ for (let i = index_of_first_segment + 1; i < index_of_second_segment; i++) {
2072
+ const segment = segmented_text[i];
2073
+ number_of_characters_between_segments += segment.text_.length;
2074
+ }
2075
+ if (number_of_characters_between_segments < $f3a159279dc1a8fb$var$dont_cut_in_between_less_than_characters)
2076
+ // don't cut if there are less than 30 characters between the two segments
2077
+ return;
2078
+ // We have more than 50 characters between the two segments, cut between them
2079
+ const [split_start_segment, split_start_character] = $f3a159279dc1a8fb$var$find_split_point(index_of_first_segment, index_of_second_segment, segmented_text);
2080
+ const [split_end_segment, split_end_character] = $f3a159279dc1a8fb$var$find_split_point(index_of_second_segment, index_of_first_segment, segmented_text);
2081
+ if (split_start_segment === undefined || split_end_segment === undefined ||
2082
+ // identical split point, or split end before split start, can't do anything
2083
+ split_start_segment == split_end_segment && split_start_character >= split_end_character || split_start_segment > split_end_segment) return;
2084
+ const dots_segment = {
2085
+ text_: " … ",
2086
+ highlighted_: false
2087
+ };
2088
+ const split_and_dotted_values = segmented_text.flatMap((segment, i) => {
2089
+ if (i < split_start_segment || i > split_end_segment) return segment;
2090
+ const text = segment.text_;
2091
+ if (i == split_end_segment && i == split_start_segment) return [{
2092
+ ...segment,
2093
+ text_: text.slice(0, split_start_character).trimEnd()
2094
+ }, dots_segment, {
2095
+ ...segment,
2096
+ text_: text.slice(split_end_character + 1, text.length).trimStart()
2097
+ }];else if (i == split_start_segment) {
2098
+ segment.text_ = text.slice(0, split_start_character).trimEnd(); // this would be split_start_character + 1, but we want to remove the last "dot" because . ... looks weird
2099
+ return segment;
2100
+ } else if (i == split_end_segment) return [dots_segment, {
2101
+ ...segment,
2102
+ text_: text.slice(split_end_character + 1, text.length).trimStart()
2103
+ }];
2104
+ return []; // remove all segments inbetween
2105
+ });
2106
+
2107
+ segmented_text.splice(0, segmented_text.length, ...split_and_dotted_values); // Sorry…
2108
+ $f3a159279dc1a8fb$var$heal_holes(segmented_text);
2109
+ }
2110
+ function $f3a159279dc1a8fb$var$heal_holes(segmented_text) {
2111
+ // try to heal "holes" created in the segments so there are only alternating segments
2112
+ const segments_to_delete = new Set();
2113
+ for (let i = 0; i < segmented_text.length; i++) {
2114
+ var _previous_segment, _previous_segment2;
2115
+ const segment = segmented_text[i];
2116
+ let previous_segment;
2117
+ for (let j = i - 1; j >= 0; j--) {
2118
+ previous_segment = segmented_text[j];
2119
+ // Don't write to a segment that's marked for deletion or the contents we write to it will be deleted
2120
+ if (!segments_to_delete.has(previous_segment)) break;
2121
+ }
2122
+ if ((_previous_segment = previous_segment) !== null && _previous_segment !== void 0 && _previous_segment.highlighted_ && segment.highlighted_ || ((_previous_segment2 = previous_segment) === null || _previous_segment2 === void 0 ? void 0 : _previous_segment2.highlighted_) === false && segment.highlighted_ === false) {
2123
+ previous_segment.text_ += segment.text_; // IDK if this ever happens
2124
+ segments_to_delete.add(segment);
2125
+ }
2126
+ }
2127
+ for (const segment of segments_to_delete) {
2128
+ const index = segmented_text.indexOf(segment);
2129
+ segmented_text.splice(index, 1);
2130
+ }
2131
+ }
2132
+ function $f3a159279dc1a8fb$var$find_split_point(index_of_start_segment, index_of_end_segment, segmented_text) {
2133
+ let be_very_aggressive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
2134
+ const should_loop_backwards = index_of_start_segment > index_of_end_segment;
2135
+ const step = should_loop_backwards ? -1 : 1;
2136
+ const desperate_split_attempts = [":", ";", ","];
2137
+ while (desperate_split_attempts.length) {
2138
+ const split_point_between_words = [];
2139
+ // for the middle also try to split with a few more characters if the default ones don't work over a full run
2140
+ const desperate_split_attempt = desperate_split_attempts.pop();
2141
+ let is_first_character = true;
2142
+ for (let i = index_of_start_segment + step; should_loop_backwards ? i > index_of_end_segment : i < index_of_end_segment; i += step) {
2143
+ const segment = segmented_text[i];
2144
+ const text = segment.text_;
2145
+ for (let j = should_loop_backwards ? text.length - 1 : 0; should_loop_backwards ? j >= 0 : j < text.length; j += step) {
2146
+ const character = text[j];
2147
+ if (character == "." || character == "?" || character == "!" || character == desperate_split_attempt) return [i, j]; // segment index, character index
2148
+ if (is_first_character) is_first_character = false;else if (be_very_aggressive && character == " ") {
2149
+ split_point_between_words.push([i, j]);
2150
+ if (split_point_between_words.length > 3)
2151
+ // We can't find a split point, so we'll just split between words
2152
+ // This is because for UI reasons we only want to show 2 lines of text, so we need to be very aggressive with getting the second match soon
2153
+ return split_point_between_words[1];
2154
+ }
2155
+ }
2156
+ }
2157
+ }
2158
+ return [];
2159
+ }
2160
+ function $f3a159279dc1a8fb$var$cut_start(cut_left_of_index, segmented_text) {
2161
+ // Cut the start of the text to bring the first matching token
2162
+ let is_first_character = false;
2163
+ let words_encountered = 0;
2164
+ outmost_loop: for (let i = cut_left_of_index - 1; i >= 0; i--) {
2165
+ const segment = segmented_text[i];
2166
+ // We assume that two adjacent highlighted segments don't exist and have been merged if they were to have existed
2167
+ const text = segment.text_;
2168
+ for (let j = text.length - 1; j >= 0; j--) {
2169
+ const character = text[j];
2170
+ const is_space = character == " ";
2171
+ if (!is_first_character && is_space) words_encountered++;
2172
+ if (character == "." || character == "?" || character == "!" || character == "," || words_encountered > 8 && is_space) {
2173
+ // We have to be really aggressive at the start of sentences so stuff can be seen on mobile, hence comma
2174
+ segment.text_ = text.slice(j + 1).trimStart();
2175
+ segmented_text.splice(0, i);
2176
+ if (character === "," || is_space)
2177
+ // if we cut at a comma or psace, we add a … at the beginning
2178
+ segmented_text.unshift({
2179
+ text_: "… ",
2180
+ highlighted_: false
2181
+ });
2182
+ break outmost_loop;
2183
+ }
2184
+ if (is_first_character) is_first_character = false;
2185
+ }
2186
+ }
2187
+ $f3a159279dc1a8fb$var$heal_holes(segmented_text); // if we added a ... there could now be a sequence that's not alternating true/false
2188
+ }
2189
+
2190
+ function $f3a159279dc1a8fb$export$1b00d74faf266c56(text, matched_strings) {
2191
+ let loose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
2192
+ const output = [];
2193
+ if (!text) return; // shouldn't happen but whatever
2194
+ for (let i = 0; i < text.length; i++) {
2195
+ const found_strings = [];
2196
+ if (!i || text[i - 1] == " " || loose)
2197
+ // only match at the start of a word or string, it looks weird if i.e. "we" is highlighted in "activewear
2198
+ for (let j = 0; j < matched_strings.length; j++) {
2199
+ const matched_string = matched_strings[j];
2200
+ const part_in_text = text.slice(i, i + matched_string.length);
2201
+ if (matched_string.length < 2 && !loose) continue; // don't match on single characters, i.e. "I", it looks weird
2202
+ if (part_in_text.toLowerCase() === matched_string.toLowerCase()) found_strings.push(part_in_text); // use the casing from the text, not from typesense, can look weird otherwise
2203
+ }
2204
+
2205
+ const last_index_in_output = output.length - 1;
2206
+ if (!found_strings.length) {
2207
+ var _output$last_index_in;
2208
+ const character = text[i];
2209
+ if (((_output$last_index_in = output[last_index_in_output]) === null || _output$last_index_in === void 0 ? void 0 : _output$last_index_in.highlighted_) === false || output.length && /\s/.test(character))
2210
+ // always push whitespace characters to the last segment, this is because typesense doesn't see them as part of the matched tokens but we want to be able to detect "phat" matched segments
2211
+ output[last_index_in_output].text_ += character;else output.push({
2212
+ highlighted_: false,
2213
+ text_: character
2214
+ });
2215
+ } else {
2216
+ var _output$last_index_in2;
2217
+ const longest_found_string = found_strings.reduce((a, b) => a.length > b.length ? a : b);
2218
+ if ((_output$last_index_in2 = output[last_index_in_output]) !== null && _output$last_index_in2 !== void 0 && _output$last_index_in2.highlighted_) output[last_index_in_output].text_ += longest_found_string;else output.push({
2219
+ highlighted_: true,
2220
+ text_: longest_found_string
2221
+ });
2222
+ i += longest_found_string.length - 1;
2223
+ }
2224
+ }
2225
+ return output;
2226
+ }
2227
+ const $b0e2100b511ec9a4$var$_tmpl$ = ["<span", ' class="', '">', "</span>"],
2228
+ $b0e2100b511ec9a4$var$_tmpl$2 = ["<span", ' class="highlighted-part">', "</span>"];
2229
+ function $b0e2100b511ec9a4$export$8e79c28529dbfa90(props) {
2230
+ const segmented_text = $b8hua$createMemo(() => {
2231
+ const {
2232
+ to_highlight_: to_highlight_,
2233
+ text_: text_
2234
+ } = props;
2235
+ return $f3a159279dc1a8fb$export$1b00d74faf266c56(text_, to_highlight_ ? [to_highlight_] : [], true);
2236
+ });
2237
+ const has_highlights = $b8hua$createMemo(() => segmented_text().some(segment => segment.highlighted_));
2238
+ return $b8hua$ssr($b0e2100b511ec9a4$var$_tmpl$, $b8hua$ssrHydrationKey() + $b8hua$ssrAttribute("title", $b8hua$escape(props.text_, true), false), has_highlights() ? "has-match" : "", $b8hua$escape($b8hua$createComponent((0, $b8hua$Index), {
2239
+ get each() {
2240
+ return segmented_text();
2241
+ },
2242
+ children: item => {
2243
+ return $b8hua$createComponent((0, $b8hua$Show), {
2244
+ get when() {
2245
+ return item().highlighted_;
2246
+ },
2247
+ get fallback() {
2248
+ return item().text_;
2249
+ },
2250
+ get children() {
2251
+ return $b8hua$ssr($b0e2100b511ec9a4$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape(item().text_));
2252
+ }
2253
+ });
2254
+ }
2255
+ })));
2256
+ }
2257
+ const $0ae614c5c7babb43$var$_tmpl$ = ["<form", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></form>"],
2258
+ $0ae614c5c7babb43$var$_tmpl$2 = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
2259
+ $0ae614c5c7babb43$var$_tmpl$3 = ["<details", "></details>"],
2260
+ $0ae614c5c7babb43$var$_tmpl$4 = ["<summary", ' class="category-parent"><div class="summary"><span class="', '">', "</span><!--$-->", "<!--/--></div></summary>"];
2261
+ const $0ae614c5c7babb43$var$max_visible_without_collapsing = 15;
2262
+ const $0ae614c5c7babb43$var$show_non_collapsible_when_collapsed = 4;
2263
+ function $0ae614c5c7babb43$export$a32086fa6616eafd(_ref) {
2264
+ let {
2265
+ filter_: filter_,
2266
+ selected_filters_: selected_filters_,
2267
+ i18n_: i18n_,
2268
+ view_more_button_below_group_: view_more_button_below_group_,
2269
+ expanded_hierarchical_filters_: expanded_hierarchical_filters_,
2270
+ filter_query_: filter_query_
2271
+ } = _ref;
2272
+ let form;
2273
+ const existing_filter = $b8hua$createMemo(() => {
2274
+ const {
2275
+ field: field,
2276
+ op: op
2277
+ } = filter_();
2278
+ return selected_filters_[0]().find(_ref2 => {
2279
+ let {
2280
+ field: checking_field,
2281
+ op: checking_op
2282
+ } = _ref2;
2283
+ return checking_field === field && checking_op === op;
2284
+ });
2285
+ });
2286
+ const show_extras = $b8hua$createSignal(false);
2287
+ const is_being_searched_ = $b8hua$createMemo(() => !!(filter_query_ !== null && filter_query_ !== void 0 && filter_query_())); // If the user is searching in the filter
2288
+ const trigger_sync_ = $0ae614c5c7babb43$var$batching_filter_state_syncer({
2289
+ filter_: filter_,
2290
+ existing_filter_: existing_filter,
2291
+ selected_filters_: selected_filters_,
2292
+ get category_structure_() {
2293
+ return structured_categories();
2294
+ }
2295
+ });
2296
+ const structured_categories = $b8hua$createMemo(() => {
2297
+ const execute_when_structure_finished = [];
2298
+ const {
2299
+ values: values,
2300
+ names: names,
2301
+ counts: counts
2302
+ } = filter_().meta;
2303
+ const data_structure = {};
2304
+ for (let i = 0; i < values.length; i++) {
2305
+ const value = values[i];
2306
+ let pointer = data_structure;
2307
+ let parent_ = {};
2308
+ let created_an_object = false;
2309
+ for (let j = 0; j < value.length; j++) {
2310
+ var _pointer;
2311
+ const this_categories_name = value[j];
2312
+ const obj = (_pointer = pointer)[this_categories_name] || (_pointer[this_categories_name] = (() => {
2313
+ const value_as_string = value.map(v => typeof v === "number" ? v + "" : v); // don't think backend will ever send numbers but technically it's allowed;
2314
+ const created_obj = {
2315
+ name_: names[i],
2316
+ count_: counts === null || counts === void 0 ? void 0 : counts[i],
2317
+ parent_: parent_,
2318
+ is_expanded_: $0ae614c5c7babb43$var$make_expanded_signal({
2319
+ expanded_hierarchical_filters_: expanded_hierarchical_filters_,
2320
+ filter_value_: value_as_string,
2321
+ is_being_searched_: is_being_searched_
2322
+ }),
2323
+ value_: value_as_string,
2324
+ children_: {}
2325
+ };
2326
+ const {
2327
+ signal_: signal_,
2328
+ on_structure_complete_: on_structure_complete_
2329
+ } = $0ae614c5c7babb43$var$create_updating_signal({
2330
+ self_: created_obj,
2331
+ existing_filter_: $b8hua$untrack(existing_filter),
2332
+ trigger_sync_: trigger_sync_
2333
+ });
2334
+ execute_when_structure_finished.push(on_structure_complete_);
2335
+ created_obj.is_checked_ = signal_;
2336
+ parent_ = created_obj;
2337
+ created_an_object = true;
2338
+ return created_obj;
2339
+ })());
2340
+ pointer = obj.children_;
2341
+ parent_ = obj;
2342
+ }
2343
+ if (!created_an_object && "value_" in parent_) {
2344
+ // if an object was created for our "depth" in the hierarchy but not for our specific entry this means that the entry array was unsorted and looked something like
2345
+ // [
2346
+ // ["Öl", "IPA"],
2347
+ // ["Öl", "Pale Ale"],
2348
+ // ["Öl", "Ale"],
2349
+ // ["Öl", "Mörk Lager"],
2350
+ // ["Öl", "Suröl"],
2351
+ // ["Öl", "Veteöl"],
2352
+ // ["Öl", "Stout och Porter"],
2353
+ // ["Öl"], // <- We are here, our `hierarchical_data_structure[string]`-object was created when we iterated over ["Öl", "IPA"]
2354
+ // ["Öl", "Ljus Lager"],
2355
+ // ];
2356
+ // In this case we want to just correct the name and value of the already created object, which will be in parent_
2357
+ parent_.value_ = value.map(v => v + "");
2358
+ parent_.name_ = names[i];
2359
+ parent_.count_ = counts[i];
2360
+ parent_.is_expanded_ = $0ae614c5c7babb43$var$make_expanded_signal({
2361
+ expanded_hierarchical_filters_: expanded_hierarchical_filters_,
2362
+ filter_value_: parent_.value_,
2363
+ is_being_searched_: is_being_searched_
2364
+ });
2365
+ }
2366
+ }
2367
+ while (execute_when_structure_finished.length) execute_when_structure_finished.pop()();
2368
+ $0ae614c5c7babb43$var$expand_until_choice(data_structure);
2369
+ $b8hua$dlog("CheckboxHierarchicalFilter: Recomputed structured_categories", data_structure);
2370
+ return data_structure;
2371
+ });
2372
+ const some_top_level_are_hidden = $b8hua$createMemo(() => Object.keys(structured_categories()).length > $0ae614c5c7babb43$var$max_visible_without_collapsing);
2373
+ const {
2374
+ expand: expand,
2375
+ collapse: collapse,
2376
+ ExpandingContainer: ExpandingContainer
2377
+ } = $8e8b179489080711$export$5bad61ecde080b1f({
2378
+ duration: 200
2379
+ });
2380
+ const expanding_container_els = $b8hua$createComponent(ExpandingContainer, {
2381
+ get children() {
2382
+ return $b8hua$createComponent((0, $b8hua$Show), {
2383
+ get when() {
2384
+ return some_top_level_are_hidden();
2385
+ },
2386
+ get children() {
2387
+ return $0ae614c5c7babb43$var$render_stuff($b8hua$createMemo(() => Object.fromEntries(Object.entries(structured_categories()).slice($0ae614c5c7babb43$var$show_non_collapsible_when_collapsed))), existing_filter, i18n_, filter_query_);
2388
+ }
2389
+ });
2390
+ }
2391
+ });
2392
+ $b8hua$createRenderEffect(() => {
2393
+ view_more_button_below_group_[1](some_top_level_are_hidden() ? $b8hua$createComponent((0, $3e850b2f2cca761f$export$ca21a16d65b3dd8), {
2394
+ show_extras_: show_extras,
2395
+ i18n_: i18n_
2396
+ }) : []);
2397
+ });
2398
+ $b8hua$createEffect($b8hua$catchify(async () => {
2399
+ if (!some_top_level_are_hidden()) {
2400
+ await collapse();
2401
+ return;
2402
+ }
2403
+ if (show_extras[0]()) await expand();else await collapse();
2404
+ }));
2405
+ return $b8hua$ssr($0ae614c5c7babb43$var$_tmpl$, $b8hua$ssrHydrationKey(), "checkboxes hierarchical ".concat(Object.values(structured_categories()).some(category => Object.keys(category.children_).length) ? "any-expandable" : ""), $b8hua$escape($0ae614c5c7babb43$var$render_stuff($b8hua$createMemo(() => some_top_level_are_hidden() ? Object.fromEntries(Object.entries(structured_categories()).slice(0, $0ae614c5c7babb43$var$show_non_collapsible_when_collapsed)) : structured_categories()), existing_filter, i18n_, filter_query_)), $b8hua$escape(expanding_container_els));
2406
+ }
2407
+ function $0ae614c5c7babb43$var$render_stuff(data, existing_filter, i18n_, filter_query_) {
2408
+ const keys = $b8hua$createMemo(() => Object.keys(data()));
2409
+ return $b8hua$createComponent((0, $b8hua$For), {
2410
+ get each() {
2411
+ return keys();
2412
+ },
2077
2413
  children: key => $b8hua$createComponent((0, $b8hua$Show), {
2078
2414
  get when() {
2079
2415
  return $b8hua$createMemo(() => !!data()[key])();
@@ -2086,14 +2422,27 @@ function $0ae614c5c7babb43$var$render_stuff(data, existing_filter, i18n_) {
2086
2422
  var _value;
2087
2423
  return !!Object.keys(((_value = value()) === null || _value === void 0 ? void 0 : _value.children_) || {}).length;
2088
2424
  });
2425
+ const value_as_string = $b8hua$createMemo(() => {
2426
+ var _value2;
2427
+ return JSON.stringify((_value2 = value()) === null || _value2 === void 0 ? void 0 : _value2.value_);
2428
+ });
2429
+ const label_text = $b8hua$createMemo(() => {
2430
+ var _value3;
2431
+ return ((_value3 = value()) === null || _value3 === void 0 ? void 0 : _value3.name_) || value_as_string();
2432
+ });
2089
2433
  return $b8hua$ssr($0ae614c5c7babb43$var$_tmpl$2, $b8hua$ssrHydrationKey(), "checkbox-details ".concat(has_expandable() ? "expandable" : ""), $b8hua$escape($b8hua$createComponent((0, $19e828709c7723a0$export$48513f6b9f8ce62d), {
2090
2434
  get value_() {
2091
- var _value2;
2092
- return JSON.stringify((_value2 = value()) === null || _value2 === void 0 ? void 0 : _value2.value_);
2435
+ return value_as_string();
2093
2436
  },
2094
2437
  get label_() {
2095
- var _value3;
2096
- return (_value3 = value()) === null || _value3 === void 0 ? void 0 : _value3.name_;
2438
+ return $b8hua$createComponent((0, $b0e2100b511ec9a4$export$8e79c28529dbfa90), {
2439
+ get text_() {
2440
+ return label_text();
2441
+ },
2442
+ get to_highlight_() {
2443
+ return filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_();
2444
+ }
2445
+ });
2097
2446
  },
2098
2447
  get count_() {
2099
2448
  var _value4;
@@ -2177,7 +2526,7 @@ function $0ae614c5c7babb43$var$render_stuff(data, existing_filter, i18n_) {
2177
2526
  return $0ae614c5c7babb43$var$render_stuff($b8hua$createMemo(() => {
2178
2527
  var _value13;
2179
2528
  return ((_value13 = value()) === null || _value13 === void 0 ? void 0 : _value13.children_) || {};
2180
- }), existing_filter, i18n_);
2529
+ }), existing_filter, i18n_, filter_query_);
2181
2530
  }
2182
2531
  });
2183
2532
  })();
@@ -2292,7 +2641,8 @@ function $0ae614c5c7babb43$var$make_expanded_signal(_ref5) {
2292
2641
  var _untrack$untrack;
2293
2642
  let {
2294
2643
  expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters],
2295
- filter_value_: filter_value_
2644
+ filter_value_: filter_value_,
2645
+ is_being_searched_: is_being_searched_
2296
2646
  } = _ref5;
2297
2647
  const index_in_expanded_filters = $b8hua$createMemo(() => read_expanded_hierarchical_filters().findIndex(_ref6 => {
2298
2648
  let {
@@ -2335,9 +2685,11 @@ function $0ae614c5c7babb43$var$make_expanded_signal(_ref5) {
2335
2685
  defer: true
2336
2686
  }));
2337
2687
  return {
2338
- ui_should_show_expanded_: $b8hua$createMemo(() => {
2688
+ ui_should_show_expanded_: $b8hua$createMemo(
2689
+ // When user is searching through filters, expand everything they haven't collapsed, so they can see the results
2690
+ () => {
2339
2691
  var _user_choice_signal$;
2340
- return (_user_choice_signal$ = user_choice_signal[0]()) !== null && _user_choice_signal$ !== void 0 ? _user_choice_signal$ : get_low_precedence_expanded();
2692
+ return (_user_choice_signal$ = user_choice_signal[0]()) !== null && _user_choice_signal$ !== void 0 ? _user_choice_signal$ : is_being_searched_() || get_low_precedence_expanded();
2341
2693
  }),
2342
2694
  set_low_precedence_expanded_: set_low_precedence_expanded,
2343
2695
  set_user_expanded_: set_user_choice_expanded
@@ -2367,7 +2719,9 @@ const $830ea8efda59884e$var$max_columns = 3;
2367
2719
  const $830ea8efda59884e$export$414f6a19d38e655c = _ref => {
2368
2720
  let {
2369
2721
  filter_: filter_,
2370
- selected_filters_: [get_selected_filters, set_selected_filters]
2722
+ selected_filters_: [get_selected_filters, set_selected_filters],
2723
+ filter_query_: filter_query_,
2724
+ details_element_width_: details_element_width_
2371
2725
  } = _ref;
2372
2726
  const existing_filter = $b8hua$createMemo(() => {
2373
2727
  const {
@@ -2401,7 +2755,7 @@ const $830ea8efda59884e$export$414f6a19d38e655c = _ref => {
2401
2755
  const container_width_accessor = $b8hua$createMemo(() => {
2402
2756
  const element = container();
2403
2757
  if (!element) return;
2404
- return $0dc044cffe1e825b$export$9f191182275e9ef(element);
2758
+ return $fc830a7ee59416ef$export$ebdc3711f7e02ccd(element);
2405
2759
  });
2406
2760
  const [shadow_children, set_shadow_children] = $b8hua$createSignal(new Set(), {
2407
2761
  equals: false
@@ -2409,11 +2763,11 @@ const $830ea8efda59884e$export$414f6a19d38e655c = _ref => {
2409
2763
  const shadow_grid = $b8hua$ssr($830ea8efda59884e$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape([...shadow_children()])); // for getting the smallest possible sizes of all the items
2410
2764
  $b8hua$createEffect(() => {
2411
2765
  var _container_width_acce;
2412
- const container_width = (_container_width_acce = container_width_accessor()) === null || _container_width_acce === void 0 ? void 0 : _container_width_acce();
2413
- if (container_width == undefined) return;
2766
+ const container_width = ((_container_width_acce = container_width_accessor()) === null || _container_width_acce === void 0 ? void 0 : _container_width_acce()) || details_element_width_();
2767
+ if (container_width === undefined) return; // On firefox, unexpanded <details> elements' contents dont't have a width, fall back to the width of the details element itself to not have janky expanding animations due to wrong number of columns at point of expanding
2414
2768
  $830ea8efda59884e$var$adjust_sizes(container_width, sizes_set(), set_cols_at_size);
2415
2769
  });
2416
- return [shadow_grid, $b8hua$createComponent((0, $63f1f8dbcd07d3b0$export$d21e32dfedac04be), {
2770
+ return [$b8hua$createComponent((0, $63f1f8dbcd07d3b0$export$d21e32dfedac04be), {
2417
2771
  get cols_at_size() {
2418
2772
  return cols_at_size();
2419
2773
  },
@@ -2436,27 +2790,33 @@ const $830ea8efda59884e$export$414f6a19d38e655c = _ref => {
2436
2790
  const current_value = $af5d8e0b7d97a7f6$export$325f75597868c4f0(value().value_);
2437
2791
  return !!(data !== null && data !== void 0 && data.some(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === current_value));
2438
2792
  });
2439
- const MakeButton = attributes => $b8hua$ssrElement("button", $b8hua$mergeProps1(attributes, {
2440
- get disabled() {
2441
- return value().count_ === 0 && !is_selected();
2442
- },
2443
- get classList() {
2444
- return {
2445
- minor: !is_selected(),
2446
- major: is_selected(),
2447
- "major-minor-transition": true
2448
- };
2449
- }
2450
- }), () => ["<!--$-->", $b8hua$escape(value().value_), "<!--/-->", "<!--$-->", $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
2451
- get when() {
2452
- return value().count_ != undefined;
2453
- },
2454
- get children() {
2455
- return $b8hua$ssr($830ea8efda59884e$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape(value().count_));
2456
- }
2457
- })), "<!--/-->"], true);
2793
+ const MakeButton = attributes => {
2794
+ const label = $b8hua$createMemo(() => value().name_ || value().value_ + "");
2795
+ return $b8hua$ssrElement("button", $b8hua$mergeProps1(attributes, {
2796
+ get disabled() {
2797
+ return value().count_ === 0 && !is_selected();
2798
+ },
2799
+ get classList() {
2800
+ return {
2801
+ minor: !is_selected(),
2802
+ major: is_selected(),
2803
+ "major-minor-transition": true
2804
+ };
2805
+ }
2806
+ }), () => ["<!--$-->", $b8hua$escape($b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
2807
+ whole_text_to_display_: label,
2808
+ searching_for_value_: () => filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_()
2809
+ })), "<!--/-->", "<!--$-->", $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
2810
+ get when() {
2811
+ return value().count_ != undefined;
2812
+ },
2813
+ get children() {
2814
+ return $b8hua$ssr($830ea8efda59884e$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape(value().count_));
2815
+ }
2816
+ })), "<!--/-->"], true);
2817
+ };
2458
2818
  const invisible_size_button = $b8hua$createComponent(MakeButton, {});
2459
- const smallest_possible_size = $0dc044cffe1e825b$export$9f191182275e9ef(invisible_size_button); // create ResizeObserver for the invisible size button where the div hugs its content
2819
+ const smallest_possible_size = $fc830a7ee59416ef$export$ebdc3711f7e02ccd(invisible_size_button); // create ResizeObserver for the invisible size button where the div hugs its content
2460
2820
  const sizes_value = $b8hua$untrack(sizes_set);
2461
2821
  const shadow_children_value = $b8hua$untrack(shadow_children);
2462
2822
  sizes_value.add(smallest_possible_size);
@@ -2476,7 +2836,7 @@ const $830ea8efda59884e$export$414f6a19d38e655c = _ref => {
2476
2836
  }
2477
2837
  });
2478
2838
  }
2479
- })];
2839
+ }), shadow_grid];
2480
2840
  };
2481
2841
  /**
2482
2842
  * Calculate and apply cols_at_size overrides to fit as many items as possible in a row, evenly spaced
@@ -2544,7 +2904,8 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
2544
2904
  filter_: filter_,
2545
2905
  selected_filters_: [get_selected_filters, set_selected_filters],
2546
2906
  i18n_: i18n_,
2547
- view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_]
2907
+ view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_],
2908
+ filter_query_: filter_query_
2548
2909
  } = _ref;
2549
2910
  // same as in CheckboxFilter, maybe we should make this DRY at some point
2550
2911
  const existing_filter = $b8hua$createMemo(() => {
@@ -2589,12 +2950,17 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
2589
2950
  const value = $af5d8e0b7d97a7f6$export$325f75597868c4f0(checkbox().value_);
2590
2951
  return !!(data !== null && data !== void 0 && data.some(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === value));
2591
2952
  });
2953
+ const value = $b8hua$createMemo(() => checkbox().value_);
2954
+ const label_text = $b8hua$createMemo(() => checkbox().name_ || value() + "");
2592
2955
  const input_row = $b8hua$createComponent((0, $19e828709c7723a0$export$48513f6b9f8ce62d), {
2593
2956
  get value_() {
2594
- return checkbox().value_;
2957
+ return value();
2595
2958
  },
2596
2959
  get label_() {
2597
- return checkbox().name_;
2960
+ return $b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
2961
+ whole_text_to_display_: label_text,
2962
+ searching_for_value_: () => filter_query_ === null || filter_query_ === void 0 ? void 0 : filter_query_()
2963
+ });
2598
2964
  },
2599
2965
  get count_() {
2600
2966
  return checkbox().count_;
@@ -2852,10 +3218,152 @@ function $ceafb6fb91c6f394$export$89c6019e4baa40b1(props) {
2852
3218
  }
2853
3219
  });
2854
3220
  }
3221
+ const $ef0f18a578b32578$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>';
3222
+ function $ef0f18a578b32578$export$82eafebb825fc23f() {
3223
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3224
+ return $b8hua$ssrElement("svg", $b8hua$mergeProps1({
3225
+ xmlns: "http://www.w3.org/2000/svg",
3226
+ width: "20",
3227
+ height: "22",
3228
+ viewBox: "0 0 20 22"
3229
+ }, props), () => $b8hua$ssr($ef0f18a578b32578$var$_tmpl$), true);
3230
+ }
3231
+ const $e354b2f9ce33cb75$var$_tmpl$ = ["<div", ' class="search-in-filters"><input type="text" class="query"', "><!--$-->", '<!--/--><button style="', '" class="clear">', "</button></div>"];
3232
+ const $e354b2f9ce33cb75$var$min_items_to_enable_filter_searching = 10; // For checkbox hierarchical we 2x this
3233
+ function $e354b2f9ce33cb75$export$4b2c5292ffe0c5dd(filter_array_, section, i18n_) {
3234
+ const [filter_query_, set_filter_query_] = $b8hua$createSignal();
3235
+ // Check if we have enough items to enable searching
3236
+ const enable_searchability = $b8hua$createMemo(() => {
3237
+ let count = 0;
3238
+ for (const filter of filter_array_()) {
3239
+ var _filter$meta;
3240
+ const type = (_filter$meta = filter.meta) === null || _filter$meta === void 0 ? void 0 : _filter$meta.type;
3241
+ if (type === "range") continue;
3242
+ const length = filter.meta.values.length;
3243
+ count += type === "checkbox-color" ? length / 2 : type === "checkbox-grid" ? length / 3 : length; // For checkbox-color we have two columns, checkbox-grid three, so we can show search later
3244
+ }
3245
+
3246
+ return count >= $e354b2f9ce33cb75$var$min_items_to_enable_filter_searching;
3247
+ });
3248
+ const SearchThisFilterGroup_ = () => {
3249
+ return $b8hua$createComponent((0, $b8hua$Show), {
3250
+ get when() {
3251
+ return enable_searchability();
3252
+ },
3253
+ get children() {
3254
+ return $b8hua$ssr($e354b2f9ce33cb75$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("value", $b8hua$escape(filter_query_(), true) || "", false) + $b8hua$ssrAttribute("placeholder", $b8hua$escape(i18n_.search_a_filter_()(section), true), false), $b8hua$escape($b8hua$createComponent((0, $ef0f18a578b32578$export$82eafebb825fc23f), {
3255
+ width: "16",
3256
+ height: "17.6",
3257
+ "class": "search-icon"
3258
+ })), "display:" + (filter_query_() ? "" : "none"), $b8hua$escape($b8hua$createComponent((0, $9783d437ad61594c$export$3b621d86b1566b2), {
3259
+ width: "12",
3260
+ height: "12"
3261
+ })));
3262
+ }
3263
+ });
3264
+ };
3265
+ const searched_filter_array_ = $b8hua$createMemo(() => {
3266
+ const query = filter_query_();
3267
+ if (!enable_searchability() || !query) return filter_array_();
3268
+ const lowercase_query = query.toLowerCase();
3269
+ const check_string_match = to_check => {
3270
+ to_check = to_check.toLowerCase();
3271
+ return to_check.includes(lowercase_query) || lowercase_query.includes(to_check);
3272
+ };
3273
+ return filter_array_().map(filter => {
3274
+ var _filter$meta2, _meta$names;
3275
+ const type = (_filter$meta2 = filter.meta) === null || _filter$meta2 === void 0 ? void 0 : _filter$meta2.type;
3276
+ if (type === "range") return filter; // can't search in range filters and for checkbox-hierarchical we do the searching in the filter component since we have access to a hierarchical structure there
3277
+ const meta = filter.meta;
3278
+ const {
3279
+ values: values,
3280
+ names: names,
3281
+ counts: counts
3282
+ } = meta;
3283
+ if (!Array.isArray(values)) return filter; // Might have to adjust this in the future, but I think these super simple filters won't need search
3284
+ const is_hierarchical_checkbox = type === "checkbox-hierarchical";
3285
+ // Which index of counts, values and names should be kept
3286
+ const filtered_indexes = values.map((item, index) => {
3287
+ const item_from_names = names === null || names === void 0 ? void 0 : names[index];
3288
+ if (item_from_names && !is_hierarchical_checkbox)
3289
+ // We should use names if they exist, but sometimes backend doesn't provide any at all, and sometimes they are undefined, presumably from create_modified_filters
3290
+ item = item_from_names;
3291
+ if (typeof item === "number") return true;
3292
+ if (is_hierarchical_checkbox && names)
3293
+ // Special case for hierarchical checkboxes where we need to check if any of the names in the path match the query
3294
+ item = item.map((_, index) => names[$e354b2f9ce33cb75$var$find_str_arr_in_str_arr_arr("findIndex", values, item.slice(0, index + 1))]);
3295
+ if (Array.isArray(item)) return item.some(item => check_string_match(item + "")); // If any of the items in the array match, keep it
3296
+ return check_string_match(item);
3297
+ });
3298
+ const new_values = values.filter((_, i) => filtered_indexes[i]);
3299
+ if (!new_values.length) return false; // false = please delete this filter, see below
3300
+ const new_filter_object = {
3301
+ ...filter,
3302
+ meta: {
3303
+ ...meta,
3304
+ counts: counts === null || counts === void 0 ? void 0 : counts.filter((_, i) => filtered_indexes[i]),
3305
+ ...(names ? {
3306
+ names: (_meta$names = meta.names) === null || _meta$names === void 0 ? void 0 : _meta$names.filter((_, i) => filtered_indexes[i])
3307
+ } : {}),
3308
+ values: new_values
3309
+ }
3310
+ };
3311
+ if (is_hierarchical_checkbox) {
3312
+ // For hierarchical checkbox we need to fill the holes created by filtering, for example if there is
3313
+ // ["Clothes"]
3314
+ // ["Clothes", "Blazers"]
3315
+ // And the user searched for "blazers" we need to add back ["Clothes"] so CheckboxHierarchicalFilter doesn't get confused
3316
+ // I explored doing the filtering there instead, but it's very hard to do it early enough before the expansion/collapsedness is calculated and check-logic is set up in relation to other items
3317
+ // So we do it here instead
3318
+ const new_meta = new_filter_object.meta;
3319
+ const new_values = new_meta.values;
3320
+ for (const value of new_values) {
3321
+ if (!Array.isArray(value)) continue; // Shouldn't happen
3322
+ if (value.length < 2) continue; // No parent
3323
+ const parent = value.slice(0, -1);
3324
+ // Check if parent exists
3325
+ if ($e354b2f9ce33cb75$var$find_str_arr_in_str_arr_arr("some", new_values, parent)) continue; // Parent exists
3326
+ // Otherwise, put it back
3327
+ const index_to_restore = $e354b2f9ce33cb75$var$find_str_arr_in_str_arr_arr("findIndex", values, parent);
3328
+ if (index_to_restore < 0) {
3329
+ $b8hua$dwarn("Can't restore", parent, "to", new_values);
3330
+ continue;
3331
+ }
3332
+ const current_index_of_us = new_values.findIndex(item => item === value);
3333
+ new_values.splice(current_index_of_us, 0, values[index_to_restore]);
3334
+ const count_to_restore = counts === null || counts === void 0 ? void 0 : counts[index_to_restore];
3335
+ if (count_to_restore) {
3336
+ var _new_meta$counts;
3337
+ (_new_meta$counts = new_meta.counts) === null || _new_meta$counts === void 0 || _new_meta$counts.splice(current_index_of_us, 0, count_to_restore);
3338
+ }
3339
+ const name_to_restore = names === null || names === void 0 ? void 0 : names[index_to_restore];
3340
+ if (name_to_restore) {
3341
+ var _new_meta$names;
3342
+ (_new_meta$names = new_meta.names) === null || _new_meta$names === void 0 || _new_meta$names.splice(current_index_of_us, 0, name_to_restore);
3343
+ }
3344
+ }
3345
+ }
3346
+ return new_filter_object;
3347
+ }).filter(filter => filter); // Delete filters that don't have a value anymore
3348
+ });
3349
+
3350
+ return {
3351
+ SearchThisFilterGroup_: SearchThisFilterGroup_,
3352
+ searched_filter_array_: searched_filter_array_,
3353
+ filter_query_: filter_query_
3354
+ };
3355
+ }
3356
+ /**
3357
+ * Finds/whatevers what's effectively one hierarchical filter item in an array of hierarchical filter items
3358
+ * Functions similar to this happen loads in create_modified_filters, but they have additional checks so not touching them RN
3359
+ */
3360
+ function $e354b2f9ce33cb75$var$find_str_arr_in_str_arr_arr(operation, haystack, needle) {
3361
+ return haystack[operation](value => value.length === needle.length && value.every((item, index) => item === needle[index]));
3362
+ }
2855
3363
  const $f6b0500577e1b210$var$_tmpl$ = ["<div", ' class="filter-collapsible">', "</div>"],
2856
3364
  $f6b0500577e1b210$var$_tmpl$2 = ["<button", ' class="clear-group"><!--$-->', "<!--/--><span>", "</span></button>"],
2857
3365
  $f6b0500577e1b210$var$_tmpl$3 = ["<div", ' class="view-more-clear"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
2858
- $f6b0500577e1b210$var$_tmpl$4 = ["<div", ' class="filter-collapsible-body"><div class="filter-part">', "</div><!--$-->", "<!--/--></div>"],
3366
+ $f6b0500577e1b210$var$_tmpl$4 = ["<div", ' class="filter-collapsible-body"><div class="filter-part"><!--$-->', "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
2859
3367
  $f6b0500577e1b210$var$_tmpl$5 = ["<details", ' class="filter-collapsible"', "></details>"],
2860
3368
  $f6b0500577e1b210$var$_tmpl$6 = ["<summary", ' class="filter-group-summary"><div class="summary"><span>', '</span><div class="selected-w-sign"><!--$-->', "<!--/--><!--$-->", "<!--/--></div></div></summary>"],
2861
3369
  $f6b0500577e1b210$var$_tmpl$7 = ["<div", ' class="ungrouped">', "</div>"],
@@ -2912,6 +3420,11 @@ function $f6b0500577e1b210$var$ActualFilterBody(props) {
2912
3420
  const filter_array_ = $b8hua$createMemo(() => {
2913
3421
  return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
2914
3422
  });
3423
+ const {
3424
+ SearchThisFilterGroup_: SearchThisFilterGroup_,
3425
+ searched_filter_array_: searched_filter_array_,
3426
+ filter_query_: filter_query_
3427
+ } = $e354b2f9ce33cb75$export$4b2c5292ffe0c5dd(filter_array_, section_, props.i18n_);
2915
3428
  const is_open = $f1e63746f76ce012$export$ab34afce88557c0e({
2916
3429
  get expanded_filters_() {
2917
3430
  return props.expanded_filters_;
@@ -2927,6 +3440,11 @@ function $f6b0500577e1b210$var$ActualFilterBody(props) {
2927
3440
  return selected_filter;
2928
3441
  })));
2929
3442
  const a_filter_is_selected = $b8hua$createMemo(() => selected_filters_in_group().size);
3443
+ const [get_details_width, set_get_details_width] = $b8hua$createSignal();
3444
+ const details_element_width_ = $b8hua$createMemo(() => {
3445
+ var _get_details_width;
3446
+ return get_details_width === null || get_details_width === void 0 ? void 0 : (_get_details_width = get_details_width()) === null || _get_details_width === void 0 ? void 0 : _get_details_width();
3447
+ });
2930
3448
  return $b8hua$createComponent((0, $ad371564683947ab$export$6c6d7a51fa9aa15d), {
2931
3449
  is_open_: is_open,
2932
3450
  get details_() {
@@ -2955,9 +3473,9 @@ function $f6b0500577e1b210$var$ActualFilterBody(props) {
2955
3473
  })));
2956
3474
  },
2957
3475
  get children() {
2958
- return $b8hua$ssr($f6b0500577e1b210$var$_tmpl$4, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent((0, $b8hua$Index), {
3476
+ return $b8hua$ssr($f6b0500577e1b210$var$_tmpl$4, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent(SearchThisFilterGroup_, {})), $b8hua$escape($b8hua$createComponent((0, $b8hua$Index), {
2959
3477
  get each() {
2960
- return filter_array_();
3478
+ return searched_filter_array_();
2961
3479
  },
2962
3480
  children: filter => $b8hua$createComponent((0, $74777e8fe65b3dcb$export$b69d0d92862de18b), {
2963
3481
  severity_: "error",
@@ -2980,7 +3498,9 @@ function $f6b0500577e1b210$var$ActualFilterBody(props) {
2980
3498
  get i18n_() {
2981
3499
  return props.i18n_;
2982
3500
  },
2983
- view_more_button_below_group_: view_more_button_below_group
3501
+ view_more_button_below_group_: view_more_button_below_group,
3502
+ filter_query_: filter_query_,
3503
+ details_element_width_: details_element_width_
2984
3504
  });
2985
3505
  }
2986
3506
  })
@@ -7129,15 +7649,6 @@ const $ecc323d9c29305ee$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/sv
7129
7649
  function $ecc323d9c29305ee$export$1c641004b5485fed() {
7130
7650
  return $b8hua$ssr($ecc323d9c29305ee$var$_tmpl$, $b8hua$ssrHydrationKey());
7131
7651
  }
7132
- const $ef0f18a578b32578$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>';
7133
- function $ef0f18a578b32578$export$82eafebb825fc23f() {
7134
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7135
- return $b8hua$ssrElement("svg", $b8hua$mergeProps1(props, {
7136
- xmlns: "http://www.w3.org/2000/svg",
7137
- width: "20",
7138
- height: "22"
7139
- }), () => $b8hua$ssr($ef0f18a578b32578$var$_tmpl$), true);
7140
- }
7141
7652
  const $584c06c09cf4609d$var$_tmpl$ = ["<button", ' class="back" type="button"', ">", "</button>"],
7142
7653
  $584c06c09cf4609d$var$_tmpl$2 = ["<div", ' class="search-field"><!--$-->', '<!--/--><div class="field"><input class="', '" tabindex="0"', '><button type="button" class="clear"', ' style="', '">', '</button></div><button class="submit major" type="button"', ">", "</button></div>"];
7143
7654
  function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
@@ -7629,78 +8140,24 @@ function $494c9ad553139dbc$export$a146ac6fa8346a25(_ref) {
7629
8140
  return has_entries();
7630
8141
  },
7631
8142
  get children() {
7632
- return $b8hua$ssr($494c9ad553139dbc$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape(text_()), $b8hua$escape($b8hua$createComponent((0, $b8hua$Index), {
7633
- get each() {
7634
- return previous_searches_();
7635
- },
7636
- children: (item, index) => {
7637
- const href = $e8776b492383c292$export$91c3b6774e8be0f5({
7638
- param_: search_query_param_name_,
7639
- value_: item,
7640
- url_transformer_: url_transformer_
7641
- });
7642
- return $b8hua$ssr($494c9ad553139dbc$var$_tmpl$2, $b8hua$ssrHydrationKey(), "".concat("item", " ").concat($b8hua$createMemo(() => {
7643
- var _read_selected_index_, _read_selected_index_2;
7644
- return ((_read_selected_index_ = read_selected_index_()) === null || _read_selected_index_ === void 0 ? void 0 : _read_selected_index_[0]) === 0 && ((_read_selected_index_2 = read_selected_index_()) === null || _read_selected_index_2 === void 0 ? void 0 : _read_selected_index_2[1]) === index;
7645
- })() ? "selected" : ""), $b8hua$ssrAttribute("href", $b8hua$escape(href(), true), false), $b8hua$escape($b8hua$createComponent((0, $6d95ef50ee01d5a1$export$5d2caaa6b530761c), {})), $b8hua$ssrAttribute("title", $b8hua$escape(item(), true), false), $b8hua$escape(item()), $b8hua$ssrAttribute("title", $b8hua$escape(i18n_.previous_searches_delete_entry_from_history_(), true), false), $b8hua$escape($b8hua$createComponent((0, $9783d437ad61594c$export$3b621d86b1566b2), {})));
7646
- }
7647
- })));
7648
- }
7649
- });
7650
- }
7651
- const $02b6641aa50ce528$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"],
7652
- $02b6641aa50ce528$var$_tmpl$2 = ["<span", ' class="', '"', ">", "</span>"];
7653
- function $02b6641aa50ce528$export$ba17c5b7e6dda39f(_ref) {
7654
- let {
7655
- whole_text_to_display_: whole_text_to_display_memo,
7656
- searching_for_value_: searching_for_value_memo,
7657
- class_: class_
7658
- } = _ref;
7659
- const [get_has_highlighted, set_has_highlighted] = $b8hua$createSignal(false);
7660
- const text_itself = $b8hua$createMemo(() => $b8hua$batch(() => {
7661
- set_has_highlighted(false);
7662
- const searching_for_value = searching_for_value_memo();
7663
- const whole_text_to_display_ = whole_text_to_display_memo();
7664
- let for_black = "";
7665
- let pushed_grey = false;
7666
- const search_q = searching_for_value;
7667
- if (!search_q) return whole_text_to_display_;
7668
- const output = [];
7669
- const searching_for = search_q.toLowerCase();
7670
- const push_black = () => {
7671
- if (for_black) {
7672
- set_has_highlighted(true);
7673
- output.push($b8hua$ssr($02b6641aa50ce528$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape(for_black))); // "black"
7674
- for_black = "";
7675
- }
7676
- };
7677
- for (let i = 0; i < whole_text_to_display_.length;) {
7678
- let is_whole_word = true;
7679
- let searching_for_but_with_texts_casing = "";
7680
- const i_at_start = i;
7681
- for (let j = 0; j < searching_for.length; i++, j++) {
7682
- const letter_in_suggestion = whole_text_to_display_[i];
7683
- if ((letter_in_suggestion === null || letter_in_suggestion === void 0 ? void 0 : letter_in_suggestion.toLowerCase()) !== searching_for[j]) {
7684
- is_whole_word = false;
7685
- i = i_at_start;
7686
- break;
8143
+ return $b8hua$ssr($494c9ad553139dbc$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape(text_()), $b8hua$escape($b8hua$createComponent((0, $b8hua$Index), {
8144
+ get each() {
8145
+ return previous_searches_();
8146
+ },
8147
+ children: (item, index) => {
8148
+ const href = $e8776b492383c292$export$91c3b6774e8be0f5({
8149
+ param_: search_query_param_name_,
8150
+ value_: item,
8151
+ url_transformer_: url_transformer_
8152
+ });
8153
+ return $b8hua$ssr($494c9ad553139dbc$var$_tmpl$2, $b8hua$ssrHydrationKey(), "".concat("item", " ").concat($b8hua$createMemo(() => {
8154
+ var _read_selected_index_, _read_selected_index_2;
8155
+ return ((_read_selected_index_ = read_selected_index_()) === null || _read_selected_index_ === void 0 ? void 0 : _read_selected_index_[0]) === 0 && ((_read_selected_index_2 = read_selected_index_()) === null || _read_selected_index_2 === void 0 ? void 0 : _read_selected_index_2[1]) === index;
8156
+ })() ? "selected" : ""), $b8hua$ssrAttribute("href", $b8hua$escape(href(), true), false), $b8hua$escape($b8hua$createComponent((0, $6d95ef50ee01d5a1$export$5d2caaa6b530761c), {})), $b8hua$ssrAttribute("title", $b8hua$escape(item(), true), false), $b8hua$escape(item()), $b8hua$ssrAttribute("title", $b8hua$escape(i18n_.previous_searches_delete_entry_from_history_(), true), false), $b8hua$escape($b8hua$createComponent((0, $9783d437ad61594c$export$3b621d86b1566b2), {})));
7687
8157
  }
7688
- searching_for_but_with_texts_casing += letter_in_suggestion;
7689
- }
7690
- if (is_whole_word) {
7691
- push_black();
7692
- output.push(searching_for_but_with_texts_casing);
7693
- pushed_grey = true;
7694
- } else for_black += whole_text_to_display_[i++];
7695
- }
7696
- push_black();
7697
- if (!pushed_grey) {
7698
- set_has_highlighted(false);
7699
- return whole_text_to_display_;
8158
+ })));
7700
8159
  }
7701
- return output;
7702
- }));
7703
- return $b8hua$ssr($02b6641aa50ce528$var$_tmpl$2, $b8hua$ssrHydrationKey(), "".concat($b8hua$escape(class_, true) || "", " ").concat(get_has_highlighted() ? "has-history-match" : ""), $b8hua$ssrAttribute("title", $b8hua$escape(whole_text_to_display_memo(), true), false), $b8hua$escape(text_itself()));
8160
+ });
7704
8161
  }
7705
8162
  const $3c5e15c6ee4227a9$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>';
7706
8163
  function $3c5e15c6ee4227a9$export$605674723bcc715c() {
@@ -7744,8 +8201,8 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
7744
8201
  } = _ref2;
7745
8202
  return type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title);
7746
8203
  } // don't show the ones we already show from the history
7747
- ));
7748
-
8204
+ ) // + limit to three query suggestions, API sends more sometimes
8205
+ .slice(0, 3));
7749
8206
  const not_queries_memo = $b8hua$createMemo(() => {
7750
8207
  // For the section that shows categories and content results
7751
8208
  // We want to limit to 3 items, and we want to show the categories first
@@ -8586,236 +9043,6 @@ function $8e8ce3f7a5eb11a6$export$41b4894022a3580f() {
8586
9043
  })));
8587
9044
  return style_props_;
8588
9045
  }
8589
- const $f3a159279dc1a8fb$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"];
8590
- const $f3a159279dc1a8fb$var$dont_cut_in_between_less_than_characters = 30;
8591
- function $f3a159279dc1a8fb$export$e1a98a189fd2c0e7(_ref) {
8592
- let {
8593
- content_result_: content_result_,
8594
- key_: key_,
8595
- cut_when_possible_: cut_when_possible_
8596
- } = _ref;
8597
- const matched_tokens = $b8hua$createMemo(() => {
8598
- var _content_result_$high, _content_result_$high2;
8599
- return (_content_result_$high = content_result_().highlights) === null || _content_result_$high === void 0 ? void 0 : (_content_result_$high2 = _content_result_$high.find(highlight => highlight.field == key_)) === null || _content_result_$high2 === void 0 ? void 0 : _content_result_$high2.matched_tokens;
8600
- });
8601
- const full_value = $b8hua$createMemo(() => {
8602
- var _content_result_$key_;
8603
- return (_content_result_$key_ = content_result_()[key_]) === null || _content_result_$key_ === void 0 ? void 0 : _content_result_$key_.replaceAll("\n", " ");
8604
- });
8605
- return $b8hua$createComponent((0, $b8hua$Show), {
8606
- get when() {
8607
- var _matched_tokens;
8608
- return (_matched_tokens = matched_tokens()) === null || _matched_tokens === void 0 ? void 0 : _matched_tokens.length;
8609
- },
8610
- get fallback() {
8611
- return full_value();
8612
- },
8613
- get children() {
8614
- return (() => {
8615
- const segmented_cut_text = $b8hua$createMemo(() => {
8616
- const segmented_text = $f3a159279dc1a8fb$var$segment_text(full_value(), matched_tokens());
8617
- if (cut_when_possible_) $f3a159279dc1a8fb$var$cut_text(segmented_text);
8618
- return segmented_text;
8619
- });
8620
- return $b8hua$createComponent((0, $b8hua$Index), {
8621
- get each() {
8622
- return segmented_cut_text();
8623
- },
8624
- children: item => {
8625
- return $b8hua$createComponent((0, $b8hua$Show), {
8626
- get when() {
8627
- return item().highlighted_;
8628
- },
8629
- get fallback() {
8630
- return item().text_;
8631
- },
8632
- get children() {
8633
- return $b8hua$ssr($f3a159279dc1a8fb$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape(item().text_));
8634
- }
8635
- });
8636
- }
8637
- });
8638
- })();
8639
- }
8640
- });
8641
- }
8642
- function $f3a159279dc1a8fb$var$cut_text(segmented_text) {
8643
- // cut away chunks of text that are not highlighted to give a google-like overview of the content
8644
- const highlighted_segments = segmented_text === null || segmented_text === void 0 ? void 0 : segmented_text.filter(segment => segment.highlighted_);
8645
- if (!segmented_text || !(highlighted_segments !== null && highlighted_segments !== void 0 && highlighted_segments.length)) return;
8646
- // We have one or more highlighted segments
8647
- if (highlighted_segments.length === 1) {
8648
- // cut away from the left until the start of the highlighted sentence if just one sentence is highlighted
8649
- $f3a159279dc1a8fb$var$cut_start(segmented_text.indexOf(highlighted_segments[0]), segmented_text);
8650
- return;
8651
- }
8652
- // We have two or more highlighted segments, take the two biggest chunks and show them + a bit text around
8653
- const sorted_highlighted_segments = [...highlighted_segments].sort((a, b) => b.text_.trim().length - a.text_.trim().length // trim to avoid unfair comparisons due to whitespace
8654
- );
8655
-
8656
- const [longest_segment, next_longest_segment] = sorted_highlighted_segments;
8657
- // We need to cut before the first segment - possibly through other segments - and maybe between segments
8658
- let [index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
8659
- $f3a159279dc1a8fb$var$cut_start(index_of_first_segment, segmented_text);
8660
- // update indexes since we might have removed segments
8661
- [index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
8662
- let number_of_characters_between_segments = 0;
8663
- for (let i = index_of_first_segment + 1; i < index_of_second_segment; i++) {
8664
- const segment = segmented_text[i];
8665
- number_of_characters_between_segments += segment.text_.length;
8666
- }
8667
- if (number_of_characters_between_segments < $f3a159279dc1a8fb$var$dont_cut_in_between_less_than_characters)
8668
- // don't cut if there are less than 30 characters between the two segments
8669
- return;
8670
- // We have more than 50 characters between the two segments, cut between them
8671
- const [split_start_segment, split_start_character] = $f3a159279dc1a8fb$var$find_split_point(index_of_first_segment, index_of_second_segment, segmented_text);
8672
- const [split_end_segment, split_end_character] = $f3a159279dc1a8fb$var$find_split_point(index_of_second_segment, index_of_first_segment, segmented_text);
8673
- if (split_start_segment === undefined || split_end_segment === undefined ||
8674
- // identical split point, or split end before split start, can't do anything
8675
- split_start_segment == split_end_segment && split_start_character >= split_end_character || split_start_segment > split_end_segment) return;
8676
- const dots_segment = {
8677
- text_: " … ",
8678
- highlighted_: false
8679
- };
8680
- const split_and_dotted_values = segmented_text.flatMap((segment, i) => {
8681
- if (i < split_start_segment || i > split_end_segment) return segment;
8682
- const text = segment.text_;
8683
- if (i == split_end_segment && i == split_start_segment) return [{
8684
- ...segment,
8685
- text_: text.slice(0, split_start_character).trimEnd()
8686
- }, dots_segment, {
8687
- ...segment,
8688
- text_: text.slice(split_end_character + 1, text.length).trimStart()
8689
- }];else if (i == split_start_segment) {
8690
- segment.text_ = text.slice(0, split_start_character).trimEnd(); // this would be split_start_character + 1, but we want to remove the last "dot" because . ... looks weird
8691
- return segment;
8692
- } else if (i == split_end_segment) return [dots_segment, {
8693
- ...segment,
8694
- text_: text.slice(split_end_character + 1, text.length).trimStart()
8695
- }];
8696
- return []; // remove all segments inbetween
8697
- });
8698
-
8699
- segmented_text.splice(0, segmented_text.length, ...split_and_dotted_values); // Sorry…
8700
- $f3a159279dc1a8fb$var$heal_holes(segmented_text);
8701
- }
8702
- function $f3a159279dc1a8fb$var$heal_holes(segmented_text) {
8703
- // try to heal "holes" created in the segments so there are only alternating segments
8704
- const segments_to_delete = new Set();
8705
- for (let i = 0; i < segmented_text.length; i++) {
8706
- var _previous_segment, _previous_segment2;
8707
- const segment = segmented_text[i];
8708
- let previous_segment;
8709
- for (let j = i - 1; j >= 0; j--) {
8710
- previous_segment = segmented_text[j];
8711
- // Don't write to a segment that's marked for deletion or the contents we write to it will be deleted
8712
- if (!segments_to_delete.has(previous_segment)) break;
8713
- }
8714
- if ((_previous_segment = previous_segment) !== null && _previous_segment !== void 0 && _previous_segment.highlighted_ && segment.highlighted_ || ((_previous_segment2 = previous_segment) === null || _previous_segment2 === void 0 ? void 0 : _previous_segment2.highlighted_) === false && segment.highlighted_ === false) {
8715
- previous_segment.text_ += segment.text_; // IDK if this ever happens
8716
- segments_to_delete.add(segment);
8717
- }
8718
- }
8719
- for (const segment of segments_to_delete) {
8720
- const index = segmented_text.indexOf(segment);
8721
- segmented_text.splice(index, 1);
8722
- }
8723
- }
8724
- function $f3a159279dc1a8fb$var$find_split_point(index_of_start_segment, index_of_end_segment, segmented_text) {
8725
- let be_very_aggressive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
8726
- const should_loop_backwards = index_of_start_segment > index_of_end_segment;
8727
- const step = should_loop_backwards ? -1 : 1;
8728
- const desperate_split_attempts = [":", ";", ","];
8729
- while (desperate_split_attempts.length) {
8730
- const split_point_between_words = [];
8731
- // for the middle also try to split with a few more characters if the default ones don't work over a full run
8732
- const desperate_split_attempt = desperate_split_attempts.pop();
8733
- let is_first_character = true;
8734
- for (let i = index_of_start_segment + step; should_loop_backwards ? i > index_of_end_segment : i < index_of_end_segment; i += step) {
8735
- const segment = segmented_text[i];
8736
- const text = segment.text_;
8737
- for (let j = should_loop_backwards ? text.length - 1 : 0; should_loop_backwards ? j >= 0 : j < text.length; j += step) {
8738
- const character = text[j];
8739
- if (character == "." || character == "?" || character == "!" || character == desperate_split_attempt) return [i, j]; // segment index, character index
8740
- if (is_first_character) is_first_character = false;else if (be_very_aggressive && character == " ") {
8741
- split_point_between_words.push([i, j]);
8742
- if (split_point_between_words.length > 3)
8743
- // We can't find a split point, so we'll just split between words
8744
- // This is because for UI reasons we only want to show 2 lines of text, so we need to be very aggressive with getting the second match soon
8745
- return split_point_between_words[1];
8746
- }
8747
- }
8748
- }
8749
- }
8750
- return [];
8751
- }
8752
- function $f3a159279dc1a8fb$var$cut_start(cut_left_of_index, segmented_text) {
8753
- // Cut the start of the text to bring the first matching token
8754
- let is_first_character = false;
8755
- let words_encountered = 0;
8756
- outmost_loop: for (let i = cut_left_of_index - 1; i >= 0; i--) {
8757
- const segment = segmented_text[i];
8758
- // We assume that two adjacent highlighted segments don't exist and have been merged if they were to have existed
8759
- const text = segment.text_;
8760
- for (let j = text.length - 1; j >= 0; j--) {
8761
- const character = text[j];
8762
- const is_space = character == " ";
8763
- if (!is_first_character && is_space) words_encountered++;
8764
- if (character == "." || character == "?" || character == "!" || character == "," || words_encountered > 8 && is_space) {
8765
- // We have to be really aggressive at the start of sentences so stuff can be seen on mobile, hence comma
8766
- segment.text_ = text.slice(j + 1).trimStart();
8767
- segmented_text.splice(0, i);
8768
- if (character === "," || is_space)
8769
- // if we cut at a comma or psace, we add a … at the beginning
8770
- segmented_text.unshift({
8771
- text_: "… ",
8772
- highlighted_: false
8773
- });
8774
- break outmost_loop;
8775
- }
8776
- if (is_first_character) is_first_character = false;
8777
- }
8778
- }
8779
- $f3a159279dc1a8fb$var$heal_holes(segmented_text); // if we added a ... there could now be a sequence that's not alternating true/false
8780
- }
8781
-
8782
- function $f3a159279dc1a8fb$var$segment_text(text, matched_strings) {
8783
- // segment text where the matched strings are highlighted sections
8784
- const output = [];
8785
- if (!text) return; // shouldn't happen but whatever
8786
- for (let i = 0; i < text.length; i++) {
8787
- const found_strings = [];
8788
- if (!i || text[i - 1] == " ")
8789
- // only match at the start of a word or string, it looks weird if i.e. "we" is highlighted in "activewear
8790
- for (let j = 0; j < matched_strings.length; j++) {
8791
- const matched_string = matched_strings[j];
8792
- const part_in_text = text.slice(i, i + matched_string.length);
8793
- if (matched_string.length < 2) continue; // don't match on single characters, i.e. "I", it looks weird
8794
- if (part_in_text.toLowerCase() === matched_string.toLowerCase()) found_strings.push(part_in_text); // use the casing from the text, not from typesense, can look weird otherwise
8795
- }
8796
-
8797
- const last_index_in_output = output.length - 1;
8798
- if (!found_strings.length) {
8799
- var _output$last_index_in;
8800
- const character = text[i];
8801
- if (((_output$last_index_in = output[last_index_in_output]) === null || _output$last_index_in === void 0 ? void 0 : _output$last_index_in.highlighted_) === false || output.length && /\s/.test(character))
8802
- // always push whitespace characters to the last segment, this is because typesense doesn't see them as part of the matched tokens but we want to be able to detect "phat" matched segments
8803
- output[last_index_in_output].text_ += character;else output.push({
8804
- highlighted_: false,
8805
- text_: character
8806
- });
8807
- } else {
8808
- var _output$last_index_in2;
8809
- const longest_found_string = found_strings.reduce((a, b) => a.length > b.length ? a : b);
8810
- if ((_output$last_index_in2 = output[last_index_in_output]) !== null && _output$last_index_in2 !== void 0 && _output$last_index_in2.highlighted_) output[last_index_in_output].text_ += longest_found_string;else output.push({
8811
- highlighted_: true,
8812
- text_: longest_found_string
8813
- });
8814
- i += longest_found_string.length - 1;
8815
- }
8816
- }
8817
- return output;
8818
- }
8819
9046
  const $22470de5f42cc35d$var$_tmpl$ = ["<div", ' class="description line-clamp">', "</div>"],
8820
9047
  $22470de5f42cc35d$var$_tmpl$2 = ["<div", ' class="content-card"><div class="image">', '</div><div class="info"><!--$-->', "<!--/--><!--$-->", "<!--/--></div></div>"];
8821
9048
  function $22470de5f42cc35d$export$f631859cab12b342(_ref) {
@@ -10340,4 +10567,4 @@ const $d399250dfa491636$export$c3834fa86c616831 = [[4], [3, 1024], [2, 901]];
10340
10567
  const $d399250dfa491636$export$864d304a0bc46829 = "2%";
10341
10568
  const $d399250dfa491636$export$7bf543b9d9be2c22 = (0, $fa332ea03168857c$export$b91cec6bdc6b32a1);
10342
10569
  $b8hua$add_to_version_info("ui", (0, $8db9a15135765c11$export$83d89fbfd8236492));
10343
- export { $2855bffe06ef7a03$export$916e6850778505f6 as strip_encoded_filter_and_sort, $2855bffe06ef7a03$export$58aa3f171519b6d7 as encode_filters, $2855bffe06ef7a03$export$f934fa24c3a86811 as decode_filters, $4df489344a0f97c7$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $5441862cd2f5e111$export$e68cff63f76bd15b as ListingProvider, $5441862cd2f5e111$export$8d0c4fdbb05a2f2e as useListing, $4df489344a0f97c7$export$e4b984597b71e989 as ShopifyContainedImage, $002f09d00aac50b2$export$6649caad96ef8870 as SlidableItems, $0dc044cffe1e825b$export$9f191182275e9ef as make_accurate_size_accessor, $d5d7e58c5c9d8db0$export$9574e176201e5e8d as RecommendationSlider, $b432b11321ad4c97$export$9756467d34d91cdb as RecommendationGrid, $56047603f9d212b6$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $56047603f9d212b6$export$e6fffe67d4cdd848 as makeSizeAccessor, $801e8845d3fa3653$export$94026ee33dbabc26 as ImageContainer, $74777e8fe65b3dcb$export$b69d0d92862de18b as SentryErrorBoundary, $ad371564683947ab$export$6c6d7a51fa9aa15d as ExpandingDetails, $e18ab2868df26f40$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $4711a82d08d2021b$export$fecbb157621501bd as SelectedFilters, $f6b0500577e1b210$export$3f1a388cc0d8fed7 as FilterBody, $44aa24b1bb793549$export$b288c38ae3fddb56 as create_modified_filters, $63f1f8dbcd07d3b0$export$d21e32dfedac04be as SolidLayout, $d5f1e6a0f9117286$export$79b1565500412d9b as general_modal_abstraction, $9783d437ad61594c$export$3b621d86b1566b2 as CrossIcon, $ca6ab5f08bd28bca$export$8be2714ec7f169ee as GenericSliderArrowButton, $5c5732ef44f05b26$export$58e808b1db15d3bc as fetchDepictRecommendations, $f5f54892fd0c7d9f$export$de035477d6fef996 as QuickLinks, $f5f54892fd0c7d9f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $fa332ea03168857c$export$b91cec6bdc6b32a1 as CategoryTitle, $702d7656a373973e$export$824dde41348efed1 as embedded_num_products, $96fd967c5b358ead$export$643598a327b5833e as get_categories, $f5f54892fd0c7d9f$export$f34314aa9505732e as DepictCategory, $f5f54892fd0c7d9f$export$e2bf8ce7779e827e as CategoryPage, $eb064bc3350276c1$export$ac6237957a15b3f0 as DepictSearch, $eb064bc3350276c1$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $eb064bc3350276c1$export$f2dc7e4e4aa11abb as SearchPage, $eb064bc3350276c1$export$316f6f283ae64765 as SearchField, $f3b7124b76123e44$export$aa14a9f43128f61f as ProductCardError, $169c13c0531d91d2$export$d86a33413558014e as open_modal_with_alignment, $5eaa00b951637e96$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $1308a7816c3d4f2d$export$b3ad617e9036868 as align_field, $a9c7ba6087881ac2$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $cc64aabf2c7a1f1a$export$1233ca167bf71f9a as styles_to_valid_css_string, $e56d241d0f33d459$export$fe334901e8bebd57 as disable_scrolling, $573c007c697a1831$export$d0596b5cae35ad4 as open_search_with_shift_slash, $284849364a6ef73a$export$e015ed2f2950f2e3 as DepictAPI, $00a5b94f0c11efbb$export$d9f36cf74e24d595 as media_query_to_accessor, $e60a76195ac6d408$export$689e204eadb33baf as setup_fast_leave, $a61a2051e15c8d7a$export$5196e4c01fa56fcb as show_toast, $60ec7a29849d81db$export$a71e92cfbb498adc as SolidFormatPrice, $37e8c97bb6876197$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $bc2337c9a05ecd18$export$acb3eaade4b23afd as BasePlaceholder, $ceafb6fb91c6f394$export$89c6019e4baa40b1 as TextPlaceholder, $3ab4aa97880fb88d$export$3f37af283f8fb843 as ImagePlaceholder, $f9fd3017c20b774a$export$3ccaa27d81dd8556 as PageReplacer, $d399250dfa491636$export$864d304a0bc46829 as defaultGridSpacing, $d399250dfa491636$export$c3834fa86c616831 as defaultColsAtSize, $d399250dfa491636$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $8db9a15135765c11$export$83d89fbfd8236492 as version };
10570
+ export { $2855bffe06ef7a03$export$916e6850778505f6 as strip_encoded_filter_and_sort, $2855bffe06ef7a03$export$58aa3f171519b6d7 as encode_filters, $2855bffe06ef7a03$export$f934fa24c3a86811 as decode_filters, $4df489344a0f97c7$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $5441862cd2f5e111$export$e68cff63f76bd15b as ListingProvider, $5441862cd2f5e111$export$8d0c4fdbb05a2f2e as useListing, $4df489344a0f97c7$export$e4b984597b71e989 as ShopifyContainedImage, $002f09d00aac50b2$export$6649caad96ef8870 as SlidableItems, $fc830a7ee59416ef$export$ebdc3711f7e02ccd as make_accurate_width_accessor, $d5d7e58c5c9d8db0$export$9574e176201e5e8d as RecommendationSlider, $b432b11321ad4c97$export$9756467d34d91cdb as RecommendationGrid, $56047603f9d212b6$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $56047603f9d212b6$export$e6fffe67d4cdd848 as makeSizeAccessor, $801e8845d3fa3653$export$94026ee33dbabc26 as ImageContainer, $74777e8fe65b3dcb$export$b69d0d92862de18b as SentryErrorBoundary, $ad371564683947ab$export$6c6d7a51fa9aa15d as ExpandingDetails, $e18ab2868df26f40$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $4711a82d08d2021b$export$fecbb157621501bd as SelectedFilters, $f6b0500577e1b210$export$3f1a388cc0d8fed7 as FilterBody, $44aa24b1bb793549$export$b288c38ae3fddb56 as create_modified_filters, $63f1f8dbcd07d3b0$export$d21e32dfedac04be as SolidLayout, $d5f1e6a0f9117286$export$79b1565500412d9b as general_modal_abstraction, $9783d437ad61594c$export$3b621d86b1566b2 as CrossIcon, $ca6ab5f08bd28bca$export$8be2714ec7f169ee as GenericSliderArrowButton, $5c5732ef44f05b26$export$58e808b1db15d3bc as fetchDepictRecommendations, $f5f54892fd0c7d9f$export$de035477d6fef996 as QuickLinks, $f5f54892fd0c7d9f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $fa332ea03168857c$export$b91cec6bdc6b32a1 as CategoryTitle, $702d7656a373973e$export$824dde41348efed1 as embedded_num_products, $96fd967c5b358ead$export$643598a327b5833e as get_categories, $f5f54892fd0c7d9f$export$f34314aa9505732e as DepictCategory, $f5f54892fd0c7d9f$export$e2bf8ce7779e827e as CategoryPage, $eb064bc3350276c1$export$ac6237957a15b3f0 as DepictSearch, $eb064bc3350276c1$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $eb064bc3350276c1$export$f2dc7e4e4aa11abb as SearchPage, $eb064bc3350276c1$export$316f6f283ae64765 as SearchField, $f3b7124b76123e44$export$aa14a9f43128f61f as ProductCardError, $169c13c0531d91d2$export$d86a33413558014e as open_modal_with_alignment, $5eaa00b951637e96$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $1308a7816c3d4f2d$export$b3ad617e9036868 as align_field, $a9c7ba6087881ac2$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $cc64aabf2c7a1f1a$export$1233ca167bf71f9a as styles_to_valid_css_string, $e56d241d0f33d459$export$fe334901e8bebd57 as disable_scrolling, $573c007c697a1831$export$d0596b5cae35ad4 as open_search_with_shift_slash, $284849364a6ef73a$export$e015ed2f2950f2e3 as DepictAPI, $00a5b94f0c11efbb$export$d9f36cf74e24d595 as media_query_to_accessor, $e60a76195ac6d408$export$689e204eadb33baf as setup_fast_leave, $a61a2051e15c8d7a$export$5196e4c01fa56fcb as show_toast, $60ec7a29849d81db$export$a71e92cfbb498adc as SolidFormatPrice, $37e8c97bb6876197$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $bc2337c9a05ecd18$export$acb3eaade4b23afd as BasePlaceholder, $ceafb6fb91c6f394$export$89c6019e4baa40b1 as TextPlaceholder, $3ab4aa97880fb88d$export$3f37af283f8fb843 as ImagePlaceholder, $f9fd3017c20b774a$export$3ccaa27d81dd8556 as PageReplacer, $d399250dfa491636$export$864d304a0bc46829 as defaultGridSpacing, $d399250dfa491636$export$c3834fa86c616831 as defaultColsAtSize, $d399250dfa491636$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $8db9a15135765c11$export$83d89fbfd8236492 as version };