"use strict";exports.id=8482,exports.ids=[8482],exports.modules={72955:(t,e,a)=>{a.d(e,{_:()=>useSKUMatrix});var n=a(16689),i=a(63442);function useSKUMatrix(){let t=(0,n.useContext)(i.m);if(!t)throw Error("Do not use SKUMatrix components outside the SKUMatrix context.");return t}},6693:(t,e,a)=>{a.d(e,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var n=a(16689),i=a.n(n),u=a(37041),l=a(2614),r=a(42256);let __WEBPACK_DEFAULT_EXPORT__=({max:t,min:e=1,unitMultiplier:a=1,useUnitMultiplier:o,initial:s,disabled:d=!1,onChange:c,onValidateBlur:_,testId:m="fs-quantity-selector",...E})=>{let[h,y]=(0,n.useState)(s??e),[b,f]=(0,n.useState)(h*a),roundUpQuantityIfNeeded=t=>o?Math.ceil(t/a)*a:t,g=h===e,p=h===t,changeQuantity=t=>{let e=validateQuantityBounds(h+t);c?.(e),y(e),f(e*a)};function validateQuantityBounds(n){let i=e?Math.max(n,e):n;return t?Math.min(i,o?t*a:t):i}return(0,n.useEffect)(()=>{s&&y(s)},[s]),i().createElement("div",{"data-fs-quantity-selector":d?"disabled":"true","data-testid":m,...E},i().createElement(u.Z,{"data-quantity-selector-button":"left",icon:i().createElement(l.Z,{name:"Minus",width:16,height:16,weight:"bold"}),"aria-label":"Decrement Quantity","aria-controls":"quantity-selector-input",disabled:g||d,onClick:()=>changeQuantity(-1),testId:`${m}-left-button`,size:"small"}),i().createElement(r.Z,{"data-quantity-selector-input":!0,id:"quantity-selector-input","aria-label":"Quantity",value:o?b:h,onChange:t=>{let e=t.target.value.replace(/\D/g,"");y(Number(e))},onBlur:function(){let n=validateQuantityBounds(h),i=roundUpQuantityIfNeeded(n),u=t??(e?Math.max(h,e):h),l=h>u||h<e;l&&_?.(e,u,i),y(()=>(f(i),c?.(i/a),i/a))},onInput:t=>{let e=t.currentTarget;e.value=e.value.replace(/\D/g,"")},disabled:d}),i().createElement(u.Z,{"data-quantity-selector-button":"right","aria-controls":"quantity-selector-input","aria-label":"Increment Quantity",disabled:p||d,icon:i().createElement(l.Z,{name:"Plus",width:16,height:16,weight:"bold"}),onClick:()=>changeQuantity(1),testId:`${m}-right-button`,size:"small"}))}},63442:(t,e,a)=>{a.d(e,{Z:()=>__WEBPACK_DEFAULT_EXPORT__,m:()=>u});var n=a(16689),i=a.n(n);let u=(0,n.createContext)(null),__WEBPACK_DEFAULT_EXPORT__=function({children:t}){let[e,a]=(0,n.useState)(!1),[l,r]=(0,n.useState)([]),o=(0,n.useCallback)((t,e)=>{let a=[...l],n=a.find(e=>e.id===t);return n&&(n.selectedCount=e),r(a),a},[l]);return i().createElement(u.Provider,{value:{isOpen:e,allVariantProducts:l,setAllVariantProducts:r,onChangeQuantityItem:o,setIsOpen:a}},t)}}};