@magicx-eng/ai-autocomplete-react 0.59.0 → 0.59.2
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 +3 -3
- package/REFERENCE.md +13 -13
- package/dist/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +117 -117
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +117 -117
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Da=Object.defineProperty;var Lt=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Dt=Object.prototype.hasOwnProperty;var Mt=(e,t)=>{for(var a in t)Da(e,a,{get:t[a],enumerable:!0})},Nt=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zt(t))!Dt.call(e,o)&&o!==a&&Da(e,o,{get:()=>t[o],enumerable:!(i=Lt(t,o))||i.enumerable});return e};var Ft=e=>Nt(Da({},"__esModule",{value:!0}),e);var pi={};Mt(pi,{AIAutocomplete:()=>kt,AIAutocompleteDropdown:()=>Aa,DATE_RANGE_META_END:()=>d.DATE_RANGE_META_END,DATE_RANGE_META_START:()=>d.DATE_RANGE_META_START,DEFAULT_OPTION_COUNT_UNIT:()=>d.DEFAULT_OPTION_COUNT_UNIT,LOCATION_META_KEY:()=>d.LOCATION_META_KEY,PRODUCT_PATH_PREFIX:()=>d.PRODUCT_PATH_PREFIX,TIME_META_KEY:()=>d.TIME_META_KEY,WEEKDAY_LABELS:()=>d.WEEKDAY_LABELS,buildSubmitResult:()=>d.buildSubmitResult,cellDay:()=>d.cellDay,cellIso:()=>d.cellIso,dateCellMarks:()=>d.dateCellMarks,formatDate:()=>d.formatDate,formatDateRange:()=>d.formatDateRange,formatOptionCount:()=>d.formatOptionCount,formatPlace:()=>d.formatPlace,formatTime:()=>d.formatTime,isoDate:()=>d.isoDate,monthLabel:()=>d.monthLabel,optionCountLabel:()=>d.optionCountLabel,optionHasImage:()=>d.optionHasImage,optionImageSources:()=>d.optionImageSources,optionImageSrc:()=>d.optionImageSrc,optionLabel:()=>d.optionLabel,optionsShowLeadingVisuals:()=>d.optionsShowLeadingVisuals,parseDate:()=>d.parseDate,parseLooseDate:()=>d.parseLooseDate,parseLooseDateRange:()=>d.parseLooseDateRange,parseTime:()=>d.parseTime,productFromMatchedItem:()=>d.productFromMatchedItem,productImageSources:()=>d.productImageSources,productsFromCustomFields:()=>d.productsFromCustomFields,sanitizeOptionIconSvg:()=>d.sanitizeOptionIconSvg,selectedRangeFor:()=>d.selectedRangeFor,useAIAutocomplete:()=>Oa,visibleDateRange:()=>d.visibleDateRange,withSkippedParams:()=>d.withSkippedParams});module.exports=Ft(pi);var d=require("@magicx-eng/ai-autocomplete-vanilla");var Y=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
|
|
@@ -406,7 +406,7 @@
|
|
|
406
406
|
transition: none;
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
`,document.head.appendChild(e)}var
|
|
409
|
+
`,document.head.appendChild(e)}var pa={container:"aia-container-KKjFU",inputWrapper:"aia-inputWrapper-FLq1b",editorArea:"aia-editorArea-7rBWq",input:"aia-input-IW-P-",pillListContainer:"aia-pillListContainer-h92IA",submitSlot:"aia-submitSlot-GhuCM",aiaChipForm:"aia-aiaChipForm-tKbNc",aiaTileGrow:"aia-aiaTileGrow-j9Pat",aiaTileSpring:"aia-aiaTileSpring-FEwNg",aiaTileFade:"aia-aiaTileFade-H1LDQ",aiaImageGrow:"aia-aiaImageGrow-i9yw8"};var z=require("@magicx-eng/ai-autocomplete-vanilla"),J=require("react");if(typeof document<"u"&&!document.getElementById("ac-style-0ae03977")){let e=document.createElement("style");e.id="ac-style-0ae03977",e.textContent=`/*
|
|
410
410
|
* Built-in appearance defaults \u2014 zero specificity via :where().
|
|
411
411
|
* Consumer CSS always wins without !important.
|
|
412
412
|
*
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
--aia-scrollbar-track: rgba(15, 23, 42, 0.05);
|
|
625
625
|
--aia-scrollbar-thumb: rgba(15, 23, 42, 0.22);
|
|
626
626
|
--aia-option-color-selected: var(--aia-primitive-neutral-0);
|
|
627
|
-
--aia-option-font-size:
|
|
627
|
+
--aia-option-font-size: 16px;
|
|
628
628
|
|
|
629
629
|
--aia-written-text-color: var(--aia-primitive-neutral-0);
|
|
630
630
|
/* The typed query keeps its full size; only the options box below it is
|
|
@@ -699,7 +699,7 @@
|
|
|
699
699
|
--aia-scrollbar-track: rgba(255, 255, 255, 0.08);
|
|
700
700
|
--aia-scrollbar-thumb: rgba(255, 255, 255, 0.28);
|
|
701
701
|
--aia-option-color-selected: var(--aia-primitive-neutral-1000);
|
|
702
|
-
--aia-option-font-size:
|
|
702
|
+
--aia-option-font-size: 16px;
|
|
703
703
|
|
|
704
704
|
--aia-written-text-color: var(--aia-primitive-neutral-1000);
|
|
705
705
|
--aia-written-text-font-size: 16px;
|
|
@@ -786,7 +786,7 @@
|
|
|
786
786
|
justify-content: flex-start;
|
|
787
787
|
border-inline-width: 0;
|
|
788
788
|
padding-inline: 0;
|
|
789
|
-
padding-block:
|
|
789
|
+
padding-block: 5px;
|
|
790
790
|
}
|
|
791
791
|
|
|
792
792
|
/* The reserved band the footer overlaps. Declared here, apart from the grid
|
|
@@ -1015,7 +1015,7 @@
|
|
|
1015
1015
|
the third row. The planned cap (--aia-grid-max-height) still wins when it
|
|
1016
1016
|
is smaller: fewer than three rows of options. */
|
|
1017
1017
|
[data-aia-dropdown][aria-multiselectable="true"] .aia-grid[data-scroll] {
|
|
1018
|
-
max-height: min(var(--aia-grid-max-height,
|
|
1018
|
+
max-height: min(var(--aia-grid-max-height, 120px), calc(3 * var(--aia-option-row-height, 37px)));
|
|
1019
1019
|
}
|
|
1020
1020
|
|
|
1021
1021
|
/* Fitted to the viewport, every other grid hands its scrolling to the panel,
|
|
@@ -1024,8 +1024,8 @@
|
|
|
1024
1024
|
so Done stays in view. */
|
|
1025
1025
|
[data-aia-dropdown][data-aia-fit][aria-multiselectable="true"] .aia-grid[data-scroll] {
|
|
1026
1026
|
flex-shrink: 1;
|
|
1027
|
-
min-height: var(--aia-option-row-height,
|
|
1028
|
-
max-height: min(var(--aia-grid-max-height,
|
|
1027
|
+
min-height: var(--aia-option-row-height, 37px);
|
|
1028
|
+
max-height: min(var(--aia-grid-max-height, 120px), calc(3 * var(--aia-option-row-height, 37px)));
|
|
1029
1029
|
overflow-y: auto;
|
|
1030
1030
|
}
|
|
1031
1031
|
|
|
@@ -1068,7 +1068,7 @@
|
|
|
1068
1068
|
[data-aia-dropdown] [data-aia-pillbar] [data-aia-pill][data-aia-pill-active] {
|
|
1069
1069
|
text-transform: none;
|
|
1070
1070
|
letter-spacing: normal;
|
|
1071
|
-
font-size: var(--aia-param-label-font-size,
|
|
1071
|
+
font-size: var(--aia-param-label-font-size, 17px);
|
|
1072
1072
|
font-weight: 500;
|
|
1073
1073
|
opacity: 1;
|
|
1074
1074
|
}
|
|
@@ -1087,17 +1087,17 @@
|
|
|
1087
1087
|
text-transform: uppercase;
|
|
1088
1088
|
}
|
|
1089
1089
|
[data-aia-dropdown] [data-aia-pillbar] [data-aia-skip] {
|
|
1090
|
-
padding-inline:
|
|
1091
|
-
font-size: var(--aia-skip-font-size,
|
|
1090
|
+
padding-inline: 8px;
|
|
1091
|
+
font-size: var(--aia-skip-font-size, 13.5px);
|
|
1092
1092
|
}
|
|
1093
|
-
/* Roomier rows:
|
|
1093
|
+
/* Roomier rows: 15px above and below each option instead of 8px. The
|
|
1094
1094
|
row height feeds the visible-rows cap (planOptionsGrid), so it moves with
|
|
1095
1095
|
the padding; picture and parameter-line rows add the same padding to their
|
|
1096
1096
|
own heights. Tokens on the themed root at zero specificity, like the rest,
|
|
1097
1097
|
so a consumer's value wins and the classic block below can restore its own. */
|
|
1098
1098
|
:where(.magicx-aia) {
|
|
1099
|
-
--aia-option-padding-block:
|
|
1100
|
-
--aia-option-row-height: calc(
|
|
1099
|
+
--aia-option-padding-block: 15px;
|
|
1100
|
+
--aia-option-row-height: calc(21px + 2 * var(--aia-option-padding-block));
|
|
1101
1101
|
}
|
|
1102
1102
|
/* The panel hugs its options (panelHugWidth): as wide as the widest option
|
|
1103
1103
|
times the columns, plus the panel's padding and 36px of breathing room,
|
|
@@ -1497,15 +1497,15 @@
|
|
|
1497
1497
|
align-items: center;
|
|
1498
1498
|
margin-inline-start: auto;
|
|
1499
1499
|
flex-shrink: 0;
|
|
1500
|
-
padding:
|
|
1500
|
+
padding: 5px 8px;
|
|
1501
1501
|
border: none;
|
|
1502
1502
|
/* Matches the completed-param chip radius, so the hover fill reads as a
|
|
1503
1503
|
soft rectangle rather than a capsule. */
|
|
1504
|
-
border-radius:
|
|
1504
|
+
border-radius: 6px;
|
|
1505
1505
|
background: transparent;
|
|
1506
1506
|
font-family: inherit;
|
|
1507
|
-
font-size: var(--aia-skip-font-size,
|
|
1508
|
-
line-height:
|
|
1507
|
+
font-size: var(--aia-skip-font-size, 13.5px);
|
|
1508
|
+
line-height: 18px;
|
|
1509
1509
|
color: var(--aia-skip-color, var(--aia-footer-hint-color, #505050));
|
|
1510
1510
|
cursor: pointer;
|
|
1511
1511
|
white-space: nowrap;
|
|
@@ -1724,7 +1724,7 @@
|
|
|
1724
1724
|
opacity: 1;
|
|
1725
1725
|
}
|
|
1726
1726
|
}
|
|
1727
|
-
`,document.head.appendChild(e)}var
|
|
1727
|
+
`,document.head.appendChild(e)}var ye={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",multiActionsLoadingOut:"aia-multiActionsLoadingOut-lSdMh",multiActionsFadeIn:"aia-multiActionsFadeIn-zbGTG",seeAllLoadingOut:"aia-seeAllLoadingOut-THnrl",seeAllFadeIn:"aia-seeAllFadeIn-1GWpl"};var te=require("@magicx-eng/ai-autocomplete-vanilla"),ja=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) ---
|
|
1728
1728
|
|
|
1729
1729
|
One of three hand-maintained copies (vanilla styles.css, this file, Angular's
|
|
1730
1730
|
date-grid.component.css). Only the class-naming layer differs \u2014 the
|
|
@@ -1921,7 +1921,7 @@
|
|
|
1921
1921
|
opacity: 0.8;
|
|
1922
1922
|
background: rgba(var(--aia-streak-rgb, 255, 255, 255), 0.06);
|
|
1923
1923
|
}
|
|
1924
|
-
`,document.head.appendChild(e)}var Z={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
|
|
1924
|
+
`,document.head.appendChild(e)}var Z={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 we=require("react/jsx-runtime"),Ht=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function $a({options:e,activeIndex:t,listboxId:a,view:i,selection:o,onSelect:s,onHighlight:r,onUnhighlight:l,onPreviousMonth:v,onNextMonth:x}){let k=(0,te.isoDate)(new Date),b=(0,te.visibleDateRange)({pendingStart:o.rangeStart,highlightedIso:(0,te.cellIso)(e[t]),selected:o.selectedRange,floor:o.floor});return(0,we.jsxs)("div",{className:Z.datepicker,"data-aia-datepicker":"",children:[(0,we.jsxs)("div",{className:Z.header,children:[(0,we.jsx)("button",{type:"button",tabIndex:-1,className:Z.nav,"data-aia-date-prev":"","aria-label":"Previous month",onMouseDown:u=>u.preventDefault(),onClick:v,children:"\u2039"}),(0,we.jsx)("span",{className:Z.month,"data-aia-date-month":"","aria-live":"polite",children:(0,te.monthLabel)(i)}),(0,we.jsx)("button",{type:"button",tabIndex:-1,className:Z.nav,"data-aia-date-next":"","aria-label":"Next month",onMouseDown:u=>u.preventDefault(),onClick:x,children:"\u203A"})]}),(0,we.jsx)("div",{className:Z.weekdays,"aria-hidden":"true",children:te.WEEKDAY_LABELS.map((u,p)=>(0,we.jsx)("span",{className:Z.weekday,children:u},Ht[p]))}),(0,we.jsx)("div",{className:Z.grid,"data-aia-date-grid":"",children:e.map((u,p)=>(0,we.jsx)(Bt,{option:u,id:`${a}-option-${p}`,index:p,isHighlighted:p===t&&u.is_tappable,isToday:(0,te.cellIso)(u)===k,isPast:(0,te.isDimmedDay)((0,te.cellIso)(u),k,o.floor),marks:(0,te.dateCellMarks)((0,te.cellIso)(u),{selectedIso:o.selectedIso,range:b,references:o.references}),onSelect:s,onHighlight:r,onUnhighlight:l},(0,te.cellIso)(u)??`pad-${p}`))})]})}function Bt({option:e,id:t,index:a,isHighlighted:i,isToday:o,isPast:s,marks:r,onSelect:l,onHighlight:v,onUnhighlight:x}){let[k,b]=(0,ja.useState)(!1),u=(0,te.cellDay)(e);if(u==null)return(0,we.jsx)("div",{id:t,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-hidden":"true","aria-selected":!1,tabIndex:-1,className:`${Z.cell} ${Z.blank}`});let p=()=>{b(!0),l(e),setTimeout(()=>b(!1),170)},y=[Z.cell,Z.day,s?Z.past:"",i?Z.highlighted:"",o?Z.today:"",r.inRange?Z.inRange:"",r.selected?Z.selected:"",r.reference?Z.reference:"",k?Z.pressed:""].filter(Boolean).join(" ");return(0,we.jsx)("div",{id:t,role:"option","data-aia-option":"","data-aia-date-cell":"","aria-selected":i,"aria-label":e.text,tabIndex:0,className:y,onClick:p,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),p())},onMouseEnter:()=>v(a),onMouseLeave:x?()=>x(a):void 0,children:(0,we.jsx)("span",{className:Z.number,children:u})})}var ta=require("@magicx-eng/ai-autocomplete-vanilla"),Ta=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 {
|
|
1925
1925
|
display: flex;
|
|
1926
1926
|
flex-wrap: wrap;
|
|
1927
1927
|
gap: var(--aia-cluster-gap, 0.5rem);
|
|
@@ -1961,7 +1961,7 @@
|
|
|
1961
1961
|
.aia-cluster[data-justify="around"] {
|
|
1962
1962
|
justify-content: space-around;
|
|
1963
1963
|
}
|
|
1964
|
-
`,document.head.appendChild(e)}var
|
|
1964
|
+
`,document.head.appendChild(e)}var Ma=require("react/jsx-runtime");function xa({gap:e,align:t="center",justify:a="start",noWrap:i=!1,inline:o=!1,className:s,children:r,...l}){let v=e?{"--aia-cluster-gap":e}:void 0,x={className:s?`aia-cluster ${s}`:"aia-cluster","data-align":t,"data-justify":a,"data-nowrap":i||void 0,"data-inline":o||void 0,style:v,...l};return o?(0,Ma.jsx)("span",{...x,children:r}):(0,Ma.jsx)("div",{...x,children:r})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset so it stays clear of the
|
|
1965
1965
|
dropdown's rounded edges. The top inset (--aia-footer-gap) adds breathing
|
|
1966
1966
|
room above the hint/branding row so the footer doesn't butt against the last
|
|
1967
1967
|
option row \u2014 additive to the dropdown's 8px section gap. */
|
|
@@ -2108,7 +2108,7 @@
|
|
|
2108
2108
|
justify-content: flex-end;
|
|
2109
2109
|
}
|
|
2110
2110
|
}
|
|
2111
|
-
`,document.head.appendChild(e)}var Ye={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
|
|
2111
|
+
`,document.head.appendChild(e)}var Ye={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 De=require("react/jsx-runtime");function Za({isOptionHighlighted:e=!1,isInputEmpty:t=!1,strings:a=(0,ta.uiStringsFor)()}){let{key:i,hint:o}=(0,ta.getFooterHint)(e,t,a),[s,r]=(0,Ta.useState)(ta.ATTRIBUTION_URL);return(0,Ta.useEffect)(()=>{r((0,ta.buildAttributionUrl)())},[]),(0,De.jsx)("footer",{className:Ye.footer,"data-aia-footer":"",children:(0,De.jsxs)(xa,{justify:"between",noWrap:!0,className:Ye.row,children:[(0,De.jsxs)(xa,{gap:"5px",className:Ye.hintGroup,children:[(0,De.jsx)("kbd",{className:Ye.key,children:i}),(0,De.jsx)("span",{className:Ye.hint,children:o})]}),(0,De.jsxs)("a",{className:Ye.brandLink,href:s,target:"_blank",rel:"noopener noreferrer",children:[(0,De.jsx)("span",{className:Ye.brand,children:"AI"}),(0,De.jsx)("span",{className:Ye.badge,children:"Autocomplete"})]})]})})}var de=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
|
|
2112
2112
|
Angular copy). The three are kept identical by
|
|
2113
2113
|
packages/vanilla/tests/render/locationFieldParity.test.ts. */
|
|
2114
2114
|
.aia-location-6-fsr {
|
|
@@ -2242,7 +2242,7 @@
|
|
|
2242
2242
|
.aia-loadingBar-OLCr4:nth-child(3) {
|
|
2243
2243
|
width: 60%;
|
|
2244
2244
|
}
|
|
2245
|
-
`,document.head.appendChild(e)}var
|
|
2245
|
+
`,document.head.appendChild(e)}var ie={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 K=require("react/jsx-runtime"),Wt=0;function ya(e){return e.getRootNode().activeElement??null}function et(e){return e.getRootNode().getSelection?.()??document.getSelection()}function Xa(e){if(!e.isContentEditable)return null;let t=et(e);if(!t||t.rangeCount===0)return null;let a=t.getRangeAt(0);return e.contains(a.startContainer)?a.cloneRange():null}function Ja(e,t){if(e.focus({preventScroll:!0}),!e.isContentEditable)return;let a=et(e);if(!a)return;let i=t;(!i||!i.startContainer.isConnected||!e.contains(i.startContainer))&&(i=document.createRange(),i.selectNodeContents(e),i.collapse(!1)),a.removeAllRanges(),a.addRange(i)}var Gt=(0,K.jsxs)("svg",{className:ie.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,K.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,K.jsx)("circle",{cx:"12",cy:"9.5",r:"2.5"})]}),Kt=(0,K.jsxs)("svg",{className:ie.icon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,K.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,K.jsx)("path",{d:"m20 20-3.5-3.5"})]});function at({view:e,searchLabel:t,noResultsLabel:a,useTypedLabel:i,widgetFocused:o,reediting:s=!1,visible:r=!0,interactive:l=!0,onQuery:v,onMove:x,onCommit:k,onFocusChange:b}){let u=(0,de.useRef)(null),p=(0,de.useRef)(null),y=(0,de.useRef)(null),A=(0,de.useRef)(null),ee=(0,de.useRef)(null),H=(0,de.useRef)(!1),M=(0,de.useRef)(!1),ue=(0,de.useRef)(!1),P=(0,de.useRef)(!1),F=(0,de.useRef)(o);F.current=o;let ae=(0,de.useRef)(b);ae.current=b;let q=c=>{P.current=c,b(c)},ne=()=>{let c=u.current;return c!=null&&ya(c)===c},R=()=>{let c=p.current;if(!c)return;let T=ya(c);T instanceof HTMLElement&&T!==u.current&&T!==document.body&&!c.contains(T)&&(A.current=T,ee.current=Xa(T))},he=c=>{let T=p.current;!T||!(c instanceof HTMLElement)||c===A.current||c===document.body||T.contains(c)||(A.current=c,ee.current=Xa(c))},j=(0,de.useRef)(null);j.current===null&&(j.current=`aia-location-${++Wt}`);let U=`${j.current}-row-`;(0,de.useEffect)(()=>{let c=u.current;c&&c.value!==e.query&&ya(c)!==c&&(c.value=e.query)},[e.query]),(0,de.useEffect)(()=>{o&&(s&&!ue.current&&(M.current=!1),ue.current=s);let c=u.current;if(c){if(!r&&ne()){M.current=!0,re();return}if(!o){setTimeout(()=>{if(F.current)return;let T=A.current;T&&ya(T)===T||(M.current=!1)},0);return}if(!(!s||M.current||!l||ne())){if(R(),q(!0),c.focus({preventScroll:!0}),!ne()){M.current=!0,q(!1);return}c.value&&c.select()}}}),(0,de.useLayoutEffect)(()=>()=>{if(!P.current)return;let c=u.current,T=A.current;T?.isConnected&&c&&ya(c)===c&&(H.current=!0,Ja(T,ee.current),H.current=!1),P.current=!1,ae.current(!1)},[]);let re=(c=!1)=>{c&&(M.current=!0);let T=A.current;T?.isConnected&&ne()&&(H.current=!0,Ja(T,ee.current),H.current=!1),q(!1)},xe=e.query.trim(),S=e.highlighted>=0&&e.highlighted<e.places.length?`${U}${e.highlighted}`:void 0,Q=null;return e.places.length>0?Q=e.places.map((c,T)=>(0,K.jsxs)("div",{id:`${U}${T}`,role:"option","aria-selected":T===e.highlighted,className:T===e.highlighted?`${ie.row} ${ie.highlighted}`:ie.row,"data-aia-location-row":"","data-aia-index":T,onClick:()=>{l&&(re(!0),k(T))},children:[(0,K.jsx)("span",{className:ie.pin,children:Gt}),(0,K.jsxs)("span",{className:ie.text,children:[(0,K.jsx)("span",{className:ie.name,children:c.name}),c.secondary&&(0,K.jsx)("span",{className:ie.secondary,children:c.secondary})]})]},c.id)):e.status==="loading"?Q=(0,K.jsxs)("div",{className:ie.loading,"data-aia-location-loading":"",children:[(0,K.jsx)("span",{className:ie.loadingBar}),(0,K.jsx)("span",{className:ie.loadingBar}),(0,K.jsx)("span",{className:ie.loadingBar})]}):xe&&(Q=(0,K.jsxs)("div",{className:ie.note,"data-aia-location-note":"",children:[e.status==="done"&&(0,K.jsx)("span",{className:ie.empty,children:a}),(0,K.jsx)("span",{children:i})]})),(0,K.jsxs)("div",{ref:p,className:ie.location,"data-aia-location":"",onMouseDown:c=>{!(c.target instanceof Node)||!y.current?.contains(c.target)||(c.stopPropagation(),R(),q(!0))},children:[(0,K.jsxs)("label",{ref:y,className:ie.field,children:[Kt,(0,K.jsx)("input",{ref:u,type:"text",className:ie.input,"data-aia-location-input":"",defaultValue:e.query,placeholder:t,"aria-label":t,"aria-activedescendant":S,autoComplete:"off",autoCapitalize:"words",enterKeyHint:"done",spellCheck:!1,tabIndex:r?0:-1,onChange:c=>v(c.target.value),onFocus:c=>{he(c.relatedTarget),q(!0)},onBlur:()=>{H.current||(M.current=!0,q(!1))},onKeyDown:c=>{if(!c.nativeEvent.isComposing)switch(c.key){case"ArrowDown":case"ArrowUp":c.preventDefault(),x(c.key==="ArrowDown"?1:-1);return;case"Enter":if(c.preventDefault(),!l)return;re(!0),k();return;case"Escape":c.preventDefault(),c.stopPropagation(),M.current=!0,re();return;case"Backspace":if(c.currentTarget.value!=="")return;c.preventDefault(),M.current=!0,re();return}}})]}),(0,K.jsx)("div",{className:ie.results,"data-aia-location-results":"","aria-live":"polite",children:Q})]})}var Pa=require("@magicx-eng/ai-autocomplete-vanilla");var tt=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,
|
|
2246
2246
|
no outline. ~28px via 6px padding + 14px text + the 1px border (border-box).
|
|
2247
2247
|
The border is kept as a 1px transparent line so the box stays the same size
|
|
2248
2248
|
as it was when the outline was dashed. */
|
|
@@ -2400,7 +2400,7 @@
|
|
|
2400
2400
|
opacity: 0;
|
|
2401
2401
|
}
|
|
2402
2402
|
}
|
|
2403
|
-
`,document.head.appendChild(e)}var
|
|
2403
|
+
`,document.head.appendChild(e)}var Me={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 ia=require("react/jsx-runtime"),Na={selected:1,first:.7,next:.4,last:.2};function it({label:e,state:t,active:a,rounded:i,loading:o,smartSuggestion:s,completionHeader:r,onClick:l}){let v=[Me.pill,i?Me.rounded:"",o?Me.skeleton:""].filter(Boolean).join(" ");return(0,ia.jsx)("button",{type:"button","data-aia-pill":"","data-aia-pill-active":a?"":void 0,"data-aia-loading":o?"":void 0,"data-aia-smart-suggestion":s?r?"header":"":void 0,tabIndex:-1,contentEditable:!1,suppressContentEditableWarning:!0,className:v,style:{"--aia-pill-opacity":Na[t]},onMouseDown:x=>x.preventDefault(),onClick:o?void 0:l,disabled:o,children:s?(0,ia.jsxs)(ia.Fragment,{children:[(0,ia.jsx)("span",{className:`${Me.smartText} magicx-aia-smart-suggestion-text`,children:e}),(0,ia.jsx)("span",{className:`${Me.smartSparkle} magicx-aia-smart-suggestion-sparkle`,dangerouslySetInnerHTML:{__html:tt.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 {
|
|
2404
2404
|
position: relative;
|
|
2405
2405
|
z-index: 1;
|
|
2406
2406
|
pointer-events: auto;
|
|
@@ -2410,7 +2410,7 @@
|
|
|
2410
2410
|
align-items: center;
|
|
2411
2411
|
vertical-align: middle;
|
|
2412
2412
|
}
|
|
2413
|
-
`,document.head.appendChild(e)}var
|
|
2413
|
+
`,document.head.appendChild(e)}var Fa={list:"aia-list-qvLqO"};var ka=require("react/jsx-runtime"),qt=[125,69];function ot(e){return e===0?"first":e===1?"next":"last"}function Ia({pills:e,activePillIndex:t,onSelectPill:a,activeSelected:i,rounded:o,loading:s}){return s&&e.length===0?(0,ka.jsx)("span",{className:Fa.list,"data-aia-pill-list-loading":"",children:qt.map((r,l)=>(0,ka.jsx)("span",{"data-aia-pill-skeleton":"",className:`${Me.pill} ${o?Me.rounded:""} ${Me.skeleton}`,style:{width:r,"--aia-pill-opacity":Na[ot(l)]}},`skel-${r}`))}):(0,ka.jsx)("span",{className:Fa.list,"data-aia-pill-list-loading":s?"":void 0,children:e.map((r,l)=>{let v=!!i&&l===t;return(0,ka.jsx)(it,{label:r.text,state:v?"selected":ot(l),selected:v,active:l===t,rounded:o,loading:s,smartSuggestion:(0,Pa.isSmartSuggestion)(r),completionHeader:(0,Pa.isTraditionalAutocompleteSuggestion)(r),onClick:()=>a(l)},`${r.parameter}-${r.text}`)})})}var ke=require("@magicx-eng/ai-autocomplete-vanilla"),ve=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
|
|
2414
2414
|
(packages/vanilla/src/styles.css). Same tokens, same defaults, so a consumer
|
|
2415
2415
|
theming one package sees the same result in the other.
|
|
2416
2416
|
|
|
@@ -2423,7 +2423,7 @@
|
|
|
2423
2423
|
.aia-section-Hugfg {
|
|
2424
2424
|
display: flex;
|
|
2425
2425
|
flex-direction: column;
|
|
2426
|
-
gap:
|
|
2426
|
+
gap: 6px;
|
|
2427
2427
|
/* The option text sits 10px inside the dropdown's padding edge (the
|
|
2428
2428
|
option's own padding), so the section carries the same 10px and its
|
|
2429
2429
|
label lands on the option text's left edge \u2014 which the dropdown in turn
|
|
@@ -2434,9 +2434,9 @@
|
|
|
2434
2434
|
|
|
2435
2435
|
.aia-label-nuc93 {
|
|
2436
2436
|
font-family: inherit;
|
|
2437
|
-
font-size: var(--aia-products-label-font-size,
|
|
2437
|
+
font-size: var(--aia-products-label-font-size, 11px);
|
|
2438
2438
|
font-weight: 500;
|
|
2439
|
-
line-height:
|
|
2439
|
+
line-height: 18px;
|
|
2440
2440
|
letter-spacing: 0.02em;
|
|
2441
2441
|
color: var(
|
|
2442
2442
|
--aia-products-label-color,
|
|
@@ -2450,16 +2450,16 @@
|
|
|
2450
2450
|
a trackpad fling at either end from chaining out to the page. */
|
|
2451
2451
|
.aia-row-WDVBX {
|
|
2452
2452
|
display: flex;
|
|
2453
|
-
gap: var(--aia-product-gap,
|
|
2453
|
+
gap: var(--aia-product-gap, 8px);
|
|
2454
2454
|
min-width: 0;
|
|
2455
2455
|
overflow-x: auto;
|
|
2456
2456
|
overflow-y: hidden;
|
|
2457
2457
|
overscroll-behavior-x: contain;
|
|
2458
|
-
padding-bottom:
|
|
2458
|
+
padding-bottom: 2px;
|
|
2459
2459
|
/* Pull the row out by the card's own 6px padding so the first card's
|
|
2460
2460
|
image tile \u2014 not its hover fill \u2014 starts on the label's left edge, the
|
|
2461
2461
|
same way the option's highlight fill hangs outside its text. */
|
|
2462
|
-
margin-inline: -
|
|
2462
|
+
margin-inline: -6px;
|
|
2463
2463
|
/* Hide the scrollbar chrome across all three engines while leaving the box
|
|
2464
2464
|
scrollable by trackpad, touch and keyboard. A mouse wheel is vertical and
|
|
2465
2465
|
would otherwise have no way through a row with no scrollbar to grab, so
|
|
@@ -2477,10 +2477,10 @@
|
|
|
2477
2477
|
flex: 0 0 auto;
|
|
2478
2478
|
display: flex;
|
|
2479
2479
|
flex-direction: column;
|
|
2480
|
-
gap:
|
|
2481
|
-
width: var(--aia-product-card-width,
|
|
2482
|
-
padding:
|
|
2483
|
-
border-radius:
|
|
2480
|
+
gap: 6px;
|
|
2481
|
+
width: var(--aia-product-card-width, 116px);
|
|
2482
|
+
padding: 6px;
|
|
2483
|
+
border-radius: 10px;
|
|
2484
2484
|
background: var(--aia-product-bg, transparent);
|
|
2485
2485
|
/* Explicit, never inherited \u2014 see the file header. */
|
|
2486
2486
|
color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
|
|
@@ -2513,7 +2513,7 @@
|
|
|
2513
2513
|
position: relative;
|
|
2514
2514
|
width: 100%;
|
|
2515
2515
|
aspect-ratio: 1 / 1;
|
|
2516
|
-
border-radius:
|
|
2516
|
+
border-radius: 8px;
|
|
2517
2517
|
overflow: hidden;
|
|
2518
2518
|
background: var(--aia-product-media-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.25)));
|
|
2519
2519
|
}
|
|
@@ -2538,7 +2538,7 @@
|
|
|
2538
2538
|
max-width: 100%;
|
|
2539
2539
|
height: 100%;
|
|
2540
2540
|
margin: 0 auto;
|
|
2541
|
-
border-radius: var(--aia-product-image-radius,
|
|
2541
|
+
border-radius: var(--aia-product-image-radius, 8px);
|
|
2542
2542
|
object-fit: contain;
|
|
2543
2543
|
}
|
|
2544
2544
|
|
|
@@ -2551,7 +2551,7 @@
|
|
|
2551
2551
|
align-items: center;
|
|
2552
2552
|
justify-content: center;
|
|
2553
2553
|
color: var(--aia-product-title-color, var(--aia-option-color-selected, currentColor));
|
|
2554
|
-
font-size:
|
|
2554
|
+
font-size: 24px;
|
|
2555
2555
|
font-weight: 600;
|
|
2556
2556
|
line-height: 1;
|
|
2557
2557
|
}
|
|
@@ -2574,14 +2574,14 @@
|
|
|
2574
2574
|
.aia-body-ly032 {
|
|
2575
2575
|
display: flex;
|
|
2576
2576
|
flex-direction: column;
|
|
2577
|
-
gap:
|
|
2577
|
+
gap: 2px;
|
|
2578
2578
|
min-width: 0;
|
|
2579
2579
|
}
|
|
2580
2580
|
|
|
2581
2581
|
.aia-vendor-Gvu7G {
|
|
2582
2582
|
font-family: inherit;
|
|
2583
|
-
font-size: var(--aia-product-vendor-font-size,
|
|
2584
|
-
line-height:
|
|
2583
|
+
font-size: var(--aia-product-vendor-font-size, 10px);
|
|
2584
|
+
line-height: 14px;
|
|
2585
2585
|
color: var(
|
|
2586
2586
|
--aia-product-vendor-color,
|
|
2587
2587
|
var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb))
|
|
@@ -2595,9 +2595,9 @@
|
|
|
2595
2595
|
|
|
2596
2596
|
.aia-title-gCNmq {
|
|
2597
2597
|
font-family: inherit;
|
|
2598
|
-
font-size: var(--aia-product-title-font-size,
|
|
2598
|
+
font-size: var(--aia-product-title-font-size, 12px);
|
|
2599
2599
|
font-weight: 400;
|
|
2600
|
-
line-height:
|
|
2600
|
+
line-height: 16px;
|
|
2601
2601
|
/* The card's most prominent text uses the same token the *highlighted*
|
|
2602
2602
|
option text does, so it stays legible on any --aia-surface a consumer
|
|
2603
2603
|
sets \u2014 light or dark \u2014 without a second theming control. */
|
|
@@ -2614,9 +2614,9 @@
|
|
|
2614
2614
|
|
|
2615
2615
|
.aia-price-gULcE {
|
|
2616
2616
|
font-family: inherit;
|
|
2617
|
-
font-size: var(--aia-product-price-font-size,
|
|
2617
|
+
font-size: var(--aia-product-price-font-size, 11px);
|
|
2618
2618
|
font-weight: 500;
|
|
2619
|
-
line-height:
|
|
2619
|
+
line-height: 15px;
|
|
2620
2620
|
color: var(
|
|
2621
2621
|
--aia-product-price-color,
|
|
2622
2622
|
var(--aia-option-color-selected, var(--aia-color-text-default, #fff))
|
|
@@ -2627,7 +2627,7 @@
|
|
|
2627
2627
|
display: flex;
|
|
2628
2628
|
flex-wrap: wrap;
|
|
2629
2629
|
align-items: baseline;
|
|
2630
|
-
column-gap:
|
|
2630
|
+
column-gap: 4px;
|
|
2631
2631
|
}
|
|
2632
2632
|
|
|
2633
2633
|
/* The price before a markdown, struck through after the price, on the same
|
|
@@ -2645,10 +2645,10 @@
|
|
|
2645
2645
|
reads on any photo, light or dark, and on either panel surface. */
|
|
2646
2646
|
.aia-badge-j9Hcd {
|
|
2647
2647
|
position: absolute;
|
|
2648
|
-
top: var(--aia-product-badge-inset,
|
|
2649
|
-
left: var(--aia-product-badge-inset,
|
|
2650
|
-
padding:
|
|
2651
|
-
border-radius:
|
|
2648
|
+
top: var(--aia-product-badge-inset, 12px);
|
|
2649
|
+
left: var(--aia-product-badge-inset, 12px);
|
|
2650
|
+
padding: 3px 6px;
|
|
2651
|
+
border-radius: 4px;
|
|
2652
2652
|
background: var(--aia-product-badge-bg, rgba(255, 255, 255, 0.94));
|
|
2653
2653
|
color: var(--aia-product-badge-color, #1f2328);
|
|
2654
2654
|
/* A hairline ring keeps the chip's edge on a pale image or a light panel. */
|
|
@@ -2656,7 +2656,7 @@
|
|
|
2656
2656
|
0 0 0 1px rgba(0, 0, 0, 0.08),
|
|
2657
2657
|
0 1px 2px rgba(0, 0, 0, 0.18);
|
|
2658
2658
|
font-family: inherit;
|
|
2659
|
-
font-size: var(--aia-product-badge-font-size,
|
|
2659
|
+
font-size: var(--aia-product-badge-font-size, 9px);
|
|
2660
2660
|
font-weight: 600;
|
|
2661
2661
|
line-height: 1;
|
|
2662
2662
|
letter-spacing: 0.08em;
|
|
@@ -2678,24 +2678,24 @@
|
|
|
2678
2678
|
fill the square (--aia-product-photo-fill-x / -y, set on the card when
|
|
2679
2679
|
the photo loads; 1, the tile's own corner, until then). */
|
|
2680
2680
|
top: calc(
|
|
2681
|
-
var(--aia-product-card-width,
|
|
2682
|
-
|
|
2683
|
-
var(--aia-product-cart-size,
|
|
2684
|
-
(var(--aia-product-card-width,
|
|
2681
|
+
var(--aia-product-card-width, 116px) -
|
|
2682
|
+
12px -
|
|
2683
|
+
var(--aia-product-cart-size, 28px) -
|
|
2684
|
+
(var(--aia-product-card-width, 116px) - 12px) *
|
|
2685
2685
|
(1 - var(--aia-product-photo-fill-y, 1)) /
|
|
2686
2686
|
2
|
|
2687
2687
|
);
|
|
2688
2688
|
right: calc(
|
|
2689
|
-
|
|
2690
|
-
(var(--aia-product-card-width,
|
|
2689
|
+
12px +
|
|
2690
|
+
(var(--aia-product-card-width, 116px) - 12px) *
|
|
2691
2691
|
(1 - var(--aia-product-photo-fill-x, 1)) /
|
|
2692
2692
|
2
|
|
2693
2693
|
);
|
|
2694
2694
|
display: flex;
|
|
2695
2695
|
align-items: center;
|
|
2696
2696
|
justify-content: center;
|
|
2697
|
-
width: var(--aia-product-cart-size,
|
|
2698
|
-
height: var(--aia-product-cart-size,
|
|
2697
|
+
width: var(--aia-product-cart-size, 28px);
|
|
2698
|
+
height: var(--aia-product-cart-size, 28px);
|
|
2699
2699
|
border-radius: 999px;
|
|
2700
2700
|
background: var(--aia-product-cart-bg, rgba(255, 255, 255, 0.94));
|
|
2701
2701
|
color: var(--aia-product-cart-color, #1f2328);
|
|
@@ -2719,8 +2719,8 @@
|
|
|
2719
2719
|
|
|
2720
2720
|
.aia-cart-kSlqU svg {
|
|
2721
2721
|
display: block;
|
|
2722
|
-
width:
|
|
2723
|
-
height:
|
|
2722
|
+
width: 16px;
|
|
2723
|
+
height: 16px;
|
|
2724
2724
|
fill: none;
|
|
2725
2725
|
stroke: currentColor;
|
|
2726
2726
|
stroke-width: 2;
|
|
@@ -2803,8 +2803,8 @@
|
|
|
2803
2803
|
occurrence, and these selectors contain the base selectors. */
|
|
2804
2804
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-row-WDVBX {
|
|
2805
2805
|
flex-direction: column;
|
|
2806
|
-
gap: var(--aia-product-list-gap,
|
|
2807
|
-
max-height: var(--aia-product-list-max-height,
|
|
2806
|
+
gap: var(--aia-product-list-gap, 2px);
|
|
2807
|
+
max-height: var(--aia-product-list-max-height, 320px);
|
|
2808
2808
|
overflow-x: hidden;
|
|
2809
2809
|
overflow-y: auto;
|
|
2810
2810
|
overscroll-behavior-y: contain;
|
|
@@ -2813,17 +2813,17 @@
|
|
|
2813
2813
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-card-JBGYT {
|
|
2814
2814
|
flex-direction: row;
|
|
2815
2815
|
align-items: center;
|
|
2816
|
-
gap:
|
|
2816
|
+
gap: 10px;
|
|
2817
2817
|
width: auto;
|
|
2818
|
-
padding:
|
|
2818
|
+
padding: 6px 8px;
|
|
2819
2819
|
}
|
|
2820
2820
|
|
|
2821
2821
|
/* A fixed square thumbnail: width and height together, so the row's height
|
|
2822
2822
|
is the tile's, not the card width's. */
|
|
2823
2823
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-media-RrbGe {
|
|
2824
2824
|
flex: 0 0 auto;
|
|
2825
|
-
width: var(--aia-product-list-media-size,
|
|
2826
|
-
height: var(--aia-product-list-media-size,
|
|
2825
|
+
width: var(--aia-product-list-media-size, 44px);
|
|
2826
|
+
height: var(--aia-product-list-media-size, 44px);
|
|
2827
2827
|
}
|
|
2828
2828
|
|
|
2829
2829
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-body-ly032 {
|
|
@@ -2835,18 +2835,18 @@
|
|
|
2835
2835
|
match, so its bottom edge is half a thumbnail below the card's centre; its
|
|
2836
2836
|
left edge is the card's 8px inline padding. */
|
|
2837
2837
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-badge-j9Hcd {
|
|
2838
|
-
top: calc(50% + var(--aia-product-list-media-size,
|
|
2839
|
-
left:
|
|
2840
|
-
width: var(--aia-product-list-media-size,
|
|
2838
|
+
top: calc(50% + var(--aia-product-list-media-size, 44px) / 2);
|
|
2839
|
+
left: 8px;
|
|
2840
|
+
width: var(--aia-product-list-media-size, 44px);
|
|
2841
2841
|
transform: translateY(-100%);
|
|
2842
|
-
padding:
|
|
2843
|
-
border-radius: 0 0
|
|
2842
|
+
padding: 2px 0;
|
|
2843
|
+
border-radius: 0 0 8px 8px;
|
|
2844
2844
|
/* A dark scrim rather than the light chip: a light banner at a tile's edge
|
|
2845
2845
|
merges with a light panel and reads as a cropped photo. */
|
|
2846
2846
|
background: var(--aia-product-badge-list-bg, rgba(17, 17, 17, 0.72));
|
|
2847
2847
|
color: var(--aia-product-badge-list-color, #fff);
|
|
2848
2848
|
box-shadow: none;
|
|
2849
|
-
font-size: var(--aia-product-badge-list-font-size,
|
|
2849
|
+
font-size: var(--aia-product-badge-list-font-size, 7px);
|
|
2850
2850
|
letter-spacing: 0.02em;
|
|
2851
2851
|
text-align: center;
|
|
2852
2852
|
}
|
|
@@ -2855,7 +2855,7 @@
|
|
|
2855
2855
|
column stops short of it. */
|
|
2856
2856
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-cart-kSlqU {
|
|
2857
2857
|
top: 50%;
|
|
2858
|
-
right:
|
|
2858
|
+
right: 8px;
|
|
2859
2859
|
transform: translateY(-50%);
|
|
2860
2860
|
}
|
|
2861
2861
|
|
|
@@ -2864,7 +2864,7 @@
|
|
|
2864
2864
|
}
|
|
2865
2865
|
|
|
2866
2866
|
.aia-section-Hugfg[data-aia-products-layout="list"] .aia-card-JBGYT[data-aia-product-has-cart] {
|
|
2867
|
-
padding-right: calc(var(--aia-product-cart-size,
|
|
2867
|
+
padding-right: calc(var(--aia-product-cart-size, 28px) + 16px);
|
|
2868
2868
|
}
|
|
2869
2869
|
|
|
2870
2870
|
/* Classic options box (optionsStyle: "classic"): the panel as it was
|
|
@@ -3003,7 +3003,7 @@
|
|
|
3003
3003
|
opacity: 0.01;
|
|
3004
3004
|
}
|
|
3005
3005
|
}
|
|
3006
|
-
`,document.head.appendChild(e)}var
|
|
3006
|
+
`,document.head.appendChild(e)}var oe={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 G=require("react/jsx-runtime");function nt({products:e,listboxId:t,onSelect:a,onAddToCart:i,onFocusChange:o,focusable:s=!0,loading:r=!1,layout:l="row",imageFallback:v="image",strings:x=(0,ke.uiStringsFor)()}){let k=e.length>0,b=(0,ve.useRef)(null);if((0,ve.useEffect)(()=>{let p=b.current;if(!(!k||!p))return(0,ke.attachProductRowWheel)(p)},[k]),!k)return null;let u=`${t}-products-label`;return(0,G.jsxs)("section",{className:oe.section,"data-aia-products":"","data-aia-loading":r?"":void 0,"data-aia-products-layout":l,role:"group","aria-labelledby":u,children:[(0,G.jsx)("div",{className:oe.label,id:u,"data-aia-products-label":"",children:x.products}),(0,G.jsx)("div",{ref:b,className:oe.row,"data-aia-products-row":"",children:e.map((p,y)=>(0,G.jsx)(_t,{product:p,id:`${t}-product-${y}`,onSelect:a,onAddToCart:i,onFocusChange:o,focusable:s,imageFallback:v,soldOut:x.soldOut,addToCart:x.addToCart},p.id))})]})}function _t({product:e,id:t,onSelect:a,onAddToCart:i,onFocusChange:o,focusable:s,imageFallback:r,soldOut:l,addToCart:v}){let x=!!i&&e.available!==!1,[k,b]=(0,ve.useState)(null),u=y=>{y.relatedTarget?.closest("[data-aia-dropdown]")||o?.(!1)},p=y=>{y.metaKey||y.ctrlKey||y.shiftKey||y.altKey||y.button!==0||(y.preventDefault(),a(e))};return(0,G.jsxs)("a",{id:t,className:oe.card,"data-aia-product":"","data-aia-product-sold-out":e.available===!1?"":void 0,"data-aia-product-has-cart":x?"":void 0,role:"option","aria-selected":!1,style:k?{"--aia-product-photo-fill-x":String(k.x),"--aia-product-photo-fill-y":String(k.y)}:void 0,href:e.url,tabIndex:s?0:-1,onClick:p,onKeyDown:y=>{y.key!=="Enter"&&y.key!==" "||(y.preventDefault(),a(e))},onFocus:()=>o?.(!0),onBlur:u,children:[(0,G.jsx)(Qt,{sources:(0,ke.productImageSources)(e.imageUrl),title:e.title,fallback:r,onPhotoFill:b},(0,ke.productImageSrc)(e.imageUrl)??""),(0,G.jsxs)("span",{className:oe.body,children:[e.vendor?(0,G.jsx)("span",{className:oe.vendor,children:e.vendor}):null,(0,G.jsx)("span",{className:oe.title,children:e.title}),e.price?(0,G.jsxs)("span",{className:oe.price,children:[e.price,e.compareAtPrice?(0,G.jsx)("s",{className:oe.compareAt,children:e.compareAtPrice}):null]}):null,e.available===!1?(0,G.jsx)("span",{className:oe.badge,children:l}):null]}),x&&i?(0,G.jsx)(Ut,{product:e,label:`${v}: ${e.title}`,focusable:s,onAddToCart:i,onFocus:()=>o?.(!0),onBlur:u},Vt(e)):null]})}function Vt(e){return[e.id,e.title,e.url,e.imageUrl,e.vendor].map(t=>t??"").join("\0")}function Ut({product:e,label:t,focusable:a,onAddToCart:i,onFocus:o,onBlur:s}){let[r,l]=(0,ve.useState)(null),v=(0,ve.useRef)(null),x=(0,ve.useRef)(e);x.current=e;let k=(0,ve.useRef)(!0);(0,ve.useEffect)(()=>(k.current=!0,()=>{k.current=!1}),[]);let b=p=>{v.current=p,k.current&&l(p)},u=p=>{if(p.preventDefault(),p.stopPropagation(),v.current==="adding")return;b("adding");let y;try{y=Promise.resolve(i(x.current))}catch(A){y=Promise.reject(A)}y.then(()=>b("added"),()=>b(null))};return(0,G.jsx)("span",{className:oe.cart,"data-aia-product-cart":"","data-aia-cart-state":r??void 0,"aria-busy":r==="adding"?!0:void 0,role:"button","aria-label":t,tabIndex:a?0:-1,onClick:u,onKeyDown:p=>{p.key!=="Enter"&&p.key!==" "||u(p)},onFocus:p=>{p.stopPropagation(),o()},onBlur:p=>{p.stopPropagation(),s(p)},children:(0,G.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,G.jsx)("path",{className:oe.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,G.jsx)("path",{className:oe.cartGlyph,d:"M13.5 6.5v-4M11.5 4.5h4"}),(0,G.jsx)("path",{className:oe.cartCheck,d:"M5 12.5l4.5 4.5L19 7.5"}),(0,G.jsx)("path",{className:oe.cartSpinner,d:"M12 4a8 8 0 1 0 8 8"}),(0,G.jsx)("circle",{className:oe.cartGlyph,cx:"9",cy:"20",r:"1.3"}),(0,G.jsx)("circle",{className:oe.cartGlyph,cx:"17.5",cy:"20",r:"1.3"})]})})}function Qt({sources:e,title:t,fallback:a,onPhotoFill:i}){let[o,s]=(0,ve.useState)(0),r=e[o],l=!!r,[v,x]=(0,ve.useState)(null),k=!l&&a==="initial";return(0,ve.useEffect)(()=>()=>i(null),[i]),(0,G.jsxs)("span",{className:oe.media,"aria-hidden":"true","data-aia-product-placeholder":!l&&!k?"":void 0,"data-aia-product-initial":k?"":void 0,"data-aia-image-loaded":l&&v===r?"":void 0,children:[l?(0,G.jsx)("img",{className:oe.image,src:r,alt:"",loading:"lazy",decoding:"async",onLoad:b=>{x(r),i((0,ke.productPhotoFill)(b.currentTarget.naturalWidth,b.currentTarget.naturalHeight))},onError:()=>{o+1>=e.length&&i(null),s(b=>b+1)}}):null,k?(0,ke.productInitial)(t):null]})}var X=require("@magicx-eng/ai-autocomplete-vanilla"),Pe=require("react");var rt=require("@magicx-eng/ai-autocomplete-vanilla"),Ea=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 {
|
|
3007
3007
|
display: grid;
|
|
3008
3008
|
grid-template-columns: repeat(
|
|
3009
3009
|
auto-fit,
|
|
@@ -3031,7 +3031,7 @@
|
|
|
3031
3031
|
/* The scroll box's reserved band (--aia-grid-scroll-* / --aia-grid-overlap-*)
|
|
3032
3032
|
is deliberately NOT declared here \u2014 see the rule in
|
|
3033
3033
|
appearance.css for why. */
|
|
3034
|
-
max-height: var(--aia-grid-max-height,
|
|
3034
|
+
max-height: var(--aia-grid-max-height, 120px);
|
|
3035
3035
|
overflow-y: auto;
|
|
3036
3036
|
overscroll-behavior: contain;
|
|
3037
3037
|
scrollbar-width: none;
|
|
@@ -3047,7 +3047,7 @@
|
|
|
3047
3047
|
:where([data-aia-options-style="classic"]) .aia-grid[data-scroll] {
|
|
3048
3048
|
max-height: var(--aia-grid-max-height, 120px);
|
|
3049
3049
|
}
|
|
3050
|
-
`,document.head.appendChild(e)}var lt=require("react/jsx-runtime");function st({min:e="16rem",max:t,gap:a,scroll:i=!1,maxHeight:o,scrollResetKey:s,cols:r,template:l,innerRef:
|
|
3050
|
+
`,document.head.appendChild(e)}var lt=require("react/jsx-runtime");function st({min:e="16rem",max:t,gap:a,scroll:i=!1,maxHeight:o,scrollResetKey:s,cols:r,template:l,innerRef:v,className:x,children:k,...b}){let u=(0,Ea.useRef)(null);(0,Ea.useLayoutEffect)(()=>{if(s===void 0)return;let y=u.current;y&&(y.scrollTop=0)},[s]);let p={"--aia-grid-min":e};return t&&(p["--aia-grid-max"]=t),a&&(p["--aia-grid-gap"]=a),o&&(p["--aia-grid-max-height"]=o),r&&(p.gridTemplateColumns=(0,rt.optionsGridTemplateColumns)(r)),l&&(p.gridTemplateColumns=l),(0,lt.jsx)("div",{ref:y=>{u.current=y,v?.(y)},className:x?`aia-grid ${x}`:"aia-grid","data-scroll":i||void 0,style:p,...b,children:k})}var me=require("@magicx-eng/ai-autocomplete-vanilla"),Ce=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 {
|
|
3051
3051
|
position: relative;
|
|
3052
3052
|
/* Clip, not visible: the entrance rise below runs on the inner content,
|
|
3053
3053
|
and a transformed box extends its scroll container's scrollable area.
|
|
@@ -3065,16 +3065,16 @@
|
|
|
3065
3065
|
the same baseline at the top edge of the cell. */
|
|
3066
3066
|
align-items: flex-start;
|
|
3067
3067
|
font-family: inherit;
|
|
3068
|
-
font-size: var(--aia-option-font-size,
|
|
3068
|
+
font-size: var(--aia-option-font-size, 16px);
|
|
3069
3069
|
font-weight: 450;
|
|
3070
|
-
line-height:
|
|
3070
|
+
line-height: 21px;
|
|
3071
3071
|
color: var(--aia-option-color, var(--aia-color-text-muted, #c1c4cb));
|
|
3072
3072
|
white-space: normal;
|
|
3073
3073
|
word-break: break-word;
|
|
3074
|
-
/*
|
|
3075
|
-
SuggestionItem selection
|
|
3076
|
-
border-radius:
|
|
3077
|
-
padding: var(--aia-option-padding-block,
|
|
3074
|
+
/* 8px radius on the highlighted fill (--aia-option-bg), matching the Figma
|
|
3075
|
+
SuggestionItem selection. The 8px/10px inset is the item's own padding. */
|
|
3076
|
+
border-radius: 8px;
|
|
3077
|
+
padding: var(--aia-option-padding-block, 8px) 10px;
|
|
3078
3078
|
/* No entrance animation on the row itself \u2014 deliberately. The row is the
|
|
3079
3079
|
tappable element, and iOS Safari drops a tap on a scripted-clickable
|
|
3080
3080
|
element (a div with a click handler; a native button is exempt) whose
|
|
@@ -3160,8 +3160,8 @@
|
|
|
3160
3160
|
}
|
|
3161
3161
|
|
|
3162
3162
|
.aia-tag-e3Fwe {
|
|
3163
|
-
font-size:
|
|
3164
|
-
margin-left:
|
|
3163
|
+
font-size: 11px;
|
|
3164
|
+
margin-left: 6px;
|
|
3165
3165
|
opacity: 0.5;
|
|
3166
3166
|
}
|
|
3167
3167
|
|
|
@@ -3233,9 +3233,9 @@
|
|
|
3233
3233
|
text box, so a hanging indent never moves it. */
|
|
3234
3234
|
.aia-parameter-Dt2zF {
|
|
3235
3235
|
display: block;
|
|
3236
|
-
font-size: var(--aia-option-parameter-font-size,
|
|
3236
|
+
font-size: var(--aia-option-parameter-font-size, 12px);
|
|
3237
3237
|
font-weight: 400;
|
|
3238
|
-
line-height:
|
|
3238
|
+
line-height: 16px;
|
|
3239
3239
|
text-indent: 0;
|
|
3240
3240
|
color: var(--aia-option-parameter-color, inherit);
|
|
3241
3241
|
opacity: var(--aia-option-parameter-opacity, 0.6);
|
|
@@ -3255,8 +3255,8 @@
|
|
|
3255
3255
|
.aia-icon-Qw938 {
|
|
3256
3256
|
display: inline-flex;
|
|
3257
3257
|
align-items: center;
|
|
3258
|
-
height:
|
|
3259
|
-
margin-right:
|
|
3258
|
+
height: 21px; /* = the option's line-height */
|
|
3259
|
+
margin-right: 8px;
|
|
3260
3260
|
vertical-align: top;
|
|
3261
3261
|
/* Own compositing layer. The row (entrance) and the chip (promotion fade)
|
|
3262
3262
|
animate on a layer WebKit drops when the animation ends; content drawn at
|
|
@@ -3279,8 +3279,8 @@
|
|
|
3279
3279
|
(blockified), so text-indent applies to it directly. Skeleton rows keep
|
|
3280
3280
|
it too: their icon is hidden but still occupies its column. */
|
|
3281
3281
|
.aia-content-T-Qba:not(:has(.aia-count-IpYbQ)):has(.aia-icon-Qw938) {
|
|
3282
|
-
padding-left: calc(1em +
|
|
3283
|
-
text-indent: calc(-1em -
|
|
3282
|
+
padding-left: calc(1em + 8px);
|
|
3283
|
+
text-indent: calc(-1em - 8px);
|
|
3284
3284
|
}
|
|
3285
3285
|
|
|
3286
3286
|
/* --- Option pictures and counts ---
|
|
@@ -3313,15 +3313,15 @@
|
|
|
3313
3313
|
loads) and stays if it never does. */
|
|
3314
3314
|
.aia-content-T-Qba:has(.aia-image-YZAbO) {
|
|
3315
3315
|
align-items: center;
|
|
3316
|
-
gap: var(--aia-option-image-gap,
|
|
3316
|
+
gap: var(--aia-option-image-gap, 12px);
|
|
3317
3317
|
}
|
|
3318
3318
|
|
|
3319
3319
|
.aia-image-YZAbO {
|
|
3320
3320
|
flex: 0 0 auto;
|
|
3321
3321
|
display: block;
|
|
3322
|
-
width: var(--aia-option-image-size,
|
|
3323
|
-
height: var(--aia-option-image-size,
|
|
3324
|
-
border-radius: var(--aia-option-image-radius,
|
|
3322
|
+
width: var(--aia-option-image-size, 40px);
|
|
3323
|
+
height: var(--aia-option-image-size, 40px);
|
|
3324
|
+
border-radius: var(--aia-option-image-radius, 12px);
|
|
3325
3325
|
overflow: hidden;
|
|
3326
3326
|
background: var(--aia-option-image-bg, var(--aia-skeleton-bg, rgba(189, 189, 189, 0.083)));
|
|
3327
3327
|
}
|
|
@@ -3346,7 +3346,7 @@
|
|
|
3346
3346
|
max-width: 100%;
|
|
3347
3347
|
height: 100%;
|
|
3348
3348
|
margin: 0 auto;
|
|
3349
|
-
border-radius: var(--aia-option-picture-radius,
|
|
3349
|
+
border-radius: var(--aia-option-picture-radius, 6px);
|
|
3350
3350
|
object-fit: contain;
|
|
3351
3351
|
}
|
|
3352
3352
|
|
|
@@ -3363,10 +3363,10 @@
|
|
|
3363
3363
|
.aia-count-IpYbQ {
|
|
3364
3364
|
flex: 0 0 auto;
|
|
3365
3365
|
margin-left: auto;
|
|
3366
|
-
padding-left:
|
|
3367
|
-
font-size: var(--aia-option-count-font-size,
|
|
3366
|
+
padding-left: 12px;
|
|
3367
|
+
font-size: var(--aia-option-count-font-size, 12px);
|
|
3368
3368
|
font-weight: 400;
|
|
3369
|
-
line-height:
|
|
3369
|
+
line-height: 21px; /* = the option's line-height */
|
|
3370
3370
|
font-variant-numeric: tabular-nums;
|
|
3371
3371
|
white-space: nowrap;
|
|
3372
3372
|
color: var(--aia-option-count-color, inherit);
|
|
@@ -3392,7 +3392,7 @@
|
|
|
3392
3392
|
(\`--aia-grid-max-height\`) does not cut the last row. Before the picture rule,
|
|
3393
3393
|
which wins when a group has both. */
|
|
3394
3394
|
[data-aia-group]:has(.aia-parameter-Dt2zF) {
|
|
3395
|
-
--aia-option-row-height: calc(
|
|
3395
|
+
--aia-option-row-height: calc(37px + 2 * var(--aia-option-padding-block, 8px));
|
|
3396
3396
|
}
|
|
3397
3397
|
|
|
3398
3398
|
/* A grid of picture rows is taller per row: the visible-rows cap
|
|
@@ -3401,9 +3401,9 @@
|
|
|
3401
3401
|
same number of rows shows before the list scrolls. */
|
|
3402
3402
|
[data-aia-group]:has(.aia-image-YZAbO) {
|
|
3403
3403
|
--aia-option-row-height: calc(
|
|
3404
|
-
var(--aia-option-image-size,
|
|
3404
|
+
var(--aia-option-image-size, 40px) +
|
|
3405
3405
|
2 *
|
|
3406
|
-
var(--aia-option-padding-block,
|
|
3406
|
+
var(--aia-option-padding-block, 8px)
|
|
3407
3407
|
);
|
|
3408
3408
|
}
|
|
3409
3409
|
|
|
@@ -3418,9 +3418,9 @@
|
|
|
3418
3418
|
display: flex;
|
|
3419
3419
|
flex: 1 1 auto;
|
|
3420
3420
|
align-items: center;
|
|
3421
|
-
gap: var(--aia-option-image-gap,
|
|
3421
|
+
gap: var(--aia-option-image-gap, 12px);
|
|
3422
3422
|
min-width: 0;
|
|
3423
|
-
min-height: var(--aia-option-image-size,
|
|
3423
|
+
min-height: var(--aia-option-image-size, 40px);
|
|
3424
3424
|
padding-left: 0;
|
|
3425
3425
|
text-indent: 0;
|
|
3426
3426
|
}
|
|
@@ -3428,8 +3428,8 @@
|
|
|
3428
3428
|
[data-aia-group]:has(.aia-image-YZAbO) .aia-content-T-Qba:not(:has(.aia-image-YZAbO)) .aia-icon-Qw938 {
|
|
3429
3429
|
flex: 0 0 auto;
|
|
3430
3430
|
justify-content: center;
|
|
3431
|
-
width: var(--aia-option-image-size,
|
|
3432
|
-
height: var(--aia-option-image-size,
|
|
3431
|
+
width: var(--aia-option-image-size, 40px);
|
|
3432
|
+
height: var(--aia-option-image-size, 40px);
|
|
3433
3433
|
margin-right: 0;
|
|
3434
3434
|
}
|
|
3435
3435
|
|
|
@@ -3451,7 +3451,7 @@
|
|
|
3451
3451
|
.aia-content-T-Qba:has(.aia-checkbox-KGRhg) {
|
|
3452
3452
|
display: flex;
|
|
3453
3453
|
align-items: center;
|
|
3454
|
-
gap:
|
|
3454
|
+
gap: 10px;
|
|
3455
3455
|
}
|
|
3456
3456
|
|
|
3457
3457
|
/* A checkbox row is a flex row, so its icon is a flex item beside the text,
|
|
@@ -3475,14 +3475,14 @@
|
|
|
3475
3475
|
/* The mark is text centred in the box. An indent inherited from the row
|
|
3476
3476
|
(an icon row hangs its text with one) would slide it out of the box. */
|
|
3477
3477
|
text-indent: 0;
|
|
3478
|
-
flex: 0 0
|
|
3479
|
-
width:
|
|
3480
|
-
height:
|
|
3478
|
+
flex: 0 0 18px;
|
|
3479
|
+
width: 18px;
|
|
3480
|
+
height: 18px;
|
|
3481
3481
|
border: 1px solid var(--aia-border);
|
|
3482
|
-
border-radius:
|
|
3482
|
+
border-radius: 6px;
|
|
3483
3483
|
background: var(--aia-surface);
|
|
3484
3484
|
color: transparent;
|
|
3485
|
-
font-size:
|
|
3485
|
+
font-size: 11px;
|
|
3486
3486
|
line-height: 1;
|
|
3487
3487
|
}
|
|
3488
3488
|
|
|
@@ -3567,7 +3567,7 @@
|
|
|
3567
3567
|
border-radius: 6px;
|
|
3568
3568
|
font-size: 11px;
|
|
3569
3569
|
}
|
|
3570
|
-
`,document.head.appendChild(e)}var
|
|
3570
|
+
`,document.head.appendChild(e)}var ce={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 pe=require("react/jsx-runtime");function dt({option:e,isHighlighted:t,checked:a,onSelect:i,onHighlight:o,onUnhighlight:s,id:r,loading:l,showIcon:v=!0,showImage:x=!0,showCount:k=!0,scrollHint:b,enterDelayMs:u=0}){let[p]=(0,Ce.useState)(u),[y,A]=(0,Ce.useState)(!1),ee=x?(0,me.optionImageSources)(e.image_url):[],H=ee[0]??null,[M,ue]=(0,Ce.useState)([]),P=ee.find(S=>!M.includes(S))??null,F=x?(e.imageCollage??[]).map(S=>(0,me.optionImageSources)(S)[0]).filter(S=>S!==void 0):[],[ae,q]=(0,Ce.useState)(!1),[ne,R]=(0,Ce.useState)(null),he=(0,Ce.useMemo)(()=>!H&&v&&e.icon_svg?(0,me.sanitizeOptionIconSvg)(e.icon_svg):null,[H,v,e.icon_svg]),j=k?(0,me.formatOptionCount)(e.item_count):null,U=(0,Ce.useRef)(void 0);(0,Ce.useEffect)(()=>()=>clearTimeout(U.current),[]);let re=S=>{if(l||!e.is_tappable||y&&a===void 0)return;A(!0);let Q=S?.currentTarget;a!==void 0&&Q!==void 0&&S!==void 0&&!(0,me.isMultiSelectToggleTap)(Q,Q.querySelector("[data-aia-checkbox]"),S)?i(e,{commit:!0}):i(e),clearTimeout(U.current),U.current=setTimeout(()=>A(!1),170)},xe=[ce.item,t&&!l?ce.highlighted:"",e.liveMatch&&!l?ce.liveMatch:"",e.is_tappable?ce.tappable:ce.nonTappable,y?ce.pressed:"",b?ce.scrollHint:""].filter(Boolean).join(" ");return(0,pe.jsx)("div",{id:r,role:"option","data-aia-option":"","data-aia-loading":l?"":void 0,"data-aia-icon":he&&e.icon?e.icon:void 0,"data-aia-image":H?"":void 0,"data-aia-item-count":j!==null?e.item_count:void 0,"aria-selected":a??t,className:xe,style:{[me.OPTION_ENTER_DELAY_VAR]:`${p}ms`},tabIndex:l||!e.is_tappable?-1:0,onClick:re,onKeyDown:S=>{!l&&e.is_tappable&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),re())},onMouseEnter:!l&&e.is_tappable?o:void 0,onMouseLeave:s,children:(0,pe.jsxs)("span",{className:ce.content,children:[a!==void 0&&e.is_tappable&&(0,pe.jsx)("span",{className:ce.checkbox,"aria-hidden":"true","data-aia-checkbox":"","data-checked":a,children:a?"\u2713":""}),H&&F.length>1&&(0,pe.jsx)("span",{className:`${ce.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-collage":F.length,"data-aia-image-loaded":ae?"":void 0,children:F.map(S=>(0,pe.jsx)("img",{src:S,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,onLoad:()=>q(!0),onError:Q=>{Q.currentTarget.hidden=!0}},S))}),H&&F.length<=1&&(0,pe.jsx)("span",{className:`${ce.image} magicx-aia-option-image`,"aria-hidden":"true","data-aia-image-loaded":P!==null&&ne===P?"":void 0,children:(0,pe.jsx)("img",{src:P??H,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",draggable:!1,hidden:P===null,onLoad:()=>R(P),onError:()=>{P!==null&&ue(S=>[...S,P])}})}),he&&(0,pe.jsx)("span",{className:`${ce.icon} magicx-aia-option-icon`,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:he}}),(0,pe.jsxs)("span",{className:ce.text,children:[e.matchedText?(0,me.highlightParts)((0,me.optionLabel)(e),e.matchedText).map((S,Q)=>S.bold?(0,pe.jsx)("strong",{className:`${ce.match} magicx-aia-option-match`,children:S.text},Q):S.text):(0,me.optionLabel)(e),e.parameterLabel&&(0,pe.jsxs)(pe.Fragment,{children:[" ",(0,pe.jsx)("span",{className:`${ce.parameter} magicx-aia-option-parameter`,children:e.parameterLabel})]})]}),e.tag&&(0,pe.jsx)("span",{className:ce.tag,children:e.tag}),j!==null&&(0,pe.jsx)("span",{className:`${ce.count} magicx-aia-option-count`,children:j})]})})}var Ha=require("react/jsx-runtime");function Yt(){let[e,t]=(0,Pe.useState)(X.isOptionsGridMobileViewport);return(0,Pe.useEffect)(()=>{if(typeof window>"u"||!window.matchMedia)return;let a=window.matchMedia(X.OPTIONS_GRID_MOBILE_QUERY),i=()=>t(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[]),e}function ct({options:e,activeIndex:t,picked:a,onSelect:i,onHighlight:o,onUnhighlight:s,listboxId:r,loading:l,groupKey:v="",optionsPosition:x="below",showIcons:k=!0,showImages:b=!0,showCounts:u=!0}){let p=Yt(),y=(0,Pe.useRef)(null),[A,ee]=(0,Pe.useState)(null),H=(0,Pe.useRef)(null);(0,Pe.useLayoutEffect)(()=>{if(l&&(0,X.sameOptionRows)(H.current,e))return;H.current=l?null:e;let P=y.current,F=P&&!l&&(0,X.needsOptionsGridMeasurement)(e.length,p),ae=P?.closest("[data-aia-dropdown]");F&&ae&&(0,X.releasePanelHug)(ae);let q=F?(0,X.measureOptionsGrid)(P):null;ee(q?(0,X.planOptionsGrid)(e.length,p,q.rowWidths,q.gridWidth):null)},[e,p,l]);let M=A??(0,X.planOptionsGrid)(e.length,p,null,null);(0,Pe.useLayoutEffect)(()=>{let P=y.current?.closest("[data-aia-dropdown]");P&&(0,X.syncPanelHug)(P)},[M.template,p]);let ue=(0,X.optionsShowLeadingVisuals)(e,k,b);return(0,Ha.jsx)(st,{min:"250px",max:"1fr",gap:"0",scroll:!0,scrollResetKey:v,template:M.template,maxHeight:M.maxHeight,innerRef:P=>{y.current=P},"data-aia-group":v,children:e.map((P,F)=>(0,Ha.jsx)(dt,{option:P,isHighlighted:F===t,checked:a?a.includes(P.text):void 0,onSelect:i,onHighlight:()=>o(F),onUnhighlight:s?()=>s(F):void 0,id:`${r}-option-${F}`,loading:l,showIcon:k&&ue,showImage:b&&ue,showCount:u,scrollHint:!l&&M.scrollHintIndices.includes(F),enterDelayMs:l?0:(0,X.optionEnterDelayMs)(F,M.cols,e.length,x)},`${v}\0${P.parameter??""}\0${P.text}`))})}var ge=require("@magicx-eng/ai-autocomplete-vanilla"),Ee=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) ---
|
|
3571
3571
|
|
|
3572
3572
|
One of three hand-maintained copies (vanilla styles.css, this file, Angular's
|
|
3573
3573
|
time-wheel.component.css). Only the class-naming layer differs \u2014 the
|
|
@@ -3689,7 +3689,7 @@
|
|
|
3689
3689
|
.aia-done-llNY5:hover {
|
|
3690
3690
|
background: var(--aia-time-done-bg-hover, var(--aia-done-bg-hover, #d8dde8));
|
|
3691
3691
|
}
|
|
3692
|
-
`,document.head.appendChild(e)}var
|
|
3692
|
+
`,document.head.appendChild(e)}var Ie={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 Se=require("react/jsx-runtime"),jt=120;function pt({view:e,label:t,doneLabel:a,interactive:i=!0,onTimeChange:o,onTimeCommit:s}){return(0,Se.jsxs)("div",{className:Ie.timeWheel,"data-aia-time-wheel":"",role:"group","aria-label":t,onMouseDown:r=>r.preventDefault(),children:[(0,Se.jsx)("span",{className:Ie.value,"data-aia-time-value":"","aria-live":"polite",children:(0,ge.formatTime)(e.minutes)}),(0,Se.jsxs)("div",{className:Ie.columns,"aria-hidden":"true",children:[(0,Se.jsx)("div",{className:Ie.band}),ge.TIME_WHEEL_COLUMNS.map(r=>(0,Se.jsxs)(Ee.Fragment,{children:[r==="minute"&&(0,Se.jsx)("span",{className:Ie.separator,children:":"}),(0,Se.jsx)($t,{column:r,minutes:e.minutes,interactive:i,onTimeChange:o})]},r))]}),(0,Se.jsx)("button",{type:"button",tabIndex:-1,className:Ie.done,"data-aia-time-done":"",onClick:()=>{i&&s()},children:a})]})}function $t({column:e,minutes:t,interactive:a,onTimeChange:i}){let o=(0,Ee.useRef)(null),s=(0,Ee.useRef)(null),r=(0,Ee.useRef)(null),l=(0,Ee.useRef)({minutes:t,interactive:a,onTimeChange:i});l.current={minutes:t,interactive:a,onTimeChange:i};let v=(0,ge.timeWheelIndex)(e,t);(0,Ee.useLayoutEffect)(()=>{let b=o.current;if(!b||r.current)return;let u=v*ge.TIME_WHEEL_ROW_HEIGHT;Math.abs(b.scrollTop-u)<1||(s.current=u,b.scrollTop=u)},[v]),(0,Ee.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let x=()=>{r.current=null;let b=o.current,u=l.current;if(!b||!u.interactive)return;let p=(0,ge.timeWheelIndexFromScroll)(e,b.scrollTop);p!==(0,ge.timeWheelIndex)(e,u.minutes)&&u.onTimeChange((0,ge.withTimeWheelIndex)(e,u.minutes,p))},k=()=>{let b=o.current;if(b){if(s.current!=null&&Math.abs(b.scrollTop-s.current)<1){s.current=null;return}s.current=null,r.current&&clearTimeout(r.current),r.current=setTimeout(x,jt)}};return(0,Se.jsx)("div",{ref:o,className:Ie.column,"data-aia-time-column":e,onScroll:k,children:(0,ge.timeWheelRows)(e).map((b,u)=>(0,Se.jsx)("div",{className:u===v?`${Ie.row} ${Ie.selected}`:Ie.row,"data-aia-time-row":"","data-aia-index":u,onClick:()=>{l.current.interactive&&i((0,ge.withTimeWheelIndex)(e,l.current.minutes,u))},children:b.label},b.label))})}if(typeof document<"u"&&!document.getElementById("ac-style-8414cd5f")){let e=document.createElement("style");e.id="ac-style-8414cd5f",e.textContent=`.aia-stack {
|
|
3693
3693
|
display: flex;
|
|
3694
3694
|
flex-direction: column;
|
|
3695
3695
|
gap: var(--aia-stack-space, 0.5rem);
|
|
@@ -3704,7 +3704,7 @@
|
|
|
3704
3704
|
align-items: end;
|
|
3705
3705
|
}
|
|
3706
3706
|
/* data-align="stretch" is the flex default \u2014 no rule needed. */
|
|
3707
|
-
`,document.head.appendChild(e)}var ut=require("react/jsx-runtime");function ht({space:e,align:t="stretch",className:a,children:i,...o}){let s=e?{"--aia-stack-space":e}:void 0;return(0,ut.jsx)("div",{className:a?`aia-stack ${a}`:"aia-stack","data-align":t,style:s,...o,children:i})}var _=require("react/jsx-runtime"),Zt=typeof window>"u"?J.useEffect:J.useLayoutEffect,Xt=[159,119,164],Jt=()=>{},mt=()=>{},ei=e=>{},ai=()=>{},ti=e=>{},ii=e=>{},oi=e=>{},ni=e=>{};function ri(e){let t=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[a,i]=(0,J.useState)(t);if((0,J.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>i(o.matches);return o.addEventListener("change",s),()=>o.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?a?"dark":"light":e}function si(e,t){let a=(0,J.useRef)(null);(0,J.useEffect)(()=>{let i=e.current,o=t.current;if(!i||!o)return;let s=(0,z.queryLive)(i,".aia-grid[data-scroll]");if(a.current&&a.current.grid!==s&&(a.current.controller.destroy(),a.current=null),s&&!a.current){a.current={grid:s,controller:(0,z.attachScrollArrow)({dropdown:i,grid:s,button:o})};return}a.current?.controller.update()}),(0,J.useEffect)(()=>()=>{a.current?.controller.destroy(),a.current=null},[])}function li(e,t){let a=(0,J.useRef)(t);a.current=t;let i=(0,J.useRef)(null);(0,J.useLayoutEffect)(()=>{let o=e.current;if(o){if(!i.current){i.current=(0,z.attachViewportFit)({dropdown:o,isOpen:()=>a.current});return}i.current.update()}}),(0,J.useEffect)(()=>()=>{i.current?.destroy(),i.current=null},[])}function
|
|
3707
|
+
`,document.head.appendChild(e)}var ut=require("react/jsx-runtime");function ht({space:e,align:t="stretch",className:a,children:i,...o}){let s=e?{"--aia-stack-space":e}:void 0;return(0,ut.jsx)("div",{className:a?`aia-stack ${a}`:"aia-stack","data-align":t,style:s,...o,children:i})}var _=require("react/jsx-runtime"),Zt=typeof window>"u"?J.useEffect:J.useLayoutEffect,Xt=[159,119,164],Jt=()=>{},mt=()=>{},ei=e=>{},ai=()=>{},ti=e=>{},ii=e=>{},oi=e=>{},ni=e=>{};function ri(e){let t=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[a,i]=(0,J.useState)(t);if((0,J.useEffect)(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>i(o.matches);return o.addEventListener("change",s),()=>o.removeEventListener("change",s)},[e]),e!==void 0)return e==="auto"?a?"dark":"light":e}function si(e,t){let a=(0,J.useRef)(null);(0,J.useEffect)(()=>{let i=e.current,o=t.current;if(!i||!o)return;let s=(0,z.queryLive)(i,".aia-grid[data-scroll]");if(a.current&&a.current.grid!==s&&(a.current.controller.destroy(),a.current=null),s&&!a.current){a.current={grid:s,controller:(0,z.attachScrollArrow)({dropdown:i,grid:s,button:o})};return}a.current?.controller.update()}),(0,J.useEffect)(()=>()=>{a.current?.controller.destroy(),a.current=null},[])}function li(e,t){let a=(0,J.useRef)(t);a.current=t;let i=(0,J.useRef)(null);(0,J.useLayoutEffect)(()=>{let o=e.current;if(o){if(!i.current){i.current=(0,z.attachViewportFit)({dropdown:o,isOpen:()=>a.current});return}i.current.update()}}),(0,J.useEffect)(()=>()=>{i.current?.destroy(),i.current=null},[])}function Aa({suggestions:e,activeIndex:t,onSelect:a,onHighlight:i,onUnhighlight:o,isOpen:s,id:r,className:l,pills:v,onPillClick:x,showPills:k=!0,onSkip:b,showSkipButton:u=!0,showOptionIcons:p=!0,showOptionImages:y=!0,showOptionCounts:A=!0,skipDisabled:ee=!1,activeSelected:H=!1,isLoading:M=!1,skeletonExiting:ue=!1,isInputEmpty:P=!1,language:F,products:ae,onProductSelect:q,onProductAddToCart:ne,onProductFocusChange:R,productsLayout:he="row",productImageFallback:j="image",formatType:U="options",dateView:re=null,selectedDateIso:xe=null,selectedDateRange:S=null,dateRangeStart:Q=null,dateReferences:c,onPreviousMonth:T,onNextMonth:oa,timeView:He=null,multiSelectView:w=null,onMultiSelectCommit:na,onSeeAllResults:Be,fullWidth:je=!1,onTimeChange:$e,onTimeCommit:Ze,locationView:g=null,isReediting:C=!1,onLocationQuery:I,onLocationMove:O,onLocationCommit:N,onLocationFocusChange:se,isFocused:Te=!1,optionsPosition:fe="below",mode:Xe}){let We=ri(Xe),ra=We!==void 0,le=(0,J.useRef)(null),Ge=(0,J.useRef)(null);si(le,Ge),(0,J.useEffect)(()=>{if(le.current)return(0,z.containScroll)(le.current)},[]);let sa=e[0]?.options??[],fa=!!(v&&v.length>0&&x),Re=!!(ae&&ae.length>0),ha=U==="time"&&He!=null,Je=U==="location"&&g!=null,f=s&&(sa.length>0||k&&fa||M||Re||ha||Je);li(le,f),Zt(()=>{let L=le.current;L&&((0,z.fitMultiSelectDone)(L,(0,z.findMultiSelectDone)(L)),(0,z.syncPanelHug)(L))});let Ke={suggestions:e,activeIndex:t,pills:v,showPills:k,showSkipButton:u,showOptionIcons:p,showOptionImages:y,showOptionCounts:A,skipDisabled:ee,activeSelected:H,isLoading:M,skeletonExiting:ue,isInputEmpty:P,products:ae,formatType:U,dateView:re,selectedDateIso:xe,selectedDateRange:S,dateRangeStart:Q,dateReferences:c,timeView:He,multiSelectView:w,locationView:g,isReediting:C,showsSeeAll:!!Be},la=(0,J.useRef)(Ke);f&&(la.current=Ke);let n=f?Ke:la.current,m=(0,z.uiStringsFor)(F),qe=n.suggestions[0],_e=qe?.options??[],Oe=n.activeIndex>=0&&!!_e[n.activeIndex]?.is_tappable,Ve=(0,z.labelTraditionalAutocomplete)(n.pills??[],m.keepTyping),ea=!!(Ve.length>0&&x),Le=n.showPills&&ea,ba=n.showPills&&!ea&&n.isLoading,Ue=Le||ba,ze=ea&&(0,z.hasSkippablePill)(Ve)&&n.showSkipButton&&!n.isInputEmpty&&!!b,aa=Ve[0]?.text,da=(0,z.isCalendarFormat)(n.formatType)&&n.dateView!=null,ua=_e.length>0&&!da,Qe=_e.length>0&&da&&!n.isLoading,ca=n.formatType==="time"&&n.timeView!=null&&!n.isLoading,h=n.formatType==="location"&&n.locationView!=null&&!n.isLoading,$=n.isLoading&&!ua&&!Qe&&!ca&&!h,B=n.products??[],ma=(0,z.panelMorphKey)(Le?Ve:[]);return(0,J.useLayoutEffect)(()=>{le.current&&(0,z.settlePanelMorph)(le.current,ma,{visible:f,anchorBottom:fe==="above"})},[ma,f,fe,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,he,F]),(0,J.useEffect)(()=>{let L=le.current;return()=>{L&&(0,z.destroyPanelMorph)(L)}},[]),(0,_.jsxs)("div",{ref:le,id:r,role:"listbox","aria-multiselectable":!!n.multiSelectView,"data-aia-dropdown":"","data-options-position":fe,"data-mode":We,"data-aia-loading":n.isLoading?"":void 0,"data-aia-skeleton-exiting":n.skeletonExiting?"":void 0,"data-aia-has-products":B.length>0?"":void 0,"data-aia-full-width":je?"":void 0,className:`${ra?"magicx-aia ":""}${ye.dropdown} ${f?ye.visible:""} ${l??""}`,onMouseDown:L=>L.preventDefault(),children:[(0,_.jsxs)(ht,{space:"8px",children:[(Ue||ze)&&(0,_.jsxs)(xa,{noWrap:!0,className:ye.pillBar,"data-aia-pillbar":"",children:[Ue&&(0,_.jsx)("span",{className:ye.pillScroll,"data-aia-pill-scroll":"",children:(0,_.jsx)(Ia,{pills:Ve,activePillIndex:0,activeSelected:n.activeSelected,onSelectPill:x??(()=>{}),rounded:!0,loading:n.isLoading})}),ze&&(0,_.jsx)("button",{type:"button",tabIndex:-1,className:ye.skip,"data-aia-skip":"",disabled:n.isLoading||n.skipDisabled,"aria-label":aa?`${m.skipLabel} ${aa}`:m.skipLabel,onClick:b,children:m.skip})]}),ua&&(0,_.jsx)(ct,{options:_e,activeIndex:n.activeIndex,onSelect:a,onHighlight:i,onUnhighlight:o,listboxId:r,loading:n.isLoading,groupKey:qe?`${qe.parameter} ${qe.text}`:"",optionsPosition:fe,showIcons:n.showOptionIcons,showImages:n.showOptionImages,showCounts:n.showOptionCounts,picked:n.multiSelectView?.picked}),n.multiSelectView&&(0,_.jsx)("div",{"data-aia-multi-actions":"",onClick:L=>{L.target.closest("[data-aia-multi-done]")&&!n.skipDisabled&&!n.isLoading&&na?.()},children:(0,_.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-multi-done":"",className:ye.multiDone,ref:L=>{L&&(L.disabled=!0,L.offsetHeight,L.disabled=n.skipDisabled||n.isLoading)},children:m.done})}),Qe&&n.dateView&&(0,_.jsx)($a,{options:_e,activeIndex:n.activeIndex,listboxId:r,view:n.dateView,selection:{selectedIso:n.selectedDateIso??null,selectedRange:n.selectedDateRange??null,rangeStart:n.dateRangeStart??null,floor:(0,z.dateFloorFor)(n.formatType,n.dateRangeStart),references:n.dateReferences??[]},onSelect:a,onHighlight:i,onUnhighlight:o,onPreviousMonth:T??mt,onNextMonth:oa??mt}),ca&&n.timeView&&(0,_.jsx)(pt,{view:n.timeView,label:m.timeLabel,doneLabel:m.done,interactive:!n.skipDisabled,onTimeChange:$e??ei,onTimeCommit:Ze??ai}),h&&n.locationView&&(0,_.jsx)(at,{view:n.locationView,searchLabel:m.locationSearch,noResultsLabel:m.locationNoResults,useTypedLabel:m.locationUseTyped,widgetFocused:Te&&f,reediting:n.isReediting,visible:f,interactive:!n.skipDisabled,onQuery:I??ti,onMove:O??ii,onCommit:N??oi,onFocusChange:se??ni}),$&&(0,_.jsx)("div",{className:ye.skeletonBars,"data-aia-skeleton-bars":"",children:Xt.map(L=>(0,_.jsx)("span",{className:ye.skeletonBar,style:{width:L}},`bar-${L}`))}),(0,_.jsx)(nt,{products:B,listboxId:r,onSelect:q??Jt,onAddToCart:ne,onFocusChange:R,focusable:f&&!n.isLoading,loading:n.isLoading,layout:he,imageFallback:j,strings:m}),n.showsSeeAll&&(0,_.jsx)("div",{className:ye.seeAllRow,"data-aia-see-all":"",onClick:L=>{L.target.closest("[data-aia-see-all-button]")&&(L.stopPropagation(),!n.isLoading&&Be?.())},children:(0,_.jsx)("button",{type:"button",tabIndex:-1,disabled:!0,"data-aia-see-all-button":"",className:ye.seeAll,ref:L=>{L&&(L.disabled=!0,L.offsetHeight,L.disabled=n.isLoading)},children:m.seeAllResults})}),(0,_.jsx)(Za,{isOptionHighlighted:Oe,isInputEmpty:n.isInputEmpty,strings:m})]}),(0,_.jsx)("button",{ref:Ge,type:"button",tabIndex:-1,className:ye.scrollArrow,"data-aia-scroll-arrow":"","aria-label":m.scrollArrow,"aria-hidden":"true",children:(0,_.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,_.jsx)("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}var Fe=require("@magicx-eng/ai-autocomplete-vanilla");var ft=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 {
|
|
3708
3708
|
flex-shrink: 0;
|
|
3709
3709
|
width: 32px;
|
|
3710
3710
|
height: 32px;
|
|
@@ -3775,5 +3775,5 @@
|
|
|
3775
3775
|
transition: none;
|
|
3776
3776
|
}
|
|
3777
3777
|
}
|
|
3778
|
-
`,document.head.appendChild(e)}var gt={submitButton:"aia-submitButton-otz7H"};var Aa=require("react/jsx-runtime");function bt({disabled:e,ready:t,onClick:a,label:i=(0,ft.uiStringsFor)().submit}){return(0,Aa.jsx)("button",{type:"button","data-aia-submit":"",className:gt.submitButton,disabled:e,"data-aia-ready":t?"":void 0,onClick:o=>{o.stopPropagation(),a()},"aria-label":i,children:(0,Aa.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":i,children:(0,Aa.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var Be=require("@magicx-eng/ai-autocomplete-vanilla"),E=require("react");var Ha=require("react");function wt(e){let t=(0,Ha.useRef)(e);t.current=e;let a=Object.keys(e??{}).sort().join("\0"),i=(0,Ha.useRef)({key:"",overrides:void 0});if(i.current.key!==a){let o={};for(let s of Object.keys(e??{})){let r=(l,b,v)=>{let k=t.current?.[s];return k?k(l,b,v):[]};o[s]=r}i.current={key:a,overrides:e?o:void 0}}return{overrides:i.current.overrides,key:a}}var Ba=require("react");function vt(e){let t=(0,Ba.useRef)(e);t.current=e;let a=(0,Ba.useRef)(null);a.current===null&&(a.current={fetch:(o,s)=>{let r=t.current;return r?r.fetch(o,s):Promise.reject(new Error("products config removed"))},transform:o=>t.current?.transform(o)??[],get limit(){return t.current?.limit}});let i=e!==void 0;return{config:i?a.current:void 0,enabled:i}}var xt={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],traditionalAutocomplete:!1,customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],dropdownLoading:!0,dropdownOptions:[],skeletonOptions:null,skeletonSuggestion:null,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,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 Ra({onSubmit:e,onResult:t,onError:a,optionOverrides:i,maskCompletedText:o,apiConfig:s,additionalContext:r,language:l,currency:b,productId:v,visitorId:k,columns:g=2,dropdownTrigger:u,optionsPosition:p,closeDropdownOnBlur:x,prependPlaceholder:A,allOption:ee,showNonTappableOptions:H,locationSearch:M,showOptionIcons:ue,showOptionImages:P,showOptionCounts:F,showSkipButton:ae,showProducts:q,productImageFallback:re="image",onFocus:R,onBlur:pe,value:$,completedParams:U,onChange:se,onParamsChange:Ce,products:S,mapProducts:Q,onProductSelect:c,onProductAddToCart:T,source:ia,setCursor:Ge}){let f=(0,E.useRef)(null),[oa,Ke]=(0,E.useState)(null),je=(0,E.useRef)(e);je.current=e;let $e=(0,E.useRef)(t);$e.current=t;let qe=(0,E.useRef)(a);qe.current=a;let m=(0,E.useRef)(se);m.current=se;let C=(0,E.useRef)(Ce);C.current=Ce;let I=(0,E.useRef)(R);I.current=R;let O=(0,E.useRef)(pe);O.current=pe;let N=(0,E.useRef)(Ge);N.current=Ge;let he=(0,E.useRef)(c);he.current=c;let we=(0,E.useRef)(T);we.current=T;let Ee=(0,E.useRef)(k);Ee.current=k;let _e=(0,E.useRef)(()=>{let h=Ee.current;return typeof h=="function"?h():h}).current,Ze=vt(S),be=(0,E.useRef)(Q);be.current=Q;let Ae=(0,E.useRef)((h,Y)=>{let B=be.current;return B?B(h,Y):h}).current,Xe=Q?Ae:void 0,na=wt(i);(0,E.useEffect)(()=>{if(typeof document>"u")return;let h=new Be.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:l,currency:b,productId:v,visitorId:_e,optionOverrides:na.overrides,maskCompletedText:o,columns:g,dropdownTrigger:u,optionsPosition:p,closeDropdownOnBlur:x,prependPlaceholder:A,allOption:ee,showNonTappableOptions:H,locationSearch:M,showProducts:q,source:ia,value:$,completedParams:U,onSubmit:(...B)=>je.current?.(...B),onResult:(...B)=>$e.current?.(...B),onError:(...B)=>qe.current?.(...B),onChange:(...B)=>m.current?.(...B),onParamsChange:(...B)=>C.current?.(...B),onFocus:()=>I.current?.(),onBlur:()=>O.current?.(),onProductSelect:B=>he.current?.(B),onProductAddToCart:B=>we.current?.(B),setCursor:B=>N.current?.(B),products:Ze.config,mapProducts:Xe});f.current=h,Ke(h.getState());let Y=h.subscribe(B=>Ke(B));return()=>{Y(),h.destroy(),f.current===h&&(f.current=null)}},[]),(0,E.useEffect)(()=>{$!==void 0&&f.current?.setValue($)},[$]),(0,E.useEffect)(()=>{U!==void 0&&f.current?.setCompletedParams(U)},[U]);let ga=JSON.stringify(s??null),De;try{De=JSON.stringify(r??null)}catch{De="[unstringifiable]"}(0,E.useEffect)(()=>{f.current?.update({apiConfig:s,additionalContext:r,language:l,currency:b,productId:v,optionOverrides:na.overrides,dropdownTrigger:u,optionsPosition:p,closeDropdownOnBlur:x,prependPlaceholder:A,allOption:ee,showNonTappableOptions:H,locationSearch:M,showProducts:q})},[ga,De,l,b?.code,b?.rate,b?.country,v,na.key,u,p,x,A,ee,H,M,q]);let pa=(0,E.useRef)(!1);(0,E.useEffect)(()=>{if(!pa.current){pa.current=!0;return}f.current?.update({products:Ze.config})},[Ze.enabled]),(0,E.useEffect)(()=>{f.current?.update({mapProducts:Xe})},[Xe]);let me=(0,E.useRef)(null);me.current===null&&(me.current={handleTextChange:h=>f.current?.handleTextChange(h),handleKeyDown:h=>{let Y="nativeEvent"in h?h.nativeEvent:h;f.current?.handleKeyDown(Y)},setFocused:h=>f.current?.setFocused(h),startEditingParam:h=>f.current?.startEditingParam(h),removeParam:h=>f.current?.removeParam(h)??!1,exitEditMode:()=>f.current?.exitEditMode(),handleCaretAfterInput:h=>f.current?.handleCaretAfterInput(h),handleCaretMove:h=>f.current?.handleCaretMove(h),replaceEditingRange:h=>f.current?.replaceEditingRange(h)??!1,setActivePill:h=>f.current?.setActivePill(h),skipActivePill:()=>f.current?.skipActivePill(),removeLastParam:()=>f.current?.removeLastParam(),clearNewParamId:()=>f.current?.clearNewParamId(),reset:()=>f.current?.reset(),refreshProducts:()=>f.current?.refreshProducts(),prepareSubmit:()=>f.current?.prepareSubmit(),getState:()=>f.current?.getState()??xt,recordSubmit:h=>f.current?.recordSubmit(h),selectOption:(h,Y)=>f.current?.selectOption(h,Y),selectProduct:h=>f.current?.selectProduct(h),addProductToCart:h=>{let Y=f.current;return!Y||!we.current?Promise.resolve():Y.addProductToCart(h)},setActiveDropdownIndex:h=>f.current?.setActiveDropdownIndex(h),clearHighlight:h=>f.current?.clearHighlight(h),showPreviousMonth:()=>f.current?.showPreviousMonth(),showNextMonth:()=>f.current?.showNextMonth(),setTime:h=>f.current?.setTime(h),commitTime:()=>f.current?.commitTime(),toggleMultiSelectOption:h=>f.current?.toggleMultiSelectOption(h),commitMultiSelect:()=>f.current?.commitMultiSelect(),setLocationQuery:h=>f.current?.setLocationQuery(h),moveLocationHighlight:h=>f.current?.moveLocationHighlight(h),commitLocation:h=>f.current?.commitLocation(h),setLocationFieldFocused:h=>f.current?.setLocationFieldFocused(h),handleFocus:()=>f.current?.setFocused(!0),handleBlur:()=>f.current?.setFocused(!1)});let y=me.current,Je=(0,E.useCallback)(h=>{let Y=h.target.value,L=Y.length>0&&!h.nativeEvent?.isComposing&&Y[0]!==Y[0].toUpperCase()?Y[0].toUpperCase()+Y.slice(1):Y;f.current?.handleTextChange(L)},[]),n=(0,E.useCallback)(h=>{f.current?.handleKeyDown(h.nativeEvent)},[]),te=f.current,w=oa??xt,Me=$!==void 0?$:w.text,fa=U!==void 0?U:w.completedParams,ve=w.actionableSuggestions,ra=ve[0],sa=(0,E.useMemo)(()=>(0,Be.withoutTraditionalAutocomplete)(ve),[ve]),Ve=te?.listboxId??"",ha=w.activeDropdownIndex>=0&&te?`${Ve}-option-${w.activeDropdownIndex}`:void 0,Ue=w.editingParam,Ne=w.editingIdentified,ea=Ue?(0,Be.editingSuggestion)(Ue):Ne?{parameter:Ne.parameter,text:(0,Be.identifiedParamLabel)(Ne.parameter),required:!0,options:[]}:null,la=w.dropdownSuggestion??ea??ra,ua=ea?[ea]:ve,Qe=(0,Be.dateSelectionFor)(w),da=!te||w.dropdownLoading;return{completedParams:fa,multiSelectView:w.multiSelectView,toggleMultiSelectOption:y.toggleMultiSelectOption,commitMultiSelect:y.commitMultiSelect,skippedParams:w.skippedParams,identifiedParams:w.identifiedParams,suggestionPills:sa,setActivePill:y.setActivePill,skipActivePill:y.skipActivePill,removeLastParam:y.removeLastParam,segments:w.segments,newParamId:w.newParamId,clearNewParamId:y.clearNewParamId,suggestions:w.suggestions,activeIndex:w.activeDropdownIndex,isReady:w.isReady,isLoading:da,isFocused:w.isFocused,isDropdownOpen:w.isDropdownOpen,isActivePillSelected:w.isActivePillSelected,placeholderText:w.placeholderText,listboxId:Ve,error:w.error,products:w.products,customFields:w.customFields,selectProduct:y.selectProduct,addProductToCart:y.addProductToCart,handleTextChange:y.handleTextChange,handleKeyDown:y.handleKeyDown,setFocused:y.setFocused,editingParam:Ue,editingIdentified:Ne,editingAnchor:w.editingAnchor,caretOffset:w.caretOffset,startEditingParam:y.startEditingParam,removeParam:y.removeParam,exitEditMode:y.exitEditMode,handleCaretAfterInput:y.handleCaretAfterInput,handleCaretMove:y.handleCaretMove,replaceEditingRange:y.replaceEditingRange,inputProps:{value:Me,placeholder:w.placeholderText||void 0,onChange:Je,onKeyDown:n,onFocus:y.handleFocus,onBlur:y.handleBlur,role:"combobox","aria-expanded":w.isDropdownOpen,"aria-activedescendant":ha,"aria-autocomplete":"list","aria-controls":Ve},reset:y.reset,refreshProducts:y.refreshProducts,prepareSubmit:y.prepareSubmit,getState:y.getState,recordSubmit:y.recordSubmit,dropdownProps:{suggestions:la?[{...la,options:w.dropdownOptions}]:[],activeIndex:w.activeDropdownIndex,onSelect:y.selectOption,onHighlight:y.setActiveDropdownIndex,onUnhighlight:y.clearHighlight,isOpen:w.isDropdownOpen,id:Ve,pills:ua,activeSelected:w.isActivePillSelected,onPillClick:y.setActivePill,onSkip:y.skipActivePill,showSkipButton:(ae??!0)&&!Ue&&!Ne,showOptionIcons:ue??!0,showOptionImages:P??!0,showOptionCounts:F??!0,skipDisabled:w.inSelectionAnimation,isLoading:da,skeletonExiting:w.skeletonExiting,isInputEmpty:Me.trim().length===0,language:l,products:w.products,productImageFallback:re,onProductSelect:y.selectProduct,onProductAddToCart:T?y.addProductToCart:void 0,onProductFocusChange:y.setFocused,formatType:w.activeFormatType,dateView:w.dateView,selectedDateIso:Qe.selectedIso,selectedDateRange:Qe.selectedRange,dateRangeStart:Qe.rangeStart,dateReferences:Qe.references,onPreviousMonth:y.showPreviousMonth,onNextMonth:y.showNextMonth,timeView:w.timeView,multiSelectView:w.dropdownMultiSelect,onMultiSelectCommit:y.commitMultiSelect,onTimeChange:y.setTime,onTimeCommit:y.commitTime,locationView:w.locationView,isReediting:w.editingParam!=null,onLocationQuery:y.setLocationQuery,onLocationMove:y.moveLocationHighlight,onLocationCommit:y.commitLocation,onLocationFocusChange:y.setLocationFieldFocused,isFocused:w.isFocused||w.locationFieldFocused,optionsPosition:p??"below"}}}var V=require("@magicx-eng/ai-autocomplete-vanilla"),D=require("react"),Oa;function di(){if(Oa!==void 0)return Oa;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),Oa=e.contentEditable==="plaintext-only",Oa}function yt(e){let{segments:t,showChipIcons:a=!0,showChipImages:i=!0,showChipRemove:o=!1,removeParam:s,newParamId:r,editingParam:l,editingIdentified:b,editingAnchor:v,caretOffset:k,placeholderText:g,hintSuggestions:u,isFocused:p,isDropdownOpen:x,listboxId:A,activeDescendantId:ee,autoFocus:H,handleTextChange:M,handleKeyDown:ue,handleCaretAfterInput:P,handleCaretMove:F,startEditingParam:ae,replaceEditingRange:q,setFocused:re}=e,R=(0,D.useRef)(null),pe=(0,D.useRef)(!1),$=(0,D.useRef)(""),U=(0,D.useRef)(""),se=(0,D.useRef)(null),Ce=(0,D.useRef)(0);se.current=k,(0,D.useEffect)(()=>{if(!H)return;let m=R.current;if(!m)return;document.activeElement===m?re(!0):m.focus();let C=m.ownerDocument??document,I=C.getSelection(),O=I&&I.rangeCount>0&&m.contains(I.anchorNode);if(I&&!O){let N=C.createRange();N.selectNodeContents(m),N.collapse(!0),I.removeAllRanges(),I.addRange(N)}},[H,re]),(0,D.useEffect)(()=>{let m=R.current;if(!m)return;let C=m.ownerDocument??document,I=()=>{let O=C.getSelection();if(!O||O.rangeCount===0||!O.anchorNode||!m.contains(O.anchorNode))return;let N=O.anchorNode,he=N.nodeType===Node.ELEMENT_NODE?N:N.parentElement,Ee=(O.isCollapsed?he?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,_e=l?.id??b?.id??null;if(Ee&&Ee!==_e){ae(Ee);return}performance.now()-Ce.current<50||F((0,V.getCursorOffset)(m))};return C.addEventListener("selectionchange",I),()=>C.removeEventListener("selectionchange",I)},[l,b,ae,F]),(0,D.useEffect)(()=>{let m=R.current;if(!m)return;let C=I=>{let O=(0,V.chipIdFromTap)(m,I.target);O&&(ae(O),(0,V.keepCaretOnChip)(m,O))};return m.addEventListener("click",C),()=>m.removeEventListener("click",C)},[ae]),(0,D.useEffect)(()=>{let m=R.current;if(!(!m||!s||!o))return(0,V.attachChipRemove)(m,s)},[s,o]),(0,D.useLayoutEffect)(()=>{let m=R.current;m&&(0,V.renderEditableContent)({input:m,segments:t,newParamId:r,editingParamId:l?.id??null,placeholderText:g??"",isFocused:p,showChipIcons:a,showChipImages:i,showChipRemove:o,hintOptions:(0,V.startingHintOptions)(u??[])})},[t,r,l,g,u,p,a,i,o]),(0,D.useEffect)(()=>{let m=R.current;return()=>{m&&(0,V.cancelStartingHint)(m)}},[]),(0,D.useLayoutEffect)(()=>{let m=$.current,C=r??"";if($.current=C,!C||C===m)return;let I=R.current;if(!I)return;I.focus();let O=se.current??(0,V.plainTextLength)(I);(0,V.setCursorOffset)(I,O)},[r]),(0,D.useLayoutEffect)(()=>{let m=U.current,C=l?.id??"";if(U.current=C,!C||C===m||v==null)return;let I=R.current;I&&(0,V.setCursorOffset)(I,v)},[l,v]);let S=(0,D.useCallback)(()=>{if(pe.current)return;let m=R.current;if(!m)return;let C=(0,V.extractPlainText)(m),O=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;M(O)},[M]),Q=(0,D.useCallback)(()=>{Ce.current=performance.now(),S();let m=R.current;m&&P((0,V.getCursorOffset)(m))},[S,P]);(0,D.useEffect)(()=>{let m=R.current;if(!m)return;let C=I=>{let O=I,N=O.inputType;if(N==="insertParagraph"||N==="insertLineBreak"||N==="insertFromDrop"){I.preventDefault();return}if(N.startsWith("insert")||N.startsWith("delete")){let he=N.startsWith("delete")?"":O.data??"";q(he)&&I.preventDefault()}};return m.addEventListener("beforeinput",C),()=>m.removeEventListener("beforeinput",C)},[q]);let c=(0,D.useCallback)(()=>{pe.current=!0,R.current?.setAttribute("data-aia-composing","true")},[]),T=(0,D.useCallback)(()=>{pe.current=!1,R.current?.removeAttribute("data-aia-composing"),S()},[S]),ia=(0,D.useCallback)(m=>{m.preventDefault();let C=R.current;if(!C)return;let I=(m.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!I)return;let O=C.ownerDocument??document,N=O.getSelection();if(!N||N.rangeCount===0)return;let he=N.getRangeAt(0);if(!C.contains(he.startContainer))return;he.deleteContents();let we=O.createTextNode(I);he.insertNode(we),he.setStartAfter(we),he.collapse(!0),N.removeAllRanges(),N.addRange(he),S()},[S]),Ge=(0,D.useCallback)(m=>ue(m),[ue]),f=(0,D.useCallback)(()=>re(!0),[re]),oa=(0,D.useCallback)(()=>re(!1),[re]),Ke=(0,D.useCallback)(()=>R.current?.focus(),[]),je=(0,D.useCallback)(()=>R.current?.blur(),[]),$e=(0,D.useCallback)(()=>{let m=R.current;return m?(0,V.extractPlainText)(m):""},[]),qe=di()?"plaintext-only":"true";return{inputRef:R,editorProps:{ref:R,contentEditable:qe,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":A,"aria-expanded":x,"aria-activedescendant":ee,spellCheck:!0,enterKeyHint:"send",onInput:Q,onKeyDown:Ge,onCompositionStart:c,onCompositionEnd:T,onPaste:ia,onFocus:f,onBlur:oa},getPlainText:$e,focus:Ke,blur:je}}var ze=require("react/jsx-runtime");function ci(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var kt=(0,j.forwardRef)(function({onSubmit:t,onResult:a,onError:i,optionOverrides:o,maskCompletedText:s,className:r,apiConfig:l,additionalContext:b,language:v,currency:k,productId:g,visitorId:u,columns:p,pillPlacement:x="dropdown",mode:A="auto",optionsPosition:ee="below",animations:H=!0,optionsStyle:M="floating",dropdownTrigger:ue,closeDropdownOnBlur:P,prependPlaceholder:F,allOption:ae,showNonTappableOptions:q,locationSearch:re,showOptionIcons:R=!0,showChipIcons:pe=!0,showChipImages:$=!0,showChipRemove:U=!1,showOptionImages:se=!0,showOptionCounts:Ce=!0,showSkipButton:S,showProducts:Q,productsLayout:c,productImageFallback:T,autoFocus:ia=!0,onFocus:Ge,onBlur:f,value:oa,completedParams:Ke,onChange:je,onParamsChange:$e,products:qe,mapProducts:m,onProductSelect:C,onProductAddToCart:I,submitButton:O,resetOnSubmit:N=!0,seeAllResults:he=!1},we){let Ee=(0,j.useRef)(null),_e=(0,j.useRef)(null),Ze=(0,j.useRef)(null),be=(0,j.useRef)(()=>{}),Ae=(0,j.useRef)(null),Xe=(0,j.useRef)(null);(0,j.useEffect)(()=>{let W=Ee.current;if(W)return Ae.current?Ae.current.setMode(A):Ae.current=new We.ModeController(W,A),()=>{Ae.current?.destroy(),Ae.current=null}},[A]);let na=(0,j.useCallback)(W=>{let xe=Xe.current?.current;xe&&(xe.focus(),(0,We.setCursorOffset)(xe,W))},[]),{completedParams:ga,suggestionPills:De,setActivePill:pa,skipActivePill:me,segments:y,newParamId:Je,clearNewParamId:n,placeholderText:te,isFocused:w,isDropdownOpen:Me,isActivePillSelected:fa,isLoading:ve,isReady:ra,activeIndex:sa,listboxId:Ve,handleTextChange:ha,handleKeyDown:Ue,setFocused:Ne,editingParam:ea,editingIdentified:la,editingAnchor:ua,caretOffset:Qe,startEditingParam:da,removeParam:h,handleCaretAfterInput:Y,handleCaretMove:B,replaceEditingRange:L,dropdownProps:Wa,reset:ka,refreshProducts:Ga,prepareSubmit:Ka,getState:qa,recordSubmit:_a}=Ra({onSubmit:W=>be.current(W),onResult:a,onError:i,optionOverrides:o,maskCompletedText:s,apiConfig:l,additionalContext:b,language:v,currency:k,productId:g,visitorId:u,columns:p,dropdownTrigger:ue,optionsPosition:ee,closeDropdownOnBlur:P,prependPlaceholder:F,allOption:ae,showNonTappableOptions:q,locationSearch:re,showOptionIcons:R,showOptionImages:se,showOptionCounts:Ce,showSkipButton:S,showProducts:Q,onFocus:Ge,onBlur:f,value:oa,completedParams:Ke,onChange:je,onParamsChange:$e,products:qe,mapProducts:m,onProductSelect:C,onProductAddToCart:I,source:"full-sdk",setCursor:na});(0,j.useEffect)(()=>{if(!Je)return;let W=window.setTimeout(()=>n(),650);return()=>window.clearTimeout(W)},[Je,n]);let Ct=sa>=0?`${Ve}-option-${sa}`:void 0,{inputRef:La,editorProps:St,focus:Ca,blur:Va,getPlainText:Ua}=yt({segments:y,newParamId:Je,editingParam:ea,editingIdentified:la,editingAnchor:ua,caretOffset:Qe,placeholderText:te,hintSuggestions:x==="inline"?[]:De,isFocused:w,showChipIcons:pe,showChipImages:$,showChipRemove:U,removeParam:h,isDropdownOpen:Me,listboxId:Ve,activeDescendantId:Ct,autoFocus:ia,handleTextChange:ha,handleKeyDown:Ue,handleCaretAfterInput:Y,handleCaretMove:B,startEditingParam:da,replaceEditingRange:L,setFocused:Ne});Xe.current=La,(0,j.useLayoutEffect)(()=>{let W=_e.current,xe=La.current;if(!W||!xe)return;let wa=()=>{let Ya=W.firstElementChild;if(!Ya)return;let Rt=Ya.getBoundingClientRect(),Ot=xe.getBoundingClientRect();Rt.top>=Ot.bottom-2?W.setAttribute("data-aia-pill-wrapped",""):W.removeAttribute("data-aia-pill-wrapped")};wa();let Qa=new ResizeObserver(wa);return Qa.observe(xe),()=>Qa.disconnect()},[y,De.length,ve,La]),(0,j.useEffect)(()=>{let W=Ze.current;if(W)return(0,We.watchEditorHeight)(W)},[]),(0,j.useImperativeHandle)(we,()=>({focus:Ca,blur:Va,reset:ka,refreshProducts:Ga,setMode:W=>Ae.current?.setMode(W),skipActivePill:me}),[Ca,Va,ka,Ga,me]);let ma=!!y.length||ga.length>0,ba=(0,j.useCallback)(W=>{if(!ma)return;W&&Ka();let xe=qa(),wa=(0,We.buildSubmitResult)(Ua(),xe.completedParams,xe.skippedParams,{identifiedParams:xe.identifiedParams,isReady:xe.isReady,customFields:xe.customFields});W&&_a(wa),t(wa),N&&ka()},[_a,N,ma,Ka,qa,t,ka,Ua]);be.current=()=>ba(!1);let Tt=he&&!Wa.isInputEmpty&&ma,Pt=(0,j.useCallback)(()=>ba(!0),[ba]),It=(0,j.useCallback)(W=>{W.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||Ca()},[Ca]),Et=x==="inline",At=x==="dropdown";return(0,ze.jsxs)("div",{ref:Ee,className:`magicx-aia ${ca.container} ${r??""}`,"data-pill-placement":x,"data-options-position":ee,"data-animations":H?"on":"off","data-aia-options-style":M,"data-mode":ci(A),children:[(0,ze.jsx)(Ea,{...Wa,showPills:At,productsLayout:c,productImageFallback:T,onSeeAllResults:Tt?Pt:void 0}),(0,ze.jsxs)("div",{className:ca.inputWrapper,"data-aia-input-wrapper":"",onClick:It,children:[(0,ze.jsxs)("div",{ref:Ze,className:ca.editorArea,"data-aia-editor":"",children:[(0,ze.jsx)("div",{...St,className:ca.input,"data-aia-input":""}),Et&&(ve||De.length>0)&&(0,ze.jsx)("span",{ref:_e,className:ca.pillListContainer,"data-aia-pill-list-container":"",children:(0,ze.jsx)(Pa,{pills:De,activePillIndex:0,activeSelected:fa,onSelectPill:pa,loading:ve})})]}),O===null?null:O===void 0?(0,ze.jsx)(bt,{disabled:!ma,ready:ma&&ra,onClick:()=>ba(!0),label:(0,We.uiStringsFor)(v).submit}):(0,ze.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:ca.submitSlot,onClick:W=>{ma&&(W.stopPropagation(),ba(!0))},children:O})]})]})});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});
|
|
3778
|
+
`,document.head.appendChild(e)}var gt={submitButton:"aia-submitButton-otz7H"};var Ra=require("react/jsx-runtime");function bt({disabled:e,ready:t,onClick:a,label:i=(0,ft.uiStringsFor)().submit}){return(0,Ra.jsx)("button",{type:"button","data-aia-submit":"",className:gt.submitButton,disabled:e,"data-aia-ready":t?"":void 0,onClick:o=>{o.stopPropagation(),a()},"aria-label":i,children:(0,Ra.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",role:"img","aria-label":i,children:(0,Ra.jsx)("path",{d:"M9 14V4M9 4L4 9M9 4L14 9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}var Ne=require("@magicx-eng/ai-autocomplete-vanilla"),E=require("react");var Ba=require("react");function wt(e){let t=(0,Ba.useRef)(e);t.current=e;let a=Object.keys(e??{}).sort().join("\0"),i=(0,Ba.useRef)({key:"",overrides:void 0});if(i.current.key!==a){let o={};for(let s of Object.keys(e??{})){let r=(l,v,x)=>{let k=t.current?.[s];return k?k(l,v,x):[]};o[s]=r}i.current={key:a,overrides:e?o:void 0}}return{overrides:i.current.overrides,key:a}}var Wa=require("react");function vt(e){let t=(0,Wa.useRef)(e);t.current=e;let a=(0,Wa.useRef)(null);a.current===null&&(a.current={fetch:(o,s)=>{let r=t.current;return r?r.fetch(o,s):Promise.reject(new Error("products config removed"))},transform:o=>t.current?.transform(o)??[],get limit(){return t.current?.limit}});let i=e!==void 0;return{config:i?a.current:void 0,enabled:i}}var xt={text:"",completedParams:[],identifiedParams:[],skippedParams:[],pendingSpan:null,suggestions:[],products:[],traditionalAutocomplete:!1,customFields:null,optionSearch:null,activeDropdownIndex:-1,newParamId:null,isLoading:!0,isReady:!1,error:null,segments:[],actionableSuggestions:[],filteredOptions:[],dropdownLoading:!0,dropdownOptions:[],skeletonOptions:null,skeletonSuggestion:null,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,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 Oa({onSubmit:e,onResult:t,onError:a,optionOverrides:i,maskCompletedText:o,apiConfig:s,additionalContext:r,language:l,currency:v,productId:x,visitorId:k,columns:b=2,dropdownTrigger:u,optionsPosition:p,closeDropdownOnBlur:y,prependPlaceholder:A,allOption:ee,showNonTappableOptions:H,locationSearch:M,showOptionIcons:ue,showOptionImages:P,showOptionCounts:F,showSkipButton:ae,showProducts:q,productImageFallback:ne="image",onFocus:R,onBlur:he,value:j,completedParams:U,onChange:re,onParamsChange:xe,products:S,mapProducts:Q,onProductSelect:c,onProductAddToCart:T,source:oa,setCursor:He}){let w=(0,E.useRef)(null),[na,Be]=(0,E.useState)(null),je=(0,E.useRef)(e);je.current=e;let $e=(0,E.useRef)(t);$e.current=t;let Ze=(0,E.useRef)(a);Ze.current=a;let g=(0,E.useRef)(re);g.current=re;let C=(0,E.useRef)(xe);C.current=xe;let I=(0,E.useRef)(R);I.current=R;let O=(0,E.useRef)(he);O.current=he;let N=(0,E.useRef)(He);N.current=He;let se=(0,E.useRef)(c);se.current=c;let Te=(0,E.useRef)(T);Te.current=T;let fe=(0,E.useRef)(k);fe.current=k;let Xe=(0,E.useRef)(()=>{let h=fe.current;return typeof h=="function"?h():h}).current,We=vt(S),ra=(0,E.useRef)(Q);ra.current=Q;let le=(0,E.useRef)((h,$)=>{let B=ra.current;return B?B(h,$):h}).current,Ge=Q?le:void 0,sa=wt(i);(0,E.useEffect)(()=>{if(typeof document>"u")return;let h=new Ne.AIAutocomplete(document.createElement("div"),{renderMode:"headless",apiConfig:s,additionalContext:r,language:l,currency:v,productId:x,visitorId:Xe,optionOverrides:sa.overrides,maskCompletedText:o,columns:b,dropdownTrigger:u,optionsPosition:p,closeDropdownOnBlur:y,prependPlaceholder:A,allOption:ee,showNonTappableOptions:H,locationSearch:M,showProducts:q,source:oa,value:j,completedParams:U,onSubmit:(...B)=>je.current?.(...B),onResult:(...B)=>$e.current?.(...B),onError:(...B)=>Ze.current?.(...B),onChange:(...B)=>g.current?.(...B),onParamsChange:(...B)=>C.current?.(...B),onFocus:()=>I.current?.(),onBlur:()=>O.current?.(),onProductSelect:B=>se.current?.(B),onProductAddToCart:B=>Te.current?.(B),setCursor:B=>N.current?.(B),products:We.config,mapProducts:Ge});w.current=h,Be(h.getState());let $=h.subscribe(B=>Be(B));return()=>{$(),h.destroy(),w.current===h&&(w.current=null)}},[]),(0,E.useEffect)(()=>{j!==void 0&&w.current?.setValue(j)},[j]),(0,E.useEffect)(()=>{U!==void 0&&w.current?.setCompletedParams(U)},[U]);let fa=JSON.stringify(s??null),Re;try{Re=JSON.stringify(r??null)}catch{Re="[unstringifiable]"}(0,E.useEffect)(()=>{w.current?.update({apiConfig:s,additionalContext:r,language:l,currency:v,productId:x,optionOverrides:sa.overrides,dropdownTrigger:u,optionsPosition:p,closeDropdownOnBlur:y,prependPlaceholder:A,allOption:ee,showNonTappableOptions:H,locationSearch:M,showProducts:q})},[fa,Re,l,v?.code,v?.rate,v?.country,x,sa.key,u,p,y,A,ee,H,M,q]);let ha=(0,E.useRef)(!1);(0,E.useEffect)(()=>{if(!ha.current){ha.current=!0;return}w.current?.update({products:We.config})},[We.enabled]),(0,E.useEffect)(()=>{w.current?.update({mapProducts:Ge})},[Ge]);let Je=(0,E.useRef)(null);Je.current===null&&(Je.current={handleTextChange:h=>w.current?.handleTextChange(h),handleKeyDown:h=>{let $="nativeEvent"in h?h.nativeEvent:h;w.current?.handleKeyDown($)},setFocused:h=>w.current?.setFocused(h),startEditingParam:h=>w.current?.startEditingParam(h),removeParam:h=>w.current?.removeParam(h)??!1,exitEditMode:()=>w.current?.exitEditMode(),handleCaretAfterInput:h=>w.current?.handleCaretAfterInput(h),handleCaretMove:h=>w.current?.handleCaretMove(h),replaceEditingRange:h=>w.current?.replaceEditingRange(h)??!1,setActivePill:h=>w.current?.setActivePill(h),skipActivePill:()=>w.current?.skipActivePill(),removeLastParam:()=>w.current?.removeLastParam(),clearNewParamId:()=>w.current?.clearNewParamId(),reset:()=>w.current?.reset(),refreshProducts:()=>w.current?.refreshProducts(),prepareSubmit:()=>w.current?.prepareSubmit(),getState:()=>w.current?.getState()??xt,recordSubmit:h=>w.current?.recordSubmit(h),selectOption:(h,$)=>w.current?.selectOption(h,$),selectProduct:h=>w.current?.selectProduct(h),addProductToCart:h=>{let $=w.current;return!$||!Te.current?Promise.resolve():$.addProductToCart(h)},setActiveDropdownIndex:h=>w.current?.setActiveDropdownIndex(h),clearHighlight:h=>w.current?.clearHighlight(h),showPreviousMonth:()=>w.current?.showPreviousMonth(),showNextMonth:()=>w.current?.showNextMonth(),setTime:h=>w.current?.setTime(h),commitTime:()=>w.current?.commitTime(),toggleMultiSelectOption:h=>w.current?.toggleMultiSelectOption(h),commitMultiSelect:()=>w.current?.commitMultiSelect(),setLocationQuery:h=>w.current?.setLocationQuery(h),moveLocationHighlight:h=>w.current?.moveLocationHighlight(h),commitLocation:h=>w.current?.commitLocation(h),setLocationFieldFocused:h=>w.current?.setLocationFieldFocused(h),handleFocus:()=>w.current?.setFocused(!0),handleBlur:()=>w.current?.setFocused(!1)});let f=Je.current,Ke=(0,E.useCallback)(h=>{let $=h.target.value,ma=$.length>0&&!h.nativeEvent?.isComposing&&$[0]!==$[0].toUpperCase()?$[0].toUpperCase()+$.slice(1):$;w.current?.handleTextChange(ma)},[]),la=(0,E.useCallback)(h=>{w.current?.handleKeyDown(h.nativeEvent)},[]),n=w.current,m=na??xt,qe=j!==void 0?j:m.text,_e=U!==void 0?U:m.completedParams,Oe=m.actionableSuggestions,Ve=Oe[0],ea=(0,E.useMemo)(()=>(0,Ne.withoutTraditionalAutocomplete)(Oe),[Oe]),Le=n?.listboxId??"",ba=m.activeDropdownIndex>=0&&n?`${Le}-option-${m.activeDropdownIndex}`:void 0,Ue=m.editingParam,ze=m.editingIdentified,aa=Ue?(0,Ne.editingSuggestion)(Ue):ze?{parameter:ze.parameter,text:(0,Ne.identifiedParamLabel)(ze.parameter),required:!0,options:[]}:null,da=m.dropdownSuggestion??aa??Ve,ua=aa?[aa]:Oe,Qe=(0,Ne.dateSelectionFor)(m),ca=!n||m.dropdownLoading;return{completedParams:_e,multiSelectView:m.multiSelectView,toggleMultiSelectOption:f.toggleMultiSelectOption,commitMultiSelect:f.commitMultiSelect,skippedParams:m.skippedParams,identifiedParams:m.identifiedParams,suggestionPills:ea,setActivePill:f.setActivePill,skipActivePill:f.skipActivePill,removeLastParam:f.removeLastParam,segments:m.segments,newParamId:m.newParamId,clearNewParamId:f.clearNewParamId,suggestions:m.suggestions,activeIndex:m.activeDropdownIndex,isReady:m.isReady,isLoading:ca,isFocused:m.isFocused,isDropdownOpen:m.isDropdownOpen,isActivePillSelected:m.isActivePillSelected,placeholderText:m.placeholderText,listboxId:Le,error:m.error,products:m.products,customFields:m.customFields,selectProduct:f.selectProduct,addProductToCart:f.addProductToCart,handleTextChange:f.handleTextChange,handleKeyDown:f.handleKeyDown,setFocused:f.setFocused,editingParam:Ue,editingIdentified:ze,editingAnchor:m.editingAnchor,caretOffset:m.caretOffset,startEditingParam:f.startEditingParam,removeParam:f.removeParam,exitEditMode:f.exitEditMode,handleCaretAfterInput:f.handleCaretAfterInput,handleCaretMove:f.handleCaretMove,replaceEditingRange:f.replaceEditingRange,inputProps:{value:qe,placeholder:m.placeholderText||void 0,onChange:Ke,onKeyDown:la,onFocus:f.handleFocus,onBlur:f.handleBlur,role:"combobox","aria-expanded":m.isDropdownOpen,"aria-activedescendant":ba,"aria-autocomplete":"list","aria-controls":Le},reset:f.reset,refreshProducts:f.refreshProducts,prepareSubmit:f.prepareSubmit,getState:f.getState,recordSubmit:f.recordSubmit,dropdownProps:{suggestions:da?[{...da,options:m.dropdownOptions}]:[],activeIndex:m.activeDropdownIndex,onSelect:f.selectOption,onHighlight:f.setActiveDropdownIndex,onUnhighlight:f.clearHighlight,isOpen:m.isDropdownOpen,id:Le,pills:ua,activeSelected:m.isActivePillSelected,onPillClick:f.setActivePill,onSkip:f.skipActivePill,showSkipButton:(ae??!0)&&!Ue&&!ze,showOptionIcons:ue??!0,showOptionImages:P??!0,showOptionCounts:F??!0,skipDisabled:m.inSelectionAnimation,isLoading:ca,skeletonExiting:m.skeletonExiting,isInputEmpty:qe.trim().length===0,language:l,products:m.products,productImageFallback:ne,onProductSelect:f.selectProduct,onProductAddToCart:T?f.addProductToCart:void 0,onProductFocusChange:f.setFocused,formatType:m.activeFormatType,dateView:m.dateView,selectedDateIso:Qe.selectedIso,selectedDateRange:Qe.selectedRange,dateRangeStart:Qe.rangeStart,dateReferences:Qe.references,onPreviousMonth:f.showPreviousMonth,onNextMonth:f.showNextMonth,timeView:m.timeView,multiSelectView:m.dropdownMultiSelect,onMultiSelectCommit:f.commitMultiSelect,onTimeChange:f.setTime,onTimeCommit:f.commitTime,locationView:m.locationView,isReediting:m.editingParam!=null,onLocationQuery:f.setLocationQuery,onLocationMove:f.moveLocationHighlight,onLocationCommit:f.commitLocation,onLocationFocusChange:f.setLocationFieldFocused,isFocused:m.isFocused||m.locationFieldFocused,optionsPosition:p??"below"}}}var V=require("@magicx-eng/ai-autocomplete-vanilla"),D=require("react"),La;function di(){if(La!==void 0)return La;if(typeof document>"u")return!1;let e=document.createElement("div");return e.setAttribute("contenteditable","plaintext-only"),La=e.contentEditable==="plaintext-only",La}function yt(e){let{segments:t,showChipIcons:a=!0,showChipImages:i=!0,showChipRemove:o=!1,removeParam:s,newParamId:r,editingParam:l,editingIdentified:v,editingAnchor:x,caretOffset:k,placeholderText:b,hintSuggestions:u,isFocused:p,isDropdownOpen:y,listboxId:A,activeDescendantId:ee,autoFocus:H,handleTextChange:M,handleKeyDown:ue,handleCaretAfterInput:P,handleCaretMove:F,startEditingParam:ae,replaceEditingRange:q,setFocused:ne}=e,R=(0,D.useRef)(null),he=(0,D.useRef)(!1),j=(0,D.useRef)(""),U=(0,D.useRef)(""),re=(0,D.useRef)(null),xe=(0,D.useRef)(0);re.current=k,(0,D.useEffect)(()=>{if(!H)return;let g=R.current;if(!g)return;document.activeElement===g?ne(!0):g.focus();let C=g.ownerDocument??document,I=C.getSelection(),O=I&&I.rangeCount>0&&g.contains(I.anchorNode);if(I&&!O){let N=C.createRange();N.selectNodeContents(g),N.collapse(!0),I.removeAllRanges(),I.addRange(N)}},[H,ne]),(0,D.useEffect)(()=>{let g=R.current;if(!g)return;let C=g.ownerDocument??document,I=()=>{let O=C.getSelection();if(!O||O.rangeCount===0||!O.anchorNode||!g.contains(O.anchorNode))return;let N=O.anchorNode,se=N.nodeType===Node.ELEMENT_NODE?N:N.parentElement,fe=(O.isCollapsed?se?.closest("strong[data-param-id]"):null)?.dataset.paramId??null,Xe=l?.id??v?.id??null;if(fe&&fe!==Xe){ae(fe);return}performance.now()-xe.current<50||F((0,V.getCursorOffset)(g))};return C.addEventListener("selectionchange",I),()=>C.removeEventListener("selectionchange",I)},[l,v,ae,F]),(0,D.useEffect)(()=>{let g=R.current;if(!g)return;let C=I=>{let O=(0,V.chipIdFromTap)(g,I.target);O&&(ae(O),(0,V.keepCaretOnChip)(g,O))};return g.addEventListener("click",C),()=>g.removeEventListener("click",C)},[ae]),(0,D.useEffect)(()=>{let g=R.current;if(!(!g||!s||!o))return(0,V.attachChipRemove)(g,s)},[s,o]),(0,D.useLayoutEffect)(()=>{let g=R.current;g&&(0,V.renderEditableContent)({input:g,segments:t,newParamId:r,editingParamId:l?.id??null,placeholderText:b??"",isFocused:p,showChipIcons:a,showChipImages:i,showChipRemove:o,hintOptions:(0,V.startingHintOptions)(u??[])})},[t,r,l,b,u,p,a,i,o]),(0,D.useEffect)(()=>{let g=R.current;return()=>{g&&(0,V.cancelStartingHint)(g)}},[]),(0,D.useLayoutEffect)(()=>{let g=j.current,C=r??"";if(j.current=C,!C||C===g)return;let I=R.current;if(!I)return;I.focus();let O=re.current??(0,V.plainTextLength)(I);(0,V.setCursorOffset)(I,O)},[r]),(0,D.useLayoutEffect)(()=>{let g=U.current,C=l?.id??"";if(U.current=C,!C||C===g||x==null)return;let I=R.current;I&&(0,V.setCursorOffset)(I,x)},[l,x]);let S=(0,D.useCallback)(()=>{if(he.current)return;let g=R.current;if(!g)return;let C=(0,V.extractPlainText)(g),O=C.length>0&&C[0]!==C[0].toUpperCase()?C[0].toUpperCase()+C.slice(1):C;M(O)},[M]),Q=(0,D.useCallback)(()=>{xe.current=performance.now(),S();let g=R.current;g&&P((0,V.getCursorOffset)(g))},[S,P]);(0,D.useEffect)(()=>{let g=R.current;if(!g)return;let C=I=>{let O=I,N=O.inputType;if(N==="insertParagraph"||N==="insertLineBreak"||N==="insertFromDrop"){I.preventDefault();return}if(N.startsWith("insert")||N.startsWith("delete")){let se=N.startsWith("delete")?"":O.data??"";q(se)&&I.preventDefault()}};return g.addEventListener("beforeinput",C),()=>g.removeEventListener("beforeinput",C)},[q]);let c=(0,D.useCallback)(()=>{he.current=!0,R.current?.setAttribute("data-aia-composing","true")},[]),T=(0,D.useCallback)(()=>{he.current=!1,R.current?.removeAttribute("data-aia-composing"),S()},[S]),oa=(0,D.useCallback)(g=>{g.preventDefault();let C=R.current;if(!C)return;let I=(g.clipboardData.getData("text/plain")??"").replace(/\r?\n/g," ");if(!I)return;let O=C.ownerDocument??document,N=O.getSelection();if(!N||N.rangeCount===0)return;let se=N.getRangeAt(0);if(!C.contains(se.startContainer))return;se.deleteContents();let Te=O.createTextNode(I);se.insertNode(Te),se.setStartAfter(Te),se.collapse(!0),N.removeAllRanges(),N.addRange(se),S()},[S]),He=(0,D.useCallback)(g=>ue(g),[ue]),w=(0,D.useCallback)(()=>ne(!0),[ne]),na=(0,D.useCallback)(()=>ne(!1),[ne]),Be=(0,D.useCallback)(()=>R.current?.focus(),[]),je=(0,D.useCallback)(()=>R.current?.blur(),[]),$e=(0,D.useCallback)(()=>{let g=R.current;return g?(0,V.extractPlainText)(g):""},[]),Ze=di()?"plaintext-only":"true";return{inputRef:R,editorProps:{ref:R,contentEditable:Ze,suppressContentEditableWarning:!0,tabIndex:0,role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":A,"aria-expanded":y,"aria-activedescendant":ee,spellCheck:!0,enterKeyHint:"send",onInput:Q,onKeyDown:He,onCompositionStart:c,onCompositionEnd:T,onPaste:oa,onFocus:w,onBlur:na},getPlainText:$e,focus:Be,blur:je}}var Ae=require("react/jsx-runtime");function ci(e){return e!=="auto"?e:typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var kt=(0,Y.forwardRef)(function({onSubmit:t,onResult:a,onError:i,optionOverrides:o,maskCompletedText:s,className:r,apiConfig:l,additionalContext:v,language:x,currency:k,productId:b,visitorId:u,columns:p,pillPlacement:y="dropdown",mode:A="auto",optionsPosition:ee="below",animations:H=!0,optionsStyle:M="floating",dropdownTrigger:ue,closeDropdownOnBlur:P,prependPlaceholder:F,allOption:ae,showNonTappableOptions:q,locationSearch:ne,showOptionIcons:R=!0,showChipIcons:he=!0,showChipImages:j=!0,showChipRemove:U=!1,showOptionImages:re=!0,showOptionCounts:xe=!0,showSkipButton:S,showProducts:Q,productsLayout:c,productImageFallback:T,autoFocus:oa=!0,onFocus:He,onBlur:w,value:na,completedParams:Be,onChange:je,onParamsChange:$e,products:Ze,mapProducts:g,onProductSelect:C,onProductAddToCart:I,submitButton:O,resetOnSubmit:N=!0,seeAllResults:se=!1},Te){let fe=(0,Y.useRef)(null),Xe=(0,Y.useRef)(null),We=(0,Y.useRef)(null),ra=(0,Y.useRef)(()=>{}),le=(0,Y.useRef)(null),Ge=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let W=fe.current;if(W)return le.current?le.current.setMode(A):le.current=new Fe.ModeController(W,A),()=>{le.current?.destroy(),le.current=null}},[A]);let sa=(0,Y.useCallback)(W=>{let be=Ge.current?.current;be&&(be.focus(),(0,Fe.setCursorOffset)(be,W))},[]),{completedParams:fa,suggestionPills:Re,setActivePill:ha,skipActivePill:Je,segments:f,newParamId:Ke,clearNewParamId:la,placeholderText:n,isFocused:m,isDropdownOpen:qe,isActivePillSelected:_e,isLoading:Oe,isReady:Ve,activeIndex:ea,listboxId:Le,handleTextChange:ba,handleKeyDown:Ue,setFocused:ze,editingParam:aa,editingIdentified:da,editingAnchor:ua,caretOffset:Qe,startEditingParam:ca,removeParam:h,handleCaretAfterInput:$,handleCaretMove:B,replaceEditingRange:ma,dropdownProps:L,reset:Ca,refreshProducts:Ga,prepareSubmit:Ka,getState:qa,recordSubmit:_a}=Oa({onSubmit:W=>ra.current(W),onResult:a,onError:i,optionOverrides:o,maskCompletedText:s,apiConfig:l,additionalContext:v,language:x,currency:k,productId:b,visitorId:u,columns:p,dropdownTrigger:ue,optionsPosition:ee,closeDropdownOnBlur:P,prependPlaceholder:F,allOption:ae,showNonTappableOptions:q,locationSearch:ne,showOptionIcons:R,showOptionImages:re,showOptionCounts:xe,showSkipButton:S,showProducts:Q,onFocus:He,onBlur:w,value:na,completedParams:Be,onChange:je,onParamsChange:$e,products:Ze,mapProducts:g,onProductSelect:C,onProductAddToCart:I,source:"full-sdk",setCursor:sa});(0,Y.useEffect)(()=>{if(!Ke)return;let W=window.setTimeout(()=>la(),650);return()=>window.clearTimeout(W)},[Ke,la]);let Ct=ea>=0?`${Le}-option-${ea}`:void 0,{inputRef:za,editorProps:St,focus:Sa,blur:Va,getPlainText:Ua}=yt({segments:f,newParamId:Ke,editingParam:aa,editingIdentified:da,editingAnchor:ua,caretOffset:Qe,placeholderText:n,hintSuggestions:y==="inline"?[]:Re,isFocused:m,showChipIcons:he,showChipImages:j,showChipRemove:U,removeParam:h,isDropdownOpen:qe,listboxId:Le,activeDescendantId:Ct,autoFocus:oa,handleTextChange:ba,handleKeyDown:Ue,handleCaretAfterInput:$,handleCaretMove:B,startEditingParam:ca,replaceEditingRange:ma,setFocused:ze});Ge.current=za,(0,Y.useLayoutEffect)(()=>{let W=Xe.current,be=za.current;if(!W||!be)return;let va=()=>{let Ya=W.firstElementChild;if(!Ya)return;let Rt=Ya.getBoundingClientRect(),Ot=be.getBoundingClientRect();Rt.top>=Ot.bottom-2?W.setAttribute("data-aia-pill-wrapped",""):W.removeAttribute("data-aia-pill-wrapped")};va();let Qa=new ResizeObserver(va);return Qa.observe(be),()=>Qa.disconnect()},[f,Re.length,Oe,za]),(0,Y.useEffect)(()=>{let W=We.current;if(W)return(0,Fe.watchEditorHeight)(W)},[]),(0,Y.useImperativeHandle)(Te,()=>({focus:Sa,blur:Va,reset:Ca,refreshProducts:Ga,setMode:W=>le.current?.setMode(W),skipActivePill:Je}),[Sa,Va,Ca,Ga,Je]);let ga=!!f.length||fa.length>0,wa=(0,Y.useCallback)(W=>{if(!ga)return;W&&Ka();let be=qa(),va=(0,Fe.buildSubmitResult)(Ua(),be.completedParams,be.skippedParams,{identifiedParams:be.identifiedParams,isReady:be.isReady,customFields:be.customFields});W&&_a(va),t(va),N&&Ca()},[_a,N,ga,Ka,qa,t,Ca,Ua]);ra.current=()=>wa(!1);let Tt=se&&!L.isInputEmpty&&ga,Pt=(0,Y.useCallback)(()=>wa(!0),[wa]),It=(0,Y.useCallback)(W=>{W.target?.closest("[data-aia-pill]")||document.activeElement?.closest("[data-aia-location]")||Sa()},[Sa]),Et=y==="inline",At=y==="dropdown";return(0,Ae.jsxs)("div",{ref:fe,className:`magicx-aia ${pa.container} ${r??""}`,"data-pill-placement":y,"data-options-position":ee,"data-animations":H?"on":"off","data-aia-options-style":M,"data-mode":ci(A),children:[(0,Ae.jsx)(Aa,{...L,showPills:At,productsLayout:c,productImageFallback:T,onSeeAllResults:Tt?Pt:void 0,fullWidth:se}),(0,Ae.jsxs)("div",{className:pa.inputWrapper,"data-aia-input-wrapper":"",onClick:It,children:[(0,Ae.jsxs)("div",{ref:We,className:pa.editorArea,"data-aia-editor":"",children:[(0,Ae.jsx)("div",{...St,className:pa.input,"data-aia-input":""}),Et&&(Oe||Re.length>0)&&(0,Ae.jsx)("span",{ref:Xe,className:pa.pillListContainer,"data-aia-pill-list-container":"",children:(0,Ae.jsx)(Ia,{pills:Re,activePillIndex:0,activeSelected:_e,onSelectPill:ha,loading:Oe})})]}),O===null?null:O===void 0?(0,Ae.jsx)(bt,{disabled:!ga,ready:ga&&Ve,onClick:()=>wa(!0),label:(0,Fe.uiStringsFor)(x).submit}):(0,Ae.jsx)("span",{"data-aia-submit":"","data-aia-submit-slot":"",className:pa.submitSlot,onClick:W=>{ga&&(W.stopPropagation(),wa(!0))},children:O})]})]})});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});
|
|
3779
3779
|
//# sourceMappingURL=index.js.map
|