@magicx-eng/ai-autocomplete-react 0.48.2 → 0.49.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/REFERENCE.md +5 -3
- package/dist/index.js +44 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/REFERENCE.md
CHANGED
|
@@ -582,9 +582,11 @@ The full input also accepts `--aia-input-radius` and `--aia-written-text-font-we
|
|
|
582
582
|
| `--aia-time-panel-width` | `240px` | `240px` | Max width of the whole dropdown panel while the time wheel is up. |
|
|
583
583
|
| `--aia-time-font-size` | `15px` | `15px` | The time wheel's numbers and its `:` separator. |
|
|
584
584
|
| `--aia-time-band-bg` | white at 8% | white at 8% | The band behind the wheels' top rows — the chosen time. |
|
|
585
|
-
| `--aia-
|
|
586
|
-
| `--aia-
|
|
587
|
-
| `--aia-
|
|
585
|
+
| `--aia-confirm-bg` | `#262626` | `#a6a6a6` | The solid fill shared by the Done buttons (multi-select and time wheel) and a checked multi-select checkbox. |
|
|
586
|
+
| `--aia-confirm-bg-hover` | `#404040` | `#b8b8b8` | The Done buttons on hover. |
|
|
587
|
+
| `--aia-confirm-color` | `#ffffff` | `#000000` | The Done buttons' text and the checkbox's checkmark. |
|
|
588
|
+
| `--aia-multi-done-bg` / `--aia-multi-done-bg-hover` / `--aia-multi-done-color` | `--aia-confirm-*` | `--aia-confirm-*` | Override the multi-select Done button alone. |
|
|
589
|
+
| `--aia-time-done-bg` / `--aia-time-done-bg-hover` / `--aia-time-done-color` | `--aia-confirm-*` | `--aia-confirm-*` | Override the time wheel's Done button alone. |
|
|
588
590
|
| `--aia-location-field-bg` | `--aia-streak-rgb` at 6% (indigo) | `--aia-streak-rgb` at 6% (white) | The location search field. |
|
|
589
591
|
| `--aia-location-field-radius` | `10px` | `10px` | Corner radius of the location search field. |
|
|
590
592
|
| `--aia-location-font-size` | `15px` | `15px` | The location field's text and the place names. |
|
package/dist/index.js
CHANGED
|
@@ -579,6 +579,11 @@
|
|
|
579
579
|
--aia-skeleton-bg: var(--aia-primitive-neutral-750-a8);
|
|
580
580
|
|
|
581
581
|
--aia-streak-rgb: 99, 102, 241; /* off shared palette (indigo effect) */
|
|
582
|
+
/* Solid confirm fill: the pickers' Done buttons and a ticked multi-select
|
|
583
|
+
checkbox. A near-black gray on light, so white reads on it. */
|
|
584
|
+
--aia-confirm-bg: #262626;
|
|
585
|
+
--aia-confirm-bg-hover: #404040;
|
|
586
|
+
--aia-confirm-color: #ffffff;
|
|
582
587
|
|
|
583
588
|
--aia-footer-hint-color: var(--aia-primitive-neutral-500);
|
|
584
589
|
--aia-footer-brand-color: var(--aia-primitive-neutral-700);
|
|
@@ -634,6 +639,11 @@
|
|
|
634
639
|
--aia-skeleton-bg: var(--aia-primitive-neutral-150);
|
|
635
640
|
|
|
636
641
|
--aia-streak-rgb: 255, 255, 255;
|
|
642
|
+
/* The light theme's solid confirm fill, inverted: a soft gray (not white,
|
|
643
|
+
which glares on the dark surface) under dark text. */
|
|
644
|
+
--aia-confirm-bg: #a6a6a6;
|
|
645
|
+
--aia-confirm-bg-hover: #b8b8b8;
|
|
646
|
+
--aia-confirm-color: #000000;
|
|
637
647
|
|
|
638
648
|
--aia-footer-hint-color: var(--aia-primitive-neutral-700);
|
|
639
649
|
--aia-footer-brand-color: var(--aia-primitive-neutral-500);
|
|
@@ -1249,20 +1259,33 @@
|
|
|
1249
1259
|
}
|
|
1250
1260
|
}
|
|
1251
1261
|
|
|
1262
|
+
/* A picker with its own Done button (multi-select, time wheel) ends on that
|
|
1263
|
+
button: the footer is not shown under it. */
|
|
1264
|
+
.aia-dropdown-yz2KC:has([data-aia-multi-done]) [data-aia-footer],
|
|
1265
|
+
.aia-dropdown-yz2KC:has([data-aia-time-wheel]) [data-aia-footer] {
|
|
1266
|
+
display: none;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/* The multi-select Done button: the time wheel's Done, full width and solid. */
|
|
1252
1270
|
.aia-multiDone-y12U7 {
|
|
1253
1271
|
display: block;
|
|
1254
|
-
width:
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
padding: 0 18px;
|
|
1272
|
+
width: 100%;
|
|
1273
|
+
height: 36px;
|
|
1274
|
+
padding: 0 12px;
|
|
1258
1275
|
border: none;
|
|
1259
|
-
border-radius:
|
|
1260
|
-
background: var(--aia-
|
|
1261
|
-
color: var(--aia-
|
|
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));
|
|
1262
1279
|
font-family: inherit;
|
|
1263
|
-
font-size:
|
|
1264
|
-
font-weight:
|
|
1280
|
+
font-size: 13px;
|
|
1281
|
+
font-weight: 500;
|
|
1282
|
+
line-height: 20px;
|
|
1265
1283
|
cursor: pointer;
|
|
1284
|
+
transition: background-color 150ms ease-out;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.aia-multiDone-y12U7:hover {
|
|
1288
|
+
background: var(--aia-multi-done-bg-hover, var(--aia-confirm-bg-hover, #404040));
|
|
1266
1289
|
}
|
|
1267
1290
|
`,document.head.appendChild(e)}var De={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"};var Y=require("@magicx-eng/ai-autocomplete-vanilla"),qt=require("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) ---
|
|
1268
1291
|
|
|
@@ -1638,7 +1661,7 @@
|
|
|
1638
1661
|
justify-content: flex-end;
|
|
1639
1662
|
}
|
|
1640
1663
|
}
|
|
1641
|
-
`,document.head.appendChild(e)}var qe={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"};var Me=require("react/jsx-runtime");function
|
|
1664
|
+
`,document.head.appendChild(e)}var qe={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"};var Me=require("react/jsx-runtime");function Ut({isOptionHighlighted:e=!1,isInputEmpty:i=!1,strings:t=(0,$e.uiStringsFor)()}){let{key:a,hint:o}=(0,$e.getFooterHint)(e,i,t),[r,n]=(0,xt.useState)($e.ATTRIBUTION_URL);return(0,xt.useEffect)(()=>{n((0,$e.buildAttributionUrl)())},[]),(0,Me.jsx)("footer",{className:qe.footer,"data-aia-footer":"",children:(0,Me.jsxs)(gt,{justify:"between",noWrap:!0,className:qe.row,children:[(0,Me.jsxs)(gt,{gap:"5px",className:qe.hintGroup,children:[(0,Me.jsx)("kbd",{className:qe.key,children:a}),(0,Me.jsx)("span",{className:qe.hint,children:o})]}),(0,Me.jsxs)("a",{className:qe.brandLink,href:r,target:"_blank",rel:"noopener noreferrer",children:[(0,Me.jsx)("span",{className:qe.brand,children:"AI"}),(0,Me.jsx)("span",{className:qe.badge,children:"Autocomplete"})]})]})})}var ie=require("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
|
|
1642
1665
|
Angular copy). The three are kept identical by
|
|
1643
1666
|
packages/vanilla/tests/render/locationFieldParity.test.ts. */
|
|
1644
1667
|
.aia-location-6-fsr {
|
|
@@ -1765,7 +1788,7 @@
|
|
|
1765
1788
|
.aia-loadingBar-OLCr4:nth-child(3) {
|
|
1766
1789
|
width: 60%;
|
|
1767
1790
|
}
|
|
1768
|
-
`,document.head.appendChild(e)}var j={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"};var W=require("react/jsx-runtime"),Ra=0;function ft(e){return e.getRootNode().activeElement??null}function Qt(e){return e.getRootNode().getSelection?.()??document.getSelection()}function Oa(e){if(!e.isContentEditable)return null;let i=Qt(e);if(!i||i.rangeCount===0)return null;let t=i.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function
|
|
1791
|
+
`,document.head.appendChild(e)}var j={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"};var W=require("react/jsx-runtime"),Ra=0;function ft(e){return e.getRootNode().activeElement??null}function Qt(e){return e.getRootNode().getSelection?.()??document.getSelection()}function Oa(e){if(!e.isContentEditable)return null;let i=Qt(e);if(!i||i.rangeCount===0)return null;let t=i.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function Vt(e,i){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=Qt(e);if(!t)return;let a=i;(!a||!a.startContainer.isConnected||!e.contains(a.startContainer))&&(a=document.createRange(),a.selectNodeContents(e),a.collapse(!1)),t.removeAllRanges(),t.addRange(a)}var Da=(0,W.jsxs)("svg",{className:j.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,W.jsx)("path",{d:"M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z"}),(0,W.jsx)("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Ma=(0,W.jsxs)("svg",{className:j.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,W.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,W.jsx)("path",{d:"m20 20-3.5-3.5"})]});function Yt({view:e,searchLabel:i,noResultsLabel:t,useTypedLabel:a,widgetFocused:o,visible:r=!0,interactive:n=!0,onQuery:l,onMove:f,onCommit:x,onFocusChange:y}){let m=(0,ie.useRef)(null),c=(0,ie.useRef)(null),p=(0,ie.useRef)(null),v=(0,ie.useRef)(null),O=(0,ie.useRef)(null),G=(0,ie.useRef)(!1),N=(0,ie.useRef)(!1),U=(0,ie.useRef)(!1),Z=(0,ie.useRef)(o);Z.current=o;let D=(0,ie.useRef)(y);D.current=y;let E=h=>{U.current=h,y(h)},S=()=>{let h=m.current;return h!=null&&ft(h)===h},ee=()=>{let h=c.current;if(!h)return;let A=ft(h);A instanceof HTMLElement&&A!==m.current&&A!==document.body&&!h.contains(A)&&(v.current=A,O.current=Oa(A))},te=(0,ie.useRef)(null);te.current===null&&(te.current=`aia-location-${++Ra}`);let V=`${te.current}-row-`;(0,ie.useEffect)(()=>{let h=m.current;h&&h.value!==e.query&&ft(h)!==h&&(h.value=e.query)},[e.query]),(0,ie.useEffect)(()=>{let h=m.current;if(h){if(!r&&S()){N.current=!0,K();return}if(!o){setTimeout(()=>{if(Z.current)return;let A=v.current;A&&ft(A)===A||(N.current=!1)},0);return}if(!(N.current||!n||S())){if(ee(),E(!0),h.focus({preventScroll:!0}),!S()){N.current=!0,E(!1);return}h.value&&h.select()}}}),(0,ie.useLayoutEffect)(()=>()=>{if(!U.current)return;let h=m.current,A=v.current;A?.isConnected&&h&&ft(h)===h&&(G.current=!0,Vt(A,O.current),G.current=!1),U.current=!1,D.current(!1)},[]);let K=(h=!1)=>{h&&(N.current=!0);let A=v.current;A?.isConnected&&S()&&(G.current=!0,Vt(A,O.current),G.current=!1),E(!1)},fe=e.query.trim(),I=e.highlighted>=0&&e.highlighted<e.places.length?`${V}${e.highlighted}`:void 0,X=null;return e.places.length>0?X=e.places.map((h,A)=>(0,W.jsxs)("div",{id:`${V}${A}`,role:"option","aria-selected":A===e.highlighted,className:A===e.highlighted?`${j.row} ${j.highlighted}`:j.row,"data-aia-location-row":"","data-aia-index":A,onClick:()=>{n&&(K(!0),x(A))},children:[(0,W.jsx)("span",{className:j.pin,children:Da}),(0,W.jsxs)("span",{className:j.text,children:[(0,W.jsx)("span",{className:j.name,children:h.name}),h.secondary&&(0,W.jsx)("span",{className:j.secondary,children:h.secondary})]})]},h.id)):e.status==="loading"?X=(0,W.jsxs)("div",{className:j.loading,"data-aia-location-loading":"",children:[(0,W.jsx)("span",{className:j.loadingBar}),(0,W.jsx)("span",{className:j.loadingBar}),(0,W.jsx)("span",{className:j.loadingBar})]}):fe&&(X=(0,W.jsxs)("div",{className:j.note,"data-aia-location-note":"",children:[e.status==="done"&&(0,W.jsx)("span",{className:j.empty,children:t}),(0,W.jsx)("span",{children:a})]})),(0,W.jsxs)("div",{ref:c,className:j.location,"data-aia-location":"",onMouseDown:h=>{!(h.target instanceof Node)||!p.current?.contains(h.target)||(h.stopPropagation(),ee(),E(!0))},children:[(0,W.jsxs)("label",{ref:p,className:j.field,children:[Ma,(0,W.jsx)("input",{ref:m,type:"text",className:j.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:i,"aria-label":i,"aria-activedescendant":I,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:r?0:-1,onChange:h=>l(h.target.value),onFocus:()=>E(!0),onBlur:()=>{G.current||(N.current=!0,E(!1))},onKeyDown:h=>{if(!h.nativeEvent.isComposing)switch(h.key){case"ArrowDown":case"ArrowUp":h.preventDefault(),f(h.key==="ArrowDown"?1:-1);return;case"Enter":if(h.preventDefault(),!n)return;K(!0),x();return;case"Escape":h.preventDefault(),h.stopPropagation(),N.current=!0,K();return;case"Backspace":if(h.currentTarget.value!=="")return;h.preventDefault(),N.current=!0,K();return}}})]}),(0,W.jsx)("div",{className:j.results,"data-aia-location-results":"","aria-live":"polite",children:X})]})}var yt=require("@magicx-eng/ai-autocomplete-vanilla");var jt=require("@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,
|
|
1769
1792
|
no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
|
|
1770
1793
|
The border is kept as a 1px transparent line so the box stays the same size
|
|
1771
1794
|
as it was when the outline was dashed. */
|
|
@@ -2965,15 +2988,15 @@
|
|
|
2965
2988
|
}
|
|
2966
2989
|
|
|
2967
2990
|
.aia-checkbox-KGRhg[data-checked="true"] {
|
|
2968
|
-
background:
|
|
2969
|
-
border-color:
|
|
2970
|
-
color:
|
|
2991
|
+
background: var(--aia-confirm-bg, #262626);
|
|
2992
|
+
border-color: var(--aia-confirm-bg, #262626);
|
|
2993
|
+
color: var(--aia-confirm-color, #ffffff);
|
|
2971
2994
|
}
|
|
2972
2995
|
|
|
2973
2996
|
.aia-item-d4vpD:has(.aia-checkbox-KGRhg[data-checked="true"]) {
|
|
2974
2997
|
background: var(--aia-option-bg, transparent);
|
|
2975
2998
|
}
|
|
2976
|
-
`,document.head.appendChild(e)}var oe={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"};var se=require("react/jsx-runtime");function aa({option:e,isHighlighted:i,checked:t,onSelect:a,onHighlight:o,onUnhighlight:r,id:n,loading:l,showIcon:f=!0,showImage:x=!0,showCount:y=!0,scrollHint:m,enterDelayMs:c=0}){let[p]=(0,Ce.useState)(c),[v,O]=(0,Ce.useState)(!1),G=x?(0,pe.optionImageSources)(e.image_url):[],N=G[0]??null,[
|
|
2999
|
+
`,document.head.appendChild(e)}var oe={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"};var se=require("react/jsx-runtime");function aa({option:e,isHighlighted:i,checked:t,onSelect:a,onHighlight:o,onUnhighlight:r,id:n,loading:l,showIcon:f=!0,showImage:x=!0,showCount:y=!0,scrollHint:m,enterDelayMs:c=0}){let[p]=(0,Ce.useState)(c),[v,O]=(0,Ce.useState)(!1),G=x?(0,pe.optionImageSources)(e.image_url):[],N=G[0]??null,[U,Z]=(0,Ce.useState)([]),D=G.find(I=>!U.includes(I))??null,[E,S]=(0,Ce.useState)(null),ee=(0,Ce.useMemo)(()=>!N&&f&&e.icon_svg?(0,pe.sanitizeOptionIconSvg)(e.icon_svg):null,[N,f,e.icon_svg]),te=y?(0,pe.formatOptionCount)(e.item_count):null,V=(0,Ce.useRef)(void 0);(0,Ce.useEffect)(()=>()=>clearTimeout(V.current),[]);let K=I=>{if(l||!e.is_tappable||v&&t===void 0)return;O(!0);let X=I?.currentTarget;t!==void 0&&X!==void 0&&I!==void 0&&!(0,pe.isMultiSelectToggleTap)(X,X.querySelector("[data-aia-checkbox]"),I)?a(e,{commit:!0}):a(e),clearTimeout(V.current),V.current=setTimeout(()=>O(!1),170)},fe=[oe.item,i&&!l?oe.highlighted:"",e.liveMatch&&!l?oe.liveMatch:"",e.is_tappable?oe.tappable:oe.nonTappable,v?oe.pressed:"",m?oe.scrollHint:""].filter(Boolean).join(" ");return(0,se.jsx)("div",{id:n,role:"option","data-aia-option":"","data-aia-loading":l?"":void 0,"data-aia-icon":ee&&e.icon?e.icon:void 0,"data-aia-image":N?"":void 0,"data-aia-item-count":te!==null?e.item_count:void 0,"aria-selected":t??i,className:fe,style:{[pe.OPTION_ENTER_DELAY_VAR]:`${p}ms`},tabIndex:l||!e.is_tappable?-1:0,onClick:K,onKeyDown:I=>{!l&&e.is_tappable&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),K())},onMouseEnter:!l&&e.is_tappable?o:void 0,onMouseLeave:r,children:(0,se.jsxs)("span",{className:oe.content,children:[t!==void 0&&e.is_tappable&&(0,se.jsx)("span",{className:oe.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t,children:t?"\u2713":""}),N&&(0,se.jsx)("span",{className:`${oe.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":D!==null&&E===D?"":void 0,children:(0,se.jsx)("img",{src:D??N,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:D===null,onLoad:()=>S(D),onError:()=>{D!==null&&Z(I=>[...I,D])}})}),ee&&(0,se.jsx)("span",{className:`${oe.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:ee}}),(0,se.jsxs)("span",{className:oe.text,children:[e.matchedText?(0,pe.highlightParts)((0,pe.optionLabel)(e),e.matchedText).map((I,X)=>I.bold?(0,se.jsx)("strong",{className:`${oe.match} magicx-aia-option-match`,children:I.text},X):I.text):(0,pe.optionLabel)(e),e.parameterLabel&&(0,se.jsxs)(se.Fragment,{children:[" ",(0,se.jsx)("span",{className:`${oe.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&(0,se.jsx)("span",{className:oe.tag,children:e.tag}),te!==null&&(0,se.jsx)("span",{className:`${oe.count} magicx-aia-option-count`,children:te})]})})}var Mt=require("react/jsx-runtime");function Wa(){let[e,i]=(0,Ne.useState)(ne.isOptionsGridMobileViewport);return(0,Ne.useEffect)(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(ne.OPTIONS_GRID_MOBILE_QUERY),a=()=>i(t.matches);return a(),t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[]),e}function ia({options:e,activeIndex:i,picked:t,onSelect:a,onHighlight:o,onUnhighlight:r,listboxId:n,loading:l,groupKey:f="",optionsPosition:x="below",showIcons:y=!0,showImages:m=!0,showCounts:c=!0}){let p=Wa(),v=(0,Ne.useRef)(null),[O,G]=(0,Ne.useState)(null),N=(0,Ne.useRef)(null);(0,Ne.useLayoutEffect)(()=>{if(l&&(0,ne.sameOptionRows)(N.current,e))return;N.current=l?null:e;let D=v.current,S=D&&!l&&(0,ne.needsOptionsGridMeasurement)(e.length,p)?(0,ne.measureOptionsGrid)(D):null;G(S?(0,ne.planOptionsGrid)(e.length,p,S.rowWidths,S.gridWidth):null)},[e,p,l]);let U=O??(0,ne.planOptionsGrid)(e.length,p,null,null),Z=(0,ne.optionsShowLeadingVisuals)(e,y,m);return(0,Mt.jsx)(ea,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:f,template:U.template,maxHeight:U.maxHeight,innerRef:D=>{v.current=D},"data-aia-group":f,children:e.map((D,E)=>(0,Mt.jsx)(aa,{option:D,isHighlighted:E===i,checked:t?t.includes(D.text):void 0,onSelect:a,onHighlight:()=>o(E),onUnhighlight:r?()=>r(E):void 0,id:`${n}-option-${E}`,loading:l,showIcon:y&&Z,showImage:m&&Z,showCount:c,scrollHint:!l&&U.scrollHintIndices.includes(E),enterDelayMs:l?0:(0,ne.optionEnterDelayMs)(E,U.cols,e.length,x)},`${f}\0${D.text}`))})}var le=require("@magicx-eng/ai-autocomplete-vanilla"),Te=require("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) ---
|
|
2977
3000
|
|
|
2978
3001
|
One of three hand-maintained copies (vanilla styles.css, this file, Angular's
|
|
2979
3002
|
time-wheel.component.css). Only the class-naming layer differs \u2014 the
|
|
@@ -3078,25 +3101,22 @@
|
|
|
3078
3101
|
|
|
3079
3102
|
.aia-done-llNY5 {
|
|
3080
3103
|
align-self: stretch;
|
|
3081
|
-
height:
|
|
3104
|
+
height: 36px;
|
|
3082
3105
|
padding: 0 12px;
|
|
3083
3106
|
border: none;
|
|
3084
3107
|
border-radius: 8px;
|
|
3085
|
-
background: var(--aia-time-done-bg,
|
|
3108
|
+
background: var(--aia-time-done-bg, var(--aia-confirm-bg, #262626));
|
|
3086
3109
|
font-family: inherit;
|
|
3087
3110
|
font-size: 13px;
|
|
3088
3111
|
font-weight: 500;
|
|
3089
3112
|
line-height: 20px;
|
|
3090
|
-
color: var(
|
|
3091
|
-
--aia-time-done-color,
|
|
3092
|
-
var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
|
|
3093
|
-
);
|
|
3113
|
+
color: var(--aia-time-done-color, var(--aia-confirm-color, #ffffff));
|
|
3094
3114
|
cursor: pointer;
|
|
3095
3115
|
transition: background-color 150ms ease-out;
|
|
3096
3116
|
}
|
|
3097
3117
|
|
|
3098
3118
|
.aia-done-llNY5:hover {
|
|
3099
|
-
background: var(--aia-time-done-bg-hover,
|
|
3119
|
+
background: var(--aia-time-done-bg-hover, var(--aia-confirm-bg-hover, #404040));
|
|
3100
3120
|
}
|
|
3101
3121
|
`,document.head.appendChild(e)}var Se={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"};var ye=require("react/jsx-runtime"),Ga=120;function oa({view:e,label:i,doneLabel:t,interactive:a=!0,onTimeChange:o,onTimeCommit:r}){return(0,ye.jsxs)("div",{className:Se.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":i,onMouseDown:n=>n.preventDefault(),children:[(0,ye.jsx)("span",{className:Se.value,"data-aia-time-value":"","aria-live":"polite",children:(0,le.formatTime)(e.minutes)}),(0,ye.jsxs)("div",{className:Se.columns,"aria-hidden":"true",children:[(0,ye.jsx)("div",{className:Se.band}),le.TIME_WHEEL_COLUMNS.map(n=>(0,ye.jsxs)(Te.Fragment,{children:[n==="minute"&&(0,ye.jsx)("span",{className:Se.separator,children:":"}),(0,ye.jsx)(Ka,{column:n,minutes:e.minutes,interactive:a,onTimeChange:o})]},n))]}),(0,ye.jsx)("button",{type:"button",tabIndex:-1,className:Se.done,"data-aia-time-done":"",onClick:()=>{a&&r()},children:t})]})}function Ka({column:e,minutes:i,interactive:t,onTimeChange:a}){let o=(0,Te.useRef)(null),r=(0,Te.useRef)(null),n=(0,Te.useRef)(null),l=(0,Te.useRef)({minutes:i,interactive:t,onTimeChange:a});l.current={minutes:i,interactive:t,onTimeChange:a};let f=(0,le.timeWheelIndex)(e,i);(0,Te.useLayoutEffect)(()=>{let m=o.current;if(!m||n.current)return;let c=f*le.TIME_WHEEL_ROW_HEIGHT;Math.abs(m.scrollTop-c)<1||(r.current=c,m.scrollTop=c)},[f]),(0,Te.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]);let x=()=>{n.current=null;let m=o.current,c=l.current;if(!m||!c.interactive)return;let p=(0,le.timeWheelIndexFromScroll)(e,m.scrollTop);p!==(0,le.timeWheelIndex)(e,c.minutes)&&c.onTimeChange((0,le.withTimeWheelIndex)(e,c.minutes,p))},y=()=>{let m=o.current;if(m){if(r.current!=null&&Math.abs(m.scrollTop-r.current)<1){r.current=null;return}r.current=null,n.current&&clearTimeout(n.current),n.current=setTimeout(x,Ga)}};return(0,ye.jsx)("div",{ref:o,className:Se.column,"data-aia-time-column":e,onScroll:y,children:(0,le.timeWheelRows)(e).map((m,c)=>(0,ye.jsx)("div",{className:c===f?`${Se.row} ${Se.selected}`:Se.row,"data-aia-time-row":"","data-aia-index":c,onClick:()=>{l.current.interactive&&a((0,le.withTimeWheelIndex)(e,l.current.minutes,c))},children:m.label},m.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
|
|
3102
3122
|
display: flex;
|
|
@@ -3113,7 +3133,7 @@
|
|
|
3113
3133
|
align-items: end;
|
|
3114
3134
|
}
|
|
3115
3135
|
/* data-align="stretch" is the flex default \u2014 no rule needed. */
|
|
3116
|
-
`,document.head.appendChild(e)}var ra=require("react/jsx-runtime");function na({space:e,align:i="stretch",className:t,children:a,...o}){let r=e?{"--aia-stack-space":e}:void 0;return(0,ra.jsx)("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":i,style:r,...o,children:a})}var q=require("react/jsx-runtime"),qa=[159,119,164],_a=()=>{},sa=()=>{},
|
|
3136
|
+
`,document.head.appendChild(e)}var ra=require("react/jsx-runtime");function na({space:e,align:i="stretch",className:t,children:a,...o}){let r=e?{"--aia-stack-space":e}:void 0;return(0,ra.jsx)("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":i,style:r,...o,children:a})}var q=require("react/jsx-runtime"),qa=[159,119,164],_a=()=>{},sa=()=>{},Ua=e=>{},Va=()=>{},Qa=e=>{},Ya=e=>{},ja=e=>{},$a=e=>{};function Za(e){let i=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,a]=(0,de.useState)(i);if((0,de.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>a(o.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function Xa(e,i){let t=(0,de.useRef)(null);(0,de.useEffect)(()=>{let a=e.current,o=i.current;if(!a||!o)return;let r=a.querySelector(".aia-grid[data-scroll]");if(t.current&&t.current.grid!==r&&(t.current.controller.destroy(),t.current=null),r&&!t.current){t.current={grid:r,controller:(0,ce.attachScrollArrow)({dropdown:a,grid:r,button:o})};return}t.current?.controller.update()}),(0,de.useEffect)(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function Ja(e,i){let t=(0,de.useRef)(i);t.current=i;let a=(0,de.useRef)(null);(0,de.useEffect)(()=>{let o=e.current;if(o){if(!a.current){a.current=(0,ce.attachViewportFit)({dropdown:o,isOpen:()=>t.current});return}a.current.update()}}),(0,de.useEffect)(()=>()=>{a.current?.destroy(),a.current=null},[])}function St({suggestions:e,activeIndex:i,onSelect:t,onHighlight:a,onUnhighlight:o,isOpen:r,id:n,className:l,pills:f,onPillClick:x,showPills:y=!0,onSkip:m,showSkipButton:c=!0,showOptionIcons:p=!0,showOptionImages:v=!0,showOptionCounts:O=!0,skipDisabled:G=!1,activeSelected:N=!1,isLoading:U=!1,skeletonExiting:Z=!1,isInputEmpty:D=!1,language:E,products:S,onProductSelect:ee,onProductAddToCart:te,onProductFocusChange:V,productsLayout:K="row",productImageFallback:fe="image",formatType:I="options",dateView:X=null,selectedDateIso:h=null,selectedDateRange:A=null,dateRangeStart:He=null,onPreviousMonth:Je,onNextMonth:_e,timeView:b=null,multiSelectView:et=null,onMultiSelectCommit:Ue,onTimeChange:Ve,onTimeCommit:Qe,locationView:w=null,onLocationQuery:C,onLocationMove:T,onLocationCommit:L,onLocationFocusChange:z,isFocused:J=!1,optionsPosition:be="below",mode:we}){let Ie=Za(we),Ee=Ie!==void 0,ve=(0,de.useRef)(null),tt=(0,de.useRef)(null);Xa(ve,tt),(0,de.useEffect)(()=>{if(ve.current)return(0,ce.containScroll)(ve.current)},[]);let ct=e[0]?.options??[],Be=!!(f&&f.length>0&&x),at=!!(S&&S.length>0),nt=I==="time"&&b!=null,We=I==="location"&&w!=null,he=r&&(ct.length>0||y&&Be||U||at||nt||We);Ja(ve,he);let Ae={suggestions:e,activeIndex:i,pills:f,showPills:y,showSkipButton:c,showOptionIcons:p,showOptionImages:v,showOptionCounts:O,skipDisabled:G,activeSelected:N,isLoading:U,skeletonExiting:Z,isInputEmpty:D,products:S,formatType:I,dateView:X,selectedDateIso:h,selectedDateRange:A,dateRangeStart:He,timeView:b,multiSelectView:et,locationView:w},k=(0,de.useRef)(Ae);he&&(k.current=Ae);let u=he?Ae:k.current,ae=(0,ce.uiStringsFor)(E),Le=u.suggestions[0],g=Le?.options??[],rt=u.activeIndex>=0&&!!g[u.activeIndex]?.is_tappable,Ge=(0,ce.labelTraditionalAutocomplete)(u.pills??[],ae.keepTyping),Re=!!(Ge.length>0&&x),pt=u.showPills&&Re,ht=u.showPills&&!Re&&u.isLoading,Ke=pt||ht,st=Re&&(0,ce.hasSkippablePill)(Ge)&&u.showSkipButton&&!u.isInputEmpty&&!!m,ke=Ge[0]?.text,Oe=(0,ce.isCalendarFormat)(u.formatType)&&u.dateView!=null,Ye=g.length>0&&!Oe,it=g.length>0&&Oe&&!u.isLoading,lt=u.formatType==="time"&&u.timeView!=null&&!u.isLoading,je=u.formatType==="location"&&u.locationView!=null&&!u.isLoading,dt=u.isLoading&&!Ye&&!it&&!lt&&!je,d=u.products??[];return(0,q.jsxs)("div",{ref:ve,id:n,role:"listbox","aria-multiselectable":!!u.multiSelectView,"data-aia-dropdown":"","data-options-position":be,"data-mode":Ie,"data-aia-loading":u.isLoading?"":void 0,"data-aia-skeleton-exiting":u.skeletonExiting?"":void 0,"data-aia-has-products":d.length>0?"":void 0,className:`${Ee?"magicx-aia ":""}${De.dropdown} ${he?De.visible:""} ${l??""}`,onMouseDown:P=>P.preventDefault(),children:[(0,q.jsxs)(na,{space:"8px",children:[(Ke||st)&&(0,q.jsxs)(gt,{noWrap:!0,className:De.pillBar,"data-aia-pillbar":"",children:[Ke&&(0,q.jsx)("span",{className:De.pillScroll,"data-aia-pill-scroll":"",children:(0,q.jsx)(kt,{pills:Ge,activePillIndex:0,activeSelected:u.activeSelected,onSelectPill:x??(()=>{}),rounded:!0,loading:u.isLoading})}),st&&(0,q.jsx)("button",{type:"button",tabIndex:-1,className:De.skip,"data-aia-skip":"",disabled:u.isLoading||u.skipDisabled,"aria-label":ke?`${ae.skipLabel} ${ke}`:ae.skipLabel,onClick:m,children:ae.skip})]}),Ye&&(0,q.jsx)(ia,{options:g,activeIndex:u.activeIndex,onSelect:t,onHighlight:a,onUnhighlight:o,listboxId:n,loading:u.isLoading,groupKey:Le?`${Le.parameter} ${Le.text}`:"",optionsPosition:be,showIcons:u.showOptionIcons,showImages:u.showOptionImages,showCounts:u.showOptionCounts,picked:u.isLoading?void 0:u.multiSelectView?.picked}),u.multiSelectView&&!u.isLoading&&(0,q.jsx)("div",{onClick:P=>{P.target.closest("[data-aia-multi-done]")&&!u.skipDisabled&&Ue?.()},children:(0,q.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:De.multiDone,ref:P=>{P&&(P.disabled=!0,P.offsetHeight,P.disabled=u.skipDisabled)},children:ae.done})}),it&&u.dateView&&(0,q.jsx)(_t,{options:g,activeIndex:u.activeIndex,listboxId:n,view:u.dateView,selection:{selectedIso:u.selectedDateIso??null,selectedRange:u.selectedDateRange??null,rangeStart:u.dateRangeStart??null,floor:(0,ce.dateFloorFor)(u.formatType,u.dateRangeStart)},onSelect:t,onHighlight:a,onUnhighlight:o,onPreviousMonth:Je??sa,onNextMonth:_e??sa}),lt&&u.timeView&&(0,q.jsx)(oa,{view:u.timeView,label:ae.timeLabel,doneLabel:ae.done,interactive:!u.skipDisabled,onTimeChange:Ve??Ua,onTimeCommit:Qe??Va}),je&&u.locationView&&(0,q.jsx)(Yt,{view:u.locationView,searchLabel:ae.locationSearch,noResultsLabel:ae.locationNoResults,useTypedLabel:ae.locationUseTyped,widgetFocused:J&&he,visible:he,interactive:!u.skipDisabled,onQuery:C??Qa,onMove:T??Ya,onCommit:L??ja,onFocusChange:z??$a}),dt&&(0,q.jsx)("div",{className:De.skeletonBars,"data-aia-skeleton-bars":"",children:qa.map(P=>(0,q.jsx)("span",{className:De.skeletonBar,style:{width:P}},`bar-${P}`))}),(0,q.jsx)(Xt,{products:d,listboxId:n,onSelect:ee??_a,onAddToCart:te,onFocusChange:V,focusable:he,layout:K,imageFallback:fe,strings:ae}),(0,q.jsx)(Ut,{isOptionHighlighted:rt,isInputEmpty:u.isInputEmpty,strings:ae})]}),(0,q.jsx)("button",{ref:tt,type:"button",tabIndex:-1,className:De.scrollArrow,"data-aia-scroll-arrow":"","aria-label":ae.scrollArrow,"aria-hidden":"true",children:(0,q.jsx)("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:(0,q.jsx)("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}var Fe=require("@magicx-eng/ai-autocomplete-vanilla");var da=require("@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 {
|
|
3117
3137
|
flex-shrink: 0;
|
|
3118
3138
|
width: 32px;
|
|
3119
3139
|
height: 32px;
|
|
@@ -3184,5 +3204,5 @@
|
|
|
3184
3204
|
transition: none;
|
|
3185
3205
|
}
|
|
3186
3206
|
}
|
|
3187
|
-
`,document.head.appendChild(e)}var la={submitButton:"aia-submitButton-otz7H"};var Tt=require("react/jsx-runtime");function ca({disabled:e,ready:i,onClick:t,label:a=(0,da.uiStringsFor)().submit}){return(0,Tt.jsx)("button",{type:"button","data-aia-submit":"",className:la.submitButton,disabled:e,"data-aia-ready":i?"":void 0,onClick:o=>{o.stopPropagation(),t()},"aria-label":a,children:(0,Tt.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":a,children:(0,Tt.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var Xe=require("@magicx-eng/ai-autocomplete-vanilla"),R=require("react");var zt=require("react");function pa(e){let i=(0,zt.useRef)(e);i.current=e;let t=Object.keys(e??{}).sort().join("\0"),a=(0,zt.useRef)({key:"",overrides:void 0});if(a.current.key!==t){let o={};for(let r of Object.keys(e??{})){let n=(l,f,x)=>{let y=i.current?.[r];return y?y(l,f,x):[]};o[r]=n}a.current={key:t,overrides:e?o:void 0}}return{overrides:a.current.overrides,key:t}}var Nt=require("react");function ha(e){let i=(0,Nt.useRef)(e);i.current=e;let t=(0,Nt.useRef)(null);t.current===null&&(t.current={fetch:(o,r)=>{let n=i.current;return n?n.fetch(o,r):Promise.reject(new Error("products config removed"))},transform:o=>i.current?.transform(o)??[],get limit(){return i.current?.limit}});let a=e!==void 0;return{config:a?t.current:void 0,enabled:a}}var ua={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:"",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 Pt({onSubmit:e,onResult:i,onError:t,optionOverrides:a,maskCompletedText:o,apiConfig:r,additionalContext:n,language:l,currency:f,productId:x,visitorId:y,columns:m=2,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:v,showNonTappableOptions:O,locationSearch:G,showOptionIcons:N,showOptionImages:V,showOptionCounts:Z,showSkipButton:D,showProducts:E,productImageFallback:S="image",onFocus:ee,onBlur:te,value:U,completedParams:K,onChange:fe,onParamsChange:I,products:X,mapProducts:h,onProductSelect:A,onProductAddToCart:He,source:Je,setCursor:_e}){let b=(0,R.useRef)(null),[et,Ve]=(0,R.useState)(null),Ue=(0,R.useRef)(e);Ue.current=e;let Qe=(0,R.useRef)(i);Qe.current=i;let w=(0,R.useRef)(t);w.current=t;let C=(0,R.useRef)(fe);C.current=fe;let T=(0,R.useRef)(I);T.current=I;let L=(0,R.useRef)(ee);L.current=ee;let z=(0,R.useRef)(te);z.current=te;let J=(0,R.useRef)(_e);J.current=_e;let be=(0,R.useRef)(A);be.current=A;let we=(0,R.useRef)(He);we.current=He;let Ie=(0,R.useRef)(y);Ie.current=y;let Ee=(0,R.useRef)(()=>{let d=Ie.current;return typeof d=="function"?d():d}).current,ve=ha(X),tt=(0,R.useRef)(h);tt.current=h;let ct=(0,R.useRef)((d,P)=>{let B=tt.current;return B?B(d,P):d}).current,Be=h?ct:void 0,at=pa(a);(0,R.useEffect)(()=>{if(typeof document>"u")return;let d=new Xe.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:r,additionalContext:n,language:l,currency:f,productId:x,visitorId:Ee,optionOverrides:at.overrides,maskCompletedText:o,columns:m,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:v,showNonTappableOptions:O,locationSearch:G,showProducts:E,source:Je,value:U,completedParams:K,onSubmit:(...B)=>Ue.current?.(...B),onResult:(...B)=>Qe.current?.(...B),onError:(...B)=>w.current?.(...B),onChange:(...B)=>C.current?.(...B),onParamsChange:(...B)=>T.current?.(...B),onFocus:()=>L.current?.(),onBlur:()=>z.current?.(),onProductSelect:B=>be.current?.(B),onProductAddToCart:B=>we.current?.(B),setCursor:B=>J.current?.(B),products:ve.config,mapProducts:Be});b.current=d,Ve(d.getState());let P=d.subscribe(B=>Ve(B));return()=>{P(),d.destroy(),b.current===d&&(b.current=null)}},[]),(0,R.useEffect)(()=>{U!==void 0&&b.current?.setValue(U)},[U]),(0,R.useEffect)(()=>{K!==void 0&&b.current?.setCompletedParams(K)},[K]);let nt=JSON.stringify(r??null),We;try{We=JSON.stringify(n??null)}catch{We="[unstringifiable]"}(0,R.useEffect)(()=>{b.current?.update({apiConfig:r,additionalContext:n,language:l,currency:f,productId:x,optionOverrides:at.overrides,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:v,showNonTappableOptions:O,locationSearch:G,showProducts:E})},[nt,We,l,f?.code,f?.rate,f?.country,x,at.key,c,p,v,O,G,E]);let he=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(!he.current){he.current=!0;return}b.current?.update({products:ve.config})},[ve.enabled]),(0,R.useEffect)(()=>{b.current?.update({mapProducts:Be})},[Be]);let Ae=(0,R.useRef)(null);Ae.current===null&&(Ae.current={handleTextChange:d=>b.current?.handleTextChange(d),handleKeyDown:d=>{let P="nativeEvent"in d?d.nativeEvent:d;b.current?.handleKeyDown(P)},setFocused:d=>b.current?.setFocused(d),startEditingParam:d=>b.current?.startEditingParam(d),exitEditMode:()=>b.current?.exitEditMode(),handleCaretAfterInput:d=>b.current?.handleCaretAfterInput(d),handleCaretMove:d=>b.current?.handleCaretMove(d),replaceEditingRange:d=>b.current?.replaceEditingRange(d)??!1,setActivePill:d=>b.current?.setActivePill(d),skipActivePill:()=>b.current?.skipActivePill(),removeLastParam:()=>b.current?.removeLastParam(),clearNewParamId:()=>b.current?.clearNewParamId(),reset:()=>b.current?.reset(),refreshProducts:()=>b.current?.refreshProducts(),prepareSubmit:()=>b.current?.prepareSubmit(),getState:()=>b.current?.getState()??ua,recordSubmit:d=>b.current?.recordSubmit(d),selectOption:(d,P)=>b.current?.selectOption(d,P),selectProduct:d=>b.current?.selectProduct(d),addProductToCart:d=>{let P=b.current;return!P||!we.current?Promise.resolve():P.addProductToCart(d)},setActiveDropdownIndex:d=>b.current?.setActiveDropdownIndex(d),clearHighlight:d=>b.current?.clearHighlight(d),showPreviousMonth:()=>b.current?.showPreviousMonth(),showNextMonth:()=>b.current?.showNextMonth(),setTime:d=>b.current?.setTime(d),commitTime:()=>b.current?.commitTime(),toggleMultiSelectOption:d=>b.current?.toggleMultiSelectOption(d),commitMultiSelect:()=>b.current?.commitMultiSelect(),setLocationQuery:d=>b.current?.setLocationQuery(d),moveLocationHighlight:d=>b.current?.moveLocationHighlight(d),commitLocation:d=>b.current?.commitLocation(d),setLocationFieldFocused:d=>b.current?.setLocationFieldFocused(d),handleFocus:()=>b.current?.setFocused(!0),handleBlur:()=>b.current?.setFocused(!1)});let k=Ae.current,u=(0,R.useCallback)(d=>{let P=d.target.value,wt=P.length>0&&!d.nativeEvent?.isComposing&&P[0]!==P[0].toUpperCase()?P[0].toUpperCase()+P.slice(1):P;b.current?.handleTextChange(wt)},[]),ae=(0,R.useCallback)(d=>{b.current?.handleKeyDown(d.nativeEvent)},[]),Le=b.current,g=et??ua,rt=U!==void 0?U:g.text,Ge=K!==void 0?K:g.completedParams,Re=g.actionableSuggestions,pt=Re[0],ht=(0,Xe.withoutTraditionalAutocomplete)(Re),Ke=Le?.listboxId??"",st=g.activeDropdownIndex>=0&&Le?`${Ke}-option-${g.activeDropdownIndex}`:void 0,ke=g.editingParam,Oe=g.editingIdentified,Ye=ke?{parameter:ke.suggestionParameter,text:ke.suggestionPlaceholder,required:!0,options:ke.options}:Oe?{parameter:Oe.parameter,text:(0,Xe.identifiedParamLabel)(Oe.parameter),required:!0,options:[]}:null,it=g.dropdownSuggestion??Ye??pt,lt=Ye?[Ye]:Re,je=(0,Xe.dateSelectionFor)(g),dt=!Le||g.dropdownLoading;return{completedParams:Ge,multiSelectView:g.multiSelectView,toggleMultiSelectOption:k.toggleMultiSelectOption,commitMultiSelect:k.commitMultiSelect,skippedParams:g.skippedParams,identifiedParams:g.identifiedParams,suggestionPills:ht,setActivePill:k.setActivePill,skipActivePill:k.skipActivePill,removeLastParam:k.removeLastParam,segments:g.segments,newParamId:g.newParamId,clearNewParamId:k.clearNewParamId,suggestions:g.suggestions,activeIndex:g.activeDropdownIndex,isReady:g.isReady,isLoading:dt,isFocused:g.isFocused,isDropdownOpen:g.isDropdownOpen,isActivePillSelected:g.isActivePillSelected,placeholderText:g.placeholderText,listboxId:Ke,error:g.error,products:g.products,customFields:g.customFields,selectProduct:k.selectProduct,addProductToCart:k.addProductToCart,handleTextChange:k.handleTextChange,handleKeyDown:k.handleKeyDown,setFocused:k.setFocused,editingParam:ke,editingIdentified:Oe,editingAnchor:g.editingAnchor,caretOffset:g.caretOffset,startEditingParam:k.startEditingParam,exitEditMode:k.exitEditMode,handleCaretAfterInput:k.handleCaretAfterInput,handleCaretMove:k.handleCaretMove,replaceEditingRange:k.replaceEditingRange,inputProps:{value:rt,placeholder:g.placeholderText||void 0,onChange:u,onKeyDown:ae,onFocus:k.handleFocus,onBlur:k.handleBlur,role:"combobox","aria-expanded":g.isDropdownOpen,"aria-activedescendant":st,"aria-autocomplete":"list","aria-controls":Ke},reset:k.reset,refreshProducts:k.refreshProducts,prepareSubmit:k.prepareSubmit,getState:k.getState,recordSubmit:k.recordSubmit,dropdownProps:{suggestions:it?[{...it,options:g.dropdownOptions}]:[],activeIndex:g.activeDropdownIndex,onSelect:k.selectOption,onHighlight:k.setActiveDropdownIndex,onUnhighlight:k.clearHighlight,isOpen:g.isDropdownOpen,id:Ke,pills:lt,activeSelected:g.isActivePillSelected,onPillClick:k.setActivePill,onSkip:k.skipActivePill,showSkipButton:(D??!0)&&!ke&&!Oe,showOptionIcons:N??!0,showOptionImages:V??!0,showOptionCounts:Z??!0,skipDisabled:g.inSelectionAnimation,isLoading:dt,skeletonExiting:g.skeletonExiting,isInputEmpty:rt.trim().length===0,language:l,products:g.products,productImageFallback:S,onProductSelect:k.selectProduct,onProductAddToCart:He?k.addProductToCart:void 0,onProductFocusChange:k.setFocused,formatType:g.activeFormatType,dateView:g.dateView,selectedDateIso:je.selectedIso,selectedDateRange:je.selectedRange,dateRangeStart:je.rangeStart,onPreviousMonth:k.showPreviousMonth,onNextMonth:k.showNextMonth,timeView:g.timeView,multiSelectView:g.multiSelectView,onMultiSelectCommit:k.commitMultiSelect,onTimeChange:k.setTime,onTimeCommit:k.commitTime,locationView:g.locationView,onLocationQuery:k.setLocationQuery,onLocationMove:k.moveLocationHighlight,onLocationCommit:k.commitLocation,onLocationFocusChange:k.setLocationFieldFocused,isFocused:g.isFocused||g.locationFieldFocused,optionsPosition:p??"below"}}}var re=require("@magicx-eng/ai-autocomplete-vanilla"),M=require("react"),It;function ei(){if(It!==void 0)return It;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),It=e.contentEditable==="plaintext-only",It}function ma(e){let{segments:i,showChipIcons:t=!0,showChipImages:a=!0,newParamId:o,editingParam:r,editingIdentified:n,editingAnchor:l,caretOffset:f,placeholderText:x,isFocused:y,isDropdownOpen:m,listboxId:c,activeDescendantId:p,autoFocus:v,handleTextChange:O,handleKeyDown:G,handleCaretAfterInput:N,handleCaretMove:V,startEditingParam:Z,replaceEditingRange:D,setFocused:E}=e,S=(0,M.useRef)(null),ee=(0,M.useRef)(!1),te=(0,M.useRef)(""),U=(0,M.useRef)(""),K=(0,M.useRef)(null),fe=(0,M.useRef)(0);K.current=f,(0,M.useEffect)(()=>{if(!v)return;let w=S.current;if(!w)return;document.activeElement===w?E(!0):w.focus();let C=w.ownerDocument??document,T=C.getSelection(),L=T&&T.rangeCount>0&&w.contains(T.anchorNode);if(T&&!L){let z=C.createRange();z.selectNodeContents(w),z.collapse(!0),T.removeAllRanges(),T.addRange(z)}},[v,E]),(0,M.useEffect)(()=>{let w=S.current;if(!w)return;let C=w.ownerDocument??document,T=()=>{let L=C.getSelection();if(!L||L.rangeCount===0||!L.anchorNode||!w.contains(L.anchorNode))return;let z=L.anchorNode,J=z.nodeType===Node.ELEMENT_NODE?z:z.parentElement,we=(L.isCollapsed?J?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,Ie=r?.id??n?.id??null;if(we&&we!==Ie){Z(we);return}performance.now()-fe.current<50||V((0,re.getCursorOffset)(w))};return C.addEventListener("selectionchange",T),()=>C.removeEventListener("selectionchange",T)},[r,n,Z,V]),(0,M.useEffect)(()=>{let w=S.current;if(!w)return;let C=T=>{let L=(0,re.chipIdFromTap)(w,T.target);L&&(Z(L),(0,re.keepCaretOnChip)(w,L))};return w.addEventListener("click",C),()=>w.removeEventListener("click",C)},[Z]),(0,M.useLayoutEffect)(()=>{let w=S.current;w&&(0,re.renderEditableContent)({input:w,segments:i,newParamId:o,editingParamId:r?.id??null,placeholderText:x??"",isFocused:y,showChipIcons:t,showChipImages:a})},[i,o,r,x,y,t,a]),(0,M.useLayoutEffect)(()=>{let w=te.current,C=o??"";if(te.current=C,!C||C===w)return;let T=S.current;if(!T)return;T.focus();let L=K.current??(0,re.plainTextLength)(T);(0,re.setCursorOffset)(T,L)},[o]),(0,M.useLayoutEffect)(()=>{let w=U.current,C=r?.id??"";if(U.current=C,!C||C===w||l==null)return;let T=S.current;T&&(0,re.setCursorOffset)(T,l)},[r,l]);let I=(0,M.useCallback)(()=>{if(ee.current)return;let w=S.current;if(!w)return;let C=(0,re.extractPlainText)(w),L=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;O(L)},[O]),X=(0,M.useCallback)(()=>{fe.current=performance.now(),I();let w=S.current;w&&N((0,re.getCursorOffset)(w))},[I,N]);(0,M.useEffect)(()=>{let w=S.current;if(!w)return;let C=T=>{let L=T,z=L.inputType;if(z==="insertParagraph"||z==="insertLineBreak"||z==="insertFromDrop"){T.preventDefault();return}if(z.startsWith("insert")||z.startsWith("delete")){let J=z.startsWith("delete")?"":L.data??"";D(J)&&T.preventDefault()}};return w.addEventListener("beforeinput",C),()=>w.removeEventListener("beforeinput",C)},[D]);let h=(0,M.useCallback)(()=>{ee.current=!0,S.current?.setAttribute("data-aia-composing","true")},[]),A=(0,M.useCallback)(()=>{ee.current=!1,S.current?.removeAttribute("data-aia-composing"),I()},[I]),He=(0,M.useCallback)(w=>{w.preventDefault();let C=S.current;if(!C)return;let T=(w.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!T)return;let L=C.ownerDocument??document,z=L.getSelection();if(!z||z.rangeCount===0)return;let J=z.getRangeAt(0);if(!C.contains(J.startContainer))return;J.deleteContents();let be=L.createTextNode(T);J.insertNode(be),J.setStartAfter(be),J.collapse(!0),z.removeAllRanges(),z.addRange(J),I()},[I]),Je=(0,M.useCallback)(w=>G(w),[G]),_e=(0,M.useCallback)(()=>E(!0),[E]),b=(0,M.useCallback)(()=>E(!1),[E]),et=(0,M.useCallback)(()=>S.current?.focus(),[]),Ve=(0,M.useCallback)(()=>S.current?.blur(),[]),Ue=(0,M.useCallback)(()=>{let w=S.current;return w?(0,re.extractPlainText)(w):""},[]),Qe=ei()?"plaintext-only":"true";return{inputRef:S,editorProps:{ref:S,contentEditable:Qe,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":c,"aria-expanded":m,"aria-activedescendant":p,spellCheck:!0,enterKeyHint:"send",onInput:X,onKeyDown:Je,onCompositionStart:h,onCompositionEnd:A,onPaste:He,onFocus:_e,onBlur:b},getPlainText:Ue,focus:et,blur:Ve}}var Pe=require("react/jsx-runtime");function ti(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var ga=(0,_.forwardRef)(function({onSubmit:i,onResult:t,onError:a,optionOverrides:o,maskCompletedText:r,className:n,apiConfig:l,additionalContext:f,language:x,currency:y,productId:m,visitorId:c,columns:p,pillPlacement:v="dropdown",mode:O="auto",optionsPosition:G="below",animations:N=!0,dropdownTrigger:V,closeDropdownOnBlur:Z,showNonTappableOptions:D,locationSearch:E,showOptionIcons:S=!0,showChipIcons:ee=!0,showChipImages:te=!0,showOptionImages:U=!0,showOptionCounts:K=!0,showSkipButton:fe,showProducts:I,productsLayout:X,productImageFallback:h,autoFocus:A=!0,onFocus:He,onBlur:Je,value:_e,completedParams:b,onChange:et,onParamsChange:Ve,products:Ue,mapProducts:Qe,onProductSelect:w,onProductAddToCart:C,submitButton:T,resetOnSubmit:L=!0},z){let J=(0,_.useRef)(null),be=(0,_.useRef)(null),we=(0,_.useRef)(null),Ie=(0,_.useRef)(()=>{}),Ee=(0,_.useRef)(null),ve=(0,_.useRef)(null);(0,_.useEffect)(()=>{let F=J.current;if(F)return Ee.current?Ee.current.setMode(O):Ee.current=new Fe.ModeController(F,O),()=>{Ee.current?.destroy(),Ee.current=null}},[O]);let tt=(0,_.useCallback)(F=>{let ue=ve.current?.current;ue&&(ue.focus(),(0,Fe.setCursorOffset)(ue,F))},[]),{completedParams:ct,suggestionPills:Be,setActivePill:at,skipActivePill:nt,segments:We,newParamId:he,clearNewParamId:Ae,placeholderText:k,isFocused:u,isDropdownOpen:ae,isActivePillSelected:Le,isLoading:g,isReady:rt,activeIndex:Ge,listboxId:Re,handleTextChange:pt,handleKeyDown:ht,setFocused:Ke,editingParam:st,editingIdentified:ke,editingAnchor:Oe,caretOffset:Ye,startEditingParam:it,handleCaretAfterInput:lt,handleCaretMove:je,replaceEditingRange:dt,dropdownProps:d,reset:P,refreshProducts:B,prepareSubmit:wt,getState:Ft,recordSubmit:Ht}=Pt({onSubmit:F=>Ie.current(F),onResult:t,onError:a,optionOverrides:o,maskCompletedText:r,apiConfig:l,additionalContext:f,language:x,currency:y,productId:m,visitorId:c,columns:p,dropdownTrigger:V,optionsPosition:G,closeDropdownOnBlur:Z,showNonTappableOptions:D,locationSearch:E,showOptionIcons:S,showOptionImages:U,showOptionCounts:K,showSkipButton:fe,showProducts:I,onFocus:He,onBlur:Je,value:_e,completedParams:b,onChange:et,onParamsChange:Ve,products:Ue,mapProducts:Qe,onProductSelect:w,onProductAddToCart:C,source:"full-sdk",setCursor:tt});(0,_.useEffect)(()=>{if(!he)return;let F=window.setTimeout(()=>Ae(),650);return()=>window.clearTimeout(F)},[he,Ae]);let fa=Ge>=0?`${Re}-option-${Ge}`:void 0,{inputRef:Et,editorProps:ba,focus:vt,blur:Bt,getPlainText:Wt}=ma({segments:We,newParamId:he,editingParam:st,editingIdentified:ke,editingAnchor:Oe,caretOffset:Ye,placeholderText:k,isFocused:u,showChipIcons:ee,showChipImages:te,isDropdownOpen:ae,listboxId:Re,activeDescendantId:fa,autoFocus:A,handleTextChange:pt,handleKeyDown:ht,handleCaretAfterInput:lt,handleCaretMove:je,startEditingParam:it,replaceEditingRange:dt,setFocused:Ke});ve.current=Et,(0,_.useLayoutEffect)(()=>{let F=be.current,ue=Et.current;if(!F||!ue)return;let mt=()=>{let Kt=F.firstElementChild;if(!Kt)return;let ya=Kt.getBoundingClientRect(),ka=ue.getBoundingClientRect();ya.top>=ka.bottom-2?F.setAttribute("data-aia-pill-wrapped",""):F.removeAttribute("data-aia-pill-wrapped")};mt();let Gt=new ResizeObserver(mt);return Gt.observe(ue),()=>Gt.disconnect()},[We,Be.length,g,Et]),(0,_.useEffect)(()=>{let F=we.current;if(F)return(0,Fe.watchEditorHeight)(F)},[]),(0,_.useImperativeHandle)(z,()=>({focus:vt,blur:Bt,reset:P,refreshProducts:B,setMode:F=>Ee.current?.setMode(F),skipActivePill:nt}),[vt,Bt,P,B,nt]);let ut=!!We.length||ct.length>0,At=(0,_.useCallback)(F=>{if(!ut)return;F&&wt();let ue=Ft(),mt=(0,Fe.buildSubmitResult)(Wt(),ue.completedParams,ue.skippedParams,{identifiedParams:ue.identifiedParams,isReady:ue.isReady,customFields:ue.customFields});F&&Ht(mt),i(mt),L&&P()},[Ht,L,ut,wt,Ft,i,P,Wt]);Ie.current=()=>At(!1);let wa=(0,_.useCallback)(F=>{F.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||vt()},[vt]),va=v==="inline",xa=v==="dropdown";return(0,Pe.jsxs)("div",{ref:J,className:`magicx-aia ${ot.container} ${n??""}`,"data-pill-placement":v,"data-options-position":G,"data-animations":N?"on":"off","data-mode":ti(O),children:[(0,Pe.jsx)(St,{...d,showPills:xa,productsLayout:X,productImageFallback:h}),(0,Pe.jsxs)("div",{className:ot.inputWrapper,"data-aia-input-wrapper":"",onClick:wa,children:[(0,Pe.jsxs)("div",{ref:we,className:ot.editorArea,"data-aia-editor":"",children:[(0,Pe.jsx)("div",{...ba,className:ot.input,"data-aia-input":""}),va&&(g||Be.length>0)&&(0,Pe.jsx)("span",{ref:be,className:ot.pillListContainer,"data-aia-pill-list-container":"",children:(0,Pe.jsx)(kt,{pills:Be,activePillIndex:0,activeSelected:Le,onSelectPill:at,loading:g})})]}),T===null?null:T===void 0?(0,Pe.jsx)(ca,{disabled:!ut,ready:ut&&rt,onClick:()=>At(!0),label:(0,Fe.uiStringsFor)(x).submit}):(0,Pe.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:ot.submitSlot,onClick:F=>{ut&&(F.stopPropagation(),At(!0))},children:T})]})]})});0&&(module.exports={AIAutocomplete,AIAutocompleteDropdown,DATE_RANGE_META_END,DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY,PRODUCT_PATH_PREFIX,TIME_META_KEY,WEEKDAY_LABELS,buildSubmitResult,cellDay,cellIso,dateCellMarks,formatDate,formatDateRange,formatOptionCount,formatPlace,formatTime,isoDate,monthLabel,optionCountLabel,optionHasImage,optionImageSources,optionImageSrc,optionLabel,optionsShowLeadingVisuals,parseDate,parseLooseDate,parseLooseDateRange,parseTime,productFromMatchedItem,productImageSources,productsFromCustomFields,sanitizeOptionIconSvg,selectedRangeFor,useAIAutocomplete,visibleDateRange,withSkippedParams});
|
|
3207
|
+
`,document.head.appendChild(e)}var la={submitButton:"aia-submitButton-otz7H"};var Tt=require("react/jsx-runtime");function ca({disabled:e,ready:i,onClick:t,label:a=(0,da.uiStringsFor)().submit}){return(0,Tt.jsx)("button",{type:"button","data-aia-submit":"",className:la.submitButton,disabled:e,"data-aia-ready":i?"":void 0,onClick:o=>{o.stopPropagation(),t()},"aria-label":a,children:(0,Tt.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":a,children:(0,Tt.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var Xe=require("@magicx-eng/ai-autocomplete-vanilla"),R=require("react");var zt=require("react");function pa(e){let i=(0,zt.useRef)(e);i.current=e;let t=Object.keys(e??{}).sort().join("\0"),a=(0,zt.useRef)({key:"",overrides:void 0});if(a.current.key!==t){let o={};for(let r of Object.keys(e??{})){let n=(l,f,x)=>{let y=i.current?.[r];return y?y(l,f,x):[]};o[r]=n}a.current={key:t,overrides:e?o:void 0}}return{overrides:a.current.overrides,key:t}}var Nt=require("react");function ha(e){let i=(0,Nt.useRef)(e);i.current=e;let t=(0,Nt.useRef)(null);t.current===null&&(t.current={fetch:(o,r)=>{let n=i.current;return n?n.fetch(o,r):Promise.reject(new Error("products config removed"))},transform:o=>i.current?.transform(o)??[],get limit(){return i.current?.limit}});let a=e!==void 0;return{config:a?t.current:void 0,enabled:a}}var ua={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:"",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 Pt({onSubmit:e,onResult:i,onError:t,optionOverrides:a,maskCompletedText:o,apiConfig:r,additionalContext:n,language:l,currency:f,productId:x,visitorId:y,columns:m=2,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:v,showNonTappableOptions:O,locationSearch:G,showOptionIcons:N,showOptionImages:U,showOptionCounts:Z,showSkipButton:D,showProducts:E,productImageFallback:S="image",onFocus:ee,onBlur:te,value:V,completedParams:K,onChange:fe,onParamsChange:I,products:X,mapProducts:h,onProductSelect:A,onProductAddToCart:He,source:Je,setCursor:_e}){let b=(0,R.useRef)(null),[et,Ue]=(0,R.useState)(null),Ve=(0,R.useRef)(e);Ve.current=e;let Qe=(0,R.useRef)(i);Qe.current=i;let w=(0,R.useRef)(t);w.current=t;let C=(0,R.useRef)(fe);C.current=fe;let T=(0,R.useRef)(I);T.current=I;let L=(0,R.useRef)(ee);L.current=ee;let z=(0,R.useRef)(te);z.current=te;let J=(0,R.useRef)(_e);J.current=_e;let be=(0,R.useRef)(A);be.current=A;let we=(0,R.useRef)(He);we.current=He;let Ie=(0,R.useRef)(y);Ie.current=y;let Ee=(0,R.useRef)(()=>{let d=Ie.current;return typeof d=="function"?d():d}).current,ve=ha(X),tt=(0,R.useRef)(h);tt.current=h;let ct=(0,R.useRef)((d,P)=>{let B=tt.current;return B?B(d,P):d}).current,Be=h?ct:void 0,at=pa(a);(0,R.useEffect)(()=>{if(typeof document>"u")return;let d=new Xe.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:r,additionalContext:n,language:l,currency:f,productId:x,visitorId:Ee,optionOverrides:at.overrides,maskCompletedText:o,columns:m,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:v,showNonTappableOptions:O,locationSearch:G,showProducts:E,source:Je,value:V,completedParams:K,onSubmit:(...B)=>Ve.current?.(...B),onResult:(...B)=>Qe.current?.(...B),onError:(...B)=>w.current?.(...B),onChange:(...B)=>C.current?.(...B),onParamsChange:(...B)=>T.current?.(...B),onFocus:()=>L.current?.(),onBlur:()=>z.current?.(),onProductSelect:B=>be.current?.(B),onProductAddToCart:B=>we.current?.(B),setCursor:B=>J.current?.(B),products:ve.config,mapProducts:Be});b.current=d,Ue(d.getState());let P=d.subscribe(B=>Ue(B));return()=>{P(),d.destroy(),b.current===d&&(b.current=null)}},[]),(0,R.useEffect)(()=>{V!==void 0&&b.current?.setValue(V)},[V]),(0,R.useEffect)(()=>{K!==void 0&&b.current?.setCompletedParams(K)},[K]);let nt=JSON.stringify(r??null),We;try{We=JSON.stringify(n??null)}catch{We="[unstringifiable]"}(0,R.useEffect)(()=>{b.current?.update({apiConfig:r,additionalContext:n,language:l,currency:f,productId:x,optionOverrides:at.overrides,dropdownTrigger:c,optionsPosition:p,closeDropdownOnBlur:v,showNonTappableOptions:O,locationSearch:G,showProducts:E})},[nt,We,l,f?.code,f?.rate,f?.country,x,at.key,c,p,v,O,G,E]);let he=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(!he.current){he.current=!0;return}b.current?.update({products:ve.config})},[ve.enabled]),(0,R.useEffect)(()=>{b.current?.update({mapProducts:Be})},[Be]);let Ae=(0,R.useRef)(null);Ae.current===null&&(Ae.current={handleTextChange:d=>b.current?.handleTextChange(d),handleKeyDown:d=>{let P="nativeEvent"in d?d.nativeEvent:d;b.current?.handleKeyDown(P)},setFocused:d=>b.current?.setFocused(d),startEditingParam:d=>b.current?.startEditingParam(d),exitEditMode:()=>b.current?.exitEditMode(),handleCaretAfterInput:d=>b.current?.handleCaretAfterInput(d),handleCaretMove:d=>b.current?.handleCaretMove(d),replaceEditingRange:d=>b.current?.replaceEditingRange(d)??!1,setActivePill:d=>b.current?.setActivePill(d),skipActivePill:()=>b.current?.skipActivePill(),removeLastParam:()=>b.current?.removeLastParam(),clearNewParamId:()=>b.current?.clearNewParamId(),reset:()=>b.current?.reset(),refreshProducts:()=>b.current?.refreshProducts(),prepareSubmit:()=>b.current?.prepareSubmit(),getState:()=>b.current?.getState()??ua,recordSubmit:d=>b.current?.recordSubmit(d),selectOption:(d,P)=>b.current?.selectOption(d,P),selectProduct:d=>b.current?.selectProduct(d),addProductToCart:d=>{let P=b.current;return!P||!we.current?Promise.resolve():P.addProductToCart(d)},setActiveDropdownIndex:d=>b.current?.setActiveDropdownIndex(d),clearHighlight:d=>b.current?.clearHighlight(d),showPreviousMonth:()=>b.current?.showPreviousMonth(),showNextMonth:()=>b.current?.showNextMonth(),setTime:d=>b.current?.setTime(d),commitTime:()=>b.current?.commitTime(),toggleMultiSelectOption:d=>b.current?.toggleMultiSelectOption(d),commitMultiSelect:()=>b.current?.commitMultiSelect(),setLocationQuery:d=>b.current?.setLocationQuery(d),moveLocationHighlight:d=>b.current?.moveLocationHighlight(d),commitLocation:d=>b.current?.commitLocation(d),setLocationFieldFocused:d=>b.current?.setLocationFieldFocused(d),handleFocus:()=>b.current?.setFocused(!0),handleBlur:()=>b.current?.setFocused(!1)});let k=Ae.current,u=(0,R.useCallback)(d=>{let P=d.target.value,wt=P.length>0&&!d.nativeEvent?.isComposing&&P[0]!==P[0].toUpperCase()?P[0].toUpperCase()+P.slice(1):P;b.current?.handleTextChange(wt)},[]),ae=(0,R.useCallback)(d=>{b.current?.handleKeyDown(d.nativeEvent)},[]),Le=b.current,g=et??ua,rt=V!==void 0?V:g.text,Ge=K!==void 0?K:g.completedParams,Re=g.actionableSuggestions,pt=Re[0],ht=(0,Xe.withoutTraditionalAutocomplete)(Re),Ke=Le?.listboxId??"",st=g.activeDropdownIndex>=0&&Le?`${Ke}-option-${g.activeDropdownIndex}`:void 0,ke=g.editingParam,Oe=g.editingIdentified,Ye=ke?{parameter:ke.suggestionParameter,text:ke.suggestionPlaceholder,required:!0,options:ke.options}:Oe?{parameter:Oe.parameter,text:(0,Xe.identifiedParamLabel)(Oe.parameter),required:!0,options:[]}:null,it=g.dropdownSuggestion??Ye??pt,lt=Ye?[Ye]:Re,je=(0,Xe.dateSelectionFor)(g),dt=!Le||g.dropdownLoading;return{completedParams:Ge,multiSelectView:g.multiSelectView,toggleMultiSelectOption:k.toggleMultiSelectOption,commitMultiSelect:k.commitMultiSelect,skippedParams:g.skippedParams,identifiedParams:g.identifiedParams,suggestionPills:ht,setActivePill:k.setActivePill,skipActivePill:k.skipActivePill,removeLastParam:k.removeLastParam,segments:g.segments,newParamId:g.newParamId,clearNewParamId:k.clearNewParamId,suggestions:g.suggestions,activeIndex:g.activeDropdownIndex,isReady:g.isReady,isLoading:dt,isFocused:g.isFocused,isDropdownOpen:g.isDropdownOpen,isActivePillSelected:g.isActivePillSelected,placeholderText:g.placeholderText,listboxId:Ke,error:g.error,products:g.products,customFields:g.customFields,selectProduct:k.selectProduct,addProductToCart:k.addProductToCart,handleTextChange:k.handleTextChange,handleKeyDown:k.handleKeyDown,setFocused:k.setFocused,editingParam:ke,editingIdentified:Oe,editingAnchor:g.editingAnchor,caretOffset:g.caretOffset,startEditingParam:k.startEditingParam,exitEditMode:k.exitEditMode,handleCaretAfterInput:k.handleCaretAfterInput,handleCaretMove:k.handleCaretMove,replaceEditingRange:k.replaceEditingRange,inputProps:{value:rt,placeholder:g.placeholderText||void 0,onChange:u,onKeyDown:ae,onFocus:k.handleFocus,onBlur:k.handleBlur,role:"combobox","aria-expanded":g.isDropdownOpen,"aria-activedescendant":st,"aria-autocomplete":"list","aria-controls":Ke},reset:k.reset,refreshProducts:k.refreshProducts,prepareSubmit:k.prepareSubmit,getState:k.getState,recordSubmit:k.recordSubmit,dropdownProps:{suggestions:it?[{...it,options:g.dropdownOptions}]:[],activeIndex:g.activeDropdownIndex,onSelect:k.selectOption,onHighlight:k.setActiveDropdownIndex,onUnhighlight:k.clearHighlight,isOpen:g.isDropdownOpen,id:Ke,pills:lt,activeSelected:g.isActivePillSelected,onPillClick:k.setActivePill,onSkip:k.skipActivePill,showSkipButton:(D??!0)&&!ke&&!Oe,showOptionIcons:N??!0,showOptionImages:U??!0,showOptionCounts:Z??!0,skipDisabled:g.inSelectionAnimation,isLoading:dt,skeletonExiting:g.skeletonExiting,isInputEmpty:rt.trim().length===0,language:l,products:g.products,productImageFallback:S,onProductSelect:k.selectProduct,onProductAddToCart:He?k.addProductToCart:void 0,onProductFocusChange:k.setFocused,formatType:g.activeFormatType,dateView:g.dateView,selectedDateIso:je.selectedIso,selectedDateRange:je.selectedRange,dateRangeStart:je.rangeStart,onPreviousMonth:k.showPreviousMonth,onNextMonth:k.showNextMonth,timeView:g.timeView,multiSelectView:g.multiSelectView,onMultiSelectCommit:k.commitMultiSelect,onTimeChange:k.setTime,onTimeCommit:k.commitTime,locationView:g.locationView,onLocationQuery:k.setLocationQuery,onLocationMove:k.moveLocationHighlight,onLocationCommit:k.commitLocation,onLocationFocusChange:k.setLocationFieldFocused,isFocused:g.isFocused||g.locationFieldFocused,optionsPosition:p??"below"}}}var re=require("@magicx-eng/ai-autocomplete-vanilla"),M=require("react"),It;function ei(){if(It!==void 0)return It;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),It=e.contentEditable==="plaintext-only",It}function ma(e){let{segments:i,showChipIcons:t=!0,showChipImages:a=!0,newParamId:o,editingParam:r,editingIdentified:n,editingAnchor:l,caretOffset:f,placeholderText:x,isFocused:y,isDropdownOpen:m,listboxId:c,activeDescendantId:p,autoFocus:v,handleTextChange:O,handleKeyDown:G,handleCaretAfterInput:N,handleCaretMove:U,startEditingParam:Z,replaceEditingRange:D,setFocused:E}=e,S=(0,M.useRef)(null),ee=(0,M.useRef)(!1),te=(0,M.useRef)(""),V=(0,M.useRef)(""),K=(0,M.useRef)(null),fe=(0,M.useRef)(0);K.current=f,(0,M.useEffect)(()=>{if(!v)return;let w=S.current;if(!w)return;document.activeElement===w?E(!0):w.focus();let C=w.ownerDocument??document,T=C.getSelection(),L=T&&T.rangeCount>0&&w.contains(T.anchorNode);if(T&&!L){let z=C.createRange();z.selectNodeContents(w),z.collapse(!0),T.removeAllRanges(),T.addRange(z)}},[v,E]),(0,M.useEffect)(()=>{let w=S.current;if(!w)return;let C=w.ownerDocument??document,T=()=>{let L=C.getSelection();if(!L||L.rangeCount===0||!L.anchorNode||!w.contains(L.anchorNode))return;let z=L.anchorNode,J=z.nodeType===Node.ELEMENT_NODE?z:z.parentElement,we=(L.isCollapsed?J?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,Ie=r?.id??n?.id??null;if(we&&we!==Ie){Z(we);return}performance.now()-fe.current<50||U((0,re.getCursorOffset)(w))};return C.addEventListener("selectionchange",T),()=>C.removeEventListener("selectionchange",T)},[r,n,Z,U]),(0,M.useEffect)(()=>{let w=S.current;if(!w)return;let C=T=>{let L=(0,re.chipIdFromTap)(w,T.target);L&&(Z(L),(0,re.keepCaretOnChip)(w,L))};return w.addEventListener("click",C),()=>w.removeEventListener("click",C)},[Z]),(0,M.useLayoutEffect)(()=>{let w=S.current;w&&(0,re.renderEditableContent)({input:w,segments:i,newParamId:o,editingParamId:r?.id??null,placeholderText:x??"",isFocused:y,showChipIcons:t,showChipImages:a})},[i,o,r,x,y,t,a]),(0,M.useLayoutEffect)(()=>{let w=te.current,C=o??"";if(te.current=C,!C||C===w)return;let T=S.current;if(!T)return;T.focus();let L=K.current??(0,re.plainTextLength)(T);(0,re.setCursorOffset)(T,L)},[o]),(0,M.useLayoutEffect)(()=>{let w=V.current,C=r?.id??"";if(V.current=C,!C||C===w||l==null)return;let T=S.current;T&&(0,re.setCursorOffset)(T,l)},[r,l]);let I=(0,M.useCallback)(()=>{if(ee.current)return;let w=S.current;if(!w)return;let C=(0,re.extractPlainText)(w),L=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;O(L)},[O]),X=(0,M.useCallback)(()=>{fe.current=performance.now(),I();let w=S.current;w&&N((0,re.getCursorOffset)(w))},[I,N]);(0,M.useEffect)(()=>{let w=S.current;if(!w)return;let C=T=>{let L=T,z=L.inputType;if(z==="insertParagraph"||z==="insertLineBreak"||z==="insertFromDrop"){T.preventDefault();return}if(z.startsWith("insert")||z.startsWith("delete")){let J=z.startsWith("delete")?"":L.data??"";D(J)&&T.preventDefault()}};return w.addEventListener("beforeinput",C),()=>w.removeEventListener("beforeinput",C)},[D]);let h=(0,M.useCallback)(()=>{ee.current=!0,S.current?.setAttribute("data-aia-composing","true")},[]),A=(0,M.useCallback)(()=>{ee.current=!1,S.current?.removeAttribute("data-aia-composing"),I()},[I]),He=(0,M.useCallback)(w=>{w.preventDefault();let C=S.current;if(!C)return;let T=(w.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!T)return;let L=C.ownerDocument??document,z=L.getSelection();if(!z||z.rangeCount===0)return;let J=z.getRangeAt(0);if(!C.contains(J.startContainer))return;J.deleteContents();let be=L.createTextNode(T);J.insertNode(be),J.setStartAfter(be),J.collapse(!0),z.removeAllRanges(),z.addRange(J),I()},[I]),Je=(0,M.useCallback)(w=>G(w),[G]),_e=(0,M.useCallback)(()=>E(!0),[E]),b=(0,M.useCallback)(()=>E(!1),[E]),et=(0,M.useCallback)(()=>S.current?.focus(),[]),Ue=(0,M.useCallback)(()=>S.current?.blur(),[]),Ve=(0,M.useCallback)(()=>{let w=S.current;return w?(0,re.extractPlainText)(w):""},[]),Qe=ei()?"plaintext-only":"true";return{inputRef:S,editorProps:{ref:S,contentEditable:Qe,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":c,"aria-expanded":m,"aria-activedescendant":p,spellCheck:!0,enterKeyHint:"send",onInput:X,onKeyDown:Je,onCompositionStart:h,onCompositionEnd:A,onPaste:He,onFocus:_e,onBlur:b},getPlainText:Ve,focus:et,blur:Ue}}var Pe=require("react/jsx-runtime");function ti(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var ga=(0,_.forwardRef)(function({onSubmit:i,onResult:t,onError:a,optionOverrides:o,maskCompletedText:r,className:n,apiConfig:l,additionalContext:f,language:x,currency:y,productId:m,visitorId:c,columns:p,pillPlacement:v="dropdown",mode:O="auto",optionsPosition:G="below",animations:N=!0,dropdownTrigger:U,closeDropdownOnBlur:Z,showNonTappableOptions:D,locationSearch:E,showOptionIcons:S=!0,showChipIcons:ee=!0,showChipImages:te=!0,showOptionImages:V=!0,showOptionCounts:K=!0,showSkipButton:fe,showProducts:I,productsLayout:X,productImageFallback:h,autoFocus:A=!0,onFocus:He,onBlur:Je,value:_e,completedParams:b,onChange:et,onParamsChange:Ue,products:Ve,mapProducts:Qe,onProductSelect:w,onProductAddToCart:C,submitButton:T,resetOnSubmit:L=!0},z){let J=(0,_.useRef)(null),be=(0,_.useRef)(null),we=(0,_.useRef)(null),Ie=(0,_.useRef)(()=>{}),Ee=(0,_.useRef)(null),ve=(0,_.useRef)(null);(0,_.useEffect)(()=>{let F=J.current;if(F)return Ee.current?Ee.current.setMode(O):Ee.current=new Fe.ModeController(F,O),()=>{Ee.current?.destroy(),Ee.current=null}},[O]);let tt=(0,_.useCallback)(F=>{let ue=ve.current?.current;ue&&(ue.focus(),(0,Fe.setCursorOffset)(ue,F))},[]),{completedParams:ct,suggestionPills:Be,setActivePill:at,skipActivePill:nt,segments:We,newParamId:he,clearNewParamId:Ae,placeholderText:k,isFocused:u,isDropdownOpen:ae,isActivePillSelected:Le,isLoading:g,isReady:rt,activeIndex:Ge,listboxId:Re,handleTextChange:pt,handleKeyDown:ht,setFocused:Ke,editingParam:st,editingIdentified:ke,editingAnchor:Oe,caretOffset:Ye,startEditingParam:it,handleCaretAfterInput:lt,handleCaretMove:je,replaceEditingRange:dt,dropdownProps:d,reset:P,refreshProducts:B,prepareSubmit:wt,getState:Ft,recordSubmit:Ht}=Pt({onSubmit:F=>Ie.current(F),onResult:t,onError:a,optionOverrides:o,maskCompletedText:r,apiConfig:l,additionalContext:f,language:x,currency:y,productId:m,visitorId:c,columns:p,dropdownTrigger:U,optionsPosition:G,closeDropdownOnBlur:Z,showNonTappableOptions:D,locationSearch:E,showOptionIcons:S,showOptionImages:V,showOptionCounts:K,showSkipButton:fe,showProducts:I,onFocus:He,onBlur:Je,value:_e,completedParams:b,onChange:et,onParamsChange:Ue,products:Ve,mapProducts:Qe,onProductSelect:w,onProductAddToCart:C,source:"full-sdk",setCursor:tt});(0,_.useEffect)(()=>{if(!he)return;let F=window.setTimeout(()=>Ae(),650);return()=>window.clearTimeout(F)},[he,Ae]);let fa=Ge>=0?`${Re}-option-${Ge}`:void 0,{inputRef:Et,editorProps:ba,focus:vt,blur:Bt,getPlainText:Wt}=ma({segments:We,newParamId:he,editingParam:st,editingIdentified:ke,editingAnchor:Oe,caretOffset:Ye,placeholderText:k,isFocused:u,showChipIcons:ee,showChipImages:te,isDropdownOpen:ae,listboxId:Re,activeDescendantId:fa,autoFocus:A,handleTextChange:pt,handleKeyDown:ht,handleCaretAfterInput:lt,handleCaretMove:je,startEditingParam:it,replaceEditingRange:dt,setFocused:Ke});ve.current=Et,(0,_.useLayoutEffect)(()=>{let F=be.current,ue=Et.current;if(!F||!ue)return;let mt=()=>{let Kt=F.firstElementChild;if(!Kt)return;let ya=Kt.getBoundingClientRect(),ka=ue.getBoundingClientRect();ya.top>=ka.bottom-2?F.setAttribute("data-aia-pill-wrapped",""):F.removeAttribute("data-aia-pill-wrapped")};mt();let Gt=new ResizeObserver(mt);return Gt.observe(ue),()=>Gt.disconnect()},[We,Be.length,g,Et]),(0,_.useEffect)(()=>{let F=we.current;if(F)return(0,Fe.watchEditorHeight)(F)},[]),(0,_.useImperativeHandle)(z,()=>({focus:vt,blur:Bt,reset:P,refreshProducts:B,setMode:F=>Ee.current?.setMode(F),skipActivePill:nt}),[vt,Bt,P,B,nt]);let ut=!!We.length||ct.length>0,At=(0,_.useCallback)(F=>{if(!ut)return;F&&wt();let ue=Ft(),mt=(0,Fe.buildSubmitResult)(Wt(),ue.completedParams,ue.skippedParams,{identifiedParams:ue.identifiedParams,isReady:ue.isReady,customFields:ue.customFields});F&&Ht(mt),i(mt),L&&P()},[Ht,L,ut,wt,Ft,i,P,Wt]);Ie.current=()=>At(!1);let wa=(0,_.useCallback)(F=>{F.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||vt()},[vt]),va=v==="inline",xa=v==="dropdown";return(0,Pe.jsxs)("div",{ref:J,className:`magicx-aia ${ot.container} ${n??""}`,"data-pill-placement":v,"data-options-position":G,"data-animations":N?"on":"off","data-mode":ti(O),children:[(0,Pe.jsx)(St,{...d,showPills:xa,productsLayout:X,productImageFallback:h}),(0,Pe.jsxs)("div",{className:ot.inputWrapper,"data-aia-input-wrapper":"",onClick:wa,children:[(0,Pe.jsxs)("div",{ref:we,className:ot.editorArea,"data-aia-editor":"",children:[(0,Pe.jsx)("div",{...ba,className:ot.input,"data-aia-input":""}),va&&(g||Be.length>0)&&(0,Pe.jsx)("span",{ref:be,className:ot.pillListContainer,"data-aia-pill-list-container":"",children:(0,Pe.jsx)(kt,{pills:Be,activePillIndex:0,activeSelected:Le,onSelectPill:at,loading:g})})]}),T===null?null:T===void 0?(0,Pe.jsx)(ca,{disabled:!ut,ready:ut&&rt,onClick:()=>At(!0),label:(0,Fe.uiStringsFor)(x).submit}):(0,Pe.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:ot.submitSlot,onClick:F=>{ut&&(F.stopPropagation(),At(!0))},children:T})]})]})});0&&(module.exports={AIAutocomplete,AIAutocompleteDropdown,DATE_RANGE_META_END,DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY,PRODUCT_PATH_PREFIX,TIME_META_KEY,WEEKDAY_LABELS,buildSubmitResult,cellDay,cellIso,dateCellMarks,formatDate,formatDateRange,formatOptionCount,formatPlace,formatTime,isoDate,monthLabel,optionCountLabel,optionHasImage,optionImageSources,optionImageSrc,optionLabel,optionsShowLeadingVisuals,parseDate,parseLooseDate,parseLooseDateRange,parseTime,productFromMatchedItem,productImageSources,productsFromCustomFields,sanitizeOptionIconSvg,selectedRangeFor,useAIAutocomplete,visibleDateRange,withSkippedParams});
|
|
3188
3208
|
//# sourceMappingURL=index.js.map
|