@magicx-eng/ai-autocomplete-react 0.50.0 → 0.52.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/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END as Ur,DATE_RANGE_META_START as Vr,DEFAULT_OPTION_COUNT_UNIT as Qr,dateCellMarks as Yr,formatDate as jr,formatDateRange as $r,formatOptionCount as Zr,formatPlace as Xr,formatTime as Jr,isoDate as es,LOCATION_META_KEY as ts,monthLabel as as,optionCountLabel as is,optionHasImage as os,optionImageSources as ns,optionImageSrc as rs,optionLabel as ss,optionsShowLeadingVisuals as ls,PRODUCT_PATH_PREFIX as ds,parseDate as cs,parseLooseDate as ps,parseLooseDateRange as hs,parseTime as us,productFromMatchedItem as ms,productImageSources as gs,productsFromCustomFields as fs,sanitizeOptionIconSvg as bs,selectedRangeFor as ws,TIME_META_KEY as vs,visibleDateRange as xs,WEEKDAY_LABELS as ys,withSkippedParams as ks}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Po,useCallback as Ot,useEffect as Dt,useImperativeHandle as Io,useLayoutEffect as Eo,useRef as Xe}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-67791514")){let e=document.createElement("style");e.id="ac-style-67791514",e.textContent=`.aia-container-KKjFU {
1
+ import{buildSubmitResult as $r,cellDay as Zr,cellIso as Xr,DATE_RANGE_META_END as Jr,DATE_RANGE_META_START as es,DEFAULT_OPTION_COUNT_UNIT as ts,dateCellMarks as as,formatDate as is,formatDateRange as os,formatOptionCount as ns,formatPlace as rs,formatTime as ss,isoDate as ls,LOCATION_META_KEY as ds,monthLabel as cs,optionCountLabel as ps,optionHasImage as hs,optionImageSources as us,optionImageSrc as ms,optionLabel as gs,optionsShowLeadingVisuals as fs,PRODUCT_PATH_PREFIX as bs,parseDate as ws,parseLooseDate as vs,parseLooseDateRange as xs,parseTime as ys,productFromMatchedItem as ks,productImageSources as Cs,productsFromCustomFields as Ss,sanitizeOptionIconSvg as Ts,selectedRangeFor as Ps,TIME_META_KEY as Is,visibleDateRange as Es,WEEKDAY_LABELS as As,withSkippedParams as Rs}from"@magicx-eng/ai-autocomplete-vanilla";import{forwardRef as Mo,useCallback as Dt,useEffect as Mt,useImperativeHandle as zo,useLayoutEffect as No,useRef as Xe}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-67791514")){let e=document.createElement("style");e.id="ac-style-67791514",e.textContent=`.aia-container-KKjFU {
2
2
  position: relative;
3
3
  /* Inherits the host page's font by default. Consumers can pin a specific
4
4
  font on the library via \`--aia-font-family: 'Custom Font'\` without
@@ -346,7 +346,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
346
346
  transition: none;
347
347
  }
348
348
  }
349
- `,document.head.appendChild(e)}var We={container:"aia-container-KKjFU",inputWrapper:"aia-inputWrapper-FLq1b",editorArea:"aia-editorArea-7rBWq",input:"aia-input-IW-P-",pillListContainer:"aia-pillListContainer-h92IA",submitSlot:"aia-submitSlot-GhuCM",aiaChipForm:"aia-aiaChipForm-tKbNc",aiaTileGrow:"aia-aiaTileGrow-j9Pat",aiaTileSpring:"aia-aiaTileSpring-FEwNg",aiaTileFade:"aia-aiaTileFade-H1LDQ",aiaImageGrow:"aia-aiaImageGrow-i9yw8"};import{attachScrollArrow as Yi,attachViewportFit as ji,containScroll as $i,dateFloorFor as Zi,hasSkippablePill as Xi,isCalendarFormat as Ji,labelTraditionalAutocomplete as eo,uiStringsFor as to}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as je,useRef as Ye,useState as ao}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
349
+ `,document.head.appendChild(e)}var Be={container:"aia-container-KKjFU",inputWrapper:"aia-inputWrapper-FLq1b",editorArea:"aia-editorArea-7rBWq",input:"aia-input-IW-P-",pillListContainer:"aia-pillListContainer-h92IA",submitSlot:"aia-submitSlot-GhuCM",aiaChipForm:"aia-aiaChipForm-tKbNc",aiaTileGrow:"aia-aiaTileGrow-j9Pat",aiaTileSpring:"aia-aiaTileSpring-FEwNg",aiaTileFade:"aia-aiaTileFade-H1LDQ",aiaImageGrow:"aia-aiaImageGrow-i9yw8"};import{attachScrollArrow as ji,attachViewportFit as $i,containScroll as Zi,dateFloorFor as Xi,destroyPanelMorph as Ji,findMultiSelectDone as eo,fitMultiSelectDone as to,hasSkippablePill as ao,isCalendarFormat as io,labelTraditionalAutocomplete as oo,panelMorphKey as no,queryLive as ro,settlePanelMorph as so,uiStringsFor as lo}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ke,useLayoutEffect as Et,useRef as je,useState as co}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
350
350
  * Built-in appearance defaults \u2014 zero specificity via :where().
351
351
  * Consumer CSS always wins without !important.
352
352
  *
@@ -538,7 +538,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
538
538
  /* Half-strength stroke: neutral-900 (was #e5e7eb \u2014 snapped to palette,
539
539
  \u03942) at 50% alpha over the surface, so the hairline lands exactly
540
540
  halfway between its old value and the white behind it. */
541
- --aia-dropdown-border: var(--aia-primitive-neutral-900-a50);
541
+ --aia-dropdown-border: transparent; /* no stroke by default */
542
542
  --aia-dropdown-shadow: none; /* flat by default */
543
543
  /* Suggestion pills (Figma "ParamPill"): transparent fill, no visible border;
544
544
  per-pill opacity via getPillOpacity. */
@@ -561,11 +561,11 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
561
561
  /* Options read bigger + darker than the small-caps param labels above them. */
562
562
  --aia-option-color: var(--aia-primitive-neutral-150);
563
563
  --aia-option-color-selected: var(--aia-primitive-neutral-0);
564
- --aia-option-font-size: 16px;
564
+ --aia-option-font-size: 11.2px;
565
565
 
566
566
  --aia-written-text-color: var(--aia-primitive-neutral-0);
567
- /* Match the option size so the typed query never reads smaller than the
568
- choices below it. */
567
+ /* The typed query keeps its full size; only the options box below it is
568
+ scaled down, so the query reads larger than the choices. */
569
569
  --aia-written-text-font-size: 16px;
570
570
  --aia-caret-color: var(--aia-written-text-color, #000000);
571
571
 
@@ -584,6 +584,12 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
584
584
  --aia-confirm-bg: #262626;
585
585
  --aia-confirm-bg-hover: #404040;
586
586
  --aia-confirm-color: #ffffff;
587
+ /* The pickers' Done buttons: a soft blue-gray under dark navy text, the
588
+ Real-time One playground's Done (the ticked checkbox keeps the solid
589
+ confirm fill above). */
590
+ --aia-done-bg: #e4e8f0;
591
+ --aia-done-bg-hover: #d8dde8;
592
+ --aia-done-color: #2a3150;
587
593
 
588
594
  --aia-footer-hint-color: var(--aia-primitive-neutral-500);
589
595
  --aia-footer-brand-color: var(--aia-primitive-neutral-700);
@@ -599,7 +605,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
599
605
  --aia-shadow: none;
600
606
  /* Half-strength stroke \u2014 neutral-400 (was #484848 \u2014 snapped to palette,
601
607
  \u03942) at 50% alpha; see the light-mode note above. */
602
- --aia-dropdown-border: var(--aia-primitive-neutral-400-a50);
608
+ --aia-dropdown-border: transparent; /* no stroke by default */
603
609
  --aia-dropdown-shadow: none; /* flat by default */
604
610
  /* Suggestion pills (Figma "ParamPill"): transparent fill, no visible border. */
605
611
  --aia-pill-bg: var(--aia-primitive-neutral-750);
@@ -623,7 +629,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
623
629
  /* Options read bigger + darker/brighter than the small-caps param labels. */
624
630
  --aia-option-color: var(--aia-primitive-neutral-900);
625
631
  --aia-option-color-selected: var(--aia-primitive-neutral-1000);
626
- --aia-option-font-size: 16px;
632
+ --aia-option-font-size: 11.2px;
627
633
 
628
634
  --aia-written-text-color: var(--aia-primitive-neutral-1000);
629
635
  --aia-written-text-font-size: 16px;
@@ -644,6 +650,10 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
644
650
  --aia-confirm-bg: #a6a6a6;
645
651
  --aia-confirm-bg-hover: #b8b8b8;
646
652
  --aia-confirm-color: #000000;
653
+ /* Done keeps the dark theme's confirm colors. */
654
+ --aia-done-bg: var(--aia-confirm-bg);
655
+ --aia-done-bg-hover: var(--aia-confirm-bg-hover);
656
+ --aia-done-color: var(--aia-confirm-color);
647
657
 
648
658
  --aia-footer-hint-color: var(--aia-primitive-neutral-700);
649
659
  --aia-footer-brand-color: var(--aia-primitive-neutral-500);
@@ -701,6 +711,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
701
711
  justify-content: flex-start;
702
712
  border-inline-width: 0;
703
713
  padding-inline: 0;
714
+ padding-block: 3.5px;
704
715
  }
705
716
 
706
717
  /* The reserved band the footer overlaps. Declared here, apart from the grid
@@ -767,9 +778,6 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
767
778
  --aia-grid-scroll-top: var(--aia-footer-band);
768
779
  --aia-grid-overlap-top: calc(-1 * (var(--aia-footer-band) + 8px));
769
780
  --aia-footer-fade-inset: 0 0 calc(-1 * var(--aia-footer-fade-lead));
770
- /* The unfold flips with the stack: the collapsed sliver sits at the panel's
771
- bottom edge (against the input) and expands upward out of it. */
772
- transform-origin: 50% 100%;
773
781
  top: auto;
774
782
  bottom: 100%;
775
783
  margin-top: 0;
@@ -829,6 +837,8 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
829
837
  :where(.magicx-aia[data-animations="off"]) *::after {
830
838
  animation-duration: 0s !important;
831
839
  transition-duration: 0s !important;
840
+ /* biome-ignore lint/complexity/noImportantStyles: a delayed close must not linger with animations off */
841
+ transition-delay: 0s !important;
832
842
  }
833
843
 
834
844
  /* Desktop footer is opaque: the option list clips at the footer's edge instead
@@ -930,7 +940,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
930
940
  the third row. The planned cap (--aia-grid-max-height) still wins when it
931
941
  is smaller: fewer than three rows of options. */
932
942
  [data-aia-dropdown][aria-multiselectable="true"] .aia-grid[data-scroll] {
933
- max-height: min(var(--aia-grid-max-height, 120px), calc(3 * var(--aia-option-row-height, 37px)));
943
+ max-height: min(var(--aia-grid-max-height, 84px), calc(3 * var(--aia-option-row-height, 25.9px)));
934
944
  }
935
945
 
936
946
  /* Fitted to the viewport, every other grid hands its scrolling to the panel,
@@ -939,10 +949,89 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
939
949
  so Done stays in view. */
940
950
  [data-aia-dropdown][data-aia-fit][aria-multiselectable="true"] .aia-grid[data-scroll] {
941
951
  flex-shrink: 1;
942
- min-height: var(--aia-option-row-height, 37px);
943
- max-height: min(var(--aia-grid-max-height, 120px), calc(3 * var(--aia-option-row-height, 37px)));
952
+ min-height: var(--aia-option-row-height, 25.9px);
953
+ max-height: min(var(--aia-grid-max-height, 84px), calc(3 * var(--aia-option-row-height, 25.9px)));
944
954
  overflow-y: auto;
945
955
  }
956
+
957
+ /* Floating options box (2026-11). The panel reads as a light sheet under the
958
+ text: no footer, only the parameter being asked (sentence case), and "skip"
959
+ right after it behind a thin rule \u2014 "Gender | skip". With no footer there is
960
+ no band for the rows to slide under, so it is zeroed in every layout.
961
+ Declared last so it follows every rule that sets the band. Mirrored in all
962
+ four appearance copies; floatingOptionsParity.test.ts pins them together. */
963
+ [data-aia-dropdown] [data-aia-footer] {
964
+ display: none;
965
+ }
966
+ /* Doubled attribute: ties the above-position rule's specificity and wins on
967
+ source order, so both edges are zeroed whichever side the panel opens on. */
968
+ [data-aia-dropdown][data-aia-dropdown] {
969
+ --aia-grid-scroll-bottom: 0px;
970
+ --aia-grid-overlap-bottom: 0px;
971
+ --aia-grid-scroll-top: 0px;
972
+ --aia-grid-overlap-top: 0px;
973
+ --aia-footer-fade-lead: 0px;
974
+ --aia-footer-row-min-height: 0px;
975
+ }
976
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill]:not([data-aia-pill-active]) {
977
+ display: none;
978
+ }
979
+ /* One label, one placeholder: the loading skeletons carry no data-aia-pill, so
980
+ the rule above leaves them alone. Keep the first and hide the rest. */
981
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-skeleton] ~ [data-aia-pill-skeleton] {
982
+ display: none;
983
+ }
984
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-scroll] {
985
+ flex: 0 1 auto;
986
+ mask-image: none;
987
+ -webkit-mask-image: none;
988
+ }
989
+ /* The live label reads at full strength. The pill's positional opacity ramp
990
+ is a custom property the pill's own rule reads, so this plain declaration
991
+ wins by specificity, and the pill's entrance fade and a loading chip's
992
+ skeleton fades still animate over it. */
993
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill][data-aia-pill-active] {
994
+ text-transform: none;
995
+ letter-spacing: normal;
996
+ font-size: var(--aia-param-label-font-size, 9.45px);
997
+ font-weight: 500;
998
+ opacity: 1;
999
+ }
1000
+ /* A flex container has no ::first-letter; the label is plain text, so an
1001
+ inline block lays it out the same and lets it take a capital. A Smart
1002
+ Suggestion header keeps its flex layout: its gap and centring hold the
1003
+ sparkle beside the text. */
1004
+ [data-aia-dropdown]
1005
+ [data-aia-pillbar]
1006
+ [data-aia-pill][data-aia-pill-active]:not([data-aia-smart-suggestion]) {
1007
+ display: inline-block;
1008
+ }
1009
+ [data-aia-dropdown]
1010
+ [data-aia-pillbar]
1011
+ [data-aia-pill][data-aia-pill-active]:not([data-aia-smart-suggestion])::first-letter {
1012
+ text-transform: uppercase;
1013
+ }
1014
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-skip] {
1015
+ padding-inline: 5.6px;
1016
+ font-size: var(--aia-skip-font-size, 9.45px);
1017
+ }
1018
+ /* After the label, skip sits right beside it ("Gender | skip"). A skip-only
1019
+ row (pills shown in the input, so the bar has no label) keeps the base
1020
+ auto margin and stays pinned at the trailing edge, with no rule. */
1021
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-scroll] + [data-aia-skip] {
1022
+ margin-inline-start: 0;
1023
+ }
1024
+ [data-aia-dropdown] [data-aia-pillbar] [data-aia-pill-scroll] + [data-aia-skip]::before {
1025
+ content: "";
1026
+ align-self: center;
1027
+ width: 1px;
1028
+ height: 0.9em;
1029
+ margin-inline-end: 5.6px;
1030
+ margin-inline-start: -2.8px;
1031
+ background: currentColor;
1032
+ opacity: 0.45;
1033
+ }
1034
+ /* End floating options box. */
946
1035
  `,document.head.appendChild(e)}if(typeof document<"u"&&!document.getElementById("ac-style-3819c762")){let e=document.createElement("style");e.id="ac-style-3819c762",e.textContent=`.aia-dropdown-yz2KC {
947
1036
  position: absolute;
948
1037
  left: 0;
@@ -968,21 +1057,32 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
968
1057
  z-index: 10;
969
1058
  opacity: 0;
970
1059
  pointer-events: none;
971
- /* Closed, the panel rests as a near-zero-height sliver at the input's edge
972
- (scaleY only \u2014 full width), so opening unfolds it top-to-bottom out of the
973
- input. The origin flips to the bottom edge for optionsPosition="above" \u2014
974
- see appearance.css. The transform "transition" on THIS side is a delayed
975
- snap: while closing, the panel holds its full size for the whole 400ms
976
- fade and only then collapses, ready for the next open. */
977
- transform-origin: 50% 0;
978
- transform: scaleY(var(--aia-dropdown-reveal-scale, 0.02));
1060
+ /* Closed, the panel rests in place, transparent and softly blurred, so it
1061
+ floats in as a dissolve rather than dropping down (the Real-time One
1062
+ motion, 2026-11): out is 280ms on a soft ease back to opacity 0 and a 2px
1063
+ blur. */
1064
+ filter: blur(2px);
1065
+ /* The 220ms beat before closing covers the gap between a keystroke that
1066
+ filters every option away and the next response, so typing never blinks
1067
+ the panel out and back. */
1068
+ /* Closed, the panel keeps its full size (the floating box does not collapse
1069
+ it), so pointer-events: none alone would still leave an invisible box
1070
+ over the page: a descendant that sets pointer-events: auto (the pill row,
1071
+ the scroll arrow) takes taps through it, and it stays in the tab order.
1072
+ visibility: hidden once the fade has run removes it from hit testing and
1073
+ focus; the 0s visibility transition waits out the beat and the fade
1074
+ (220ms + 280ms), so the dissolve still plays. */
1075
+ visibility: hidden;
979
1076
  transition:
980
- opacity 400ms cubic-bezier(0.4, 0, 0.2, 1),
981
- transform 0s 400ms;
1077
+ opacity 280ms cubic-bezier(0.25, 0.1, 0.25, 1) 220ms,
1078
+ filter 280ms cubic-bezier(0.25, 0.1, 0.25, 1) 220ms,
1079
+ visibility 0s linear 500ms;
982
1080
  /* Solid surface is the default (matches the Figma components). Opt into the
983
1081
  frosted-glass look with data-aia-surface="glass". */
984
1082
  background: var(--aia-surface, #ffffff);
985
- border: 1px solid var(--aia-dropdown-border, rgba(231, 231, 231, 0.5));
1083
+ /* No stroke by default: the 1px border stays (transparent) so the
1084
+ geometry does not move; set --aia-dropdown-border to draw one. */
1085
+ border: 1px solid var(--aia-dropdown-border, transparent);
986
1086
  border-radius: 9px;
987
1087
  /* Flat by default; consumers can set --aia-dropdown-shadow for elevation. */
988
1088
  box-shadow: var(--aia-dropdown-shadow, none);
@@ -1017,20 +1117,18 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1017
1117
  backdrop-filter: blur(30px);
1018
1118
  }
1019
1119
 
1020
- /* Opening: the panel unfolds top-to-bottom out of the input with a single
1021
- spring settle while the option rows cascade in on top of it. Closing keeps
1022
- the longer fade so a populated panel dissolves as one (the base rule above
1023
- delays the transform snap until that fade has finished). */
1120
+ /* Opening: the panel dissolves in where it sits \u2014 opacity and the 2px blur
1121
+ resolve together over 320ms after a 40ms beat \u2014 while the option rows
1122
+ cascade in on top of it. */
1024
1123
  .aia-visible-QCoXj {
1025
1124
  opacity: 1;
1026
1125
  pointer-events: auto;
1027
- transform: scaleY(1);
1028
- /* Spring: the easing overshoots full height by a few percent and settles
1029
- once (P1y = 1.28 \u2014 one spring, no bounce). Opacity resolves almost
1030
- immediately so the unfold, not a fade, is what reads. */
1126
+ filter: none;
1127
+ visibility: visible;
1031
1128
  transition:
1032
- opacity 100ms cubic-bezier(0.4, 0, 0.2, 1),
1033
- transform 320ms cubic-bezier(0.22, 1.28, 0.36, 1);
1129
+ opacity 320ms cubic-bezier(0.25, 0.1, 0.25, 1) 40ms,
1130
+ filter 320ms cubic-bezier(0.25, 0.1, 0.25, 1) 40ms,
1131
+ visibility 0s;
1034
1132
  }
1035
1133
 
1036
1134
  /* "More below" scroll arrow \u2014 see the core's render/scrollArrow.ts.
@@ -1129,6 +1227,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1129
1227
  animation-duration: 0s;
1130
1228
  animation-delay: 0s;
1131
1229
  transition-duration: 0s;
1230
+ transition-delay: 0s;
1132
1231
  }
1133
1232
  }
1134
1233
 
@@ -1175,15 +1274,15 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1175
1274
  align-items: center;
1176
1275
  margin-inline-start: auto;
1177
1276
  flex-shrink: 0;
1178
- padding: 5px 8px;
1277
+ padding: 3.5px 5.6px;
1179
1278
  border: none;
1180
1279
  /* Matches the completed-param chip radius, so the hover fill reads as a
1181
1280
  soft rectangle rather than a capsule. */
1182
- border-radius: 6px;
1281
+ border-radius: 4.2px;
1183
1282
  background: transparent;
1184
1283
  font-family: inherit;
1185
- font-size: var(--aia-skip-font-size, 10px);
1186
- line-height: 18px;
1284
+ font-size: var(--aia-skip-font-size, 9.45px);
1285
+ line-height: 12.6px;
1187
1286
  color: var(--aia-skip-color, var(--aia-footer-hint-color, #505050));
1188
1287
  cursor: pointer;
1189
1288
  white-space: nowrap;
@@ -1266,28 +1365,44 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1266
1365
  display: none;
1267
1366
  }
1268
1367
 
1269
- /* The multi-select Done button: the time wheel's Done, full width and solid. */
1368
+ /* The multi-select Done button: the time wheel's Done, full width. */
1270
1369
  .aia-multiDone-y12U7 {
1271
1370
  display: block;
1272
- width: 100%;
1273
- height: 36px;
1371
+ /* As wide as the widest option (set by fitMultiSelectDone), never
1372
+ narrower than the minimum nor wider than the panel. */
1373
+ width: var(--aia-multi-done-width, var(--aia-multi-done-fit, 100%));
1374
+ min-width: min(var(--aia-multi-done-min-width, 120px), 100%);
1375
+ max-width: 100%;
1376
+ height: 44px;
1274
1377
  padding: 0 12px;
1275
1378
  border: none;
1276
- border-radius: 8px;
1277
- background: var(--aia-multi-done-bg, var(--aia-confirm-bg, #262626));
1278
- color: var(--aia-multi-done-color, var(--aia-confirm-color, #ffffff));
1379
+ border-radius: 12px;
1380
+ background: var(--aia-multi-done-bg, var(--aia-done-bg, #e4e8f0));
1381
+ color: var(--aia-multi-done-color, var(--aia-done-color, #2a3150));
1279
1382
  font-family: inherit;
1280
- font-size: 13px;
1281
- font-weight: 500;
1383
+ font-size: 15px;
1384
+ font-weight: 600;
1282
1385
  line-height: 20px;
1283
1386
  cursor: pointer;
1284
1387
  transition: background-color 150ms ease-out;
1285
1388
  }
1286
1389
 
1287
1390
  .aia-multiDone-y12U7:hover {
1288
- background: var(--aia-multi-done-bg-hover, var(--aia-confirm-bg-hover, #404040));
1391
+ background: var(--aia-multi-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
1392
+ }
1393
+
1394
+ /* The open panel's leaving ghost (panelMorph.ts) is a frozen copy of the
1395
+ last step: the rows' own entrance must not replay in it while it fades. */
1396
+ .aia-dropdown-yz2KC .magicx-aia-panel-ghost,
1397
+ .aia-dropdown-yz2KC .magicx-aia-panel-ghost * {
1398
+ /* biome-ignore lint/complexity/noImportantStyles: the copy must not replay the rows' own motion */
1399
+ animation: none !important;
1400
+ /* biome-ignore lint/complexity/noImportantStyles: the copy must not replay the rows' own motion */
1401
+ transition: none !important;
1402
+ /* biome-ignore lint/complexity/noImportantStyles: a row's own pointer-events: auto must not make the leaving copy catch taps */
1403
+ pointer-events: none !important;
1289
1404
  }
1290
- `,document.head.appendChild(e)}var ue={dropdown:"aia-dropdown-yz2KC",visible:"aia-visible-QCoXj",scrollArrow:"aia-scrollArrow-uUzV0","magicx-aia-scroll-arrow-bob":"aia-magicx-aia-scroll-arrow-bob-z-HXC",pillBar:"aia-pillBar-pwTXe",pillScroll:"aia-pillScroll-Tpzus",skip:"aia-skip-7-olS",skeletonBars:"aia-skeletonBars-HVr9C",skeletonBarsIn:"aia-skeletonBarsIn-BdPrL",skeletonBarsOut:"aia-skeletonBarsOut-TqKeD",skeletonBar:"aia-skeletonBar-O3xIx",aiaSkeletonPulse:"aia-aiaSkeletonPulse-G8W7q",multiDone:"aia-multiDone-y12U7"};import{cellDay as La,cellIso as ot,dateCellMarks as Ra,isDimmedDay as Oa,isoDate as Da,monthLabel as Ma,visibleDateRange as za,WEEKDAY_LABELS as Na}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as Fa}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-f687bd03")){let e=document.createElement("style");e.id="ac-style-f687bd03",e.textContent=`/* --- Datepicker (replaces the options grid for date suggestions) ---
1405
+ `,document.head.appendChild(e)}var xe={dropdown:"aia-dropdown-yz2KC",visible:"aia-visible-QCoXj",scrollArrow:"aia-scrollArrow-uUzV0","magicx-aia-scroll-arrow-bob":"aia-magicx-aia-scroll-arrow-bob-z-HXC",pillBar:"aia-pillBar-pwTXe",pillScroll:"aia-pillScroll-Tpzus",skip:"aia-skip-7-olS",skeletonBars:"aia-skeletonBars-HVr9C",skeletonBarsIn:"aia-skeletonBarsIn-BdPrL",skeletonBarsOut:"aia-skeletonBarsOut-TqKeD",skeletonBar:"aia-skeletonBar-O3xIx",aiaSkeletonPulse:"aia-aiaSkeletonPulse-G8W7q",multiDone:"aia-multiDone-y12U7"};import{cellDay as Oa,cellIso as ot,dateCellMarks as Da,isDimmedDay as Ma,isoDate as za,monthLabel as Na,visibleDateRange as Fa,WEEKDAY_LABELS as Ha}from"@magicx-eng/ai-autocomplete-vanilla";import{useState as Ba}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-f687bd03")){let e=document.createElement("style");e.id="ac-style-f687bd03",e.textContent=`/* --- Datepicker (replaces the options grid for date suggestions) ---
1291
1406
 
1292
1407
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
1293
1408
  date-grid.component.css). Only the class-naming layer differs \u2014 the
@@ -1474,7 +1589,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1474
1589
  opacity: 0.8;
1475
1590
  background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
1476
1591
  }
1477
- `,document.head.appendChild(e)}var H={datepicker:"aia-datepicker-6RrTs",header:"aia-header-z4LRk",month:"aia-month-urB2T",nav:"aia-nav-ap4AN",weekdays:"aia-weekdays-3EA3q",grid:"aia-grid-mQCgw",weekday:"aia-weekday-3lF4B",cell:"aia-cell-59k0y",number:"aia-number-aoT01",day:"aia-day-cB3u9",blank:"aia-blank-ivgRC",past:"aia-past-CEZsj",highlighted:"aia-highlighted-YIdtK",today:"aia-today-iI3ME",inRange:"aia-inRange-r9S2q",selected:"aia-selected-28KDn",pressed:"aia-pressed-bEyyN"};import{jsx as me,jsxs as Gt}from"react/jsx-runtime";var Ha=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function Kt({options:e,activeIndex:o,listboxId:a,view:i,selection:n,onSelect:l,onHighlight:r,onUnhighlight:d,onPreviousMonth:m,onNextMonth:v}){let x=Da(new Date),u=za({pendingStart:n.rangeStart,highlightedIso:ot(e[o]),selected:n.selectedRange,floor:n.floor});return Gt("div",{className:H.datepicker,"data-aia-datepicker":"",children:[Gt("div",{className:H.header,children:[me("button",{type:"button",tabIndex:-1,className:H.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:c=>c.preventDefault(),onClick:m,children:"\u2039"}),me("span",{className:H.month,"data-aia-date-month":"","aria-live":"polite",children:Ma(i)}),me("button",{type:"button",tabIndex:-1,className:H.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:c=>c.preventDefault(),onClick:v,children:"\u203A"})]}),me("div",{className:H.weekdays,"aria-hidden":"true",children:Na.map((c,p)=>me("span",{className:H.weekday,children:c},Ha[p]))}),me("div",{className:H.grid,"data-aia-date-grid":"",children:e.map((c,p)=>me(Ba,{option:c,id:`${a}-option-${p}`,index:p,isHighlighted:p===o&&c.is_tappable,isToday:ot(c)===x,isPast:Oa(ot(c),x,n.floor),marks:Ra(ot(c),{selectedIso:n.selectedIso,range:u}),onSelect:l,onHighlight:r,onUnhighlight:d},ot(c)??`pad-${p}`))})]})}function Ba({option:e,id:o,index:a,isHighlighted:i,isToday:n,isPast:l,marks:r,onSelect:d,onHighlight:m,onUnhighlight:v}){let[x,u]=Fa(!1),c=La(e);if(c==null)return me("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${H.cell} ${H.blank}`});let p=()=>{u(!0),d(e),setTimeout(()=>u(!1),170)},w=[H.cell,H.day,l?H.past:"",i?H.highlighted:"",n?H.today:"",r.inRange?H.inRange:"",r.selected?H.selected:"",x?H.pressed:""].filter(Boolean).join(" ");return me("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":i,"aria-label":e.text,tabIndex:0,className:w,onClick:p,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),p())},onMouseEnter:()=>m(a),onMouseLeave:v?()=>v(a):void 0,children:me("span",{className:H.number,children:c})})}import{ATTRIBUTION_URL as Wa,buildAttributionUrl as Ga,getFooterHint as Ka,uiStringsFor as qa}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as _a,useState as Ua}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`.aia-cluster {
1592
+ `,document.head.appendChild(e)}var W={datepicker:"aia-datepicker-6RrTs",header:"aia-header-z4LRk",month:"aia-month-urB2T",nav:"aia-nav-ap4AN",weekdays:"aia-weekdays-3EA3q",grid:"aia-grid-mQCgw",weekday:"aia-weekday-3lF4B",cell:"aia-cell-59k0y",number:"aia-number-aoT01",day:"aia-day-cB3u9",blank:"aia-blank-ivgRC",past:"aia-past-CEZsj",highlighted:"aia-highlighted-YIdtK",today:"aia-today-iI3ME",inRange:"aia-inRange-r9S2q",selected:"aia-selected-28KDn",pressed:"aia-pressed-bEyyN"};import{jsx as ye,jsxs as Gt}from"react/jsx-runtime";var Wa=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function qt({options:e,activeIndex:o,listboxId:t,view:a,selection:i,onSelect:s,onHighlight:r,onUnhighlight:l,onPreviousMonth:m,onNextMonth:w}){let x=za(new Date),g=Fa({pendingStart:i.rangeStart,highlightedIso:ot(e[o]),selected:i.selectedRange,floor:i.floor});return Gt("div",{className:W.datepicker,"data-aia-datepicker":"",children:[Gt("div",{className:W.header,children:[ye("button",{type:"button",tabIndex:-1,className:W.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:c=>c.preventDefault(),onClick:m,children:"\u2039"}),ye("span",{className:W.month,"data-aia-date-month":"","aria-live":"polite",children:Na(a)}),ye("button",{type:"button",tabIndex:-1,className:W.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:c=>c.preventDefault(),onClick:w,children:"\u203A"})]}),ye("div",{className:W.weekdays,"aria-hidden":"true",children:Ha.map((c,h)=>ye("span",{className:W.weekday,children:c},Wa[h]))}),ye("div",{className:W.grid,"data-aia-date-grid":"",children:e.map((c,h)=>ye(Ka,{option:c,id:`${t}-option-${h}`,index:h,isHighlighted:h===o&&c.is_tappable,isToday:ot(c)===x,isPast:Ma(ot(c),x,i.floor),marks:Da(ot(c),{selectedIso:i.selectedIso,range:g}),onSelect:s,onHighlight:r,onUnhighlight:l},ot(c)??`pad-${h}`))})]})}function Ka({option:e,id:o,index:t,isHighlighted:a,isToday:i,isPast:s,marks:r,onSelect:l,onHighlight:m,onUnhighlight:w}){let[x,g]=Ba(!1),c=Oa(e);if(c==null)return ye("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${W.cell} ${W.blank}`});let h=()=>{g(!0),l(e),setTimeout(()=>g(!1),170)},v=[W.cell,W.day,s?W.past:"",a?W.highlighted:"",i?W.today:"",r.inRange?W.inRange:"",r.selected?W.selected:"",x?W.pressed:""].filter(Boolean).join(" ");return ye("div",{id:o,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":a,"aria-label":e.text,tabIndex:0,className:v,onClick:h,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),h())},onMouseEnter:()=>m(t),onMouseLeave:w?()=>w(t):void 0,children:ye("span",{className:W.number,children:c})})}import{ATTRIBUTION_URL as Ga,buildAttributionUrl as qa,getFooterHint as _a,uiStringsFor as Va}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ua,useState as Qa}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`.aia-cluster {
1478
1593
  display: flex;
1479
1594
  flex-wrap: wrap;
1480
1595
  gap: var(--aia-cluster-gap, 0.5rem);
@@ -1514,7 +1629,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1514
1629
  .aia-cluster[data-justify="around"] {
1515
1630
  justify-content: space-around;
1516
1631
  }
1517
- `,document.head.appendChild(e)}import{jsx as qt}from"react/jsx-runtime";function nt({gap:e,align:o="center",justify:a="start",noWrap:i=!1,inline:n=!1,className:l,children:r,...d}){let m=e?{"--aia-cluster-gap":e}:void 0,v={className:l?`aia-cluster ${l}`:"aia-cluster","data-align":o,"data-justify":a,"data-nowrap":i||void 0,"data-inline":n||void 0,style:m,...d};return n?qt("span",{...v,children:r}):qt("div",{...v,children:r})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
1632
+ `,document.head.appendChild(e)}import{jsx as _t}from"react/jsx-runtime";function nt({gap:e,align:o="center",justify:t="start",noWrap:a=!1,inline:i=!1,className:s,children:r,...l}){let m=e?{"--aia-cluster-gap":e}:void 0,w={className:s?`aia-cluster ${s}`:"aia-cluster","data-align":o,"data-justify":t,"data-nowrap":a||void 0,"data-inline":i||void 0,style:m,...l};return i?_t("span",{...w,children:r}):_t("div",{...w,children:r})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
1518
1633
  dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing
1519
1634
  room above the hint/branding row so the footer doesn't butt against the last
1520
1635
  option row \u2014 additive to the dropdown's 8px section gap. */
@@ -1661,7 +1776,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1661
1776
  justify-content: flex-end;
1662
1777
  }
1663
1778
  }
1664
- `,document.head.appendChild(e)}var Ce={footer:"aia-footer-qQQ7x",row:"aia-row-BgZ6Q",hintGroup:"aia-hintGroup-ZzbPf",brandLink:"aia-brandLink-r4f3R",key:"aia-key-Bz1H-",hint:"aia-hint-GKEOH",brand:"aia-brand-Al-lR",badge:"aia-badge-Fk9vg"};import{jsx as rt,jsxs as xt}from"react/jsx-runtime";function _t({isOptionHighlighted:e=!1,isInputEmpty:o=!1,strings:a=qa()}){let{key:i,hint:n}=Ka(e,o,a),[l,r]=Ua(Wa);return _a(()=>{r(Ga())},[]),rt("footer",{className:Ce.footer,"data-aia-footer":"",children:xt(nt,{justify:"between",noWrap:!0,className:Ce.row,children:[xt(nt,{gap:"5px",className:Ce.hintGroup,children:[rt("kbd",{className:Ce.key,children:i}),rt("span",{className:Ce.hint,children:n})]}),xt("a",{className:Ce.brandLink,href:l,target:"_blank",rel:"noopener noreferrer",children:[rt("span",{className:Ce.brand,children:"AI"}),rt("span",{className:Ce.badge,children:"Autocomplete"})]})]})})}import{useEffect as Ut,useLayoutEffect as Va,useRef as le}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-2feec02e")){let e=document.createElement("style");e.id="ac-style-2feec02e",e.textContent=`/* Location search \u2014 React copy of the vanilla rules in styles.css (and of the
1779
+ `,document.head.appendChild(e)}var Ie={footer:"aia-footer-qQQ7x",row:"aia-row-BgZ6Q",hintGroup:"aia-hintGroup-ZzbPf",brandLink:"aia-brandLink-r4f3R",key:"aia-key-Bz1H-",hint:"aia-hint-GKEOH",brand:"aia-brand-Al-lR",badge:"aia-badge-Fk9vg"};import{jsx as rt,jsxs as xt}from"react/jsx-runtime";function Vt({isOptionHighlighted:e=!1,isInputEmpty:o=!1,strings:t=Va()}){let{key:a,hint:i}=_a(e,o,t),[s,r]=Qa(Ga);return Ua(()=>{r(qa())},[]),rt("footer",{className:Ie.footer,"data-aia-footer":"",children:xt(nt,{justify:"between",noWrap:!0,className:Ie.row,children:[xt(nt,{gap:"5px",className:Ie.hintGroup,children:[rt("kbd",{className:Ie.key,children:a}),rt("span",{className:Ie.hint,children:i})]}),xt("a",{className:Ie.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[rt("span",{className:Ie.brand,children:"AI"}),rt("span",{className:Ie.badge,children:"Autocomplete"})]})]})})}import{useEffect as Ut,useLayoutEffect as Ya,useRef as re}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-2feec02e")){let e=document.createElement("style");e.id="ac-style-2feec02e",e.textContent=`/* Location search \u2014 React copy of the vanilla rules in styles.css (and of the
1665
1780
  Angular copy). The three are kept identical by
1666
1781
  packages/vanilla/tests/render/locationFieldParity.test.ts. */
1667
1782
  .aia-location-6-fsr {
@@ -1677,9 +1792,15 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1677
1792
  gap: 8px;
1678
1793
  padding: 8px 10px;
1679
1794
  border-radius: var(--aia-location-field-radius, 10px);
1680
- background: var(--aia-location-field-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06));
1795
+ background: var(--aia-location-field-bg-idle, transparent);
1681
1796
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
1682
1797
  cursor: text;
1798
+ transition: background-color 120ms ease;
1799
+ }
1800
+
1801
+ .aia-field-xEzwi:hover,
1802
+ .aia-field-xEzwi:focus-within {
1803
+ background: var(--aia-location-field-bg, rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06));
1683
1804
  }
1684
1805
 
1685
1806
  .aia-icon-czx6C {
@@ -1703,6 +1824,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1703
1824
 
1704
1825
  .aia-input-Yi9V-::placeholder {
1705
1826
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
1827
+ font-weight: 300;
1706
1828
  opacity: 0.7;
1707
1829
  }
1708
1830
 
@@ -1788,7 +1910,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1788
1910
  .aia-loadingBar-OLCr4:nth-child(3) {
1789
1911
  width: 60%;
1790
1912
  }
1791
- `,document.head.appendChild(e)}var B={location:"aia-location-6-fsr",field:"aia-field-xEzwi",icon:"aia-icon-czx6C",input:"aia-input-Yi9V-",results:"aia-results-C3O0V",row:"aia-row-Q9y8g",highlighted:"aia-highlighted-RJjPx",pin:"aia-pin-OjabL",text:"aia-text-Xs84O",name:"aia-name-Z-WJR",secondary:"aia-secondary-4sCT1",note:"aia-note-xCSvY",empty:"aia-empty-SYBzi",loading:"aia-loading-Ih1gi",loadingBar:"aia-loadingBar-OLCr4"};import{jsx as ae,jsxs as Oe}from"react/jsx-runtime";var Qa=0;function st(e){return e.getRootNode().activeElement??null}function Qt(e){return e.getRootNode().getSelection?.()??document.getSelection()}function Ya(e){if(!e.isContentEditable)return null;let o=Qt(e);if(!o||o.rangeCount===0)return null;let a=o.getRangeAt(0);return e.contains(a.startContainer)?a.cloneRange():null}function Vt(e,o){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let a=Qt(e);if(!a)return;let i=o;(!i||!i.startContainer.isConnected||!e.contains(i.startContainer))&&(i=document.createRange(),i.selectNodeContents(e),i.collapse(!1)),a.removeAllRanges(),a.addRange(i)}var ja=Oe("svg",{className:B.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[ae("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),ae("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),$a=Oe("svg",{className:B.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[ae("circle",{cx:"11",cy:"11",r:"7"}),ae("path",{d:"m20 20-3.5-3.5"})]});function Yt({view:e,searchLabel:o,noResultsLabel:a,useTypedLabel:i,widgetFocused:n,visible:l=!0,interactive:r=!0,onQuery:d,onMove:m,onCommit:v,onFocusChange:x}){let u=le(null),c=le(null),p=le(null),w=le(null),I=le(null),M=le(!1),A=le(!1),F=le(!1),K=le(n);K.current=n;let L=le(x);L.current=x;let E=h=>{F.current=h,x(h)},y=()=>{let h=u.current;return h!=null&&st(h)===h},$=()=>{let h=c.current;if(!h)return;let T=st(h);T instanceof HTMLElement&&T!==u.current&&T!==document.body&&!h.contains(T)&&(w.current=T,I.current=Ya(T))},q=le(null);q.current===null&&(q.current=`aia-location-${++Qa}`);let Z=`${q.current}-row-`;Ut(()=>{let h=u.current;h&&h.value!==e.query&&st(h)!==h&&(h.value=e.query)},[e.query]),Ut(()=>{let h=u.current;if(h){if(!l&&y()){A.current=!0,z();return}if(!n){setTimeout(()=>{if(K.current)return;let T=w.current;T&&st(T)===T||(A.current=!1)},0);return}if(!(A.current||!r||y())){if($(),E(!0),h.focus({preventScroll:!0}),!y()){A.current=!0,E(!1);return}h.value&&h.select()}}}),Va(()=>()=>{if(!F.current)return;let h=u.current,T=w.current;T?.isConnected&&h&&st(h)===h&&(M.current=!0,Vt(T,I.current),M.current=!1),F.current=!1,L.current(!1)},[]);let z=(h=!1)=>{h&&(A.current=!0);let T=w.current;T?.isConnected&&y()&&(M.current=!0,Vt(T,I.current),M.current=!1),E(!1)},_=e.query.trim(),S=e.highlighted>=0&&e.highlighted<e.places.length?`${Z}${e.highlighted}`:void 0,G=null;return e.places.length>0?G=e.places.map((h,T)=>Oe("div",{id:`${Z}${T}`,role:"option","aria-selected":T===e.highlighted,className:T===e.highlighted?`${B.row} ${B.highlighted}`:B.row,"data-aia-location-row":"","data-aia-index":T,onClick:()=>{r&&(z(!0),v(T))},children:[ae("span",{className:B.pin,children:ja}),Oe("span",{className:B.text,children:[ae("span",{className:B.name,children:h.name}),h.secondary&&ae("span",{className:B.secondary,children:h.secondary})]})]},h.id)):e.status==="loading"?G=Oe("div",{className:B.loading,"data-aia-location-loading":"",children:[ae("span",{className:B.loadingBar}),ae("span",{className:B.loadingBar}),ae("span",{className:B.loadingBar})]}):_&&(G=Oe("div",{className:B.note,"data-aia-location-note":"",children:[e.status==="done"&&ae("span",{className:B.empty,children:a}),ae("span",{children:i})]})),Oe("div",{ref:c,className:B.location,"data-aia-location":"",onMouseDown:h=>{!(h.target instanceof Node)||!p.current?.contains(h.target)||(h.stopPropagation(),$(),E(!0))},children:[Oe("label",{ref:p,className:B.field,children:[$a,ae("input",{ref:u,type:"text",className:B.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:o,"aria-label":o,"aria-activedescendant":S,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:l?0:-1,onChange:h=>d(h.target.value),onFocus:()=>E(!0),onBlur:()=>{M.current||(A.current=!0,E(!1))},onKeyDown:h=>{if(!h.nativeEvent.isComposing)switch(h.key){case"ArrowDown":case"ArrowUp":h.preventDefault(),m(h.key==="ArrowDown"?1:-1);return;case"Enter":if(h.preventDefault(),!r)return;z(!0),v();return;case"Escape":h.preventDefault(),h.stopPropagation(),A.current=!0,z();return;case"Backspace":if(h.currentTarget.value!=="")return;h.preventDefault(),A.current=!0,z();return}}})]}),ae("div",{className:B.results,"data-aia-location-results":"","aria-live":"polite",children:G})]})}import{isSmartSuggestion as ei,isTraditionalAutocompleteSuggestion as ti}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as Za}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-199d0432")){let e=document.createElement("style");e.id="ac-style-199d0432",e.textContent=`/* ParamPill (Figma "ParamPill") \u2014 unfilled suggestion pill: transparent fill,
1913
+ `,document.head.appendChild(e)}var K={location:"aia-location-6-fsr",field:"aia-field-xEzwi",icon:"aia-icon-czx6C",input:"aia-input-Yi9V-",results:"aia-results-C3O0V",row:"aia-row-Q9y8g",highlighted:"aia-highlighted-RJjPx",pin:"aia-pin-OjabL",text:"aia-text-Xs84O",name:"aia-name-Z-WJR",secondary:"aia-secondary-4sCT1",note:"aia-note-xCSvY",empty:"aia-empty-SYBzi",loading:"aia-loading-Ih1gi",loadingBar:"aia-loadingBar-OLCr4"};import{jsx as oe,jsxs as Me}from"react/jsx-runtime";var ja=0;function st(e){return e.getRootNode().activeElement??null}function jt(e){return e.getRootNode().getSelection?.()??document.getSelection()}function Qt(e){if(!e.isContentEditable)return null;let o=jt(e);if(!o||o.rangeCount===0)return null;let t=o.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function Yt(e,o){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=jt(e);if(!t)return;let a=o;(!a||!a.startContainer.isConnected||!e.contains(a.startContainer))&&(a=document.createRange(),a.selectNodeContents(e),a.collapse(!1)),t.removeAllRanges(),t.addRange(a)}var $a=Me("svg",{className:K.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[oe("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),oe("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Za=Me("svg",{className:K.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[oe("circle",{cx:"11",cy:"11",r:"7"}),oe("path",{d:"m20 20-3.5-3.5"})]});function $t({view:e,searchLabel:o,noResultsLabel:t,useTypedLabel:a,widgetFocused:i,reediting:s=!1,visible:r=!0,interactive:l=!0,onQuery:m,onMove:w,onCommit:x,onFocusChange:g}){let c=re(null),h=re(null),v=re(null),E=re(null),F=re(null),M=re(!1),O=re(!1),V=re(!1),R=re(!1),D=re(i);D.current=i;let S=re(g);S.current=g;let H=d=>{R.current=d,g(d)},U=()=>{let d=c.current;return d!=null&&st(d)===d},X=()=>{let d=h.current;if(!d)return;let I=st(d);I instanceof HTMLElement&&I!==c.current&&I!==document.body&&!d.contains(I)&&(E.current=I,F.current=Qt(I))},q=d=>{let I=h.current;!I||!(d instanceof HTMLElement)||d===E.current||d===document.body||I.contains(d)||(E.current=d,F.current=Qt(d))},_=re(null);_.current===null&&(_.current=`aia-location-${++ja}`);let T=`${_.current}-row-`;Ut(()=>{let d=c.current;d&&d.value!==e.query&&st(d)!==d&&(d.value=e.query)},[e.query]),Ut(()=>{i&&(s&&!V.current&&(O.current=!1),V.current=s);let d=c.current;if(d){if(!r&&U()){O.current=!0,B();return}if(!i){setTimeout(()=>{if(D.current)return;let I=E.current;I&&st(I)===I||(O.current=!1)},0);return}if(!(!s||O.current||!l||U())){if(X(),H(!0),d.focus({preventScroll:!0}),!U()){O.current=!0,H(!1);return}d.value&&d.select()}}}),Ya(()=>()=>{if(!R.current)return;let d=c.current,I=E.current;I?.isConnected&&d&&st(d)===d&&(M.current=!0,Yt(I,F.current),M.current=!1),R.current=!1,S.current(!1)},[]);let B=(d=!1)=>{d&&(O.current=!0);let I=E.current;I?.isConnected&&U()&&(M.current=!0,Yt(I,F.current),M.current=!1),H(!1)},he=e.query.trim(),se=e.highlighted>=0&&e.highlighted<e.places.length?`${T}${e.highlighted}`:void 0,ne=null;return e.places.length>0?ne=e.places.map((d,I)=>Me("div",{id:`${T}${I}`,role:"option","aria-selected":I===e.highlighted,className:I===e.highlighted?`${K.row} ${K.highlighted}`:K.row,"data-aia-location-row":"","data-aia-index":I,onClick:()=>{l&&(B(!0),x(I))},children:[oe("span",{className:K.pin,children:$a}),Me("span",{className:K.text,children:[oe("span",{className:K.name,children:d.name}),d.secondary&&oe("span",{className:K.secondary,children:d.secondary})]})]},d.id)):e.status==="loading"?ne=Me("div",{className:K.loading,"data-aia-location-loading":"",children:[oe("span",{className:K.loadingBar}),oe("span",{className:K.loadingBar}),oe("span",{className:K.loadingBar})]}):he&&(ne=Me("div",{className:K.note,"data-aia-location-note":"",children:[e.status==="done"&&oe("span",{className:K.empty,children:t}),oe("span",{children:a})]})),Me("div",{ref:h,className:K.location,"data-aia-location":"",onMouseDown:d=>{!(d.target instanceof Node)||!v.current?.contains(d.target)||(d.stopPropagation(),X(),H(!0))},children:[Me("label",{ref:v,className:K.field,children:[Za,oe("input",{ref:c,type:"text",className:K.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:o,"aria-label":o,"aria-activedescendant":se,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:r?0:-1,onChange:d=>m(d.target.value),onFocus:d=>{q(d.relatedTarget),H(!0)},onBlur:()=>{M.current||(O.current=!0,H(!1))},onKeyDown:d=>{if(!d.nativeEvent.isComposing)switch(d.key){case"ArrowDown":case"ArrowUp":d.preventDefault(),w(d.key==="ArrowDown"?1:-1);return;case"Enter":if(d.preventDefault(),!l)return;B(!0),x();return;case"Escape":d.preventDefault(),d.stopPropagation(),O.current=!0,B();return;case"Backspace":if(d.currentTarget.value!=="")return;d.preventDefault(),O.current=!0,B();return}}})]}),oe("div",{className:K.results,"data-aia-location-results":"","aria-live":"polite",children:ne})]})}import{isSmartSuggestion as ti,isTraditionalAutocompleteSuggestion as ai}from"@magicx-eng/ai-autocomplete-vanilla";import{SMART_SUGGESTION_SPARKLE_SVG as Xa}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-199d0432")){let e=document.createElement("style");e.id="ac-style-199d0432",e.textContent=`/* ParamPill (Figma "ParamPill") \u2014 unfilled suggestion pill: transparent fill,
1792
1914
  no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
1793
1915
  The border is kept as a 1px transparent line so the box stays the same size
1794
1916
  as it was when the outline was dashed. */
@@ -1811,6 +1933,9 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1811
1933
  letter-spacing: 0.06em;
1812
1934
  cursor: pointer;
1813
1935
  white-space: nowrap;
1936
+ /* The positional opacity ramp, set inline per pill as a custom property so
1937
+ a rule can read the live label at full strength without !important. */
1938
+ opacity: var(--aia-pill-opacity, 1);
1814
1939
  animation: aia-fadeIn-Ux4eQ 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
1815
1940
  }
1816
1941
 
@@ -1968,7 +2093,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1968
2093
  opacity: 0;
1969
2094
  }
1970
2095
  }
1971
- `,document.head.appendChild(e)}var ge={pill:"aia-pill-6Ga7S",fadeIn:"aia-fadeIn-Ux4eQ",rounded:"aia-rounded-y7xA9",smartText:"aia-smartText-R0cfw","smartSuggestion-shimmer":"aia-smartSuggestion-shimmer-F-yoD",smartSparkle:"aia-smartSparkle-IVabG","smartSuggestion-sparkle":"aia-smartSuggestion-sparkle-Wfj-4","smartSuggestion-sparkle-small":"aia-smartSuggestion-sparkle-small-3VsWJ",skeleton:"aia-skeleton-57P0T",skeletonIn:"aia-skeletonIn-54kMv",skeletonPulse:"aia-skeletonPulse-xGcUy",skeletonOut:"aia-skeletonOut-1sJ-r"};import{Fragment as Xa,jsx as yt,jsxs as Ja}from"react/jsx-runtime";var kt={selected:1,first:.7,next:.4,last:.2};function jt({label:e,state:o,rounded:a,loading:i,smartSuggestion:n,completionHeader:l,onClick:r}){let d=[ge.pill,a?ge.rounded:"",i?ge.skeleton:""].filter(Boolean).join(" ");return yt("button",{type:"button","data-aia-pill":"","data-aia-loading":i?"":void 0,"data-aia-smart-suggestion":n?l?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:d,style:{opacity:kt[o]},onMouseDown:m=>m.preventDefault(),onClick:i?void 0:r,disabled:i,children:n?Ja(Xa,{children:[yt("span",{className:`${ge.smartText} magicx-aia-smart-suggestion-text`,children:e}),yt("span",{className:`${ge.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:Za}})]}):e})}if(typeof document<"u"&&!document.getElementById("ac-style-0fcb7940")){let e=document.createElement("style");e.id="ac-style-0fcb7940",e.textContent=`.aia-list-qvLqO {
2096
+ `,document.head.appendChild(e)}var ke={pill:"aia-pill-6Ga7S",fadeIn:"aia-fadeIn-Ux4eQ",rounded:"aia-rounded-y7xA9",smartText:"aia-smartText-R0cfw","smartSuggestion-shimmer":"aia-smartSuggestion-shimmer-F-yoD",smartSparkle:"aia-smartSparkle-IVabG","smartSuggestion-sparkle":"aia-smartSuggestion-sparkle-Wfj-4","smartSuggestion-sparkle-small":"aia-smartSuggestion-sparkle-small-3VsWJ",skeleton:"aia-skeleton-57P0T",skeletonIn:"aia-skeletonIn-54kMv",skeletonPulse:"aia-skeletonPulse-xGcUy",skeletonOut:"aia-skeletonOut-1sJ-r"};import{Fragment as Ja,jsx as yt,jsxs as ei}from"react/jsx-runtime";var kt={selected:1,first:.7,next:.4,last:.2};function Zt({label:e,state:o,active:t,rounded:a,loading:i,smartSuggestion:s,completionHeader:r,onClick:l}){let m=[ke.pill,a?ke.rounded:"",i?ke.skeleton:""].filter(Boolean).join(" ");return yt("button",{type:"button","data-aia-pill":"","data-aia-pill-active":t?"":void 0,"data-aia-loading":i?"":void 0,"data-aia-smart-suggestion":s?r?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:m,style:{"--aia-pill-opacity":kt[o]},onMouseDown:w=>w.preventDefault(),onClick:i?void 0:l,disabled:i,children:s?ei(Ja,{children:[yt("span",{className:`${ke.smartText} magicx-aia-smart-suggestion-text`,children:e}),yt("span",{className:`${ke.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:Xa}})]}):e})}if(typeof document<"u"&&!document.getElementById("ac-style-0fcb7940")){let e=document.createElement("style");e.id="ac-style-0fcb7940",e.textContent=`.aia-list-qvLqO {
1972
2097
  position: relative;
1973
2098
  z-index: 1;
1974
2099
  pointer-events: auto;
@@ -1978,7 +2103,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1978
2103
  align-items: center;
1979
2104
  vertical-align: middle;
1980
2105
  }
1981
- `,document.head.appendChild(e)}var Ct={list:"aia-list-qvLqO"};import{jsx as ct}from"react/jsx-runtime";var ai=[125,69];function $t(e){return e===0?"first":e===1?"next":"last"}function pt({pills:e,activePillIndex:o,onSelectPill:a,activeSelected:i,rounded:n,loading:l}){return l&&e.length===0?ct("span",{className:Ct.list,"data-aia-pill-list-loading":"",children:ai.map((r,d)=>ct("span",{"data-aia-pill-skeleton":"",className:`${ge.pill} ${n?ge.rounded:""} ${ge.skeleton}`,style:{width:r,opacity:kt[$t(d)]}},`skel-${r}`))}):ct("span",{className:Ct.list,"data-aia-pill-list-loading":l?"":void 0,children:e.map((r,d)=>{let m=!!i&&d===o;return ct(jt,{label:r.text,state:m?"selected":$t(d),selected:m,rounded:n,loading:l,smartSuggestion:ei(r),completionHeader:ti(r),onClick:()=>a(d)},`${r.parameter}-${r.text}`)})})}import{attachProductRowWheel as ii,productImageSources as oi,productImageSrc as ni,productInitial as ri,productPhotoFill as si,uiStringsFor as li}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as St,useRef as ht,useState as ut}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-fef1688d")){let e=document.createElement("style");e.id="ac-style-fef1688d",e.textContent=`/* Product strip \u2014 the React counterpart of the vanilla core's strip rules
2106
+ `,document.head.appendChild(e)}var Ct={list:"aia-list-qvLqO"};import{jsx as ct}from"react/jsx-runtime";var ii=[125,69];function Xt(e){return e===0?"first":e===1?"next":"last"}function pt({pills:e,activePillIndex:o,onSelectPill:t,activeSelected:a,rounded:i,loading:s}){return s&&e.length===0?ct("span",{className:Ct.list,"data-aia-pill-list-loading":"",children:ii.map((r,l)=>ct("span",{"data-aia-pill-skeleton":"",className:`${ke.pill} ${i?ke.rounded:""} ${ke.skeleton}`,style:{width:r,"--aia-pill-opacity":kt[Xt(l)]}},`skel-${r}`))}):ct("span",{className:Ct.list,"data-aia-pill-list-loading":s?"":void 0,children:e.map((r,l)=>{let m=!!a&&l===o;return ct(Zt,{label:r.text,state:m?"selected":Xt(l),selected:m,active:l===o,rounded:i,loading:s,smartSuggestion:ti(r),completionHeader:ai(r),onClick:()=>t(l)},`${r.parameter}-${r.text}`)})})}import{attachProductRowWheel as oi,productImageSources as ni,productImageSrc as ri,productInitial as si,productPhotoFill as li,uiStringsFor as di}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as St,useRef as ht,useState as ut}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-fef1688d")){let e=document.createElement("style");e.id="ac-style-fef1688d",e.textContent=`/* Product strip \u2014 the React counterpart of the vanilla core's strip rules
1982
2107
  (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
1983
2108
  theming one package sees the same result in the other.
1984
2109
 
@@ -1991,7 +2116,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
1991
2116
  .aia-section-Hugfg {
1992
2117
  display: flex;
1993
2118
  flex-direction: column;
1994
- gap: 6px;
2119
+ gap: 4.2px;
1995
2120
  /* The option text sits 10px inside the dropdown's padding edge (the
1996
2121
  option's own padding), so the section carries the same 10px and its
1997
2122
  label lands on the option text's left edge \u2014 which the dropdown in turn
@@ -2002,9 +2127,9 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2002
2127
 
2003
2128
  .aia-label-nuc93 {
2004
2129
  font-family: inherit;
2005
- font-size: var(--aia-products-label-font-size, 11px);
2130
+ font-size: var(--aia-products-label-font-size, 7.7px);
2006
2131
  font-weight: 500;
2007
- line-height: 18px;
2132
+ line-height: 12.6px;
2008
2133
  letter-spacing: 0.02em;
2009
2134
  color: var(
2010
2135
  --aia-products-label-color,
@@ -2018,16 +2143,16 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2018
2143
  a trackpad fling at either end from chaining out to the page. */
2019
2144
  .aia-row-WDVBX {
2020
2145
  display: flex;
2021
- gap: var(--aia-product-gap, 8px);
2146
+ gap: var(--aia-product-gap, 5.6px);
2022
2147
  min-width: 0;
2023
2148
  overflow-x: auto;
2024
2149
  overflow-y: hidden;
2025
2150
  overscroll-behavior-x: contain;
2026
- padding-bottom: 2px;
2151
+ padding-bottom: 1.4px;
2027
2152
  /* Pull the row out by the card's own 6px padding so the first card's
2028
2153
  image tile \u2014 not its hover fill \u2014 starts on the label's left edge, the
2029
2154
  same way the option's highlight fill hangs outside its text. */
2030
- margin-inline: -6px;
2155
+ margin-inline: -4.2px;
2031
2156
  /* Hide the scrollbar chrome across all three engines while leaving the box
2032
2157
  scrollable by trackpad, touch and keyboard. A mouse wheel is vertical and
2033
2158
  would otherwise have no way through a row with no scrollbar to grab, so
@@ -2045,10 +2170,10 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2045
2170
  flex: 0 0 auto;
2046
2171
  display: flex;
2047
2172
  flex-direction: column;
2048
- gap: 6px;
2049
- width: var(--aia-product-card-width, 116px);
2050
- padding: 6px;
2051
- border-radius: 10px;
2173
+ gap: 4.2px;
2174
+ width: var(--aia-product-card-width, 81.2px);
2175
+ padding: 4.2px;
2176
+ border-radius: 7px;
2052
2177
  background: var(--aia-product-bg, transparent);
2053
2178
  /* Explicit, never inherited \u2014 see the file header. */
2054
2179
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
@@ -2081,7 +2206,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2081
2206
  position: relative;
2082
2207
  width: 100%;
2083
2208
  aspect-ratio: 1 / 1;
2084
- border-radius: 8px;
2209
+ border-radius: 5.6px;
2085
2210
  overflow: hidden;
2086
2211
  background: var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.25)));
2087
2212
  }
@@ -2106,7 +2231,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2106
2231
  max-width: 100%;
2107
2232
  height: 100%;
2108
2233
  margin: 0 auto;
2109
- border-radius: var(--aia-product-image-radius, 8px);
2234
+ border-radius: var(--aia-product-image-radius, 5.6px);
2110
2235
  object-fit: contain;
2111
2236
  }
2112
2237
 
@@ -2119,7 +2244,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2119
2244
  align-items: center;
2120
2245
  justify-content: center;
2121
2246
  color: var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));
2122
- font-size: 24px;
2247
+ font-size: 16.8px;
2123
2248
  font-weight: 600;
2124
2249
  line-height: 1;
2125
2250
  }
@@ -2142,14 +2267,14 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2142
2267
  .aia-body-ly032 {
2143
2268
  display: flex;
2144
2269
  flex-direction: column;
2145
- gap: 2px;
2270
+ gap: 1.4px;
2146
2271
  min-width: 0;
2147
2272
  }
2148
2273
 
2149
2274
  .aia-vendor-Gvu7G {
2150
2275
  font-family: inherit;
2151
- font-size: var(--aia-product-vendor-font-size, 10px);
2152
- line-height: 14px;
2276
+ font-size: var(--aia-product-vendor-font-size, 7px);
2277
+ line-height: 9.8px;
2153
2278
  color: var(
2154
2279
  --aia-product-vendor-color,
2155
2280
  var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))
@@ -2163,9 +2288,9 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2163
2288
 
2164
2289
  .aia-title-gCNmq {
2165
2290
  font-family: inherit;
2166
- font-size: var(--aia-product-title-font-size, 12px);
2291
+ font-size: var(--aia-product-title-font-size, 8.4px);
2167
2292
  font-weight: 400;
2168
- line-height: 16px;
2293
+ line-height: 11.2px;
2169
2294
  /* The card's most prominent text uses the same token the *highlighted*
2170
2295
  option text does, so it stays legible on any --aia-surface a consumer
2171
2296
  sets \u2014 light or dark \u2014 without a second theming control. */
@@ -2182,9 +2307,9 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2182
2307
 
2183
2308
  .aia-price-gULcE {
2184
2309
  font-family: inherit;
2185
- font-size: var(--aia-product-price-font-size, 11px);
2310
+ font-size: var(--aia-product-price-font-size, 7.7px);
2186
2311
  font-weight: 500;
2187
- line-height: 15px;
2312
+ line-height: 10.5px;
2188
2313
  color: var(
2189
2314
  --aia-product-price-color,
2190
2315
  var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
@@ -2195,7 +2320,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2195
2320
  display: flex;
2196
2321
  flex-wrap: wrap;
2197
2322
  align-items: baseline;
2198
- column-gap: 4px;
2323
+ column-gap: 2.8px;
2199
2324
  }
2200
2325
 
2201
2326
  /* The price before a markdown, struck through after the price, on the same
@@ -2213,10 +2338,10 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2213
2338
  reads on any photo, light or dark, and on either panel surface. */
2214
2339
  .aia-badge-j9Hcd {
2215
2340
  position: absolute;
2216
- top: var(--aia-product-badge-inset, 12px);
2217
- left: var(--aia-product-badge-inset, 12px);
2218
- padding: 3px 6px;
2219
- border-radius: 4px;
2341
+ top: var(--aia-product-badge-inset, 8.4px);
2342
+ left: var(--aia-product-badge-inset, 8.4px);
2343
+ padding: 2.1px 4.2px;
2344
+ border-radius: 2.8px;
2220
2345
  background: var(--aia-product-badge-bg, rgba(255, 255, 255, 0.94));
2221
2346
  color: var(--aia-product-badge-color, #1f2328);
2222
2347
  /* A hairline ring keeps the chip's edge on a pale image or a light panel. */
@@ -2224,7 +2349,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2224
2349
  0 0 0 1px rgba(0, 0, 0, 0.08),
2225
2350
  0 1px 2px rgba(0, 0, 0, 0.18);
2226
2351
  font-family: inherit;
2227
- font-size: var(--aia-product-badge-font-size, 9px);
2352
+ font-size: var(--aia-product-badge-font-size, 6.3px);
2228
2353
  font-weight: 600;
2229
2354
  line-height: 1;
2230
2355
  letter-spacing: 0.08em;
@@ -2246,24 +2371,24 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2246
2371
  fill the square (--aia-product-photo-fill-x / -y, set on the card when
2247
2372
  the photo loads; 1, the tile's own corner, until then). */
2248
2373
  top: calc(
2249
- var(--aia-product-card-width, 116px) -
2250
- 12px -
2251
- var(--aia-product-cart-size, 28px) -
2252
- (var(--aia-product-card-width, 116px) - 12px) *
2374
+ var(--aia-product-card-width, 81.2px) -
2375
+ 8.4px -
2376
+ var(--aia-product-cart-size, 19.6px) -
2377
+ (var(--aia-product-card-width, 81.2px) - 8.4px) *
2253
2378
  (1 - var(--aia-product-photo-fill-y, 1)) /
2254
2379
  2
2255
2380
  );
2256
2381
  right: calc(
2257
- 12px +
2258
- (var(--aia-product-card-width, 116px) - 12px) *
2382
+ 8.4px +
2383
+ (var(--aia-product-card-width, 81.2px) - 8.4px) *
2259
2384
  (1 - var(--aia-product-photo-fill-x, 1)) /
2260
2385
  2
2261
2386
  );
2262
2387
  display: flex;
2263
2388
  align-items: center;
2264
2389
  justify-content: center;
2265
- width: var(--aia-product-cart-size, 28px);
2266
- height: var(--aia-product-cart-size, 28px);
2390
+ width: var(--aia-product-cart-size, 19.6px);
2391
+ height: var(--aia-product-cart-size, 19.6px);
2267
2392
  border-radius: 999px;
2268
2393
  background: var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94));
2269
2394
  color: var(--aia-product-cart-color, #1f2328);
@@ -2287,8 +2412,8 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2287
2412
 
2288
2413
  .aia-cart-kSlqU svg {
2289
2414
  display: block;
2290
- width: 16px;
2291
- height: 16px;
2415
+ width: 11.2px;
2416
+ height: 11.2px;
2292
2417
  fill: none;
2293
2418
  stroke: currentColor;
2294
2419
  stroke-width: 2;
@@ -2371,8 +2496,8 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2371
2496
  occurrence, and these selectors contain the base selectors. */
2372
2497
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-row-WDVBX {
2373
2498
  flex-direction: column;
2374
- gap: var(--aia-product-list-gap, 2px);
2375
- max-height: var(--aia-product-list-max-height, 320px);
2499
+ gap: var(--aia-product-list-gap, 1.4px);
2500
+ max-height: var(--aia-product-list-max-height, 224px);
2376
2501
  overflow-x: hidden;
2377
2502
  overflow-y: auto;
2378
2503
  overscroll-behavior-y: contain;
@@ -2381,17 +2506,17 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2381
2506
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-card-JBGYT {
2382
2507
  flex-direction: row;
2383
2508
  align-items: center;
2384
- gap: 10px;
2509
+ gap: 7px;
2385
2510
  width: auto;
2386
- padding: 6px 8px;
2511
+ padding: 4.2px 5.6px;
2387
2512
  }
2388
2513
 
2389
2514
  /* A fixed square thumbnail: width and height together, so the row's height
2390
2515
  is the tile's, not the card width's. */
2391
2516
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-media-RrbGe {
2392
2517
  flex: 0 0 auto;
2393
- width: var(--aia-product-list-media-size, 44px);
2394
- height: var(--aia-product-list-media-size, 44px);
2518
+ width: var(--aia-product-list-media-size, 30.8px);
2519
+ height: var(--aia-product-list-media-size, 30.8px);
2395
2520
  }
2396
2521
 
2397
2522
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-body-ly032 {
@@ -2403,18 +2528,18 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2403
2528
  match, so its bottom edge is half a thumbnail below the card's centre; its
2404
2529
  left edge is the card's 8px inline padding. */
2405
2530
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-badge-j9Hcd {
2406
- top: calc(50% + var(--aia-product-list-media-size, 44px) / 2);
2407
- left: 8px;
2408
- width: var(--aia-product-list-media-size, 44px);
2531
+ top: calc(50% + var(--aia-product-list-media-size, 30.8px) / 2);
2532
+ left: 5.6px;
2533
+ width: var(--aia-product-list-media-size, 30.8px);
2409
2534
  transform: translateY(-100%);
2410
- padding: 2px 0;
2411
- border-radius: 0 0 8px 8px;
2535
+ padding: 1.4px 0;
2536
+ border-radius: 0 0 5.6px 5.6px;
2412
2537
  /* A dark scrim rather than the light chip: a light banner at a tile's edge
2413
2538
  merges with a light panel and reads as a cropped photo. */
2414
2539
  background: var(--aia-product-badge-list-bg, rgba(17, 17, 17, 0.72));
2415
2540
  color: var(--aia-product-badge-list-color, #fff);
2416
2541
  box-shadow: none;
2417
- font-size: var(--aia-product-badge-list-font-size, 7px);
2542
+ font-size: var(--aia-product-badge-list-font-size, 4.9px);
2418
2543
  letter-spacing: 0.02em;
2419
2544
  text-align: center;
2420
2545
  }
@@ -2423,7 +2548,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2423
2548
  column stops short of it. */
2424
2549
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-cart-kSlqU {
2425
2550
  top: 50%;
2426
- right: 8px;
2551
+ right: 5.6px;
2427
2552
  transform: translateY(-50%);
2428
2553
  }
2429
2554
 
@@ -2432,9 +2557,9 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2432
2557
  }
2433
2558
 
2434
2559
  .aia-section-Hugfg[data-aia-products-layout="list"] .aia-card-JBGYT[data-aia-product-has-cart] {
2435
- padding-right: calc(var(--aia-product-cart-size, 28px) + 16px);
2560
+ padding-right: calc(var(--aia-product-cart-size, 19.6px) + 11.2px);
2436
2561
  }
2437
- `,document.head.appendChild(e)}var W={section:"aia-section-Hugfg",label:"aia-label-nuc93",row:"aia-row-WDVBX",card:"aia-card-JBGYT",media:"aia-media-RrbGe",image:"aia-image-5pNL7",body:"aia-body-ly032",vendor:"aia-vendor-Gvu7G",title:"aia-title-gCNmq",price:"aia-price-gULcE",compareAt:"aia-compareAt-ewE54",badge:"aia-badge-j9Hcd",cart:"aia-cart-kSlqU",cartCheck:"aia-cartCheck-YTTQ6",cartGlyph:"aia-cartGlyph-cmqAk",cartSpinner:"aia-cartSpinner-442rc","magicx-aia-product-cart-spin":"aia-magicx-aia-product-cart-spin-x8mgr"};import{jsx as Q,jsxs as Qe}from"react/jsx-runtime";function Zt({products:e,listboxId:o,onSelect:a,onAddToCart:i,onFocusChange:n,focusable:l=!0,layout:r="row",imageFallback:d="image",strings:m=li()}){let v=e.length>0,x=ht(null);if(St(()=>{let c=x.current;if(!(!v||!c))return ii(c)},[v]),!v)return null;let u=`${o}-products-label`;return Qe("section",{className:W.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":u,children:[Q("div",{className:W.label,id:u,"data-aia-products-label":"",children:m.products}),Q("div",{ref:x,className:W.row,"data-aia-products-row":"",children:e.map((c,p)=>Q(di,{product:c,id:`${o}-product-${p}`,onSelect:a,onAddToCart:i,onFocusChange:n,focusable:l,imageFallback:d,soldOut:m.soldOut,addToCart:m.addToCart},c.id))})]})}function di({product:e,id:o,onSelect:a,onAddToCart:i,onFocusChange:n,focusable:l,imageFallback:r,soldOut:d,addToCart:m}){let v=!!i&&e.available!==!1,[x,u]=ut(null),c=w=>{w.relatedTarget?.closest("[data-aia-dropdown]")||n?.(!1)},p=w=>{w.metaKey||w.ctrlKey||w.shiftKey||w.altKey||w.button!==0||(w.preventDefault(),a(e))};return Qe("a",{id:o,className:W.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":v?"":void 0,role:"option","aria-selected":!1,style:x?{"--aia-product-photo-fill-x":String(x.x),"--aia-product-photo-fill-y":String(x.y)}:void 0,href:e.url,tabIndex:l?0:-1,onClick:p,onKeyDown:w=>{w.key!=="Enter"&&w.key!==" "||(w.preventDefault(),a(e))},onFocus:()=>n?.(!0),onBlur:c,children:[Q(hi,{sources:oi(e.imageUrl),title:e.title,fallback:r,onPhotoFill:u},ni(e.imageUrl)??""),Qe("span",{className:W.body,children:[e.vendor?Q("span",{className:W.vendor,children:e.vendor}):null,Q("span",{className:W.title,children:e.title}),e.price?Qe("span",{className:W.price,children:[e.price,e.compareAtPrice?Q("s",{className:W.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?Q("span",{className:W.badge,children:d}):null]}),v&&i?Q(pi,{product:e,label:`${m}: ${e.title}`,focusable:l,onAddToCart:i,onFocus:()=>n?.(!0),onBlur:c},ci(e)):null]})}function ci(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(o=>o??"").join("\0")}function pi({product:e,label:o,focusable:a,onAddToCart:i,onFocus:n,onBlur:l}){let[r,d]=ut(null),m=ht(null),v=ht(e);v.current=e;let x=ht(!0);St(()=>(x.current=!0,()=>{x.current=!1}),[]);let u=p=>{m.current=p,x.current&&d(p)},c=p=>{if(p.preventDefault(),p.stopPropagation(),m.current==="adding")return;u("adding");let w;try{w=Promise.resolve(i(v.current))}catch(I){w=Promise.reject(I)}w.then(()=>u("added"),()=>u(null))};return Q("span",{className:W.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":o,tabIndex:a?0:-1,onClick:c,onKeyDown:p=>{p.key!=="Enter"&&p.key!==" "||c(p)},onFocus:p=>{p.stopPropagation(),n()},onBlur:p=>{p.stopPropagation(),l(p)},children:Qe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[Q("path",{className:W.cartGlyph,d:"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6"}),Q("path",{className:W.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),Q("path",{className:W.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),Q("path",{className:W.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),Q("circle",{className:W.cartGlyph,cx:"9",cy:"20",r:"1.3"}),Q("circle",{className:W.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function hi({sources:e,title:o,fallback:a,onPhotoFill:i}){let[n,l]=ut(0),r=e[n],d=!!r,[m,v]=ut(null),x=!d&&a==="initial";return St(()=>()=>i(null),[i]),Qe("span",{className:W.media,"aria-hidden":"true","data-aia-product-placeholder":!d&&!x?"":void 0,"data-aia-product-initial":x?"":void 0,"data-aia-image-loaded":d&&m===r?"":void 0,children:[d?Q("img",{className:W.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:u=>{v(r),i(si(u.currentTarget.naturalWidth,u.currentTarget.naturalHeight))},onError:()=>{n+1>=e.length&&i(null),l(u=>u+1)}}):null,x?ri(o):null]})}import{isOptionsGridMobileViewport as Ii,measureOptionsGrid as Ei,needsOptionsGridMeasurement as Ai,OPTIONS_GRID_MOBILE_QUERY as Li,optionEnterDelayMs as Ri,optionsShowLeadingVisuals as Oi,planOptionsGrid as ta,sameOptionRows as Di}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Mi,useLayoutEffect as zi,useRef as aa,useState as oa}from"react";import{optionsGridTemplateColumns as ui}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as mi,useRef as gi}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`.aia-grid {
2562
+ `,document.head.appendChild(e)}var G={section:"aia-section-Hugfg",label:"aia-label-nuc93",row:"aia-row-WDVBX",card:"aia-card-JBGYT",media:"aia-media-RrbGe",image:"aia-image-5pNL7",body:"aia-body-ly032",vendor:"aia-vendor-Gvu7G",title:"aia-title-gCNmq",price:"aia-price-gULcE",compareAt:"aia-compareAt-ewE54",badge:"aia-badge-j9Hcd",cart:"aia-cart-kSlqU",cartCheck:"aia-cartCheck-YTTQ6",cartGlyph:"aia-cartGlyph-cmqAk",cartSpinner:"aia-cartSpinner-442rc","magicx-aia-product-cart-spin":"aia-magicx-aia-product-cart-spin-x8mgr"};import{jsx as j,jsxs as Ye}from"react/jsx-runtime";function Jt({products:e,listboxId:o,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s=!0,layout:r="row",imageFallback:l="image",strings:m=di()}){let w=e.length>0,x=ht(null);if(St(()=>{let c=x.current;if(!(!w||!c))return oi(c)},[w]),!w)return null;let g=`${o}-products-label`;return Ye("section",{className:G.section,"data-aia-products":"","data-aia-products-layout":r,role:"group","aria-labelledby":g,children:[j("div",{className:G.label,id:g,"data-aia-products-label":"",children:m.products}),j("div",{ref:x,className:G.row,"data-aia-products-row":"",children:e.map((c,h)=>j(ci,{product:c,id:`${o}-product-${h}`,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s,imageFallback:l,soldOut:m.soldOut,addToCart:m.addToCart},c.id))})]})}function ci({product:e,id:o,onSelect:t,onAddToCart:a,onFocusChange:i,focusable:s,imageFallback:r,soldOut:l,addToCart:m}){let w=!!a&&e.available!==!1,[x,g]=ut(null),c=v=>{v.relatedTarget?.closest("[data-aia-dropdown]")||i?.(!1)},h=v=>{v.metaKey||v.ctrlKey||v.shiftKey||v.altKey||v.button!==0||(v.preventDefault(),t(e))};return Ye("a",{id:o,className:G.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":w?"":void 0,role:"option","aria-selected":!1,style:x?{"--aia-product-photo-fill-x":String(x.x),"--aia-product-photo-fill-y":String(x.y)}:void 0,href:e.url,tabIndex:s?0:-1,onClick:h,onKeyDown:v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),t(e))},onFocus:()=>i?.(!0),onBlur:c,children:[j(ui,{sources:ni(e.imageUrl),title:e.title,fallback:r,onPhotoFill:g},ri(e.imageUrl)??""),Ye("span",{className:G.body,children:[e.vendor?j("span",{className:G.vendor,children:e.vendor}):null,j("span",{className:G.title,children:e.title}),e.price?Ye("span",{className:G.price,children:[e.price,e.compareAtPrice?j("s",{className:G.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?j("span",{className:G.badge,children:l}):null]}),w&&a?j(hi,{product:e,label:`${m}: ${e.title}`,focusable:s,onAddToCart:a,onFocus:()=>i?.(!0),onBlur:c},pi(e)):null]})}function pi(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(o=>o??"").join("\0")}function hi({product:e,label:o,focusable:t,onAddToCart:a,onFocus:i,onBlur:s}){let[r,l]=ut(null),m=ht(null),w=ht(e);w.current=e;let x=ht(!0);St(()=>(x.current=!0,()=>{x.current=!1}),[]);let g=h=>{m.current=h,x.current&&l(h)},c=h=>{if(h.preventDefault(),h.stopPropagation(),m.current==="adding")return;g("adding");let v;try{v=Promise.resolve(a(w.current))}catch(E){v=Promise.reject(E)}v.then(()=>g("added"),()=>g(null))};return j("span",{className:G.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":o,tabIndex:t?0:-1,onClick:c,onKeyDown:h=>{h.key!=="Enter"&&h.key!==" "||c(h)},onFocus:h=>{h.stopPropagation(),i()},onBlur:h=>{h.stopPropagation(),s(h)},children:Ye("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[j("path",{className:G.cartGlyph,d:"M2 3h2.2l2.4 11.2a2 2 0 0 0 2 1.6h8.9a2 2 0 0 0 1.9-1.5L21 8H6"}),j("path",{className:G.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),j("path",{className:G.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),j("path",{className:G.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),j("circle",{className:G.cartGlyph,cx:"9",cy:"20",r:"1.3"}),j("circle",{className:G.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function ui({sources:e,title:o,fallback:t,onPhotoFill:a}){let[i,s]=ut(0),r=e[i],l=!!r,[m,w]=ut(null),x=!l&&t==="initial";return St(()=>()=>a(null),[a]),Ye("span",{className:G.media,"aria-hidden":"true","data-aia-product-placeholder":!l&&!x?"":void 0,"data-aia-product-initial":x?"":void 0,"data-aia-image-loaded":l&&m===r?"":void 0,children:[l?j("img",{className:G.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:g=>{w(r),a(li(g.currentTarget.naturalWidth,g.currentTarget.naturalHeight))},onError:()=>{i+1>=e.length&&a(null),s(g=>g+1)}}):null,x?si(o):null]})}import{isOptionsGridMobileViewport as Ei,measureOptionsGrid as Ai,needsOptionsGridMeasurement as Ri,OPTIONS_GRID_MOBILE_QUERY as Li,optionEnterDelayMs as Oi,optionsShowLeadingVisuals as Di,planOptionsGrid as ia,sameOptionRows as Mi}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as zi,useLayoutEffect as Ni,useRef as oa,useState as ra}from"react";import{optionsGridTemplateColumns as mi}from"@magicx-eng/ai-autocomplete-vanilla";import{useLayoutEffect as gi,useRef as fi}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`.aia-grid {
2438
2563
  display: grid;
2439
2564
  grid-template-columns: repeat(
2440
2565
  auto-fit,
@@ -2462,7 +2587,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2462
2587
  /* The scroll box's reserved band (--aia-grid-scroll-* / --aia-grid-overlap-*)
2463
2588
  is deliberately NOT declared here \u2014 see the rule in
2464
2589
  appearance.css for why. */
2465
- max-height: var(--aia-grid-max-height, 120px);
2590
+ max-height: var(--aia-grid-max-height, 84px);
2466
2591
  overflow-y: auto;
2467
2592
  overscroll-behavior: contain;
2468
2593
  scrollbar-width: none;
@@ -2470,7 +2595,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2470
2595
  .aia-grid[data-scroll]::-webkit-scrollbar {
2471
2596
  display: none;
2472
2597
  }
2473
- `,document.head.appendChild(e)}import{jsx as fi}from"react/jsx-runtime";function Xt({min:e="16rem",max:o,gap:a,scroll:i=!1,maxHeight:n,scrollResetKey:l,cols:r,template:d,innerRef:m,className:v,children:x,...u}){let c=gi(null);mi(()=>{if(l===void 0)return;let w=c.current;w&&(w.scrollTop=0)},[l]);let p={"--aia-grid-min":e};return o&&(p["--aia-grid-max"]=o),a&&(p["--aia-grid-gap"]=a),n&&(p["--aia-grid-max-height"]=n),r&&(p.gridTemplateColumns=ui(r)),d&&(p.gridTemplateColumns=d),fi("div",{ref:w=>{c.current=w,m?.(w)},className:v?`aia-grid ${v}`:"aia-grid","data-scroll":i||void 0,style:p,...u,children:x})}import{formatOptionCount as bi,highlightParts as wi,isMultiSelectToggleTap as vi,OPTION_ENTER_DELAY_VAR as xi,optionImageSources as yi,optionLabel as Jt,sanitizeOptionIconSvg as ki}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Ci,useMemo as Si,useRef as Ti,useState as mt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-82820da7")){let e=document.createElement("style");e.id="ac-style-82820da7",e.textContent=`.aia-item-d4vpD {
2598
+ `,document.head.appendChild(e)}import{jsx as bi}from"react/jsx-runtime";function ea({min:e="16rem",max:o,gap:t,scroll:a=!1,maxHeight:i,scrollResetKey:s,cols:r,template:l,innerRef:m,className:w,children:x,...g}){let c=fi(null);gi(()=>{if(s===void 0)return;let v=c.current;v&&(v.scrollTop=0)},[s]);let h={"--aia-grid-min":e};return o&&(h["--aia-grid-max"]=o),t&&(h["--aia-grid-gap"]=t),i&&(h["--aia-grid-max-height"]=i),r&&(h.gridTemplateColumns=mi(r)),l&&(h.gridTemplateColumns=l),bi("div",{ref:v=>{c.current=v,m?.(v)},className:w?`aia-grid ${w}`:"aia-grid","data-scroll":a||void 0,style:h,...g,children:x})}import{formatOptionCount as wi,highlightParts as vi,isMultiSelectToggleTap as xi,OPTION_ENTER_DELAY_VAR as yi,optionImageSources as ki,optionLabel as ta,sanitizeOptionIconSvg as Ci}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Si,useMemo as Ti,useRef as Pi,useState as mt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-82820da7")){let e=document.createElement("style");e.id="ac-style-82820da7",e.textContent=`.aia-item-d4vpD {
2474
2599
  position: relative;
2475
2600
  /* Clip, not visible: the entrance rise below runs on the inner content,
2476
2601
  and a transformed box extends its scroll container's scrollable area.
@@ -2488,16 +2613,16 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2488
2613
  the same baseline at the top edge of the cell. */
2489
2614
  align-items: flex-start;
2490
2615
  font-family: inherit;
2491
- font-size: var(--aia-option-font-size, 16px);
2616
+ font-size: var(--aia-option-font-size, 11.2px);
2492
2617
  font-weight: 450;
2493
- line-height: 21px;
2618
+ line-height: 14.7px;
2494
2619
  color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
2495
2620
  white-space: normal;
2496
2621
  word-break: break-word;
2497
- /* 8px radius on the highlighted fill (--aia-option-bg), matching the Figma
2498
- SuggestionItem selection. The 9px/10px inset is the item's own padding. */
2499
- border-radius: 8px;
2500
- padding: 8px 10px;
2622
+ /* 5.6px radius on the highlighted fill (--aia-option-bg), matching the Figma
2623
+ SuggestionItem selection at 70%. The 5.6px/10px inset is the item's own padding. */
2624
+ border-radius: 5.6px;
2625
+ padding: 5.6px 10px;
2501
2626
  /* No entrance animation on the row itself \u2014 deliberately. The row is the
2502
2627
  tappable element, and iOS Safari drops a tap on a scripted-clickable
2503
2628
  element (a div with a click handler; a native button is exempt) whose
@@ -2583,8 +2708,8 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2583
2708
  }
2584
2709
 
2585
2710
  .aia-tag-e3Fwe {
2586
- font-size: 11px;
2587
- margin-left: 6px;
2711
+ font-size: 7.7px;
2712
+ margin-left: 4.2px;
2588
2713
  opacity: 0.5;
2589
2714
  }
2590
2715
 
@@ -2663,9 +2788,9 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2663
2788
  text box, so a hanging indent never moves it; a skeleton row drops it. */
2664
2789
  .aia-parameter-Dt2zF {
2665
2790
  display: block;
2666
- font-size: var(--aia-option-parameter-font-size, 12px);
2791
+ font-size: var(--aia-option-parameter-font-size, 8.4px);
2667
2792
  font-weight: 400;
2668
- line-height: 16px;
2793
+ line-height: 11.2px;
2669
2794
  text-indent: 0;
2670
2795
  color: var(--aia-option-parameter-color, inherit);
2671
2796
  opacity: var(--aia-option-parameter-opacity, 0.6);
@@ -2689,8 +2814,8 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2689
2814
  .aia-icon-Qw938 {
2690
2815
  display: inline-flex;
2691
2816
  align-items: center;
2692
- height: 21px; /* = the option's line-height */
2693
- margin-right: 8px;
2817
+ height: 14.7px; /* = the option's line-height */
2818
+ margin-right: 5.6px;
2694
2819
  vertical-align: top;
2695
2820
  /* Own compositing layer. The row (entrance) and the chip (promotion fade)
2696
2821
  animate on a layer WebKit drops when the animation ends; content drawn at
@@ -2721,8 +2846,8 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2721
2846
  (blockified), so text-indent applies to it directly. Skeleton rows keep
2722
2847
  it too: their icon is hidden but still occupies its column. */
2723
2848
  .aia-content-T-Qba:not(:has(.aia-count-IpYbQ)):has(.aia-icon-Qw938) {
2724
- padding-left: calc(1em + 8px);
2725
- text-indent: calc(-1em - 8px);
2849
+ padding-left: calc(1em + 5.6px);
2850
+ text-indent: calc(-1em - 5.6px);
2726
2851
  }
2727
2852
 
2728
2853
  /* --- Option pictures and counts ---
@@ -2764,15 +2889,15 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2764
2889
  loads) and stays if it never does. */
2765
2890
  .aia-content-T-Qba:has(.aia-image-YZAbO) {
2766
2891
  align-items: center;
2767
- gap: var(--aia-option-image-gap, 12px);
2892
+ gap: var(--aia-option-image-gap, 8.4px);
2768
2893
  }
2769
2894
 
2770
2895
  .aia-image-YZAbO {
2771
2896
  flex: 0 0 auto;
2772
2897
  display: block;
2773
- width: var(--aia-option-image-size, 40px);
2774
- height: var(--aia-option-image-size, 40px);
2775
- border-radius: var(--aia-option-image-radius, 12px);
2898
+ width: var(--aia-option-image-size, 28px);
2899
+ height: var(--aia-option-image-size, 28px);
2900
+ border-radius: var(--aia-option-image-radius, 8.4px);
2776
2901
  overflow: hidden;
2777
2902
  background: var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));
2778
2903
  }
@@ -2797,7 +2922,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2797
2922
  max-width: 100%;
2798
2923
  height: 100%;
2799
2924
  margin: 0 auto;
2800
- border-radius: var(--aia-option-picture-radius, 6px);
2925
+ border-radius: var(--aia-option-picture-radius, 4.2px);
2801
2926
  object-fit: contain;
2802
2927
  }
2803
2928
 
@@ -2814,10 +2939,10 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2814
2939
  .aia-count-IpYbQ {
2815
2940
  flex: 0 0 auto;
2816
2941
  margin-left: auto;
2817
- padding-left: 12px;
2818
- font-size: var(--aia-option-count-font-size, 12px);
2942
+ padding-left: 8.4px;
2943
+ font-size: var(--aia-option-count-font-size, 8.4px);
2819
2944
  font-weight: 400;
2820
- line-height: 21px; /* = the option's line-height */
2945
+ line-height: 14.7px; /* = the option's line-height */
2821
2946
  font-variant-numeric: tabular-nums;
2822
2947
  white-space: nowrap;
2823
2948
  color: var(--aia-option-count-color, inherit);
@@ -2853,12 +2978,12 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2853
2978
  display: none;
2854
2979
  }
2855
2980
 
2856
- /* A grid of rows with a parameter line is taller per row: the row's 21px text
2857
- line and 16px padding plus the 16px parameter line, so the visible-rows cap
2981
+ /* A grid of rows with a parameter line is taller per row: the row's text
2982
+ line and padding plus the parameter line, so the visible-rows cap
2858
2983
  (\`--aia-grid-max-height\`) does not cut the last row. Before the picture rule,
2859
2984
  which wins when a group has both. */
2860
2985
  [data-aia-group]:has(.aia-parameter-Dt2zF) {
2861
- --aia-option-row-height: 53px;
2986
+ --aia-option-row-height: 37.1px;
2862
2987
  }
2863
2988
 
2864
2989
  /* A grid of picture rows is taller per row: the visible-rows cap
@@ -2866,7 +2991,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2866
2991
  planOptionsGrid) follows the tile's height plus the row's padding, so the
2867
2992
  same number of rows shows before the list scrolls. */
2868
2993
  [data-aia-group]:has(.aia-image-YZAbO) {
2869
- --aia-option-row-height: calc(var(--aia-option-image-size, 40px) + 16px);
2994
+ --aia-option-row-height: calc(var(--aia-option-image-size, 28px) + 11.2px);
2870
2995
  }
2871
2996
 
2872
2997
  /* A row without a picture, in a grid where other rows have one, lines up
@@ -2881,9 +3006,9 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2881
3006
  display: flex;
2882
3007
  flex: 1 1 auto;
2883
3008
  align-items: center;
2884
- gap: var(--aia-option-image-gap, 12px);
3009
+ gap: var(--aia-option-image-gap, 8.4px);
2885
3010
  min-width: 0;
2886
- min-height: var(--aia-option-image-size, 40px);
3011
+ min-height: var(--aia-option-image-size, 28px);
2887
3012
  padding-left: 0;
2888
3013
  text-indent: 0;
2889
3014
  }
@@ -2891,8 +3016,8 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2891
3016
  [data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) .aia-icon-Qw938 {
2892
3017
  flex: 0 0 auto;
2893
3018
  justify-content: center;
2894
- width: var(--aia-option-image-size, 40px);
2895
- height: var(--aia-option-image-size, 40px);
3019
+ width: var(--aia-option-image-size, 28px);
3020
+ height: var(--aia-option-image-size, 28px);
2896
3021
  margin-right: 0;
2897
3022
  }
2898
3023
 
@@ -2952,7 +3077,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2952
3077
  .aia-content-T-Qba:has(.aia-checkbox-KGRhg) {
2953
3078
  display: flex;
2954
3079
  align-items: center;
2955
- gap: 10px;
3080
+ gap: 7px;
2956
3081
  }
2957
3082
 
2958
3083
  /* A checkbox row is a flex row, so its icon is a flex item beside the text,
@@ -2976,14 +3101,14 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2976
3101
  /* The mark is text centred in the box. An indent inherited from the row
2977
3102
  (an icon row hangs its text with one) would slide it out of the box. */
2978
3103
  text-indent: 0;
2979
- flex: 0 0 18px;
2980
- width: 18px;
2981
- height: 18px;
3104
+ flex: 0 0 12.6px;
3105
+ width: 12.6px;
3106
+ height: 12.6px;
2982
3107
  border: 1px solid var(--aia-border);
2983
- border-radius: 6px;
3108
+ border-radius: 4.2px;
2984
3109
  background: var(--aia-surface);
2985
3110
  color: transparent;
2986
- font-size: 11px;
3111
+ font-size: 7.7px;
2987
3112
  line-height: 1;
2988
3113
  }
2989
3114
 
@@ -2996,7 +3121,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
2996
3121
  .aia-item-d4vpD:has(.aia-checkbox-KGRhg[data-checked="true"]) {
2997
3122
  background: var(--aia-option-bg, transparent);
2998
3123
  }
2999
- `,document.head.appendChild(e)}var Y={item:"aia-item-d4vpD",content:"aia-content-T-Qba",riseIn:"aia-riseIn-etXZT",fadeIn:"aia-fadeIn-I8u35",tappable:"aia-tappable-70KcX",nonTappable:"aia-nonTappable-xSZM-",highlighted:"aia-highlighted-Hb0SU",liveMatch:"aia-liveMatch--eYfs",tag:"aia-tag-e3Fwe",pressed:"aia-pressed-98o-r",pressCompress:"aia-pressCompress-ICV3q",scrollHint:"aia-scrollHint-xKXPt",skeletonPulse:"aia-skeletonPulse-plvdD",text:"aia-text-yqoh9",skeletonBarIn:"aia-skeletonBarIn-ZlEM0",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",skeletonOut:"aia-skeletonOut-x6NRd",checkbox:"aia-checkbox-KGRhg"};import{Fragment as Pi,jsx as Se,jsxs as Tt}from"react/jsx-runtime";function ea({option:e,isHighlighted:o,checked:a,onSelect:i,onHighlight:n,onUnhighlight:l,id:r,loading:d,showIcon:m=!0,showImage:v=!0,showCount:x=!0,scrollHint:u,enterDelayMs:c=0}){let[p]=mt(c),[w,I]=mt(!1),M=v?yi(e.image_url):[],A=M[0]??null,[F,K]=mt([]),L=M.find(S=>!F.includes(S))??null,[E,y]=mt(null),$=Si(()=>!A&&m&&e.icon_svg?ki(e.icon_svg):null,[A,m,e.icon_svg]),q=x?bi(e.item_count):null,Z=Ti(void 0);Ci(()=>()=>clearTimeout(Z.current),[]);let z=S=>{if(d||!e.is_tappable||w&&a===void 0)return;I(!0);let G=S?.currentTarget;a!==void 0&&G!==void 0&&S!==void 0&&!vi(G,G.querySelector("[data-aia-checkbox]"),S)?i(e,{commit:!0}):i(e),clearTimeout(Z.current),Z.current=setTimeout(()=>I(!1),170)},_=[Y.item,o&&!d?Y.highlighted:"",e.liveMatch&&!d?Y.liveMatch:"",e.is_tappable?Y.tappable:Y.nonTappable,w?Y.pressed:"",u?Y.scrollHint:""].filter(Boolean).join(" ");return Se("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":d?"":void 0,"data-aia-icon":$&&e.icon?e.icon:void 0,"data-aia-image":A?"":void 0,"data-aia-item-count":q!==null?e.item_count:void 0,"aria-selected":a??o,className:_,style:{[xi]:`${p}ms`},tabIndex:d||!e.is_tappable?-1:0,onClick:z,onKeyDown:S=>{!d&&e.is_tappable&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),z())},onMouseEnter:!d&&e.is_tappable?n:void 0,onMouseLeave:l,children:Tt("span",{className:Y.content,children:[a!==void 0&&e.is_tappable&&Se("span",{className:Y.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":a,children:a?"\u2713":""}),A&&Se("span",{className:`${Y.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":L!==null&&E===L?"":void 0,children:Se("img",{src:L??A,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:L===null,onLoad:()=>y(L),onError:()=>{L!==null&&K(S=>[...S,L])}})}),$&&Se("span",{className:`${Y.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:$}}),Tt("span",{className:Y.text,children:[e.matchedText?wi(Jt(e),e.matchedText).map((S,G)=>S.bold?Se("strong",{className:`${Y.match} magicx-aia-option-match`,children:S.text},G):S.text):Jt(e),e.parameterLabel&&Tt(Pi,{children:[" ",Se("span",{className:`${Y.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&Se("span",{className:Y.tag,children:e.tag}),q!==null&&Se("span",{className:`${Y.count} magicx-aia-option-count`,children:q})]})})}import{jsx as ia}from"react/jsx-runtime";function Ni(){let[e,o]=oa(Ii);return Mi(()=>{if(typeof window>"u"||!window.matchMedia)return;let a=window.matchMedia(Li),i=()=>o(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[]),e}function na({options:e,activeIndex:o,picked:a,onSelect:i,onHighlight:n,onUnhighlight:l,listboxId:r,loading:d,groupKey:m="",optionsPosition:v="below",showIcons:x=!0,showImages:u=!0,showCounts:c=!0}){let p=Ni(),w=aa(null),[I,M]=oa(null),A=aa(null);zi(()=>{if(d&&Di(A.current,e))return;A.current=d?null:e;let L=w.current,y=L&&!d&&Ai(e.length,p)?Ei(L):null;M(y?ta(e.length,p,y.rowWidths,y.gridWidth):null)},[e,p,d]);let F=I??ta(e.length,p,null,null),K=Oi(e,x,u);return ia(Xt,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:m,template:F.template,maxHeight:F.maxHeight,innerRef:L=>{w.current=L},"data-aia-group":m,children:e.map((L,E)=>ia(ea,{option:L,isHighlighted:E===o,checked:a?a.includes(L.text):void 0,onSelect:i,onHighlight:()=>n(E),onUnhighlight:l?()=>l(E):void 0,id:`${r}-option-${E}`,loading:d,showIcon:x&&K,showImage:u&&K,showCount:c,scrollHint:!d&&F.scrollHintIndices.includes(E),enterDelayMs:d?0:Ri(E,F.cols,e.length,v)},`${m}\0${L.text}`))})}import{formatTime as Fi,TIME_WHEEL_COLUMNS as Hi,TIME_WHEEL_ROW_HEIGHT as Bi,timeWheelIndex as ra,timeWheelIndexFromScroll as Wi,timeWheelRows as Gi,withTimeWheelIndex as sa}from"@magicx-eng/ai-autocomplete-vanilla";import{Fragment as Ki,useEffect as qi,useLayoutEffect as _i,useRef as gt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-52a922cb")){let e=document.createElement("style");e.id="ac-style-52a922cb",e.textContent=`/* --- Time wheel (replaces the options grid for time suggestions) ---
3124
+ `,document.head.appendChild(e)}var $={item:"aia-item-d4vpD",content:"aia-content-T-Qba",riseIn:"aia-riseIn-etXZT",fadeIn:"aia-fadeIn-I8u35",tappable:"aia-tappable-70KcX",nonTappable:"aia-nonTappable-xSZM-",highlighted:"aia-highlighted-Hb0SU",liveMatch:"aia-liveMatch--eYfs",tag:"aia-tag-e3Fwe",pressed:"aia-pressed-98o-r",pressCompress:"aia-pressCompress-ICV3q",scrollHint:"aia-scrollHint-xKXPt",skeletonPulse:"aia-skeletonPulse-plvdD",text:"aia-text-yqoh9",skeletonBarIn:"aia-skeletonBarIn-ZlEM0",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",skeletonOut:"aia-skeletonOut-x6NRd",checkbox:"aia-checkbox-KGRhg"};import{Fragment as Ii,jsx as Ee,jsxs as Tt}from"react/jsx-runtime";function aa({option:e,isHighlighted:o,checked:t,onSelect:a,onHighlight:i,onUnhighlight:s,id:r,loading:l,showIcon:m=!0,showImage:w=!0,showCount:x=!0,scrollHint:g,enterDelayMs:c=0}){let[h]=mt(c),[v,E]=mt(!1),F=w?ki(e.image_url):[],M=F[0]??null,[O,V]=mt([]),R=F.find(T=>!O.includes(T))??null,[D,S]=mt(null),H=Ti(()=>!M&&m&&e.icon_svg?Ci(e.icon_svg):null,[M,m,e.icon_svg]),U=x?wi(e.item_count):null,X=Pi(void 0);Si(()=>()=>clearTimeout(X.current),[]);let q=T=>{if(l||!e.is_tappable||v&&t===void 0)return;E(!0);let B=T?.currentTarget;t!==void 0&&B!==void 0&&T!==void 0&&!xi(B,B.querySelector("[data-aia-checkbox]"),T)?a(e,{commit:!0}):a(e),clearTimeout(X.current),X.current=setTimeout(()=>E(!1),170)},_=[$.item,o&&!l?$.highlighted:"",e.liveMatch&&!l?$.liveMatch:"",e.is_tappable?$.tappable:$.nonTappable,v?$.pressed:"",g?$.scrollHint:""].filter(Boolean).join(" ");return Ee("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":l?"":void 0,"data-aia-icon":H&&e.icon?e.icon:void 0,"data-aia-image":M?"":void 0,"data-aia-item-count":U!==null?e.item_count:void 0,"aria-selected":t??o,className:_,style:{[yi]:`${h}ms`},tabIndex:l||!e.is_tappable?-1:0,onClick:q,onKeyDown:T=>{!l&&e.is_tappable&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),q())},onMouseEnter:!l&&e.is_tappable?i:void 0,onMouseLeave:s,children:Tt("span",{className:$.content,children:[t!==void 0&&e.is_tappable&&Ee("span",{className:$.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t,children:t?"\u2713":""}),M&&Ee("span",{className:`${$.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":R!==null&&D===R?"":void 0,children:Ee("img",{src:R??M,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:R===null,onLoad:()=>S(R),onError:()=>{R!==null&&V(T=>[...T,R])}})}),H&&Ee("span",{className:`${$.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:H}}),Tt("span",{className:$.text,children:[e.matchedText?vi(ta(e),e.matchedText).map((T,B)=>T.bold?Ee("strong",{className:`${$.match} magicx-aia-option-match`,children:T.text},B):T.text):ta(e),e.parameterLabel&&Tt(Ii,{children:[" ",Ee("span",{className:`${$.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&Ee("span",{className:$.tag,children:e.tag}),U!==null&&Ee("span",{className:`${$.count} magicx-aia-option-count`,children:U})]})})}import{jsx as na}from"react/jsx-runtime";function Fi(){let[e,o]=ra(Ei);return zi(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(Li),a=()=>o(t.matches);return a(),t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[]),e}function sa({options:e,activeIndex:o,picked:t,onSelect:a,onHighlight:i,onUnhighlight:s,listboxId:r,loading:l,groupKey:m="",optionsPosition:w="below",showIcons:x=!0,showImages:g=!0,showCounts:c=!0}){let h=Fi(),v=oa(null),[E,F]=ra(null),M=oa(null);Ni(()=>{if(l&&Mi(M.current,e))return;M.current=l?null:e;let R=v.current,S=R&&!l&&Ri(e.length,h)?Ai(R):null;F(S?ia(e.length,h,S.rowWidths,S.gridWidth):null)},[e,h,l]);let O=E??ia(e.length,h,null,null),V=Di(e,x,g);return na(ea,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:m,template:O.template,maxHeight:O.maxHeight,innerRef:R=>{v.current=R},"data-aia-group":m,children:e.map((R,D)=>na(aa,{option:R,isHighlighted:D===o,checked:t?t.includes(R.text):void 0,onSelect:a,onHighlight:()=>i(D),onUnhighlight:s?()=>s(D):void 0,id:`${r}-option-${D}`,loading:l,showIcon:x&&V,showImage:g&&V,showCount:c,scrollHint:!l&&O.scrollHintIndices.includes(D),enterDelayMs:l?0:Oi(D,O.cols,e.length,w)},`${m}\0${R.text}`))})}import{formatTime as Hi,TIME_WHEEL_COLUMNS as Bi,TIME_WHEEL_ROW_HEIGHT as Wi,timeWheelIndex as la,timeWheelIndexFromScroll as Ki,timeWheelRows as Gi,withTimeWheelIndex as da}from"@magicx-eng/ai-autocomplete-vanilla";import{Fragment as qi,useEffect as _i,useLayoutEffect as Vi,useRef as gt}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-52a922cb")){let e=document.createElement("style");e.id="ac-style-52a922cb",e.textContent=`/* --- Time wheel (replaces the options grid for time suggestions) ---
3000
3125
 
3001
3126
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
3002
3127
  time-wheel.component.css). Only the class-naming layer differs \u2014 the
@@ -3101,24 +3226,24 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
3101
3226
 
3102
3227
  .aia-done-llNY5 {
3103
3228
  align-self: stretch;
3104
- height: 36px;
3229
+ height: 44px;
3105
3230
  padding: 0 12px;
3106
3231
  border: none;
3107
- border-radius: 8px;
3108
- background: var(--aia-time-done-bg, var(--aia-confirm-bg, #262626));
3232
+ border-radius: 12px;
3233
+ background: var(--aia-time-done-bg, var(--aia-done-bg, #e4e8f0));
3109
3234
  font-family: inherit;
3110
- font-size: 13px;
3111
- font-weight: 500;
3235
+ font-size: 15px;
3236
+ font-weight: 600;
3112
3237
  line-height: 20px;
3113
- color: var(--aia-time-done-color, var(--aia-confirm-color, #ffffff));
3238
+ color: var(--aia-time-done-color, var(--aia-done-color, #2a3150));
3114
3239
  cursor: pointer;
3115
3240
  transition: background-color 150ms ease-out;
3116
3241
  }
3117
3242
 
3118
3243
  .aia-done-llNY5:hover {
3119
- background: var(--aia-time-done-bg-hover, var(--aia-confirm-bg-hover, #404040));
3244
+ background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
3120
3245
  }
3121
- `,document.head.appendChild(e)}var de={timeWheel:"aia-timeWheel-KdR4A",value:"aia-value--wqvm",columns:"aia-columns-TaD-f",band:"aia-band-pVy-f",column:"aia-column-lwtdd",row:"aia-row-A3pAx",selected:"aia-selected-xgOWY",separator:"aia-separator-kX9WO",done:"aia-done-llNY5"};import{jsx as Ge,jsxs as Pt}from"react/jsx-runtime";var Ui=120;function la({view:e,label:o,doneLabel:a,interactive:i=!0,onTimeChange:n,onTimeCommit:l}){return Pt("div",{className:de.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":o,onMouseDown:r=>r.preventDefault(),children:[Ge("span",{className:de.value,"data-aia-time-value":"","aria-live":"polite",children:Fi(e.minutes)}),Pt("div",{className:de.columns,"aria-hidden":"true",children:[Ge("div",{className:de.band}),Hi.map(r=>Pt(Ki,{children:[r==="minute"&&Ge("span",{className:de.separator,children:":"}),Ge(Vi,{column:r,minutes:e.minutes,interactive:i,onTimeChange:n})]},r))]}),Ge("button",{type:"button",tabIndex:-1,className:de.done,"data-aia-time-done":"",onClick:()=>{i&&l()},children:a})]})}function Vi({column:e,minutes:o,interactive:a,onTimeChange:i}){let n=gt(null),l=gt(null),r=gt(null),d=gt({minutes:o,interactive:a,onTimeChange:i});d.current={minutes:o,interactive:a,onTimeChange:i};let m=ra(e,o);_i(()=>{let u=n.current;if(!u||r.current)return;let c=m*Bi;Math.abs(u.scrollTop-c)<1||(l.current=c,u.scrollTop=c)},[m]),qi(()=>()=>{r.current&&clearTimeout(r.current)},[]);let v=()=>{r.current=null;let u=n.current,c=d.current;if(!u||!c.interactive)return;let p=Wi(e,u.scrollTop);p!==ra(e,c.minutes)&&c.onTimeChange(sa(e,c.minutes,p))},x=()=>{let u=n.current;if(u){if(l.current!=null&&Math.abs(u.scrollTop-l.current)<1){l.current=null;return}l.current=null,r.current&&clearTimeout(r.current),r.current=setTimeout(v,Ui)}};return Ge("div",{ref:n,className:de.column,"data-aia-time-column":e,onScroll:x,children:Gi(e).map((u,c)=>Ge("div",{className:c===m?`${de.row} ${de.selected}`:de.row,"data-aia-time-row":"","data-aia-index":c,onClick:()=>{d.current.interactive&&i(sa(e,d.current.minutes,c))},children:u.label},u.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
3246
+ `,document.head.appendChild(e)}var ce={timeWheel:"aia-timeWheel-KdR4A",value:"aia-value--wqvm",columns:"aia-columns-TaD-f",band:"aia-band-pVy-f",column:"aia-column-lwtdd",row:"aia-row-A3pAx",selected:"aia-selected-xgOWY",separator:"aia-separator-kX9WO",done:"aia-done-llNY5"};import{jsx as We,jsxs as Pt}from"react/jsx-runtime";var Ui=120;function ca({view:e,label:o,doneLabel:t,interactive:a=!0,onTimeChange:i,onTimeCommit:s}){return Pt("div",{className:ce.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":o,onMouseDown:r=>r.preventDefault(),children:[We("span",{className:ce.value,"data-aia-time-value":"","aria-live":"polite",children:Hi(e.minutes)}),Pt("div",{className:ce.columns,"aria-hidden":"true",children:[We("div",{className:ce.band}),Bi.map(r=>Pt(qi,{children:[r==="minute"&&We("span",{className:ce.separator,children:":"}),We(Qi,{column:r,minutes:e.minutes,interactive:a,onTimeChange:i})]},r))]}),We("button",{type:"button",tabIndex:-1,className:ce.done,"data-aia-time-done":"",onClick:()=>{a&&s()},children:t})]})}function Qi({column:e,minutes:o,interactive:t,onTimeChange:a}){let i=gt(null),s=gt(null),r=gt(null),l=gt({minutes:o,interactive:t,onTimeChange:a});l.current={minutes:o,interactive:t,onTimeChange:a};let m=la(e,o);Vi(()=>{let g=i.current;if(!g||r.current)return;let c=m*Wi;Math.abs(g.scrollTop-c)<1||(s.current=c,g.scrollTop=c)},[m]),_i(()=>()=>{r.current&&clearTimeout(r.current)},[]);let w=()=>{r.current=null;let g=i.current,c=l.current;if(!g||!c.interactive)return;let h=Ki(e,g.scrollTop);h!==la(e,c.minutes)&&c.onTimeChange(da(e,c.minutes,h))},x=()=>{let g=i.current;if(g){if(s.current!=null&&Math.abs(g.scrollTop-s.current)<1){s.current=null;return}s.current=null,r.current&&clearTimeout(r.current),r.current=setTimeout(w,Ui)}};return We("div",{ref:i,className:ce.column,"data-aia-time-column":e,onScroll:x,children:Gi(e).map((g,c)=>We("div",{className:c===m?`${ce.row} ${ce.selected}`:ce.row,"data-aia-time-row":"","data-aia-index":c,onClick:()=>{l.current.interactive&&a(da(e,l.current.minutes,c))},children:g.label},g.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
3122
3247
  display: flex;
3123
3248
  flex-direction: column;
3124
3249
  gap: var(--aia-stack-space, 0.5rem);
@@ -3133,7 +3258,7 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
3133
3258
  align-items: end;
3134
3259
  }
3135
3260
  /* data-align="stretch" is the flex default \u2014 no rule needed. */
3136
- `,document.head.appendChild(e)}import{jsx as Qi}from"react/jsx-runtime";function da({space:e,align:o="stretch",className:a,children:i,...n}){let l=e?{"--aia-stack-space":e}:void 0;return Qi("div",{className:a?`aia-stack ${a}`:"aia-stack","data-align":o,style:l,...n,children:i})}import{jsx as X,jsxs as It}from"react/jsx-runtime";var io=[159,119,164],oo=()=>{},ca=()=>{},no=e=>{},ro=()=>{},so=e=>{},lo=e=>{},co=e=>{},po=e=>{};function ho(e){let o=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[a,i]=ao(o);if(je(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let n=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>i(n.matches);return n.addEventListener("change",l),()=>n.removeEventListener("change",l)},[e]),e!==void 0)return e==="auto"?a?"dark":"light":e}function uo(e,o){let a=Ye(null);je(()=>{let i=e.current,n=o.current;if(!i||!n)return;let l=i.querySelector(".aia-grid[data-scroll]");if(a.current&&a.current.grid!==l&&(a.current.controller.destroy(),a.current=null),l&&!a.current){a.current={grid:l,controller:Yi({dropdown:i,grid:l,button:n})};return}a.current?.controller.update()}),je(()=>()=>{a.current?.controller.destroy(),a.current=null},[])}function mo(e,o){let a=Ye(o);a.current=o;let i=Ye(null);je(()=>{let n=e.current;if(n){if(!i.current){i.current=ji({dropdown:n,isOpen:()=>a.current});return}i.current.update()}}),je(()=>()=>{i.current?.destroy(),i.current=null},[])}function Et({suggestions:e,activeIndex:o,onSelect:a,onHighlight:i,onUnhighlight:n,isOpen:l,id:r,className:d,pills:m,onPillClick:v,showPills:x=!0,onSkip:u,showSkipButton:c=!0,showOptionIcons:p=!0,showOptionImages:w=!0,showOptionCounts:I=!0,skipDisabled:M=!1,activeSelected:A=!1,isLoading:F=!1,skeletonExiting:K=!1,isInputEmpty:L=!1,language:E,products:y,onProductSelect:$,onProductAddToCart:q,onProductFocusChange:Z,productsLayout:z="row",productImageFallback:_="image",formatType:S="options",dateView:G=null,selectedDateIso:h=null,selectedDateRange:T=null,dateRangeStart:Te=null,onPreviousMonth:fe,onNextMonth:De,timeView:be=null,multiSelectView:g=null,onMultiSelectCommit:Me,onTimeChange:Pe,onTimeCommit:Ie,locationView:f=null,onLocationQuery:k,onLocationMove:C,onLocationCommit:P,onLocationFocusChange:R,isFocused:U=!1,optionsPosition:ie="below",mode:oe}){let ne=ho(oe),ze=ne!==void 0,ee=Ye(null),we=Ye(null);uo(ee,we),je(()=>{if(ee.current)return $i(ee.current)},[]);let Ke=e[0]?.options??[],et=!!(m&&m.length>0&&v),ve=!!(y&&y.length>0),Ne=S==="time"&&be!=null,qe=S==="location"&&f!=null,J=l&&(Ke.length>0||x&&et||F||ve||Ne||qe);mo(ee,J);let pe={suggestions:e,activeIndex:o,pills:m,showPills:x,showSkipButton:c,showOptionIcons:p,showOptionImages:w,showOptionCounts:I,skipDisabled:M,activeSelected:A,isLoading:F,skeletonExiting:K,isInputEmpty:L,products:y,formatType:S,dateView:G,selectedDateIso:h,selectedDateRange:T,dateRangeStart:Te,timeView:be,multiSelectView:g,locationView:f},xe=Ye(pe);J&&(xe.current=pe);let t=J?pe:xe.current,V=to(E),Ee=t.suggestions[0],re=Ee?.options??[],b=t.activeIndex>=0&&!!re[t.activeIndex]?.is_tappable,ye=eo(t.pills??[],V.keepTyping),Ae=!!(ye.length>0&&v),Le=t.showPills&&Ae,tt=t.showPills&&!Ae&&t.isLoading,_e=Le||tt,ke=Ae&&Xi(ye)&&t.showSkipButton&&!t.isInputEmpty&&!!u,Ue=ye[0]?.text,se=Ji(t.formatType)&&t.dateView!=null,he=re.length>0&&!se,Re=re.length>0&&se&&!t.isLoading,Fe=t.formatType==="time"&&t.timeView!=null&&!t.isLoading,Ve=t.formatType==="location"&&t.locationView!=null&&!t.isLoading,He=t.isLoading&&!he&&!Re&&!Fe&&!Ve,Be=t.products??[];return It("div",{ref:ee,id:r,role:"listbox","aria-multiselectable":!!t.multiSelectView,"data-aia-dropdown":"","data-options-position":ie,"data-mode":ne,"data-aia-loading":t.isLoading?"":void 0,"data-aia-skeleton-exiting":t.skeletonExiting?"":void 0,"data-aia-has-products":Be.length>0?"":void 0,className:`${ze?"magicx-aia ":""}${ue.dropdown} ${J?ue.visible:""} ${d??""}`,onMouseDown:s=>s.preventDefault(),children:[It(da,{space:"8px",children:[(_e||ke)&&It(nt,{noWrap:!0,className:ue.pillBar,"data-aia-pillbar":"",children:[_e&&X("span",{className:ue.pillScroll,"data-aia-pill-scroll":"",children:X(pt,{pills:ye,activePillIndex:0,activeSelected:t.activeSelected,onSelectPill:v??(()=>{}),rounded:!0,loading:t.isLoading})}),ke&&X("button",{type:"button",tabIndex:-1,className:ue.skip,"data-aia-skip":"",disabled:t.isLoading||t.skipDisabled,"aria-label":Ue?`${V.skipLabel} ${Ue}`:V.skipLabel,onClick:u,children:V.skip})]}),he&&X(na,{options:re,activeIndex:t.activeIndex,onSelect:a,onHighlight:i,onUnhighlight:n,listboxId:r,loading:t.isLoading,groupKey:Ee?`${Ee.parameter} ${Ee.text}`:"",optionsPosition:ie,showIcons:t.showOptionIcons,showImages:t.showOptionImages,showCounts:t.showOptionCounts,picked:t.isLoading?void 0:t.multiSelectView?.picked}),t.multiSelectView&&!t.isLoading&&X("div",{onClick:s=>{s.target.closest("[data-aia-multi-done]")&&!t.skipDisabled&&Me?.()},children:X("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:ue.multiDone,ref:s=>{s&&(s.disabled=!0,s.offsetHeight,s.disabled=t.skipDisabled)},children:V.done})}),Re&&t.dateView&&X(Kt,{options:re,activeIndex:t.activeIndex,listboxId:r,view:t.dateView,selection:{selectedIso:t.selectedDateIso??null,selectedRange:t.selectedDateRange??null,rangeStart:t.dateRangeStart??null,floor:Zi(t.formatType,t.dateRangeStart)},onSelect:a,onHighlight:i,onUnhighlight:n,onPreviousMonth:fe??ca,onNextMonth:De??ca}),Fe&&t.timeView&&X(la,{view:t.timeView,label:V.timeLabel,doneLabel:V.done,interactive:!t.skipDisabled,onTimeChange:Pe??no,onTimeCommit:Ie??ro}),Ve&&t.locationView&&X(Yt,{view:t.locationView,searchLabel:V.locationSearch,noResultsLabel:V.locationNoResults,useTypedLabel:V.locationUseTyped,widgetFocused:U&&J,visible:J,interactive:!t.skipDisabled,onQuery:k??so,onMove:C??lo,onCommit:P??co,onFocusChange:R??po}),He&&X("div",{className:ue.skeletonBars,"data-aia-skeleton-bars":"",children:io.map(s=>X("span",{className:ue.skeletonBar,style:{width:s}},`bar-${s}`))}),X(Zt,{products:Be,listboxId:r,onSelect:$??oo,onAddToCart:q,onFocusChange:Z,focusable:J,layout:z,imageFallback:_,strings:V}),X(_t,{isOptionHighlighted:b,isInputEmpty:t.isInputEmpty,strings:V})]}),X("button",{ref:we,type:"button",tabIndex:-1,className:ue.scrollArrow,"data-aia-scroll-arrow":"","aria-label":V.scrollArrow,"aria-hidden":"true",children:X("svg",{viewBox:"0 0 16 16",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:X("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Ao,ModeController as Lo,setCursorOffset as Ro,uiStringsFor as Oo,watchEditorHeight as Do}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as go}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.aia-submitButton-otz7H {
3261
+ `,document.head.appendChild(e)}import{jsx as Yi}from"react/jsx-runtime";function pa({space:e,align:o="stretch",className:t,children:a,...i}){let s=e?{"--aia-stack-space":e}:void 0;return Yi("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":o,style:s,...i,children:a})}import{jsx as te,jsxs as It}from"react/jsx-runtime";var po=typeof window>"u"?Ke:Et,ho=[159,119,164],uo=()=>{},ha=()=>{},mo=e=>{},go=()=>{},fo=e=>{},bo=e=>{},wo=e=>{},vo=e=>{};function xo(e){let o=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,a]=co(o);if(Ke(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let i=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>a(i.matches);return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function yo(e,o){let t=je(null);Ke(()=>{let a=e.current,i=o.current;if(!a||!i)return;let s=ro(a,".aia-grid[data-scroll]");if(t.current&&t.current.grid!==s&&(t.current.controller.destroy(),t.current=null),s&&!t.current){t.current={grid:s,controller:ji({dropdown:a,grid:s,button:i})};return}t.current?.controller.update()}),Ke(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function ko(e,o){let t=je(o);t.current=o;let a=je(null);Et(()=>{let i=e.current;if(i){if(!a.current){a.current=$i({dropdown:i,isOpen:()=>t.current});return}a.current.update()}}),Ke(()=>()=>{a.current?.destroy(),a.current=null},[])}function At({suggestions:e,activeIndex:o,onSelect:t,onHighlight:a,onUnhighlight:i,isOpen:s,id:r,className:l,pills:m,onPillClick:w,showPills:x=!0,onSkip:g,showSkipButton:c=!0,showOptionIcons:h=!0,showOptionImages:v=!0,showOptionCounts:E=!0,skipDisabled:F=!1,activeSelected:M=!1,isLoading:O=!1,skeletonExiting:V=!1,isInputEmpty:R=!1,language:D,products:S,onProductSelect:H,onProductAddToCart:U,onProductFocusChange:X,productsLayout:q="row",productImageFallback:_="image",formatType:T="options",dateView:B=null,selectedDateIso:he=null,selectedDateRange:se=null,dateRangeStart:ne=null,onPreviousMonth:d,onNextMonth:I,timeView:Ce=null,multiSelectView:f=null,onMultiSelectCommit:ze,onTimeChange:Ae,onTimeCommit:Re,locationView:b=null,isReediting:C=!1,onLocationQuery:P,onLocationMove:A,onLocationCommit:L,onLocationFocusChange:Q,isFocused:le=!1,optionsPosition:ae="below",mode:ue}){let Le=xo(ue),me=Le!==void 0,J=je(null),Ne=je(null);yo(J,Ne),Ke(()=>{if(J.current)return Zi(J.current)},[]);let et=e[0]?.options??[],Se=!!(m&&m.length>0&&w),Fe=!!(S&&S.length>0),Ge=T==="time"&&Ce!=null,Te=T==="location"&&b!=null,ee=s&&(et.length>0||x&&Se||O||Fe||Ge||Te);ko(J,ee),po(()=>{let k=J.current;k&&to(k,eo(k))});let ge={suggestions:e,activeIndex:o,pills:m,showPills:x,showSkipButton:c,showOptionIcons:h,showOptionImages:v,showOptionCounts:E,skipDisabled:F,activeSelected:M,isLoading:O,skeletonExiting:V,isInputEmpty:R,products:S,formatType:T,dateView:B,selectedDateIso:he,selectedDateRange:se,dateRangeStart:ne,timeView:Ce,multiSelectView:f,locationView:b,isReediting:C},y=je(ge);ee&&(y.current=ge);let n=ee?ge:y.current,Y=lo(D),fe=n.suggestions[0],u=fe?.options??[],qe=n.activeIndex>=0&&!!u[n.activeIndex]?.is_tappable,be=oo(n.pills??[],Y.keepTyping),we=!!(be.length>0&&w),_e=n.showPills&&we,tt=n.showPills&&!we&&n.isLoading,Pe=_e||tt,Ve=we&&ao(be)&&n.showSkipButton&&!n.isInputEmpty&&!!g,de=be[0]?.text,ve=io(n.formatType)&&n.dateView!=null,Oe=u.length>0&&!ve,He=u.length>0&&ve&&!n.isLoading,Ue=n.formatType==="time"&&n.timeView!=null&&!n.isLoading,De=n.formatType==="location"&&n.locationView!=null&&!n.isLoading,Qe=n.isLoading&&!Oe&&!He&&!Ue&&!De,p=n.products??[],z=no(_e?be:[]);return Et(()=>{J.current&&so(J.current,z,{visible:ee,anchorBottom:ae==="above"})},[z,ee,ae,n.suggestions,n.pills,n.isLoading,n.skeletonExiting,n.isInputEmpty,n.products,n.formatType,n.dateView,n.selectedDateIso,n.selectedDateRange,n.dateRangeStart,n.timeView,n.multiSelectView,n.locationView,n.showPills,n.showSkipButton,n.showOptionIcons,n.showOptionImages,n.showOptionCounts,q,D]),Ke(()=>{let k=J.current;return()=>{k&&Ji(k)}},[]),It("div",{ref:J,id:r,role:"listbox","aria-multiselectable":!!n.multiSelectView,"data-aia-dropdown":"","data-options-position":ae,"data-mode":Le,"data-aia-loading":n.isLoading?"":void 0,"data-aia-skeleton-exiting":n.skeletonExiting?"":void 0,"data-aia-has-products":p.length>0?"":void 0,className:`${me?"magicx-aia ":""}${xe.dropdown} ${ee?xe.visible:""} ${l??""}`,onMouseDown:k=>k.preventDefault(),children:[It(pa,{space:"8px",children:[(Pe||Ve)&&It(nt,{noWrap:!0,className:xe.pillBar,"data-aia-pillbar":"",children:[Pe&&te("span",{className:xe.pillScroll,"data-aia-pill-scroll":"",children:te(pt,{pills:be,activePillIndex:0,activeSelected:n.activeSelected,onSelectPill:w??(()=>{}),rounded:!0,loading:n.isLoading})}),Ve&&te("button",{type:"button",tabIndex:-1,className:xe.skip,"data-aia-skip":"",disabled:n.isLoading||n.skipDisabled,"aria-label":de?`${Y.skipLabel} ${de}`:Y.skipLabel,onClick:g,children:Y.skip})]}),Oe&&te(sa,{options:u,activeIndex:n.activeIndex,onSelect:t,onHighlight:a,onUnhighlight:i,listboxId:r,loading:n.isLoading,groupKey:fe?`${fe.parameter} ${fe.text}`:"",optionsPosition:ae,showIcons:n.showOptionIcons,showImages:n.showOptionImages,showCounts:n.showOptionCounts,picked:n.isLoading?void 0:n.multiSelectView?.picked}),n.multiSelectView&&!n.isLoading&&te("div",{onClick:k=>{k.target.closest("[data-aia-multi-done]")&&!n.skipDisabled&&ze?.()},children:te("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:xe.multiDone,ref:k=>{k&&(k.disabled=!0,k.offsetHeight,k.disabled=n.skipDisabled)},children:Y.done})}),He&&n.dateView&&te(qt,{options:u,activeIndex:n.activeIndex,listboxId:r,view:n.dateView,selection:{selectedIso:n.selectedDateIso??null,selectedRange:n.selectedDateRange??null,rangeStart:n.dateRangeStart??null,floor:Xi(n.formatType,n.dateRangeStart)},onSelect:t,onHighlight:a,onUnhighlight:i,onPreviousMonth:d??ha,onNextMonth:I??ha}),Ue&&n.timeView&&te(ca,{view:n.timeView,label:Y.timeLabel,doneLabel:Y.done,interactive:!n.skipDisabled,onTimeChange:Ae??mo,onTimeCommit:Re??go}),De&&n.locationView&&te($t,{view:n.locationView,searchLabel:Y.locationSearch,noResultsLabel:Y.locationNoResults,useTypedLabel:Y.locationUseTyped,widgetFocused:le&&ee,reediting:n.isReediting,visible:ee,interactive:!n.skipDisabled,onQuery:P??fo,onMove:A??bo,onCommit:L??wo,onFocusChange:Q??vo}),Qe&&te("div",{className:xe.skeletonBars,"data-aia-skeleton-bars":"",children:ho.map(k=>te("span",{className:xe.skeletonBar,style:{width:k}},`bar-${k}`))}),te(Jt,{products:p,listboxId:r,onSelect:H??uo,onAddToCart:U,onFocusChange:X,focusable:ee,layout:q,imageFallback:_,strings:Y}),te(Vt,{isOptionHighlighted:qe,isInputEmpty:n.isInputEmpty,strings:Y})]}),te("button",{ref:Ne,type:"button",tabIndex:-1,className:xe.scrollArrow,"data-aia-scroll-arrow":"","aria-label":Y.scrollArrow,"aria-hidden":"true",children:te("svg",{viewBox:"0 0 16 16",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:te("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Fo,ModeController as Ho,setCursorOffset as Bo,uiStringsFor as Wo,watchEditorHeight as Ko}from"@magicx-eng/ai-autocomplete-vanilla";import{uiStringsFor as Co}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.aia-submitButton-otz7H {
3137
3262
  flex-shrink: 0;
3138
3263
  width: 32px;
3139
3264
  height: 32px;
@@ -3204,5 +3329,5 @@ import{buildSubmitResult as Kr,cellDay as qr,cellIso as _r,DATE_RANGE_META_END a
3204
3329
  transition: none;
3205
3330
  }
3206
3331
  }
3207
- `,document.head.appendChild(e)}var pa={submitButton:"aia-submitButton-otz7H"};import{jsx as At}from"react/jsx-runtime";function ha({disabled:e,ready:o,onClick:a,label:i=go().submit}){return At("button",{type:"button","data-aia-submit":"",className:pa.submitButton,disabled:e,"data-aia-ready":o?"":void 0,onClick:n=>{n.stopPropagation(),a()},"aria-label":i,children:At("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":i,children:At("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as fo,dateSelectionFor as bo,identifiedParamLabel as wo,withoutTraditionalAutocomplete as vo}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as ba,useEffect as $e,useRef as j,useState as xo}from"react";import{useRef as ua}from"react";function ma(e){let o=ua(e);o.current=e;let a=Object.keys(e??{}).sort().join("\0"),i=ua({key:"",overrides:void 0});if(i.current.key!==a){let n={};for(let l of Object.keys(e??{})){let r=(d,m,v)=>{let x=o.current?.[l];return x?x(d,m,v):[]};n[l]=r}i.current={key:a,overrides:e?n:void 0}}return{overrides:i.current.overrides,key:a}}import{useRef as ga}from"react";function fa(e){let o=ga(e);o.current=e;let a=ga(null);a.current===null&&(a.current={fetch:(n,l)=>{let r=o.current;return r?r.fetch(n,l):Promise.reject(new Error("products config removed"))},transform:n=>o.current?.transform(n)??[],get limit(){return o.current?.limit}});let i=e!==void 0;return{config:i?a.current:void 0,enabled:i}}var wa={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],traditionalAutocomplete:!1,customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],dropdownLoading:!0,dropdownOptions:[],skeletonOptions:null,skeletonSuggestion:null,dropdownSuggestion:null,skeletonRequested:!1,skeletonExiting:!1,activeFormatType:"options",dateView:null,dateRangeStart:null,dateFloor:null,timeView:null,multiSelectView:null,multiSelectDraft:null,locationView:null,locationSearch:null,locationAutocomplete:!0,locationFieldFocused:!1,placeholderText:"",leadInText:"",optionQuery:"",isSearchingOptions:!1,isDropdownOpen:!1,isActivePillSelected:!1,filterBase:0,filterInProgress:!1,pillTapped:!1,skipNextFetch:!1,lastRawQuery:"",isFocused:!1,dropdownHeld:!1,editingParam:null,editingIdentified:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1,dateViewMonth:null,pendingRangeStart:null,timeDraft:null};function Lt({onSubmit:e,onResult:o,onError:a,optionOverrides:i,maskCompletedText:n,apiConfig:l,additionalContext:r,language:d,currency:m,productId:v,visitorId:x,columns:u=2,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:w,prependPlaceholder:I,showNonTappableOptions:M,locationSearch:A,showOptionIcons:F,showOptionImages:K,showOptionCounts:L,showSkipButton:E,showProducts:y,productImageFallback:$="image",onFocus:q,onBlur:Z,value:z,completedParams:_,onChange:S,onParamsChange:G,products:h,mapProducts:T,onProductSelect:Te,onProductAddToCart:fe,source:De,setCursor:be}){let g=j(null),[Me,Pe]=xo(null),Ie=j(e);Ie.current=e;let f=j(o);f.current=o;let k=j(a);k.current=a;let C=j(S);C.current=S;let P=j(G);P.current=G;let R=j(q);R.current=q;let U=j(Z);U.current=Z;let ie=j(be);ie.current=be;let oe=j(Te);oe.current=Te;let ne=j(fe);ne.current=fe;let ze=j(x);ze.current=x;let ee=j(()=>{let s=ze.current;return typeof s=="function"?s():s}).current,we=fa(h),Ke=j(T);Ke.current=T;let et=j((s,N)=>{let D=Ke.current;return D?D(s,N):s}).current,ve=T?et:void 0,Ne=ma(i);$e(()=>{if(typeof document>"u")return;let s=new fo(document.createElement("div"),{renderMode:"headless",apiConfig:l,additionalContext:r,language:d,currency:m,productId:v,visitorId:ee,optionOverrides:Ne.overrides,maskCompletedText:n,columns:u,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:w,prependPlaceholder:I,showNonTappableOptions:M,locationSearch:A,showProducts:y,source:De,value:z,completedParams:_,onSubmit:(...D)=>Ie.current?.(...D),onResult:(...D)=>f.current?.(...D),onError:(...D)=>k.current?.(...D),onChange:(...D)=>C.current?.(...D),onParamsChange:(...D)=>P.current?.(...D),onFocus:()=>R.current?.(),onBlur:()=>U.current?.(),onProductSelect:D=>oe.current?.(D),onProductAddToCart:D=>ne.current?.(D),setCursor:D=>ie.current?.(D),products:we.config,mapProducts:ve});g.current=s,Pe(s.getState());let N=s.subscribe(D=>Pe(D));return()=>{N(),s.destroy(),g.current===s&&(g.current=null)}},[]),$e(()=>{z!==void 0&&g.current?.setValue(z)},[z]),$e(()=>{_!==void 0&&g.current?.setCompletedParams(_)},[_]);let qe=JSON.stringify(l??null),J;try{J=JSON.stringify(r??null)}catch{J="[unstringifiable]"}$e(()=>{g.current?.update({apiConfig:l,additionalContext:r,language:d,currency:m,productId:v,optionOverrides:Ne.overrides,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:w,prependPlaceholder:I,showNonTappableOptions:M,locationSearch:A,showProducts:y})},[qe,J,d,m?.code,m?.rate,m?.country,v,Ne.key,c,p,w,I,M,A,y]);let pe=j(!1);$e(()=>{if(!pe.current){pe.current=!0;return}g.current?.update({products:we.config})},[we.enabled]),$e(()=>{g.current?.update({mapProducts:ve})},[ve]);let xe=j(null);xe.current===null&&(xe.current={handleTextChange:s=>g.current?.handleTextChange(s),handleKeyDown:s=>{let N="nativeEvent"in s?s.nativeEvent:s;g.current?.handleKeyDown(N)},setFocused:s=>g.current?.setFocused(s),startEditingParam:s=>g.current?.startEditingParam(s),exitEditMode:()=>g.current?.exitEditMode(),handleCaretAfterInput:s=>g.current?.handleCaretAfterInput(s),handleCaretMove:s=>g.current?.handleCaretMove(s),replaceEditingRange:s=>g.current?.replaceEditingRange(s)??!1,setActivePill:s=>g.current?.setActivePill(s),skipActivePill:()=>g.current?.skipActivePill(),removeLastParam:()=>g.current?.removeLastParam(),clearNewParamId:()=>g.current?.clearNewParamId(),reset:()=>g.current?.reset(),refreshProducts:()=>g.current?.refreshProducts(),prepareSubmit:()=>g.current?.prepareSubmit(),getState:()=>g.current?.getState()??wa,recordSubmit:s=>g.current?.recordSubmit(s),selectOption:(s,N)=>g.current?.selectOption(s,N),selectProduct:s=>g.current?.selectProduct(s),addProductToCart:s=>{let N=g.current;return!N||!ne.current?Promise.resolve():N.addProductToCart(s)},setActiveDropdownIndex:s=>g.current?.setActiveDropdownIndex(s),clearHighlight:s=>g.current?.clearHighlight(s),showPreviousMonth:()=>g.current?.showPreviousMonth(),showNextMonth:()=>g.current?.showNextMonth(),setTime:s=>g.current?.setTime(s),commitTime:()=>g.current?.commitTime(),toggleMultiSelectOption:s=>g.current?.toggleMultiSelectOption(s),commitMultiSelect:()=>g.current?.commitMultiSelect(),setLocationQuery:s=>g.current?.setLocationQuery(s),moveLocationHighlight:s=>g.current?.moveLocationHighlight(s),commitLocation:s=>g.current?.commitLocation(s),setLocationFieldFocused:s=>g.current?.setLocationFieldFocused(s),handleFocus:()=>g.current?.setFocused(!0),handleBlur:()=>g.current?.setFocused(!1)});let t=xe.current,V=ba(s=>{let N=s.target.value,lt=N.length>0&&!s.nativeEvent?.isComposing&&N[0]!==N[0].toUpperCase()?N[0].toUpperCase()+N.slice(1):N;g.current?.handleTextChange(lt)},[]),Ee=ba(s=>{g.current?.handleKeyDown(s.nativeEvent)},[]),re=g.current,b=Me??wa,ye=z!==void 0?z:b.text,Ae=_!==void 0?_:b.completedParams,Le=b.actionableSuggestions,tt=Le[0],_e=vo(Le),ke=re?.listboxId??"",Ue=b.activeDropdownIndex>=0&&re?`${ke}-option-${b.activeDropdownIndex}`:void 0,se=b.editingParam,he=b.editingIdentified,Re=se?{parameter:se.suggestionParameter,text:se.suggestionPlaceholder,required:!0,options:se.options}:he?{parameter:he.parameter,text:wo(he.parameter),required:!0,options:[]}:null,Fe=b.dropdownSuggestion??Re??tt,Ve=Re?[Re]:Le,He=bo(b),Be=!re||b.dropdownLoading;return{completedParams:Ae,multiSelectView:b.multiSelectView,toggleMultiSelectOption:t.toggleMultiSelectOption,commitMultiSelect:t.commitMultiSelect,skippedParams:b.skippedParams,identifiedParams:b.identifiedParams,suggestionPills:_e,setActivePill:t.setActivePill,skipActivePill:t.skipActivePill,removeLastParam:t.removeLastParam,segments:b.segments,newParamId:b.newParamId,clearNewParamId:t.clearNewParamId,suggestions:b.suggestions,activeIndex:b.activeDropdownIndex,isReady:b.isReady,isLoading:Be,isFocused:b.isFocused,isDropdownOpen:b.isDropdownOpen,isActivePillSelected:b.isActivePillSelected,placeholderText:b.placeholderText,listboxId:ke,error:b.error,products:b.products,customFields:b.customFields,selectProduct:t.selectProduct,addProductToCart:t.addProductToCart,handleTextChange:t.handleTextChange,handleKeyDown:t.handleKeyDown,setFocused:t.setFocused,editingParam:se,editingIdentified:he,editingAnchor:b.editingAnchor,caretOffset:b.caretOffset,startEditingParam:t.startEditingParam,exitEditMode:t.exitEditMode,handleCaretAfterInput:t.handleCaretAfterInput,handleCaretMove:t.handleCaretMove,replaceEditingRange:t.replaceEditingRange,inputProps:{value:ye,placeholder:b.placeholderText||void 0,onChange:V,onKeyDown:Ee,onFocus:t.handleFocus,onBlur:t.handleBlur,role:"combobox","aria-expanded":b.isDropdownOpen,"aria-activedescendant":Ue,"aria-autocomplete":"list","aria-controls":ke},reset:t.reset,refreshProducts:t.refreshProducts,prepareSubmit:t.prepareSubmit,getState:t.getState,recordSubmit:t.recordSubmit,dropdownProps:{suggestions:Fe?[{...Fe,options:b.dropdownOptions}]:[],activeIndex:b.activeDropdownIndex,onSelect:t.selectOption,onHighlight:t.setActiveDropdownIndex,onUnhighlight:t.clearHighlight,isOpen:b.isDropdownOpen,id:ke,pills:Ve,activeSelected:b.isActivePillSelected,onPillClick:t.setActivePill,onSkip:t.skipActivePill,showSkipButton:(E??!0)&&!se&&!he,showOptionIcons:F??!0,showOptionImages:K??!0,showOptionCounts:L??!0,skipDisabled:b.inSelectionAnimation,isLoading:Be,skeletonExiting:b.skeletonExiting,isInputEmpty:ye.trim().length===0,language:d,products:b.products,productImageFallback:$,onProductSelect:t.selectProduct,onProductAddToCart:fe?t.addProductToCart:void 0,onProductFocusChange:t.setFocused,formatType:b.activeFormatType,dateView:b.dateView,selectedDateIso:He.selectedIso,selectedDateRange:He.selectedRange,dateRangeStart:He.rangeStart,onPreviousMonth:t.showPreviousMonth,onNextMonth:t.showNextMonth,timeView:b.timeView,multiSelectView:b.multiSelectView,onMultiSelectCommit:t.commitMultiSelect,onTimeChange:t.setTime,onTimeCommit:t.commitTime,locationView:b.locationView,onLocationQuery:t.setLocationQuery,onLocationMove:t.moveLocationHighlight,onLocationCommit:t.commitLocation,onLocationFocusChange:t.setLocationFieldFocused,isFocused:b.isFocused||b.locationFieldFocused,optionsPosition:p??"below"}}}import{chipIdFromTap as yo,extractPlainText as va,getCursorOffset as xa,keepCaretOnChip as ko,plainTextLength as Co,renderEditableContent as So,setCursorOffset as ya}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as ce,useEffect as ft,useLayoutEffect as Rt,useRef as Ze}from"react";var bt;function To(){if(bt!==void 0)return bt;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),bt=e.contentEditable==="plaintext-only",bt}function ka(e){let{segments:o,showChipIcons:a=!0,showChipImages:i=!0,newParamId:n,editingParam:l,editingIdentified:r,editingAnchor:d,caretOffset:m,placeholderText:v,isFocused:x,isDropdownOpen:u,listboxId:c,activeDescendantId:p,autoFocus:w,handleTextChange:I,handleKeyDown:M,handleCaretAfterInput:A,handleCaretMove:F,startEditingParam:K,replaceEditingRange:L,setFocused:E}=e,y=Ze(null),$=Ze(!1),q=Ze(""),Z=Ze(""),z=Ze(null),_=Ze(0);z.current=m,ft(()=>{if(!w)return;let f=y.current;if(!f)return;document.activeElement===f?E(!0):f.focus();let k=f.ownerDocument??document,C=k.getSelection(),P=C&&C.rangeCount>0&&f.contains(C.anchorNode);if(C&&!P){let R=k.createRange();R.selectNodeContents(f),R.collapse(!0),C.removeAllRanges(),C.addRange(R)}},[w,E]),ft(()=>{let f=y.current;if(!f)return;let k=f.ownerDocument??document,C=()=>{let P=k.getSelection();if(!P||P.rangeCount===0||!P.anchorNode||!f.contains(P.anchorNode))return;let R=P.anchorNode,U=R.nodeType===Node.ELEMENT_NODE?R:R.parentElement,oe=(P.isCollapsed?U?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,ne=l?.id??r?.id??null;if(oe&&oe!==ne){K(oe);return}performance.now()-_.current<50||F(xa(f))};return k.addEventListener("selectionchange",C),()=>k.removeEventListener("selectionchange",C)},[l,r,K,F]),ft(()=>{let f=y.current;if(!f)return;let k=C=>{let P=yo(f,C.target);P&&(K(P),ko(f,P))};return f.addEventListener("click",k),()=>f.removeEventListener("click",k)},[K]),Rt(()=>{let f=y.current;f&&So({input:f,segments:o,newParamId:n,editingParamId:l?.id??null,placeholderText:v??"",isFocused:x,showChipIcons:a,showChipImages:i})},[o,n,l,v,x,a,i]),Rt(()=>{let f=q.current,k=n??"";if(q.current=k,!k||k===f)return;let C=y.current;if(!C)return;C.focus();let P=z.current??Co(C);ya(C,P)},[n]),Rt(()=>{let f=Z.current,k=l?.id??"";if(Z.current=k,!k||k===f||d==null)return;let C=y.current;C&&ya(C,d)},[l,d]);let S=ce(()=>{if($.current)return;let f=y.current;if(!f)return;let k=va(f),P=k.length>0&&k[0]!==k[0].toUpperCase()?k[0].toUpperCase()+k.slice(1):k;I(P)},[I]),G=ce(()=>{_.current=performance.now(),S();let f=y.current;f&&A(xa(f))},[S,A]);ft(()=>{let f=y.current;if(!f)return;let k=C=>{let P=C,R=P.inputType;if(R==="insertParagraph"||R==="insertLineBreak"||R==="insertFromDrop"){C.preventDefault();return}if(R.startsWith("insert")||R.startsWith("delete")){let U=R.startsWith("delete")?"":P.data??"";L(U)&&C.preventDefault()}};return f.addEventListener("beforeinput",k),()=>f.removeEventListener("beforeinput",k)},[L]);let h=ce(()=>{$.current=!0,y.current?.setAttribute("data-aia-composing","true")},[]),T=ce(()=>{$.current=!1,y.current?.removeAttribute("data-aia-composing"),S()},[S]),Te=ce(f=>{f.preventDefault();let k=y.current;if(!k)return;let C=(f.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!C)return;let P=k.ownerDocument??document,R=P.getSelection();if(!R||R.rangeCount===0)return;let U=R.getRangeAt(0);if(!k.contains(U.startContainer))return;U.deleteContents();let ie=P.createTextNode(C);U.insertNode(ie),U.setStartAfter(ie),U.collapse(!0),R.removeAllRanges(),R.addRange(U),S()},[S]),fe=ce(f=>M(f),[M]),De=ce(()=>E(!0),[E]),be=ce(()=>E(!1),[E]),g=ce(()=>y.current?.focus(),[]),Me=ce(()=>y.current?.blur(),[]),Pe=ce(()=>{let f=y.current;return f?va(f):""},[]),Ie=To()?"plaintext-only":"true";return{inputRef:y,editorProps:{ref:y,contentEditable:Ie,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":c,"aria-expanded":u,"aria-activedescendant":p,spellCheck:!0,enterKeyHint:"send",onInput:G,onKeyDown:fe,onCompositionStart:h,onCompositionEnd:T,onPaste:Te,onFocus:De,onBlur:be},getPlainText:Pe,focus:g,blur:Me}}import{jsx as Je,jsxs as Mt}from"react/jsx-runtime";function Mo(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var zo=Po(function({onSubmit:o,onResult:a,onError:i,optionOverrides:n,maskCompletedText:l,className:r,apiConfig:d,additionalContext:m,language:v,currency:x,productId:u,visitorId:c,columns:p,pillPlacement:w="dropdown",mode:I="auto",optionsPosition:M="below",animations:A=!0,dropdownTrigger:F,closeDropdownOnBlur:K,prependPlaceholder:L,showNonTappableOptions:E,locationSearch:y,showOptionIcons:$=!0,showChipIcons:q=!0,showChipImages:Z=!0,showOptionImages:z=!0,showOptionCounts:_=!0,showSkipButton:S,showProducts:G,productsLayout:h,productImageFallback:T,autoFocus:Te=!0,onFocus:fe,onBlur:De,value:be,completedParams:g,onChange:Me,onParamsChange:Pe,products:Ie,mapProducts:f,onProductSelect:k,onProductAddToCart:C,submitButton:P,resetOnSubmit:R=!0},U){let ie=Xe(null),oe=Xe(null),ne=Xe(null),ze=Xe(()=>{}),ee=Xe(null),we=Xe(null);Dt(()=>{let O=ie.current;if(O)return ee.current?ee.current.setMode(I):ee.current=new Lo(O,I),()=>{ee.current?.destroy(),ee.current=null}},[I]);let Ke=Ot(O=>{let te=we.current?.current;te&&(te.focus(),Ro(te,O))},[]),{completedParams:et,suggestionPills:ve,setActivePill:Ne,skipActivePill:qe,segments:J,newParamId:pe,clearNewParamId:xe,placeholderText:t,isFocused:V,isDropdownOpen:Ee,isActivePillSelected:re,isLoading:b,isReady:ye,activeIndex:Ae,listboxId:Le,handleTextChange:tt,handleKeyDown:_e,setFocused:ke,editingParam:Ue,editingIdentified:se,editingAnchor:he,caretOffset:Re,startEditingParam:Fe,handleCaretAfterInput:Ve,handleCaretMove:He,replaceEditingRange:Be,dropdownProps:s,reset:N,refreshProducts:D,prepareSubmit:lt,getState:zt,recordSubmit:Nt}=Lt({onSubmit:O=>ze.current(O),onResult:a,onError:i,optionOverrides:n,maskCompletedText:l,apiConfig:d,additionalContext:m,language:v,currency:x,productId:u,visitorId:c,columns:p,dropdownTrigger:F,optionsPosition:M,closeDropdownOnBlur:K,prependPlaceholder:L,showNonTappableOptions:E,locationSearch:y,showOptionIcons:$,showOptionImages:z,showOptionCounts:_,showSkipButton:S,showProducts:G,onFocus:fe,onBlur:De,value:be,completedParams:g,onChange:Me,onParamsChange:Pe,products:Ie,mapProducts:f,onProductSelect:k,onProductAddToCart:C,source:"full-sdk",setCursor:Ke});Dt(()=>{if(!pe)return;let O=window.setTimeout(()=>xe(),650);return()=>window.clearTimeout(O)},[pe,xe]);let Ca=Ae>=0?`${Le}-option-${Ae}`:void 0,{inputRef:wt,editorProps:Sa,focus:dt,blur:Ft,getPlainText:Ht}=ka({segments:J,newParamId:pe,editingParam:Ue,editingIdentified:se,editingAnchor:he,caretOffset:Re,placeholderText:t,isFocused:V,showChipIcons:q,showChipImages:Z,isDropdownOpen:Ee,listboxId:Le,activeDescendantId:Ca,autoFocus:Te,handleTextChange:tt,handleKeyDown:_e,handleCaretAfterInput:Ve,handleCaretMove:He,startEditingParam:Fe,replaceEditingRange:Be,setFocused:ke});we.current=wt,Eo(()=>{let O=oe.current,te=wt.current;if(!O||!te)return;let it=()=>{let Wt=O.firstElementChild;if(!Wt)return;let Ea=Wt.getBoundingClientRect(),Aa=te.getBoundingClientRect();Ea.top>=Aa.bottom-2?O.setAttribute("data-aia-pill-wrapped",""):O.removeAttribute("data-aia-pill-wrapped")};it();let Bt=new ResizeObserver(it);return Bt.observe(te),()=>Bt.disconnect()},[J,ve.length,b,wt]),Dt(()=>{let O=ne.current;if(O)return Do(O)},[]),Io(U,()=>({focus:dt,blur:Ft,reset:N,refreshProducts:D,setMode:O=>ee.current?.setMode(O),skipActivePill:qe}),[dt,Ft,N,D,qe]);let at=!!J.length||et.length>0,vt=Ot(O=>{if(!at)return;O&&lt();let te=zt(),it=Ao(Ht(),te.completedParams,te.skippedParams,{identifiedParams:te.identifiedParams,isReady:te.isReady,customFields:te.customFields});O&&Nt(it),o(it),R&&N()},[Nt,R,at,lt,zt,o,N,Ht]);ze.current=()=>vt(!1);let Ta=Ot(O=>{O.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||dt()},[dt]),Pa=w==="inline",Ia=w==="dropdown";return Mt("div",{ref:ie,className:`magicx-aia ${We.container} ${r??""}`,"data-pill-placement":w,"data-options-position":M,"data-animations":A?"on":"off","data-mode":Mo(I),children:[Je(Et,{...s,showPills:Ia,productsLayout:h,productImageFallback:T}),Mt("div",{className:We.inputWrapper,"data-aia-input-wrapper":"",onClick:Ta,children:[Mt("div",{ref:ne,className:We.editorArea,"data-aia-editor":"",children:[Je("div",{...Sa,className:We.input,"data-aia-input":""}),Pa&&(b||ve.length>0)&&Je("span",{ref:oe,className:We.pillListContainer,"data-aia-pill-list-container":"",children:Je(pt,{pills:ve,activePillIndex:0,activeSelected:re,onSelectPill:Ne,loading:b})})]}),P===null?null:P===void 0?Je(ha,{disabled:!at,ready:at&&ye,onClick:()=>vt(!0),label:Oo(v).submit}):Je("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:We.submitSlot,onClick:O=>{at&&(O.stopPropagation(),vt(!0))},children:P})]})]})});export{zo as AIAutocomplete,Et as AIAutocompleteDropdown,Ur as DATE_RANGE_META_END,Vr as DATE_RANGE_META_START,Qr as DEFAULT_OPTION_COUNT_UNIT,ts as LOCATION_META_KEY,ds as PRODUCT_PATH_PREFIX,vs as TIME_META_KEY,ys as WEEKDAY_LABELS,Kr as buildSubmitResult,qr as cellDay,_r as cellIso,Yr as dateCellMarks,jr as formatDate,$r as formatDateRange,Zr as formatOptionCount,Xr as formatPlace,Jr as formatTime,es as isoDate,as as monthLabel,is as optionCountLabel,os as optionHasImage,ns as optionImageSources,rs as optionImageSrc,ss as optionLabel,ls as optionsShowLeadingVisuals,cs as parseDate,ps as parseLooseDate,hs as parseLooseDateRange,us as parseTime,ms as productFromMatchedItem,gs as productImageSources,fs as productsFromCustomFields,bs as sanitizeOptionIconSvg,ws as selectedRangeFor,Lt as useAIAutocomplete,xs as visibleDateRange,ks as withSkippedParams};
3332
+ `,document.head.appendChild(e)}var ua={submitButton:"aia-submitButton-otz7H"};import{jsx as Rt}from"react/jsx-runtime";function ma({disabled:e,ready:o,onClick:t,label:a=Co().submit}){return Rt("button",{type:"button","data-aia-submit":"",className:ua.submitButton,disabled:e,"data-aia-ready":o?"":void 0,onClick:i=>{i.stopPropagation(),t()},"aria-label":a,children:Rt("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":a,children:Rt("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}import{AIAutocomplete as So,dateSelectionFor as To,identifiedParamLabel as Po,withoutTraditionalAutocomplete as Io}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as va,useEffect as $e,useRef as Z,useState as Eo}from"react";import{useRef as ga}from"react";function fa(e){let o=ga(e);o.current=e;let t=Object.keys(e??{}).sort().join("\0"),a=ga({key:"",overrides:void 0});if(a.current.key!==t){let i={};for(let s of Object.keys(e??{})){let r=(l,m,w)=>{let x=o.current?.[s];return x?x(l,m,w):[]};i[s]=r}a.current={key:t,overrides:e?i:void 0}}return{overrides:a.current.overrides,key:t}}import{useRef as ba}from"react";function wa(e){let o=ba(e);o.current=e;let t=ba(null);t.current===null&&(t.current={fetch:(i,s)=>{let r=o.current;return r?r.fetch(i,s):Promise.reject(new Error("products config removed"))},transform:i=>o.current?.transform(i)??[],get limit(){return o.current?.limit}});let a=e!==void 0;return{config:a?t.current:void 0,enabled:a}}var xa={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],traditionalAutocomplete:!1,customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],dropdownLoading:!0,dropdownOptions:[],skeletonOptions:null,skeletonSuggestion:null,dropdownSuggestion:null,skeletonRequested:!1,skeletonExiting:!1,activeFormatType:"options",dateView:null,dateRangeStart:null,dateFloor:null,timeView:null,multiSelectView:null,multiSelectDraft:null,locationView:null,locationSearch:null,locationAutocomplete:!0,locationFieldFocused:!1,placeholderText:"",leadInText:"",optionQuery:"",isSearchingOptions:!1,isDropdownOpen:!1,isActivePillSelected:!1,filterBase:0,filterInProgress:!1,pillTapped:!1,skipNextFetch:!1,lastRawQuery:"",isFocused:!1,dropdownHeld:!1,editingParam:null,editingIdentified:null,editingAnchor:null,editingTail:null,caretOffset:null,inSelectionAnimation:!1,dateViewMonth:null,pendingRangeStart:null,timeDraft:null};function Lt({onSubmit:e,onResult:o,onError:t,optionOverrides:a,maskCompletedText:i,apiConfig:s,additionalContext:r,language:l,currency:m,productId:w,visitorId:x,columns:g=2,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:E,showNonTappableOptions:F,locationSearch:M,showOptionIcons:O,showOptionImages:V,showOptionCounts:R,showSkipButton:D,showProducts:S,productImageFallback:H="image",onFocus:U,onBlur:X,value:q,completedParams:_,onChange:T,onParamsChange:B,products:he,mapProducts:se,onProductSelect:ne,onProductAddToCart:d,source:I,setCursor:Ce}){let f=Z(null),[ze,Ae]=Eo(null),Re=Z(e);Re.current=e;let b=Z(o);b.current=o;let C=Z(t);C.current=t;let P=Z(T);P.current=T;let A=Z(B);A.current=B;let L=Z(U);L.current=U;let Q=Z(X);Q.current=X;let le=Z(Ce);le.current=Ce;let ae=Z(ne);ae.current=ne;let ue=Z(d);ue.current=d;let Le=Z(x);Le.current=x;let me=Z(()=>{let p=Le.current;return typeof p=="function"?p():p}).current,J=wa(he),Ne=Z(se);Ne.current=se;let et=Z((p,z)=>{let k=Ne.current;return k?k(p,z):p}).current,Se=se?et:void 0,Fe=fa(a);$e(()=>{if(typeof document>"u")return;let p=new So(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:l,currency:m,productId:w,visitorId:me,optionOverrides:Fe.overrides,maskCompletedText:i,columns:g,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:E,showNonTappableOptions:F,locationSearch:M,showProducts:S,source:I,value:q,completedParams:_,onSubmit:(...k)=>Re.current?.(...k),onResult:(...k)=>b.current?.(...k),onError:(...k)=>C.current?.(...k),onChange:(...k)=>P.current?.(...k),onParamsChange:(...k)=>A.current?.(...k),onFocus:()=>L.current?.(),onBlur:()=>Q.current?.(),onProductSelect:k=>ae.current?.(k),onProductAddToCart:k=>ue.current?.(k),setCursor:k=>le.current?.(k),products:J.config,mapProducts:Se});f.current=p,Ae(p.getState());let z=p.subscribe(k=>Ae(k));return()=>{z(),p.destroy(),f.current===p&&(f.current=null)}},[]),$e(()=>{q!==void 0&&f.current?.setValue(q)},[q]),$e(()=>{_!==void 0&&f.current?.setCompletedParams(_)},[_]);let Ge=JSON.stringify(s??null),Te;try{Te=JSON.stringify(r??null)}catch{Te="[unstringifiable]"}$e(()=>{f.current?.update({apiConfig:s,additionalContext:r,language:l,currency:m,productId:w,optionOverrides:Fe.overrides,dropdownTrigger:c,optionsPosition:h,closeDropdownOnBlur:v,prependPlaceholder:E,showNonTappableOptions:F,locationSearch:M,showProducts:S})},[Ge,Te,l,m?.code,m?.rate,m?.country,w,Fe.key,c,h,v,E,F,M,S]);let ee=Z(!1);$e(()=>{if(!ee.current){ee.current=!0;return}f.current?.update({products:J.config})},[J.enabled]),$e(()=>{f.current?.update({mapProducts:Se})},[Se]);let ge=Z(null);ge.current===null&&(ge.current={handleTextChange:p=>f.current?.handleTextChange(p),handleKeyDown:p=>{let z="nativeEvent"in p?p.nativeEvent:p;f.current?.handleKeyDown(z)},setFocused:p=>f.current?.setFocused(p),startEditingParam:p=>f.current?.startEditingParam(p),exitEditMode:()=>f.current?.exitEditMode(),handleCaretAfterInput:p=>f.current?.handleCaretAfterInput(p),handleCaretMove:p=>f.current?.handleCaretMove(p),replaceEditingRange:p=>f.current?.replaceEditingRange(p)??!1,setActivePill:p=>f.current?.setActivePill(p),skipActivePill:()=>f.current?.skipActivePill(),removeLastParam:()=>f.current?.removeLastParam(),clearNewParamId:()=>f.current?.clearNewParamId(),reset:()=>f.current?.reset(),refreshProducts:()=>f.current?.refreshProducts(),prepareSubmit:()=>f.current?.prepareSubmit(),getState:()=>f.current?.getState()??xa,recordSubmit:p=>f.current?.recordSubmit(p),selectOption:(p,z)=>f.current?.selectOption(p,z),selectProduct:p=>f.current?.selectProduct(p),addProductToCart:p=>{let z=f.current;return!z||!ue.current?Promise.resolve():z.addProductToCart(p)},setActiveDropdownIndex:p=>f.current?.setActiveDropdownIndex(p),clearHighlight:p=>f.current?.clearHighlight(p),showPreviousMonth:()=>f.current?.showPreviousMonth(),showNextMonth:()=>f.current?.showNextMonth(),setTime:p=>f.current?.setTime(p),commitTime:()=>f.current?.commitTime(),toggleMultiSelectOption:p=>f.current?.toggleMultiSelectOption(p),commitMultiSelect:()=>f.current?.commitMultiSelect(),setLocationQuery:p=>f.current?.setLocationQuery(p),moveLocationHighlight:p=>f.current?.moveLocationHighlight(p),commitLocation:p=>f.current?.commitLocation(p),setLocationFieldFocused:p=>f.current?.setLocationFieldFocused(p),handleFocus:()=>f.current?.setFocused(!0),handleBlur:()=>f.current?.setFocused(!1)});let y=ge.current,n=va(p=>{let z=p.target.value,lt=z.length>0&&!p.nativeEvent?.isComposing&&z[0]!==z[0].toUpperCase()?z[0].toUpperCase()+z.slice(1):z;f.current?.handleTextChange(lt)},[]),Y=va(p=>{f.current?.handleKeyDown(p.nativeEvent)},[]),fe=f.current,u=ze??xa,qe=q!==void 0?q:u.text,be=_!==void 0?_:u.completedParams,we=u.actionableSuggestions,_e=we[0],tt=Io(we),Pe=fe?.listboxId??"",Ve=u.activeDropdownIndex>=0&&fe?`${Pe}-option-${u.activeDropdownIndex}`:void 0,de=u.editingParam,ve=u.editingIdentified,Oe=de?{parameter:de.suggestionParameter,text:de.suggestionPlaceholder,required:!0,options:de.options}:ve?{parameter:ve.parameter,text:Po(ve.parameter),required:!0,options:[]}:null,He=u.dropdownSuggestion??Oe??_e,Ue=Oe?[Oe]:we,De=To(u),Qe=!fe||u.dropdownLoading;return{completedParams:be,multiSelectView:u.multiSelectView,toggleMultiSelectOption:y.toggleMultiSelectOption,commitMultiSelect:y.commitMultiSelect,skippedParams:u.skippedParams,identifiedParams:u.identifiedParams,suggestionPills:tt,setActivePill:y.setActivePill,skipActivePill:y.skipActivePill,removeLastParam:y.removeLastParam,segments:u.segments,newParamId:u.newParamId,clearNewParamId:y.clearNewParamId,suggestions:u.suggestions,activeIndex:u.activeDropdownIndex,isReady:u.isReady,isLoading:Qe,isFocused:u.isFocused,isDropdownOpen:u.isDropdownOpen,isActivePillSelected:u.isActivePillSelected,placeholderText:u.placeholderText,listboxId:Pe,error:u.error,products:u.products,customFields:u.customFields,selectProduct:y.selectProduct,addProductToCart:y.addProductToCart,handleTextChange:y.handleTextChange,handleKeyDown:y.handleKeyDown,setFocused:y.setFocused,editingParam:de,editingIdentified:ve,editingAnchor:u.editingAnchor,caretOffset:u.caretOffset,startEditingParam:y.startEditingParam,exitEditMode:y.exitEditMode,handleCaretAfterInput:y.handleCaretAfterInput,handleCaretMove:y.handleCaretMove,replaceEditingRange:y.replaceEditingRange,inputProps:{value:qe,placeholder:u.placeholderText||void 0,onChange:n,onKeyDown:Y,onFocus:y.handleFocus,onBlur:y.handleBlur,role:"combobox","aria-expanded":u.isDropdownOpen,"aria-activedescendant":Ve,"aria-autocomplete":"list","aria-controls":Pe},reset:y.reset,refreshProducts:y.refreshProducts,prepareSubmit:y.prepareSubmit,getState:y.getState,recordSubmit:y.recordSubmit,dropdownProps:{suggestions:He?[{...He,options:u.dropdownOptions}]:[],activeIndex:u.activeDropdownIndex,onSelect:y.selectOption,onHighlight:y.setActiveDropdownIndex,onUnhighlight:y.clearHighlight,isOpen:u.isDropdownOpen,id:Pe,pills:Ue,activeSelected:u.isActivePillSelected,onPillClick:y.setActivePill,onSkip:y.skipActivePill,showSkipButton:(D??!0)&&!de&&!ve,showOptionIcons:O??!0,showOptionImages:V??!0,showOptionCounts:R??!0,skipDisabled:u.inSelectionAnimation,isLoading:Qe,skeletonExiting:u.skeletonExiting,isInputEmpty:qe.trim().length===0,language:l,products:u.products,productImageFallback:H,onProductSelect:y.selectProduct,onProductAddToCart:d?y.addProductToCart:void 0,onProductFocusChange:y.setFocused,formatType:u.activeFormatType,dateView:u.dateView,selectedDateIso:De.selectedIso,selectedDateRange:De.selectedRange,dateRangeStart:De.rangeStart,onPreviousMonth:y.showPreviousMonth,onNextMonth:y.showNextMonth,timeView:u.timeView,multiSelectView:u.multiSelectView,onMultiSelectCommit:y.commitMultiSelect,onTimeChange:y.setTime,onTimeCommit:y.commitTime,locationView:u.locationView,isReediting:u.editingParam!=null,onLocationQuery:y.setLocationQuery,onLocationMove:y.moveLocationHighlight,onLocationCommit:y.commitLocation,onLocationFocusChange:y.setLocationFieldFocused,isFocused:u.isFocused||u.locationFieldFocused,optionsPosition:h??"below"}}}import{chipIdFromTap as Ao,extractPlainText as ya,getCursorOffset as ka,keepCaretOnChip as Ro,plainTextLength as Lo,renderEditableContent as Oo,setCursorOffset as Ca}from"@magicx-eng/ai-autocomplete-vanilla";import{useCallback as pe,useEffect as ft,useLayoutEffect as Ot,useRef as Ze}from"react";var bt;function Do(){if(bt!==void 0)return bt;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),bt=e.contentEditable==="plaintext-only",bt}function Sa(e){let{segments:o,showChipIcons:t=!0,showChipImages:a=!0,newParamId:i,editingParam:s,editingIdentified:r,editingAnchor:l,caretOffset:m,placeholderText:w,isFocused:x,isDropdownOpen:g,listboxId:c,activeDescendantId:h,autoFocus:v,handleTextChange:E,handleKeyDown:F,handleCaretAfterInput:M,handleCaretMove:O,startEditingParam:V,replaceEditingRange:R,setFocused:D}=e,S=Ze(null),H=Ze(!1),U=Ze(""),X=Ze(""),q=Ze(null),_=Ze(0);q.current=m,ft(()=>{if(!v)return;let b=S.current;if(!b)return;document.activeElement===b?D(!0):b.focus();let C=b.ownerDocument??document,P=C.getSelection(),A=P&&P.rangeCount>0&&b.contains(P.anchorNode);if(P&&!A){let L=C.createRange();L.selectNodeContents(b),L.collapse(!0),P.removeAllRanges(),P.addRange(L)}},[v,D]),ft(()=>{let b=S.current;if(!b)return;let C=b.ownerDocument??document,P=()=>{let A=C.getSelection();if(!A||A.rangeCount===0||!A.anchorNode||!b.contains(A.anchorNode))return;let L=A.anchorNode,Q=L.nodeType===Node.ELEMENT_NODE?L:L.parentElement,ae=(A.isCollapsed?Q?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,ue=s?.id??r?.id??null;if(ae&&ae!==ue){V(ae);return}performance.now()-_.current<50||O(ka(b))};return C.addEventListener("selectionchange",P),()=>C.removeEventListener("selectionchange",P)},[s,r,V,O]),ft(()=>{let b=S.current;if(!b)return;let C=P=>{let A=Ao(b,P.target);A&&(V(A),Ro(b,A))};return b.addEventListener("click",C),()=>b.removeEventListener("click",C)},[V]),Ot(()=>{let b=S.current;b&&Oo({input:b,segments:o,newParamId:i,editingParamId:s?.id??null,placeholderText:w??"",isFocused:x,showChipIcons:t,showChipImages:a})},[o,i,s,w,x,t,a]),Ot(()=>{let b=U.current,C=i??"";if(U.current=C,!C||C===b)return;let P=S.current;if(!P)return;P.focus();let A=q.current??Lo(P);Ca(P,A)},[i]),Ot(()=>{let b=X.current,C=s?.id??"";if(X.current=C,!C||C===b||l==null)return;let P=S.current;P&&Ca(P,l)},[s,l]);let T=pe(()=>{if(H.current)return;let b=S.current;if(!b)return;let C=ya(b),A=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;E(A)},[E]),B=pe(()=>{_.current=performance.now(),T();let b=S.current;b&&M(ka(b))},[T,M]);ft(()=>{let b=S.current;if(!b)return;let C=P=>{let A=P,L=A.inputType;if(L==="insertParagraph"||L==="insertLineBreak"||L==="insertFromDrop"){P.preventDefault();return}if(L.startsWith("insert")||L.startsWith("delete")){let Q=L.startsWith("delete")?"":A.data??"";R(Q)&&P.preventDefault()}};return b.addEventListener("beforeinput",C),()=>b.removeEventListener("beforeinput",C)},[R]);let he=pe(()=>{H.current=!0,S.current?.setAttribute("data-aia-composing","true")},[]),se=pe(()=>{H.current=!1,S.current?.removeAttribute("data-aia-composing"),T()},[T]),ne=pe(b=>{b.preventDefault();let C=S.current;if(!C)return;let P=(b.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!P)return;let A=C.ownerDocument??document,L=A.getSelection();if(!L||L.rangeCount===0)return;let Q=L.getRangeAt(0);if(!C.contains(Q.startContainer))return;Q.deleteContents();let le=A.createTextNode(P);Q.insertNode(le),Q.setStartAfter(le),Q.collapse(!0),L.removeAllRanges(),L.addRange(Q),T()},[T]),d=pe(b=>F(b),[F]),I=pe(()=>D(!0),[D]),Ce=pe(()=>D(!1),[D]),f=pe(()=>S.current?.focus(),[]),ze=pe(()=>S.current?.blur(),[]),Ae=pe(()=>{let b=S.current;return b?ya(b):""},[]),Re=Do()?"plaintext-only":"true";return{inputRef:S,editorProps:{ref:S,contentEditable:Re,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":c,"aria-expanded":g,"aria-activedescendant":h,spellCheck:!0,enterKeyHint:"send",onInput:B,onKeyDown:d,onCompositionStart:he,onCompositionEnd:se,onPaste:ne,onFocus:I,onBlur:Ce},getPlainText:Ae,focus:f,blur:ze}}import{jsx as Je,jsxs as zt}from"react/jsx-runtime";function Go(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var qo=Mo(function({onSubmit:o,onResult:t,onError:a,optionOverrides:i,maskCompletedText:s,className:r,apiConfig:l,additionalContext:m,language:w,currency:x,productId:g,visitorId:c,columns:h,pillPlacement:v="dropdown",mode:E="auto",optionsPosition:F="below",animations:M=!0,dropdownTrigger:O,closeDropdownOnBlur:V,prependPlaceholder:R,showNonTappableOptions:D,locationSearch:S,showOptionIcons:H=!0,showChipIcons:U=!0,showChipImages:X=!0,showOptionImages:q=!0,showOptionCounts:_=!0,showSkipButton:T,showProducts:B,productsLayout:he,productImageFallback:se,autoFocus:ne=!0,onFocus:d,onBlur:I,value:Ce,completedParams:f,onChange:ze,onParamsChange:Ae,products:Re,mapProducts:b,onProductSelect:C,onProductAddToCart:P,submitButton:A,resetOnSubmit:L=!0},Q){let le=Xe(null),ae=Xe(null),ue=Xe(null),Le=Xe(()=>{}),me=Xe(null),J=Xe(null);Mt(()=>{let N=le.current;if(N)return me.current?me.current.setMode(E):me.current=new Ho(N,E),()=>{me.current?.destroy(),me.current=null}},[E]);let Ne=Dt(N=>{let ie=J.current?.current;ie&&(ie.focus(),Bo(ie,N))},[]),{completedParams:et,suggestionPills:Se,setActivePill:Fe,skipActivePill:Ge,segments:Te,newParamId:ee,clearNewParamId:ge,placeholderText:y,isFocused:n,isDropdownOpen:Y,isActivePillSelected:fe,isLoading:u,isReady:qe,activeIndex:be,listboxId:we,handleTextChange:_e,handleKeyDown:tt,setFocused:Pe,editingParam:Ve,editingIdentified:de,editingAnchor:ve,caretOffset:Oe,startEditingParam:He,handleCaretAfterInput:Ue,handleCaretMove:De,replaceEditingRange:Qe,dropdownProps:p,reset:z,refreshProducts:k,prepareSubmit:lt,getState:Nt,recordSubmit:Ft}=Lt({onSubmit:N=>Le.current(N),onResult:t,onError:a,optionOverrides:i,maskCompletedText:s,apiConfig:l,additionalContext:m,language:w,currency:x,productId:g,visitorId:c,columns:h,dropdownTrigger:O,optionsPosition:F,closeDropdownOnBlur:V,prependPlaceholder:R,showNonTappableOptions:D,locationSearch:S,showOptionIcons:H,showOptionImages:q,showOptionCounts:_,showSkipButton:T,showProducts:B,onFocus:d,onBlur:I,value:Ce,completedParams:f,onChange:ze,onParamsChange:Ae,products:Re,mapProducts:b,onProductSelect:C,onProductAddToCart:P,source:"full-sdk",setCursor:Ne});Mt(()=>{if(!ee)return;let N=window.setTimeout(()=>ge(),650);return()=>window.clearTimeout(N)},[ee,ge]);let Ta=be>=0?`${we}-option-${be}`:void 0,{inputRef:wt,editorProps:Pa,focus:dt,blur:Ht,getPlainText:Bt}=Sa({segments:Te,newParamId:ee,editingParam:Ve,editingIdentified:de,editingAnchor:ve,caretOffset:Oe,placeholderText:y,isFocused:n,showChipIcons:U,showChipImages:X,isDropdownOpen:Y,listboxId:we,activeDescendantId:Ta,autoFocus:ne,handleTextChange:_e,handleKeyDown:tt,handleCaretAfterInput:Ue,handleCaretMove:De,startEditingParam:He,replaceEditingRange:Qe,setFocused:Pe});J.current=wt,No(()=>{let N=ae.current,ie=wt.current;if(!N||!ie)return;let it=()=>{let Kt=N.firstElementChild;if(!Kt)return;let Ra=Kt.getBoundingClientRect(),La=ie.getBoundingClientRect();Ra.top>=La.bottom-2?N.setAttribute("data-aia-pill-wrapped",""):N.removeAttribute("data-aia-pill-wrapped")};it();let Wt=new ResizeObserver(it);return Wt.observe(ie),()=>Wt.disconnect()},[Te,Se.length,u,wt]),Mt(()=>{let N=ue.current;if(N)return Ko(N)},[]),zo(Q,()=>({focus:dt,blur:Ht,reset:z,refreshProducts:k,setMode:N=>me.current?.setMode(N),skipActivePill:Ge}),[dt,Ht,z,k,Ge]);let at=!!Te.length||et.length>0,vt=Dt(N=>{if(!at)return;N&&lt();let ie=Nt(),it=Fo(Bt(),ie.completedParams,ie.skippedParams,{identifiedParams:ie.identifiedParams,isReady:ie.isReady,customFields:ie.customFields});N&&Ft(it),o(it),L&&z()},[Ft,L,at,lt,Nt,o,z,Bt]);Le.current=()=>vt(!1);let Ia=Dt(N=>{N.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||dt()},[dt]),Ea=v==="inline",Aa=v==="dropdown";return zt("div",{ref:le,className:`magicx-aia ${Be.container} ${r??""}`,"data-pill-placement":v,"data-options-position":F,"data-animations":M?"on":"off","data-mode":Go(E),children:[Je(At,{...p,showPills:Aa,productsLayout:he,productImageFallback:se}),zt("div",{className:Be.inputWrapper,"data-aia-input-wrapper":"",onClick:Ia,children:[zt("div",{ref:ue,className:Be.editorArea,"data-aia-editor":"",children:[Je("div",{...Pa,className:Be.input,"data-aia-input":""}),Ea&&(u||Se.length>0)&&Je("span",{ref:ae,className:Be.pillListContainer,"data-aia-pill-list-container":"",children:Je(pt,{pills:Se,activePillIndex:0,activeSelected:fe,onSelectPill:Fe,loading:u})})]}),A===null?null:A===void 0?Je(ma,{disabled:!at,ready:at&&qe,onClick:()=>vt(!0),label:Wo(w).submit}):Je("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:Be.submitSlot,onClick:N=>{at&&(N.stopPropagation(),vt(!0))},children:A})]})]})});export{qo as AIAutocomplete,At as AIAutocompleteDropdown,Jr as DATE_RANGE_META_END,es as DATE_RANGE_META_START,ts as DEFAULT_OPTION_COUNT_UNIT,ds as LOCATION_META_KEY,bs as PRODUCT_PATH_PREFIX,Is as TIME_META_KEY,As as WEEKDAY_LABELS,$r as buildSubmitResult,Zr as cellDay,Xr as cellIso,as as dateCellMarks,is as formatDate,os as formatDateRange,ns as formatOptionCount,rs as formatPlace,ss as formatTime,ls as isoDate,cs as monthLabel,ps as optionCountLabel,hs as optionHasImage,us as optionImageSources,ms as optionImageSrc,gs as optionLabel,fs as optionsShowLeadingVisuals,ws as parseDate,vs as parseLooseDate,xs as parseLooseDateRange,ys as parseTime,ks as productFromMatchedItem,Cs as productImageSources,Ss as productsFromCustomFields,Ts as sanitizeOptionIconSvg,Ps as selectedRangeFor,Lt as useAIAutocomplete,Es as visibleDateRange,Rs as withSkippedParams};
3208
3333
  //# sourceMappingURL=index.mjs.map