@magicx-eng/ai-autocomplete-react 0.64.0 → 0.65.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @magicx-eng/ai-autocomplete-react
2
2
 
3
- AI Autocomplete for React: an input and dropdown for search boxes and other
3
+ Intent-1 for React: an input and dropdown for search boxes and other
4
4
  text inputs. As the user types, it suggests the next detail to add and the
5
5
  options for it. Built on `@magicx-eng/ai-autocomplete-vanilla`.
6
6
 
@@ -31,10 +31,10 @@ Next.js App Router, mark the file that renders it `"use client"`.
31
31
 
32
32
  To get a key, create your product at https://ai-autocomplete.com/edit/logic (it sets what the box suggests), then create a public key at https://ai-autocomplete.com/account/keys. Public keys start with `pk_v1_` and are safe to ship in the browser.
33
33
 
34
- - Docs: https://ai-autocomplete.com/docs/react/getting-started
34
+ - Docs: https://magicx.ai/intent-1/docs/react/getting-started
35
35
  - Install with an AI coding agent: https://ai-autocomplete.com/install/react.md
36
36
  - Product strip and datepicker guides: [REFERENCE.md](https://unpkg.com/@magicx-eng/ai-autocomplete-react/REFERENCE.md), also shipped in the package
37
- - On Shopify? The Shopify app sets this up in a few minutes, no code: https://apps.shopify.com/ai-autocomplete
37
+ - On Shopify? Install [AI Search, by Intent-1](https://apps.shopify.com/ai-autocomplete) to set this up without code.
38
38
 
39
39
  ## Features
40
40
 
package/REFERENCE.md CHANGED
@@ -10,6 +10,7 @@ Longer guides that do not fit in the [README](https://unpkg.com/@magicx-eng/ai-a
10
10
  - [Location search](#location-search)
11
11
  - [CSS variables](#css-variables)
12
12
  - [Visitor id kept by the SDK](#visitor-id-kept-by-the-sdk)
13
+ - [Search id](#search-id)
13
14
 
14
15
  ## Product strip
15
16
 
@@ -654,7 +655,7 @@ The full input also accepts `--aia-input-radius` and `--aia-written-text-font-we
654
655
  | `--aia-dropdown-offset` | `13px` | `13px` | Gap between the input box and the dropdown (the dropdown's margin toward the input). |
655
656
  | `--aia-content-inset-left` | `16px` | `16px` | Left inset of the SDK's content: the input wrapper's left padding, and the line the dropdown's content (parameter label, option text, product strip) starts on. Set it when you pad the field to clear a leading icon of your own, so the dropdown's content stays aligned under the typed text. Practical minimum is `10px` (the option text's own inset); both surfaces floor it there. |
656
657
  | `--aia-footer-gap` | `12px` | `12px` | Breathing room above the dropdown footer (badge / keyboard hints), additive to the dropdown's 8px section gap. |
657
- | `--aia-footer-chip-bg` | `--aia-surface` at 65% | `--aia-surface` at 65% | Fill behind the footer's keyboard hint and AI-Autocomplete badge. The option list scrolls under the footer, so this keeps both legible over the row passing behind them. `transparent` on the glass surface. |
658
+ | `--aia-footer-chip-bg` | `--aia-surface` at 65% | `--aia-surface` at 65% | Fill behind the footer's keyboard hint and "Powered by Intent-1" badge. The option list scrolls under the footer, so this keeps both legible over the row passing behind them. `transparent` on the glass surface. |
658
659
  | `--aia-dropdown-bg` | — | — | Optional bg color the dropdown's "glass" rim shadow tints toward. Set this to the page background behind the dropdown so the bottom-corner glow blends seamlessly. |
659
660
  | `--aia-scrollbar-track` | `rgba(15, 23, 42, 0.05)` | `rgba(255, 255, 255, 0.08)` | The floating options box's thin scrollbar track, shown while a long list overflows. |
660
661
  | `--aia-scrollbar-thumb` | `rgba(15, 23, 42, 0.22)` | `rgba(255, 255, 255, 0.28)` | That scrollbar's thumb. |
@@ -737,3 +738,19 @@ Without `visitorId`, the SDK can keep the id for you. Pass `analyticsConsent` so
737
738
  ```
738
739
 
739
740
  Apply a changed choice at once with the handle's `refreshAnalyticsConsent()` (or the hook's), rather than at the next event. `getVisitorId()` on the handle or the hook returns the id the events carry, so you can send it with your own events. It is `undefined` before the first response and whenever there is no id.
741
+
742
+ ## Search id
743
+
744
+ Each search gets its own id, so what happens after it (a results page, a cart, an order) can be tied to the exact search. The SDK makes it: a new one starts with the widget, on `reset()`, and with the shopper's next input after a submit or a product pick. It rides on the SDK's own requests and events once the feature is enabled for your account; until then `getSearchId()` returns `undefined`.
745
+
746
+ Read it where the search is handed off, before the shopper types again:
747
+
748
+ ```ts
749
+ // The Tier 1 handle (ref) and the hook both have getSearchId().
750
+ onSubmit: (result) => {
751
+ const searchId = handle.getSearchId();
752
+ // Carry it to your results page, and send it with the events that follow.
753
+ },
754
+ ```
755
+
756
+ The id of the last search the current tab handed off (a submit or a product pick) is also kept in `sessionStorage` under `aia:last-search`, as `{ id, at }`, where `at` is when it was handed off, in milliseconds since the epoch.
package/dist/index.d.mts CHANGED
@@ -27,6 +27,8 @@ interface AIAutocompleteHandle {
27
27
  * still on the page (a quick view opened, inline results drawn).
28
28
  */
29
29
  endSubmitProgress: () => void;
30
+ /** The search in progress, or `undefined` until the feature is enabled for your account. Read it in your submit or product handler. */
31
+ getSearchId: () => string | undefined;
30
32
  /** The visitor id the events carry right now, or `undefined` while there is none. */
31
33
  getVisitorId: () => string | undefined;
32
34
  /** Reads `analyticsConsent` again now, after the visitor changes their choice. */
@@ -566,6 +568,8 @@ interface UseAIAutocompleteReturn {
566
568
  * still on the page (a quick view opened, inline results drawn).
567
569
  */
568
570
  endSubmitProgress: () => void;
571
+ /** The search in progress, or `undefined` until the feature is enabled for your account. Read it in your submit or product handler. */
572
+ getSearchId: () => string | undefined;
569
573
  /** The visitor id the events carry right now, or `undefined` while there is none. */
570
574
  getVisitorId: () => string | undefined;
571
575
  /** Reads `analyticsConsent` again now, after the visitor changes their choice. */
package/dist/index.d.ts CHANGED
@@ -27,6 +27,8 @@ interface AIAutocompleteHandle {
27
27
  * still on the page (a quick view opened, inline results drawn).
28
28
  */
29
29
  endSubmitProgress: () => void;
30
+ /** The search in progress, or `undefined` until the feature is enabled for your account. Read it in your submit or product handler. */
31
+ getSearchId: () => string | undefined;
30
32
  /** The visitor id the events carry right now, or `undefined` while there is none. */
31
33
  getVisitorId: () => string | undefined;
32
34
  /** Reads `analyticsConsent` again now, after the visitor changes their choice. */
@@ -566,6 +568,8 @@ interface UseAIAutocompleteReturn {
566
568
  * still on the page (a quick view opened, inline results drawn).
567
569
  */
568
570
  endSubmitProgress: () => void;
571
+ /** The search in progress, or `undefined` until the feature is enabled for your account. Read it in your submit or product handler. */
572
+ getSearchId: () => string | undefined;
569
573
  /** The visitor id the events carry right now, or `undefined` while there is none. */
570
574
  getVisitorId: () => string | undefined;
571
575
  /** Reads `analyticsConsent` again now, after the visitor changes their choice. */
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var qt=Object.defineProperty;var Ga=Object.getOwnPropertyDescriptor;var Ka=Object.getOwnPropertyNames;var qa=Object.prototype.hasOwnProperty;var Va=(e,a)=>{for(var t in a)qt(e,t,{get:a[t],enumerable:!0})},_a=(e,a,t,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of Ka(a))!qa.call(e,i)&&i!==t&&qt(e,i,{get:()=>a[i],enumerable:!(o=Ga(a,i))||o.enumerable});return e};var Ua=e=>_a(qt({},"__esModule",{value:!0}),e);var xi={};Va(xi,{AIAutocomplete:()=>Ra,AIAutocompleteDropdown:()=>Ht,DATE_RANGE_META_END:()=>c.DATE_RANGE_META_END,DATE_RANGE_META_START:()=>c.DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT:()=>c.DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY:()=>c.LOCATION_META_KEY,PRODUCT_PATH_PREFIX:()=>c.PRODUCT_PATH_PREFIX,TIME_META_KEY:()=>c.TIME_META_KEY,WEEKDAY_LABELS:()=>c.WEEKDAY_LABELS,buildSubmitResult:()=>c.buildSubmitResult,cellDay:()=>c.cellDay,cellIso:()=>c.cellIso,dateCellMarks:()=>c.dateCellMarks,formatDate:()=>c.formatDate,formatDateRange:()=>c.formatDateRange,formatOptionCount:()=>c.formatOptionCount,formatPlace:()=>c.formatPlace,formatTime:()=>c.formatTime,isoDate:()=>c.isoDate,monthLabel:()=>c.monthLabel,optionCountLabel:()=>c.optionCountLabel,optionHasImage:()=>c.optionHasImage,optionImageSources:()=>c.optionImageSources,optionImageSrc:()=>c.optionImageSrc,optionLabel:()=>c.optionLabel,optionsShowLeadingVisuals:()=>c.optionsShowLeadingVisuals,parseDate:()=>c.parseDate,parseLooseDate:()=>c.parseLooseDate,parseLooseDateRange:()=>c.parseLooseDateRange,parseTime:()=>c.parseTime,productFromMatchedItem:()=>c.productFromMatchedItem,productImageSources:()=>c.productImageSources,productsFromCustomFields:()=>c.productsFromCustomFields,sanitizeOptionIconSvg:()=>c.sanitizeOptionIconSvg,selectedRangeFor:()=>c.selectedRangeFor,useAIAutocomplete:()=>Bt,visibleDateRange:()=>c.visibleDateRange,withSkippedParams:()=>c.withSkippedParams});module.exports=Ua(xi);var c=require("@magicx-eng/ai-autocomplete-vanilla");var $=require("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
+ "use strict";var qt=Object.defineProperty;var Ka=Object.getOwnPropertyDescriptor;var qa=Object.getOwnPropertyNames;var Va=Object.prototype.hasOwnProperty;var _a=(e,a)=>{for(var t in a)qt(e,t,{get:a[t],enumerable:!0})},Ua=(e,a,t,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of qa(a))!Va.call(e,i)&&i!==t&&qt(e,i,{get:()=>a[i],enumerable:!(o=Ka(a,i))||o.enumerable});return e};var Qa=e=>Ua(qt({},"__esModule",{value:!0}),e);var yi={};_a(yi,{AIAutocomplete:()=>Oa,AIAutocompleteDropdown:()=>Ht,DATE_RANGE_META_END:()=>c.DATE_RANGE_META_END,DATE_RANGE_META_START:()=>c.DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT:()=>c.DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY:()=>c.LOCATION_META_KEY,PRODUCT_PATH_PREFIX:()=>c.PRODUCT_PATH_PREFIX,TIME_META_KEY:()=>c.TIME_META_KEY,WEEKDAY_LABELS:()=>c.WEEKDAY_LABELS,buildSubmitResult:()=>c.buildSubmitResult,cellDay:()=>c.cellDay,cellIso:()=>c.cellIso,dateCellMarks:()=>c.dateCellMarks,formatDate:()=>c.formatDate,formatDateRange:()=>c.formatDateRange,formatOptionCount:()=>c.formatOptionCount,formatPlace:()=>c.formatPlace,formatTime:()=>c.formatTime,isoDate:()=>c.isoDate,monthLabel:()=>c.monthLabel,optionCountLabel:()=>c.optionCountLabel,optionHasImage:()=>c.optionHasImage,optionImageSources:()=>c.optionImageSources,optionImageSrc:()=>c.optionImageSrc,optionLabel:()=>c.optionLabel,optionsShowLeadingVisuals:()=>c.optionsShowLeadingVisuals,parseDate:()=>c.parseDate,parseLooseDate:()=>c.parseLooseDate,parseLooseDateRange:()=>c.parseLooseDateRange,parseTime:()=>c.parseTime,productFromMatchedItem:()=>c.productFromMatchedItem,productImageSources:()=>c.productImageSources,productsFromCustomFields:()=>c.productsFromCustomFields,sanitizeOptionIconSvg:()=>c.sanitizeOptionIconSvg,selectedRangeFor:()=>c.selectedRangeFor,useAIAutocomplete:()=>Bt,visibleDateRange:()=>c.visibleDateRange,withSkippedParams:()=>c.withSkippedParams});module.exports=Qa(yi);var c=require("@magicx-eng/ai-autocomplete-vanilla");var $=require("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
@@ -1811,7 +1811,7 @@
1811
1811
  opacity: 1;
1812
1812
  }
1813
1813
  }
1814
- `,document.head.appendChild(e)}var Pe={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",skeletonBar:"aia-skeletonBar-O3xIx",multiDone:"aia-multiDone-y12U7",seeAllRow:"aia-seeAllRow-icrau",seeAll:"aia-seeAll-0Zbgc",seeAllSpin:"aia-seeAllSpin-jlsZP",multiActionsLoadingOut:"aia-multiActionsLoadingOut-lSdMh",multiActionsFadeIn:"aia-multiActionsFadeIn-zbGTG",seeAllLoadingOut:"aia-seeAllLoadingOut-THnrl",seeAllFadeIn:"aia-seeAllFadeIn-1GWpl"};var ie=require("@magicx-eng/ai-autocomplete-vanilla"),oa=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) ---
1814
+ `,document.head.appendChild(e)}var Pe={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",skeletonBar:"aia-skeletonBar-O3xIx",multiDone:"aia-multiDone-y12U7",seeAllRow:"aia-seeAllRow-icrau",seeAll:"aia-seeAll-0Zbgc",seeAllSpin:"aia-seeAllSpin-jlsZP",multiActionsLoadingOut:"aia-multiActionsLoadingOut-lSdMh",multiActionsFadeIn:"aia-multiActionsFadeIn-zbGTG",seeAllLoadingOut:"aia-seeAllLoadingOut-THnrl",seeAllFadeIn:"aia-seeAllFadeIn-1GWpl"};var ie=require("@magicx-eng/ai-autocomplete-vanilla"),na=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) ---
1815
1815
 
1816
1816
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
1817
1817
  date-grid.component.css). Only the class-naming layer differs \u2014 the
@@ -2008,7 +2008,7 @@
2008
2008
  opacity: 0.8;
2009
2009
  background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
2010
2010
  }
2011
- `,document.head.appendChild(e)}var X={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",reference:"aia-reference-Q5bXf",pressed:"aia-pressed-bEyyN"};var xe=require("react/jsx-runtime"),Qa=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function na({options:e,activeIndex:a,listboxId:t,view:o,selection:i,onSelect:s,onHighlight:r,onUnhighlight:d,onPreviousMonth:v,onNextMonth:x}){let y=(0,ie.isoDate)(new Date),g=(0,ie.visibleDateRange)({pendingStart:i.rangeStart,highlightedIso:(0,ie.cellIso)(e[a]),selected:i.selectedRange,floor:i.floor});return(0,xe.jsxs)("div",{className:X.datepicker,"data-aia-datepicker":"",children:[(0,xe.jsxs)("div",{className:X.header,children:[(0,xe.jsx)("button",{type:"button",tabIndex:-1,className:X.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:h=>h.preventDefault(),onClick:v,children:"\u2039"}),(0,xe.jsx)("span",{className:X.month,"data-aia-date-month":"","aria-live":"polite",children:(0,ie.monthLabel)(o)}),(0,xe.jsx)("button",{type:"button",tabIndex:-1,className:X.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:h=>h.preventDefault(),onClick:x,children:"\u203A"})]}),(0,xe.jsx)("div",{className:X.weekdays,"aria-hidden":"true",children:ie.WEEKDAY_LABELS.map((h,u)=>(0,xe.jsx)("span",{className:X.weekday,children:h},Qa[u]))}),(0,xe.jsx)("div",{className:X.grid,"data-aia-date-grid":"",children:e.map((h,u)=>(0,xe.jsx)(Ya,{option:h,id:`${t}-option-${u}`,index:u,isHighlighted:u===a&&h.is_tappable,isToday:(0,ie.cellIso)(h)===y,isPast:(0,ie.isDimmedDay)((0,ie.cellIso)(h),y,i.floor),marks:(0,ie.dateCellMarks)((0,ie.cellIso)(h),{selectedIso:i.selectedIso,range:g,references:i.references}),onSelect:s,onHighlight:r,onUnhighlight:d},(0,ie.cellIso)(h)??`pad-${u}`))})]})}function Ya({option:e,id:a,index:t,isHighlighted:o,isToday:i,isPast:s,marks:r,onSelect:d,onHighlight:v,onUnhighlight:x}){let[y,g]=(0,oa.useState)(!1),h=(0,ie.cellDay)(e);if(h==null)return(0,xe.jsx)("div",{id:a,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${X.cell} ${X.blank}`});let u=()=>{g(!0),d(e),setTimeout(()=>g(!1),170)},k=[X.cell,X.day,s?X.past:"",o?X.highlighted:"",i?X.today:"",r.inRange?X.inRange:"",r.selected?X.selected:"",r.reference?X.reference:"",y?X.pressed:""].filter(Boolean).join(" ");return(0,xe.jsx)("div",{id:a,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":o,"aria-label":e.text,tabIndex:0,className:k,onClick:u,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),u())},onMouseEnter:()=>v(t),onMouseLeave:x?()=>x(t):void 0,children:(0,xe.jsx)("span",{className:X.number,children:h})})}var ot=require("@magicx-eng/ai-autocomplete-vanilla"),Lt=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`.aia-cluster {
2011
+ `,document.head.appendChild(e)}var X={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",reference:"aia-reference-Q5bXf",pressed:"aia-pressed-bEyyN"};var xe=require("react/jsx-runtime"),Ya=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ra({options:e,activeIndex:a,listboxId:t,view:o,selection:i,onSelect:s,onHighlight:r,onUnhighlight:d,onPreviousMonth:v,onNextMonth:x}){let y=(0,ie.isoDate)(new Date),g=(0,ie.visibleDateRange)({pendingStart:i.rangeStart,highlightedIso:(0,ie.cellIso)(e[a]),selected:i.selectedRange,floor:i.floor});return(0,xe.jsxs)("div",{className:X.datepicker,"data-aia-datepicker":"",children:[(0,xe.jsxs)("div",{className:X.header,children:[(0,xe.jsx)("button",{type:"button",tabIndex:-1,className:X.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:h=>h.preventDefault(),onClick:v,children:"\u2039"}),(0,xe.jsx)("span",{className:X.month,"data-aia-date-month":"","aria-live":"polite",children:(0,ie.monthLabel)(o)}),(0,xe.jsx)("button",{type:"button",tabIndex:-1,className:X.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:h=>h.preventDefault(),onClick:x,children:"\u203A"})]}),(0,xe.jsx)("div",{className:X.weekdays,"aria-hidden":"true",children:ie.WEEKDAY_LABELS.map((h,u)=>(0,xe.jsx)("span",{className:X.weekday,children:h},Ya[u]))}),(0,xe.jsx)("div",{className:X.grid,"data-aia-date-grid":"",children:e.map((h,u)=>(0,xe.jsx)(ja,{option:h,id:`${t}-option-${u}`,index:u,isHighlighted:u===a&&h.is_tappable,isToday:(0,ie.cellIso)(h)===y,isPast:(0,ie.isDimmedDay)((0,ie.cellIso)(h),y,i.floor),marks:(0,ie.dateCellMarks)((0,ie.cellIso)(h),{selectedIso:i.selectedIso,range:g,references:i.references}),onSelect:s,onHighlight:r,onUnhighlight:d},(0,ie.cellIso)(h)??`pad-${u}`))})]})}function ja({option:e,id:a,index:t,isHighlighted:o,isToday:i,isPast:s,marks:r,onSelect:d,onHighlight:v,onUnhighlight:x}){let[y,g]=(0,na.useState)(!1),h=(0,ie.cellDay)(e);if(h==null)return(0,xe.jsx)("div",{id:a,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${X.cell} ${X.blank}`});let u=()=>{g(!0),d(e),setTimeout(()=>g(!1),170)},k=[X.cell,X.day,s?X.past:"",o?X.highlighted:"",i?X.today:"",r.inRange?X.inRange:"",r.selected?X.selected:"",r.reference?X.reference:"",y?X.pressed:""].filter(Boolean).join(" ");return(0,xe.jsx)("div",{id:a,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":o,"aria-label":e.text,tabIndex:0,className:k,onClick:u,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),u())},onMouseEnter:()=>v(t),onMouseLeave:x?()=>x(t):void 0,children:(0,xe.jsx)("span",{className:X.number,children:h})})}var ot=require("@magicx-eng/ai-autocomplete-vanilla"),Lt=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-5259a217")){let e=document.createElement("style");e.id="ac-style-5259a217",e.textContent=`.aia-cluster {
2012
2012
  display: flex;
2013
2013
  flex-wrap: wrap;
2014
2014
  gap: var(--aia-cluster-gap, 0.5rem);
@@ -2174,6 +2174,7 @@
2174
2174
  .aia-badge-Fk9vg {
2175
2175
  display: inline-flex;
2176
2176
  align-items: center;
2177
+ white-space: nowrap;
2177
2178
  height: var(--aia-footer-row-height, 23px);
2178
2179
  padding: 2.5px 5.5px;
2179
2180
  border: 0.5px solid var(--aia-footer-badge-border, rgba(189, 189, 189, 0.51));
@@ -2195,7 +2196,7 @@
2195
2196
  justify-content: flex-end;
2196
2197
  }
2197
2198
  }
2198
- `,document.head.appendChild(e)}var Xe={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 Ge=require("react/jsx-runtime");function ra({isOptionHighlighted:e=!1,isInputEmpty:a=!1,strings:t=(0,ot.uiStringsFor)()}){let{key:o,hint:i}=(0,ot.getFooterHint)(e,a,t),[s,r]=(0,Lt.useState)(ot.ATTRIBUTION_URL);return(0,Lt.useEffect)(()=>{r((0,ot.buildAttributionUrl)())},[]),(0,Ge.jsx)("footer",{className:Xe.footer,"data-aia-footer":"",children:(0,Ge.jsxs)(Et,{justify:"between",noWrap:!0,className:Xe.row,children:[(0,Ge.jsxs)(Et,{gap:"5px",className:Xe.hintGroup,children:[(0,Ge.jsx)("kbd",{className:Xe.key,children:o}),(0,Ge.jsx)("span",{className:Xe.hint,children:i})]}),(0,Ge.jsxs)("a",{className:Xe.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[(0,Ge.jsx)("span",{className:Xe.brand,children:"AI"}),(0,Ge.jsx)("span",{className:Xe.badge,children:"Autocomplete"})]})]})})}var pe=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
2199
+ `,document.head.appendChild(e)}var Xe={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 Ge=require("react/jsx-runtime");function sa({isOptionHighlighted:e=!1,isInputEmpty:a=!1,strings:t=(0,ot.uiStringsFor)()}){let{key:o,hint:i}=(0,ot.getFooterHint)(e,a,t),[s,r]=(0,Lt.useState)(ot.ATTRIBUTION_URL);return(0,Lt.useEffect)(()=>{r((0,ot.buildAttributionUrl)())},[]),(0,Ge.jsx)("footer",{className:Xe.footer,"data-aia-footer":"",children:(0,Ge.jsxs)(Et,{justify:"between",noWrap:!0,className:Xe.row,children:[(0,Ge.jsxs)(Et,{gap:"5px",className:Xe.hintGroup,children:[(0,Ge.jsx)("kbd",{className:Xe.key,children:o}),(0,Ge.jsx)("span",{className:Xe.hint,children:i})]}),(0,Ge.jsx)("a",{className:Xe.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:(0,Ge.jsx)("span",{className:Xe.badge,children:(0,Ge.jsx)("span",{className:Xe.brand,children:"Powered by Intent-1"})})})]})})}var pe=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
2199
2200
  Angular copy). The three are kept identical by
2200
2201
  packages/vanilla/tests/render/locationFieldParity.test.ts. */
2201
2202
  .aia-location-6-fsr {
@@ -2329,7 +2330,7 @@
2329
2330
  .aia-loadingBar-OLCr4:nth-child(3) {
2330
2331
  width: 60%;
2331
2332
  }
2332
- `,document.head.appendChild(e)}var oe={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 U=require("react/jsx-runtime"),ja=0;function zt(e){return e.getRootNode().activeElement??null}function da(e){return e.getRootNode().getSelection?.()??document.getSelection()}function sa(e){if(!e.isContentEditable)return null;let a=da(e);if(!a||a.rangeCount===0)return null;let t=a.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function la(e,a){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=da(e);if(!t)return;let o=a;(!o||!o.startContainer.isConnected||!e.contains(o.startContainer))&&(o=document.createRange(),o.selectNodeContents(e),o.collapse(!1)),t.removeAllRanges(),t.addRange(o)}var $a=(0,U.jsxs)("svg",{className:oe.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,U.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,U.jsx)("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Za=(0,U.jsxs)("svg",{className:oe.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,U.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,U.jsx)("path",{d:"m20 20-3.5-3.5"})]});function ca({view:e,searchLabel:a,noResultsLabel:t,useTypedLabel:o,widgetFocused:i,reediting:s=!1,visible:r=!0,interactive:d=!0,onQuery:v,onMove:x,onCommit:y,onFocusChange:g}){let h=(0,pe.useRef)(null),u=(0,pe.useRef)(null),k=(0,pe.useRef)(null),S=(0,pe.useRef)(null),I=(0,pe.useRef)(null),H=(0,pe.useRef)(!1),N=(0,pe.useRef)(!1),de=(0,pe.useRef)(!1),Q=(0,pe.useRef)(!1),O=(0,pe.useRef)(i);O.current=i;let W=(0,pe.useRef)(g);W.current=g;let G=p=>{Q.current=p,g(p)},Z=()=>{let p=h.current;return p!=null&&zt(p)===p},re=()=>{let p=u.current;if(!p)return;let z=zt(p);z instanceof HTMLElement&&z!==h.current&&z!==document.body&&!p.contains(z)&&(S.current=z,I.current=sa(z))},R=p=>{let z=u.current;!z||!(p instanceof HTMLElement)||p===S.current||p===document.body||z.contains(p)||(S.current=p,I.current=sa(p))},me=(0,pe.useRef)(null);me.current===null&&(me.current=`aia-location-${++ja}`);let fe=`${me.current}-row-`;(0,pe.useEffect)(()=>{let p=h.current;p&&p.value!==e.query&&zt(p)!==p&&(p.value=e.query)},[e.query]),(0,pe.useEffect)(()=>{i&&(s&&!de.current&&(N.current=!1),de.current=s);let p=h.current;if(p){if(!r&&Z()){N.current=!0,ee();return}if(!i){setTimeout(()=>{if(O.current)return;let z=S.current;z&&zt(z)===z||(N.current=!1)},0);return}if(!(!s||N.current||!d||Z())){if(re(),G(!0),p.focus({preventScroll:!0}),!Z()){N.current=!0,G(!1);return}p.value&&p.select()}}}),(0,pe.useLayoutEffect)(()=>()=>{if(!Q.current)return;let p=h.current,z=S.current;z?.isConnected&&p&&zt(p)===p&&(H.current=!0,la(z,I.current),H.current=!1),Q.current=!1,W.current(!1)},[]);let ee=(p=!1)=>{p&&(N.current=!0);let z=S.current;z?.isConnected&&Z()&&(H.current=!0,la(z,I.current),H.current=!1),G(!1)},ge=e.query.trim(),C=e.highlighted>=0&&e.highlighted<e.places.length?`${fe}${e.highlighted}`:void 0,K=null;return e.places.length>0?K=e.places.map((p,z)=>(0,U.jsxs)("div",{id:`${fe}${z}`,role:"option","aria-selected":z===e.highlighted,className:z===e.highlighted?`${oe.row} ${oe.highlighted}`:oe.row,"data-aia-location-row":"","data-aia-index":z,onClick:()=>{d&&(ee(!0),y(z))},children:[(0,U.jsx)("span",{className:oe.pin,children:$a}),(0,U.jsxs)("span",{className:oe.text,children:[(0,U.jsx)("span",{className:oe.name,children:p.name}),p.secondary&&(0,U.jsx)("span",{className:oe.secondary,children:p.secondary})]})]},p.id)):e.status==="loading"?K=(0,U.jsxs)("div",{className:oe.loading,"data-aia-location-loading":"",children:[(0,U.jsx)("span",{className:oe.loadingBar}),(0,U.jsx)("span",{className:oe.loadingBar}),(0,U.jsx)("span",{className:oe.loadingBar})]}):ge&&(K=(0,U.jsxs)("div",{className:oe.note,"data-aia-location-note":"",children:[e.status==="done"&&(0,U.jsx)("span",{className:oe.empty,children:t}),(0,U.jsx)("span",{children:o})]})),(0,U.jsxs)("div",{ref:u,className:oe.location,"data-aia-location":"",onMouseDown:p=>{!(p.target instanceof Node)||!k.current?.contains(p.target)||(p.stopPropagation(),re(),G(!0))},children:[(0,U.jsxs)("label",{ref:k,className:oe.field,children:[Za,(0,U.jsx)("input",{ref:h,type:"text",className:oe.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:a,"aria-label":a,"aria-activedescendant":C,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:r?0:-1,onChange:p=>v(p.target.value),onFocus:p=>{R(p.relatedTarget),G(!0)},onBlur:()=>{H.current||(N.current=!0,G(!1))},onKeyDown:p=>{if(!p.nativeEvent.isComposing)switch(p.key){case"ArrowDown":case"ArrowUp":p.preventDefault(),x(p.key==="ArrowDown"?1:-1);return;case"Enter":if(p.preventDefault(),!d)return;ee(!0),y();return;case"Escape":p.preventDefault(),p.stopPropagation(),N.current=!0,ee();return;case"Backspace":if(p.currentTarget.value!=="")return;p.preventDefault(),N.current=!0,ee();return}}})]}),(0,U.jsx)("div",{className:oe.results,"data-aia-location-results":"","aria-live":"polite",children:K})]})}var Dt=require("@magicx-eng/ai-autocomplete-vanilla");var pa=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,
2333
+ `,document.head.appendChild(e)}var oe={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 U=require("react/jsx-runtime"),$a=0;function zt(e){return e.getRootNode().activeElement??null}function ca(e){return e.getRootNode().getSelection?.()??document.getSelection()}function la(e){if(!e.isContentEditable)return null;let a=ca(e);if(!a||a.rangeCount===0)return null;let t=a.getRangeAt(0);return e.contains(t.startContainer)?t.cloneRange():null}function da(e,a){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let t=ca(e);if(!t)return;let o=a;(!o||!o.startContainer.isConnected||!e.contains(o.startContainer))&&(o=document.createRange(),o.selectNodeContents(e),o.collapse(!1)),t.removeAllRanges(),t.addRange(o)}var Za=(0,U.jsxs)("svg",{className:oe.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,U.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,U.jsx)("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Xa=(0,U.jsxs)("svg",{className:oe.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,U.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,U.jsx)("path",{d:"m20 20-3.5-3.5"})]});function pa({view:e,searchLabel:a,noResultsLabel:t,useTypedLabel:o,widgetFocused:i,reediting:s=!1,visible:r=!0,interactive:d=!0,onQuery:v,onMove:x,onCommit:y,onFocusChange:g}){let h=(0,pe.useRef)(null),u=(0,pe.useRef)(null),k=(0,pe.useRef)(null),S=(0,pe.useRef)(null),I=(0,pe.useRef)(null),H=(0,pe.useRef)(!1),N=(0,pe.useRef)(!1),de=(0,pe.useRef)(!1),Q=(0,pe.useRef)(!1),O=(0,pe.useRef)(i);O.current=i;let W=(0,pe.useRef)(g);W.current=g;let G=p=>{Q.current=p,g(p)},Z=()=>{let p=h.current;return p!=null&&zt(p)===p},re=()=>{let p=u.current;if(!p)return;let z=zt(p);z instanceof HTMLElement&&z!==h.current&&z!==document.body&&!p.contains(z)&&(S.current=z,I.current=la(z))},R=p=>{let z=u.current;!z||!(p instanceof HTMLElement)||p===S.current||p===document.body||z.contains(p)||(S.current=p,I.current=la(p))},me=(0,pe.useRef)(null);me.current===null&&(me.current=`aia-location-${++$a}`);let fe=`${me.current}-row-`;(0,pe.useEffect)(()=>{let p=h.current;p&&p.value!==e.query&&zt(p)!==p&&(p.value=e.query)},[e.query]),(0,pe.useEffect)(()=>{i&&(s&&!de.current&&(N.current=!1),de.current=s);let p=h.current;if(p){if(!r&&Z()){N.current=!0,ee();return}if(!i){setTimeout(()=>{if(O.current)return;let z=S.current;z&&zt(z)===z||(N.current=!1)},0);return}if(!(!s||N.current||!d||Z())){if(re(),G(!0),p.focus({preventScroll:!0}),!Z()){N.current=!0,G(!1);return}p.value&&p.select()}}}),(0,pe.useLayoutEffect)(()=>()=>{if(!Q.current)return;let p=h.current,z=S.current;z?.isConnected&&p&&zt(p)===p&&(H.current=!0,da(z,I.current),H.current=!1),Q.current=!1,W.current(!1)},[]);let ee=(p=!1)=>{p&&(N.current=!0);let z=S.current;z?.isConnected&&Z()&&(H.current=!0,da(z,I.current),H.current=!1),G(!1)},ge=e.query.trim(),C=e.highlighted>=0&&e.highlighted<e.places.length?`${fe}${e.highlighted}`:void 0,K=null;return e.places.length>0?K=e.places.map((p,z)=>(0,U.jsxs)("div",{id:`${fe}${z}`,role:"option","aria-selected":z===e.highlighted,className:z===e.highlighted?`${oe.row} ${oe.highlighted}`:oe.row,"data-aia-location-row":"","data-aia-index":z,onClick:()=>{d&&(ee(!0),y(z))},children:[(0,U.jsx)("span",{className:oe.pin,children:Za}),(0,U.jsxs)("span",{className:oe.text,children:[(0,U.jsx)("span",{className:oe.name,children:p.name}),p.secondary&&(0,U.jsx)("span",{className:oe.secondary,children:p.secondary})]})]},p.id)):e.status==="loading"?K=(0,U.jsxs)("div",{className:oe.loading,"data-aia-location-loading":"",children:[(0,U.jsx)("span",{className:oe.loadingBar}),(0,U.jsx)("span",{className:oe.loadingBar}),(0,U.jsx)("span",{className:oe.loadingBar})]}):ge&&(K=(0,U.jsxs)("div",{className:oe.note,"data-aia-location-note":"",children:[e.status==="done"&&(0,U.jsx)("span",{className:oe.empty,children:t}),(0,U.jsx)("span",{children:o})]})),(0,U.jsxs)("div",{ref:u,className:oe.location,"data-aia-location":"",onMouseDown:p=>{!(p.target instanceof Node)||!k.current?.contains(p.target)||(p.stopPropagation(),re(),G(!0))},children:[(0,U.jsxs)("label",{ref:k,className:oe.field,children:[Xa,(0,U.jsx)("input",{ref:h,type:"text",className:oe.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:a,"aria-label":a,"aria-activedescendant":C,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:r?0:-1,onChange:p=>v(p.target.value),onFocus:p=>{R(p.relatedTarget),G(!0)},onBlur:()=>{H.current||(N.current=!0,G(!1))},onKeyDown:p=>{if(!p.nativeEvent.isComposing)switch(p.key){case"ArrowDown":case"ArrowUp":p.preventDefault(),x(p.key==="ArrowDown"?1:-1);return;case"Enter":if(p.preventDefault(),!d)return;ee(!0),y();return;case"Escape":p.preventDefault(),p.stopPropagation(),N.current=!0,ee();return;case"Backspace":if(p.currentTarget.value!=="")return;p.preventDefault(),N.current=!0,ee();return}}})]}),(0,U.jsx)("div",{className:oe.results,"data-aia-location-results":"","aria-live":"polite",children:K})]})}var Dt=require("@magicx-eng/ai-autocomplete-vanilla");var ha=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,
2333
2334
  no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
2334
2335
  The border is kept as a 1px transparent line so the box stays the same size
2335
2336
  as it was when the outline was dashed. */
@@ -2487,7 +2488,7 @@
2487
2488
  opacity: 0;
2488
2489
  }
2489
2490
  }
2490
- `,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",loadingOut:"aia-loadingOut-Aj9xO"};var nt=require("react/jsx-runtime"),_t={selected:1,first:.7,next:.4,last:.2};function ha({label:e,state:a,active:t,rounded:o,loading:i,smartSuggestion:s,completionHeader:r,onClick:d}){let v=[Ke.pill,o?Ke.rounded:"",i?Ke.skeleton:""].filter(Boolean).join(" ");return(0,nt.jsx)("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:v,style:{"--aia-pill-opacity":_t[a]},onMouseDown:x=>x.preventDefault(),onClick:i?void 0:d,disabled:i,children:s?(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)("span",{className:`${Ke.smartText} magicx-aia-smart-suggestion-text`,children:e}),(0,nt.jsx)("span",{className:`${Ke.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:pa.SMART_SUGGESTION_SPARKLE_SVG}})]}):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 {
2491
+ `,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",loadingOut:"aia-loadingOut-Aj9xO"};var nt=require("react/jsx-runtime"),_t={selected:1,first:.7,next:.4,last:.2};function ua({label:e,state:a,active:t,rounded:o,loading:i,smartSuggestion:s,completionHeader:r,onClick:d}){let v=[Ke.pill,o?Ke.rounded:"",i?Ke.skeleton:""].filter(Boolean).join(" ");return(0,nt.jsx)("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:v,style:{"--aia-pill-opacity":_t[a]},onMouseDown:x=>x.preventDefault(),onClick:i?void 0:d,disabled:i,children:s?(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)("span",{className:`${Ke.smartText} magicx-aia-smart-suggestion-text`,children:e}),(0,nt.jsx)("span",{className:`${Ke.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:ha.SMART_SUGGESTION_SPARKLE_SVG}})]}):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 {
2491
2492
  position: relative;
2492
2493
  z-index: 1;
2493
2494
  pointer-events: auto;
@@ -2497,7 +2498,7 @@
2497
2498
  align-items: center;
2498
2499
  vertical-align: middle;
2499
2500
  }
2500
- `,document.head.appendChild(e)}var Ut={list:"aia-list-qvLqO"};var Rt=require("react/jsx-runtime"),Xa=[125,69];function ua(e){return e===0?"first":e===1?"next":"last"}function Mt({pills:e,activePillIndex:a,onSelectPill:t,activeSelected:o,rounded:i,loading:s}){return s&&e.length===0?(0,Rt.jsx)("span",{className:Ut.list,"data-aia-pill-list-loading":"",children:Xa.map((r,d)=>(0,Rt.jsx)("span",{"data-aia-pill-skeleton":"",className:`${Ke.pill} ${i?Ke.rounded:""} ${Ke.skeleton}`,style:{width:r,"--aia-pill-opacity":_t[ua(d)]}},`skel-${r}`))}):(0,Rt.jsx)("span",{className:Ut.list,"data-aia-pill-list-loading":s?"":void 0,children:e.map((r,d)=>{let v=!!o&&d===a;return(0,Rt.jsx)(ha,{label:r.text,state:v?"selected":ua(d),selected:v,active:d===a,rounded:i,loading:s,smartSuggestion:(0,Dt.isSmartSuggestion)(r),completionHeader:(0,Dt.isTraditionalAutocompleteSuggestion)(r),onClick:()=>t(d)},`${r.parameter}-${r.text}`)})})}var Ie=require("@magicx-eng/ai-autocomplete-vanilla"),ye=require("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
2501
+ `,document.head.appendChild(e)}var Ut={list:"aia-list-qvLqO"};var Rt=require("react/jsx-runtime"),Ja=[125,69];function ma(e){return e===0?"first":e===1?"next":"last"}function Mt({pills:e,activePillIndex:a,onSelectPill:t,activeSelected:o,rounded:i,loading:s}){return s&&e.length===0?(0,Rt.jsx)("span",{className:Ut.list,"data-aia-pill-list-loading":"",children:Ja.map((r,d)=>(0,Rt.jsx)("span",{"data-aia-pill-skeleton":"",className:`${Ke.pill} ${i?Ke.rounded:""} ${Ke.skeleton}`,style:{width:r,"--aia-pill-opacity":_t[ma(d)]}},`skel-${r}`))}):(0,Rt.jsx)("span",{className:Ut.list,"data-aia-pill-list-loading":s?"":void 0,children:e.map((r,d)=>{let v=!!o&&d===a;return(0,Rt.jsx)(ua,{label:r.text,state:v?"selected":ma(d),selected:v,active:d===a,rounded:i,loading:s,smartSuggestion:(0,Dt.isSmartSuggestion)(r),completionHeader:(0,Dt.isTraditionalAutocompleteSuggestion)(r),onClick:()=>t(d)},`${r.parameter}-${r.text}`)})})}var Ie=require("@magicx-eng/ai-autocomplete-vanilla"),ye=require("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
2501
2502
  (packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
2502
2503
  theming one package sees the same result in the other.
2503
2504
 
@@ -3124,7 +3125,7 @@
3124
3125
  opacity: 0.01;
3125
3126
  }
3126
3127
  }
3127
- `,document.head.appendChild(e)}var ne={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",stripLoadingOut:"aia-stripLoadingOut-0jOOQ",stripFadeIn:"aia-stripFadeIn-0p9qx"};var V=require("react/jsx-runtime");function ma({products:e,listboxId:a,onSelect:t,busyProductId:o=null,onAddToCart:i,onFocusChange:s,focusable:r=!0,loading:d=!1,layout:v="row",imageFallback:x="image",showVendor:y=!0,strings:g=(0,Ie.uiStringsFor)()}){let h=e.length>0,u=(0,ye.useRef)(null);if((0,ye.useEffect)(()=>{let S=u.current;if(!(!h||!S))return(0,Ie.attachProductRowWheel)(S)},[h]),!h)return null;let k=`${a}-products-label`;return(0,V.jsxs)("section",{className:ne.section,"data-aia-products":"","data-aia-loading":d?"":void 0,"data-aia-products-layout":v,role:"group","aria-labelledby":k,children:[(0,V.jsx)("div",{className:ne.label,id:k,"data-aia-products-label":"",children:g.products}),(0,V.jsx)("div",{ref:u,className:ne.row,"data-aia-products-row":"",children:e.map((S,I)=>(0,V.jsx)(Ja,{product:S,id:`${a}-product-${I}`,onSelect:t,busy:S.id===o,onAddToCart:i,onFocusChange:s,focusable:r,imageFallback:x,showVendor:y,soldOut:g.soldOut,addToCart:g.addToCart},S.id))})]})}function Ja({product:e,id:a,onSelect:t,busy:o,onAddToCart:i,onFocusChange:s,focusable:r,imageFallback:d,showVendor:v,soldOut:x,addToCart:y}){let g=!!i&&e.available!==!1,[h,u]=(0,ye.useState)(null),k=I=>{I.relatedTarget?.closest("[data-aia-dropdown]")||s?.(!1)},S=I=>{I.metaKey||I.ctrlKey||I.shiftKey||I.altKey||I.button!==0||(I.preventDefault(),t(e))};return(0,V.jsxs)("a",{id:a,className:ne.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":g?"":void 0,"data-aia-product-state":o?"busy":void 0,"aria-busy":o?!0:void 0,role:"option","aria-selected":!1,style:h?{"--aia-product-photo-fill-x":String(h.x),"--aia-product-photo-fill-y":String(h.y)}:void 0,href:e.url,tabIndex:r?0:-1,onClick:S,onKeyDown:I=>{I.key!=="Enter"&&I.key!==" "||(I.preventDefault(),t(e))},onFocus:()=>s?.(!0),onBlur:k,children:[(0,V.jsx)(ai,{sources:(0,Ie.productImageSources)(e.imageUrl),title:e.title,fallback:d,onPhotoFill:u},(0,Ie.productImageSrc)(e.imageUrl)??""),(0,V.jsxs)("span",{className:ne.body,children:[v&&e.vendor?(0,V.jsx)("span",{className:ne.vendor,children:e.vendor}):null,(0,V.jsx)("span",{className:ne.title,children:e.title}),e.price?(0,V.jsxs)("span",{className:ne.price,children:[e.price,e.compareAtPrice?(0,V.jsx)("s",{className:ne.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?(0,V.jsx)("span",{className:ne.badge,children:x}):null]}),g&&i?(0,V.jsx)(ti,{product:e,label:`${y}: ${e.title}`,focusable:r,onAddToCart:i,onFocus:()=>s?.(!0),onBlur:k},ei(e)):null]})}function ei(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(a=>a??"").join("\0")}function ti({product:e,label:a,focusable:t,onAddToCart:o,onFocus:i,onBlur:s}){let[r,d]=(0,ye.useState)(null),v=(0,ye.useRef)(null),x=(0,ye.useRef)(e);x.current=e;let y=(0,ye.useRef)(!0);(0,ye.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let g=u=>{v.current=u,y.current&&d(u)},h=u=>{if(u.preventDefault(),u.stopPropagation(),v.current==="adding")return;g("adding");let k;try{k=Promise.resolve(o(x.current))}catch(S){k=Promise.reject(S)}k.then(()=>g("added"),()=>g(null))};return(0,V.jsx)("span",{className:ne.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":a,tabIndex:t?0:-1,onClick:h,onKeyDown:u=>{u.key!=="Enter"&&u.key!==" "||h(u)},onFocus:u=>{u.stopPropagation(),i()},onBlur:u=>{u.stopPropagation(),s(u)},children:(0,V.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,V.jsx)("path",{className:ne.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"}),(0,V.jsx)("path",{className:ne.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),(0,V.jsx)("path",{className:ne.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),(0,V.jsx)("path",{className:ne.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),(0,V.jsx)("circle",{className:ne.cartGlyph,cx:"9",cy:"20",r:"1.3"}),(0,V.jsx)("circle",{className:ne.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function ai({sources:e,title:a,fallback:t,onPhotoFill:o}){let[i,s]=(0,ye.useState)(0),r=e[i],d=!!r,[v,x]=(0,ye.useState)(null),y=!d&&t==="initial";return(0,ye.useEffect)(()=>()=>o(null),[o]),(0,V.jsxs)("span",{className:ne.media,"data-aia-product-media":"","aria-hidden":"true","data-aia-product-placeholder":!d&&!y?"":void 0,"data-aia-product-initial":y?"":void 0,"data-aia-image-loaded":d&&v===r?"":void 0,children:[d?(0,V.jsx)("img",{className:ne.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:g=>{x(r),o((0,Ie.productPhotoFill)(g.currentTarget.naturalWidth,g.currentTarget.naturalHeight))},onError:()=>{i+1>=e.length&&o(null),s(g=>g+1)}}):null,y?(0,Ie.productInitial)(a):null]})}var q=require("@magicx-eng/ai-autocomplete-vanilla"),Ee=require("react");var ga=require("@magicx-eng/ai-autocomplete-vanilla"),Nt=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`.aia-grid {
3128
+ `,document.head.appendChild(e)}var ne={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",stripLoadingOut:"aia-stripLoadingOut-0jOOQ",stripFadeIn:"aia-stripFadeIn-0p9qx"};var V=require("react/jsx-runtime");function ga({products:e,listboxId:a,onSelect:t,busyProductId:o=null,onAddToCart:i,onFocusChange:s,focusable:r=!0,loading:d=!1,layout:v="row",imageFallback:x="image",showVendor:y=!0,strings:g=(0,Ie.uiStringsFor)()}){let h=e.length>0,u=(0,ye.useRef)(null);if((0,ye.useEffect)(()=>{let S=u.current;if(!(!h||!S))return(0,Ie.attachProductRowWheel)(S)},[h]),!h)return null;let k=`${a}-products-label`;return(0,V.jsxs)("section",{className:ne.section,"data-aia-products":"","data-aia-loading":d?"":void 0,"data-aia-products-layout":v,role:"group","aria-labelledby":k,children:[(0,V.jsx)("div",{className:ne.label,id:k,"data-aia-products-label":"",children:g.products}),(0,V.jsx)("div",{ref:u,className:ne.row,"data-aia-products-row":"",children:e.map((S,I)=>(0,V.jsx)(ei,{product:S,id:`${a}-product-${I}`,onSelect:t,busy:S.id===o,onAddToCart:i,onFocusChange:s,focusable:r,imageFallback:x,showVendor:y,soldOut:g.soldOut,addToCart:g.addToCart},S.id))})]})}function ei({product:e,id:a,onSelect:t,busy:o,onAddToCart:i,onFocusChange:s,focusable:r,imageFallback:d,showVendor:v,soldOut:x,addToCart:y}){let g=!!i&&e.available!==!1,[h,u]=(0,ye.useState)(null),k=I=>{I.relatedTarget?.closest("[data-aia-dropdown]")||s?.(!1)},S=I=>{I.metaKey||I.ctrlKey||I.shiftKey||I.altKey||I.button!==0||(I.preventDefault(),t(e))};return(0,V.jsxs)("a",{id:a,className:ne.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":g?"":void 0,"data-aia-product-state":o?"busy":void 0,"aria-busy":o?!0:void 0,role:"option","aria-selected":!1,style:h?{"--aia-product-photo-fill-x":String(h.x),"--aia-product-photo-fill-y":String(h.y)}:void 0,href:e.url,tabIndex:r?0:-1,onClick:S,onKeyDown:I=>{I.key!=="Enter"&&I.key!==" "||(I.preventDefault(),t(e))},onFocus:()=>s?.(!0),onBlur:k,children:[(0,V.jsx)(ii,{sources:(0,Ie.productImageSources)(e.imageUrl),title:e.title,fallback:d,onPhotoFill:u},(0,Ie.productImageSrc)(e.imageUrl)??""),(0,V.jsxs)("span",{className:ne.body,children:[v&&e.vendor?(0,V.jsx)("span",{className:ne.vendor,children:e.vendor}):null,(0,V.jsx)("span",{className:ne.title,children:e.title}),e.price?(0,V.jsxs)("span",{className:ne.price,children:[e.price,e.compareAtPrice?(0,V.jsx)("s",{className:ne.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?(0,V.jsx)("span",{className:ne.badge,children:x}):null]}),g&&i?(0,V.jsx)(ai,{product:e,label:`${y}: ${e.title}`,focusable:r,onAddToCart:i,onFocus:()=>s?.(!0),onBlur:k},ti(e)):null]})}function ti(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(a=>a??"").join("\0")}function ai({product:e,label:a,focusable:t,onAddToCart:o,onFocus:i,onBlur:s}){let[r,d]=(0,ye.useState)(null),v=(0,ye.useRef)(null),x=(0,ye.useRef)(e);x.current=e;let y=(0,ye.useRef)(!0);(0,ye.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let g=u=>{v.current=u,y.current&&d(u)},h=u=>{if(u.preventDefault(),u.stopPropagation(),v.current==="adding")return;g("adding");let k;try{k=Promise.resolve(o(x.current))}catch(S){k=Promise.reject(S)}k.then(()=>g("added"),()=>g(null))};return(0,V.jsx)("span",{className:ne.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":a,tabIndex:t?0:-1,onClick:h,onKeyDown:u=>{u.key!=="Enter"&&u.key!==" "||h(u)},onFocus:u=>{u.stopPropagation(),i()},onBlur:u=>{u.stopPropagation(),s(u)},children:(0,V.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,V.jsx)("path",{className:ne.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"}),(0,V.jsx)("path",{className:ne.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),(0,V.jsx)("path",{className:ne.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),(0,V.jsx)("path",{className:ne.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),(0,V.jsx)("circle",{className:ne.cartGlyph,cx:"9",cy:"20",r:"1.3"}),(0,V.jsx)("circle",{className:ne.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function ii({sources:e,title:a,fallback:t,onPhotoFill:o}){let[i,s]=(0,ye.useState)(0),r=e[i],d=!!r,[v,x]=(0,ye.useState)(null),y=!d&&t==="initial";return(0,ye.useEffect)(()=>()=>o(null),[o]),(0,V.jsxs)("span",{className:ne.media,"data-aia-product-media":"","aria-hidden":"true","data-aia-product-placeholder":!d&&!y?"":void 0,"data-aia-product-initial":y?"":void 0,"data-aia-image-loaded":d&&v===r?"":void 0,children:[d?(0,V.jsx)("img",{className:ne.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:g=>{x(r),o((0,Ie.productPhotoFill)(g.currentTarget.naturalWidth,g.currentTarget.naturalHeight))},onError:()=>{i+1>=e.length&&o(null),s(g=>g+1)}}):null,y?(0,Ie.productInitial)(a):null]})}var q=require("@magicx-eng/ai-autocomplete-vanilla"),Ee=require("react");var fa=require("@magicx-eng/ai-autocomplete-vanilla"),Nt=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-948e58da")){let e=document.createElement("style");e.id="ac-style-948e58da",e.textContent=`.aia-grid {
3128
3129
  display: grid;
3129
3130
  grid-template-columns: repeat(
3130
3131
  auto-fit,
@@ -3168,7 +3169,7 @@
3168
3169
  :where([data-aia-options-style="classic"]) .aia-grid[data-scroll] {
3169
3170
  max-height: var(--aia-grid-max-height, 120px);
3170
3171
  }
3171
- `,document.head.appendChild(e)}var ba=require("react/jsx-runtime");function fa({min:e="16rem",max:a,gap:t,scroll:o=!1,maxHeight:i,scrollResetKey:s,cols:r,template:d,innerRef:v,className:x,children:y,...g}){let h=(0,Nt.useRef)(null);(0,Nt.useLayoutEffect)(()=>{if(s===void 0)return;let k=h.current;k&&(k.scrollTop=0)},[s]);let u={"--aia-grid-min":e};return a&&(u["--aia-grid-max"]=a),t&&(u["--aia-grid-gap"]=t),i&&(u["--aia-grid-max-height"]=i),r&&(u.gridTemplateColumns=(0,ga.optionsGridTemplateColumns)(r)),d&&(u.gridTemplateColumns=d),(0,ba.jsx)("div",{ref:k=>{h.current=k,v?.(k)},className:x?`aia-grid ${x}`:"aia-grid","data-scroll":o||void 0,style:u,...g,children:y})}var be=require("@magicx-eng/ai-autocomplete-vanilla"),Ae=require("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 {
3172
+ `,document.head.appendChild(e)}var wa=require("react/jsx-runtime");function ba({min:e="16rem",max:a,gap:t,scroll:o=!1,maxHeight:i,scrollResetKey:s,cols:r,template:d,innerRef:v,className:x,children:y,...g}){let h=(0,Nt.useRef)(null);(0,Nt.useLayoutEffect)(()=>{if(s===void 0)return;let k=h.current;k&&(k.scrollTop=0)},[s]);let u={"--aia-grid-min":e};return a&&(u["--aia-grid-max"]=a),t&&(u["--aia-grid-gap"]=t),i&&(u["--aia-grid-max-height"]=i),r&&(u.gridTemplateColumns=(0,fa.optionsGridTemplateColumns)(r)),d&&(u.gridTemplateColumns=d),(0,wa.jsx)("div",{ref:k=>{h.current=k,v?.(k)},className:x?`aia-grid ${x}`:"aia-grid","data-scroll":o||void 0,style:u,...g,children:y})}var be=require("@magicx-eng/ai-autocomplete-vanilla"),Ae=require("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 {
3172
3173
  position: relative;
3173
3174
  /* Clip, not visible: the entrance rise below runs on the inner content,
3174
3175
  and a transformed box extends its scroll container's scrollable area.
@@ -3694,7 +3695,7 @@
3694
3695
  border-radius: 6px;
3695
3696
  font-size: 11px;
3696
3697
  }
3697
- `,document.head.appendChild(e)}var he={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",loadingOut:"aia-loadingOut-hI-qI",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",text:"aia-text-yqoh9",checkbox:"aia-checkbox-KGRhg"};var ue=require("react/jsx-runtime");function wa({option:e,isHighlighted:a,checked:t,onSelect:o,onHighlight:i,onUnhighlight:s,id:r,loading:d,showIcon:v=!0,showImage:x=!0,showCount:y=!0,scrollHint:g,enterDelayMs:h=0}){let[u]=(0,Ae.useState)(h),[k,S]=(0,Ae.useState)(!1),I=x?(0,be.optionImageSources)(e.image_url):[],H=I[0]??null,[N,de]=(0,Ae.useState)([]),Q=I.find(C=>!N.includes(C))??null,O=x?(e.imageCollage??[]).map(C=>(0,be.optionImageSources)(C)[0]).filter(C=>C!==void 0):[],[W,G]=(0,Ae.useState)(!1),[Z,re]=(0,Ae.useState)(null),R=(0,Ae.useMemo)(()=>!H&&v&&e.icon_svg?(0,be.sanitizeOptionIconSvg)(e.icon_svg):null,[H,v,e.icon_svg]),me=y?(0,be.formatOptionCount)(e.item_count):null,fe=(0,Ae.useRef)(void 0);(0,Ae.useEffect)(()=>()=>clearTimeout(fe.current),[]);let ee=C=>{if(d||!e.is_tappable||k&&t===void 0)return;S(!0);let K=C?.currentTarget;t!==void 0&&K!==void 0&&C!==void 0&&!(0,be.isMultiSelectToggleTap)(K,K.querySelector("[data-aia-checkbox]"),C)?o(e,{commit:!0}):o(e),clearTimeout(fe.current),fe.current=setTimeout(()=>S(!1),170)},ge=[he.item,a&&!d?he.highlighted:"",e.liveMatch&&!d?he.liveMatch:"",e.is_tappable?he.tappable:he.nonTappable,k?he.pressed:"",g?he.scrollHint:""].filter(Boolean).join(" ");return(0,ue.jsx)("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":d?"":void 0,"data-aia-icon":R&&e.icon?e.icon:void 0,"data-aia-image":H?"":void 0,"data-aia-item-count":me!==null?e.item_count:void 0,"aria-selected":t??a,className:ge,style:{[be.OPTION_ENTER_DELAY_VAR]:`${u}ms`},tabIndex:d||!e.is_tappable?-1:0,onClick:ee,onKeyDown:C=>{!d&&e.is_tappable&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),ee())},onMouseEnter:!d&&e.is_tappable?i:void 0,onMouseLeave:s,children:(0,ue.jsxs)("span",{className:he.content,children:[t!==void 0&&e.is_tappable&&(0,ue.jsx)("span",{className:he.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t,children:t?"\u2713":""}),H&&O.length>1&&(0,ue.jsx)("span",{className:`${he.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-collage":O.length,"data-aia-image-loaded":W?"":void 0,children:O.map(C=>(0,ue.jsx)("img",{src:C,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,onLoad:()=>G(!0),onError:K=>{K.currentTarget.hidden=!0}},C))}),H&&O.length<=1&&(0,ue.jsx)("span",{className:`${he.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":Q!==null&&Z===Q?"":void 0,children:(0,ue.jsx)("img",{src:Q??H,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:Q===null,onLoad:()=>re(Q),onError:()=>{Q!==null&&de(C=>[...C,Q])}})}),R&&(0,ue.jsx)("span",{className:`${he.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:R}}),(0,ue.jsxs)("span",{className:he.text,children:[e.matchedText?(0,be.highlightParts)((0,be.optionLabel)(e),e.matchedText).map((C,K)=>C.bold?(0,ue.jsx)("strong",{className:`${he.match} magicx-aia-option-match`,"data-aia-match-partial":C.partial?"":void 0,children:C.text},K):C.text):(0,be.optionLabel)(e),e.parameterLabel&&(0,ue.jsxs)(ue.Fragment,{children:[" ",(0,ue.jsx)("span",{className:`${he.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&(0,ue.jsx)("span",{className:he.tag,children:e.tag}),me!==null&&(0,ue.jsx)("span",{className:`${he.count} magicx-aia-option-count`,children:me})]})})}var Qt=require("react/jsx-runtime");function ii(){let[e,a]=(0,Ee.useState)(q.isOptionsGridMobileViewport);return(0,Ee.useEffect)(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(q.OPTIONS_GRID_MOBILE_QUERY),o=()=>a(t.matches);return o(),t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[]),e}function va({options:e,activeIndex:a,picked:t,onSelect:o,onHighlight:i,onUnhighlight:s,listboxId:r,loading:d,groupKey:v="",optionsPosition:x="below",showIcons:y=!0,showImages:g=!0,showCounts:h=!0}){let u=ii(),k=(0,Ee.useRef)(null),[S,I]=(0,Ee.useState)(null),H=(0,Ee.useRef)(null);(0,Ee.useLayoutEffect)(()=>{if(d&&(0,q.sameOptionRows)(H.current,e))return;H.current=d?null:e;let O=k.current,W=O&&!d&&(0,q.needsOptionsGridMeasurement)(e.length,u),G=O?.closest("[data-aia-dropdown]");W&&G&&(0,q.releasePanelHug)(G);let Z=W?(0,q.measureOptionsGrid)(O):null;I(Z?(0,q.planOptionsGrid)(e.length,u,Z.rowWidths,Z.gridWidth):null)},[e,u,d]);let N=S??(0,q.planOptionsGrid)(e.length,u,null,null);(0,Ee.useLayoutEffect)(()=>{let O=k.current?.closest("[data-aia-dropdown]");O&&(0,q.syncPanelHug)(O)},[N.template,u]);let de=d?-1:a;(0,Ee.useLayoutEffect)(()=>{k.current&&(0,q.syncHighlightScroll)(k.current,de)},[de]);let Q=(0,q.optionsShowLeadingVisuals)(e,y,g);return(0,Qt.jsx)(fa,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:v,template:N.template,maxHeight:N.maxHeight,innerRef:O=>{k.current=O},"data-aia-group":v,children:e.map((O,W)=>(0,Qt.jsx)(wa,{option:O,isHighlighted:W===a,checked:t?t.includes(O.text):void 0,onSelect:o,onHighlight:G=>{(0,q.pointerMayHighlight)(k.current,W,G)&&i(W)},onUnhighlight:s?G=>{(0,q.pointerMayHighlight)(k.current,-1,G)&&s(W)}:void 0,id:`${r}-option-${W}`,loading:d,showIcon:y&&Q,showImage:g&&Q,showCount:h,scrollHint:!d&&N.scrollHintIndices.includes(W),enterDelayMs:d?0:(0,q.optionEnterDelayMs)(W,N.cols,e.length,x)},`${v}\0${O.parameter??""}\0${O.text}`))})}var we=require("@magicx-eng/ai-autocomplete-vanilla"),Oe=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) ---
3698
+ `,document.head.appendChild(e)}var he={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",loadingOut:"aia-loadingOut-hI-qI",parameter:"aia-parameter-Dt2zF",match:"aia-match-pp-9v",icon:"aia-icon-Qw938",count:"aia-count-IpYbQ",image:"aia-image-YZAbO",text:"aia-text-yqoh9",checkbox:"aia-checkbox-KGRhg"};var ue=require("react/jsx-runtime");function va({option:e,isHighlighted:a,checked:t,onSelect:o,onHighlight:i,onUnhighlight:s,id:r,loading:d,showIcon:v=!0,showImage:x=!0,showCount:y=!0,scrollHint:g,enterDelayMs:h=0}){let[u]=(0,Ae.useState)(h),[k,S]=(0,Ae.useState)(!1),I=x?(0,be.optionImageSources)(e.image_url):[],H=I[0]??null,[N,de]=(0,Ae.useState)([]),Q=I.find(C=>!N.includes(C))??null,O=x?(e.imageCollage??[]).map(C=>(0,be.optionImageSources)(C)[0]).filter(C=>C!==void 0):[],[W,G]=(0,Ae.useState)(!1),[Z,re]=(0,Ae.useState)(null),R=(0,Ae.useMemo)(()=>!H&&v&&e.icon_svg?(0,be.sanitizeOptionIconSvg)(e.icon_svg):null,[H,v,e.icon_svg]),me=y?(0,be.formatOptionCount)(e.item_count):null,fe=(0,Ae.useRef)(void 0);(0,Ae.useEffect)(()=>()=>clearTimeout(fe.current),[]);let ee=C=>{if(d||!e.is_tappable||k&&t===void 0)return;S(!0);let K=C?.currentTarget;t!==void 0&&K!==void 0&&C!==void 0&&!(0,be.isMultiSelectToggleTap)(K,K.querySelector("[data-aia-checkbox]"),C)?o(e,{commit:!0}):o(e),clearTimeout(fe.current),fe.current=setTimeout(()=>S(!1),170)},ge=[he.item,a&&!d?he.highlighted:"",e.liveMatch&&!d?he.liveMatch:"",e.is_tappable?he.tappable:he.nonTappable,k?he.pressed:"",g?he.scrollHint:""].filter(Boolean).join(" ");return(0,ue.jsx)("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":d?"":void 0,"data-aia-icon":R&&e.icon?e.icon:void 0,"data-aia-image":H?"":void 0,"data-aia-item-count":me!==null?e.item_count:void 0,"aria-selected":t??a,className:ge,style:{[be.OPTION_ENTER_DELAY_VAR]:`${u}ms`},tabIndex:d||!e.is_tappable?-1:0,onClick:ee,onKeyDown:C=>{!d&&e.is_tappable&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),ee())},onMouseEnter:!d&&e.is_tappable?i:void 0,onMouseLeave:s,children:(0,ue.jsxs)("span",{className:he.content,children:[t!==void 0&&e.is_tappable&&(0,ue.jsx)("span",{className:he.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":t,children:t?"\u2713":""}),H&&O.length>1&&(0,ue.jsx)("span",{className:`${he.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-collage":O.length,"data-aia-image-loaded":W?"":void 0,children:O.map(C=>(0,ue.jsx)("img",{src:C,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,onLoad:()=>G(!0),onError:K=>{K.currentTarget.hidden=!0}},C))}),H&&O.length<=1&&(0,ue.jsx)("span",{className:`${he.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":Q!==null&&Z===Q?"":void 0,children:(0,ue.jsx)("img",{src:Q??H,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:Q===null,onLoad:()=>re(Q),onError:()=>{Q!==null&&de(C=>[...C,Q])}})}),R&&(0,ue.jsx)("span",{className:`${he.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:R}}),(0,ue.jsxs)("span",{className:he.text,children:[e.matchedText?(0,be.highlightParts)((0,be.optionLabel)(e),e.matchedText).map((C,K)=>C.bold?(0,ue.jsx)("strong",{className:`${he.match} magicx-aia-option-match`,"data-aia-match-partial":C.partial?"":void 0,children:C.text},K):C.text):(0,be.optionLabel)(e),e.parameterLabel&&(0,ue.jsxs)(ue.Fragment,{children:[" ",(0,ue.jsx)("span",{className:`${he.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&(0,ue.jsx)("span",{className:he.tag,children:e.tag}),me!==null&&(0,ue.jsx)("span",{className:`${he.count} magicx-aia-option-count`,children:me})]})})}var Qt=require("react/jsx-runtime");function oi(){let[e,a]=(0,Ee.useState)(q.isOptionsGridMobileViewport);return(0,Ee.useEffect)(()=>{if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia(q.OPTIONS_GRID_MOBILE_QUERY),o=()=>a(t.matches);return o(),t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[]),e}function xa({options:e,activeIndex:a,picked:t,onSelect:o,onHighlight:i,onUnhighlight:s,listboxId:r,loading:d,groupKey:v="",optionsPosition:x="below",showIcons:y=!0,showImages:g=!0,showCounts:h=!0}){let u=oi(),k=(0,Ee.useRef)(null),[S,I]=(0,Ee.useState)(null),H=(0,Ee.useRef)(null);(0,Ee.useLayoutEffect)(()=>{if(d&&(0,q.sameOptionRows)(H.current,e))return;H.current=d?null:e;let O=k.current,W=O&&!d&&(0,q.needsOptionsGridMeasurement)(e.length,u),G=O?.closest("[data-aia-dropdown]");W&&G&&(0,q.releasePanelHug)(G);let Z=W?(0,q.measureOptionsGrid)(O):null;I(Z?(0,q.planOptionsGrid)(e.length,u,Z.rowWidths,Z.gridWidth):null)},[e,u,d]);let N=S??(0,q.planOptionsGrid)(e.length,u,null,null);(0,Ee.useLayoutEffect)(()=>{let O=k.current?.closest("[data-aia-dropdown]");O&&(0,q.syncPanelHug)(O)},[N.template,u]);let de=d?-1:a;(0,Ee.useLayoutEffect)(()=>{k.current&&(0,q.syncHighlightScroll)(k.current,de)},[de]);let Q=(0,q.optionsShowLeadingVisuals)(e,y,g);return(0,Qt.jsx)(ba,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:v,template:N.template,maxHeight:N.maxHeight,innerRef:O=>{k.current=O},"data-aia-group":v,children:e.map((O,W)=>(0,Qt.jsx)(va,{option:O,isHighlighted:W===a,checked:t?t.includes(O.text):void 0,onSelect:o,onHighlight:G=>{(0,q.pointerMayHighlight)(k.current,W,G)&&i(W)},onUnhighlight:s?G=>{(0,q.pointerMayHighlight)(k.current,-1,G)&&s(W)}:void 0,id:`${r}-option-${W}`,loading:d,showIcon:y&&Q,showImage:g&&Q,showCount:h,scrollHint:!d&&N.scrollHintIndices.includes(W),enterDelayMs:d?0:(0,q.optionEnterDelayMs)(W,N.cols,e.length,x)},`${v}\0${O.parameter??""}\0${O.text}`))})}var we=require("@magicx-eng/ai-autocomplete-vanilla"),Oe=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) ---
3698
3699
 
3699
3700
  One of three hand-maintained copies (vanilla styles.css, this file, Angular's
3700
3701
  time-wheel.component.css). Only the class-naming layer differs \u2014 the
@@ -3816,7 +3817,7 @@
3816
3817
  .aia-done-llNY5:hover {
3817
3818
  background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
3818
3819
  }
3819
- `,document.head.appendChild(e)}var Re={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 ze=require("react/jsx-runtime"),oi=120;function xa({view:e,label:a,doneLabel:t,interactive:o=!0,onTimeChange:i,onTimeCommit:s}){return(0,ze.jsxs)("div",{className:Re.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":a,onMouseDown:r=>r.preventDefault(),children:[(0,ze.jsx)("span",{className:Re.value,"data-aia-time-value":"","aria-live":"polite",children:(0,we.formatTime)(e.minutes)}),(0,ze.jsxs)("div",{className:Re.columns,"aria-hidden":"true",children:[(0,ze.jsx)("div",{className:Re.band}),we.TIME_WHEEL_COLUMNS.map(r=>(0,ze.jsxs)(Oe.Fragment,{children:[r==="minute"&&(0,ze.jsx)("span",{className:Re.separator,children:":"}),(0,ze.jsx)(ni,{column:r,minutes:e.minutes,interactive:o,onTimeChange:i})]},r))]}),(0,ze.jsx)("button",{type:"button",tabIndex:-1,className:Re.done,"data-aia-time-done":"",onClick:()=>{o&&s()},children:t})]})}function ni({column:e,minutes:a,interactive:t,onTimeChange:o}){let i=(0,Oe.useRef)(null),s=(0,Oe.useRef)(null),r=(0,Oe.useRef)(null),d=(0,Oe.useRef)({minutes:a,interactive:t,onTimeChange:o});d.current={minutes:a,interactive:t,onTimeChange:o};let v=(0,we.timeWheelIndex)(e,a);(0,Oe.useLayoutEffect)(()=>{let g=i.current;if(!g||r.current)return;let h=v*we.TIME_WHEEL_ROW_HEIGHT;Math.abs(g.scrollTop-h)<1||(s.current=h,g.scrollTop=h)},[v]),(0,Oe.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let x=()=>{r.current=null;let g=i.current,h=d.current;if(!g||!h.interactive)return;let u=(0,we.timeWheelIndexFromScroll)(e,g.scrollTop);u!==(0,we.timeWheelIndex)(e,h.minutes)&&h.onTimeChange((0,we.withTimeWheelIndex)(e,h.minutes,u))},y=()=>{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(x,oi)}};return(0,ze.jsx)("div",{ref:i,className:Re.column,"data-aia-time-column":e,onScroll:y,children:(0,we.timeWheelRows)(e).map((g,h)=>(0,ze.jsx)("div",{className:h===v?`${Re.row} ${Re.selected}`:Re.row,"data-aia-time-row":"","data-aia-index":h,onClick:()=>{d.current.interactive&&o((0,we.withTimeWheelIndex)(e,d.current.minutes,h))},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 {
3820
+ `,document.head.appendChild(e)}var Re={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 ze=require("react/jsx-runtime"),ni=120;function ya({view:e,label:a,doneLabel:t,interactive:o=!0,onTimeChange:i,onTimeCommit:s}){return(0,ze.jsxs)("div",{className:Re.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":a,onMouseDown:r=>r.preventDefault(),children:[(0,ze.jsx)("span",{className:Re.value,"data-aia-time-value":"","aria-live":"polite",children:(0,we.formatTime)(e.minutes)}),(0,ze.jsxs)("div",{className:Re.columns,"aria-hidden":"true",children:[(0,ze.jsx)("div",{className:Re.band}),we.TIME_WHEEL_COLUMNS.map(r=>(0,ze.jsxs)(Oe.Fragment,{children:[r==="minute"&&(0,ze.jsx)("span",{className:Re.separator,children:":"}),(0,ze.jsx)(ri,{column:r,minutes:e.minutes,interactive:o,onTimeChange:i})]},r))]}),(0,ze.jsx)("button",{type:"button",tabIndex:-1,className:Re.done,"data-aia-time-done":"",onClick:()=>{o&&s()},children:t})]})}function ri({column:e,minutes:a,interactive:t,onTimeChange:o}){let i=(0,Oe.useRef)(null),s=(0,Oe.useRef)(null),r=(0,Oe.useRef)(null),d=(0,Oe.useRef)({minutes:a,interactive:t,onTimeChange:o});d.current={minutes:a,interactive:t,onTimeChange:o};let v=(0,we.timeWheelIndex)(e,a);(0,Oe.useLayoutEffect)(()=>{let g=i.current;if(!g||r.current)return;let h=v*we.TIME_WHEEL_ROW_HEIGHT;Math.abs(g.scrollTop-h)<1||(s.current=h,g.scrollTop=h)},[v]),(0,Oe.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let x=()=>{r.current=null;let g=i.current,h=d.current;if(!g||!h.interactive)return;let u=(0,we.timeWheelIndexFromScroll)(e,g.scrollTop);u!==(0,we.timeWheelIndex)(e,h.minutes)&&h.onTimeChange((0,we.withTimeWheelIndex)(e,h.minutes,u))},y=()=>{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(x,ni)}};return(0,ze.jsx)("div",{ref:i,className:Re.column,"data-aia-time-column":e,onScroll:y,children:(0,we.timeWheelRows)(e).map((g,h)=>(0,ze.jsx)("div",{className:h===v?`${Re.row} ${Re.selected}`:Re.row,"data-aia-time-row":"","data-aia-index":h,onClick:()=>{d.current.interactive&&o((0,we.withTimeWheelIndex)(e,d.current.minutes,h))},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 {
3820
3821
  display: flex;
3821
3822
  flex-direction: column;
3822
3823
  gap: var(--aia-stack-space, 0.5rem);
@@ -3831,7 +3832,7 @@
3831
3832
  align-items: end;
3832
3833
  }
3833
3834
  /* data-align="stretch" is the flex default \u2014 no rule needed. */
3834
- `,document.head.appendChild(e)}var ka=require("react/jsx-runtime");function ya({space:e,align:a="stretch",className:t,children:o,...i}){let s=e?{"--aia-stack-space":e}:void 0;return(0,ka.jsx)("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":a,style:s,...i,children:o})}var Y=require("react/jsx-runtime"),ri=typeof window>"u"?J.useEffect:J.useLayoutEffect,si=[159,119,164],li=()=>{},Sa=()=>{},di=e=>{},ci=()=>{},pi=e=>{},hi=e=>{},ui=e=>{},mi=e=>{};function gi(e){let a=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,o]=(0,J.useState)(a);if((0,J.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let i=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>o(i.matches);return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function fi(e,a){let t=(0,J.useRef)(null);(0,J.useEffect)(()=>{let o=e.current,i=a.current;if(!o||!i)return;let s=(0,D.queryLive)(o,".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:(0,D.attachScrollArrow)({dropdown:o,grid:s,button:i})};return}t.current?.controller.update()}),(0,J.useEffect)(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function bi(e,a){let t=(0,J.useRef)(a);t.current=a;let o=(0,J.useRef)(null);(0,J.useLayoutEffect)(()=>{let i=e.current;if(i){if(!o.current){o.current=(0,D.attachViewportFit)({dropdown:i,isOpen:()=>t.current});return}o.current.update()}}),(0,J.useEffect)(()=>()=>{o.current?.destroy(),o.current=null},[])}function Ht({suggestions:e,activeIndex:a,onSelect:t,onHighlight:o,onUnhighlight:i,isOpen:s,id:r,className:d,pills:v,onPillClick:x,showPills:y=!0,onSkip:g,showSkipButton:h=!0,showOptionIcons:u=!0,showOptionImages:k=!0,showOptionCounts:S=!0,skipDisabled:I=!1,activeSelected:H=!1,isLoading:N=!1,skeletonExiting:de=!1,isInputEmpty:Q=!1,language:O,products:W,onProductSelect:G,onProductAddToCart:Z,onProductFocusChange:re,productsLayout:R="row",productImageFallback:me="image",showProductVendor:fe=!0,formatType:ee="options",dateView:ge=null,selectedDateIso:C=null,selectedDateRange:K=null,dateRangeStart:p=null,dateReferences:z,onPreviousMonth:Ve,onNextMonth:Je,timeView:De=null,multiSelectView:rt=null,onMultiSelectCommit:et,onSeeAllResults:m,seeAllBusy:_e=!1,busyProductId:tt=null,fullWidth:at=!1,onTimeChange:f,onTimeCommit:T,locationView:A=null,isReediting:L=!1,onLocationQuery:F,onLocationMove:se,onLocationCommit:Se,onLocationFocusChange:Ce,isFocused:Ue=!1,optionsPosition:Me="below",mode:it}){let Te=gi(it),st=Te!==void 0,te=(0,J.useRef)(null),Qe=(0,J.useRef)(null);fi(te,Qe),(0,J.useEffect)(()=>{if(te.current)return(0,D.containScroll)(te.current)},[]);let mt=e[0]?.options??[],St=!!(v&&v.length>0&&x),Ne=!!(W&&W.length>0),lt=ee==="time"&&De!=null,dt=ee==="location"&&A!=null,ce=s&&(mt.length>0||y&&St||N||Ne||lt||dt);bi(te,ce),ri(()=>{let E=te.current;E&&((0,D.fitMultiSelectDone)(E,(0,D.findMultiSelectDone)(E)),(0,D.syncPanelHug)(E))});let He={suggestions:e,activeIndex:a,pills:v,showPills:y,showSkipButton:h,showOptionIcons:u,showOptionImages:k,showOptionCounts:S,skipDisabled:I,activeSelected:H,isLoading:N,skeletonExiting:de,isInputEmpty:Q,products:W,formatType:ee,dateView:ge,selectedDateIso:C,selectedDateRange:K,dateRangeStart:p,dateReferences:z,timeView:De,multiSelectView:rt,locationView:A,isReediting:L,showsSeeAll:!!m},ct=(0,J.useRef)(He);ce&&(ct.current=He);let n=ce?He:ct.current,le=(0,D.uiStringsFor)(O),Fe=n.suggestions[0],w=Fe?.options??[],pt=n.activeIndex>=0&&!!w[n.activeIndex]?.is_tappable,Ye=(0,D.labelTraditionalAutocomplete)(n.pills??[],le.keepTyping),Be=!!(Ye.length>0&&x),b=n.showPills&&Be,gt=n.showPills&&!Be&&n.isLoading,ft=b||gt,je=Be&&(0,D.hasSkippablePill)(Ye)&&n.showSkipButton&&!n.isInputEmpty&&!!g,bt=Ye[0]?.text,wt=(0,D.isCalendarFormat)(n.formatType)&&n.dateView!=null,$e=w.length>0&&!wt,vt=w.length>0&&wt&&!n.isLoading,Ze=n.formatType==="time"&&n.timeView!=null&&!n.isLoading,We=n.formatType==="location"&&n.locationView!=null&&!n.isLoading,xt=n.isLoading&&!$e&&!vt&&!Ze&&!We,ht=n.products??[],yt=(0,D.panelMorphKey)(b?Ye:[]);return(0,J.useLayoutEffect)(()=>{te.current&&(0,D.settlePanelMorph)(te.current,yt,{visible:ce,anchorBottom:Me==="above"})},[yt,ce,Me,n.suggestions,n.pills,n.isLoading,n.skeletonExiting,n.isInputEmpty,n.products,n.formatType,n.dateView,n.selectedDateIso,n.selectedDateRange,n.dateRangeStart,n.dateReferences,n.timeView,n.multiSelectView,n.locationView,n.showPills,n.showSkipButton,n.showOptionIcons,n.showOptionImages,n.showOptionCounts,n.showsSeeAll,R,O]),(0,J.useEffect)(()=>{let E=te.current;return()=>{E&&(0,D.destroyPanelMorph)(E)}},[]),(0,Y.jsxs)("div",{ref:te,id:r,role:"listbox","aria-multiselectable":!!n.multiSelectView,"data-aia-dropdown":"","data-options-position":Me,"data-mode":Te,"data-aia-loading":n.isLoading?"":void 0,"data-aia-skeleton-exiting":n.skeletonExiting?"":void 0,"data-aia-has-products":ht.length>0?"":void 0,"data-aia-full-width":at?"":void 0,className:`${st?"magicx-aia ":""}${Pe.dropdown} ${ce?Pe.visible:""} ${d??""}`,onMouseDown:E=>E.preventDefault(),children:[(0,Y.jsxs)(ya,{space:"8px",children:[(ft||je)&&(0,Y.jsxs)(Et,{noWrap:!0,className:Pe.pillBar,"data-aia-pillbar":"",children:[ft&&(0,Y.jsx)("span",{className:Pe.pillScroll,"data-aia-pill-scroll":"",children:(0,Y.jsx)(Mt,{pills:Ye,activePillIndex:0,activeSelected:n.activeSelected,onSelectPill:x??(()=>{}),rounded:!0,loading:n.isLoading})}),je&&(0,Y.jsx)("button",{type:"button",tabIndex:-1,className:Pe.skip,"data-aia-skip":"",disabled:n.isLoading||n.skipDisabled,"aria-label":bt?`${le.skipLabel} ${bt}`:le.skipLabel,onClick:g,children:le.skip})]}),$e&&(0,Y.jsx)(va,{options:w,activeIndex:n.activeIndex,onSelect:t,onHighlight:o,onUnhighlight:i,listboxId:r,loading:n.isLoading,groupKey:Fe?`${Fe.parameter} ${Fe.text}`:"",optionsPosition:Me,showIcons:n.showOptionIcons,showImages:n.showOptionImages,showCounts:n.showOptionCounts,picked:n.multiSelectView?.picked}),n.multiSelectView&&(0,Y.jsx)("div",{"data-aia-multi-actions":"",onClick:E=>{E.target.closest("[data-aia-multi-done]")&&!n.skipDisabled&&!n.isLoading&&et?.()},children:(0,Y.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:Pe.multiDone,ref:E=>{E&&(E.disabled=!0,E.offsetHeight,E.disabled=n.skipDisabled||n.isLoading)},children:le.done})}),vt&&n.dateView&&(0,Y.jsx)(na,{options:w,activeIndex:n.activeIndex,listboxId:r,view:n.dateView,selection:{selectedIso:n.selectedDateIso??null,selectedRange:n.selectedDateRange??null,rangeStart:n.dateRangeStart??null,floor:(0,D.dateFloorFor)(n.formatType,n.dateRangeStart),references:n.dateReferences??[]},onSelect:t,onHighlight:o,onUnhighlight:i,onPreviousMonth:Ve??Sa,onNextMonth:Je??Sa}),Ze&&n.timeView&&(0,Y.jsx)(xa,{view:n.timeView,label:le.timeLabel,doneLabel:le.done,interactive:!n.skipDisabled,onTimeChange:f??di,onTimeCommit:T??ci}),We&&n.locationView&&(0,Y.jsx)(ca,{view:n.locationView,searchLabel:le.locationSearch,noResultsLabel:le.locationNoResults,useTypedLabel:le.locationUseTyped,widgetFocused:Ue&&ce,reediting:n.isReediting,visible:ce,interactive:!n.skipDisabled,onQuery:F??pi,onMove:se??hi,onCommit:Se??ui,onFocusChange:Ce??mi}),xt&&(0,Y.jsx)("div",{className:Pe.skeletonBars,"data-aia-skeleton-bars":"",children:si.map(E=>(0,Y.jsx)("span",{className:Pe.skeletonBar,style:{width:E}},`bar-${E}`))}),(0,Y.jsx)(ma,{products:ht,listboxId:r,onSelect:G??li,busyProductId:tt,onAddToCart:Z,onFocusChange:re,focusable:ce&&!n.isLoading,loading:n.isLoading,layout:R,imageFallback:me,showVendor:fe,strings:le}),n.showsSeeAll&&(0,Y.jsx)("div",{className:Pe.seeAllRow,"data-aia-see-all":"",onClick:E=>{E.target.closest("[data-aia-see-all-button]")&&(E.stopPropagation(),!(n.isLoading||_e)&&m?.())},children:(0,Y.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-see-all-button":"","data-aia-see-all-state":_e?"busy":void 0,"aria-busy":_e?!0:void 0,className:Pe.seeAll,ref:E=>{E&&(E.disabled=!0,E.offsetHeight,E.disabled=n.isLoading)},children:le.seeAllResults})}),(0,Y.jsx)(ra,{isOptionHighlighted:pt,isInputEmpty:n.isInputEmpty,strings:le})]}),(0,Y.jsx)("button",{ref:Qe,type:"button",tabIndex:-1,className:Pe.scrollArrow,"data-aia-scroll-arrow":"","aria-label":le.scrollArrow,"aria-hidden":"true",children:(0,Y.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,Y.jsx)("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}var qe=require("@magicx-eng/ai-autocomplete-vanilla");var Ta=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 {
3835
+ `,document.head.appendChild(e)}var Sa=require("react/jsx-runtime");function ka({space:e,align:a="stretch",className:t,children:o,...i}){let s=e?{"--aia-stack-space":e}:void 0;return(0,Sa.jsx)("div",{className:t?`aia-stack ${t}`:"aia-stack","data-align":a,style:s,...i,children:o})}var Y=require("react/jsx-runtime"),si=typeof window>"u"?J.useEffect:J.useLayoutEffect,li=[159,119,164],di=()=>{},Ca=()=>{},ci=e=>{},pi=()=>{},hi=e=>{},ui=e=>{},mi=e=>{},gi=e=>{};function fi(e){let a=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[t,o]=(0,J.useState)(a);if((0,J.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let i=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>o(i.matches);return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?t?"dark":"light":e}function bi(e,a){let t=(0,J.useRef)(null);(0,J.useEffect)(()=>{let o=e.current,i=a.current;if(!o||!i)return;let s=(0,D.queryLive)(o,".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:(0,D.attachScrollArrow)({dropdown:o,grid:s,button:i})};return}t.current?.controller.update()}),(0,J.useEffect)(()=>()=>{t.current?.controller.destroy(),t.current=null},[])}function wi(e,a){let t=(0,J.useRef)(a);t.current=a;let o=(0,J.useRef)(null);(0,J.useLayoutEffect)(()=>{let i=e.current;if(i){if(!o.current){o.current=(0,D.attachViewportFit)({dropdown:i,isOpen:()=>t.current});return}o.current.update()}}),(0,J.useEffect)(()=>()=>{o.current?.destroy(),o.current=null},[])}function Ht({suggestions:e,activeIndex:a,onSelect:t,onHighlight:o,onUnhighlight:i,isOpen:s,id:r,className:d,pills:v,onPillClick:x,showPills:y=!0,onSkip:g,showSkipButton:h=!0,showOptionIcons:u=!0,showOptionImages:k=!0,showOptionCounts:S=!0,skipDisabled:I=!1,activeSelected:H=!1,isLoading:N=!1,skeletonExiting:de=!1,isInputEmpty:Q=!1,language:O,products:W,onProductSelect:G,onProductAddToCart:Z,onProductFocusChange:re,productsLayout:R="row",productImageFallback:me="image",showProductVendor:fe=!0,formatType:ee="options",dateView:ge=null,selectedDateIso:C=null,selectedDateRange:K=null,dateRangeStart:p=null,dateReferences:z,onPreviousMonth:Ve,onNextMonth:Je,timeView:De=null,multiSelectView:rt=null,onMultiSelectCommit:et,onSeeAllResults:m,seeAllBusy:_e=!1,busyProductId:tt=null,fullWidth:at=!1,onTimeChange:f,onTimeCommit:T,locationView:A=null,isReediting:L=!1,onLocationQuery:F,onLocationMove:se,onLocationCommit:Se,onLocationFocusChange:Ce,isFocused:Ue=!1,optionsPosition:Me="below",mode:it}){let Te=fi(it),st=Te!==void 0,te=(0,J.useRef)(null),Qe=(0,J.useRef)(null);bi(te,Qe),(0,J.useEffect)(()=>{if(te.current)return(0,D.containScroll)(te.current)},[]);let mt=e[0]?.options??[],St=!!(v&&v.length>0&&x),Ne=!!(W&&W.length>0),lt=ee==="time"&&De!=null,dt=ee==="location"&&A!=null,ce=s&&(mt.length>0||y&&St||N||Ne||lt||dt);wi(te,ce),si(()=>{let E=te.current;E&&((0,D.fitMultiSelectDone)(E,(0,D.findMultiSelectDone)(E)),(0,D.syncPanelHug)(E))});let He={suggestions:e,activeIndex:a,pills:v,showPills:y,showSkipButton:h,showOptionIcons:u,showOptionImages:k,showOptionCounts:S,skipDisabled:I,activeSelected:H,isLoading:N,skeletonExiting:de,isInputEmpty:Q,products:W,formatType:ee,dateView:ge,selectedDateIso:C,selectedDateRange:K,dateRangeStart:p,dateReferences:z,timeView:De,multiSelectView:rt,locationView:A,isReediting:L,showsSeeAll:!!m},ct=(0,J.useRef)(He);ce&&(ct.current=He);let n=ce?He:ct.current,le=(0,D.uiStringsFor)(O),Fe=n.suggestions[0],b=Fe?.options??[],pt=n.activeIndex>=0&&!!b[n.activeIndex]?.is_tappable,Ye=(0,D.labelTraditionalAutocomplete)(n.pills??[],le.keepTyping),Be=!!(Ye.length>0&&x),w=n.showPills&&Be,gt=n.showPills&&!Be&&n.isLoading,ft=w||gt,je=Be&&(0,D.hasSkippablePill)(Ye)&&n.showSkipButton&&!n.isInputEmpty&&!!g,bt=Ye[0]?.text,wt=(0,D.isCalendarFormat)(n.formatType)&&n.dateView!=null,$e=b.length>0&&!wt,vt=b.length>0&&wt&&!n.isLoading,Ze=n.formatType==="time"&&n.timeView!=null&&!n.isLoading,We=n.formatType==="location"&&n.locationView!=null&&!n.isLoading,xt=n.isLoading&&!$e&&!vt&&!Ze&&!We,ht=n.products??[],yt=(0,D.panelMorphKey)(w?Ye:[]);return(0,J.useLayoutEffect)(()=>{te.current&&(0,D.settlePanelMorph)(te.current,yt,{visible:ce,anchorBottom:Me==="above"})},[yt,ce,Me,n.suggestions,n.pills,n.isLoading,n.skeletonExiting,n.isInputEmpty,n.products,n.formatType,n.dateView,n.selectedDateIso,n.selectedDateRange,n.dateRangeStart,n.dateReferences,n.timeView,n.multiSelectView,n.locationView,n.showPills,n.showSkipButton,n.showOptionIcons,n.showOptionImages,n.showOptionCounts,n.showsSeeAll,R,O]),(0,J.useEffect)(()=>{let E=te.current;return()=>{E&&(0,D.destroyPanelMorph)(E)}},[]),(0,Y.jsxs)("div",{ref:te,id:r,role:"listbox","aria-multiselectable":!!n.multiSelectView,"data-aia-dropdown":"","data-options-position":Me,"data-mode":Te,"data-aia-loading":n.isLoading?"":void 0,"data-aia-skeleton-exiting":n.skeletonExiting?"":void 0,"data-aia-has-products":ht.length>0?"":void 0,"data-aia-full-width":at?"":void 0,className:`${st?"magicx-aia ":""}${Pe.dropdown} ${ce?Pe.visible:""} ${d??""}`,onMouseDown:E=>E.preventDefault(),children:[(0,Y.jsxs)(ka,{space:"8px",children:[(ft||je)&&(0,Y.jsxs)(Et,{noWrap:!0,className:Pe.pillBar,"data-aia-pillbar":"",children:[ft&&(0,Y.jsx)("span",{className:Pe.pillScroll,"data-aia-pill-scroll":"",children:(0,Y.jsx)(Mt,{pills:Ye,activePillIndex:0,activeSelected:n.activeSelected,onSelectPill:x??(()=>{}),rounded:!0,loading:n.isLoading})}),je&&(0,Y.jsx)("button",{type:"button",tabIndex:-1,className:Pe.skip,"data-aia-skip":"",disabled:n.isLoading||n.skipDisabled,"aria-label":bt?`${le.skipLabel} ${bt}`:le.skipLabel,onClick:g,children:le.skip})]}),$e&&(0,Y.jsx)(xa,{options:b,activeIndex:n.activeIndex,onSelect:t,onHighlight:o,onUnhighlight:i,listboxId:r,loading:n.isLoading,groupKey:Fe?`${Fe.parameter} ${Fe.text}`:"",optionsPosition:Me,showIcons:n.showOptionIcons,showImages:n.showOptionImages,showCounts:n.showOptionCounts,picked:n.multiSelectView?.picked}),n.multiSelectView&&(0,Y.jsx)("div",{"data-aia-multi-actions":"",onClick:E=>{E.target.closest("[data-aia-multi-done]")&&!n.skipDisabled&&!n.isLoading&&et?.()},children:(0,Y.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:Pe.multiDone,ref:E=>{E&&(E.disabled=!0,E.offsetHeight,E.disabled=n.skipDisabled||n.isLoading)},children:le.done})}),vt&&n.dateView&&(0,Y.jsx)(ra,{options:b,activeIndex:n.activeIndex,listboxId:r,view:n.dateView,selection:{selectedIso:n.selectedDateIso??null,selectedRange:n.selectedDateRange??null,rangeStart:n.dateRangeStart??null,floor:(0,D.dateFloorFor)(n.formatType,n.dateRangeStart),references:n.dateReferences??[]},onSelect:t,onHighlight:o,onUnhighlight:i,onPreviousMonth:Ve??Ca,onNextMonth:Je??Ca}),Ze&&n.timeView&&(0,Y.jsx)(ya,{view:n.timeView,label:le.timeLabel,doneLabel:le.done,interactive:!n.skipDisabled,onTimeChange:f??ci,onTimeCommit:T??pi}),We&&n.locationView&&(0,Y.jsx)(pa,{view:n.locationView,searchLabel:le.locationSearch,noResultsLabel:le.locationNoResults,useTypedLabel:le.locationUseTyped,widgetFocused:Ue&&ce,reediting:n.isReediting,visible:ce,interactive:!n.skipDisabled,onQuery:F??hi,onMove:se??ui,onCommit:Se??mi,onFocusChange:Ce??gi}),xt&&(0,Y.jsx)("div",{className:Pe.skeletonBars,"data-aia-skeleton-bars":"",children:li.map(E=>(0,Y.jsx)("span",{className:Pe.skeletonBar,style:{width:E}},`bar-${E}`))}),(0,Y.jsx)(ga,{products:ht,listboxId:r,onSelect:G??di,busyProductId:tt,onAddToCart:Z,onFocusChange:re,focusable:ce&&!n.isLoading,loading:n.isLoading,layout:R,imageFallback:me,showVendor:fe,strings:le}),n.showsSeeAll&&(0,Y.jsx)("div",{className:Pe.seeAllRow,"data-aia-see-all":"",onClick:E=>{E.target.closest("[data-aia-see-all-button]")&&(E.stopPropagation(),!(n.isLoading||_e)&&m?.())},children:(0,Y.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-see-all-button":"","data-aia-see-all-state":_e?"busy":void 0,"aria-busy":_e?!0:void 0,className:Pe.seeAll,ref:E=>{E&&(E.disabled=!0,E.offsetHeight,E.disabled=n.isLoading)},children:le.seeAllResults})}),(0,Y.jsx)(sa,{isOptionHighlighted:pt,isInputEmpty:n.isInputEmpty,strings:le})]}),(0,Y.jsx)("button",{ref:Qe,type:"button",tabIndex:-1,className:Pe.scrollArrow,"data-aia-scroll-arrow":"","aria-label":le.scrollArrow,"aria-hidden":"true",children:(0,Y.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,Y.jsx)("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}var qe=require("@magicx-eng/ai-autocomplete-vanilla");var Pa=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 {
3835
3836
  flex-shrink: 0;
3836
3837
  width: 32px;
3837
3838
  height: 32px;
@@ -3935,5 +3936,5 @@
3935
3936
  transition: none;
3936
3937
  }
3937
3938
  }
3938
- `,document.head.appendChild(e)}var Ca={submitButton:"aia-submitButton-otz7H",submitSpin:"aia-submitSpin-0llcF"};var Ft=require("react/jsx-runtime");function Pa({disabled:e,ready:a,busy:t=!1,onClick:o,label:i=(0,Ta.uiStringsFor)().submit}){return(0,Ft.jsx)("button",{type:"button","data-aia-submit":"",className:Ca.submitButton,disabled:e,"data-aia-ready":a?"":void 0,"data-aia-submit-state":t?"busy":void 0,"aria-busy":t?!0:void 0,onClick:s=>{s.stopPropagation(),o()},"aria-label":i,children:(0,Ft.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":i,children:(0,Ft.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var ke=require("@magicx-eng/ai-autocomplete-vanilla"),P=require("react");var Yt=require("react");function Ia(e){let a=(0,Yt.useRef)(e);a.current=e;let t=Object.keys(e??{}).sort().join("\0"),o=(0,Yt.useRef)({key:"",overrides:void 0});if(o.current.key!==t){let i={};for(let s of Object.keys(e??{})){let r=(d,v,x)=>{let y=a.current?.[s];return y?y(d,v,x):[]};i[s]=r}o.current={key:t,overrides:e?i:void 0}}return{overrides:o.current.overrides,key:t}}var jt=require("react");function Aa(e){let a=(0,jt.useRef)(e);a.current=e;let t=(0,jt.useRef)(null);t.current===null&&(t.current={fetch:(i,s)=>{let r=a.current;return r?r.fetch(i,s):Promise.reject(new Error("products config removed"))},transform:i=>a.current?.transform(i)??[],get limit(){return a.current?.limit}});let o=e!==void 0;return{config:o?t.current:void 0,enabled:o}}var Ea={text:"",composing:null,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,skeletonPicked:null,dropdownSuggestion:null,skeletonRequested:!1,skeletonExiting:!1,activeFormatType:"options",dateView:null,dateRangeStart:null,dateReferences:[],dateFloor:null,timeView:null,multiSelectView:null,dropdownMultiSelect:null,multiSelectDraft:null,locationView:null,locationSearch:null,locationAutocomplete:!0,locationFieldFocused:!1,isSubmitting:!1,selectingProductId:null,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 Bt({onSubmit:e,onResult:a,onError:t,optionOverrides:o,maskCompletedText:i,apiConfig:s,additionalContext:r,language:d,currency:v,productId:x,visitorId:y,analyticsConsent:g,columns:h=2,dropdownTrigger:u,optionsPosition:k,closeDropdownOnBlur:S,prependPlaceholder:I,allOption:H,showNonTappableOptions:N,locationSearch:de,showOptionIcons:Q,showOptionImages:O,showOptionCounts:W,showSkipButton:G,showProducts:Z,submitProgress:re,productImageFallback:R="image",showProductVendor:me=!0,onFocus:fe,onBlur:ee,value:ge,completedParams:C,onChange:K,onParamsChange:p,products:z,mapProducts:Ve,onProductSelect:Je,onProductAddToCart:De,source:rt,setCursor:et}){let m=(0,P.useRef)(null),[_e,tt]=(0,P.useState)(null),at=(0,P.useRef)(e);at.current=e;let f=(0,P.useRef)(a);f.current=a;let T=(0,P.useRef)(t);T.current=t;let A=(0,P.useRef)(K);A.current=K;let L=(0,P.useRef)(p);L.current=p;let F=(0,P.useRef)(fe);F.current=fe;let se=(0,P.useRef)(ee);se.current=ee;let Se=(0,P.useRef)(et);Se.current=et;let Ce=(0,P.useRef)(Je);Ce.current=Je;let Ue=(0,P.useRef)(De);Ue.current=De;let Me=(0,P.useRef)(y);Me.current=y;let it=(0,P.useRef)(()=>{let l=Me.current;return typeof l=="function"?l():l}).current,Te=y!==void 0,st=(0,P.useRef)(g);st.current=g;let te=(0,P.useRef)(()=>{let l=st.current;return typeof l=="function"?l():l}).current,Qe=Aa(z),mt=(0,P.useRef)(Ve);mt.current=Ve;let St=(0,P.useRef)((l,ae)=>{let _=mt.current;return _?_(l,ae):l}).current,Ne=Ve?St:void 0,lt=Ia(o);(0,P.useEffect)(()=>{if(typeof document>"u")return;let l=new ke.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:d,currency:v,productId:x,visitorId:Te?it:void 0,analyticsConsent:te,optionOverrides:lt.overrides,maskCompletedText:i,columns:h,dropdownTrigger:u,optionsPosition:k,closeDropdownOnBlur:S,prependPlaceholder:I,allOption:H,showNonTappableOptions:N,locationSearch:de,showProducts:Z,submitProgress:re,source:rt,value:ge,completedParams:C,onSubmit:(..._)=>at.current?.(..._),onResult:(..._)=>f.current?.(..._),onError:(..._)=>T.current?.(..._),onChange:(..._)=>A.current?.(..._),onParamsChange:(..._)=>L.current?.(..._),onFocus:()=>F.current?.(),onBlur:()=>se.current?.(),onProductSelect:_=>Ce.current?Ce.current(_):ke.HANDOFF_NOT_HANDLED,onProductAddToCart:_=>Ue.current?.(_),setCursor:_=>Se.current?.(_),products:Qe.config,mapProducts:Ne});m.current=l,tt(l.getState());let ae=l.subscribe(_=>tt(_));return()=>{ae(),l.destroy(),m.current===l&&(m.current=null)}},[]);let dt=(0,P.useRef)(Te);(0,P.useEffect)(()=>{dt.current!==Te&&(dt.current=Te,m.current?.update({visitorId:Te?it:void 0,analyticsConsent:te}))},[Te,it,te]);let ce=typeof g=="function"?"function":g,He=(0,P.useRef)(ce);(0,P.useEffect)(()=>{He.current!==ce&&(He.current=ce,m.current?.refreshAnalyticsConsent())},[ce]),(0,P.useEffect)(()=>{ge!==void 0&&m.current?.setValue(ge)},[ge]),(0,P.useEffect)(()=>{C!==void 0&&m.current?.setCompletedParams(C)},[C]);let ct=JSON.stringify(s??null),n;try{n=JSON.stringify(r??null)}catch{n="[unstringifiable]"}(0,P.useEffect)(()=>{m.current?.update({apiConfig:s,additionalContext:r,language:d,currency:v,productId:x,optionOverrides:lt.overrides,dropdownTrigger:u,optionsPosition:k,closeDropdownOnBlur:S,prependPlaceholder:I,allOption:H,showNonTappableOptions:N,locationSearch:de,showProducts:Z,submitProgress:re})},[ct,n,d,v?.code,v?.rate,v?.country,x,lt.key,u,k,S,I,H,N,de,Z,re]);let le=(0,P.useRef)(!1);(0,P.useEffect)(()=>{if(!le.current){le.current=!0;return}m.current?.update({products:Qe.config})},[Qe.enabled]),(0,P.useEffect)(()=>{m.current?.update({mapProducts:Ne})},[Ne]);let Fe=(0,P.useRef)(null);Fe.current===null&&(Fe.current={handleTextChange:l=>m.current?.handleTextChange(l),handleCompositionText:l=>m.current?.handleCompositionText(l),handleKeyDown:l=>{let ae="nativeEvent"in l?l.nativeEvent:l;m.current?.handleKeyDown(ae)},setFocused:l=>m.current?.setFocused(l),startEditingParam:l=>m.current?.startEditingParam(l),removeParam:l=>m.current?.removeParam(l)??!1,exitEditMode:()=>m.current?.exitEditMode(),handleCaretAfterInput:l=>m.current?.handleCaretAfterInput(l),handleCaretMove:l=>m.current?.handleCaretMove(l),replaceEditingRange:l=>m.current?.replaceEditingRange(l)??!1,setActivePill:l=>m.current?.setActivePill(l),skipActivePill:()=>m.current?.skipActivePill(),removeLastParam:()=>m.current?.removeLastParam(),clearNewParamId:()=>m.current?.clearNewParamId(),reset:()=>m.current?.reset(),refreshProducts:()=>m.current?.refreshProducts(),prepareSubmit:()=>m.current?.prepareSubmit(),getState:()=>m.current?.getState()??Ea,recordSubmit:l=>m.current?.recordSubmit(l),holdSubmit:l=>m.current?.holdSubmit(l),endSubmitProgress:()=>m.current?.endSubmitProgress(),getVisitorId:()=>m.current?.getVisitorId(),refreshAnalyticsConsent:()=>m.current?.refreshAnalyticsConsent(),selectOption:(l,ae)=>m.current?.selectOption(l,ae),selectProduct:l=>m.current?.selectProduct(l),addProductToCart:l=>{let ae=m.current;return!ae||!Ue.current?Promise.resolve():ae.addProductToCart(l)},setActiveDropdownIndex:l=>m.current?.setActiveDropdownIndex(l),clearHighlight:l=>m.current?.clearHighlight(l),showPreviousMonth:()=>m.current?.showPreviousMonth(),showNextMonth:()=>m.current?.showNextMonth(),setTime:l=>m.current?.setTime(l),commitTime:()=>m.current?.commitTime(),toggleMultiSelectOption:l=>m.current?.toggleMultiSelectOption(l),commitMultiSelect:()=>m.current?.commitMultiSelect(),setLocationQuery:l=>m.current?.setLocationQuery(l),moveLocationHighlight:l=>m.current?.moveLocationHighlight(l),commitLocation:l=>m.current?.commitLocation(l),setLocationFieldFocused:l=>m.current?.setLocationFieldFocused(l),handleFocus:()=>m.current?.setFocused(!0),handleBlur:()=>m.current?.setFocused(!1)});let w=Fe.current,pt=(0,P.useCallback)(l=>{let ae=l.target.value,Tt=ae.length>0&&!l.nativeEvent?.isComposing&&ae[0]!==ae[0].toUpperCase()?ae[0].toUpperCase()+ae.slice(1):ae;m.current?.handleTextChange(Tt)},[]),Ye=(0,P.useCallback)(l=>{m.current?.handleKeyDown(l.nativeEvent)},[]),Be=m.current,b=_e??Ea,gt=ge!==void 0?ge:b.text,ft=C!==void 0?C:b.completedParams,je=b.actionableSuggestions,bt=je[0],wt=(0,P.useMemo)(()=>(0,ke.withoutTraditionalAutocomplete)(je),[je]),$e=Be?.listboxId??"",vt=b.activeDropdownIndex>=0&&Be?`${$e}-option-${b.activeDropdownIndex}`:void 0,Ze=b.editingParam,We=b.editingIdentified,xt=Ze?(0,ke.editingSuggestion)(Ze):We?{parameter:We.parameter,text:(0,ke.identifiedParamLabel)(We.parameter),required:!0,options:[]}:null,ht=b.dropdownSuggestion??xt??bt,yt=(0,ke.dropdownPillsFor)(b.dropdownSuggestion,xt,je),E=(0,ke.dateSelectionFor)(b),Ct=!Be||b.dropdownLoading;return{completedParams:ft,multiSelectView:b.multiSelectView,toggleMultiSelectOption:w.toggleMultiSelectOption,commitMultiSelect:w.commitMultiSelect,skippedParams:b.skippedParams,identifiedParams:b.identifiedParams,suggestionPills:wt,setActivePill:w.setActivePill,skipActivePill:w.skipActivePill,removeLastParam:w.removeLastParam,segments:b.segments,newParamId:b.newParamId,clearNewParamId:w.clearNewParamId,suggestions:b.suggestions,activeIndex:b.activeDropdownIndex,isReady:b.isReady,isLoading:Ct,isFocused:b.isFocused,isDropdownOpen:b.isDropdownOpen,isActivePillSelected:b.isActivePillSelected,placeholderText:b.placeholderText,listboxId:$e,error:b.error,products:b.products,customFields:b.customFields,selectProduct:w.selectProduct,addProductToCart:w.addProductToCart,handleTextChange:w.handleTextChange,handleCompositionText:w.handleCompositionText,handleKeyDown:w.handleKeyDown,setFocused:w.setFocused,editingParam:Ze,editingIdentified:We,editingAnchor:b.editingAnchor,caretOffset:b.caretOffset,startEditingParam:w.startEditingParam,removeParam:w.removeParam,exitEditMode:w.exitEditMode,handleCaretAfterInput:w.handleCaretAfterInput,handleCaretMove:w.handleCaretMove,replaceEditingRange:w.replaceEditingRange,inputProps:{value:gt,placeholder:b.placeholderText||void 0,onChange:pt,onKeyDown:Ye,onFocus:w.handleFocus,onBlur:w.handleBlur,role:"combobox","aria-expanded":b.isDropdownOpen,"aria-activedescendant":vt,"aria-autocomplete":"list","aria-controls":$e},reset:w.reset,refreshProducts:w.refreshProducts,prepareSubmit:w.prepareSubmit,getState:w.getState,recordSubmit:w.recordSubmit,holdSubmit:w.holdSubmit,endSubmitProgress:w.endSubmitProgress,getVisitorId:w.getVisitorId,refreshAnalyticsConsent:w.refreshAnalyticsConsent,isSubmitting:b.isSubmitting,selectingProductId:b.selectingProductId,dropdownProps:{suggestions:ht?[{...ht,options:b.dropdownOptions}]:[],activeIndex:b.activeDropdownIndex,onSelect:w.selectOption,onHighlight:w.setActiveDropdownIndex,onUnhighlight:w.clearHighlight,isOpen:b.isDropdownOpen,id:$e,pills:yt,activeSelected:b.isActivePillSelected,onPillClick:w.setActivePill,onSkip:w.skipActivePill,showSkipButton:(G??!0)&&!Ze&&!We,showOptionIcons:Q??!0,showOptionImages:O??!0,showOptionCounts:W??!0,skipDisabled:b.inSelectionAnimation,isLoading:Ct,skeletonExiting:b.skeletonExiting,isInputEmpty:gt.trim().length===0,language:d,products:b.products,productImageFallback:R,showProductVendor:me,onProductSelect:w.selectProduct,busyProductId:b.selectingProductId,seeAllBusy:b.isSubmitting,onProductAddToCart:De?w.addProductToCart:void 0,onProductFocusChange:w.setFocused,formatType:b.activeFormatType,dateView:b.dateView,selectedDateIso:E.selectedIso,selectedDateRange:E.selectedRange,dateRangeStart:E.rangeStart,dateReferences:E.references,onPreviousMonth:w.showPreviousMonth,onNextMonth:w.showNextMonth,timeView:b.timeView,multiSelectView:b.dropdownMultiSelect,onMultiSelectCommit:w.commitMultiSelect,onTimeChange:w.setTime,onTimeCommit:w.commitTime,locationView:b.locationView,isReediting:b.editingParam!=null,onLocationQuery:w.setLocationQuery,onLocationMove:w.moveLocationHighlight,onLocationCommit:w.commitLocation,onLocationFocusChange:w.setLocationFieldFocused,isFocused:b.isFocused||b.locationFieldFocused,optionsPosition:k??"below"}}}var j=require("@magicx-eng/ai-autocomplete-vanilla"),M=require("react"),Wt;function wi(){if(Wt!==void 0)return Wt;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Wt=e.contentEditable==="plaintext-only",Wt}function za(e){let{segments:a,showChipIcons:t=!0,showChipImages:o=!0,showChipRemove:i=!1,removeParam:s,newParamId:r,editingParam:d,editingIdentified:v,editingAnchor:x,caretOffset:y,placeholderText:g,hintSuggestions:h,isFocused:u,isDropdownOpen:k,listboxId:S,activeDescendantId:I,autoFocus:H,handleTextChange:N,handleCompositionText:de,handleKeyDown:Q,handleCaretAfterInput:O,handleCaretMove:W,startEditingParam:G,replaceEditingRange:Z,setFocused:re}=e,R=(0,M.useRef)(null),me=(0,M.useRef)(!1),fe=(0,M.useRef)(""),ee=(0,M.useRef)(""),ge=(0,M.useRef)(null),C=(0,M.useRef)(0);ge.current=y,(0,M.useEffect)(()=>{if(!H)return;let f=R.current;if(!f)return;document.activeElement===f?re(!0):f.focus();let T=f.ownerDocument??document,A=T.getSelection(),L=A&&A.rangeCount>0&&f.contains(A.anchorNode);if(A&&!L){let F=T.createRange();F.selectNodeContents(f),F.collapse(!0),A.removeAllRanges(),A.addRange(F)}},[H,re]),(0,M.useEffect)(()=>{let f=R.current;if(!f)return;let T=f.ownerDocument??document,A=()=>{let L=T.getSelection();if(!L||L.rangeCount===0||!L.anchorNode||!f.contains(L.anchorNode))return;let F=L.anchorNode,se=F.nodeType===Node.ELEMENT_NODE?F:F.parentElement,Ce=(L.isCollapsed?se?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,Ue=d?.id??v?.id??null;if(Ce&&Ce!==Ue){G(Ce);return}performance.now()-C.current<50||W((0,j.getCursorOffset)(f))};return T.addEventListener("selectionchange",A),()=>T.removeEventListener("selectionchange",A)},[d,v,G,W]),(0,M.useEffect)(()=>{let f=R.current;if(!f)return;let T=A=>{let L=(0,j.chipIdFromTap)(f,A.target);L&&(G(L),(0,j.keepCaretOnChip)(f,L))};return f.addEventListener("click",T),()=>f.removeEventListener("click",T)},[G]),(0,M.useEffect)(()=>{let f=R.current;if(!(!f||!s||!i))return(0,j.attachChipRemove)(f,s)},[s,i]),(0,M.useLayoutEffect)(()=>{let f=R.current;f&&(0,j.renderEditableContent)({input:f,segments:a,newParamId:r,editingParamId:d?.id??null,placeholderText:g??"",isFocused:u,showChipIcons:t,showChipImages:o,showChipRemove:i,hintOptions:(0,j.startingHintOptions)(h??[])})},[a,r,d,g,h,u,t,o,i]),(0,M.useEffect)(()=>{let f=R.current;return()=>{f&&(0,j.cancelStartingHint)(f)}},[]),(0,M.useLayoutEffect)(()=>{let f=fe.current,T=r??"";if(fe.current=T,!T||T===f)return;let A=R.current;if(!A)return;A.focus();let L=ge.current??(0,j.plainTextLength)(A);(0,j.setCursorOffset)(A,L)},[r]),(0,M.useLayoutEffect)(()=>{let f=ee.current,T=d?.id??"";if(ee.current=T,!T||T===f||x==null)return;let A=R.current;A&&(0,j.setCursorOffset)(A,x)},[d,x]);let K=(0,M.useCallback)(()=>{let f=R.current;if(!f)return;let T=(0,j.extractPlainText)(f),L=T.length>0&&T[0]!==T[0].toUpperCase()?T[0].toUpperCase()+T.slice(1):T;if(me.current){de(L);return}N(L)},[N,de]),p=(0,M.useCallback)(()=>{C.current=performance.now(),K();let f=R.current;f&&O((0,j.getCursorOffset)(f))},[K,O]);(0,M.useEffect)(()=>{let f=R.current;if(!f)return;let T=A=>{let L=A,F=L.inputType;if(F==="insertParagraph"||F==="insertLineBreak"||F==="insertFromDrop"){A.preventDefault();return}if(F.startsWith("insert")||F.startsWith("delete")){let se=F.startsWith("delete")?"":L.data??"";Z(se)&&A.preventDefault()}};return f.addEventListener("beforeinput",T),()=>f.removeEventListener("beforeinput",T)},[Z]);let z=(0,M.useCallback)(()=>{me.current=!0,R.current?.setAttribute("data-aia-composing","true")},[]),Ve=(0,M.useCallback)(()=>{me.current=!1,R.current?.removeAttribute("data-aia-composing"),K()},[K]),Je=(0,M.useCallback)(f=>{f.preventDefault();let T=R.current;if(!T)return;let A=(f.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!A)return;let L=T.ownerDocument??document,F=L.getSelection();if(!F||F.rangeCount===0)return;let se=F.getRangeAt(0);if(!T.contains(se.startContainer))return;se.deleteContents();let Se=L.createTextNode(A);se.insertNode(Se),se.setStartAfter(Se),se.collapse(!0),F.removeAllRanges(),F.addRange(se),K()},[K]),De=(0,M.useCallback)(f=>Q(f),[Q]),rt=(0,M.useCallback)(()=>re(!0),[re]),et=(0,M.useCallback)(()=>re(!1),[re]),m=(0,M.useCallback)(()=>R.current?.focus(),[]),_e=(0,M.useCallback)(()=>R.current?.blur(),[]),tt=(0,M.useCallback)(()=>{let f=R.current;return f?(0,j.extractPlainText)(f):""},[]),at=wi()?"plaintext-only":"true";return{inputRef:R,editorProps:{ref:R,contentEditable:at,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":S,"aria-expanded":k,"aria-activedescendant":I,spellCheck:!0,enterKeyHint:"send",onInput:p,onKeyDown:De,onCompositionStart:z,onCompositionEnd:Ve,onPaste:Je,onFocus:rt,onBlur:et},getPlainText:tt,focus:m,blur:_e}}var Le=require("react/jsx-runtime");function vi(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Ra=(0,$.forwardRef)(function({onSubmit:a,onResult:t,onError:o,optionOverrides:i,maskCompletedText:s,className:r,apiConfig:d,additionalContext:v,language:x,currency:y,productId:g,visitorId:h,analyticsConsent:u,columns:k,pillPlacement:S="dropdown",mode:I="auto",optionsPosition:H="below",animations:N=!0,optionsStyle:de="floating",dropdownTrigger:Q,closeDropdownOnBlur:O,prependPlaceholder:W,allOption:G,showNonTappableOptions:Z,locationSearch:re,showOptionIcons:R=!0,showChipIcons:me=!0,showChipImages:fe=!0,showChipRemove:ee=!1,showOptionImages:ge=!0,showOptionCounts:C=!0,showSkipButton:K,showProducts:p,submitProgress:z,productsLayout:Ve,productImageFallback:Je,showProductVendor:De,autoFocus:rt=!0,onFocus:et,onBlur:m,value:_e,completedParams:tt,onChange:at,onParamsChange:f,products:T,mapProducts:A,onProductSelect:L,onProductAddToCart:F,submitButton:se,resetOnSubmit:Se=!0,seeAllResults:Ce=!1},Ue){let Me=(0,$.useRef)(null),it=(0,$.useRef)(null),Te=(0,$.useRef)(null),st=(0,$.useRef)(()=>{}),te=(0,$.useRef)(null),Qe=(0,$.useRef)(null);(0,$.useEffect)(()=>{let B=Me.current;if(B)return te.current?te.current.setMode(I):te.current=new qe.ModeController(B,I),()=>{te.current?.destroy(),te.current=null}},[I]);let mt=(0,$.useCallback)(B=>{let ve=Qe.current?.current;ve&&(ve.focus(),(0,qe.setCursorOffset)(ve,B))},[]),{completedParams:St,suggestionPills:Ne,setActivePill:lt,skipActivePill:dt,segments:ce,newParamId:He,clearNewParamId:ct,placeholderText:n,isFocused:le,isDropdownOpen:Fe,isActivePillSelected:w,isLoading:pt,isReady:Ye,activeIndex:Be,listboxId:b,handleTextChange:gt,handleCompositionText:ft,handleKeyDown:je,setFocused:bt,editingParam:wt,editingIdentified:$e,editingAnchor:vt,caretOffset:Ze,startEditingParam:We,removeParam:xt,handleCaretAfterInput:ht,handleCaretMove:yt,replaceEditingRange:E,dropdownProps:Ct,reset:l,refreshProducts:ae,prepareSubmit:_,getState:Tt,recordSubmit:$t,holdSubmit:Zt,endSubmitProgress:Xt,getVisitorId:Jt,refreshAnalyticsConsent:ea,isSubmitting:Gt}=Bt({onSubmit:B=>st.current(B),onResult:t,onError:o,optionOverrides:i,maskCompletedText:s,apiConfig:d,additionalContext:v,language:x,currency:y,productId:g,visitorId:h,analyticsConsent:u,columns:k,dropdownTrigger:Q,optionsPosition:H,closeDropdownOnBlur:O,prependPlaceholder:W,allOption:G,showNonTappableOptions:Z,locationSearch:re,showOptionIcons:R,showOptionImages:ge,showOptionCounts:C,showSkipButton:K,showProducts:p,submitProgress:z,onFocus:et,onBlur:m,value:_e,completedParams:tt,onChange:at,onParamsChange:f,products:T,mapProducts:A,onProductSelect:L,onProductAddToCart:F,source:"full-sdk",setCursor:mt});(0,$.useEffect)(()=>{if(!He)return;let B=window.setTimeout(()=>ct(),650);return()=>window.clearTimeout(B)},[He,ct]);let Oa=Be>=0?`${b}-option-${Be}`:void 0,{inputRef:Kt,editorProps:La,focus:Ot,blur:ta,getPlainText:aa}=za({segments:ce,newParamId:He,editingParam:wt,editingIdentified:$e,editingAnchor:vt,caretOffset:Ze,placeholderText:n,hintSuggestions:S==="inline"?[]:Ne,isFocused:le,showChipIcons:me,showChipImages:fe,showChipRemove:ee,removeParam:xt,isDropdownOpen:Fe,listboxId:b,activeDescendantId:Oa,autoFocus:rt,handleTextChange:gt,handleCompositionText:ft,handleKeyDown:je,handleCaretAfterInput:ht,handleCaretMove:yt,startEditingParam:We,replaceEditingRange:E,setFocused:bt});Qe.current=Kt,(0,$.useLayoutEffect)(()=>{let B=it.current,ve=Kt.current;if(!B||!ve)return;let It=()=>{let ia=B.firstElementChild;if(!ia)return;let Ba=ia.getBoundingClientRect(),Wa=ve.getBoundingClientRect();Ba.top>=Wa.bottom-2?B.setAttribute("data-aia-pill-wrapped",""):B.removeAttribute("data-aia-pill-wrapped")};It();let At=new ResizeObserver(It);return At.observe(ve),()=>At.disconnect()},[ce,Ne.length,pt,Kt]),(0,$.useEffect)(()=>{let B=Te.current;if(B)return(0,qe.watchEditorHeight)(B)},[]),(0,$.useImperativeHandle)(Ue,()=>({focus:Ot,blur:ta,reset:l,refreshProducts:ae,setMode:B=>te.current?.setMode(B),skipActivePill:dt,endSubmitProgress:Xt,getVisitorId:Jt,refreshAnalyticsConsent:ea}),[Ot,ta,l,ae,dt,Xt,Jt,ea]);let kt=!!ce.length||St.length>0,Pt=(0,$.useCallback)(B=>{if(!kt||B&&Tt().isSubmitting)return;B&&_();let ve=Tt(),It=(0,qe.buildSubmitResult)(aa(),ve.completedParams,ve.skippedParams,{identifiedParams:ve.identifiedParams,isReady:ve.isReady,customFields:ve.customFields});B&&$t(It);let At=a(It);return B&&!Se&&Zt(At),Se&&l(),At},[$t,Zt,Se,kt,_,Tt,a,l,aa]);st.current=()=>Pt(!1);let Da=Ce&&!Ct.isInputEmpty&&kt,Ma=(0,$.useCallback)(()=>Pt(!0),[Pt]),Na=(0,$.useCallback)(B=>{B.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||Ot()},[Ot]),Ha=S==="inline",Fa=S==="dropdown";return(0,Le.jsxs)("div",{ref:Me,className:`magicx-aia ${ut.container} ${r??""}`,"data-pill-placement":S,"data-options-position":H,"data-animations":N?"on":"off","data-aia-options-style":de,"data-mode":vi(I),children:[(0,Le.jsx)(Ht,{...Ct,showPills:Fa,productsLayout:Ve,productImageFallback:Je,showProductVendor:De,onSeeAllResults:Da?Ma:void 0,fullWidth:Ce}),(0,Le.jsxs)("div",{className:ut.inputWrapper,"data-aia-input-wrapper":"",onClick:Na,children:[(0,Le.jsxs)("div",{ref:Te,className:ut.editorArea,"data-aia-editor":"",children:[(0,Le.jsx)("div",{...La,className:ut.input,"data-aia-input":""}),Ha&&(pt||Ne.length>0)&&(0,Le.jsx)("span",{ref:it,className:ut.pillListContainer,"data-aia-pill-list-container":"",children:(0,Le.jsx)(Mt,{pills:Ne,activePillIndex:0,activeSelected:w,onSelectPill:lt,loading:pt})})]}),se===null?null:se===void 0?(0,Le.jsx)(Pa,{disabled:!kt,ready:kt&&Ye,busy:Gt,onClick:()=>Pt(!0),label:(0,qe.uiStringsFor)(x).submit}):(0,Le.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"","data-aia-submit-state":Gt?"busy":void 0,"aria-busy":Gt?!0:void 0,className:ut.submitSlot,onClick:B=>{kt&&(B.stopPropagation(),Pt(!0))},children:se})]})]})});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});
3939
+ `,document.head.appendChild(e)}var Ta={submitButton:"aia-submitButton-otz7H",submitSpin:"aia-submitSpin-0llcF"};var Ft=require("react/jsx-runtime");function Ia({disabled:e,ready:a,busy:t=!1,onClick:o,label:i=(0,Pa.uiStringsFor)().submit}){return(0,Ft.jsx)("button",{type:"button","data-aia-submit":"",className:Ta.submitButton,disabled:e,"data-aia-ready":a?"":void 0,"data-aia-submit-state":t?"busy":void 0,"aria-busy":t?!0:void 0,onClick:s=>{s.stopPropagation(),o()},"aria-label":i,children:(0,Ft.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":i,children:(0,Ft.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var ke=require("@magicx-eng/ai-autocomplete-vanilla"),P=require("react");var Yt=require("react");function Aa(e){let a=(0,Yt.useRef)(e);a.current=e;let t=Object.keys(e??{}).sort().join("\0"),o=(0,Yt.useRef)({key:"",overrides:void 0});if(o.current.key!==t){let i={};for(let s of Object.keys(e??{})){let r=(d,v,x)=>{let y=a.current?.[s];return y?y(d,v,x):[]};i[s]=r}o.current={key:t,overrides:e?i:void 0}}return{overrides:o.current.overrides,key:t}}var jt=require("react");function Ea(e){let a=(0,jt.useRef)(e);a.current=e;let t=(0,jt.useRef)(null);t.current===null&&(t.current={fetch:(i,s)=>{let r=a.current;return r?r.fetch(i,s):Promise.reject(new Error("products config removed"))},transform:i=>a.current?.transform(i)??[],get limit(){return a.current?.limit}});let o=e!==void 0;return{config:o?t.current:void 0,enabled:o}}var za={text:"",composing:null,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,skeletonPicked:null,dropdownSuggestion:null,skeletonRequested:!1,skeletonExiting:!1,activeFormatType:"options",dateView:null,dateRangeStart:null,dateReferences:[],dateFloor:null,timeView:null,multiSelectView:null,dropdownMultiSelect:null,multiSelectDraft:null,locationView:null,locationSearch:null,locationAutocomplete:!0,locationFieldFocused:!1,isSubmitting:!1,selectingProductId:null,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 Bt({onSubmit:e,onResult:a,onError:t,optionOverrides:o,maskCompletedText:i,apiConfig:s,additionalContext:r,language:d,currency:v,productId:x,visitorId:y,analyticsConsent:g,columns:h=2,dropdownTrigger:u,optionsPosition:k,closeDropdownOnBlur:S,prependPlaceholder:I,allOption:H,showNonTappableOptions:N,locationSearch:de,showOptionIcons:Q,showOptionImages:O,showOptionCounts:W,showSkipButton:G,showProducts:Z,submitProgress:re,productImageFallback:R="image",showProductVendor:me=!0,onFocus:fe,onBlur:ee,value:ge,completedParams:C,onChange:K,onParamsChange:p,products:z,mapProducts:Ve,onProductSelect:Je,onProductAddToCart:De,source:rt,setCursor:et}){let m=(0,P.useRef)(null),[_e,tt]=(0,P.useState)(null),at=(0,P.useRef)(e);at.current=e;let f=(0,P.useRef)(a);f.current=a;let T=(0,P.useRef)(t);T.current=t;let A=(0,P.useRef)(K);A.current=K;let L=(0,P.useRef)(p);L.current=p;let F=(0,P.useRef)(fe);F.current=fe;let se=(0,P.useRef)(ee);se.current=ee;let Se=(0,P.useRef)(et);Se.current=et;let Ce=(0,P.useRef)(Je);Ce.current=Je;let Ue=(0,P.useRef)(De);Ue.current=De;let Me=(0,P.useRef)(y);Me.current=y;let it=(0,P.useRef)(()=>{let l=Me.current;return typeof l=="function"?l():l}).current,Te=y!==void 0,st=(0,P.useRef)(g);st.current=g;let te=(0,P.useRef)(()=>{let l=st.current;return typeof l=="function"?l():l}).current,Qe=Ea(z),mt=(0,P.useRef)(Ve);mt.current=Ve;let St=(0,P.useRef)((l,ae)=>{let _=mt.current;return _?_(l,ae):l}).current,Ne=Ve?St:void 0,lt=Aa(o);(0,P.useEffect)(()=>{if(typeof document>"u")return;let l=new ke.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:d,currency:v,productId:x,visitorId:Te?it:void 0,analyticsConsent:te,optionOverrides:lt.overrides,maskCompletedText:i,columns:h,dropdownTrigger:u,optionsPosition:k,closeDropdownOnBlur:S,prependPlaceholder:I,allOption:H,showNonTappableOptions:N,locationSearch:de,showProducts:Z,submitProgress:re,source:rt,value:ge,completedParams:C,onSubmit:(..._)=>at.current?.(..._),onResult:(..._)=>f.current?.(..._),onError:(..._)=>T.current?.(..._),onChange:(..._)=>A.current?.(..._),onParamsChange:(..._)=>L.current?.(..._),onFocus:()=>F.current?.(),onBlur:()=>se.current?.(),onProductSelect:_=>Ce.current?Ce.current(_):ke.HANDOFF_NOT_HANDLED,onProductAddToCart:_=>Ue.current?.(_),setCursor:_=>Se.current?.(_),products:Qe.config,mapProducts:Ne});m.current=l,tt(l.getState());let ae=l.subscribe(_=>tt(_));return()=>{ae(),l.destroy(),m.current===l&&(m.current=null)}},[]);let dt=(0,P.useRef)(Te);(0,P.useEffect)(()=>{dt.current!==Te&&(dt.current=Te,m.current?.update({visitorId:Te?it:void 0,analyticsConsent:te}))},[Te,it,te]);let ce=typeof g=="function"?"function":g,He=(0,P.useRef)(ce);(0,P.useEffect)(()=>{He.current!==ce&&(He.current=ce,m.current?.refreshAnalyticsConsent())},[ce]),(0,P.useEffect)(()=>{ge!==void 0&&m.current?.setValue(ge)},[ge]),(0,P.useEffect)(()=>{C!==void 0&&m.current?.setCompletedParams(C)},[C]);let ct=JSON.stringify(s??null),n;try{n=JSON.stringify(r??null)}catch{n="[unstringifiable]"}(0,P.useEffect)(()=>{m.current?.update({apiConfig:s,additionalContext:r,language:d,currency:v,productId:x,optionOverrides:lt.overrides,dropdownTrigger:u,optionsPosition:k,closeDropdownOnBlur:S,prependPlaceholder:I,allOption:H,showNonTappableOptions:N,locationSearch:de,showProducts:Z,submitProgress:re})},[ct,n,d,v?.code,v?.rate,v?.country,x,lt.key,u,k,S,I,H,N,de,Z,re]);let le=(0,P.useRef)(!1);(0,P.useEffect)(()=>{if(!le.current){le.current=!0;return}m.current?.update({products:Qe.config})},[Qe.enabled]),(0,P.useEffect)(()=>{m.current?.update({mapProducts:Ne})},[Ne]);let Fe=(0,P.useRef)(null);Fe.current===null&&(Fe.current={handleTextChange:l=>m.current?.handleTextChange(l),handleCompositionText:l=>m.current?.handleCompositionText(l),handleKeyDown:l=>{let ae="nativeEvent"in l?l.nativeEvent:l;m.current?.handleKeyDown(ae)},setFocused:l=>m.current?.setFocused(l),startEditingParam:l=>m.current?.startEditingParam(l),removeParam:l=>m.current?.removeParam(l)??!1,exitEditMode:()=>m.current?.exitEditMode(),handleCaretAfterInput:l=>m.current?.handleCaretAfterInput(l),handleCaretMove:l=>m.current?.handleCaretMove(l),replaceEditingRange:l=>m.current?.replaceEditingRange(l)??!1,setActivePill:l=>m.current?.setActivePill(l),skipActivePill:()=>m.current?.skipActivePill(),removeLastParam:()=>m.current?.removeLastParam(),clearNewParamId:()=>m.current?.clearNewParamId(),reset:()=>m.current?.reset(),refreshProducts:()=>m.current?.refreshProducts(),prepareSubmit:()=>m.current?.prepareSubmit(),getState:()=>m.current?.getState()??za,recordSubmit:l=>m.current?.recordSubmit(l),holdSubmit:l=>m.current?.holdSubmit(l),endSubmitProgress:()=>m.current?.endSubmitProgress(),getSearchId:()=>m.current?.getSearchId(),getVisitorId:()=>m.current?.getVisitorId(),refreshAnalyticsConsent:()=>m.current?.refreshAnalyticsConsent(),selectOption:(l,ae)=>m.current?.selectOption(l,ae),selectProduct:l=>m.current?.selectProduct(l),addProductToCart:l=>{let ae=m.current;return!ae||!Ue.current?Promise.resolve():ae.addProductToCart(l)},setActiveDropdownIndex:l=>m.current?.setActiveDropdownIndex(l),clearHighlight:l=>m.current?.clearHighlight(l),showPreviousMonth:()=>m.current?.showPreviousMonth(),showNextMonth:()=>m.current?.showNextMonth(),setTime:l=>m.current?.setTime(l),commitTime:()=>m.current?.commitTime(),toggleMultiSelectOption:l=>m.current?.toggleMultiSelectOption(l),commitMultiSelect:()=>m.current?.commitMultiSelect(),setLocationQuery:l=>m.current?.setLocationQuery(l),moveLocationHighlight:l=>m.current?.moveLocationHighlight(l),commitLocation:l=>m.current?.commitLocation(l),setLocationFieldFocused:l=>m.current?.setLocationFieldFocused(l),handleFocus:()=>m.current?.setFocused(!0),handleBlur:()=>m.current?.setFocused(!1)});let b=Fe.current,pt=(0,P.useCallback)(l=>{let ae=l.target.value,Tt=ae.length>0&&!l.nativeEvent?.isComposing&&ae[0]!==ae[0].toUpperCase()?ae[0].toUpperCase()+ae.slice(1):ae;m.current?.handleTextChange(Tt)},[]),Ye=(0,P.useCallback)(l=>{m.current?.handleKeyDown(l.nativeEvent)},[]),Be=m.current,w=_e??za,gt=ge!==void 0?ge:w.text,ft=C!==void 0?C:w.completedParams,je=w.actionableSuggestions,bt=je[0],wt=(0,P.useMemo)(()=>(0,ke.withoutTraditionalAutocomplete)(je),[je]),$e=Be?.listboxId??"",vt=w.activeDropdownIndex>=0&&Be?`${$e}-option-${w.activeDropdownIndex}`:void 0,Ze=w.editingParam,We=w.editingIdentified,xt=Ze?(0,ke.editingSuggestion)(Ze):We?{parameter:We.parameter,text:(0,ke.identifiedParamLabel)(We.parameter),required:!0,options:[]}:null,ht=w.dropdownSuggestion??xt??bt,yt=(0,ke.dropdownPillsFor)(w.dropdownSuggestion,xt,je),E=(0,ke.dateSelectionFor)(w),Ct=!Be||w.dropdownLoading;return{completedParams:ft,multiSelectView:w.multiSelectView,toggleMultiSelectOption:b.toggleMultiSelectOption,commitMultiSelect:b.commitMultiSelect,skippedParams:w.skippedParams,identifiedParams:w.identifiedParams,suggestionPills:wt,setActivePill:b.setActivePill,skipActivePill:b.skipActivePill,removeLastParam:b.removeLastParam,segments:w.segments,newParamId:w.newParamId,clearNewParamId:b.clearNewParamId,suggestions:w.suggestions,activeIndex:w.activeDropdownIndex,isReady:w.isReady,isLoading:Ct,isFocused:w.isFocused,isDropdownOpen:w.isDropdownOpen,isActivePillSelected:w.isActivePillSelected,placeholderText:w.placeholderText,listboxId:$e,error:w.error,products:w.products,customFields:w.customFields,selectProduct:b.selectProduct,addProductToCart:b.addProductToCart,handleTextChange:b.handleTextChange,handleCompositionText:b.handleCompositionText,handleKeyDown:b.handleKeyDown,setFocused:b.setFocused,editingParam:Ze,editingIdentified:We,editingAnchor:w.editingAnchor,caretOffset:w.caretOffset,startEditingParam:b.startEditingParam,removeParam:b.removeParam,exitEditMode:b.exitEditMode,handleCaretAfterInput:b.handleCaretAfterInput,handleCaretMove:b.handleCaretMove,replaceEditingRange:b.replaceEditingRange,inputProps:{value:gt,placeholder:w.placeholderText||void 0,onChange:pt,onKeyDown:Ye,onFocus:b.handleFocus,onBlur:b.handleBlur,role:"combobox","aria-expanded":w.isDropdownOpen,"aria-activedescendant":vt,"aria-autocomplete":"list","aria-controls":$e},reset:b.reset,refreshProducts:b.refreshProducts,prepareSubmit:b.prepareSubmit,getState:b.getState,recordSubmit:b.recordSubmit,holdSubmit:b.holdSubmit,endSubmitProgress:b.endSubmitProgress,getSearchId:b.getSearchId,getVisitorId:b.getVisitorId,refreshAnalyticsConsent:b.refreshAnalyticsConsent,isSubmitting:w.isSubmitting,selectingProductId:w.selectingProductId,dropdownProps:{suggestions:ht?[{...ht,options:w.dropdownOptions}]:[],activeIndex:w.activeDropdownIndex,onSelect:b.selectOption,onHighlight:b.setActiveDropdownIndex,onUnhighlight:b.clearHighlight,isOpen:w.isDropdownOpen,id:$e,pills:yt,activeSelected:w.isActivePillSelected,onPillClick:b.setActivePill,onSkip:b.skipActivePill,showSkipButton:(G??!0)&&!Ze&&!We,showOptionIcons:Q??!0,showOptionImages:O??!0,showOptionCounts:W??!0,skipDisabled:w.inSelectionAnimation,isLoading:Ct,skeletonExiting:w.skeletonExiting,isInputEmpty:gt.trim().length===0,language:d,products:w.products,productImageFallback:R,showProductVendor:me,onProductSelect:b.selectProduct,busyProductId:w.selectingProductId,seeAllBusy:w.isSubmitting,onProductAddToCart:De?b.addProductToCart:void 0,onProductFocusChange:b.setFocused,formatType:w.activeFormatType,dateView:w.dateView,selectedDateIso:E.selectedIso,selectedDateRange:E.selectedRange,dateRangeStart:E.rangeStart,dateReferences:E.references,onPreviousMonth:b.showPreviousMonth,onNextMonth:b.showNextMonth,timeView:w.timeView,multiSelectView:w.dropdownMultiSelect,onMultiSelectCommit:b.commitMultiSelect,onTimeChange:b.setTime,onTimeCommit:b.commitTime,locationView:w.locationView,isReediting:w.editingParam!=null,onLocationQuery:b.setLocationQuery,onLocationMove:b.moveLocationHighlight,onLocationCommit:b.commitLocation,onLocationFocusChange:b.setLocationFieldFocused,isFocused:w.isFocused||w.locationFieldFocused,optionsPosition:k??"below"}}}var j=require("@magicx-eng/ai-autocomplete-vanilla"),M=require("react"),Wt;function vi(){if(Wt!==void 0)return Wt;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Wt=e.contentEditable==="plaintext-only",Wt}function Ra(e){let{segments:a,showChipIcons:t=!0,showChipImages:o=!0,showChipRemove:i=!1,removeParam:s,newParamId:r,editingParam:d,editingIdentified:v,editingAnchor:x,caretOffset:y,placeholderText:g,hintSuggestions:h,isFocused:u,isDropdownOpen:k,listboxId:S,activeDescendantId:I,autoFocus:H,handleTextChange:N,handleCompositionText:de,handleKeyDown:Q,handleCaretAfterInput:O,handleCaretMove:W,startEditingParam:G,replaceEditingRange:Z,setFocused:re}=e,R=(0,M.useRef)(null),me=(0,M.useRef)(!1),fe=(0,M.useRef)(""),ee=(0,M.useRef)(""),ge=(0,M.useRef)(null),C=(0,M.useRef)(0);ge.current=y,(0,M.useEffect)(()=>{if(!H)return;let f=R.current;if(!f)return;document.activeElement===f?re(!0):f.focus();let T=f.ownerDocument??document,A=T.getSelection(),L=A&&A.rangeCount>0&&f.contains(A.anchorNode);if(A&&!L){let F=T.createRange();F.selectNodeContents(f),F.collapse(!0),A.removeAllRanges(),A.addRange(F)}},[H,re]),(0,M.useEffect)(()=>{let f=R.current;if(!f)return;let T=f.ownerDocument??document,A=()=>{let L=T.getSelection();if(!L||L.rangeCount===0||!L.anchorNode||!f.contains(L.anchorNode))return;let F=L.anchorNode,se=F.nodeType===Node.ELEMENT_NODE?F:F.parentElement,Ce=(L.isCollapsed?se?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,Ue=d?.id??v?.id??null;if(Ce&&Ce!==Ue){G(Ce);return}performance.now()-C.current<50||W((0,j.getCursorOffset)(f))};return T.addEventListener("selectionchange",A),()=>T.removeEventListener("selectionchange",A)},[d,v,G,W]),(0,M.useEffect)(()=>{let f=R.current;if(!f)return;let T=A=>{let L=(0,j.chipIdFromTap)(f,A.target);L&&(G(L),(0,j.keepCaretOnChip)(f,L))};return f.addEventListener("click",T),()=>f.removeEventListener("click",T)},[G]),(0,M.useEffect)(()=>{let f=R.current;if(!(!f||!s||!i))return(0,j.attachChipRemove)(f,s)},[s,i]),(0,M.useLayoutEffect)(()=>{let f=R.current;f&&(0,j.renderEditableContent)({input:f,segments:a,newParamId:r,editingParamId:d?.id??null,placeholderText:g??"",isFocused:u,showChipIcons:t,showChipImages:o,showChipRemove:i,hintOptions:(0,j.startingHintOptions)(h??[])})},[a,r,d,g,h,u,t,o,i]),(0,M.useEffect)(()=>{let f=R.current;return()=>{f&&(0,j.cancelStartingHint)(f)}},[]),(0,M.useLayoutEffect)(()=>{let f=fe.current,T=r??"";if(fe.current=T,!T||T===f)return;let A=R.current;if(!A)return;A.focus();let L=ge.current??(0,j.plainTextLength)(A);(0,j.setCursorOffset)(A,L)},[r]),(0,M.useLayoutEffect)(()=>{let f=ee.current,T=d?.id??"";if(ee.current=T,!T||T===f||x==null)return;let A=R.current;A&&(0,j.setCursorOffset)(A,x)},[d,x]);let K=(0,M.useCallback)(()=>{let f=R.current;if(!f)return;let T=(0,j.extractPlainText)(f),L=T.length>0&&T[0]!==T[0].toUpperCase()?T[0].toUpperCase()+T.slice(1):T;if(me.current){de(L);return}N(L)},[N,de]),p=(0,M.useCallback)(()=>{C.current=performance.now(),K();let f=R.current;f&&O((0,j.getCursorOffset)(f))},[K,O]);(0,M.useEffect)(()=>{let f=R.current;if(!f)return;let T=A=>{let L=A,F=L.inputType;if(F==="insertParagraph"||F==="insertLineBreak"||F==="insertFromDrop"){A.preventDefault();return}if(F.startsWith("insert")||F.startsWith("delete")){let se=F.startsWith("delete")?"":L.data??"";Z(se)&&A.preventDefault()}};return f.addEventListener("beforeinput",T),()=>f.removeEventListener("beforeinput",T)},[Z]);let z=(0,M.useCallback)(()=>{me.current=!0,R.current?.setAttribute("data-aia-composing","true")},[]),Ve=(0,M.useCallback)(()=>{me.current=!1,R.current?.removeAttribute("data-aia-composing"),K()},[K]),Je=(0,M.useCallback)(f=>{f.preventDefault();let T=R.current;if(!T)return;let A=(f.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!A)return;let L=T.ownerDocument??document,F=L.getSelection();if(!F||F.rangeCount===0)return;let se=F.getRangeAt(0);if(!T.contains(se.startContainer))return;se.deleteContents();let Se=L.createTextNode(A);se.insertNode(Se),se.setStartAfter(Se),se.collapse(!0),F.removeAllRanges(),F.addRange(se),K()},[K]),De=(0,M.useCallback)(f=>Q(f),[Q]),rt=(0,M.useCallback)(()=>re(!0),[re]),et=(0,M.useCallback)(()=>re(!1),[re]),m=(0,M.useCallback)(()=>R.current?.focus(),[]),_e=(0,M.useCallback)(()=>R.current?.blur(),[]),tt=(0,M.useCallback)(()=>{let f=R.current;return f?(0,j.extractPlainText)(f):""},[]),at=vi()?"plaintext-only":"true";return{inputRef:R,editorProps:{ref:R,contentEditable:at,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":S,"aria-expanded":k,"aria-activedescendant":I,spellCheck:!0,enterKeyHint:"send",onInput:p,onKeyDown:De,onCompositionStart:z,onCompositionEnd:Ve,onPaste:Je,onFocus:rt,onBlur:et},getPlainText:tt,focus:m,blur:_e}}var Le=require("react/jsx-runtime");function xi(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Oa=(0,$.forwardRef)(function({onSubmit:a,onResult:t,onError:o,optionOverrides:i,maskCompletedText:s,className:r,apiConfig:d,additionalContext:v,language:x,currency:y,productId:g,visitorId:h,analyticsConsent:u,columns:k,pillPlacement:S="dropdown",mode:I="auto",optionsPosition:H="below",animations:N=!0,optionsStyle:de="floating",dropdownTrigger:Q,closeDropdownOnBlur:O,prependPlaceholder:W,allOption:G,showNonTappableOptions:Z,locationSearch:re,showOptionIcons:R=!0,showChipIcons:me=!0,showChipImages:fe=!0,showChipRemove:ee=!1,showOptionImages:ge=!0,showOptionCounts:C=!0,showSkipButton:K,showProducts:p,submitProgress:z,productsLayout:Ve,productImageFallback:Je,showProductVendor:De,autoFocus:rt=!0,onFocus:et,onBlur:m,value:_e,completedParams:tt,onChange:at,onParamsChange:f,products:T,mapProducts:A,onProductSelect:L,onProductAddToCart:F,submitButton:se,resetOnSubmit:Se=!0,seeAllResults:Ce=!1},Ue){let Me=(0,$.useRef)(null),it=(0,$.useRef)(null),Te=(0,$.useRef)(null),st=(0,$.useRef)(()=>{}),te=(0,$.useRef)(null),Qe=(0,$.useRef)(null);(0,$.useEffect)(()=>{let B=Me.current;if(B)return te.current?te.current.setMode(I):te.current=new qe.ModeController(B,I),()=>{te.current?.destroy(),te.current=null}},[I]);let mt=(0,$.useCallback)(B=>{let ve=Qe.current?.current;ve&&(ve.focus(),(0,qe.setCursorOffset)(ve,B))},[]),{completedParams:St,suggestionPills:Ne,setActivePill:lt,skipActivePill:dt,segments:ce,newParamId:He,clearNewParamId:ct,placeholderText:n,isFocused:le,isDropdownOpen:Fe,isActivePillSelected:b,isLoading:pt,isReady:Ye,activeIndex:Be,listboxId:w,handleTextChange:gt,handleCompositionText:ft,handleKeyDown:je,setFocused:bt,editingParam:wt,editingIdentified:$e,editingAnchor:vt,caretOffset:Ze,startEditingParam:We,removeParam:xt,handleCaretAfterInput:ht,handleCaretMove:yt,replaceEditingRange:E,dropdownProps:Ct,reset:l,refreshProducts:ae,prepareSubmit:_,getState:Tt,recordSubmit:$t,holdSubmit:Zt,endSubmitProgress:Xt,getSearchId:Jt,getVisitorId:ea,refreshAnalyticsConsent:ta,isSubmitting:Gt}=Bt({onSubmit:B=>st.current(B),onResult:t,onError:o,optionOverrides:i,maskCompletedText:s,apiConfig:d,additionalContext:v,language:x,currency:y,productId:g,visitorId:h,analyticsConsent:u,columns:k,dropdownTrigger:Q,optionsPosition:H,closeDropdownOnBlur:O,prependPlaceholder:W,allOption:G,showNonTappableOptions:Z,locationSearch:re,showOptionIcons:R,showOptionImages:ge,showOptionCounts:C,showSkipButton:K,showProducts:p,submitProgress:z,onFocus:et,onBlur:m,value:_e,completedParams:tt,onChange:at,onParamsChange:f,products:T,mapProducts:A,onProductSelect:L,onProductAddToCart:F,source:"full-sdk",setCursor:mt});(0,$.useEffect)(()=>{if(!He)return;let B=window.setTimeout(()=>ct(),650);return()=>window.clearTimeout(B)},[He,ct]);let La=Be>=0?`${w}-option-${Be}`:void 0,{inputRef:Kt,editorProps:Da,focus:Ot,blur:aa,getPlainText:ia}=Ra({segments:ce,newParamId:He,editingParam:wt,editingIdentified:$e,editingAnchor:vt,caretOffset:Ze,placeholderText:n,hintSuggestions:S==="inline"?[]:Ne,isFocused:le,showChipIcons:me,showChipImages:fe,showChipRemove:ee,removeParam:xt,isDropdownOpen:Fe,listboxId:w,activeDescendantId:La,autoFocus:rt,handleTextChange:gt,handleCompositionText:ft,handleKeyDown:je,handleCaretAfterInput:ht,handleCaretMove:yt,startEditingParam:We,replaceEditingRange:E,setFocused:bt});Qe.current=Kt,(0,$.useLayoutEffect)(()=>{let B=it.current,ve=Kt.current;if(!B||!ve)return;let It=()=>{let oa=B.firstElementChild;if(!oa)return;let Wa=oa.getBoundingClientRect(),Ga=ve.getBoundingClientRect();Wa.top>=Ga.bottom-2?B.setAttribute("data-aia-pill-wrapped",""):B.removeAttribute("data-aia-pill-wrapped")};It();let At=new ResizeObserver(It);return At.observe(ve),()=>At.disconnect()},[ce,Ne.length,pt,Kt]),(0,$.useEffect)(()=>{let B=Te.current;if(B)return(0,qe.watchEditorHeight)(B)},[]),(0,$.useImperativeHandle)(Ue,()=>({focus:Ot,blur:aa,reset:l,refreshProducts:ae,setMode:B=>te.current?.setMode(B),skipActivePill:dt,endSubmitProgress:Xt,getSearchId:Jt,getVisitorId:ea,refreshAnalyticsConsent:ta}),[Ot,aa,l,ae,dt,Xt,Jt,ea,ta]);let kt=!!ce.length||St.length>0,Pt=(0,$.useCallback)(B=>{if(!kt||B&&Tt().isSubmitting)return;B&&_();let ve=Tt(),It=(0,qe.buildSubmitResult)(ia(),ve.completedParams,ve.skippedParams,{identifiedParams:ve.identifiedParams,isReady:ve.isReady,customFields:ve.customFields});B&&$t(It);let At=a(It);return B&&!Se&&Zt(At),Se&&l(),At},[$t,Zt,Se,kt,_,Tt,a,l,ia]);st.current=()=>Pt(!1);let Ma=Ce&&!Ct.isInputEmpty&&kt,Na=(0,$.useCallback)(()=>Pt(!0),[Pt]),Ha=(0,$.useCallback)(B=>{B.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||Ot()},[Ot]),Fa=S==="inline",Ba=S==="dropdown";return(0,Le.jsxs)("div",{ref:Me,className:`magicx-aia ${ut.container} ${r??""}`,"data-pill-placement":S,"data-options-position":H,"data-animations":N?"on":"off","data-aia-options-style":de,"data-mode":xi(I),children:[(0,Le.jsx)(Ht,{...Ct,showPills:Ba,productsLayout:Ve,productImageFallback:Je,showProductVendor:De,onSeeAllResults:Ma?Na:void 0,fullWidth:Ce}),(0,Le.jsxs)("div",{className:ut.inputWrapper,"data-aia-input-wrapper":"",onClick:Ha,children:[(0,Le.jsxs)("div",{ref:Te,className:ut.editorArea,"data-aia-editor":"",children:[(0,Le.jsx)("div",{...Da,className:ut.input,"data-aia-input":""}),Fa&&(pt||Ne.length>0)&&(0,Le.jsx)("span",{ref:it,className:ut.pillListContainer,"data-aia-pill-list-container":"",children:(0,Le.jsx)(Mt,{pills:Ne,activePillIndex:0,activeSelected:b,onSelectPill:lt,loading:pt})})]}),se===null?null:se===void 0?(0,Le.jsx)(Ia,{disabled:!kt,ready:kt&&Ye,busy:Gt,onClick:()=>Pt(!0),label:(0,qe.uiStringsFor)(x).submit}):(0,Le.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"","data-aia-submit-state":Gt?"busy":void 0,"aria-busy":Gt?!0:void 0,className:ut.submitSlot,onClick:B=>{kt&&(B.stopPropagation(),Pt(!0))},children:se})]})]})});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});
3939
3940
  //# sourceMappingURL=index.js.map