@depict-ai/ui 4.3.14 → 4.4.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.
package/ES10/index.cjs CHANGED
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
100
100
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
101
101
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
102
102
  /*! Depict.ai search and product listing SDK */
103
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.14";
103
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.4.0";
104
104
  const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
105
105
  const cols_at_size = [];
106
106
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -3601,10 +3601,13 @@ let $c95c6dd9e93acd82$export$44dad306455dddf;
3601
3601
  DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
3602
3602
  })($c95c6dd9e93acd82$export$44dad306455dddf || ($c95c6dd9e93acd82$export$44dad306455dddf = {}));
3603
3603
  var $29e5dbeb69da7a36$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<button class=back type=button>`),
3604
- $29e5dbeb69da7a36$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=search-field role=search><!$><!/><div class=field><input class=query tabindex=0><button type=button class=clear></button></div><button class="submit major"type=button>`);
3604
+ $29e5dbeb69da7a36$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<button type=button class=clear>`),
3605
+ $29e5dbeb69da7a36$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=spacer>`),
3606
+ $29e5dbeb69da7a36$var$_tmpl$4 = /*#__PURE__*/$52FdA$solidjsweb.template(`<button class="submit major"type=button>`),
3607
+ $29e5dbeb69da7a36$var$_tmpl$5 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=search-field role=search><!$><!/><!$><!/><div class=field><!$><!/><input class=query tabindex=0><!$><!/></div><!$><!/><!$><!/>`);
3605
3608
  function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3606
3609
  let {
3607
- search_field_value_: search_field_value_,
3610
+ search_field_value_: [searchFieldValue, setSearchFieldValue],
3608
3611
  input_field_ref_: input_field_ref_,
3609
3612
  field_element_ref_: field_element_ref_,
3610
3613
  submit_query_: submit_query_,
@@ -3629,30 +3632,105 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3629
3632
  })); // focus field on render
3630
3633
  const owner_of_field_element = $52FdA$solidjs.getOwner();
3631
3634
  const isNewModal = BackIcon_[(0, $072ab198d82c3eb7$export$1ea76ea778b880dd)] === 2;
3635
+ const [backButtonWidthAccessor, setBackButtonWidthAccessor] = $52FdA$solidjs.createSignal();
3636
+ const getBackButtonWidth = () => {
3637
+ var _backButtonWidthAcces;
3638
+ return (_backButtonWidthAcces = backButtonWidthAccessor()) === null || _backButtonWidthAcces === void 0 ? void 0 : _backButtonWidthAcces();
3639
+ };
3640
+ const searchFieldEmpty = $52FdA$solidjs.createMemo(() => !searchFieldValue());
3641
+ const BackButton = () => $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
3642
+ when: on_back_,
3643
+ get children() {
3644
+ var _el$ = $52FdA$solidjsweb.getNextElement($29e5dbeb69da7a36$var$_tmpl$);
3645
+ $52FdA$solidjsweb.spread(_el$, $52FdA$solidjsweb.mergeProps({
3646
+ get onClick() {
3647
+ return $52FdA$depictaiutilishared.catchify(on_back_);
3648
+ },
3649
+ get ["aria-label"]() {
3650
+ return i18n_.back_();
3651
+ }
3652
+ }, isNewModal && {
3653
+ ref: el => {
3654
+ setBackButtonWidthAccessor(() => $c387d7f1d9fb66c0$export$ebdc3711f7e02ccd(el));
3655
+ $52FdA$solidjs.onCleanup(() => setBackButtonWidthAccessor());
3656
+ }
3657
+ }), false, true);
3658
+ $52FdA$solidjsweb.insert(_el$, isNewModal ? $52FdA$solidjsweb.createComponent((0, $083b2336093176cf$export$3b621d86b1566b2), {}) : $52FdA$solidjsweb.createComponent(BackIcon_, {}));
3659
+ $52FdA$solidjsweb.runHydrationEvents();
3660
+ return _el$;
3661
+ }
3662
+ });
3663
+ const ClearButton = () => (() => {
3664
+ var _el$2 = $52FdA$solidjsweb.getNextElement($29e5dbeb69da7a36$var$_tmpl$2);
3665
+ $52FdA$solidjsweb.spread(_el$2, $52FdA$solidjsweb.mergeProps({
3666
+ get classList() {
3667
+ return {
3668
+ empty: searchFieldEmpty()
3669
+ };
3670
+ },
3671
+ get style() {
3672
+ return isNewModal || !searchFieldEmpty() ? "" : "display: none";
3673
+ },
3674
+ get onClick() {
3675
+ return $52FdA$depictaiutilishared.catchify(() => {
3676
+ if (isNewModal && searchFieldEmpty()) return;
3677
+ setSearchFieldValue("");
3678
+ clear_filters_(true);
3679
+ if (!disabled_) input_element.focus();
3680
+ });
3681
+ }
3682
+ }, () => searchFieldEmpty() ? {
3683
+ "aria-hidden": "true"
3684
+ } : {
3685
+ title: i18n_.clear_filters_query_sorting_after_submit_()
3686
+ }), false, true);
3687
+ $52FdA$solidjsweb.insert(_el$2, isNewModal ? $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
3688
+ get when() {
3689
+ return !searchFieldEmpty();
3690
+ },
3691
+ get fallback() {
3692
+ return $52FdA$solidjsweb.createComponent((0, $5b88b077e48a4451$export$82eafebb825fc23f), {});
3693
+ },
3694
+ get children() {
3695
+ return $52FdA$solidjsweb.createComponent(BackIcon_, {});
3696
+ }
3697
+ }) : $52FdA$solidjsweb.createComponent((0, $083b2336093176cf$export$3b621d86b1566b2), {}));
3698
+ $52FdA$solidjsweb.runHydrationEvents();
3699
+ return _el$2;
3700
+ })();
3632
3701
  return (() => {
3633
- var _el$ = $52FdA$solidjsweb.getNextElement($29e5dbeb69da7a36$var$_tmpl$2),
3634
- _el$7 = _el$.firstChild,
3702
+ var _el$3 = $52FdA$solidjsweb.getNextElement($29e5dbeb69da7a36$var$_tmpl$5),
3703
+ _el$12 = _el$3.firstChild,
3704
+ [_el$13, _co$3] = $52FdA$solidjsweb.getNextMarker(_el$12.nextSibling),
3705
+ _el$14 = _el$13.nextSibling,
3706
+ [_el$15, _co$4] = $52FdA$solidjsweb.getNextMarker(_el$14.nextSibling),
3707
+ _el$5 = _el$15.nextSibling,
3708
+ _el$7 = _el$5.firstChild,
3635
3709
  [_el$8, _co$] = $52FdA$solidjsweb.getNextMarker(_el$7.nextSibling),
3636
- _el$3 = _el$8.nextSibling,
3637
- _el$4 = _el$3.firstChild,
3638
- _el$5 = _el$4.nextSibling,
3639
- _el$6 = _el$3.nextSibling;
3640
- $52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
3641
- when: on_back_,
3710
+ _el$6 = _el$8.nextSibling,
3711
+ _el$9 = _el$6.nextSibling,
3712
+ [_el$10, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$9.nextSibling),
3713
+ _el$16 = _el$5.nextSibling,
3714
+ [_el$17, _co$5] = $52FdA$solidjsweb.getNextMarker(_el$16.nextSibling),
3715
+ _el$18 = _el$17.nextSibling,
3716
+ [_el$19, _co$6] = $52FdA$solidjsweb.getNextMarker(_el$18.nextSibling);
3717
+ _el$3.classList.toggle("in-modal", !!!!on_back_);
3718
+ $52FdA$solidjsweb.insert(_el$3, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
3719
+ get when() {
3720
+ return getBackButtonWidth() !== undefined && on_back_;
3721
+ },
3642
3722
  get children() {
3643
- var _el$2 = $52FdA$solidjsweb.getNextElement($29e5dbeb69da7a36$var$_tmpl$);
3644
- $52FdA$solidjsweb.addEventListener(_el$2, "click", $52FdA$depictaiutilishared.catchify(on_back_), true);
3645
- $52FdA$solidjsweb.insert(_el$2, $52FdA$solidjsweb.createComponent(BackIcon_, {}));
3646
- $52FdA$solidjsweb.effect(() => $52FdA$solidjsweb.setAttribute(_el$2, "aria-label", i18n_.back_()));
3647
- $52FdA$solidjsweb.runHydrationEvents();
3648
- return _el$2;
3723
+ var _el$4 = $52FdA$solidjsweb.getNextElement($29e5dbeb69da7a36$var$_tmpl$3);
3724
+ $52FdA$solidjsweb.effect(() => (getBackButtonWidth(), _el$4.style.setProperty("width", getBackButtonWidth() + "px")));
3725
+ return _el$4;
3649
3726
  }
3650
- }), _el$8, _co$);
3727
+ }), _el$13, _co$3);
3728
+ $52FdA$solidjsweb.insert(_el$3, !isNewModal && $52FdA$solidjsweb.createComponent(BackButton, {}), _el$15, _co$4);
3651
3729
  $52FdA$solidjsweb.use(el => {
3652
3730
  field_div = el;
3653
3731
  field_element_ref_ === null || field_element_ref_ === void 0 || field_element_ref_(el);
3654
- }, _el$3);
3655
- $52FdA$solidjsweb.addEventListener(_el$3, "click", $52FdA$depictaiutilishared.catchify(_ref2 => {
3732
+ }, _el$5);
3733
+ $52FdA$solidjsweb.addEventListener(_el$5, "click", $52FdA$depictaiutilishared.catchify(_ref2 => {
3656
3734
  let {
3657
3735
  target: target,
3658
3736
  currentTarget: currentTarget,
@@ -3677,7 +3755,8 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3677
3755
  }
3678
3756
  }
3679
3757
  }), true);
3680
- _el$4.$$pointerdown = _ref3 => {
3758
+ $52FdA$solidjsweb.insert(_el$5, isNewModal && $52FdA$solidjsweb.createComponent(ClearButton, {}), _el$8, _co$);
3759
+ _el$6.$$pointerdown = _ref3 => {
3681
3760
  let {
3682
3761
  pointerType: pointerType
3683
3762
  } = _ref3;
@@ -3697,7 +3776,7 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3697
3776
  $52FdA$solidjs.runWithOwner(owner_of_field_element, () => $52FdA$solidjs.onCleanup(() => window.removeEventListener("pointerup", handler)));
3698
3777
  }
3699
3778
  };
3700
- $52FdA$solidjsweb.addEventListener(_el$4, "select", $52FdA$depictaiutilishared.catchify(() => {
3779
+ $52FdA$solidjsweb.addEventListener(_el$6, "select", $52FdA$depictaiutilishared.catchify(() => {
3701
3780
  if (disabled_)
3702
3781
  // just in case. The field not actually being disabled when being disabled_ is so that you can focus it and open the modal. We don't want any of the other input-field-interaction features to work
3703
3782
  return;
@@ -3709,14 +3788,14 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3709
3788
  once: true
3710
3789
  });
3711
3790
  }));
3712
- $52FdA$solidjsweb.addEventListener(_el$4, "input", $52FdA$depictaiutilishared.catchify(() => {
3791
+ $52FdA$solidjsweb.addEventListener(_el$6, "input", $52FdA$depictaiutilishared.catchify(() => {
3713
3792
  const {
3714
3793
  value: value
3715
3794
  } = input_element;
3716
3795
  if (!disabled_ && !value.length) clear_filters_(false); // if the user clears the whole field, reset filters on next submit
3717
- search_field_value_[1](value);
3796
+ setSearchFieldValue(value);
3718
3797
  }), true);
3719
- $52FdA$solidjsweb.addEventListener(_el$4, "keydown", $52FdA$depictaiutilishared.catchify(e => {
3798
+ $52FdA$solidjsweb.addEventListener(_el$6, "keydown", $52FdA$depictaiutilishared.catchify(e => {
3720
3799
  if (disabled_) {
3721
3800
  if (e.key !== "Tab" && e.key !== "Shift")
3722
3801
  // 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
@@ -3730,45 +3809,36 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3730
3809
  input_element = el;
3731
3810
  input_field_ref_ === null || input_field_ref_ === void 0 || input_field_ref_(el);
3732
3811
  });
3733
- typeof _ref$ === "function" && $52FdA$solidjsweb.use(_ref$, _el$4);
3734
- _el$4.classList.toggle("has-adjacent-back-button", !!!!on_back_);
3735
- $52FdA$solidjsweb.addEventListener(_el$5, "click", $52FdA$depictaiutilishared.catchify(() => {
3736
- search_field_value_[1]("");
3737
- clear_filters_(true);
3738
- if (!disabled_) input_element.focus();
3739
- }), true);
3740
- $52FdA$solidjsweb.insert(_el$5, $52FdA$solidjsweb.createComponent((0, $083b2336093176cf$export$3b621d86b1566b2), {}));
3741
- var _ref$2 = submit_button_ref_;
3742
- typeof _ref$2 === "function" ? $52FdA$solidjsweb.use(_ref$2, _el$6) : submit_button_ref_ = _el$6;
3743
- $52FdA$solidjsweb.spread(_el$6, $52FdA$solidjsweb.mergeProps({
3744
- get onClick() {
3745
- return $52FdA$depictaiutilishared.catchify(() => submit_query_());
3812
+ typeof _ref$ === "function" && $52FdA$solidjsweb.use(_ref$, _el$6);
3813
+ _el$6.classList.toggle("has-adjacent-back-button", !!!!on_back_);
3814
+ $52FdA$solidjsweb.insert(_el$5, !isNewModal && $52FdA$solidjsweb.createComponent(ClearButton, {}), _el$10, _co$2);
3815
+ $52FdA$solidjsweb.insert(_el$3, isNewModal && $52FdA$solidjsweb.createComponent(BackButton, {}), _el$17, _co$5);
3816
+ $52FdA$solidjsweb.insert(_el$3, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
3817
+ when: !isNewModal,
3818
+ get children() {
3819
+ var _el$11 = $52FdA$solidjsweb.getNextElement($29e5dbeb69da7a36$var$_tmpl$4);
3820
+ $52FdA$solidjsweb.addEventListener(_el$11, "click", $52FdA$depictaiutilishared.catchify(() => submit_query_()), true);
3821
+ var _ref$2 = submit_button_ref_;
3822
+ typeof _ref$2 === "function" ? $52FdA$solidjsweb.use(_ref$2, _el$11) : submit_button_ref_ = _el$11;
3823
+ $52FdA$solidjsweb.insert(_el$11, $52FdA$solidjsweb.createComponent((0, $5b88b077e48a4451$export$82eafebb825fc23f), {}));
3824
+ $52FdA$solidjsweb.effect(() => $52FdA$solidjsweb.setAttribute(_el$11, "aria-label", i18n_.search_submit_button_aria_label_()));
3825
+ $52FdA$solidjsweb.runHydrationEvents();
3826
+ return _el$11;
3746
3827
  }
3747
- }, () => isNewModal ? {
3748
- tabindex: "-1"
3749
- } : {
3750
- "aria-label": i18n_.search_submit_button_aria_label_()
3751
- }), false, true);
3752
- $52FdA$solidjsweb.insert(_el$6, $52FdA$solidjsweb.createComponent((0, $5b88b077e48a4451$export$82eafebb825fc23f), {}));
3828
+ }), _el$19, _co$6);
3753
3829
  $52FdA$solidjsweb.effect(_p$ => {
3754
3830
  var _v$ = i18n_.search_field_field_aria_label_(),
3755
- _v$2 = i18n_.placeholder_text_(),
3756
- _v$3 = i18n_.clear_filters_query_sorting_after_submit_(),
3757
- _v$4 = $52FdA$solidjs.createMemo(() => search_field_value_[0]() ? "" : "display: none")();
3758
- _v$ !== _p$.e && $52FdA$solidjsweb.setAttribute(_el$4, "aria-label", _p$.e = _v$);
3759
- _v$2 !== _p$.t && $52FdA$solidjsweb.setAttribute(_el$4, "placeholder", _p$.t = _v$2);
3760
- _v$3 !== _p$.a && $52FdA$solidjsweb.setAttribute(_el$5, "title", _p$.a = _v$3);
3761
- _p$.o = $52FdA$solidjsweb.style(_el$5, _v$4, _p$.o);
3831
+ _v$2 = i18n_.placeholder_text_();
3832
+ _v$ !== _p$.e && $52FdA$solidjsweb.setAttribute(_el$6, "aria-label", _p$.e = _v$);
3833
+ _v$2 !== _p$.t && $52FdA$solidjsweb.setAttribute(_el$6, "placeholder", _p$.t = _v$2);
3762
3834
  return _p$;
3763
3835
  }, {
3764
3836
  e: undefined,
3765
- t: undefined,
3766
- a: undefined,
3767
- o: undefined
3837
+ t: undefined
3768
3838
  });
3769
- $52FdA$solidjsweb.effect(() => $52FdA$solidjsweb.setProperty(_el$4, "value", search_field_value_[0]()));
3839
+ $52FdA$solidjsweb.effect(() => $52FdA$solidjsweb.setProperty(_el$6, "value", searchFieldValue()));
3770
3840
  $52FdA$solidjsweb.runHydrationEvents();
3771
- return _el$;
3841
+ return _el$3;
3772
3842
  })();
3773
3843
  }
3774
3844
  $52FdA$solidjsweb.delegateEvents(["click", "keydown", "input", "pointerdown"]);
@@ -3951,7 +4021,7 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
3951
4021
  };
3952
4022
  });
3953
4023
  const search_field = $29e5dbeb69da7a36$export$b94867ecbd698f21({
3954
- BackIcon_: () => $52FdA$solidjsweb.createComponent((0, $820f2920cc576f7e$export$8d8893ffd8aca39a), {}),
4024
+ BackIcon_: (0, $820f2920cc576f7e$export$8d8893ffd8aca39a),
3955
4025
  input_field_ref_: element => set_input_field(element),
3956
4026
  override_on_enter_: e => {
3957
4027
  var _on_enter_in_search_f;
@@ -3970,7 +4040,6 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
3970
4040
  input_el.setSelectionRange(start, end);
3971
4041
  }
3972
4042
  });
3973
- search_field.classList.add("in-modal");
3974
4043
  const modal_element = (() => {
3975
4044
  var _el$4 = $52FdA$solidjsweb.getNextElement($9035b24c2dbd3f36$var$_tmpl$3),
3976
4045
  _el$5 = _el$4.firstChild,
@@ -5239,7 +5308,7 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
5239
5308
  return _el$7;
5240
5309
  })();
5241
5310
  const search_field = $29e5dbeb69da7a36$export$b94867ecbd698f21({
5242
- BackIcon_: () => $52FdA$solidjsweb.createComponent((0, $50b50df3efaa8776$export$11e9f390c90a537f), {}),
5311
+ BackIcon_: (0, $50b50df3efaa8776$export$11e9f390c90a537f),
5243
5312
  input_field_ref_: element => set_input_field(element),
5244
5313
  override_on_enter_: e => {
5245
5314
  var _on_enter_in_search_f;
@@ -5258,7 +5327,6 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
5258
5327
  input_el.setSelectionRange(start, end);
5259
5328
  }
5260
5329
  });
5261
- search_field.classList.add("in-modal");
5262
5330
  if (setSearchFieldOuterWidth_) {
5263
5331
  const resizeObserver = new ResizeObserver($52FdA$depictaiutilishared.catchify(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));
5264
5332
  resizeObserver.observe(search_field);
@@ -13591,7 +13659,7 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
13591
13659
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
13592
13660
  setPollAlignment_(true);
13593
13661
  // Fade out submit button so there aren't two overlapping buttons for a split second
13594
- submitButton_.animate([{
13662
+ submitButton_ === null || submitButton_ === void 0 || submitButton_.animate([{
13595
13663
  opacity: 1
13596
13664
  }, {
13597
13665
  opacity: 0
@@ -13673,7 +13741,7 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
13673
13741
  duration: closeDuration_,
13674
13742
  fill: "forwards",
13675
13743
  easing: "ease-out"
13676
- }).finished, submitButton_.animate([{
13744
+ }).finished, submitButton_ === null || submitButton_ === void 0 ? void 0 : submitButton_.animate([{
13677
13745
  opacity: 0
13678
13746
  }, {
13679
13747
  opacity: 1
package/ES10/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "4.3.14";
13
+ export const version = "4.4.0";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
package/ES10/index.js CHANGED
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.14";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.4.0";
14
14
  const $a9c7ba6087881ac2$var$transform_elements = sorted_cols_at_size => {
15
15
  const cols_at_size = [];
16
16
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -3511,10 +3511,13 @@ let $c3820807ac1e6fd7$export$44dad306455dddf;
3511
3511
  DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
3512
3512
  })($c3820807ac1e6fd7$export$44dad306455dddf || ($c3820807ac1e6fd7$export$44dad306455dddf = {}));
3513
3513
  var $584c06c09cf4609d$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<button class=back type=button>`),
3514
- $584c06c09cf4609d$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div class=search-field role=search><!$><!/><div class=field><input class=query tabindex=0><button type=button class=clear></button></div><button class="submit major"type=button>`);
3514
+ $584c06c09cf4609d$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<button type=button class=clear>`),
3515
+ $584c06c09cf4609d$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<div class=spacer>`),
3516
+ $584c06c09cf4609d$var$_tmpl$4 = /*#__PURE__*/$8tj43$template(`<button class="submit major"type=button>`),
3517
+ $584c06c09cf4609d$var$_tmpl$5 = /*#__PURE__*/$8tj43$template(`<div class=search-field role=search><!$><!/><!$><!/><div class=field><!$><!/><input class=query tabindex=0><!$><!/></div><!$><!/><!$><!/>`);
3515
3518
  function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3516
3519
  let {
3517
- search_field_value_: search_field_value_,
3520
+ search_field_value_: [searchFieldValue, setSearchFieldValue],
3518
3521
  input_field_ref_: input_field_ref_,
3519
3522
  field_element_ref_: field_element_ref_,
3520
3523
  submit_query_: submit_query_,
@@ -3539,30 +3542,105 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3539
3542
  })); // focus field on render
3540
3543
  const owner_of_field_element = $8tj43$getOwner();
3541
3544
  const isNewModal = BackIcon_[(0, $b026fa9c9c904a98$export$1ea76ea778b880dd)] === 2;
3545
+ const [backButtonWidthAccessor, setBackButtonWidthAccessor] = $8tj43$createSignal();
3546
+ const getBackButtonWidth = () => {
3547
+ var _backButtonWidthAcces;
3548
+ return (_backButtonWidthAcces = backButtonWidthAccessor()) === null || _backButtonWidthAcces === void 0 ? void 0 : _backButtonWidthAcces();
3549
+ };
3550
+ const searchFieldEmpty = $8tj43$createMemo(() => !searchFieldValue());
3551
+ const BackButton = () => $8tj43$createComponent((0, $8tj43$Show), {
3552
+ when: on_back_,
3553
+ get children() {
3554
+ var _el$ = $8tj43$getNextElement($584c06c09cf4609d$var$_tmpl$);
3555
+ $8tj43$spread(_el$, $8tj43$mergeProps({
3556
+ get onClick() {
3557
+ return $8tj43$catchify(on_back_);
3558
+ },
3559
+ get ["aria-label"]() {
3560
+ return i18n_.back_();
3561
+ }
3562
+ }, isNewModal && {
3563
+ ref: el => {
3564
+ setBackButtonWidthAccessor(() => $fc830a7ee59416ef$export$ebdc3711f7e02ccd(el));
3565
+ $8tj43$onCleanup(() => setBackButtonWidthAccessor());
3566
+ }
3567
+ }), false, true);
3568
+ $8tj43$insert(_el$, isNewModal ? $8tj43$createComponent((0, $9783d437ad61594c$export$3b621d86b1566b2), {}) : $8tj43$createComponent(BackIcon_, {}));
3569
+ $8tj43$runHydrationEvents();
3570
+ return _el$;
3571
+ }
3572
+ });
3573
+ const ClearButton = () => (() => {
3574
+ var _el$2 = $8tj43$getNextElement($584c06c09cf4609d$var$_tmpl$2);
3575
+ $8tj43$spread(_el$2, $8tj43$mergeProps({
3576
+ get classList() {
3577
+ return {
3578
+ empty: searchFieldEmpty()
3579
+ };
3580
+ },
3581
+ get style() {
3582
+ return isNewModal || !searchFieldEmpty() ? "" : "display: none";
3583
+ },
3584
+ get onClick() {
3585
+ return $8tj43$catchify(() => {
3586
+ if (isNewModal && searchFieldEmpty()) return;
3587
+ setSearchFieldValue("");
3588
+ clear_filters_(true);
3589
+ if (!disabled_) input_element.focus();
3590
+ });
3591
+ }
3592
+ }, () => searchFieldEmpty() ? {
3593
+ "aria-hidden": "true"
3594
+ } : {
3595
+ title: i18n_.clear_filters_query_sorting_after_submit_()
3596
+ }), false, true);
3597
+ $8tj43$insert(_el$2, isNewModal ? $8tj43$createComponent((0, $8tj43$Show), {
3598
+ get when() {
3599
+ return !searchFieldEmpty();
3600
+ },
3601
+ get fallback() {
3602
+ return $8tj43$createComponent((0, $ef0f18a578b32578$export$82eafebb825fc23f), {});
3603
+ },
3604
+ get children() {
3605
+ return $8tj43$createComponent(BackIcon_, {});
3606
+ }
3607
+ }) : $8tj43$createComponent((0, $9783d437ad61594c$export$3b621d86b1566b2), {}));
3608
+ $8tj43$runHydrationEvents();
3609
+ return _el$2;
3610
+ })();
3542
3611
  return (() => {
3543
- var _el$ = $8tj43$getNextElement($584c06c09cf4609d$var$_tmpl$2),
3544
- _el$7 = _el$.firstChild,
3612
+ var _el$3 = $8tj43$getNextElement($584c06c09cf4609d$var$_tmpl$5),
3613
+ _el$12 = _el$3.firstChild,
3614
+ [_el$13, _co$3] = $8tj43$getNextMarker(_el$12.nextSibling),
3615
+ _el$14 = _el$13.nextSibling,
3616
+ [_el$15, _co$4] = $8tj43$getNextMarker(_el$14.nextSibling),
3617
+ _el$5 = _el$15.nextSibling,
3618
+ _el$7 = _el$5.firstChild,
3545
3619
  [_el$8, _co$] = $8tj43$getNextMarker(_el$7.nextSibling),
3546
- _el$3 = _el$8.nextSibling,
3547
- _el$4 = _el$3.firstChild,
3548
- _el$5 = _el$4.nextSibling,
3549
- _el$6 = _el$3.nextSibling;
3550
- $8tj43$insert(_el$, $8tj43$createComponent((0, $8tj43$Show), {
3551
- when: on_back_,
3620
+ _el$6 = _el$8.nextSibling,
3621
+ _el$9 = _el$6.nextSibling,
3622
+ [_el$10, _co$2] = $8tj43$getNextMarker(_el$9.nextSibling),
3623
+ _el$16 = _el$5.nextSibling,
3624
+ [_el$17, _co$5] = $8tj43$getNextMarker(_el$16.nextSibling),
3625
+ _el$18 = _el$17.nextSibling,
3626
+ [_el$19, _co$6] = $8tj43$getNextMarker(_el$18.nextSibling);
3627
+ _el$3.classList.toggle("in-modal", !!!!on_back_);
3628
+ $8tj43$insert(_el$3, $8tj43$createComponent((0, $8tj43$Show), {
3629
+ get when() {
3630
+ return getBackButtonWidth() !== undefined && on_back_;
3631
+ },
3552
3632
  get children() {
3553
- var _el$2 = $8tj43$getNextElement($584c06c09cf4609d$var$_tmpl$);
3554
- $8tj43$addEventListener(_el$2, "click", $8tj43$catchify(on_back_), true);
3555
- $8tj43$insert(_el$2, $8tj43$createComponent(BackIcon_, {}));
3556
- $8tj43$effect(() => $8tj43$setAttribute(_el$2, "aria-label", i18n_.back_()));
3557
- $8tj43$runHydrationEvents();
3558
- return _el$2;
3633
+ var _el$4 = $8tj43$getNextElement($584c06c09cf4609d$var$_tmpl$3);
3634
+ $8tj43$effect(() => (getBackButtonWidth(), _el$4.style.setProperty("width", getBackButtonWidth() + "px")));
3635
+ return _el$4;
3559
3636
  }
3560
- }), _el$8, _co$);
3637
+ }), _el$13, _co$3);
3638
+ $8tj43$insert(_el$3, !isNewModal && $8tj43$createComponent(BackButton, {}), _el$15, _co$4);
3561
3639
  $8tj43$use(el => {
3562
3640
  field_div = el;
3563
3641
  field_element_ref_ === null || field_element_ref_ === void 0 || field_element_ref_(el);
3564
- }, _el$3);
3565
- $8tj43$addEventListener(_el$3, "click", $8tj43$catchify(_ref2 => {
3642
+ }, _el$5);
3643
+ $8tj43$addEventListener(_el$5, "click", $8tj43$catchify(_ref2 => {
3566
3644
  let {
3567
3645
  target: target,
3568
3646
  currentTarget: currentTarget,
@@ -3587,7 +3665,8 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3587
3665
  }
3588
3666
  }
3589
3667
  }), true);
3590
- _el$4.$$pointerdown = _ref3 => {
3668
+ $8tj43$insert(_el$5, isNewModal && $8tj43$createComponent(ClearButton, {}), _el$8, _co$);
3669
+ _el$6.$$pointerdown = _ref3 => {
3591
3670
  let {
3592
3671
  pointerType: pointerType
3593
3672
  } = _ref3;
@@ -3607,7 +3686,7 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3607
3686
  $8tj43$runWithOwner(owner_of_field_element, () => $8tj43$onCleanup(() => window.removeEventListener("pointerup", handler)));
3608
3687
  }
3609
3688
  };
3610
- $8tj43$addEventListener(_el$4, "select", $8tj43$catchify(() => {
3689
+ $8tj43$addEventListener(_el$6, "select", $8tj43$catchify(() => {
3611
3690
  if (disabled_)
3612
3691
  // just in case. The field not actually being disabled when being disabled_ is so that you can focus it and open the modal. We don't want any of the other input-field-interaction features to work
3613
3692
  return;
@@ -3619,14 +3698,14 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3619
3698
  once: true
3620
3699
  });
3621
3700
  }));
3622
- $8tj43$addEventListener(_el$4, "input", $8tj43$catchify(() => {
3701
+ $8tj43$addEventListener(_el$6, "input", $8tj43$catchify(() => {
3623
3702
  const {
3624
3703
  value: value
3625
3704
  } = input_element;
3626
3705
  if (!disabled_ && !value.length) clear_filters_(false); // if the user clears the whole field, reset filters on next submit
3627
- search_field_value_[1](value);
3706
+ setSearchFieldValue(value);
3628
3707
  }), true);
3629
- $8tj43$addEventListener(_el$4, "keydown", $8tj43$catchify(e => {
3708
+ $8tj43$addEventListener(_el$6, "keydown", $8tj43$catchify(e => {
3630
3709
  if (disabled_) {
3631
3710
  if (e.key !== "Tab" && e.key !== "Shift")
3632
3711
  // 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
@@ -3640,45 +3719,36 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3640
3719
  input_element = el;
3641
3720
  input_field_ref_ === null || input_field_ref_ === void 0 || input_field_ref_(el);
3642
3721
  });
3643
- typeof _ref$ === "function" && $8tj43$use(_ref$, _el$4);
3644
- _el$4.classList.toggle("has-adjacent-back-button", !!!!on_back_);
3645
- $8tj43$addEventListener(_el$5, "click", $8tj43$catchify(() => {
3646
- search_field_value_[1]("");
3647
- clear_filters_(true);
3648
- if (!disabled_) input_element.focus();
3649
- }), true);
3650
- $8tj43$insert(_el$5, $8tj43$createComponent((0, $9783d437ad61594c$export$3b621d86b1566b2), {}));
3651
- var _ref$2 = submit_button_ref_;
3652
- typeof _ref$2 === "function" ? $8tj43$use(_ref$2, _el$6) : submit_button_ref_ = _el$6;
3653
- $8tj43$spread(_el$6, $8tj43$mergeProps({
3654
- get onClick() {
3655
- return $8tj43$catchify(() => submit_query_());
3722
+ typeof _ref$ === "function" && $8tj43$use(_ref$, _el$6);
3723
+ _el$6.classList.toggle("has-adjacent-back-button", !!!!on_back_);
3724
+ $8tj43$insert(_el$5, !isNewModal && $8tj43$createComponent(ClearButton, {}), _el$10, _co$2);
3725
+ $8tj43$insert(_el$3, isNewModal && $8tj43$createComponent(BackButton, {}), _el$17, _co$5);
3726
+ $8tj43$insert(_el$3, $8tj43$createComponent((0, $8tj43$Show), {
3727
+ when: !isNewModal,
3728
+ get children() {
3729
+ var _el$11 = $8tj43$getNextElement($584c06c09cf4609d$var$_tmpl$4);
3730
+ $8tj43$addEventListener(_el$11, "click", $8tj43$catchify(() => submit_query_()), true);
3731
+ var _ref$2 = submit_button_ref_;
3732
+ typeof _ref$2 === "function" ? $8tj43$use(_ref$2, _el$11) : submit_button_ref_ = _el$11;
3733
+ $8tj43$insert(_el$11, $8tj43$createComponent((0, $ef0f18a578b32578$export$82eafebb825fc23f), {}));
3734
+ $8tj43$effect(() => $8tj43$setAttribute(_el$11, "aria-label", i18n_.search_submit_button_aria_label_()));
3735
+ $8tj43$runHydrationEvents();
3736
+ return _el$11;
3656
3737
  }
3657
- }, () => isNewModal ? {
3658
- tabindex: "-1"
3659
- } : {
3660
- "aria-label": i18n_.search_submit_button_aria_label_()
3661
- }), false, true);
3662
- $8tj43$insert(_el$6, $8tj43$createComponent((0, $ef0f18a578b32578$export$82eafebb825fc23f), {}));
3738
+ }), _el$19, _co$6);
3663
3739
  $8tj43$effect(_p$ => {
3664
3740
  var _v$ = i18n_.search_field_field_aria_label_(),
3665
- _v$2 = i18n_.placeholder_text_(),
3666
- _v$3 = i18n_.clear_filters_query_sorting_after_submit_(),
3667
- _v$4 = $8tj43$createMemo(() => search_field_value_[0]() ? "" : "display: none")();
3668
- _v$ !== _p$.e && $8tj43$setAttribute(_el$4, "aria-label", _p$.e = _v$);
3669
- _v$2 !== _p$.t && $8tj43$setAttribute(_el$4, "placeholder", _p$.t = _v$2);
3670
- _v$3 !== _p$.a && $8tj43$setAttribute(_el$5, "title", _p$.a = _v$3);
3671
- _p$.o = $8tj43$style(_el$5, _v$4, _p$.o);
3741
+ _v$2 = i18n_.placeholder_text_();
3742
+ _v$ !== _p$.e && $8tj43$setAttribute(_el$6, "aria-label", _p$.e = _v$);
3743
+ _v$2 !== _p$.t && $8tj43$setAttribute(_el$6, "placeholder", _p$.t = _v$2);
3672
3744
  return _p$;
3673
3745
  }, {
3674
3746
  e: undefined,
3675
- t: undefined,
3676
- a: undefined,
3677
- o: undefined
3747
+ t: undefined
3678
3748
  });
3679
- $8tj43$effect(() => $8tj43$setProperty(_el$4, "value", search_field_value_[0]()));
3749
+ $8tj43$effect(() => $8tj43$setProperty(_el$6, "value", searchFieldValue()));
3680
3750
  $8tj43$runHydrationEvents();
3681
- return _el$;
3751
+ return _el$3;
3682
3752
  })();
3683
3753
  }
3684
3754
  $8tj43$delegateEvents(["click", "keydown", "input", "pointerdown"]);
@@ -3861,7 +3931,7 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
3861
3931
  };
3862
3932
  });
3863
3933
  const search_field = $584c06c09cf4609d$export$b94867ecbd698f21({
3864
- BackIcon_: () => $8tj43$createComponent((0, $fac58b5610eec6a9$export$8d8893ffd8aca39a), {}),
3934
+ BackIcon_: (0, $fac58b5610eec6a9$export$8d8893ffd8aca39a),
3865
3935
  input_field_ref_: element => set_input_field(element),
3866
3936
  override_on_enter_: e => {
3867
3937
  var _on_enter_in_search_f;
@@ -3880,7 +3950,6 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
3880
3950
  input_el.setSelectionRange(start, end);
3881
3951
  }
3882
3952
  });
3883
- search_field.classList.add("in-modal");
3884
3953
  const modal_element = (() => {
3885
3954
  var _el$4 = $8tj43$getNextElement($40411f2ec772c376$var$_tmpl$3),
3886
3955
  _el$5 = _el$4.firstChild,
@@ -5149,7 +5218,7 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
5149
5218
  return _el$7;
5150
5219
  })();
5151
5220
  const search_field = $584c06c09cf4609d$export$b94867ecbd698f21({
5152
- BackIcon_: () => $8tj43$createComponent((0, $c2fe922d21c40514$export$11e9f390c90a537f), {}),
5221
+ BackIcon_: (0, $c2fe922d21c40514$export$11e9f390c90a537f),
5153
5222
  input_field_ref_: element => set_input_field(element),
5154
5223
  override_on_enter_: e => {
5155
5224
  var _on_enter_in_search_f;
@@ -5168,7 +5237,6 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
5168
5237
  input_el.setSelectionRange(start, end);
5169
5238
  }
5170
5239
  });
5171
- search_field.classList.add("in-modal");
5172
5240
  if (setSearchFieldOuterWidth_) {
5173
5241
  const resizeObserver = new ResizeObserver($8tj43$catchify(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));
5174
5242
  resizeObserver.observe(search_field);
@@ -13501,7 +13569,7 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
13501
13569
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
13502
13570
  setPollAlignment_(true);
13503
13571
  // Fade out submit button so there aren't two overlapping buttons for a split second
13504
- submitButton_.animate([{
13572
+ submitButton_ === null || submitButton_ === void 0 || submitButton_.animate([{
13505
13573
  opacity: 1
13506
13574
  }, {
13507
13575
  opacity: 0
@@ -13583,7 +13651,7 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
13583
13651
  duration: closeDuration_,
13584
13652
  fill: "forwards",
13585
13653
  easing: "ease-out"
13586
- }).finished, submitButton_.animate([{
13654
+ }).finished, submitButton_ === null || submitButton_ === void 0 ? void 0 : submitButton_.animate([{
13587
13655
  opacity: 0
13588
13656
  }, {
13589
13657
  opacity: 1