@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.
@@ -10,7 +10,7 @@ import $b8hua$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 = $b8hua$createSignal(false);
16
16
  $b8hua$onCleanup($b8hua$javascript_media_query(media_query, _ref => {
@@ -2144,8 +2144,10 @@ async function $d5f1e6a0f9117286$export$79b1565500412d9b(search_modal, modal_fn_
2144
2144
  const modal_els = $b8hua$createRoot(dispose => {
2145
2145
  let closing_animation;
2146
2146
  let animation_started;
2147
+ let focus_target_after_close;
2147
2148
  dispose_and_remove = () => {
2148
2149
  const actually_close = () => {
2150
+ var _focus_target_after_c;
2149
2151
  dispose();
2150
2152
  on_dispose === null || on_dispose === void 0 || on_dispose();
2151
2153
  const {
@@ -2164,11 +2166,19 @@ async function $d5f1e6a0f9117286$export$79b1565500412d9b(search_modal, modal_fn_
2164
2166
  }
2165
2167
  el.remove();
2166
2168
  });
2167
- if (should_restore_focus && element_focused_before_open !== null && element_focused_before_open !== void 0 && element_focused_before_open.isConnected) {
2169
+ 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();
2170
+ 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)) {
2168
2171
  restoring_focus = true;
2169
2172
  try {
2170
2173
  // preventScroll so this can't re-introduce the safari page-jump the blur() above works around
2171
- element_focused_before_open.focus({
2174
+ let focused = false;
2175
+ if (requested_focus_target !== null && requested_focus_target !== void 0 && requested_focus_target.isConnected) {
2176
+ requested_focus_target.focus({
2177
+ preventScroll: true
2178
+ });
2179
+ focused = requested_focus_target.getRootNode().activeElement === requested_focus_target;
2180
+ }
2181
+ if (!focused && element_focused_before_open !== null && element_focused_before_open !== void 0 && element_focused_before_open.isConnected) element_focused_before_open.focus({
2172
2182
  preventScroll: true
2173
2183
  });
2174
2184
  } finally {
@@ -2190,7 +2200,8 @@ async function $d5f1e6a0f9117286$export$79b1565500412d9b(search_modal, modal_fn_
2190
2200
  ...extra_options_for_modal,
2191
2201
  close_modal_: close_modal_,
2192
2202
  open_modal_: open_modal_,
2193
- register_closing_animation_: animation => closing_animation = animation
2203
+ register_closing_animation_: animation => closing_animation = animation,
2204
+ set_focus_target_after_close_: get_target => focus_target_after_close = get_target
2194
2205
  });
2195
2206
  });
2196
2207
  body.append(...modal_els);
@@ -6639,7 +6650,8 @@ function $98688279b9059f50$export$140423fa4bfb6d63(props) {
6639
6650
  }));
6640
6651
  }
6641
6652
  var $3b772ef9a35560fe$var$_tmpl$ = ["<video", ' disablepictureinpicture="true" class="d-standard-content"></video>'],
6642
- $3b772ef9a35560fe$var$_tmpl$2 = ["<span", ' class="d-standard-content-text"', ">", "</span>"];
6653
+ $3b772ef9a35560fe$var$_tmpl$2 = ["<div", ' class="d-standard-content-text-group"', '><span class="d-standard-content-text"', ">", '</span><span class="d-standard-content-cta"', ">", "</span></div>"],
6654
+ $3b772ef9a35560fe$var$_tmpl$3 = ["<span", ' class="d-standard-content-text"', ">", "</span>"];
6643
6655
  function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
6644
6656
  let {
6645
6657
  link_: link_,
@@ -6650,7 +6662,8 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
6650
6662
  aspectRatioWhenAloneInRow_: aspectRatioWhenAloneInRow_,
6651
6663
  imageResizer_: imageResizer_,
6652
6664
  text_: text_,
6653
- textPosition_: textPosition_
6665
+ textPosition_: textPosition_,
6666
+ cta_: cta_
6654
6667
  } = _ref;
6655
6668
  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
6656
6669
  const [wrapperSize, setWrapperSize] = $b8hua$createSignal();
@@ -6718,12 +6731,31 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
6718
6731
  }), $b8hua$createComponent((0, $b8hua$Show), {
6719
6732
  when: text_,
6720
6733
  get children() {
6721
- return $b8hua$ssr($3b772ef9a35560fe$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("data-position", $b8hua$escape(textPosition_, true) || "bottom-center", false), $b8hua$escape(text_));
6734
+ return $b8hua$createComponent((0, $b8hua$Show), {
6735
+ when: cta_,
6736
+ get fallback() {
6737
+ return $b8hua$ssr($3b772ef9a35560fe$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("data-position", $b8hua$escape(textPosition_, true) || "bottom-center", false), $b8hua$escape(text_));
6738
+ },
6739
+ get children() {
6740
+ return $b8hua$ssr($3b772ef9a35560fe$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("data-position", $b8hua$escape(textPosition_, true) || "bottom-center", false), $b8hua$ssrAttribute("data-position", $b8hua$escape(textPosition_, true) || "bottom-center", false), $b8hua$escape(text_), $b8hua$ssrAttribute("data-position", $b8hua$escape(textPosition_, true) || "bottom-center", false), $b8hua$escape(cta_));
6741
+ }
6742
+ });
6722
6743
  }
6723
6744
  })];
6724
6745
  }
6725
6746
  }));
6726
6747
  }
6748
+ const $12ff24fdc4b26d88$export$af2c67164f68e9e9 = content => {
6749
+ const {
6750
+ link: link,
6751
+ type: type,
6752
+ url: url,
6753
+ text: text,
6754
+ text_position: text_position,
6755
+ cta: cta
6756
+ } = content;
6757
+ 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]);
6758
+ };
6727
6759
  function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_, imageResizer_) {
6728
6760
  let hasSeenContentBlock = false;
6729
6761
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
@@ -6761,13 +6793,11 @@ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_
6761
6793
  type: type,
6762
6794
  url: url,
6763
6795
  text: text,
6764
- text_position: text_position
6796
+ text_position: text_position,
6797
+ cta: cta
6765
6798
  }
6766
6799
  } = row;
6767
- // 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
6768
- // This makes the block not flicker when going backwards/forwards if the content is the same on both pages
6769
- // Also it lets us rewrite the blocks state in the history based on the block aspect ratio without infinite looping
6770
- const componentCacheKey = JSON.stringify([link, type, url, text !== null && text !== void 0 ? text : null, text_position !== null && text_position !== void 0 ? text_position : null]);
6800
+ const componentCacheKey = $12ff24fdc4b26d88$export$af2c67164f68e9e9(row.content);
6771
6801
  // 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
6772
6802
  const mediaCacheKey = JSON.stringify([link, type, url]);
6773
6803
  let component = contentComponents.get(componentCacheKey);
@@ -6787,7 +6817,8 @@ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_
6787
6817
  })),
6788
6818
  imageResizer_: imageResizer_,
6789
6819
  text_: text,
6790
- textPosition_: text_position
6820
+ textPosition_: text_position,
6821
+ cta_: cta
6791
6822
  });
6792
6823
  contentComponents.set(componentCacheKey, component);
6793
6824
  }
@@ -9258,6 +9289,7 @@ function $83c36ed4520d0335$export$f7658c347b037c3f() {
9258
9289
  var $584c06c09cf4609d$var$_tmpl$ = ["<div", ' style="', '" class="spacer"></div>'],
9259
9290
  $584c06c09cf4609d$var$_tmpl$2 = ['<div class="field"><!--$-->', "<!--/-->", "<!--$-->", "<!--/--></div>"],
9260
9291
  $584c06c09cf4609d$var$_tmpl$3 = ["<button", ' class="submit major" type="button"', ">", "</button>"];
9292
+ 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"]);
9261
9293
  function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
9262
9294
  let {
9263
9295
  search_field_value_: [searchFieldValue, setSearchFieldValue],
@@ -9403,6 +9435,33 @@ function $a82a41ab7188eda2$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
9403
9435
  }
9404
9436
  })();
9405
9437
  }
9438
+ function $802b1d7ed155c277$export$9e9e2ae069cf2fe1(_ref) {
9439
+ let {
9440
+ props_search_field_value_: props_search_field_value_,
9441
+ props_submit_query_: props_submit_query_,
9442
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
9443
+ set_focus_target_after_close_: set_focus_target_after_close_,
9444
+ get_search_page_input_element_: get_search_page_input_element_
9445
+ } = _ref;
9446
+ const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $b8hua$createSignal("") : props_search_field_value_;
9447
+ let submits_in_flight = 0;
9448
+ const submit_query_ = async function () {
9449
+ let new_query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $b8hua$untrack(search_field_value_[0]);
9450
+ submits_in_flight++;
9451
+ try {
9452
+ return await props_submit_query_(new_query, () => set_focus_target_after_close_(get_search_page_input_element_));
9453
+ } finally {
9454
+ submits_in_flight--;
9455
+ }
9456
+ };
9457
+ if (dont_sync_search_field_value_except_on_submit_) $b8hua$createEffect($b8hua$on(search_field_value_[0], value => submits_in_flight > 0 && props_search_field_value_[1](value), {
9458
+ defer: true
9459
+ }));
9460
+ return {
9461
+ search_field_value_: search_field_value_,
9462
+ submit_query_: submit_query_
9463
+ };
9464
+ }
9406
9465
  var $40411f2ec772c376$var$_tmpl$ = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
9407
9466
  $40411f2ec772c376$var$_tmpl$2 = ["<b", ">", "</b>"],
9408
9467
  $40411f2ec772c376$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '" 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><!--$-->", "<!--/--></div>"],
@@ -9417,6 +9476,8 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
9417
9476
  search_query_url_param_name_: search_query_url_param_name_,
9418
9477
  previous_searches_: previous_searches_,
9419
9478
  close_modal_: close_modal_,
9479
+ set_focus_target_after_close_: set_focus_target_after_close_,
9480
+ get_search_page_input_element_: get_search_page_input_element_,
9420
9481
  depict_api_: depict_api_,
9421
9482
  merchant_: merchant_,
9422
9483
  market_: market_,
@@ -9441,15 +9502,16 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
9441
9502
  // 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.
9442
9503
  // 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
9443
9504
  // Basically the UI signals that the button that opens the modal starts a new search.
9444
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $b8hua$createSignal("") : props_search_field_value;
9445
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($b8hua$untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
9446
- : undefined;
9447
- const submit_query_ = function () {
9448
- // 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
9449
- // It will write the old one back and then write the new one after submit
9450
- propagate_search_field_value_back === null || propagate_search_field_value_back === void 0 || propagate_search_field_value_back();
9451
- return props_submit_query(...arguments);
9452
- };
9505
+ const {
9506
+ search_field_value_: search_field_value_,
9507
+ submit_query_: submit_query_
9508
+ } = $802b1d7ed155c277$export$9e9e2ae069cf2fe1({
9509
+ props_search_field_value_: props_search_field_value,
9510
+ props_submit_query_: props_submit_query,
9511
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
9512
+ set_focus_target_after_close_: set_focus_target_after_close_,
9513
+ get_search_page_input_element_: get_search_page_input_element_
9514
+ });
9453
9515
  const [input_field, set_input_field] = $b8hua$createSignal();
9454
9516
  const [get_search_field_value_] = search_field_value_;
9455
9517
  // Search field alignment unused in ClassicSearchModal since the search field spans the whole modal
@@ -10082,6 +10144,8 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
10082
10144
  search_query_url_param_name_: search_query_url_param_name_,
10083
10145
  previous_searches_: previous_searches_,
10084
10146
  close_modal_: close_modal_,
10147
+ set_focus_target_after_close_: set_focus_target_after_close_,
10148
+ get_search_page_input_element_: get_search_page_input_element_,
10085
10149
  alignmentSignals_: alignmentSignals_,
10086
10150
  depict_api_: depict_api_,
10087
10151
  merchant_: merchant_,
@@ -10112,15 +10176,16 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
10112
10176
  // 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.
10113
10177
  // 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
10114
10178
  // Basically the UI signals that the button that opens the modal starts a new search.
10115
- const search_field_value_ = dont_sync_search_field_value_except_on_submit_ ? $b8hua$createSignal("") : props_search_field_value;
10116
- const propagate_search_field_value_back = dont_sync_search_field_value_except_on_submit_ ? () => props_search_field_value[1]($b8hua$untrack(search_field_value_[0])) // Set actual search field value to the throwaway internal one before submitting
10117
- : undefined;
10118
- const submit_query_ = function () {
10119
- // 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
10120
- // It will write the old one back and then write the new one after submit
10121
- propagate_search_field_value_back === null || propagate_search_field_value_back === void 0 || propagate_search_field_value_back();
10122
- return props_submit_query(...arguments);
10123
- };
10179
+ const {
10180
+ search_field_value_: search_field_value_,
10181
+ submit_query_: submit_query_
10182
+ } = $802b1d7ed155c277$export$9e9e2ae069cf2fe1({
10183
+ props_search_field_value_: props_search_field_value,
10184
+ props_submit_query_: props_submit_query,
10185
+ dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_,
10186
+ set_focus_target_after_close_: set_focus_target_after_close_,
10187
+ get_search_page_input_element_: get_search_page_input_element_
10188
+ });
10124
10189
  const [input_field, set_input_field] = $b8hua$createSignal();
10125
10190
  const [searching_for_value_, set_searching_for_value_] = $b8hua$createSignal();
10126
10191
  const [show_stale_content_results_, set_show_stale_content_results_] = $b8hua$createSignal(false);
@@ -12129,11 +12194,12 @@ async function $86b0ff0c85e5fc6c$export$e16630ecb9644a1c(_ref) {
12129
12194
  let {
12130
12195
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
12131
12196
  search_param_name_: search_param_name_,
12132
- set_search_field_value_: set_search_field_value_,
12197
+ search_field_value_: search_field_value_,
12133
12198
  get_search_query_: get_search_query_,
12134
12199
  url_transformer_: url_transformer_,
12135
12200
  router_: router_,
12136
12201
  after_submit_: after_submit_,
12202
+ before_navigate_: before_navigate_,
12137
12203
  get_new_query: get_new_query
12138
12204
  } = _ref;
12139
12205
  const new_search_query = get_new_query();
@@ -12141,21 +12207,92 @@ async function $86b0ff0c85e5fc6c$export$e16630ecb9644a1c(_ref) {
12141
12207
  if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
12142
12208
  // don't push a history entry / re-search if someone submits a search again
12143
12209
  // do close the modal though
12210
+ search_field_value_.settle_(new_search_query);
12144
12211
  on_submit_with_unchanged_value_ === null || on_submit_with_unchanged_value_ === void 0 || on_submit_with_unchanged_value_();
12145
- return;
12212
+ return false;
12146
12213
  }
12147
- set_search_field_value_(previous_query); // restore the value to the previous query since this one goes to the new history entry
12148
12214
  const target_url = new URL(location.href);
12149
12215
  url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(target_url);
12150
12216
  target_url.searchParams.set(search_param_name_, new_search_query);
12151
- await router_.navigate_.go_to_({
12152
- new_url_: target_url,
12153
- is_replace_: false,
12154
- force_spa_navigation_: true
12155
- });
12156
- set_search_field_value_(new_search_query);
12217
+ const end_submit = search_field_value_.begin_submit_(new_search_query, previous_query);
12218
+ before_navigate_ === null || before_navigate_ === void 0 || before_navigate_();
12219
+ let landed;
12220
+ try {
12221
+ await router_.navigate_.go_to_({
12222
+ new_url_: target_url,
12223
+ is_replace_: false,
12224
+ force_spa_navigation_: true
12225
+ });
12226
+ } finally {
12227
+ landed = end_submit();
12228
+ }
12229
+ if (!landed) return false;
12157
12230
  scrollTo(0, 0);
12158
12231
  after_submit_ === null || after_submit_ === void 0 || after_submit_();
12232
+ return true;
12233
+ }
12234
+ function $8a9827cc2842b300$export$d13a185c53aa5edf(persisted_, get_search_query_) {
12235
+ const [get_persisted, set_persisted] = persisted_;
12236
+ const [get_submitting, set_submitting] = $b8hua$createSignal();
12237
+ const get_value = $b8hua$createMemo(() => {
12238
+ var _get_submitting;
12239
+ return (_get_submitting = get_submitting()) !== null && _get_submitting !== void 0 ? _get_submitting : get_persisted();
12240
+ });
12241
+ const set_value = value => {
12242
+ const new_value = typeof value === "function" ? value($b8hua$untrack(get_value)) : value;
12243
+ if ($b8hua$untrack(get_submitting) === undefined) set_persisted(new_value);else set_submitting(new_value);
12244
+ return new_value;
12245
+ };
12246
+ let current_submit;
12247
+ const end_submit = landed => {
12248
+ current_submit.landed_ = landed;
12249
+ current_submit = undefined;
12250
+ $b8hua$batch(() => {
12251
+ const submitting = $b8hua$untrack(get_submitting);
12252
+ set_submitting(undefined);
12253
+ if (landed && submitting !== undefined) set_persisted(submitting);
12254
+ });
12255
+ };
12256
+ const abort_on_popstate = what_happened => {
12257
+ if (what_happened === "popstate" && current_submit) end_submit(false);
12258
+ };
12259
+ (0, $b8hua$instant_exec_on_suspect_history_change).add(abort_on_popstate);
12260
+ $b8hua$onCleanup(() => (0, $b8hua$instant_exec_on_suspect_history_change).delete(abort_on_popstate));
12261
+ $b8hua$createEffect($b8hua$on(get_search_query_, query => {
12262
+ const token = current_submit;
12263
+ if (!token || query !== token.query_) return;
12264
+ queueMicrotask(() => {
12265
+ if (current_submit === token) end_submit(true);
12266
+ });
12267
+ }, {
12268
+ defer: true
12269
+ }));
12270
+ const begin_submit_ = (submitted_query, query_of_current_history_entry) => {
12271
+ const token = current_submit = {
12272
+ query_: submitted_query,
12273
+ landed_: false
12274
+ };
12275
+ $b8hua$batch(() => {
12276
+ set_submitting(submitted_query);
12277
+ set_persisted(query_of_current_history_entry);
12278
+ });
12279
+ return () => {
12280
+ if (current_submit === token) end_submit(true);
12281
+ return token.landed_;
12282
+ };
12283
+ };
12284
+ const settle_ = query => {
12285
+ if (current_submit) return;
12286
+ $b8hua$batch(() => {
12287
+ set_submitting(undefined);
12288
+ set_persisted(query);
12289
+ });
12290
+ };
12291
+ return {
12292
+ value_: [get_value, set_value],
12293
+ begin_submit_: begin_submit_,
12294
+ settle_: settle_
12295
+ };
12159
12296
  }
12160
12297
  function $96d57a48e7bce64f$export$181cceed5c91919e(callback, alsoRaF, passiveListener) {
12161
12298
  let aligned_this_microtask = false;
@@ -12829,6 +12966,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
12829
12966
  scroll_restoration_data_: scroll_restoration_data_,
12830
12967
  product_card_template_: product_card_template_,
12831
12968
  modalAlignmentSignalsRef_: modalAlignmentSignalsRef_,
12969
+ inputFieldRef_: inputFieldRef_,
12832
12970
  router_: router_,
12833
12971
  content_results_rows_: content_results_rows_,
12834
12972
  content_layout_options_: content_layout_options_,
@@ -13024,6 +13162,8 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
13024
13162
  if (!search_field) break add_input_field;
13025
13163
  setModalBodyStyle({});
13026
13164
  modalAlignmentSignalsRef_ === null || modalAlignmentSignalsRef_ === void 0 || modalAlignmentSignalsRef_(alignmentSignals_);
13165
+ inputFieldRef_ === null || inputFieldRef_ === void 0 || inputFieldRef_(input_element);
13166
+ $b8hua$onCleanup(() => inputFieldRef_ === null || inputFieldRef_ === void 0 ? void 0 : inputFieldRef_(undefined));
13027
13167
  const [pollAlignment, setPollAlignment_] = $b8hua$createSignal(false);
13028
13168
  const align_position = $b8hua$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);
13029
13169
  div_with_field_class.addEventListener("click", $b8hua$catchify1(e => {
@@ -13392,14 +13532,16 @@ class $eb064bc3350276c1$export$ac6237957a15b3f0 {
13392
13532
  set_search_content_results_rows((0, $d53ebed6f63304e4$export$70ceae36059a1036));
13393
13533
  }; // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
13394
13534
  const on_submit_with_unchanged_value_ = () => this.modal_open = false;
13395
- const [get_search_field_value_, set_search_field_value_] = state_.field_value;
13396
- const configured_submit_query_ = new_query => $86b0ff0c85e5fc6c$export$e16630ecb9644a1c({
13535
+ const search_field_value_ = $8a9827cc2842b300$export$d13a185c53aa5edf(state_.field_value, get_search_query_);
13536
+ const [get_search_field_value_] = search_field_value_.value_;
13537
+ const configured_submit_query_ = (new_query, before_navigate_) => $86b0ff0c85e5fc6c$export$e16630ecb9644a1c({
13397
13538
  on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
13398
- set_search_field_value_: set_search_field_value_,
13539
+ search_field_value_: search_field_value_,
13399
13540
  get_search_query_: get_search_query_,
13400
13541
  search_param_name_: search_query_url_param_name_,
13401
13542
  after_submit_: after_submit_,
13402
- get_new_query: () => new_query || $b8hua$untrack(get_search_field_value_),
13543
+ before_navigate_: before_navigate_,
13544
+ get_new_query: () => new_query !== null && new_query !== void 0 ? new_query : $b8hua$untrack(get_search_field_value_),
13403
13545
  url_transformer_: url_transformer,
13404
13546
  router_: $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $eb064bc3350276c1$var$_router)
13405
13547
  });
@@ -13418,6 +13560,7 @@ class $eb064bc3350276c1$export$ac6237957a15b3f0 {
13418
13560
  search_query_url_param_name_: search_query_url_param_name_,
13419
13561
  reset_history_state_: reset_history_state_,
13420
13562
  state_: state_,
13563
+ search_field_value_: search_field_value_.value_,
13421
13564
  router_: $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $eb064bc3350276c1$var$_router),
13422
13565
  url_transformer_: url_transformer,
13423
13566
  depict_api_: depict_api_,
@@ -13441,7 +13584,11 @@ class $eb064bc3350276c1$export$ac6237957a15b3f0 {
13441
13584
  $b8hua$onCleanup(() => _this.modal_open = false);
13442
13585
  return searchModalComponent(...arguments);
13443
13586
  }, {
13444
- search_field_value_: state_.field_value,
13587
+ search_field_value_: search_field_value_.value_,
13588
+ get_search_page_input_element_: () => {
13589
+ var _privately_shared_pro2;
13590
+ return (_privately_shared_pro2 = $eb064bc3350276c1$export$dde08b2dca8cc1ce.get(this)) === null || _privately_shared_pro2 === void 0 ? void 0 : _privately_shared_pro2.search_page_input_element_;
13591
+ },
13445
13592
  get_search_query_: get_search_query_,
13446
13593
  search_query_url_param_name_: search_query_url_param_name_,
13447
13594
  previous_searches_: previous_searches,
@@ -13606,6 +13753,7 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
13606
13753
  const {
13607
13754
  state_: state_
13608
13755
  } = shared_properties;
13756
+ let registered_input_element;
13609
13757
  const grid_spacing_override = $b8hua$createMemo(() => {
13610
13758
  const {
13611
13759
  grid_spacing: grid_spacing
@@ -13637,7 +13785,7 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
13637
13785
  var _depict_search$enable;
13638
13786
  return (_depict_search$enable = depict_search.enable_content_search) !== null && _depict_search$enable !== void 0 ? _depict_search$enable : $eb064bc3350276c1$var$content_search_default;
13639
13787
  },
13640
- search_field_value_: state_.field_value,
13788
+ search_field_value_: shared_properties.search_field_value_,
13641
13789
  get_search_query_: shared_properties.get_search_query_,
13642
13790
  clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
13643
13791
  open_modal_: function () {
@@ -13648,6 +13796,16 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
13648
13796
  modalVersionUsed_: shared_properties.modalVersionUsed_,
13649
13797
  showSliderArrow_: () => props.showSliderArrow_,
13650
13798
  i18n_: shared_properties.i18n_,
13799
+ inputFieldRef_: input_element => {
13800
+ const shared_info_right_now = $eb064bc3350276c1$export$dde08b2dca8cc1ce.get(depict_search);
13801
+ if (!shared_info_right_now) return;
13802
+ if (input_element === undefined && shared_info_right_now.search_page_input_element_ !== registered_input_element) return;
13803
+ registered_input_element = input_element;
13804
+ $eb064bc3350276c1$export$dde08b2dca8cc1ce.set(depict_search, {
13805
+ ...shared_info_right_now,
13806
+ search_page_input_element_: input_element
13807
+ });
13808
+ },
13651
13809
  modalAlignmentSignalsRef_: style => {
13652
13810
  const shared_info_right_now = $eb064bc3350276c1$export$dde08b2dca8cc1ce.get(depict_search);
13653
13811
  if (!shared_info_right_now) return;
@@ -14094,7 +14252,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
14094
14252
  return shared_properties.BackIcon_;
14095
14253
  },
14096
14254
  get search_field_value_() {
14097
- return shared_properties.state_.field_value;
14255
+ return shared_properties.search_field_value_;
14098
14256
  },
14099
14257
  get submit_query_() {
14100
14258
  return shared_properties.configured_submit_query_;
@@ -14137,7 +14295,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
14137
14295
  return shared_properties.BackIcon_;
14138
14296
  },
14139
14297
  get search_field_value_() {
14140
- return shared_properties.state_.field_value;
14298
+ return shared_properties.search_field_value_;
14141
14299
  },
14142
14300
  get submit_query_() {
14143
14301
  return shared_properties.configured_submit_query_;