@depict-ai/ui 4.10.18 → 4.10.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ES10/index.js CHANGED
@@ -10,7 +10,7 @@ import $8tj43$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "4.10.18";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.10.20";
14
14
  function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
15
15
  const signal = $8tj43$createSignal(false);
16
16
  $8tj43$onCleanup($8tj43$javascript_media_query(media_query, _ref => {
@@ -2604,8 +2604,10 @@ async function $d5f1e6a0f9117286$export$79b1565500412d9b(search_modal, modal_fn_
2604
2604
  const modal_els = $8tj43$createRoot(dispose => {
2605
2605
  let closing_animation;
2606
2606
  let animation_started;
2607
+ let focus_target_after_close;
2607
2608
  dispose_and_remove = () => {
2608
2609
  const actually_close = () => {
2610
+ var _focus_target_after_c;
2609
2611
  dispose();
2610
2612
  on_dispose === null || on_dispose === void 0 || on_dispose();
2611
2613
  const {
@@ -2624,11 +2626,19 @@ async function $d5f1e6a0f9117286$export$79b1565500412d9b(search_modal, modal_fn_
2624
2626
  }
2625
2627
  el.remove();
2626
2628
  });
2627
- if (should_restore_focus && element_focused_before_open !== null && element_focused_before_open !== void 0 && element_focused_before_open.isConnected) {
2629
+ const requested_focus_target = (_focus_target_after_c = focus_target_after_close) === null || _focus_target_after_c === void 0 ? void 0 : _focus_target_after_c();
2630
+ if (should_restore_focus && (requested_focus_target !== null && requested_focus_target !== void 0 && requested_focus_target.isConnected || element_focused_before_open !== null && element_focused_before_open !== void 0 && element_focused_before_open.isConnected)) {
2628
2631
  restoring_focus = true;
2629
2632
  try {
2630
2633
  // preventScroll so this can't re-introduce the safari page-jump the blur() above works around
2631
- element_focused_before_open.focus({
2634
+ let focused = false;
2635
+ if (requested_focus_target !== null && requested_focus_target !== void 0 && requested_focus_target.isConnected) {
2636
+ requested_focus_target.focus({
2637
+ preventScroll: true
2638
+ });
2639
+ focused = requested_focus_target.getRootNode().activeElement === requested_focus_target;
2640
+ }
2641
+ if (!focused && element_focused_before_open !== null && element_focused_before_open !== void 0 && element_focused_before_open.isConnected) element_focused_before_open.focus({
2632
2642
  preventScroll: true
2633
2643
  });
2634
2644
  } finally {
@@ -2650,7 +2660,8 @@ async function $d5f1e6a0f9117286$export$79b1565500412d9b(search_modal, modal_fn_
2650
2660
  ...extra_options_for_modal,
2651
2661
  close_modal_: close_modal_,
2652
2662
  open_modal_: open_modal_,
2653
- register_closing_animation_: animation => closing_animation = animation
2663
+ register_closing_animation_: animation => closing_animation = animation,
2664
+ set_focus_target_after_close_: get_target => focus_target_after_close = get_target
2654
2665
  });
2655
2666
  });
2656
2667
  body.append(...modal_els);
@@ -8148,7 +8159,8 @@ async function $e92c154db502596d$export$5d2f6cd705125cd3() {
8148
8159
  return hlsModule;
8149
8160
  }
8150
8161
  var $3b772ef9a35560fe$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<video class=d-standard-content>`),
8151
- $3b772ef9a35560fe$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<span class=d-standard-content-text>`);
8162
+ $3b772ef9a35560fe$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div class=d-standard-content-text-group><span class=d-standard-content-text></span><span class=d-standard-content-cta>`),
8163
+ $3b772ef9a35560fe$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<span class=d-standard-content-text>`);
8152
8164
  function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
8153
8165
  let {
8154
8166
  link_: link_,
@@ -8159,7 +8171,8 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
8159
8171
  aspectRatioWhenAloneInRow_: aspectRatioWhenAloneInRow_,
8160
8172
  imageResizer_: imageResizer_,
8161
8173
  text_: text_,
8162
- textPosition_: textPosition_
8174
+ textPosition_: textPosition_,
8175
+ cta_: cta_
8163
8176
  } = _ref;
8164
8177
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
8165
8178
  const [wrapperSize, setWrapperSize] = $8tj43$createSignal();
@@ -8266,15 +8279,44 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
8266
8279
  }), $8tj43$createComponent((0, $8tj43$Show), {
8267
8280
  when: text_,
8268
8281
  get children() {
8269
- var _el$2 = $8tj43$getNextElement($3b772ef9a35560fe$var$_tmpl$2);
8270
- $8tj43$setAttribute(_el$2, "data-position", textPosition_ || "bottom-center");
8271
- $8tj43$insert(_el$2, text_);
8272
- return _el$2;
8282
+ return $8tj43$createComponent((0, $8tj43$Show), {
8283
+ when: cta_,
8284
+ get fallback() {
8285
+ return (() => {
8286
+ var _el$5 = $8tj43$getNextElement($3b772ef9a35560fe$var$_tmpl$3);
8287
+ $8tj43$setAttribute(_el$5, "data-position", textPosition_ || "bottom-center");
8288
+ $8tj43$insert(_el$5, text_);
8289
+ return _el$5;
8290
+ })();
8291
+ },
8292
+ get children() {
8293
+ var _el$2 = $8tj43$getNextElement($3b772ef9a35560fe$var$_tmpl$2),
8294
+ _el$3 = _el$2.firstChild,
8295
+ _el$4 = _el$3.nextSibling;
8296
+ $8tj43$setAttribute(_el$2, "data-position", textPosition_ || "bottom-center");
8297
+ $8tj43$setAttribute(_el$3, "data-position", textPosition_ || "bottom-center");
8298
+ $8tj43$insert(_el$3, text_);
8299
+ $8tj43$setAttribute(_el$4, "data-position", textPosition_ || "bottom-center");
8300
+ $8tj43$insert(_el$4, cta_);
8301
+ return _el$2;
8302
+ }
8303
+ });
8273
8304
  }
8274
8305
  })];
8275
8306
  }
8276
8307
  }));
8277
8308
  }
8309
+ const $12ff24fdc4b26d88$export$af2c67164f68e9e9 = content => {
8310
+ const {
8311
+ link: link,
8312
+ type: type,
8313
+ url: url,
8314
+ text: text,
8315
+ text_position: text_position,
8316
+ cta: cta
8317
+ } = content;
8318
+ return JSON.stringify([link, type, url, text !== null && text !== void 0 ? text : null, text_position !== null && text_position !== void 0 ? text_position : null, cta !== null && cta !== void 0 ? cta : null]);
8319
+ };
8278
8320
  function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_, imageResizer_) {
8279
8321
  let hasSeenContentBlock = false;
8280
8322
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
@@ -8312,13 +8354,11 @@ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_
8312
8354
  type: type,
8313
8355
  url: url,
8314
8356
  text: text,
8315
- text_position: text_position
8357
+ text_position: text_position,
8358
+ cta: cta
8316
8359
  }
8317
8360
  } = row;
8318
- // Key the "content"-component by its rendered inputs, so we can reuse the component (and later downstream the block elements) if it's the same
8319
- // This makes the block not flicker when going backwards/forwards if the content is the same on both pages
8320
- // Also it lets us rewrite the blocks state in the history based on the block aspect ratio without infinite looping
8321
- const componentCacheKey = JSON.stringify([link, type, url, text !== null && text !== void 0 ? text : null, text_position !== null && text_position !== void 0 ? text_position : null]);
8361
+ const componentCacheKey = $12ff24fdc4b26d88$export$af2c67164f68e9e9(row.content);
8322
8362
  // The aspect ratio depends only on the media, so its history key must stay the pre-text 3-element shape — widening it would orphan every ratio already persisted in history.state
8323
8363
  const mediaCacheKey = JSON.stringify([link, type, url]);
8324
8364
  let component = contentComponents.get(componentCacheKey);
@@ -8338,7 +8378,8 @@ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_
8338
8378
  })),
8339
8379
  imageResizer_: imageResizer_,
8340
8380
  text_: text,
8341
- textPosition_: text_position
8381
+ textPosition_: text_position,
8382
+ cta_: cta
8342
8383
  });
8343
8384
  contentComponents.set(componentCacheKey, component);
8344
8385
  }
@@ -11287,6 +11328,7 @@ var $584c06c09cf4609d$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<button class=b
11287
11328
  $584c06c09cf4609d$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<div class=spacer>`),
11288
11329
  $584c06c09cf4609d$var$_tmpl$4 = /*#__PURE__*/$8tj43$template(`<button class="submit major"type=button>`),
11289
11330
  $584c06c09cf4609d$var$_tmpl$5 = /*#__PURE__*/$8tj43$template(`<div><!$><!/><!$><!/><div class=field><!$><!/><input class=query tabindex=0 enterkeyhint=search><!$><!/></div><!$><!/><!$><!/>`);
11331
+ const $584c06c09cf4609d$var$keys_not_opening_modal = new Set(["Tab", "Shift", "Control", "Alt", "AltGraph", "Meta", "CapsLock", "Escape", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End", "Insert", "ContextMenu", "NumLock", "ScrollLock", "Pause", "PrintScreen"]);
11290
11332
  function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
11291
11333
  let {
11292
11334
  search_field_value_: [searchFieldValue, setSearchFieldValue],
@@ -11469,7 +11511,7 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
11469
11511
  get onKeyDown() {
11470
11512
  return $8tj43$catchify1(e => {
11471
11513
  if (disabled_) {
11472
- if (e.key !== "Tab" && e.key !== "Shift")
11514
+ if (!$584c06c09cf4609d$var$keys_not_opening_modal.has(e.key) && !/^F\d{1,2}$/.test(e.key))
11473
11515
  // alow tab-selecting the input field and then open the modal when the user start writing but also to move past the field with tab
11474
11516
  input_element.click();
11475
11517
  } else if (e.key === "Enter") {
@@ -11574,6 +11616,33 @@ function $a82a41ab7188eda2$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
11574
11616
  }
11575
11617
  })();
11576
11618
  }
11619
+ function $802b1d7ed155c277$export$9e9e2ae069cf2fe1(_ref) {
11620
+ let {
11621
+ props_search_field_value_: props_search_field_value_,
11622
+ props_submit_query_: props_submit_query_,
11623
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
11624
+ set_focus_target_after_close_: set_focus_target_after_close_,
11625
+ get_search_page_input_element_: get_search_page_input_element_
11626
+ } = _ref;
11627
+ const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $8tj43$createSignal("") : props_search_field_value_;
11628
+ let submits_in_flight = 0;
11629
+ const submit_query_ = async function () {
11630
+ let new_query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $8tj43$untrack(search_field_value_[0]);
11631
+ submits_in_flight++;
11632
+ try {
11633
+ return await props_submit_query_(new_query, () => set_focus_target_after_close_(get_search_page_input_element_));
11634
+ } finally {
11635
+ submits_in_flight--;
11636
+ }
11637
+ };
11638
+ if (dont_sync_search_field_value_except_on_submit_) $8tj43$createEffect($8tj43$on(search_field_value_[0], value => submits_in_flight > 0 && props_search_field_value_[1](value), {
11639
+ defer: true
11640
+ }));
11641
+ return {
11642
+ search_field_value_: search_field_value_,
11643
+ submit_query_: submit_query_
11644
+ };
11645
+ }
11577
11646
  var $40411f2ec772c376$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=discover-more><button class=major type=button>`),
11578
11647
  $40411f2ec772c376$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<b>`),
11579
11648
  $40411f2ec772c376$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<div class=depict-search-modal><div class=body role=search aria-label="Search modal with search field, query suggestions and result preview"><!$><!/><div id=depict-suggestions-and-result-preview class=padded><!$><!/><!$><!/><!$><!/></div><!$><!/></div><!$><!/>`),
@@ -11588,6 +11657,8 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
11588
11657
  search_query_url_param_name_: search_query_url_param_name_,
11589
11658
  previous_searches_: previous_searches_,
11590
11659
  close_modal_: close_modal_,
11660
+ set_focus_target_after_close_: set_focus_target_after_close_,
11661
+ get_search_page_input_element_: get_search_page_input_element_,
11591
11662
  depict_api_: depict_api_,
11592
11663
  merchant_: merchant_,
11593
11664
  market_: market_,
@@ -11612,15 +11683,16 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
11612
11683
  // As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
11613
11684
  // This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
11614
11685
  // Basically the UI signals that the button that opens the modal starts a new search.
11615
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $8tj43$createSignal("") : props_search_field_value;
11616
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($8tj43$untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
11617
- : undefined;
11618
- const submit_query_ = function () {
11619
- // submit_query expects to read the current search field value which is why we have to write the current one to the signal before calling it
11620
- // It will write the old one back and then write the new one after submit
11621
- propagate_search_field_value_back === null || propagate_search_field_value_back === void 0 || propagate_search_field_value_back();
11622
- return props_submit_query(...arguments);
11623
- };
11686
+ const {
11687
+ search_field_value_: search_field_value_,
11688
+ submit_query_: submit_query_
11689
+ } = $802b1d7ed155c277$export$9e9e2ae069cf2fe1({
11690
+ props_search_field_value_: props_search_field_value,
11691
+ props_submit_query_: props_submit_query,
11692
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
11693
+ set_focus_target_after_close_: set_focus_target_after_close_,
11694
+ get_search_page_input_element_: get_search_page_input_element_
11695
+ });
11624
11696
  const [input_field, set_input_field] = $8tj43$createSignal();
11625
11697
  const [get_search_field_value_] = search_field_value_;
11626
11698
  // Search field alignment unused in ClassicSearchModal since the search field spans the whole modal
@@ -12452,6 +12524,8 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
12452
12524
  search_query_url_param_name_: search_query_url_param_name_,
12453
12525
  previous_searches_: previous_searches_,
12454
12526
  close_modal_: close_modal_,
12527
+ set_focus_target_after_close_: set_focus_target_after_close_,
12528
+ get_search_page_input_element_: get_search_page_input_element_,
12455
12529
  alignmentSignals_: alignmentSignals_,
12456
12530
  depict_api_: depict_api_,
12457
12531
  merchant_: merchant_,
@@ -12482,15 +12556,16 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
12482
12556
  // As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
12483
12557
  // This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
12484
12558
  // Basically the UI signals that the button that opens the modal starts a new search.
12485
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $8tj43$createSignal("") : props_search_field_value;
12486
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($8tj43$untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
12487
- : undefined;
12488
- const submit_query_ = function () {
12489
- // submit_query expects to read the current search field value which is why we have to write the current one to the signal before calling it
12490
- // It will write the old one back and then write the new one after submit
12491
- propagate_search_field_value_back === null || propagate_search_field_value_back === void 0 || propagate_search_field_value_back();
12492
- return props_submit_query(...arguments);
12493
- };
12559
+ const {
12560
+ search_field_value_: search_field_value_,
12561
+ submit_query_: submit_query_
12562
+ } = $802b1d7ed155c277$export$9e9e2ae069cf2fe1({
12563
+ props_search_field_value_: props_search_field_value,
12564
+ props_submit_query_: props_submit_query,
12565
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
12566
+ set_focus_target_after_close_: set_focus_target_after_close_,
12567
+ get_search_page_input_element_: get_search_page_input_element_
12568
+ });
12494
12569
  const [input_field, set_input_field] = $8tj43$createSignal();
12495
12570
  const [searching_for_value_, set_searching_for_value_] = $8tj43$createSignal();
12496
12571
  const [show_stale_content_results_, set_show_stale_content_results_] = $8tj43$createSignal(false);
@@ -14808,11 +14883,12 @@ async function $86b0ff0c85e5fc6c$export$e16630ecb9644a1c(_ref) {
14808
14883
  let {
14809
14884
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
14810
14885
  search_param_name_: search_param_name_,
14811
- set_search_field_value_: set_search_field_value_,
14886
+ search_field_value_: search_field_value_,
14812
14887
  get_search_query_: get_search_query_,
14813
14888
  url_transformer_: url_transformer_,
14814
14889
  router_: router_,
14815
14890
  after_submit_: after_submit_,
14891
+ before_navigate_: before_navigate_,
14816
14892
  get_new_query: get_new_query
14817
14893
  } = _ref;
14818
14894
  const new_search_query = get_new_query();
@@ -14820,21 +14896,92 @@ async function $86b0ff0c85e5fc6c$export$e16630ecb9644a1c(_ref) {
14820
14896
  if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
14821
14897
  // don't push a history entry / re-search if someone submits a search again
14822
14898
  // do close the modal though
14899
+ search_field_value_.settle_(new_search_query);
14823
14900
  on_submit_with_unchanged_value_ === null || on_submit_with_unchanged_value_ === void 0 || on_submit_with_unchanged_value_();
14824
- return;
14901
+ return false;
14825
14902
  }
14826
- set_search_field_value_(previous_query); // restore the value to the previous query since this one goes to the new history entry
14827
14903
  const target_url = new URL(location.href);
14828
14904
  url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(target_url);
14829
14905
  target_url.searchParams.set(search_param_name_, new_search_query);
14830
- await router_.navigate_.go_to_({
14831
- new_url_: target_url,
14832
- is_replace_: false,
14833
- force_spa_navigation_: true
14834
- });
14835
- set_search_field_value_(new_search_query);
14906
+ const end_submit = search_field_value_.begin_submit_(new_search_query, previous_query);
14907
+ before_navigate_ === null || before_navigate_ === void 0 || before_navigate_();
14908
+ let landed;
14909
+ try {
14910
+ await router_.navigate_.go_to_({
14911
+ new_url_: target_url,
14912
+ is_replace_: false,
14913
+ force_spa_navigation_: true
14914
+ });
14915
+ } finally {
14916
+ landed = end_submit();
14917
+ }
14918
+ if (!landed) return false;
14836
14919
  scrollTo(0, 0);
14837
14920
  after_submit_ === null || after_submit_ === void 0 || after_submit_();
14921
+ return true;
14922
+ }
14923
+ function $8a9827cc2842b300$export$d13a185c53aa5edf(persisted_, get_search_query_) {
14924
+ const [get_persisted, set_persisted] = persisted_;
14925
+ const [get_submitting, set_submitting] = $8tj43$createSignal();
14926
+ const get_value = $8tj43$createMemo(() => {
14927
+ var _get_submitting;
14928
+ return (_get_submitting = get_submitting()) !== null && _get_submitting !== void 0 ? _get_submitting : get_persisted();
14929
+ });
14930
+ const set_value = value => {
14931
+ const new_value = typeof value === "function" ? value($8tj43$untrack(get_value)) : value;
14932
+ if ($8tj43$untrack(get_submitting) === undefined) set_persisted(new_value);else set_submitting(new_value);
14933
+ return new_value;
14934
+ };
14935
+ let current_submit;
14936
+ const end_submit = landed => {
14937
+ current_submit.landed_ = landed;
14938
+ current_submit = undefined;
14939
+ $8tj43$batch(() => {
14940
+ const submitting = $8tj43$untrack(get_submitting);
14941
+ set_submitting(undefined);
14942
+ if (landed && submitting !== undefined) set_persisted(submitting);
14943
+ });
14944
+ };
14945
+ const abort_on_popstate = what_happened => {
14946
+ if (what_happened === "popstate" && current_submit) end_submit(false);
14947
+ };
14948
+ (0, $8tj43$instant_exec_on_suspect_history_change).add(abort_on_popstate);
14949
+ $8tj43$onCleanup(() => (0, $8tj43$instant_exec_on_suspect_history_change).delete(abort_on_popstate));
14950
+ $8tj43$createEffect($8tj43$on(get_search_query_, query => {
14951
+ const token = current_submit;
14952
+ if (!token || query !== token.query_) return;
14953
+ queueMicrotask(() => {
14954
+ if (current_submit === token) end_submit(true);
14955
+ });
14956
+ }, {
14957
+ defer: true
14958
+ }));
14959
+ const begin_submit_ = (submitted_query, query_of_current_history_entry) => {
14960
+ const token = current_submit = {
14961
+ query_: submitted_query,
14962
+ landed_: false
14963
+ };
14964
+ $8tj43$batch(() => {
14965
+ set_submitting(submitted_query);
14966
+ set_persisted(query_of_current_history_entry);
14967
+ });
14968
+ return () => {
14969
+ if (current_submit === token) end_submit(true);
14970
+ return token.landed_;
14971
+ };
14972
+ };
14973
+ const settle_ = query => {
14974
+ if (current_submit) return;
14975
+ $8tj43$batch(() => {
14976
+ set_submitting(undefined);
14977
+ set_persisted(query);
14978
+ });
14979
+ };
14980
+ return {
14981
+ value_: [get_value, set_value],
14982
+ begin_submit_: begin_submit_,
14983
+ settle_: settle_
14984
+ };
14838
14985
  }
14839
14986
  function $96d57a48e7bce64f$export$181cceed5c91919e(callback, alsoRaF, passiveListener) {
14840
14987
  let aligned_this_microtask = false;
@@ -15578,6 +15725,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
15578
15725
  scroll_restoration_data_: scroll_restoration_data_,
15579
15726
  product_card_template_: product_card_template_,
15580
15727
  modalAlignmentSignalsRef_: modalAlignmentSignalsRef_,
15728
+ inputFieldRef_: inputFieldRef_,
15581
15729
  router_: router_,
15582
15730
  content_results_rows_: content_results_rows_,
15583
15731
  content_layout_options_: content_layout_options_,
@@ -15782,6 +15930,8 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
15782
15930
  if (!search_field) break add_input_field;
15783
15931
  setModalBodyStyle({});
15784
15932
  modalAlignmentSignalsRef_ === null || modalAlignmentSignalsRef_ === void 0 || modalAlignmentSignalsRef_(alignmentSignals_);
15933
+ inputFieldRef_ === null || inputFieldRef_ === void 0 || inputFieldRef_(input_element);
15934
+ $8tj43$onCleanup(() => inputFieldRef_ === null || inputFieldRef_ === void 0 ? void 0 : inputFieldRef_(undefined));
15785
15935
  const [pollAlignment, setPollAlignment_] = $8tj43$createSignal(false);
15786
15936
  const align_position = $8tj43$catchify1((0, $1308a7816c3d4f2d$export$b3ad617e9036868))(alignmentSignals_, search_field, (0, $1308a7816c3d4f2d$export$3f238c96c45e6cc6) | (0, $1308a7816c3d4f2d$export$7895aadd1956b1c7) | (modalVersionUsed_ === 1 ? (0, $1308a7816c3d4f2d$export$902f8b4a7dae5d78) : (0, $1308a7816c3d4f2d$export$6060bc6bee850eb6) | (0, $1308a7816c3d4f2d$export$5097308c5200105a)), true, pollAlignment);
15787
15937
  div_with_field_class.addEventListener("click", $8tj43$catchify1(e => {
@@ -16191,14 +16341,16 @@ class $eb064bc3350276c1$export$ac6237957a15b3f0 {
16191
16341
  set_search_content_results_rows((0, $d53ebed6f63304e4$export$70ceae36059a1036));
16192
16342
  }; // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
16193
16343
  const on_submit_with_unchanged_value_ = () => this.modal_open = false;
16194
- const [get_search_field_value_, set_search_field_value_] = state_.field_value;
16195
- const configured_submit_query_ = new_query => $86b0ff0c85e5fc6c$export$e16630ecb9644a1c({
16344
+ const search_field_value_ = $8a9827cc2842b300$export$d13a185c53aa5edf(state_.field_value, get_search_query_);
16345
+ const [get_search_field_value_] = search_field_value_.value_;
16346
+ const configured_submit_query_ = (new_query, before_navigate_) => $86b0ff0c85e5fc6c$export$e16630ecb9644a1c({
16196
16347
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
16197
- set_search_field_value_: set_search_field_value_,
16348
+ search_field_value_: search_field_value_,
16198
16349
  get_search_query_: get_search_query_,
16199
16350
  search_param_name_: search_query_url_param_name_,
16200
16351
  after_submit_: after_submit_,
16201
- get_new_query: () => new_query || $8tj43$untrack(get_search_field_value_),
16352
+ before_navigate_: before_navigate_,
16353
+ get_new_query: () => new_query !== null && new_query !== void 0 ? new_query : $8tj43$untrack(get_search_field_value_),
16202
16354
  url_transformer_: url_transformer,
16203
16355
  router_: $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $eb064bc3350276c1$var$_router)
16204
16356
  });
@@ -16217,6 +16369,7 @@ class $eb064bc3350276c1$export$ac6237957a15b3f0 {
16217
16369
  search_query_url_param_name_: search_query_url_param_name_,
16218
16370
  reset_history_state_: reset_history_state_,
16219
16371
  state_: state_,
16372
+ search_field_value_: search_field_value_.value_,
16220
16373
  router_: $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $eb064bc3350276c1$var$_router),
16221
16374
  url_transformer_: url_transformer,
16222
16375
  depict_api_: depict_api_,
@@ -16240,7 +16393,11 @@ class $eb064bc3350276c1$export$ac6237957a15b3f0 {
16240
16393
  $8tj43$onCleanup(() => _this.modal_open = false);
16241
16394
  return searchModalComponent(...arguments);
16242
16395
  }, {
16243
- search_field_value_: state_.field_value,
16396
+ search_field_value_: search_field_value_.value_,
16397
+ get_search_page_input_element_: () => {
16398
+ var _privately_shared_pro2;
16399
+ return (_privately_shared_pro2 = $eb064bc3350276c1$export$dde08b2dca8cc1ce.get(this)) === null || _privately_shared_pro2 === void 0 ? void 0 : _privately_shared_pro2.search_page_input_element_;
16400
+ },
16244
16401
  get_search_query_: get_search_query_,
16245
16402
  search_query_url_param_name_: search_query_url_param_name_,
16246
16403
  previous_searches_: previous_searches,
@@ -16405,6 +16562,7 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
16405
16562
  const {
16406
16563
  state_: state_
16407
16564
  } = shared_properties;
16565
+ let registered_input_element;
16408
16566
  const grid_spacing_override = $8tj43$createMemo(() => {
16409
16567
  const {
16410
16568
  grid_spacing: grid_spacing
@@ -16436,7 +16594,7 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
16436
16594
  var _depict_search$enable;
16437
16595
  return (_depict_search$enable = depict_search.enable_content_search) !== null && _depict_search$enable !== void 0 ? _depict_search$enable : $eb064bc3350276c1$var$content_search_default;
16438
16596
  },
16439
- search_field_value_: state_.field_value,
16597
+ search_field_value_: shared_properties.search_field_value_,
16440
16598
  get_search_query_: shared_properties.get_search_query_,
16441
16599
  clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
16442
16600
  open_modal_: function () {
@@ -16447,6 +16605,16 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
16447
16605
  modalVersionUsed_: shared_properties.modalVersionUsed_,
16448
16606
  showSliderArrow_: () => props.showSliderArrow_,
16449
16607
  i18n_: shared_properties.i18n_,
16608
+ inputFieldRef_: input_element => {
16609
+ const shared_info_right_now = $eb064bc3350276c1$export$dde08b2dca8cc1ce.get(depict_search);
16610
+ if (!shared_info_right_now) return;
16611
+ if (input_element === undefined && shared_info_right_now.search_page_input_element_ !== registered_input_element) return;
16612
+ registered_input_element = input_element;
16613
+ $eb064bc3350276c1$export$dde08b2dca8cc1ce.set(depict_search, {
16614
+ ...shared_info_right_now,
16615
+ search_page_input_element_: input_element
16616
+ });
16617
+ },
16450
16618
  modalAlignmentSignalsRef_: style => {
16451
16619
  const shared_info_right_now = $eb064bc3350276c1$export$dde08b2dca8cc1ce.get(depict_search);
16452
16620
  if (!shared_info_right_now) return;
@@ -16893,7 +17061,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
16893
17061
  return shared_properties.BackIcon_;
16894
17062
  },
16895
17063
  get search_field_value_() {
16896
- return shared_properties.state_.field_value;
17064
+ return shared_properties.search_field_value_;
16897
17065
  },
16898
17066
  get submit_query_() {
16899
17067
  return shared_properties.configured_submit_query_;
@@ -16936,7 +17104,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
16936
17104
  return shared_properties.BackIcon_;
16937
17105
  },
16938
17106
  get search_field_value_() {
16939
- return shared_properties.state_.field_value;
17107
+ return shared_properties.search_field_value_;
16940
17108
  },
16941
17109
  get submit_query_() {
16942
17110
  return shared_properties.configured_submit_query_;