@depict-ai/ui 2.0.26 → 2.1.0

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.
@@ -4,6 +4,7 @@ var $3hooq$solidjs = require("solid-js");
4
4
  var $3hooq$babelruntimehelpersclassPrivateFieldSet = require("@babel/runtime/helpers/classPrivateFieldSet");
5
5
  var $3hooq$babelruntimehelpersclassPrivateFieldGet = require("@babel/runtime/helpers/classPrivateFieldGet");
6
6
  var $3hooq$babelruntimehelpersdefineProperty = require("@babel/runtime/helpers/defineProperty");
7
+ var $3hooq$solidjsstore = require("solid-js/store");
7
8
  require("../../multi_import_deduplicator.cjs").register_es_version("ui", "ES10");
8
9
  function $parcel$export(e, n, v, s) {
9
10
  Object.defineProperty(e, n, {
@@ -75,7 +76,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
75
76
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
76
77
  $parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
77
78
  /*! Depict.ai search and product listing SDK */
78
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.26";
79
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.1.0";
79
80
  const $a68b73fd7ba0853f$var$fallback_operator = "in";
80
81
  const $a68b73fd7ba0853f$var$fallback_token = "";
81
82
  const $a68b73fd7ba0853f$var$legacy_filter_prefix = "filter_";
@@ -481,7 +482,7 @@ const $5401a6698b0c0658$export$6daf8749b65a1b77 = cols_at_size => {
481
482
  return $5401a6698b0c0658$var$transform_elements(sorted_cols_at_size);
482
483
  };
483
484
  function $8edd3cf30d1fd8b4$export$a2cc176055f8f08() {
484
- const text = "Please try setting `columnsAtSize` on the `SearchPage`/`CategoryPage` components to change the grid before setting it with CSS. If you do with CSS, set `columnsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
485
+ const text = "Please try setting `columnsAtSize`/`gridSpacing` on the `SearchPage`/`CategoryPage` components to change the grid before setting it with CSS. If you do with CSS, set `columnsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
485
486
  return (0, $3hooq$solidjsweb.isServer) ? {
486
487
  t: "<!-- ".concat(text, " -->")
487
488
  } : document.createComment(text);
@@ -503,12 +504,13 @@ let $e3915574cfd3466c$var$rendering_cached_placeholder_element;
503
504
  function $e3915574cfd3466c$export$f33414a4df0afd3f(_ref) {
504
505
  let {
505
506
  product_card_template_: product_card_template_,
506
- num_placeholders_: num_placeholders_
507
+ num_placeholders_: num_placeholders_,
508
+ content_blocks_: content_blocks_
507
509
  } = _ref;
508
- const [get_elements, set_elements] = $3hooq$solidjs.createSignal([]);
509
- let existing_num = 0;
510
+ const [num_to_actually_show, set_num_to_actually_show] = $3hooq$solidjs.createSignal($3hooq$solidjs.untrack(num_placeholders_));
510
511
  if (0, $3hooq$solidjsweb.isServer)
511
512
  // want to render simple placeholders on server, effects don't run there
513
+ // FIXME when adding proper SSR: also SSR content blocks
512
514
  return $3hooq$solidjs.createMemo(() => Array.from({
513
515
  length: num_placeholders_()
514
516
  }).map(() => {
@@ -517,19 +519,33 @@ function $e3915574cfd3466c$export$f33414a4df0afd3f(_ref) {
517
519
  if (typeof (template_result === null || template_result === void 0 ? void 0 : template_result.then) !== "function") return template_result;
518
520
  }));
519
521
  $3hooq$solidjs.createRenderEffect(() => {
522
+ const existing_num = num_to_actually_show();
520
523
  const to_add = num_placeholders_() - existing_num;
521
524
  if (to_add <= 0) return;
522
525
  // Below comment is from when we used recommendation renderer and manual DOM manipulation for this, but I'm still scared to remove placeholders and mess up scroll restoration, so I'm keeping the way it worked. Otherwise, <Index> could be used which would be far more elegant.
523
526
  // We don't need to remove placeholders, only need to add. The reason for that is that chrome restores the scroll position once all tasks queued as reaction of the "popstate" events have been completed in the task queue. That means that we need to get the placeholders in fast, or we might lose scroll position if the previous site was shorter.
524
527
  // The query id and the amount might update in separate tasks because one comes from href_change_ipns and the other one from another "popstate" listener. Therefore, we need to be able to dynamically add more placeholders. I'm not entirely sure about this anymore though, since we have the scroll position on a per-id basis it might work anyway but THIS WORKS, and I've been working on this bug for 3 hours so let's just keep it this way.
525
- set_elements(prev => [...prev, ...Array.from({
526
- length: to_add
527
- }).map(() => $e3915574cfd3466c$var$Placeholder({
528
- product_card_template_: product_card_template_
529
- }))]);
530
- existing_num += to_add;
528
+ // Above comments were from when we added elements in this createRenderEffect. Now I changed it to just increment the number and render them from an <Index> instead, so I can add content blocks better
529
+ // Functionality should be the same
530
+ set_num_to_actually_show(existing_num + to_add);
531
+ });
532
+ return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Index), {
533
+ get each() {
534
+ return Array.from({
535
+ length: num_to_actually_show()
536
+ });
537
+ },
538
+ children: (_item, index) => {
539
+ const possible_content_block = $3hooq$solidjs.createMemo(() => {
540
+ var _content_blocks_, _content_blocks_2;
541
+ return content_blocks_ === null || content_blocks_ === void 0 ? void 0 : (_content_blocks_ = content_blocks_()) === null || _content_blocks_ === void 0 ? void 0 : (_content_blocks_2 = _content_blocks_()) === null || _content_blocks_2 === void 0 ? void 0 : _content_blocks_2[index];
542
+ });
543
+ // Show content block before product card, so it's *at* that index
544
+ return [possible_content_block, $e3915574cfd3466c$var$Placeholder({
545
+ product_card_template_: product_card_template_
546
+ })]; // https://github.com/solidjs/solid/releases/tag/v1.7.0
547
+ }
531
548
  });
532
- return get_elements; // https://github.com/solidjs/solid/releases/tag/v1.7.0
533
549
  }
534
550
  /**
535
551
  * Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
@@ -620,7 +636,8 @@ function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
620
636
  merchant_: merchant_,
621
637
  market_: market_,
622
638
  product_card_template_: product_card_template_,
623
- do_per_elements_: do_per_elements_
639
+ do_per_elements_: do_per_elements_,
640
+ content_blocks_: content_blocks_
624
641
  } = _ref;
625
642
  return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.For), {
626
643
  get each() {
@@ -628,6 +645,10 @@ function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
628
645
  },
629
646
  children: (product_id, index) => {
630
647
  const owner = $3hooq$solidjs.getOwner();
648
+ const possible_content_block = $3hooq$solidjs.createMemo(() => {
649
+ var _content_blocks_, _content_blocks_2;
650
+ return content_blocks_ === null || content_blocks_ === void 0 ? void 0 : (_content_blocks_ = content_blocks_()) === null || _content_blocks_ === void 0 ? void 0 : (_content_blocks_2 = _content_blocks_()) === null || _content_blocks_2 === void 0 ? void 0 : _content_blocks_2[index()];
651
+ });
631
652
  const display_accessor = $3hooq$solidjs.createMemo(prev => {
632
653
  const new_display = displays_by_key_().get(product_id);
633
654
  if (prev && $76012c4468a53d1f$var$deep_equal(prev, new_display))
@@ -681,7 +702,9 @@ function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
681
702
  }
682
703
  do_per_elements_ === null || do_per_elements_ === void 0 || do_per_elements_(elements, index);
683
704
  });
684
- return product_card_resource; // https://github.com/solidjs/solid/releases/tag/v1.7.0
705
+ return [
706
+ // Show content block before product card, so it's *at* that index
707
+ possible_content_block, product_card_resource]; // https://github.com/solidjs/solid/releases/tag/v1.7.0
685
708
  }
686
709
  });
687
710
  }
@@ -4035,7 +4058,9 @@ function $0d3ee7000f047e67$export$a1fd619a4743ca08(_ref) {
4035
4058
  min_products_to_fetch_: min_products_to_fetch_,
4036
4059
  query_base_: query_base_,
4037
4060
  depict_api_: depict_api_,
4038
- is_loading_: is_loading_
4061
+ is_loading_: is_loading_,
4062
+ content_blocks_: content_blocks_,
4063
+ set_number_loaded_displays_: set_number_loaded_displays_
4039
4064
  } = _ref;
4040
4065
  // The following sets up an intersection observer to determine which results are in the viewport, used for the ScrollStatus indicator and knowing when to load more
4041
4066
  const target_to_index_map = new Map();
@@ -4082,11 +4107,13 @@ function $0d3ee7000f047e67$export$a1fd619a4743ca08(_ref) {
4082
4107
  query_base_: query_base_,
4083
4108
  depict_api_: depict_api_
4084
4109
  });
4110
+ $3hooq$solidjs.createComputed(() => set_number_loaded_displays_(displays_by_key_().size));
4085
4111
  return $76012c4468a53d1f$export$43f0fb951fcb0c54({
4086
4112
  displays_by_key_: displays_by_key_,
4087
4113
  merchant_: merchant_,
4088
4114
  market_: market_,
4089
4115
  product_card_template_: product_card_template_,
4116
+ content_blocks_: content_blocks_,
4090
4117
  do_per_elements_: (elements, index_accessor) =>
4091
4118
  // Adds/removes elements from the "results in viewport" intersection observer above
4092
4119
  $3hooq$solidjs.createEffect(() => {
@@ -4108,6 +4135,334 @@ function $0d3ee7000f047e67$export$a1fd619a4743ca08(_ref) {
4108
4135
  })
4109
4136
  });
4110
4137
  }
4138
+ const $830518481649feb1$var$_tmpl$ = ["<style", ' type="text/css">', "</style>"];
4139
+ const $830518481649feb1$export$c500183c31c2b22e = "--spans-columns";
4140
+ function $830518481649feb1$export$ab6b147eec64fea5(props) {
4141
+ const container_class = "x" + $3hooq$solidjs.createUniqueId();
4142
+ const container_element_ = $3hooq$solidjsweb.ssrElement("div", () => ({
4143
+ ...props.element_attributes,
4144
+ "classList": {
4145
+ [container_class]: true
4146
+ }
4147
+ }), () => $3hooq$solidjsweb.escape(props.children), true); // Don't want this in the error boundary below, it should only be for the actual layouting
4148
+ return $3hooq$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
4149
+ message_: "Failed calculating css grid layout",
4150
+ severity_: "error",
4151
+ get children() {
4152
+ return $830518481649feb1$export$e2f22da34aaf310a(props, container_element_, false, container_class);
4153
+ }
4154
+ });
4155
+ }
4156
+ function $830518481649feb1$export$e2f22da34aaf310a(props, container_element) {
4157
+ let insert_after_container = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
4158
+ let container_class = arguments.length > 3 ? arguments[3] : undefined;
4159
+ if (!container_class) {
4160
+ // only try to add if it wasn't provided, so that we have a code path without classList when doing SSR
4161
+ container_class = $3hooq$depictaiutilishared.make_random_classname();
4162
+ container_element.classList.add(container_class);
4163
+ }
4164
+ const container_selector = ".depict .".concat(container_class); // class so ppl can have id if needed
4165
+ const col_styling = $3hooq$solidjs.createMemo(() => $830518481649feb1$var$generate_media_queried_declarations({
4166
+ container_selector_: container_selector,
4167
+ default_grid_spacing_text: props.grid_spacing,
4168
+ cols_at_size_: props.cols_at_size,
4169
+ override_vertical_spacing_: props.override_vertical_spacing,
4170
+ top_row_shortened_by_: props.top_row_shortened_by_()
4171
+ }));
4172
+ const base_styling = $3hooq$solidjs.createMemo(() => {
4173
+ return "".concat(container_selector, "{display:grid;}");
4174
+ });
4175
+ const get_styling = $3hooq$solidjs.createMemo(() => base_styling() + col_styling());
4176
+ const style_element = $3hooq$solidjsweb.ssr($830518481649feb1$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), get_styling); // need to create this after set_styling has been called or else there will be no styling in the SSR'd output
4177
+ if (insert_after_container) container_element.after(style_element);
4178
+ return [container_element, style_element];
4179
+ }
4180
+ function $830518481649feb1$var$generate_media_queried_declarations(_ref) {
4181
+ let {
4182
+ container_selector_: container_selector_,
4183
+ default_grid_spacing_text: default_grid_spacing_text,
4184
+ cols_at_size_: cols_at_size_,
4185
+ override_vertical_spacing_: override_vertical_spacing_,
4186
+ top_row_shortened_by_: top_row_shortened_by_
4187
+ } = _ref;
4188
+ return cols_at_size_.map(options => {
4189
+ const [n_cols, min, max, grid_spacing_for_size] = options;
4190
+ const spacing_to_use = grid_spacing_for_size || default_grid_spacing_text;
4191
+ // See comment in else block below
4192
+ const can_use_gap = $830518481649feb1$var$can_use_gap_for_unit(spacing_to_use) && (!override_vertical_spacing_ || $830518481649feb1$var$can_use_gap_for_unit(override_vertical_spacing_));
4193
+ let spacing_styling;
4194
+ let additional_styling = ""; // outside the media query
4195
+ if (can_use_gap) spacing_styling = "gap:".concat(spacing_to_use, ";").concat(override_vertical_spacing_ ? "row-gap:".concat(override_vertical_spacing_, ";") : "");else {
4196
+ // When using percent units, which our default styling does (because convenient) and our interface relies on (hard to specify different gaps for different screen sizes)
4197
+ // row gaps in grids are relative to the whole height of the grid, maybe see also https://stackoverflow.com/a/53563865. The issue with that is that as we load more products, the gap grows. Also, it breaks existing integrations.
4198
+ // Logical thought: use margins for the vertical spacing. But margins in grids are apparently relative to the size of the individual items in grids.
4199
+ // Given that, and that content blocks can be of different width, we have to do some complicated calculations to convert the provided gap, which is in gap of the total container width, to a margin of the individual items.
4200
+ const width_multiplier = "var(".concat($830518481649feb1$export$c500183c31c2b22e, ", 1)"); // How many cards wide the current item is (needed because content blocks)
4201
+ const one_item_width_exclusing_gaps = "calc(calc(100 / ".concat(n_cols, ") - calc(calc(").concat(n_cols * 2 - 2, " * calc(").concat($830518481649feb1$var$strip_percent_unit(spacing_to_use), " / 2)) / ").concat(n_cols, "))"); // Width of one item in percent of the whole
4202
+ // Equation from layout.tsx, also used in CheckboxGrid. Needs half spacing for some reason
4203
+ const this_item_width_meat = "calc(".concat(one_item_width_exclusing_gaps, " * ").concat(width_multiplier, ")"); // Width of just the card
4204
+ const this_item_width_gaps = "calc(calc(".concat(width_multiplier, " - 1) * ").concat($830518481649feb1$var$strip_percent_unit(spacing_to_use), ")"); // Width of the gaps
4205
+ const this_item_width = "calc(".concat(this_item_width_meat, " + ").concat(this_item_width_gaps, ")"); // Width of this item including gaps
4206
+ // this_item_width needs to be unitless, and since plain css can't do calc(40% / 5%) which would become unitless we need to strip all units in the calculations before
4207
+ const convert_top_spacing_to_item_width_percentage = spacing => "calc(calc(100 / ".concat(this_item_width, ") * ").concat(spacing, ")"); // Now finally we can convert the desired spacing to a percentage of this individual item's width (including gaps that would be there but aren't because content blocks span them)
4208
+ spacing_styling = "column-gap:".concat(spacing_to_use, ";"); // Still use gaps in the horizontal direction because that works flawlessly
4209
+ // Re-use old layout code to get the correct :nth-child declarations for the top margins
4210
+ additional_styling = $3hooq$depictaiutilishared.n_col_styling_with_dist(container_selector_ + ">", convert_top_spacing_to_item_width_percentage(default_grid_spacing_text), [[n_cols, min, max, grid_spacing_for_size ? convert_top_spacing_to_item_width_percentage(grid_spacing_for_size) : null]], "grid", override_vertical_spacing_ ? convert_top_spacing_to_item_width_percentage(override_vertical_spacing_) : override_vertical_spacing_, top_row_shortened_by_);
4211
+ }
4212
+ const media_query_body = "".concat(container_selector_, "{").concat(spacing_styling, "grid-template-columns:repeat(").concat(n_cols, ",minmax(0,1fr));}");
4213
+ return "".concat($3hooq$depictaiutilishared.layout_media_query_header(min, max), "{").concat(media_query_body, "}").concat(additional_styling);
4214
+ }).join("");
4215
+ }
4216
+ function $830518481649feb1$var$can_use_gap_for_unit(spacing) {
4217
+ const trimmed_spacing = spacing.trim();
4218
+ return !trimmed_spacing.includes("%");
4219
+ }
4220
+ function $830518481649feb1$var$strip_percent_unit(css_value) {
4221
+ return css_value.replaceAll("%", "");
4222
+ }
4223
+ function $c749e60bca5000cb$export$cb5808ba002cdeed(_ref) {
4224
+ let {
4225
+ layout_options_: layout_options_,
4226
+ sort_or_filter_open_: sort_or_filter_open_
4227
+ } = _ref;
4228
+ return $3hooq$solidjs.createMemo(() => {
4229
+ const layout_options = layout_options_();
4230
+ // Add grid styling that changes when filters get opened/closed
4231
+ const when_filters_closed_cols = layout_options.cols_at_size;
4232
+ return sort_or_filter_open_() ? when_filters_closed_cols.map(row => {
4233
+ const [num_cols_default,,,, override_cols] = row;
4234
+ const cloned_row = [...row];
4235
+ // @ts-ignore
4236
+ cloned_row[0] = num_cols_default - 1;
4237
+ if (override_cols)
4238
+ // @ts-ignore
4239
+ cloned_row[4] = {
4240
+ overrides: Object.fromEntries(Object.entries(override_cols.overrides).map(_ref2 => {
4241
+ let [row, column] = _ref2;
4242
+ return [row, column - 1];
4243
+ }))
4244
+ };
4245
+ return cloned_row;
4246
+ }) : when_filters_closed_cols;
4247
+ });
4248
+ }
4249
+ function $85fcdab554c24789$export$a79e666719b3647c(cols_at_size_) {
4250
+ const size_active = $3hooq$solidjs.createMemo(() => cols_at_size_().map(_ref => {
4251
+ let [n_cols, min_width, max_width] = _ref;
4252
+ const media_query = $3hooq$depictaiutilishared.layout_media_query_header(min_width, max_width).replaceAll("@media", "");
4253
+ const matches = $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query);
4254
+ return [matches, n_cols];
4255
+ }));
4256
+ const n_cols_currently_showing = $3hooq$solidjs.createMemo(() => {
4257
+ try {
4258
+ const [, n_cols_currently_showing] = size_active().find(_ref2 => {
4259
+ let [media_query] = _ref2;
4260
+ return media_query();
4261
+ });
4262
+ return n_cols_currently_showing;
4263
+ } catch (e) {
4264
+ $3hooq$depictaiutilishared.dwarn("No active size found in columnsAtSize - can't render content blocks");
4265
+ return null;
4266
+ }
4267
+ });
4268
+ return n_cols_currently_showing;
4269
+ }
4270
+ function $b8a8d61b3ec5f5ac$export$3f37af283f8fb843(props) {
4271
+ const style = $3hooq$solidjs.createMemo(() => {
4272
+ const {
4273
+ style: style,
4274
+ height: height,
4275
+ width: width,
4276
+ aspectRatio: aspectRatio
4277
+ } = props;
4278
+ const is_image = aspectRatio != undefined;
4279
+ const size_data = is_image ? {
4280
+ width: "100%",
4281
+ "padding-bottom": 1 / aspectRatio * 100 + "%"
4282
+ } : {
4283
+ width: width,
4284
+ height: height
4285
+ };
4286
+ return {
4287
+ display: "block",
4288
+ ...(style || {}),
4289
+ ...size_data
4290
+ };
4291
+ });
4292
+ return $3hooq$solidjsweb.createComponent((0, $e3d733f899558f40$export$acb3eaade4b23afd), {
4293
+ get style() {
4294
+ return style();
4295
+ },
4296
+ get ["class"]() {
4297
+ return props.class;
4298
+ }
4299
+ });
4300
+ }
4301
+ const $f8f375d6245ffff2$var$_tmpl$ = ["<div", ' class="content-block-wrapper" style="', '">', "</div>"];
4302
+ function $f8f375d6245ffff2$export$791ef57e62e21c3f(_ref) {
4303
+ let {
4304
+ content_blocks_: incoming_content_blocks,
4305
+ cols_at_size_: cols_at_size_,
4306
+ number_of_items_shown_: number_of_items_shown_,
4307
+ set_top_row_shortened_by_: set_top_row_shortened_by_
4308
+ } = _ref;
4309
+ // these are by row
4310
+ const [content_blocks, set_content_blocks] = $3hooq$solidjsstore.createStore([]);
4311
+ const n_cols_currently_showing_ = $85fcdab554c24789$export$a79e666719b3647c(cols_at_size_);
4312
+ const products_to_rows = products => {
4313
+ const cols_currently_showing = n_cols_currently_showing_();
4314
+ if (cols_currently_showing === null) return 0;
4315
+ return Math.ceil(products / cols_currently_showing);
4316
+ };
4317
+ const showing_rows = $3hooq$solidjs.createMemo(() => products_to_rows(number_of_items_shown_()));
4318
+ $3hooq$solidjs.createEffect(() => {
4319
+ const incoming_value = incoming_content_blocks();
4320
+ if (!incoming_value) {
4321
+ set_content_blocks([]);
4322
+ return;
4323
+ }
4324
+ const capped_value = incoming_value.slice(0, showing_rows()); // Don't show more content blocks than we have rows
4325
+ set_content_blocks($3hooq$solidjsstore.reconcile(capped_value));
4326
+ });
4327
+ const get_wrapped_blocks_ = $f8f375d6245ffff2$var$wrap_blocks_in_div(content_blocks, n_cols_currently_showing_);
4328
+ $3hooq$solidjs.createComputed(() => {
4329
+ // Update our styling if a content block forces some items that should be in the top row into a lower one, so we can generate margin-top declarations for them
4330
+ const top_row_block = get_wrapped_blocks_()[0];
4331
+ const blocks_in_top_row_taken = top_row_block === null || top_row_block === void 0 ? void 0 : top_row_block.span_columns;
4332
+ if (blocks_in_top_row_taken == undefined) {
4333
+ // Fall back to zero if no content block in top row, since then no blocks in top row are taken
4334
+ set_top_row_shortened_by_(0);
4335
+ return;
4336
+ }
4337
+ set_top_row_shortened_by_(blocks_in_top_row_taken - 1); // minus one because the content block wrapper also is an element
4338
+ });
4339
+
4340
+ return $f8f375d6245ffff2$var$remap_blocks_to_index({
4341
+ get_wrapped_blocks_: get_wrapped_blocks_,
4342
+ n_cols_currently_showing_: n_cols_currently_showing_
4343
+ });
4344
+ }
4345
+ /**
4346
+ * Calculate where to put each of the finished wrapped content blocks. Also limit blocks' max width.
4347
+ * @returns an array where index is index of the blocks in the "displays array" and value is the content block (elements) to show at that index
4348
+ */
4349
+ function $f8f375d6245ffff2$var$remap_blocks_to_index(_ref2) {
4350
+ let {
4351
+ get_wrapped_blocks_: get_wrapped_blocks_,
4352
+ n_cols_currently_showing_: n_cols_currently_showing_
4353
+ } = _ref2;
4354
+ return $3hooq$solidjs.createMemo(() => {
4355
+ // This computation should be quite cheap since it just moves around things into an array
4356
+ const content_blocks_by_index = [];
4357
+ const constructed_block_arrays = new WeakSet();
4358
+ const wrapped_blocks = get_wrapped_blocks_();
4359
+ const cols_showing = n_cols_currently_showing_();
4360
+ // Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
4361
+ const displaced_products = []; // undefined = is product, true = is content block if number instead of tuple number indicates content blocks in that row. Index in first array is row, index in second array is column
4362
+ for (let i = 0; i < wrapped_blocks.length; i++) {
4363
+ // i = row to show at
4364
+ const block = wrapped_blocks[i];
4365
+ if (!block) continue; // Array can have holes/not defined places
4366
+ const index_of_first_item_in_row = i * cols_showing;
4367
+ const index_of_last_item_in_row = index_of_first_item_in_row + cols_showing;
4368
+ const {
4369
+ span_rows: span_rows,
4370
+ position: position,
4371
+ span_columns: span_columns
4372
+ } = block; // span columns is already capped in the block wrapping step (wrap_blocks_in_div)
4373
+ let target_index;
4374
+ if (position === "left") target_index = index_of_first_item_in_row;else if (position === "right") target_index = index_of_last_item_in_row - span_columns;else if (position === "center") target_index = index_of_first_item_in_row + Math.floor((cols_showing - span_columns) / 2);else throw new Error("Invalid position for content block - must be left, right or center: " + JSON.stringify(position));
4375
+ // Calculate displacement of us by content blocks above us
4376
+ let displacement_by_added_blocks = 0;
4377
+ for (let j = 0; j < i; j++) {
4378
+ const row = displaced_products[j];
4379
+ if (row === undefined) continue; // there were no blocks in this row
4380
+ let items_in_row;
4381
+ if (typeof row === "number") items_in_row = row;else {
4382
+ items_in_row = row.filter(item => item).length;
4383
+ displaced_products[j] = items_in_row;
4384
+ }
4385
+ displacement_by_added_blocks += items_in_row;
4386
+ }
4387
+ const index_of_us_in_row = target_index - index_of_first_item_in_row;
4388
+ for (let j = 0; j < index_of_us_in_row; j++) {
4389
+ var _displaced_products$i;
4390
+ if ((_displaced_products$i = displaced_products[i]) !== null && _displaced_products$i !== void 0 && _displaced_products$i[j])
4391
+ // Add blocks in our *current* row to the displacement, but only the ones to our left
4392
+ displacement_by_added_blocks++;
4393
+ }
4394
+ // Add block to output array at the correct index
4395
+ const final_target_index = target_index - displacement_by_added_blocks;
4396
+ const existing_block = content_blocks_by_index[final_target_index];
4397
+ const block_content = block.content;
4398
+ // If two blocks want to exist at the same location (can happen, for example if one block wants to be at the end of a row and the other one at the start of the next row) add an array with both
4399
+ if (existing_block) {
4400
+ if (constructed_block_arrays.has(existing_block))
4401
+ // Only push to arrays we have created to not create funky bugs when there's an array in JSX.Element
4402
+ existing_block.push(block_content);else {
4403
+ const array = [existing_block, block_content];
4404
+ constructed_block_arrays.add(array);
4405
+ content_blocks_by_index[final_target_index] = array;
4406
+ }
4407
+ } else content_blocks_by_index[final_target_index] = block_content;
4408
+ // Update displacement
4409
+ for (let j = 0; j < span_rows; j++) {
4410
+ var _ref3;
4411
+ const row = displaced_products[_ref3 = i + j] || (displaced_products[_ref3] = []);
4412
+ for (let k = index_of_us_in_row; k < index_of_us_in_row + span_columns; k++) row[k] = true;
4413
+ }
4414
+ }
4415
+ return content_blocks_by_index;
4416
+ });
4417
+ }
4418
+ /**
4419
+ * Takes a store that contains an array from where index is number of row and value is the result of executing the content block rendering function.
4420
+ * Then renders the content and wraps it into a div with the correct styling.
4421
+ * Also caps span_columns to max available columns
4422
+ */
4423
+ function $f8f375d6245ffff2$var$wrap_blocks_in_div(rendered_content_blocks, max_span_columns) {
4424
+ const get_wrapped_blocks = $3hooq$solidjs.mapArray(() => rendered_content_blocks, block => {
4425
+ if (!block) return;
4426
+ const get_span_columns = () => {
4427
+ var _max_span_columns;
4428
+ return Math.min(block.span_columns, (_max_span_columns = max_span_columns()) !== null && _max_span_columns !== void 0 ? _max_span_columns : Infinity);
4429
+ };
4430
+ return $3hooq$solidjs.mergeProps(block, {
4431
+ // Create content divs for the blocks with as much fine-grained diffing as possible?
4432
+ content: $3hooq$solidjsweb.ssr($f8f375d6245ffff2$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "grid-column:" + "span ".concat($3hooq$solidjsweb.escape(get_span_columns(), true)) + (";grid-row:" + "span ".concat($3hooq$solidjsweb.escape(block.span_rows, true))) + (";spans_columns_variable_name:" + $3hooq$solidjsweb.escape(get_span_columns(), true)), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent($f8f375d6245ffff2$var$RenderContent, {
4433
+ get content() {
4434
+ return block.content;
4435
+ }
4436
+ }))),
4437
+ get span_columns() {
4438
+ // Cap max width of block to the number of columns available, for everyone downstream
4439
+ return get_span_columns();
4440
+ }
4441
+ });
4442
+ });
4443
+ return get_wrapped_blocks;
4444
+ }
4445
+ /**
4446
+ * Basically adds support for async content block functions and shows a rudimentary placeholder if rendering is delayed. Required due to react having a rendering delay.
4447
+ */
4448
+ function $f8f375d6245ffff2$var$RenderContent(props) {
4449
+ const [resource] = $3hooq$solidjs.createResource(() => props.content,
4450
+ // Could be reactive
4451
+ fn => fn());
4452
+ $3hooq$solidjs.createEffect(() => {
4453
+ if (resource.error) console.error("Error in content block rendering", resource.error);
4454
+ });
4455
+ // The suspense is for when there's an async content block (which we have to support due to react having a rendering delay) so that we can show some height while it's loading (should kinda never be visible)
4456
+ return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Suspense), {
4457
+ get fallback() {
4458
+ return $3hooq$solidjsweb.createComponent((0, $b8a8d61b3ec5f5ac$export$3f37af283f8fb843), {
4459
+ width: "100%",
4460
+ height: "max(100%, 400px)"
4461
+ });
4462
+ },
4463
+ children: resource
4464
+ });
4465
+ }
4111
4466
  const $484eec37514a982e$var$_tmpl$ = ["<div", ' class="', '"><!--#-->', "<!--/--><!--#-->", "<!--/--></div>"];
4112
4467
  function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
4113
4468
  let {
@@ -4124,7 +4479,8 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
4124
4479
  sort_or_filter_open_: sort_or_filter_open_,
4125
4480
  product_card_template_: product_card_template_,
4126
4481
  layout_options_: layout_options_,
4127
- id_currently_querying_for_: id_currently_querying_for_
4482
+ id_currently_querying_for_: id_currently_querying_for_,
4483
+ content_blocks_by_row_: content_blocks_by_row_
4128
4484
  } = _ref;
4129
4485
  // The plp_results_ resource will be delayed because we're using createBatchedMemo to not make triplicate API requests, but we need to show the placeholders before already to match Chrome and Firefox's "content has to be there, ready for scroll restoration, before all popstate tasks have been completed"-requirement
4130
4486
  const is_loading_ = $3hooq$solidjs.createMemo(() => plp_results_.loading || query_base_.loading);
@@ -4167,24 +4523,37 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
4167
4523
  let is_just_after_plp_results_update = false;
4168
4524
  let fallback_is_alive = false;
4169
4525
  const [get_should_have_placeholders_rendered, set_should_have_placeholders_rendered] = $3hooq$solidjs.createSignal(true);
4526
+ const [top_row_shortened_by_, set_top_row_shortened_by_] = $3hooq$solidjs.createSignal(0);
4527
+ const [product_card_suspense_is_in_fallback, set_product_card_suspense_is_in_fallback] = $3hooq$solidjs.createSignal(false);
4528
+ const [number_loaded_displays, set_number_loaded_displays_] = $3hooq$solidjs.createSignal(0);
4529
+ const modified_cols_at_size = $c749e60bca5000cb$export$cb5808ba002cdeed({
4530
+ layout_options_: layout_options_,
4531
+ sort_or_filter_open_: sort_or_filter_open_
4532
+ });
4533
+ const num_placeholders_ = $3hooq$solidjs.createMemo(() => {
4534
+ var _get_scroll_restorati, _get_scroll_restorati2;
4535
+ // Can't use the data out of request_base for the id because request_base is too late, we need the correct amount of placeholders before the browser has restored the scroll state after processing all popstate events
4536
+ return (0, $da887c42f8e8847a$export$6c9030e511152266) + ((_get_scroll_restorati = (_get_scroll_restorati2 = get_scroll_restoration_data().find(_ref2 => {
4537
+ let {
4538
+ for_id: for_id
4539
+ } = _ref2;
4540
+ return for_id === id_currently_querying_for_();
4541
+ })) === null || _get_scroll_restorati2 === void 0 ? void 0 : _get_scroll_restorati2.min_results_loaded) !== null && _get_scroll_restorati !== void 0 ? _get_scroll_restorati : min_products_to_fetch_);
4542
+ });
4543
+ const number_of_items_shown_ = $3hooq$solidjs.createMemo(() => is_loading_() || product_card_suspense_is_in_fallback() ? num_placeholders_() : number_loaded_displays());
4544
+ const doesnt_have_content_blocks = $3hooq$solidjs.createMemo(() => !content_blocks_by_row_());
4545
+ const content_blocks_ = $3hooq$solidjs.createMemo(() => doesnt_have_content_blocks() ? () => [] : $f8f375d6245ffff2$export$791ef57e62e21c3f({
4546
+ content_blocks_: content_blocks_by_row_,
4547
+ cols_at_size_: modified_cols_at_size,
4548
+ number_of_items_shown_: number_of_items_shown_,
4549
+ set_top_row_shortened_by_: set_top_row_shortened_by_
4550
+ }));
4170
4551
  const rendered_placeholders = $3hooq$solidjs.createMemo(() => get_should_have_placeholders_rendered() ? $e3915574cfd3466c$export$f33414a4df0afd3f({
4552
+ content_blocks_: content_blocks_,
4171
4553
  product_card_template_: product_card_template_,
4172
- num_placeholders_: $3hooq$solidjs.createMemo(() => {
4173
- var _get_scroll_restorati, _get_scroll_restorati2;
4174
- // Can't use the data out of request_base for the id because request_base is too late, we need the correct amount of placeholders before the browser has restored the scroll state after processing all popstate events
4175
- return (0, $da887c42f8e8847a$export$6c9030e511152266) + ((_get_scroll_restorati = (_get_scroll_restorati2 = get_scroll_restoration_data().find(_ref2 => {
4176
- let {
4177
- for_id: for_id
4178
- } = _ref2;
4179
- return for_id === id_currently_querying_for_();
4180
- })) === null || _get_scroll_restorati2 === void 0 ? void 0 : _get_scroll_restorati2.min_results_loaded) !== null && _get_scroll_restorati !== void 0 ? _get_scroll_restorati : min_products_to_fetch_);
4181
- })
4554
+ num_placeholders_: num_placeholders_
4182
4555
  }) : undefined);
4183
4556
  const [get_suspense_is_blocked, set_suspense_is_blocked] = $3hooq$solidjs.createSignal(false);
4184
- const modified_cols_at_size = $484eec37514a982e$var$make_modified_cols_at_size({
4185
- layout_options_: layout_options_,
4186
- sort_or_filter_open_: sort_or_filter_open_
4187
- });
4188
4557
  const block_suspense_if_needed = () => {
4189
4558
  if (!is_just_after_plp_results_update) return;
4190
4559
  is_just_after_plp_results_update = false;
@@ -4217,6 +4586,8 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
4217
4586
  return (() => {
4218
4587
  fallback_is_alive = true;
4219
4588
  $3hooq$solidjs.onCleanup(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
4589
+ set_product_card_suspense_is_in_fallback(true); // Here for the content block code that needs to know how many items we're displaying
4590
+ $3hooq$solidjs.onCleanup(() => set_product_card_suspense_is_in_fallback(false));
4220
4591
  return $3hooq$solidjs.createMemo(() => {
4221
4592
  // We need to be able to block the suspense since when async product cards are *rendering* we want to show the placeholders on initial load but not when loading more
4222
4593
  // In future we could have individual suspense's for each product card, but that's too much for now
@@ -4241,37 +4612,64 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
4241
4612
  min_products_to_fetch_: min_products_to_fetch_,
4242
4613
  query_base_: query_base_,
4243
4614
  depict_api_: depict_api_,
4244
- is_loading_: is_loading_
4615
+ is_loading_: is_loading_,
4616
+ content_blocks_: content_blocks_,
4617
+ set_number_loaded_displays_: set_number_loaded_displays_
4245
4618
  });
4246
4619
  $3hooq$solidjs.onCleanup(() => suspense_contents = undefined);
4247
4620
  return suspense_contents;
4248
4621
  })();
4249
4622
  }
4250
4623
  });
4251
- return [$8edd3cf30d1fd8b4$export$a2cc176055f8f08(), $3hooq$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), {
4252
- get cols_at_size() {
4253
- return modified_cols_at_size();
4624
+ /* This Show is so that we show placeholders while query_base is loading and because it's cumbersome to ensure that everything that directly accesses the plp_results_ resource is within the <Suspense> boundary */
4625
+ const listing_contents = $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
4626
+ get when() {
4627
+ return !is_loading_();
4254
4628
  },
4255
- get override_vertical_spacing() {
4256
- return layout_options_().override_vertical_spacing;
4629
+ get fallback() {
4630
+ return rendered_placeholders();
4257
4631
  },
4258
- get grid_spacing() {
4259
- return layout_options_().grid_spacing;
4632
+ children: product_cards_when_data
4633
+ });
4634
+ return [$8edd3cf30d1fd8b4$export$a2cc176055f8f08(), $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
4635
+ get when() {
4636
+ return doesnt_have_content_blocks();
4260
4637
  },
4261
- rows: "all",
4262
- layout: "grid",
4263
- element_attributes: {
4264
- class: "cards"
4638
+ get fallback() {
4639
+ return $3hooq$solidjsweb.createComponent((0, $830518481649feb1$export$ab6b147eec64fea5), {
4640
+ get cols_at_size() {
4641
+ return modified_cols_at_size();
4642
+ },
4643
+ get override_vertical_spacing() {
4644
+ return layout_options_().override_vertical_spacing;
4645
+ },
4646
+ get grid_spacing() {
4647
+ return layout_options_().grid_spacing;
4648
+ },
4649
+ element_attributes: {
4650
+ class: "cards css-grid"
4651
+ },
4652
+ top_row_shortened_by_: top_row_shortened_by_,
4653
+ children: listing_contents
4654
+ });
4265
4655
  },
4266
4656
  get children() {
4267
- return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
4268
- get when() {
4269
- return !is_loading_();
4657
+ return $3hooq$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), {
4658
+ get cols_at_size() {
4659
+ return modified_cols_at_size();
4660
+ },
4661
+ get override_vertical_spacing() {
4662
+ return layout_options_().override_vertical_spacing;
4663
+ },
4664
+ get grid_spacing() {
4665
+ return layout_options_().grid_spacing;
4270
4666
  },
4271
- get fallback() {
4272
- return rendered_placeholders();
4667
+ rows: "all",
4668
+ layout: "grid",
4669
+ element_attributes: {
4670
+ class: "cards"
4273
4671
  },
4274
- children: product_cards_when_data
4672
+ children: listing_contents
4275
4673
  });
4276
4674
  }
4277
4675
  })];
@@ -4280,36 +4678,6 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
4280
4678
  }
4281
4679
  })), $3hooq$solidjsweb.escape(desktop_filter_elements_()));
4282
4680
  }
4283
- /**
4284
- * Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
4285
- * This function is special to the actual PLPResults.
4286
- */
4287
- function $484eec37514a982e$var$make_modified_cols_at_size(_ref3) {
4288
- let {
4289
- layout_options_: layout_options_,
4290
- sort_or_filter_open_: sort_or_filter_open_
4291
- } = _ref3;
4292
- return $3hooq$solidjs.createMemo(() => {
4293
- const layout_options = layout_options_();
4294
- // Add grid styling that changes when filters get opened/closed
4295
- const when_filters_closed_cols = layout_options.cols_at_size;
4296
- return sort_or_filter_open_() ? when_filters_closed_cols.map(row => {
4297
- const [num_cols_default,,,, override_cols] = row;
4298
- const cloned_row = [...row];
4299
- // @ts-ignore
4300
- cloned_row[0] = num_cols_default - 1;
4301
- if (override_cols)
4302
- // @ts-ignore
4303
- cloned_row[4] = {
4304
- overrides: Object.fromEntries(Object.entries(override_cols.overrides).map(_ref4 => {
4305
- let [row, column] = _ref4;
4306
- return [row, column - 1];
4307
- }))
4308
- };
4309
- return cloned_row;
4310
- }) : when_filters_closed_cols;
4311
- });
4312
- }
4313
4681
  const $3bd211c857f81dfd$var$_tmpl$ = ["<div", ' class="sorting-attributes">', "</div>"],
4314
4682
  $3bd211c857f81dfd$var$_tmpl$2 = ["<div", ' class="sorting-direction">', "</div>"],
4315
4683
  $3bd211c857f81dfd$var$_tmpl$3 = ["<div", '><div class="input-row"><input type="radio"', '><span class="custom-indicator"></span><!--#-->', "<!--/--></div></div>"],
@@ -5587,7 +5955,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
5587
5955
  product_card_template_: product_card_template_,
5588
5956
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
5589
5957
  sorting_query_param_: sorting_query_param_,
5590
- filter_query_param_prefix_: filter_query_param_prefix_
5958
+ filter_query_param_prefix_: filter_query_param_prefix_,
5959
+ content_blocks_by_row_: content_blocks_by_row_
5591
5960
  } = _ref;
5592
5961
  let results_for;
5593
5962
  let only_show_filters_opener_;
@@ -5863,6 +6232,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
5863
6232
  product_card_template_: product_card_template_,
5864
6233
  sort_or_filter_open_: sort_or_filter_open_,
5865
6234
  desktop_filter_elements_: desktop_filter_elements_,
6235
+ content_blocks_by_row_: content_blocks_by_row_,
5866
6236
  id_currently_querying_for_: query_id_,
5867
6237
  no_results_options_: {
5868
6238
  selected_filters_: selected_filters_,
@@ -6469,6 +6839,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
6469
6839
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
6470
6840
  selected_filters_: selected_filters_,
6471
6841
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
6842
+ content_blocks_by_row_: () => props.content_blocks_by_row,
6472
6843
  scroll_restoration_data_: scroll_restoration_data_,
6473
6844
  layout_options_: $3hooq$solidjs.createMemo(() => ({
6474
6845
  cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
@@ -6701,37 +7072,6 @@ async function $822f2c95a96c3ec8$var$download_categories(tenant, market, type) {
6701
7072
  return [];
6702
7073
  }
6703
7074
  }
6704
- function $b8a8d61b3ec5f5ac$export$3f37af283f8fb843(props) {
6705
- const style = $3hooq$solidjs.createMemo(() => {
6706
- const {
6707
- style: style,
6708
- height: height,
6709
- width: width,
6710
- aspectRatio: aspectRatio
6711
- } = props;
6712
- const is_image = aspectRatio != undefined;
6713
- const size_data = is_image ? {
6714
- width: "100%",
6715
- "padding-bottom": 1 / aspectRatio * 100 + "%"
6716
- } : {
6717
- width: width,
6718
- height: height
6719
- };
6720
- return {
6721
- display: "block",
6722
- ...(style || {}),
6723
- ...size_data
6724
- };
6725
- });
6726
- return $3hooq$solidjsweb.createComponent((0, $e3d733f899558f40$export$acb3eaade4b23afd), {
6727
- get style() {
6728
- return style();
6729
- },
6730
- get ["class"]() {
6731
- return props.class;
6732
- }
6733
- });
6734
- }
6735
7075
  const $c0cf6af094336798$var$_tmpl$ = ["<div", ' class="instant-card"><div class="img-part">', '</div><div class="right-part"><div class="title-brand-tagline"><span class="title">', "</span></div></div></div>"];
6736
7076
  function $c0cf6af094336798$export$ee1733d9a8495996() {
6737
7077
  return $3hooq$solidjsweb.ssr($c0cf6af094336798$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $b8a8d61b3ec5f5ac$export$3f37af283f8fb843), {
@@ -8722,7 +9062,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
8722
9062
  router_: router_,
8723
9063
  content_results_rows_: content_results_rows_,
8724
9064
  content_layout_options_: content_layout_options_,
8725
- content_search_enabled_: content_search_enabled_
9065
+ content_search_enabled_: content_search_enabled_,
9066
+ content_blocks_by_row_: content_blocks_by_row_
8726
9067
  } = _ref;
8727
9068
  const [get_sorting] = current_sorting_;
8728
9069
  const all_products_loaded_ = $3hooq$solidjs.createSignal(false);
@@ -8988,6 +9329,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
8988
9329
  layout_options_: layout_options_,
8989
9330
  sort_or_filter_open_: sort_or_filter_open_,
8990
9331
  id_currently_querying_for_: get_search_query_,
9332
+ content_blocks_by_row_: content_blocks_by_row_,
8991
9333
  no_results_options_: {
8992
9334
  selected_filters_: selected_filters_,
8993
9335
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
@@ -9515,6 +9857,7 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
9515
9857
  search_sorting_open_: state_.sorting_open,
9516
9858
  expanded_filters_: state_.expanded_filters,
9517
9859
  content_results_rows_: state_.content_results_rows,
9860
+ content_blocks_by_row_: () => props.content_blocks_by_row,
9518
9861
  router_: shared_properties.router_,
9519
9862
  make_category_suggestion_card_: shared_properties.enable_category_suggestions_ ? category_suggestion_ => {
9520
9863
  return $3001ad378baf39dc$export$d757d54550ebfb3d({