1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2011],{8675:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,61455,23)),Promise.resolve().then(r.bind(r,78310)),Promise.resolve().then(r.bind(r,86571)),Promise.resolve().then(r.bind(r,60444)),Promise.resolve().then(r.bind(r,70401)),Promise.resolve().then(r.bind(r,63425))},19849:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CollapseOverlay:()=>p,ProductSelectionsPreview:()=>d,default:()=>u});var n=r(5740),l=r(76704),i=r(49559),a=r(71985),s=r(21032);function o(e){let t=(0,l.useMemo)(()=>(null==e?void 0:e.multi_selections)?(e=>{let t=null==e?void 0:e.multi_selections,r=(null==t?void 0:t.product_options)||[],n=(null==t?void 0:t.selections)||[],l=null==e?void 0:e.id;if(!l||0===n.length||0===r.length)return null;let i=n.map(()=>({})),a=r.length,s=[],o={},c=()=>i=n.map((e,t)=>{let n={};for(let e=0;e<a;e++){let l=r[e].attributes,i=!0;for(let e=0;e<l.length;e++){let r=l[e];if(t!==e&&s[e]&&s[e]!==r){i=!1;break}}let a=l[t];a&&i&&(n[a]=!0)}return n});return s=(()=>{var e;for(let e=0;e<a;e++){let t=r[e];if(t.id&&String(t.id)===String(l))return[...t.attributes]}let t=r[0];return(null==t||null==(e=t.attributes)?void 0:e.map(()=>null))||[]})(),o=(()=>{let e={};return r.forEach(t=>{e[t.attributes.join("_")]=t}),e})(),c(),{selections:n,productOptions:r,productId:l,toggleSelection:(e,t)=>(s[e]&&s[e]===t?s[e]=null:s[e]=t,c()),getSelected:()=>[...s],getAvaliableOptions:()=>[...i],getProduct:()=>0===s.length||s.some(e=>!e)?null:o[s.join("_")]||null}})(e):null,[e]),[r,n]=(0,l.useState)([]),[i,a]=(0,l.useState)([]);return(0,l.useEffect)(()=>{if(!t){n([]),a([]);return}n(t.getSelected()),a(t.getAvaliableOptions())},[t]),{selectionEngine:t,selected:r,setSelected:n,avaliableOptions:i,setAvaliableOptions:a}}function c(e){let{selections:t,selected:r,avaliableOptions:l,onSelect:i}=e;return(0,n.jsx)("div",{className:"space-y-2 lg:space-y-2.5",children:t.map((e,t)=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-2 flex flex-wrap items-center text-[13px] md:text-[14px] font-bold",children:[(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:e.title}}),r[t]&&(0,n.jsx)("div",{className:"ml-[2px] text-primary font-bold",dangerouslySetInnerHTML:{__html:": ".concat(r[t])}})]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 lg:gap-2",children:e.options.map((e,s)=>{var o;let c=!!(null==(o=l[t])?void 0:o[e]),d=c&&e===r[t];return(0,n.jsxs)("button",{type:"button","aria-label":e,onClick:()=>i(t,e),disabled:!c,className:"relative items-center justify-center overflow-hidden rounded-md border px-1.5 pr-2.5 py-1 lg:py-1.5 text-[12px] lg:text-[13px] xl:text-[14px] ".concat(d?"border-primary bg-lime-50 text-primary font-semibold after:absolute after:-bottom-3 after:-right-3 after:max-lg:scale-85 after:h-6 after:w-6 after:rotate-45 after:bg-primary":c?"cursor-pointer border-zinc-200 bg-white hover:border-primary text-t1color":"cursor-not-allowed border-zinc-100 bg-zinc-100 text-zinc-400"),children:[(0,n.jsx)("div",{className:"text-inherit",dangerouslySetInnerHTML:{__html:e}}),d&&(0,n.jsx)(a.Sr,{size:.55,className:"absolute bottom-0 right-0 z-10 text-white max-lg:scale-75 scale-90 origin-bottom-right"})]},"".concat(e,"-").concat(s))})})]},"".concat(e.title,"-").concat(t)))})}function d(e){let{product:t,className:r}=e,{setIsActionExpanded:i,isActionExpanded:c}=(0,s.B)(),{selectionEngine:d,selected:u}=o(t),p=(0,l.useMemo)(()=>{var e;return Math.max(0,(null!=(e=null==d?void 0:d.selections.reduce((e,t)=>e+t.options.length,0))?e:0)-u.length)},[d,u]);return d&&0!==d.selections.length&&u.length?(0,n.jsxs)("div",{className:"relative px-2.5 flex border-zinc-100 w-full items-center gap-1.5 overflow-hidden whitespace-nowrap cursor-pointer ".concat(null!=r?r:""," py-2 pr-20"),onClick:()=>i(!c),children:[[...u].map((e,t)=>(0,n.jsx)("div",{className:"min-w-20 px-1 sm:px-2 w-auto inline-flex items-center justify-center bg-white border border-primary rounded-sm py-1 text-[12px] text-primary font-semibold",children:(0,n.jsx)("div",{className:"w-full truncate text-center",dangerouslySetInnerHTML:{__html:e}})},"".concat(e,"-").concat(t))),p>0&&(0,n.jsxs)("div",{className:"absolute right-0 top-0 z-10 h-full pl-8 pr-1.5 shrink-0 inline-flex items-center text-[12px] font-semibold text-primary-500",style:{background:"linear-gradient(to right, transparent, white 40%)"},children:["+",p," options",(0,n.jsx)(a.WL,{size:.6,className:"transition-transform duration-200 ".concat(c?"rotate-90":"")})]})]}):null}function u(e){let{product:t,className:r}=e,d=(0,l.useRef)(null),{isCollapseRight:u,isActionExpanded:m}=(0,s.B)(),{selectionEngine:x,selected:h,setSelected:f,avaliableOptions:b,setAvaliableOptions:v}=o(t),[g,y]=(0,l.useState)(null);if((0,l.useEffect)(()=>
1{if(!(null==g?void 0:g.href))return;let e=requestAnimationFrame(()=>{var e;return null==(e=d.current)?void 0:e.click()});return()=>cancelAnimationFrame(e)},[g]),!x||0===x.selections.length)return null;let[j,w]=(0,l.useState)(!0);return(0,l.useEffect)(()=>{w(m||!u)},[u,m]),(0,n.jsxs)(p,{isOpen:j,onOpen:()=>w(!0),classNames:{base:"".concat(r)},trigger:()=>(0,n.jsxs)(n.Fragment,{children:["Total Selections",(0,n.jsx)(a.k5,{size:.6})]}),children:[g&&(0,n.jsx)(i.N_,{ref:d,href:g.href,className:"hidden","aria-hidden":!0,tabIndex:-1,children:"hidden navigation"}),(0,n.jsx)(c,{selections:x.selections,selected:h,avaliableOptions:b,onSelect:(e,t)=>{var r,n;if(!(null==(r=b[e])?void 0:r[t]))return;v(x.toggleSelection(e,t)),f(x.getSelected());let l=null==(n=x.getProduct())?void 0:n.url;l&&y({href:l,key:Date.now()})}})]})}function p(e){var t,r,l,i;let{isOpen:s,onOpen:o,children:c,classNames:d,trigger:u}=e;return(0,n.jsxs)("div",{className:"relative ".concat(s?"":null!=(t=null==d?void 0:d.baseWithClosed)?t:"max-h-[120px] overflow-hidden"," ").concat(null!=(r=null==d?void 0:d.base)?r:""),children:[c,!s&&(0,n.jsx)("div",{className:"absolute rounded-t-lg flex items-center justify-center bottom-0 right-0 w-full pt-7 px-2.5 ".concat(null!=(l=null==d?void 0:d.shadow)?l:""),style:{background:"linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,1) 50px)"},children:(0,n.jsx)("button",{type:"button",onClick:o,className:"inline-flex font-semibold items-center gap-1 text-[12px] md:text-[12px] text-zinc-800 px-3 py-1 md:py-1.5 rounded-full cursor-pointer hover:bg-zinc-200 ".concat(null!=(i=null==d?void 0:d.trigger)?i:""),children:u?u():(0,n.jsx)(a.k5,{size:.6})})})]})}},20989:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(5740),l=r(13029),i=r(71985);function a(){let e={classNames:{base:"top-[var(--layout-header-h)] w-full max-w-full sm:max-w-100 md:max-w-140",content:"gap-2 md:gap-3",description:"max-h-75 overflow-y-auto me-0 font-normal scrollbar-thin scrollbar-track-transparent scrollbar-thumb-zinc-400 text-[12px] md:text-[13px] lg:text-[14px]",closeButton:"absolute right-2 top-2 ",closeIcon:"bg-zinc-400 text-white border-none hover:bg-zinc-800"},placement:"top-center",timeout:6e3,variant:"flat"};return{notify:(t,r)=>{(0,l.$U)({description:t,color:"default",...e,...r})},tipWaring:(t,r)=>{(0,l.$U)({description:t,color:"danger",...e,...r})},tipError:(t,r)=>{(0,l.$U)({description:t,color:"danger",...e,...r})},tipSuccess:(t,r)=>{(0,l.$U)({description:t,color:"primary",icon:(0,n.jsx)(i.C1,{}),...e,...r})}}}},21032:(e,t,r)=>{"use strict";r.d(t,{B:()=>b,h:()=>f});var n=r(5740),l=r(26542),i=r(35933),a=r(59341),s=r(64796),o=r(90597),c=r(76704),d=r(29793),u=r(55907);let p=(0,c.createContext)(null),m=e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?null:t},x=e=>Array.from(new Set(Object.keys((null==e?void 0:e.warehouseStockData)||{}).map(e=>m(e)).filter(e=>null!==e))),h=e=>{let{product:t,ipCountry:r,shipmentConfig:n,storeConfigDefaultWarehouseId:l}=e,a=x(t);if(0===a.length)return null;let s=m(((null==n?void 0:n[i.Ob.CountryWarehouseMap])||{})[r]);if(s&&a.includes(s))return s;let o=m(l);return o&&a.includes(o)?o:a[0]};function f(e){var t;let{product:r,children:f}=e,[b]=(0,d.lT)([l.V8.CFCountryCode]),v=(0,a.Yb)(e=>e.productConfig),g=(0,a.Yb)(e=>e.storeConfig),[y,j]=(0,c.useState)(null),[w,N]=(0,c.useState)(!1),[k,S]=(0,c.useState)(null),_=(0,c.useMemo)(()=>"ProductGallery"===k,[k]),[C,I]=(0,c.useState)(!1),z=(0,c.useMemo)(()=>(0,o.CW)(r),[r]),O=(0,c.useMemo)(()=>(0,o.KU)(r),[r]),P=(0,c.useMemo)(()=>(0,o.Rj)(r),[r]),M=null!=(t=null==r?void 0:r.product_stage)?t:null,A=Number(null==r?void 0:r.sales_moq)||0,L=m((0,u.useSearchParams)().get("warehouse")),E=(0,c.useMemo)(()=>x(r),[r]),[B,q]=(0,c.useState)(1),[T,W]=(0,c.useState)(()=>null!==L?"manual":"auto"),F=b[l.V8.CFCountryCode]||"",[D,V]=(0,c.useState)(()=>null!==L&&E.includes(L)?L:h({product:r,ipCountry:F,shipmentConfig:v,storeConfigDefaultWarehouseId:null==g?void 0:g.default_warehouse_id})),R=(0,c.useCallback)(e=>{V(e),W("manual")},[]),Q=(0,c.useCallback)(e=>{let t=Number.isFinite(e)?Math.floor(Math.abs(e)):1;q(t>0?t:1)},[]),G=(0,c.useMemo)(()=>(0,s.d$)({product:r,qty:B,warehouseStockData:null==r?void 0:r.warehouseStockData,shipmentConfig:v}),[r,B,v]);(0,c.useEffect)(()=>{"manual"!==T&&V((e=>{let{resolvedWarehouse:t,warehouseOptions:r,computedStocks:n}=e;if(0===r.length)return null;let l=e=>null!==e&&r.includes(e),i=e=>l(e)&&n[String(e)]||null,a=e=>{var t;return Number((null==(t=i(e))?void 0:t.instockCount)||0)>0},s=e=>{var t;return Number((null==(t=i(e))?void 0:t.backorderQty)||0)>0},o=r.find(e=>a(e));if(o)return a(t)?t:o;if(s(t))return t;let c=r.find(e=>s(e));return c||(l(t)?t:r[0])})({resolvedWarehouse:h({product:r,ipCountry:F,shipmentConfig:v,storeConfigDefaultWarehouseId:null==g?void 0:g.default_warehouse_id}),warehouseOptions:E,computedStocks:G}))},[T,r,F,v,null==g?void 0:g.default_warehouse_id,E,G]);let H=(0,c.useMemo)(()=>D&&G[String(D)]||null,[G,D]),U=(0,c.useMemo)(()=>(0,s.gP)(G),[G]),K=(0,c.useMemo)(()=>0!==E.length&&E.every(e=>(e=>{let t=!!e&&(e.instockCount>0||e.stockStatus===i.VL.InStock),r=!!e&&(e.backorderQty>0||e.stockStatus===i.VL.BackOrder);return!t&&!r})(G[String(e)]||null)),[E,G]),Y=(0,c.useMemo)(()=>({productId:(0,o.OX)(r)||null,sku:(0,o.d1)(r)||"",productType:(0,o.kc)(r),currentWarehouseId:D,warehouseOptions:E,isEnableChangeWarehouse:E.length>1,qty:B,setQty:Q,selectWarehouse:R,computedStocks:G,currentStock:H,disabledWarehouseIds:U,isAllWarehousesOutOfStock:K,meta:y,setMeta:j,isActionExpanded:w,setIsActionExpanded:N,scrollOverTarget:k,setScrollOverTarget:S,isCollapseRight:_,isHidePrice
1:z,priceEmail:O,purchaseLimit:P,productStage:M,salesMoq:A,purchaseLimitChecked:C,setPurchaseLimitChecked:I}),[null==r?void 0:r.id,null==r?void 0:r.sku,null==r?void 0:r.__typename,D,E,B,Q,R,G,H,U,K,y,j,w,N,k,S,_,z,O,P,M,A,C,I]);return(0,n.jsx)(p.Provider,{value:Y,children:f})}function b(){let e=(0,c.useContext)(p);if(!e)throw Error("useProduct must be used within ProductProvider");return e}},22159:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(5740),l=r(71985);function i(e){let{value:t,onChange:r,min:i=1,max:a,label:s,isError:o=!1,className:c}=e,d=e=>{let t=Number.isFinite(e)?Math.floor(e):i;return void 0!==i&&t<i?i:void 0!==a&&t>a?a:t},u="flex w-10 px-1 h-full items-center justify-center text-zinc-600 hover:bg-zinc-100 hover:scale-110 transition-transform duration-100 hover:text-black cursor-pointer";return(0,n.jsxs)("div",{className:c,children:[s&&(0,n.jsx)("div",{className:"mb-1 text-[13px] text-t1color font-semibold",children:s}),(0,n.jsxs)("div",{className:"flex h-9 items-center overflow-hidden rounded-lg border max-w-36 transition-colors ".concat(o?"border-red-500":"border-zinc-200 hover:border-primary focus-within:border-primary"),children:[(0,n.jsx)("button",{type:"button","aria-label":"decrease",onClick:()=>r(d(t-1)),className:u,children:(0,n.jsx)(l.xj,{size:.8})}),(0,n.jsx)("input",{inputMode:"numeric",value:t,onChange:e=>{let t=parseInt(e.target.value,10);r(d(Number.isNaN(t)?i:t))},className:"h-full w-full border-0 bg-transparent text-center text-[16px] font-bold outline-none focus:outline-none"}),(0,n.jsx)("button",{type:"button","aria-label":"increase",onClick:()=>{void 0!==a&&t>=a||r(d(t+1))},className:u,children:(0,n.jsx)(l.WS,{size:.8})})]})]})}},22853:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(5740);function l(e){let{className:t="",targetRef:r}=e;return(0,n.jsx)("div",{className:"w-full z-[-1] relative h-px opacity-0",children:(0,n.jsx)("div",{className:"w-full h-(--layout-header-h) absolute ".concat(t),ref:r})})}},34521:(e,t,r)=>{"use strict";r.d(t,{Qs:()=>s.Qs,i5:()=>c,lW:()=>s.lW,mL:()=>d});var n=r(5740),l=r(76704),i=r(57917),a=r(49559),s=r(13789);let o=(0,l.createContext)(null);function c(e){var t;let{children:r}=e,c=(0,a.a8)(),d={...s.ws,...null!=(t=(0,i.FZ)(c))?t:{}},[u,p]=(0,l.useState)(d.visibleMiniCart),[m,x]=(0,l.useState)(d.visibleSearch),[h,f]=(0,l.useState)(d.visibleHeader),[b,v]=(0,l.useState)(d.visibleFooter),[g,y]=(0,l.useState)(d.visibleMobileBottom),[j,w]=(0,l.useState)(d.visibleShippingBar),[N,k]=(0,l.useState)(d.headerStatus),[S,_]=(0,l.useState)(d.headerScrollType),[C,I]=(0,l.useState)(d.visibleNavMenu),[z,O]=(0,l.useState)(d.visibleCurrencySelector),[P,M]=(0,l.useState)(d.visibleZohoChat),[A,L]=(0,l.useState)(d.visibleSpinToWin),[E,B]=(0,l.useState)(d.visibleQuickOrder),[q,T]=(0,l.useState)(s.ws.navHeight),[W,F]=(0,l.useState)(s.ws.isNavOpen),[D,V]=(0,l.useState)(s.ws.visibleCartPop),[R,Q]=(0,l.useState)(s.ws.isQuickSearchOpen),[G,H]=(0,l.useState)(s.ws.isAtTop),U=(0,l.useCallback)(e=>{H(t=>t===e?t:e)},[]),K=(0,l.useRef)(null),Y=(0,l.useRef)(c);Y.current!==c&&(Y.current=c,K.current=null);let $=(0,l.useCallback)(e=>{if(!e){f(s.ws.visibleHeader),v(s.ws.visibleFooter),y(s.ws.visibleMobileBottom),w(s.ws.visibleShippingBar),p(s.ws.visibleMiniCart),x(s.ws.visibleSearch),k(s.ws.headerStatus),I(s.ws.visibleNavMenu),O(s.ws.visibleCurrencySelector),M(s.ws.visibleZohoChat),L(s.ws.visibleSpinToWin),B(s.ws.visibleQuickOrder),_(s.ws.headerScrollType);return}void 0!==e.visibleHeader&&f(e.visibleHeader),void 0!==e.visibleFooter&&v(e.visibleFooter),void 0!==e.visibleMobileBottom&&y(e.visibleMobileBottom),void 0!==e.visibleShippingBar&&w(e.visibleShippingBar),void 0!==e.visibleMiniCart&&p(e.visibleMiniCart),void 0!==e.visibleSearch&&x(e.visibleSearch),void 0!==e.headerStatus&&k(e.headerStatus),void 0!==e.headerScrollType&&_(e.headerScrollType),void 0!==e.visibleNavMenu&&I(e.visibleNavMenu),void 0!==e.visibleCurrencySelector&&O(e.visibleCurrencySelector),void 0!==e.visibleZohoChat&&M(e.visibleZohoChat),void 0!==e.visibleSpinToWin&&L(e.visibleSpinToWin),void 0!==e.visibleQuickOrder&&B(e.visibleQuickOrder)},[]),Z=(0,l.useCallback)(()=>{var e,t;$({...s.ws,...null!=(e=(0,i.FZ)(c))?e:{},...null!=(t=K.current)?t:{}})},[c,$]),J=(0,l.useCallback)(e=>{K.current=e,Z()}
1,[Z]),X=(0,l.useMemo)(()=>({visibleHeader:h,visibleFooter:b,visibleMobileBottom:g,visibleShippingBar:j,visibleMiniCart:u,visibleSearch:m,visibleZohoChat:P,visibleSpinToWin:A,navHeight:q,isNavOpen:W,visibleCartPop:D,isQuickSearchOpen:R,headerStatus:N,headerScrollType:S,visibleNavMenu:C,visibleCurrencySelector:z,visibleQuickOrder:E,isAtTop:G,setUIConfig:$,setUIOverride:J,setNavHeight:T,toggleFooter:e=>v(t=>"boolean"==typeof e?e:!t),toggleMobileBottom:e=>y(t=>"boolean"==typeof e?e:!t),toggleShippingBar:e=>w(t=>"boolean"==typeof e?e:!t),toggleNav:e=>F(t=>"boolean"==typeof e?e:!t),toggleCartPop:e=>V(t=>"boolean"==typeof e?e:!t),toggleQuickSearch:e=>Q(t=>"boolean"==typeof e?e:!t),setVisibleMiniCart:p,setVisibleSearch:x,setVisibleNavMenu:I,setVisibleCurrencySelector:O,setVisibleZohoChat:M,setVisibleSpinToWin:L,setVisibleQuickOrder:B,setIsAtTop:U}),[S,h,N,b,g,P,A,j,u,m,C,z,E,q,W,D,R,G,U,J]);return(0,l.useEffect)(()=>{Z()},[Z]),(0,n.jsx)(o.Provider,{value:X,children:r})}function d(){let e=(0,l.useContext)(o);if(!e)throw Error("useUI must be used within UIProvider");return e}},36279:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var n=r(5740),l=r(53442),i=r(74332),a=r(46871);function s(e){let{warehouseId:t}=e,r=(0,i.c)("product.shipmentTip"),s=(()=>{switch(Number(t)){case l.fr.US:return r("us.desc");case l.fr.DE:return r("de.desc");case l.fr.CN:return r("cn.desc");default:return""}})();return s?(0,n.jsxs)("div",{className:"mt-0.5 lg:mt-1 ",children:[(0,n.jsx)(a.A,{warehouseId:t,className:"text-price text-[11px] sm:text-[12px] font-semibold"}),(0,n.jsx)("div",{className:" text-[12px] text-zinc-600 font-semibold max-sm:text-t2color",children:s})]}):null}},38262:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WarehouseSwitchView:()=>j,default:()=>w});var n=r(5740),l=r(75211),i=r.n(l),a=r(42594),s=r(74332),o=r(21032),c=r(59341),d=r(35933),u=r(53442),p=r(49559),m=r(57917),x=r(76704),h=r(71985),f=r(78105);function b(e){let{warehouse:t}=e,r=(0,s.c)("product"),[l,i]=(0,x.useState)(!1),[o,c]=(0,x.useState)(!!t.isSubscribed);return(0,x.useEffect)(()=>{c(!!t.isSubscribed)},[t.isSubscribed]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{o||i(!0)},className:"flex w-full flex-col items-center justify-center gap-0.5 rounded-md py-1 transition-all ".concat(o?"cursor-default text-zinc-400":"cursor-pointer hover:text-primary"),children:[o?(0,n.jsx)(h.HE,{size:1.1}):(0,n.jsx)(h.LW,{size:1.1}),(0,n.jsx)("span",{className:"text-[11px] font-medium",children:r(o?"stockNotify.subscribed":"stockNotify.notifyMe")})]}),(0,n.jsx)(f.default,{isOpen:l,onClose:()=>i(!1),warehouseIds:[t.warehouseId],title:(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(null==t?void 0:t.flag)?(0,n.jsx)(a.default,{src:t.flag,alt:t.name,width:24,height:16,className:"h-4 w-6 object-cover"}):null,(0,n.jsx)("span",{className:"font-semibold",children:(null==t?void 0:t.name)||r("stockNotify.titleFallback")})]}),onSubscribed:()=>c(!0)})]})}var v=r(59147);let g={[u.fr.CN]:{url:m.qv.WarehouseCN,flag:u.fv[u.fr.CN]},[u.fr.US]:{url:m.qv.WarehouseUS,flag:u.fv[u.fr.US]},[u.fr.DE]:{url:m.qv.WarehouseDE,flag:u.fv[u.fr.DE]}};function y(e){let{isActive:t,isSelected:r,isDisabled:l,onSelect:i,selectAriaLabel:a}=e;return!t||l?(0,n.jsx)("span",{className:"h-5 w-5 md:h-6 md:w-6 rounded-md bg-zinc-200 not-allowed"}):r?(0,n.jsx)("button",{type:"button",className:"flex cursor-pointer h-5 w-5 md:h-6 md:w-6 items-center justify-center rounded-md bg-primary text-white","aria-label":a,children:(0,n.jsx)(h.Sr,{size:.8})}):(0,n.jsx)("button",{type:"button",onClick:i,className:"h-5 w-5 md:h-6 md:w-6 rounded-md cursor-pointer border-2 border-zinc-700 bg-white hover:border-primary ","aria-label":a})}function j(e){var t,r,l;let{currentWarehouseId:o,warehouseOptions:m,computedStocks:f,disabledWarehouseIds:j,isAllWarehousesOutOfStock:w,onSelectWarehouse:N}=e,k=(0,s.c)("product"),S=(0,c.Yb)(e=>e.productConfig),_=(null==S?void 0:S.warehouseidname)||{};if(!o||0===m.length)return null;let C=m.filter(e=>void 0!==g[e]);if(0===C.length)return null;let I=(0,x.useMemo)(()=>C.map(e=>{let t=_[e]||k("warehouseSwitch.fallbackName",{warehouseId:e}),r=g[e],n=f[String(e)],l=o===e,i=!!j[String(e)],a=!!n&&n.stockStatus===d.VL.InStock,s=!!n&&(n.backorderQty>0||n.stockStatus===d.VL.BackOrder);return{warehouseId:e,name:t,url:(null==r?void 0:r.url)||"#",flag:(null==r?void 0:r.flag)||"",isSelected:l,isWarehouseDisabled:i,isInStockActive:a,isBackOrderActive:s,visibleStockNotify:i||n&&(null==n?void 0:n.stockStatus)===d.VL.OutOfStock,isSubscribed:!!(null==n?void 0:n.isSubscribed)}}),[C,f,o,j,_,k]);return w?null:(0,n.jsxs)("div",{className:"jsx-de97fa9a76746fc0 border border-zinc-200 rounded-xl overflow-auto",children:[(0,n.jsxs)("div",{className:"jsx-de97fa9a76746fc0 flex justify-between",children:[(0,n.jsxs)("div",{className:"jsx-de97fa9a76746fc0 w-20 xl:w-30",children:[(0,n.jsxs)("div",{className:"jsx-de97fa9a76746fc0 flex items-center gap-1 text-[11px] xl:text-[13px] font-semibold text-t1color warehouse_switch_tdh",children:[(0,n.jsx)("span",{className:"jsx-de97fa9a76746fc0",children:k("warehouseSwitch.title")}),(0,n.jsx)(v.A,{placement:"top",classNames:{wrapper:"fixed shadow-lg z-10 bg-white translate-x-[-90px] translate-y-[-85px] bg-white rounded-md p-2 border border-zinc-200"},content:(0,n.jsxs)("div",{className:"jsx-de97fa9a76746fc0 w-[350px] text-[12px] space-y-1 ",children:[(0,n.jsxs)("div",{className:"jsx-de97fa9a76746fc0",children:[(0,n.jsx)(p.N_,{prefetch:!1,href:(null==(t=g[u.fr.CN])?void 0:t.url)||"#",target:"_blank",rel:"noreferrer",children:(0,n.jsx)("span",{className:"jsx-de97fa9a76746fc0 text-primary underline mr-1",children:k("warehouseSwitch.tooltip.cnLink")})}),k("warehouseSwitch.tooltip.cnDesc")]}),(0,n.jsxs)("div",{className:"jsx-de97fa9a76746fc0",children:[(0,n.jsx)(p.N_,{className:"text-primary underline",href:(null==(r=g[u.fr.US])?void 0:r.url)||"#",target:"_blank",rel:"noreferrer",prefetch:!1,children:(0,n.jsx)("span",{className:"jsx-de97fa9a76746fc0 text-primary underline mr-1",children:k("warehouseSwitch.tooltip.usLink")})}),k("warehouseSwitch.tooltip.usDesc")]}),(0,n.jsxs)("div",{className:"jsx-de97fa9a76746fc0",children:[(0,n.jsx)("a",{href:(null==(l=g[u.fr.DE])?void 0:l.url)||"#",target:"_blank",rel:"noreferrer",className:"jsx-de97fa9a76746fc0 text-primary underline",children:(0,n.jsx)("span",{className:"jsx-de97fa9a76746fc0 text-primary underline mr-1",children:k("warehouseSwitch.tooltip.deLink")})}),k("warehouseSwitch.tooltip.deDesc")]})]}),children:(0,n.jsx)(h.uI,{size:.7,className:"cursor-pointer max-md:hidden"})})]}),(0,n.jsx)("div",{className:"jsx-de97fa9a76746fc0 flex items-center text-[11px] xl:text-[12px] font-semibold text-t1color warehouse_switch_td",children:(0,n.jsx)("span",{className:"jsx-de97fa9a76746fc0 pl-1",children:k("warehouseSwitch.inStock")})}),(0,n.jsx)("div",{className:"jsx-de97fa9a76746fc0 flex items-center text-[11px] xl:text-[12px] font-semibold text-t1color warehouse_switch_td",children:(0,n.jsx)("span",{className:"jsx-de97fa9a76746fc0 pl-1",children:k("warehouseSwitch.backOrder")})})]}),I.map(e=>(0,n.jsxs)("div",{className:"jsx-de97fa9a76746fc0 grow shrink-0",children:[(0,n.jsx)(p.N_,{href:e.url,target:"_blank",rel:"noreferrer",prefetch:!1,className:"flex items-center justify-center gap-0.5 text-left transition-all hover:bg-zinc-100 warehouse_switch_tdh",title:e.name,children:e.flag&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.default,{src:e.flag,alt:e.name,sizes:"60px",width:24,height:16,className:"object-cover w-4 h-2.5 md:w-6 md:h-4 block"}),(0,n.jsx)(h.WL,{size:.6})]})}),e.visibleStockNotify?(0,n.jsx)("div",{className:"jsx-de97fa9a76746fc0 flex items-center justify-center warehouse_switch_cols_2",children:(0,n.jsx)(b,{warehouse:e})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"jsx-de97fa9a76746fc0 flex items-center justify-center warehouse_switch_td",children:(0,n.jsx)(y,{isActive:e.isInStockActive,isSelected:e.isSelected,isDisabled:e.isWarehouseDisabled,onSelect:()=>N(e.warehouseId),selectAriaLabel:k("warehouseSwitch.selectWarehouse")})}),(0,n.jsx)("div",{className:"jsx-de97fa9a76746fc0 flex items-center justify-center warehouse_switch_td",children:(0,n.jsx)(y,{isActive:e.isBackOrderActive,isSelected:e.isSelected,isDisabled:e.isWarehouseDisabled,onSelect:()=>N(e.warehouseId),selectAriaLabel:k("warehouseSwitch.selectWarehouse")})})]})]},e.warehouseId))]}),(0,n.jsx)("style",{children:"\n .warehouse_switch_tdh {\n min-height: 40px;\n background-color: #f1f1f1;\n padding: 5px 10px;\n }\n @media (max-width: 540px) {\n .warehouse_switch_tdh {\n min-height: 30px;\n padding: 5px 5px 5px 5px;\n }\n }\n .warehouse_switch_td {\n min-height: 40px;\n padding: 5px 5px 5px 5px;\n }\n @media (max-width: 540px) {\n .warehouse_switch_td {\n min-height: 30px;\n padding: 5px 5px 5px 5px;\n }\n }\n .warehouse_switch_cols_2 {\n min-height: 80px;\n padding: 5px 5px 5px 5px;\n }\n @media (max-width: 540px) {\n .warehouse_switch_cols_2 {\n min-height: 65px;\n padding: 5px 5px 5px 5px;\n }\n }\n \n "}),(0,n.jsx)(i(),{id:"de97fa9a76746fc0",children:".warehouse_switch_td.jsx-de97fa9a76746fc0{height:28px}"})]})}function w(){let{currentWarehouseId:e,warehouseOptions:t,selectWarehouse:r,computedStocks:l,disabledWarehouseIds:i,isAllWarehousesOutOfStock:a}=(0,o.B)();return(0,n.jsx)(j,{currentWarehouseId:e,warehouseOptions:t,computedStocks:l,disabledWarehouseIds:i,isAllWarehousesOutOfStock:a,onSelectWarehouse:r})}},46871:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(5740),l=r(53442),i=r(74332);let a={[l.fr.US]:"us",[l.fr.DE]:"de"};function s(e){let{warehouseId:t,className:r="text-price text-[12px] font-semibold whitespace-nowrap"}=e,l=(0,i.c)("product.shipmentTip"),s=a[Number(t)];if(!s)return null;let o="".concat(l("shippingFrom")," ").concat(l("".concat(s,".region"))).trim();return(0,n.jsx)("div",{className:r,children:o})}},55095:(e,t,r)=>{"use strict";r.d(t,{P:()=>n,r:()=>l});let n="mg:product-added-to-cart";function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.dispatchEvent(new CustomEvent(n,{detail:e}))}},59147:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(5740),l=r(19611),i=r(76704);function a(e){let{children:t,content:r,isOpen:a,onOpenChange:s,classNames:o,openDelay:c=50,closeDelay:d=200,placement:u="bottom-end"}=e,[p,m]=(0,i.useState)(!1),x=(0,i.useRef)(null),h=(0,i.useRef)(null),f=(0,i.useRef)(null),b=void 0!==a,v=b?!!a:p,g=(0,i.useCallback)(e=>{let t="function"==typeof e?e(v):e;b||m(t),null==s||s(t)},[b,v,s]),y=(0,i.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),j=(0,i.useCallback)(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]),w=(0,i.useCallback)(()=>{j(),y(),h.current=setTimeout(()=>{g(!0)},c)},[j,y,c,g]),N=(0,i.useCallback)(()=>{y(),j(),f.current=setTimeout(()=>{g(!1)},d)},[j,y,d,g]),k=(0,i.useCallback)(()=>{y(),j(),g(e=>!e)},[j,y,g]),S=(0,i.useCallback)(e=>
1{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),k()),"Escape"===e.key&&g(!1)},[g,k]),_=(0,i.useCallback)(()=>{y(),j(),g(!0)},[j,y,g]),C=(0,i.useCallback)(()=>{y(),j(),g(!1)},[j,y,g]);(0,i.useEffect)(()=>{let e=e=>{x.current&&(x.current.contains(e.target)||C())};if(v)return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[C,v]),(0,i.useEffect)(()=>()=>{y(),j()},[j,y]);let I=(0,l.A)({"left-0 top-full mt-2":"bottom-start"===u,"left-1/2 top-full mt-2 -translate-x-1/2":"bottom"===u,"right-0 top-full mt-2":"bottom-end"===u,"left-0 bottom-full mb-2":"top-start"===u,"left-1/2 bottom-full mb-2 -translate-x-1/2":"top"===u,"right-0 bottom-full mb-2":"top-end"===u,"right-full top-0 mr-2":"left-start"===u,"right-full top-1/2 -translate-y-1/2 mr-2":"left"===u,"right-full bottom-0 mr-2":"left-end"===u,"left-full top-0 ml-2":"right-start"===u,"left-full top-1/2 -translate-y-1/2 ml-2":"right"===u,"left-full bottom-0 ml-2":"right-end"===u}),z=u.startsWith("top")?"translate-y-1":u.startsWith("bottom")?"-translate-y-1":u.startsWith("left")?"translate-x-1":"-translate-x-1",O={isOpen:v,open:_,close:C,toggle:k},P="function"==typeof t?t(O):t,M="function"==typeof r?r(O):r;return(0,n.jsxs)("div",{ref:x,className:(0,l.A)("relative inline-flex",null==o?void 0:o.base),onMouseEnter:w,onMouseLeave:N,children:[(0,n.jsx)("div",{role:"button",tabIndex:0,"aria-expanded":v,"aria-haspopup":"dialog","data-state":v?"open":"closed",className:null==o?void 0:o.trigger,onClick:k,onKeyDown:S,children:P}),(0,n.jsx)("div",{"aria-hidden":!v,onMouseEnter:w,onMouseLeave:N,className:(0,l.A)((null==o?void 0:o.wrapper)?null==o?void 0:o.wrapper:"absolute z-30 transform-gpu transition duration-150 ease-out will-change-transform ".concat(I),v?"pointer-events-auto translate-y-0 opacity-100":"pointer-events-none ".concat(z," opacity-0")),children:v&&(0,n.jsx)("div",{className:(null==o?void 0:o.content)||"",children:M})})]})}},60248:(e,t,r)=>{"use strict";r.d(t,{d:()=>s,gp:()=>a,ps:()=>i,sT:()=>o});var n=r(76704),l=r(30287);let i="scrollbar-hide flex cursor-grab overflow-x-auto overscroll-x-contain [&_a]:[-webkit-user-drag:none] [&_img]:[-webkit-user-drag:none]",a="scrollbar-hide flex flex-col cursor-grab overflow-y-auto overscroll-y-contain [&_a]:[-webkit-user-drag:none] [&_img]:[-webkit-user-drag:none]";function s(e,t){let r=(100/e).toFixed(6),n=((e-1)*t/e).toFixed(6);return"calc(".concat(r,"% - ").concat(n,"px)")}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{axis:t="x",refreshKey:r,edgeEpsilon:i=2,buttonMoveRatio:a=1,stepDistance:s,step:o="viewport",slidesPerGroup:c=1,enableDrag:d=!0}
1=e,u=(0,n.useRef)(null),[p,m]=(0,n.useState)(!0),[x,h]=(0,n.useState)(!1),f=(0,l.ec)({mouseScroll:!!d&&{inertia:!0,rubberBand:!1,overscroll:!1,activationDistance:10,ignoreElements:"input, textarea, select, [data-no-drag]"}}),b=(0,n.useCallback)(e=>{u.current=e,f.ref(e)},[f.ref]),v=(0,n.useCallback)(()=>{let e=u.current;if(!e)return;if("y"===t){let{scrollTop:t,clientHeight:r,scrollHeight:n}=e;m(t<=i),h(t+r>=n-i);return}let{scrollLeft:r,clientWidth:n,scrollWidth:l}=e;m(r<=i),h(r+n>=l-i)},[t,i]);(0,n.useEffect)(()=>{let e=u.current;if(!e)return;v(),e.addEventListener("scroll",v,{passive:!0});let t=e=>{e.preventDefault()};e.addEventListener("dragstart",t);let r=new ResizeObserver(v);return r.observe(e),Array.from(e.children).forEach(e=>{r.observe(e)}),()=>{e.removeEventListener("scroll",v),e.removeEventListener("dragstart",t),r.disconnect()}},[v,r]);let g=(0,n.useCallback)(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"smooth",n=u.current;if(n&&0!==e){if("y"===t)return void n.scrollBy({top:e,behavior:r});n.scrollBy({left:e,behavior:r})}},[t]),y=(0,n.useCallback)(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"smooth",n=u.current,l=null==n?void 0:n.children[e];if(!n||!l)return;let i=n.getBoundingClientRect(),a=l.getBoundingClientRect();if("y"===t){let e=a.top-i.top,t=a.bottom-i.bottom,l=0;e<0?l=e:t>0&&(l=t),0!==l&&n.scrollBy({top:l,behavior:r});return}let s=a.left-i.left,o=a.right-i.right,c=0;s<0?c=s:o>0&&(c=o),0!==c&&n.scrollBy({left:c,behavior:r})},[t]),j=(0,n.useCallback)(e=>{let r=u.current;if(!r)return;let n=function(e,t,r,n,l,i){let a="y"===i;if(t&&t>0)return t;if("slide"===r){let t=e.children[0];if(!t)return a?e.clientHeight:e.clientWidth;let r=getComputedStyle(e),n=Number.parseFloat((a?r.rowGap:r.columnGap)||"0");return((a?t.offsetHeight:t.offsetWidth)+(Number.isFinite(n)?n:0))*Math.max(1,"function"==typeof l?l(e):l)}return(a?e.clientHeight:e.clientWidth)*n}(r,s,o,a,c,t);n<=0||g(e*n)},[t,a,g,c,o,s]),w=(0,n.useCallback)(()=>{j(-1)},[j]),N=(0,n.useCallback)(()=>{j(1)},[j]);return{scrollerRef:b,isBeginning:p,isEnd:x,canNavigate:!(p&&x),scrollByViewport:j,scrollPrev:w,scrollNext:N,scrollByDistance:g,scrollToIndex:y,syncEdges:v}}},60444:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(76704),l=r(34521),i=r(57917);function a(){let{setUIOverride:e}=(0,l.mL)();return(0,n.useEffect)(()=>(e(i.D4),()=>e(null)),[e]),null}},62866:(e,t,r)=>{"use strict";async function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutMs:r=3e4,signal:n,...l}=t,i=new AbortController;if(n)if(n.aborted)try{i.abort(n.reason)}catch(e){i.abort()}else n.addEventListener("abort",()=>{try{i.abort(n.reason)}catch(e){i.abort()}},{once:!0});let a=setTimeout(()=>i.abort(),r);try{let t=await fetch(e,{...l,signal:i.signal});if(!t.ok){let r="";try{r=await t.text()}catch(e){}let n="string"==typeof e?e:e.toString();throw Error("HTTP error: ".concat(t.status," ").concat(t.statusText," | URL: ").concat(n).concat(r?" - "+r:""))}return t}catch(e){if((null==e?void 0:e.name)==="AbortError")throw Error("Request aborted due to timeout");throw e}finally{clearTimeout(a)}}r.d(t,{H:()=>n})},64796:(e,t,r)=>{"use strict";r.d(t,{Wi:()=>x,d$:()=>f,gP:()=>b,pr:()=>m});var n=r(49099),l=r(94537),i=r(21496),a=r(25413),s=r(92612),o=r(35933);let c=e=>{let t=Number.isFinite(e)?Math.floor(Math.abs(e)):1;return t>0?t:1},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=Number(e);return Number.isFinite(r)?r:t},u=e=>{let{product:t,stockData:r,inputQty:n}=e,l=((null==t?void 0:t.stock_status)||o.VL.OutOfStock).toString();return{warehouseId:String((null==r?void 0:r.id)||""),inputQty:n,stockStatus:l,isEnough:!1,instockCount:0,backorderQty:0,backorderOnDemand:0,instockOnDemand:0,totalCount:0,shortfallQty:n,deliveryDate:"",leadTime:"",preorderShipmentDate:l===o.VL.Preorder&&(null==r?void 0:r.shipment_date)||""}},p=e=>{let{dCount:t,batches:r}=e,a={batchTotal:0,maxBackorderCount:0,deliveryDate:"",batchNo:""},s=Array.isArray(r)?r:[];if(0===s.length)return a;let o=t,c=!1,d=new Date;for(let e of s){let t=Number((null==e?void 0:e.AvaTransitQTY)||0);if(a.batchTotal+=t,a.maxBackorderCount+=t,(o-=t)<=0&&!c){c=!0;let t=(0,n.H)(String((null==e?void 0:e.Date)||""));(0,l.f)(t)&&(0,i.Y)(d,t)&&(a.batchNo=(null==e?void 0:e.BatchNO)||"",a.deliveryDate=(null==e?void 0:e.Date)||"")}}return a},m=e=>{let{product:t,stockData:r}=e,n=c(e.qty),l=u({product:t,stockData:r,inputQty:n});if(!r)return l;if((e=>"A"===String((null==e?void 0:e.product_stock_type)||"").toUpperCase())(r))return(e=>{let{product:t,stockData:r}=e,n=c(e.qty),l=u({product:t,stockData:r,inputQty:n});if(l.isStandbyStock=!0,!r)return l;let i=d(r.available_qty),a=d(r.monthly_sales),s=d(r.sales_threshold),m=d(r.small_order_qty,20),x=Math.floor(i*d(r.stock_reserve_ratio,.5)),h=Array.isArray(r.batch)?r.batch:[],f=e=>{let t=Math.max(e,0);return l.stockStatus=o.VL.InStock,l.instockCount=t,l.totalCount=t,l.isEnough=n<=t,l.shortfallQty=Math.max(n-t,0),l.instockOnDemand=l.isEnough?n:0,l};if(n<=i){if(n<=s||n<=m)return f(i);if(n>x&&i-n>=a)return f(i-a);if(n<=x)return f(x)}return(()=>{let e=p({dCount:n,batches:h});return l.stockStatus=o.VL.BackOrder,l.instockCount=0,l.instockOnDemand=0,l.totalCount=e.max
1BackorderCount,l.isEnough=n<=e.batchTotal,l.shortfallQty=Math.max(n-l.totalCount,0),l.deliveryDate=e.deliveryDate,l.backorderOnDemand=n,l})()})(e);let i=l.stockStatus,a=Number(r.available_qty||0),s=Array.isArray(r.batch)?r.batch:[];if(l.instockCount=a,l.totalCount=a,l.isEnough=n<=a,l.shortfallQty=Math.max(n-l.totalCount,0),l.isEnough)return l.instockOnDemand=n,l;if(i===o.VL.Preorder||(l.instockOnDemand=a,0===s.length))return l;let m=p({dCount:n-a,batches:s});return m.batchTotal<=0||(l.stockStatus=o.VL.BackOrder,l.totalCount=a+m.maxBackorderCount,l.isEnough=n<=l.totalCount,l.shortfallQty=Math.max(n-l.totalCount,0),l.deliveryDate=m.deliveryDate,l.backorderOnDemand=l.isEnough?n-a:m.maxBackorderCount),l},x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=(0,n.H)(String(e||""));if(!(0,l.f)(o))return"";let c=(0,a.f)(o,i),d=0;for(;d<s;){let e=h(c=(0,a.f)(c,1),"yyyyMMdd"),n=c.getDay(),l=0===n||6===n;(l&&r[e]||!l&&!t[e])&&(d+=1)}return h(c,"PP")},h=(e,t)=>(0,s.GP)(e,t),f=e=>{let{product:t,qty:r,warehouseStockData:i,includeWarehouseIds:a,shipmentConfig:c}=e,d=i||{},u={};for(let e in console.log("allStock",d),d){if(a&&!a[e]||!Object.prototype.hasOwnProperty.call(d,e))continue;let i=d[e],p=m({product:t,qty:r,stockData:i});if(p.deliveryDate&&c&&p.stockStatus===o.VL.BackOrder){let e=c[o.Ob.Holidays]||{},t=c[o.Ob.Workdays]||{};p.deliveryDate=x(p.deliveryDate,e,t,c[o.Ob.BufferDays]||0,c[o.Ob.ShipBufferDays]||1)}let h=p.preorderShipmentDate?(()=>{let e=(0,n.H)(String(p.preorderShipmentDate));return(0,l.f)(e)?(0,s.GP)(e,"PP"):p.preorderShipmentDate})():"";u[e]={...p,backorderQty:Math.max(p.totalCount-p.instockCount,0),leadTime:p.deliveryDate||h||"",isSubscribed:!!i.is_subscribed,warehouseId:e}}return u},b=e=>{let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=!e[r].isEnough);return t}},66415:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LazyImage:()=>s,default:()=>o});var n=r(5740),l=r(42594),i=r(3600);let a=(0,r(97546).A)();function s(e){let{rootMargin:t="200px",className:r,style:s,width:o,height:c,alt:d,...u}=e,{ref:p,inView:m}=(0,i.Wx)({rootMargin:t,triggerOnce:!0});return m?(0,n.jsx)(l.default,{width:o,height:c,alt:d,className:r,style:s,...u}):(0,n.jsx)("img",{ref:p,src:a,alt:"","aria-hidden":!0,width:"number"==typeof o?o:void 0,height:"number"==typeof c?c:void 0,className:r,style:s})}let o=s},68182:(e,t,r)=>{"use strict";r.d(t,{Tf:()=>s,VL:()=>i,jV:()=>a,o4:()=>o});var n=r(62866),l=r(26542),i=function(e){return e[e.IN_STOCK=1]="IN_STOCK",e[e.OUT_OF_STOCK=2]="OUT_OF_STOCK",e}({});async function a(e){let{page:t,pageSize:r}=e,i=(0,l.c4)(),a="/rest/V1/productalert/subscriptions?page=".concat(t||1,"&page_size=").concat(r||10),s=await (0,n.H)(a,{headers:{...i?{Authorization:"Bearer ".concat(i)}:{}}}),o=await s.json();if((null==o?void 0:o.code)!==1)throw Error((null==o?void 0:o.message)||"Request failed");return o}async function s(e){let{body:t}=e,r=(0,l.c4)(),i={method:"POST",credentials:"include",timeoutMs:3e4,headers:{"Content-Type":"application/json",...r?{Authorization:"Bearer ".concat(r)}:{}},body:JSON.stringify(t)},a=await (0,n.H)("/rest/V1/productalert/unsubscribe",i),s=await a.json();if((null==s?void 0:s.code)!==1)throw Error((null==s?void 0:s.message)||"Unsubscribe failed");return s}async function o(e){let{body:t}=e,r=(0,l.c4)(),i={method:"POST",credentials:"include",timeoutMs:3e4,headers:{"Content-Type":"application/json",...r?{Authorization:"Bearer ".concat(r)}:{}},body:JSON.stringify(t)},a=await (0,n.H)("/rest/V1/productalert/subscribe",i),s=await a.json();if((null==s?void 0:s.code)!==1)throw Error((null==s?void 0:s.message)||"Subscribe failed");return s}},70056:(e,t,r)=>{"use strict";r.d(t,{K:()=>s});var n=r(5740),l=r(42594),i=r(97546);function a(e){let{item:t,index:r,isActive:a,onClick:s,className:o}=e,c=t.small||t.normal||t.big||(0,i.A)();return(0,n.jsx)(l.default,{src:c,width:90,height:90,placeholder:"blur",blurDataURL:(0,i.A)(),className:"block w-full bg-white object-contain hover:scale-120 transition-transform ".concat(a?"scale-120":""," ").concat(o||"h-full"),alt:""})}function s(e){var t,r;let{item:s,index:o,mode:c,isActive:d,onClick:u,classNames:p,isZoomed:m}=e;return"thumb"===c?(0,n.jsx)(a,{item:s,index:o,isActive:d,onClick:u,className:null==p?void 0:p.image}):(0,n.jsx)("div",{className:"w-full relative h-full ".concat(null==p?void 0:p.base),onClick:u,children:"video"===s.type?(0,n.jsx)("video",{poster:s.normal||s.small||s.big||void 0,src:null==(t=s.video_content)?void 0:t.video_url,playsInl
1ine:!0,autoPlay:!0,muted:!0,loop:!0,className:" w-full h-full object-contain ".concat((null==p?void 0:p.video)||"")}):"iframe"===s.type?(0,n.jsx)("div",{className:"w-full h-full",children:(0,n.jsx)("iframe",{src:null==(r=s.video_content)?void 0:r.video_url,className:"block w-full h-full object-contain ".concat((null==p?void 0:p.iframe)||"")})}):(()=>{let e=("modal"===c?s.big:s.normal)||s.normal||s.small||s.big||(0,i.A)();return"modal"===c?(0,n.jsx)(l.default,{src:e,fill:!0,unoptimized:!0,quality:100,loading:0===o?"eager":"lazy",className:"w-full h-full object-contain ".concat((null==p?void 0:p.image)||""),alt:""}):(0,n.jsx)(l.default,{src:e,fill:!0,sizes:"(max-width: 768px) 100vw, 30vw",quality:75,loading:0===o?"eager":"lazy",priority:0===o,fetchPriority:0===o?"high":void 0,className:"w-full h-full object-contain ".concat((null==p?void 0:p.image)||""),alt:""})})()})}},70401:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ProductPage:()=>ty,default:()=>tj});var n=r(5740),l=r(11504),i=r(76704),a=r(70056),s=r(71985),o=r(60248);let c="left-1/2 -translate-x-1/2 z-10 absolute max-lg:hidden text-zinc-600 hover:bg-black/10 h-6 w-6 hover:scale-110 transition-transform duration-200 flex items-center justify-center rounded-full ";function d(e){let{items:t,activeIndex:r,onActiveIndexChange:l,className:d}=e,{scrollerRef:u,isBeginning:p,isEnd:m,scrollPrev:x,scrollNext:h,scrollToIndex:f}=(0,o.sT)({axis:"y",refreshKey:t.length,step:"slide"});return(0,i.useEffect)(()=>{f(r,"smooth")},[r,f]),(0,n.jsxs)("div",{className:"relative h-full max-h-full group ".concat(d||""),children:[(0,n.jsx)("div",{ref:u,className:"".concat(o.gp," h-full max-h-full"),style:{gap:8},children:t.map((e,t)=>(0,n.jsx)("button",{type:"button",onClick:()=>l(t),className:"w-full shrink-0 cursor-pointer hover:border-primary block rounded-md overflow-hidden border bg-white transition-colors ".concat(t===r?"border-primary":"border-zinc-200"),children:(0,n.jsx)(a.K,{item:e,index:t,mode:"thumb",isActive:t===r,classNames:{image:"h-auto"}})},t))}),(0,n.jsx)("button",{type:"button",onClick:x,disabled:p,"aria-label":"Previous thumbnails",className:"".concat(c," ").concat(p?"cursor-not-allowed opacity-50":"cursor-pointer"," top-1 "),children:(0,n.jsx)(s.Hd,{size:.8})}),(0,n.jsx)("button",{type:"button",onClick:h,disabled:m,"aria-label":"Next thumbnails",className:"".concat(c," ").concat(m?"cursor-not-allowed opacity-50":"cursor-pointer"," bottom-1"),children:(0,n.jsx)(s.k5,{size:.8})})]})}var u=r(9662),p=r(98128),m=r(7707);let x="top-1/2 -translate-y-1/2 z-10 absolute max-lg:hidden text-zinc-600 hover:bg-black/10 h-8 w-8 flex items-center justify-center rounded-full ";function h(e){let{items:t,activeIndex:r,onActiveIndexChange:l,onOpenModal:o}=e,c=(0,m.J)(),[d,u]=(0,i.useState)(0===r),[h,f]=(0,i.useState)(r>=t.length-1),[b,v]=(0,p.A)({align:"start",loop:!1,duration:20}),g=c&&t.length>1,y=(0,i.useRef)(null),j=(0,i.useRef)(r),w=(0,i.useCallback)(e=>{var t;(null!=(t=null==v?void 0:v.slideNodes())?t:[]).forEach((t,r)=>{t.querySelectorAll("video").forEach(t=>{if(r!==e)try{t.pause()}catch(e){}})})},[v]),N=(0,i.useCallback)(()=>{if(!v)return;let e=v.selectedScrollSnap();u(!v.canScrollPrev()),f(!v.canScrollNext()),w(e),l(e)},[v,l,w]),k=(0,i.useCallback)(()=>{if(!v)return;let e=y.current;y.current=null,(null==e?void 0:e.type)==="prev"?v.scrollPrev():(null==e?void 0:e.type)==="next"?v.scrollNext():(null==e?void 0:e.type)==="to"?v.scrollTo(e.index):v.selectedScrollSnap()!==r&&v.scrollTo(r)},[r,v]);(0,i.useEffect)(()=>{if(v)return k(),N(),v.on("select",N),v.on("reInit",N),()=>{v.off("select",N),v.off("reInit",N)}},[k,v,N]),(0,i.useEffect)(()=>{null==v||v.reInit()},[t.length,v]),(0,i.useEffect)(()=>{let e=j.current!==r;if(j.current=r,e){if(!v){y.current={type:"to",index:r};return}v.selectedScrollSnap()!==r&&v.scrollTo(r)}},[r,v]);let S=(0,i.useCallback)(()=>{if(v)return void v.scrollPrev();y.current={type:"prev"}},[v]),_=(0,i.useCallback)(()=>{if(v)return void v.scrollNext();y.current={type:"next"}},[v]),C=(0,i.useCallback)(e=>{if(v)return void v.scrollTo(e);y.current={type:"to",index:e}},[v]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"w-full group max-w-full relative product_gallery",children:[(0,n.jsx)("div",{ref:g?b:void 0,className:"w-full aspect-4/3 overflow-hidden lg:rounded-lg",children:(0,n.jsx)("div",{className:"flex h-full",children:t.map((e,t)=>(0,n.jsx)("div",{className:"min-h-0 min-w-0 shrink-0 grow-0 basis-full cursor-pointer",children:(0,n.jsx)(a.K,{item:e,index:t,mode:"main",onClick:o,classNames:{base:"lg:rou
1nded-lg overflow-hidden"}})},t))})}),t.length>1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{className:"".concat(x," ").concat(d?"cursor-not-allowed opacity-30":"cursor-pointer"," left-1 "),onClick:S,disabled:d,"aria-label":"Previous image",children:(0,n.jsx)(s.Z3,{size:1})}),(0,n.jsx)("button",{className:"".concat(x," ").concat(h?"cursor-not-allowed opacity-30":"cursor-pointer"," right-1"),onClick:_,disabled:h,"aria-label":"Next image",children:(0,n.jsx)(s.WL,{size:1})}),(0,n.jsx)("div",{className:"gallery-pagination absolute bottom-px left-0 z-10 flex w-full justify-center gap-1",children:t.map((e,t)=>(0,n.jsx)("button",{type:"button",className:"gallery-pagination-dot ".concat(t===r?"is-active":""),"aria-label":"Go to image ".concat(t+1),onClick:()=>C(t)},t))})]})]}),(0,n.jsx)("style",{lang:"scss",children:"\n .product_gallery .gallery-pagination {\n width: 100%;\n display: flex;\n justify-content: center;\n gap: 4px;\n bottom: 1px;\n .gallery-pagination-dot {\n flex-shrink: 1;\n width: 40px;\n height: 20px;\n margin: 0;\n background: transparent;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n opacity: 1;\n border: 0;\n padding: 0;\n &:after {\n content: '';\n display: block;\n width: 100%;\n height: 2px;\n background-color: #e1e1e1;\n transition: transform 0.2s ease;\n transform-origin: bottom;\n }\n &:hover:after {\n transform: scaleY(2);\n }\n &.is-active {\n &:after {\n background-color: var(--brand-color);\n }\n }\n }\n }\n @media (max-width: 1024px) {\n .product_gallery .gallery-pagination {\n gap: 3px;\n .gallery-pagination-dot {\n width: 20px;\n height: 20px;\n }\n }\n }\n "})]})}var f=r(74079);let b=(0,l.default)(()=>r.e(2239).then(r.bind(r,22239)),{loadableGenerated:{webpack:()=>[22239]},ssr:!1}),v=e=>{let{mediaList:t}=e,[r,l]=(0,i.useState)(0),[a,s]=(0,i.useState)(!1),o=(0,u.wR)(),{isScreenLg:c}=(0,f.l)(),p=(0,i.useCallback)(e=>{if(0===t.length)return;let r=Math.max(0,Math.min(e,t.length-1));l(e=>e===r?e:r)},[t.length]);return 0===t.length?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"md:p-1.5 xl:p-2.5 bg-white",children:(0,n.jsxs)("div",{className:"w-full min-w-0 box-border relative lg:pl-26 xl:pl-30",children:[(0,n.jsx)("div",{className:"hidden lg:block w-24 xl:w-27.5 h-full absolute left-0 top-0 z-10 overflow-hidden",children:!c&&(0,n.jsx)(d,{items:t,activeIndex:r,onActiveIndexChange:p})}),(0,n.jsx)("div",{className:"min-w-0 aspect-4/3 overflow-hidden lg:rounded-lg",children:(0,n.jsx)(h,{items:t,activeIndex:r,onActiveIndexChange:p,onOpenModal:()=>s(!0)})})]})}),!o&&(0,n.jsx)(b,{isOpen:a,items:t,activeIndex:r,onClose:e=>{s(!1),p(e)}})]})};var g=r(90597),y=r(74332),j=r(27067),w=r(66415),N=r(49559),k=r(3600);function S(e){let{content:t,className:r}=e,l={replace:e=>{var t,r;if("text"===e.type){let t=e.data;if(t&&!/[^\r\n\t\f\v \u200b]/.test(t)&&/[\r\n\t\f\v\u200b]/.test(t))return(0,n.jsx)(n.Fragment,{})}if(e instanceof j.Hg){let i={...e.attribs};if("contenteditable"in i&&(delete i.contenteditable,delete e.attribs.contenteditable),null==(t=i.class)?void 0:t.includes("tips")){let t="",r=e.children,a=[];return r.forEach(e=>{if(e instanceof j.Hg){var r,n;if(null==(r=e.attribs.class)?void 0:r.includes("left-icon")){let r=(e.attribs.style||"").match(/background-color:\s*([^;]+)/i);r&&(t=r[1].trim())}else(null==(n=e.attribs.class)?void 0:n.includes("right-desc"))&&delete e.attribs.style,a.push(e)}else a.push(e)}),(0,n.jsx)("div",{className:"tips ".concat(i.class.replace("tips","").trim()),style:t?{backgroundColor:t,borderColor:t}:void 0,children:(0,j.zd)(a,l)})}if(null==(r=e.attribs)?void 0:r.style){let t=e.attribs.style.replace(/font-family:[^;]+;?/gi,"").replace(/color:[^;]+;?/gi,"").replace(/font-size:[^;]+;?/gi,"").trim();t?(e.attribs.style=t,i.style=t):(delete e.attribs.style,delete i.style)}if("a"===e.name){let{href:t,class:r,...a}=i;
1if(t){let i=t.startsWith("http://")||t.startsWith("https://"),s=(0,j.$5)(a);return(0,n.jsx)(N.N_,{href:t,className:r||"",...s,target:i?"_blank":s.target||"_self",rel:i?"noopener noreferrer":s.rel,children:(0,j.zd)(e.children,l)})}}if("table"===e.name){let{class:t,...r}=i,a=(0,j.$5)(r);return(0,n.jsx)("div",{className:"table_wrapper",children:(0,n.jsx)("table",{...a,children:(0,j.zd)(e.children,l)})})}if("video"===e.name||"iframe"===e.name){let t=i["data-src"]||i.src;return"video"===e.name?(0,n.jsx)(k.pL,{triggerOnce:!0,rootMargin:"200px",fallbackInView:!0,children:e=>{let{ref:r,inView:l}=e;return(0,n.jsx)("div",{ref:r,className:"video_wrapper aspect-video",children:l&&(0,n.jsx)("video",{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,controls:!1})})}}):(0,n.jsx)("iframe",{src:t,loading:"lazy",allowFullScreen:!0})}if("img"===e.name){let e=i["data-src"]||i.src,t=null==e?void 0:e.includes("data:image/gif;base64");if(!e||t)return(0,n.jsx)(n.Fragment,{});let r=i.width?parseInt(i.width.replace(/px|%/g,""),10):NaN,l=i.height?parseInt(i.height.replace(/px|%/g,""),10):NaN,a=isNaN(r)?void 0:r,s=isNaN(l)?void 0:l,o=i.alt||"Seeed Studio Product Details";return a&&s?(0,n.jsx)(w.LazyImage,{"data-original":e,src:e,alt:o,width:a,height:s,quality:100,className:" ".concat(i.class||""),sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 100vw, 1400px",unoptimized:/.svg$|\/wysiwyg\/certification\//.test(e)||/data:image/.test(e)}):(0,n.jsx)("img",{src:e,alt:o,loading:"lazy",className:" ".concat(i.class||"")})}}}};if(!t)return null;let i=t.replace(/\r/g,"").replace(/=""([^"<>]*)""/g,'="$1"');return(0,n.jsx)("div",{className:r||"product_html_content",children:(0,j.Ay)(i,l)})}var _=r(75211),C=r.n(_);function I(e){let{content:t=""}=e;return(0,n.jsxs)("div",{className:"jsx-93efc6ac53268136 text-13 product_document text-t1color",children:[(0,n.jsx)(S,{content:t}),(0,n.jsx)(C(),{id:"93efc6ac53268136",children:".product_document{word-break:auto-phrase;white-space:normal;line-height:1.4}.product_document li{margin-top:10px;list-style:disc;list-style-position:inside}.product_document p{margin-top:10px}.product_document a{color:var(--brand-color)}"})]})}var z=r(1789);function O(e){let{content:t}=e;return t&&0!==t.length?(0,n.jsxs)("div",{className:"jsx-2ca9e66285af97b3 ",children:[(0,n.jsx)("div",{className:"jsx-2ca9e66285af97b3 rounded-lg shadow-none border border-zinc-200 overflow-hidden product_faq_panel",children:t.map((e,t)=>(0,n.jsx)(z.A,{ariaLabel:"faq-".concat(t),indicator:(0,n.jsx)(s.WL,{size:.8}),title:(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:(null==e?void 0:e.question)||""},className:"jsx-2ca9e66285af97b3 text-[12px] md:text-[13px] lg:text-[14px] text-black font-medium leading-[1.4]"}),classNames:{trigger:"w-full flex items-center justify-between py-1.5 min-h-[45px] text-left cursor-pointer px-2",content:"py-0 pb-3 px-2",indicator:"shrink-0 transition-transform duration-200 data-[state=open]:rotate-90 text-black"},children:(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:(null==e?void 0:e.answer)||""},className:"jsx-2ca9e66285af97b3 text-[12px] md:text-[13px] lg:text-[13px] text-zinc-600 faq_answer"})},String(t)))}),(0,n.jsx)(C(),{id:"2ca9e66285af97b3",children:".faq_answer a{color:var(--brand-color);font-weight:600;text-decoration:none}.faq_answer a:hover{text-decoration:underline}"})]}):null}r(93377);let P=(0,l.default)(()=>r.e(5931).then(r.bind(r,25931)),{loadableGenerated:{webpack:()=>[25931]},ssr:!1}),M=(0,l.default)(()=>r.e(1630).then(r.bind(r,1630)),{loadableGenerated:{webpack:()=>[1630]},ssr:!1});function A(e){let{product:t}=e,r=(0,y.c)("product.detail.sections"),[l,a]=(0,i.useState)(""),s=(0,u.wR)(),o=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)(new Map),p=(0,i.useMemo)(()=>[t.product_feature_description?{id:"feature",title:r("feature"),content:t.product_feature_description,type:"html"}:{id:"description",title:r("description"),content:(0,g.fY)(t),type:"html"},{id:"specification",title:r("specification"),content:t.specification,type:"html"},{id:"hardware",title:r("hardwareOverview"),content:t.hardware_overview,type:"html"},{id:"application",title:r("application"),content:t.product_application_description,type:"html"},{id:"documents",title:r("documents"),content:(0,g.HK)(t),type:"documents"},{id:"cert-eccn",title:r("certification"),content:t.certification_info_eccn,type:"html"},{id:"cert-info",title:r("certification"),content:t.certification_info,type:"html"}
1,{id:"tech-details",title:r("technicalDetails"),content:t.certification_info_tech,type:"html"},{id:"part-list",title:r("partList"),content:t.certification_info_part,type:"html"},{id:"faq",title:r("faq"),content:t.faq_list,type:"faq"}].filter(e=>"faq"===e.type?e.content&&e.content.length>0:!!e.content),[t,r]);return((0,i.useEffect)(()=>{p.length>0&&!l&&a(p[0].id)},[p,l]),(0,i.useEffect)(()=>{let e=new IntersectionObserver(e=>{let t=e.filter(e=>e.isIntersecting);t.length>0&&a(t[0].target.id)},{root:null,rootMargin:"-15% 0px -80% 0px",threshold:0});return d.current.forEach(t=>{t&&e.observe(t)}),()=>e.disconnect()},[p]),p.length)?(0,n.jsxs)("div",{className:"flex relative items-start max-w-[1200px] mx-auto",children:[p.length>1&&(0,n.jsx)("div",{className:"hidden lg:block sticky top-[calc(var(--layout-header-h)+55px)] w-40 shrink-0 ",children:(0,n.jsx)("div",{className:"w-full relative pt-3",children:p.map(e=>{let t=l===e.id;return(0,n.jsx)("div",{onClick:()=>(e=>{a(e);let t=d.current.get(e);t&&t.scrollIntoView({behavior:"instant",block:"start",inline:"nearest"})})(e.id),className:"relative text-[14px] whitespace-nowrap scale-95 origin-left transition-transform duration-200 ease-in-out flex items-center cursor-pointer min-h-9 pl-3 pr-1.5"+" ".concat(t?"text-primary font-bold scale-100":"text-zinc-700 font-normal hover:text-primary"),children:e.title},e.id)})})}),(0,n.jsx)("div",{ref:c,className:"grow min-w-0 px-2.5 pt-5",children:null==p?void 0:p.map(e=>(0,n.jsxs)("div",{id:e.id,ref:t=>{d.current.set(e.id,t)},className:"relative scroll-mt-[var(--layout-header-h)] mb-8",children:[(0,n.jsx)("h2",{className:"text-[22px] font-extrabold text-black leading-tight pb-2 md:pb-4 ",children:e.title}),"faq"===e.type?(0,n.jsx)(O,{content:e.content}):"documents"===e.type?(0,n.jsx)(I,{content:e.content}):(0,n.jsx)(S,{content:e.content})]},e.id))}),!s&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P,{ref:o}),(0,n.jsx)(M,{containerRef:c,mediaRef:o})]})]}):null}var L=r(22853);let E=(0,l.default)(()=>r.e(5931).then(r.bind(r,25931)),{loadableGenerated:{webpack:()=>[25931]},ssr:!1}),B=(0,l.default)(()=>r.e(1630).then(r.bind(r,1630)),{loadableGenerated:{webpack:()=>[1630]},ssr:!1});function q(e){let{product:t}=e,r=(0,y.c)("product.detail.sections"),[l,a]=(0,i.useState)(new Set),o=(0,i.useRef)(!1),c=(0,i.useRef)(null),d=(0,i.useRef)(null),p=(0,u.wR)(),m=(0,i.useMemo)(()=>[t.product_feature_description?{id:"feature",title:r("feature"),content:t.product_feature_description,type:"html"}:{id:"description",title:r("description"),content:(0,g.fY)(t),type:"html"},{id:"specification",title:r("specification"),content:t.specification,type:"html"},{id:"hardware",title:r("hardwareOverview"),content:t.hardware_overview,type:"html"},{id:"application",title:r("application"),content:t.product_application_description,type:"html"},{id:"documents",title:r("documents"),content:(0,g.HK)(t),type:"documents"},{id:"cert-eccn",title:r("certification"),content:t.certification_info_eccn,type:"html"},{id:"cert-info",title:r("certification"),content:t.certification_info,type:"html"},{id:"tech-details",title:r("technicalDetails"),content:t.certification_info_tech,type:"html"},{id:"part-list",title:r("partList"),content:t.certification_info_part,type:"html"},{id:"faq",title:r("faq"),content:t.faq_list,type:"faq"}].filter(e=>"faq"===e.type?e.content&&e.content.length>0:!!e.content),[t,r]),x=(0,i.useMemo)(()=>m.filter(e=>"faq"!==e.type),[m]),h=(0,i.useMemo)(()=>m.find(e=>"faq"===e.type),[m]);return((0,i.useEffect)(()=>{o.current||0!==x.length&&(o.current=!0,a(new Set([x[0].id])))},[x]),m.length)?(0,n.jsxs)("div",{ref:d,className:"w-full",children:[!p&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(E,{ref:c}),(0,n.jsx)(B,{containerRef:d,mediaRef:c})]}),(0,n.jsx)("div",{className:"px-0!",children:x.map(e=>(0,n.jsx)(z.A,{ariaLabel:e.id,open:l.has(e.id),onOpenChange:t=>{var r;return r=e.id,void a(e=>{let n=new Set(e);return t?n.add(r):n.delete(r),n})},disableAnimation:!0,destroyOnClose:!1,title:(0,n.jsx)("span",{className:"font-bold text-[13px]",children:e.title}),indicator:(0,n.jsx)(s.WL,{size:.8}),classNames:{base:"",heading:"sticky top-[calc(var(--layout-header-h)+45px)] bg-white z-20",trigger:"w-full flex items-center outline-none justify-between py-2 min-h-[45px] data-[state=open]:border-b border-b-zinc-200 px-3 text-left cursor-pointer",content:"pt-2.5 pb-3.5 px-2",indicator:"shrink-0 transition-transform duration-200 data-[state=open]:rotate-90 text-black"},children:(0,n.jsx)("div",{className:"content-wrapper",children:"documents"===e.type?(0,n.jsx)(I,{content:e.content}):(0,n.jsx)(S,{content:e.content})})},e.id))}),h?(0,n.jsxs)("div",{className:"px-2 pb-3 mt-3",children:[(0,n.jsx)("div",{className:"font-bold text-[13px] mb-3.5",children:h.title}),(0,n.jsx)(O,{content:h.content})]}):null]}):null}var T=r(4808);let W=(0,l.default)(()=>r.e(4831).then(r.bind(r,34831)),{loadableGenerated:{webpack:()=>[34831]},ssr:!1}),F=(0,l.default)(()=>Promise.all([r.e(83),r.e(4183),r.e(9636),r.e(8938),r.e(8255),r.e(7525),r.e(3895),r.e(5889),r.e(9706)]).then(r.bind(r,54887)),{loadableGenerated:{webpack:()=>[54887]},ssr:!1});function D(e){let{product:t,className:r}=e,l=(0,y.c)("product.detail.tabs"),a=(0,i.useRef)(null),[s,o]=(0,i.useState)(!1),[c,d]=(0,i.useState)("details"),[u,p]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),h=[{key:"details",title:l("details")},{key:"wiki",title:l("wikiLearn")},{key:"reviews",title:l("reviews")}];
1return(0,n.jsxs)("div",{children:[" ",(0,n.jsx)(L.A,{targetRef:a,className:"bottom-0 h-[calc(var(--layout-header-h))]"}),(0,n.jsx)("style",{scoped:!0,children:"\n .product_tabs {\n --product-tab-h: 45px;\n }\n @media (min-width: 1024px) {\n .product_tabs {\n --product-tab-h: 50px;\n }\n }\n "}),(0,n.jsx)("div",{className:"".concat(r||""," product_tabs"),children:(0,n.jsx)("div",{className:"flex w-full",children:h.map(e=>(0,n.jsx)("div",{className:"relative px-2 lg:px-3 grow-0 shrink-0 flex items-center justify-center h-(--product-tab-h) text-[13px] md:text-[14px] lg:text-[15px] cursor-pointer after:content-[''] after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.75 "+" ".concat(c===e.key?"after:bg-primary bg-primary/10 text-primary font-bold":"after:bg-transparent text-zinc-900 font-semibold"," "),onClick:()=>(e=>{if("wiki"!==e||u||p(!0),"reviews"!==e||m||x(!0),d(e),s){if(a.current&&a.current.getBoundingClientRect().top<Number((0,T.b_)("--layout-header-h")||"55")){var t;null==(t=a.current)||t.scrollIntoView({behavior:"smooth",block:"start"})}}else o(!0)})(e.key),children:(0,n.jsx)("div",{className:"whitespace-nowrap",children:e.title})},e.key))})}),(0,n.jsxs)("div",{className:"p-0 bg-white",children:[(0,n.jsxs)("div",{className:"".concat("details"===c?"":"hidden"),children:[(0,n.jsx)("div",{className:"lg:hidden",children:(0,n.jsx)(q,{product:t})}),(0,n.jsx)("div",{className:"hidden lg:block",children:(0,n.jsx)(A,{product:t})})]}),u?(0,n.jsx)("div",{className:"product_tab_wiki ".concat("wiki"===c?"":"hidden"),children:(0,n.jsx)(W,{product:t})}):null,m?(0,n.jsx)("div",{className:"product_tab_reviews ".concat("reviews"===c?"":"hidden"),children:(0,n.jsx)(F,{productId:Number((0,g.OX)(t)),previewSize:10})}):null]})]})}var V=r(64884),R=r(28205),Q=r(21407);function G(){let e=(0,V._)(["\n\n query ProductRelated($id: String, $alsoAdd: Boolean = false, $guessYourLike: Boolean = false) {\n products(filter: { id: { eq: $id } }) {\n items {\n related_products @include(if: $guessYourLike) {\n uid\n is_recommend\n ","\n }\n upsell_products @include(if: $alsoAdd) {\n ","\n }\n }\n }\n }\n"]);return G=function(){return e},e}let H="\n id\n __typename\n sku\n name\n stock_status\n short_description {\n html\n }\n thumbnail {\n url\n label\n }\n url_key\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n }\n }\n \n",U=(0,R.J1)(G(),H,H),K=()=>{let[e,{data:t,loading:r,error:n}]=(0,Q._)(U,{fetchPolicy:"no-cache",nextFetchPolicy:"no-cache"});return{query:e,data:t,loading:r,error:n}};var Y=r(29793),$=r(85959),Z=r(63432),J=r(26542),X=r(73101),ee=r(30830);let et=e=>{let{product:t,gaData:r,...l}=e,i=(0,ee.Zh)(t);return(0,n.jsx)(X.f,{product:i,gaData:r,...l})};var er=r(73117);let en=[{minWidth:0,slidesPerView:1.8,slidesPerGroup:1,spaceBetween:5,maxSlideWidth:200},{minWidth:420,slidesPerView:2.3,slidesPerGroup:2,spaceBetween:5,maxSlideWidth:200},{minWidth:540,slidesPerView:2.5,slidesPerGroup:2,spaceBetween:5,maxSlideWidth:200},{minWidth:640,slidesPerView:3,slidesPerGroup:3,spaceBetween:5,maxSlideWidth:200},{minWidth:768,slidesPerView:3.5,slidesPerGroup:3,spaceBetween:6,maxSlideWidth:200},{minWidth:1024,slidesPerView:4,slidesPerGroup:4,spaceBetween:8,maxSlideWidth:200},{minWidth:1320,slidesPerView:4.2,slidesPerGroup:4,spaceBetween:8,maxSlideWidth:200}];function el(e){let t="\n .product_card_swiper {\n --gap: ".concat(e.spaceBetween,"px;\n --slide-max-width: ").concat(e.maxSlideWidth,"px;\n --slide-width: ").concat(function(e){let{slidesPerView:t,spaceBetween:r,maxSlideWidth:n}=e,l=(100/t).toFixed(6),i=((t-1)*r/t).toFixed(6);return"min(".concat(n,"px, ")+"calc(".concat(l,"% - ").concat(i,"px)
1)")}(e),";\n }\n ");return 0===e.minWidth?t:"\n @media (min-width: ".concat(e.minWidth,"px) {\n ").concat(t,"\n }\n ")}function ei(e){let{title:t,items:r,className:l="min-h-0 w-full overflow-hidden",bodyClassName:a="mt-2 lg:mt-3 lg:pb-2.5",buttonClassName:c="transition-opacity border border-transparent text-zinc-600 hover:bg-black/10 max-md:w-5 max-md:h-5 min-w-0",getKey:d,renderItem:u}=e,p=(0,i.useCallback)(e=>(function(e){let t=en[0];for(let r of en)e>=r.minWidth&&(t=r);return t})(e.clientWidth).slidesPerGroup,[]),{scrollerRef:m,isBeginning:x,isEnd:h,canNavigate:f,scrollPrev:b,scrollNext:v}=(0,o.sT)({refreshKey:r.length,step:"slide",slidesPerGroup:p});if(!r.length)return null;let g=r.length>1&&f;return(0,n.jsxs)("div",{className:l,children:[(0,n.jsx)("style",{children:"\n ".concat(en.map(el).join("\n"),"\n .product_card_swiper .product-related-track {\n display: flex;\n gap: var(--gap);\n }\n .product_card_swiper .product-related-slide {\n flex: 0 0 var(--slide-width);\n min-width: 0;\n max-width: var(--slide-max-width);\n }\n ")}),(0,n.jsxs)("div",{className:"flex justify-between gap-1 lg:pt-3 pt-3 lg:pl-2 pl-1",children:[(0,n.jsx)("div",{className:"text-[14px] text-black lg:text-[18px] font-bold",children:t}),g?(0,n.jsxs)("div",{className:"flex items-center justify-center gap-3 max-md:hidden",children:[(0,n.jsx)(er.T,{variant:"light",size:"sm",className:c,onPress:b,isIconOnly:!0,isDisabled:x,radius:"full","aria-label":"Previous",children:(0,n.jsx)(s.Z3,{size:1})}),(0,n.jsx)(er.T,{variant:"light",className:c,onPress:v,isIconOnly:!0,size:"sm",isDisabled:h,radius:"full","aria-label":"Next",children:(0,n.jsx)(s.WL,{size:1})})]}):null]}),(0,n.jsx)("div",{className:a,children:(0,n.jsx)("div",{className:"product_card_swiper overflow-hidden",children:(0,n.jsx)("div",{ref:m,className:"".concat(o.ps," product-related-track"),children:r.map((e,t)=>{var r;return(0,n.jsx)("div",{className:"product-related-slide",children:u(e,t)},null!=(r=null==d?void 0:d(e,t))?r:t)})})})})]})}function ea(e){let{product:t,className:r}=e,l=(0,y.c)("product.detail.guessYourLike"),{query:a}=K(),[s,o]=(0,Y.lT)([J.V8.ProductRecommendABTest]),c=s[J.V8.ProductRecommendABTest],[d,p]=(0,i.useState)([]),[x,h]=(0,i.useState)({}),f=(0,i.useRef)(!1),b=(0,u.wR)(),v=(0,m.J)(),j=(0,i.useMemo)(()=>String((0,g.d1)(t)||""),[t]),w=(0,i.useMemo)(()=>String((0,g.OX)(t)||""),[t]);(0,i.useEffect)(()=>{if(!w)return;let e=c||(.5>Math.random()?"A":"B");c||o(J.V8.ProductRecommendABTest,e,{maxAge:7200,sameSite:"lax"}),a({variables:{id:w,guessYourLike:!0}}).then(t=>{var r,n,l,i;let a=null==t||null==(i=t.data)||null==(l=i.products)||null==(n=l.items)||null==(r=n[0])?void 0:r.related_products,s=Array.isArray(a)?a:[];if(p(s),f.current||0===s.length)return;let o=[],c=[];s.forEach(e=>{let t=String((null==e?void 0:e.sku)||"");t&&(o.push(t),"1"===String((null==e?void 0:e.is_recommend)||"")&&c.push(t))});let d=(0,J.d0)(),u="".concat(d?d+"::":"").concat(Math.random().toString(16).slice(2,10),"::").concat(j),m="".concat(Z.wL.ProductGuessYouLike,"::").concat(e,"::").concat(j),x={c_event_id:u,c_items:o.slice(0,9).join(","),c_items1:o.slice(9,18).join(","),c_items2:o.slice(18,27).join(","),c_recommend_items:c.slice(0,9).join(","),c_items3:c.slice(9,18).join(",")};h(x),(0,$.sendGAEvent)("event",Z.xf.E_recommend_products,{...x,c_event_medium:m}),f.current=!0})},[c,j,w,a,o]);let N=e=>{let t="1"===String((null==e?void 0:e.is_recommend)||""),r="".concat(t?Z.wL.ProductRecommend:Z.wL.ProductGuessYouLike,"::").concat(c||"-","::").concat(j);return{...x,c_click_target:r,c_add_to_cart_from:r,c_event_medium:r}};if(!d||0===d.length||!v||b)return null;let k=e=>{(0,$.sendGAEvent)("event",Z.xf.E_recommend_product_click,N(e))};return(0,n.jsx)(ei,{title:l("title"),items:d,className:r||"min-h-0 w-full overflow-hidden",getKey:(e,t)=>(null==e?void 0:e.uid)||(null==e?void 0:e.sku)||t,renderItem:e=>(0,n.jsx)(et,{product:e,gaData:N(e),linkProps:{target:"_blank"},classNames:{base:"bg-white rounded-xl overflow-hidden border border-gray-200 hover:border-primary",title:"mt-1 text-[12px] sm:text-[13px] leading-[1.5] min-h-[calc(1.5*3em)] line-clamp-3 text-black group-hover:text-primary",warehouse:"hidden"},onClick:k})})}function es(e){let{product:t,className:r}=e,l=(0,y.c)("product.detail.alsoAdd"),{query:a}=K(),[s,o]=(0,i.useState)([]),c=(0,i.useMemo)(()=>String((0,g.d1)(t)||""),[t]),d=(0,i.useMemo)(()=>String((0,g.OX)(t)||""),[t]),u=(0,i.useMemo)(()=>(null==t?void 0:t.upsell_products)||[],[t]),p=(0,m.J)();return((0,i.useEffect)(()=>
1{if(d&&p){if(u.length>0)return void o(u);a({variables:{id:d,alsoAdd:!0}}).then(e=>{var t,r,n,l;let i=null==e||null==(l=e.data)||null==(n=l.products)||null==(r=n.items)||null==(t=r[0])?void 0:t.upsell_products;o(Array.isArray(i)?i:[])})}},[c,d,u,a,p]),s&&0!==s.length&&p)?(0,n.jsx)(ei,{title:l("title"),items:s,className:r||"bg-white pl-2 lg:px-2.5 rounded-xl w-full overflow-hidden",bodyClassName:"mt-2 lg:mt-3 pb-2.5 max-w-full overflow-hidden",buttonClassName:"transition-opacity border border-transparent text-zinc-600 hover:bg-black/10",getKey:(e,t)=>(null==e?void 0:e.uid)||(null==e?void 0:e.sku)||t,renderItem:e=>(0,n.jsx)(et,{product:e,gaData:(e=>{let t="".concat(Z.wL.ProductAlsoAdd,"::-::").concat(c);return{c_add_to_cart_from:t,c_event_medium:t}})(0),linkProps:{target:"_blank"},classNames:{base:"bg-white rounded-lg overflow-hidden border border-gray-200 hover:border-primary",title:"mt-1 lg:mt-1.5 text-[12px] md:text-[13px] leading-[1.4] min-h-[calc(1.4*3em)] line-clamp-3 text-black group-hover:text-primary",warehouse:"hidden"}})}):null}var eo=r(35933),ec=r(56809),ed=r(6215);function eu(e){let{product:t,warehouseId:r,qty:l,syncPriceByQty:a=!0,className:s,classNames:o}=e,c=(0,i.useMemo)(()=>(0,g.y8)(t,r,a?l:void 0),[t,r,l,a]),d=(0,g.kc)(t),u=c.currency||ed.hf.Usd,p=d===eo.po.Bundle,m="number"==typeof c.maximum&&c.maximum>c.regular,x=!p&&c.saved>0,h=(0,ec.LM)(c.regular,u),f=(0,ec.LM)(c.final,u),b=(0,ec.LM)(c.maximum,u),v="font-extrabold text-[24px] lg:text-[30px] xl:text-[32px] flex items-end gap-1 ".concat(((null==f?void 0:f.length)||0)>5?"scale-90 origin-bottom-left":((null==f?void 0:f.length)||0)>7?"scale-80 origin-bottom-left":""),y=((null==b?void 0:b.length)||0)+((null==f?void 0:f.length)||0),j="font-extrabold text-[16px] md:text-[22px] xl:text-[24px] ".concat(y>8?"scale-90 origin-bottom-left":y>10?"scale-80 origin-bottom-left":"");return(0,n.jsxs)("div",{className:s||"",children:[(0,n.jsx)("div",{className:(null==o?void 0:o.priceRow)||"flex items-center max-w-full flex-wrap leading-none text-price",children:p?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(null==o?void 0:o.rangePrice)||j,children:(0,n.jsx)("div",{className:"flex items-end gap-0.5",children:h})}),m?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(null==o?void 0:o.rangeLine)||"bg-price w-2.5 mx-0.75 h-0.5"}),(0,n.jsx)("div",{className:(null==o?void 0:o.rangePrice)||j,children:b})]}):null]}):(0,n.jsxs)("div",{className:(null==o?void 0:o.normalPrice)||v,children:[(0,n.jsx)("span",{className:"text-[12px] lg:text-[15px] lg:pb-0.5",children:u}),f]})}),x?(0,n.jsxs)("div",{className:"flex items-center gap-0.5 mt-1",children:[(0,n.jsxs)("span",{className:(null==o?void 0:o.specialPrice)||"text-t3color font-bold text-[12px] scale-90 origin-bottom-left line-through flex",children:[" ",(0,ec.LM)(c.regular,u)]}),(0,n.jsxs)("div",{className:(null==o?void 0:o.savedInfo)||"text-price font-bold text-[14px]",children:[(0,n.jsx)("span",{className:"text-[12px] text-zinc-600 scale-90 origin-bottom-left",children:"Save"})," ",(0,n.jsx)("span",{className:"text-[13px] font-semibold",children:(0,ec.LM)(c.saved,u)}),c.savedPercent>0&&(0,n.jsxs)("span",{className:"text-[13px] scale-90 origin-bottom-left",children:["(",c.savedPercent,"%)"]})]})]}):null]})}var ep=r(59147);function em(e){var t,r;let{product:l,warehouseId:a}=e,o=(0,i.useMemo)(()=>(0,g.UJ)(l,a)||[],[l,a]),c=o[1];return(0,g.kc)(l)!==eo.po.Bundle&&c?(0,n.jsxs)(ep.A,{classNames:{base:"self-start",trigger:"group flex cursor-pointer items-center rounded-full px-1.5 text-[12px] gap-0 transition-colors duration-200 hover:bg-default-100 min-h-7.5",content:"rounded-md border border-zinc-200 bg-background px-2.5 py-2"},content:(0,n.jsx)("div",{className:"min-w-25 space-y-1.5 py-1",children:o.map((e,t)=>{var r,l;return(0,n.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 text-[13px]",children:[(0,n.jsxs)("span",{children:[Number((null==e?void 0:e.quantity)||0),"+"]}),(0,n.jsx)("span",{className:"font-semibold text-zinc-800",children:(0,ec.LM)(Number((null==e||null==(r=e.final_price)?void 0:r.value)||0),(null==e||null==(l=e.final_price)?void 0:l.currency)||ed.hf.Usd)})]},String((null==e?void 0:e.quantity)||t))})}),children:[(0,n.jsxs)("div",{className:"inline-flex gap-1",children:[Number((null==c?void 0:c.quantity)||0),"+",(0,n.jsx)("span",{className:"ml-1 font-semibold",children:(0,ec.LM)(Number((null==c||null==(t=c.final_price)?void 0:t.value)||0),(null==c||null==(r=c.final_price)?void 0:r.currency)||ed.hf.Usd)})]}),(0,n.jsx)(s.k5,{size:.7,className:"transition-transform duration-200 group-data-[state=open]:rotate-180"})]}):null}
1var ex=r(36279),eh=r(19849),ef=r(76104),eb=r(21032),ev=r(38262),eg=r(93120);function ey(e){let{classNames:t,max:r,min:l=1,debounce:a=300,isError:o=!1,onFocus:c}=e,{qty:d,setQty:u,currentStock:p}=(0,eb.B)(),{isEnough:m}=p||{},[x,h]=(0,i.useState)(d);p&&(p.stockStatus,eo.VL.OutOfStock),(0,i.useEffect)(()=>{h(d)},[d]),(0,eg.A)(()=>{x!==d&&u(x)},a,[x,d]);let f="flex cursor-pointer w-10 lg:w-12 px-1 h-full items-center justify-center text-zinc-600 hover:bg-zinc-100 hover:scale-110 transition-transform duration-100 hover:text-black";return(0,n.jsxs)("div",{className:"group "+"".concat(o||!m?"border-red-500 text-danger ":"border-zinc-200 text-black hover:border-primary focus-within:border-primary"," ")+"".concat((null==t?void 0:t.base)||"flex h-9 lg:h-10 items-center overflow-hidden rounded-lg border max-w-30"),children:[(0,n.jsx)("button",{type:"button","aria-label":"decrease quantity",onClick:()=>{h(e=>Math.max(l,e-1))},className:(null==t?void 0:t.button)||f,children:(0,n.jsx)(s.xj,{size:.8})}),(0,n.jsx)("input",{value:x,onChange:e=>{let t=Number.parseInt(e.target.value.trim(),10);Number.isNaN(t)||h(Math.max(1,t))},inputMode:"numeric",onFocus:()=>null==c?void 0:c(),className:"h-full w-full border-0 bg-transparent text-center text-[16px] font-bold outline-none focus:outline-none"}),(0,n.jsx)("button",{type:"button","aria-label":"increase quantity",onClick:()=>{r&&x>=r||h(e=>e+1)},className:(null==t?void 0:t.button)||f,children:(0,n.jsx)(s.WS,{size:.8})})]})}var ej=r(91155),ew=r(31347),eN=r(55095);let ek=(0,l.default)(()=>Promise.resolve().then(r.bind(r,78105)),{loadableGenerated:{webpack:()=>[78105]},ssr:!1});function eS(){let{sku:e,qty:t,currentWarehouseId:r,currentStock:l,purchaseLimit:a,purchaseLimitChecked:s,warehouseOptions:o,productStage:c,salesMoq:d}=(0,eb.B)(),u=(0,y.c)("product.addCartBtn"),[p,m]=(0,i.useState)(!1),x=!l||(null==l?void 0:l.stockStatus)===eo.VL.OutOfStock,h=(()=>{if(!l)return"addToCart";let{stockStatus:e}=l;return e===eo.VL.Preorder?"preOrder":e===eo.VL.BackOrder?"backOrder":"addToCart"})(),f=!!l&&(!l.isEnough||null!=a&&!!a.clause&&!s);return x?c===eo.T2.EOL?(0,n.jsx)("div",{className:"flex cursor-not-allowed h-9 w-full items-center justify-center rounded-full bg-zinc-100 px-2 text-[12px] text-zinc-400 md:h-10 lg:h-12 lg:text-[16px]",children:u("discontinued")}):c===eo.T2.MP&&d>0?(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)("a",{href:"https://www.seeed.cc/contacts",target:"_blank",rel:"noopener noreferrer",className:"flex h-9 w-full items-center justify-center rounded-full bg-primary/90 px-2 text-[12px] font-semibold text-white transition-all hover:bg-primary hover:ring-2 hover:ring-primary hover:ring-offset-2 md:h-10 lg:h-12 lg:text-[16px]",children:u("requestInfo")}),(0,n.jsx)("p",{className:"text-center text-xs text-danger",children:u("moq",{count:d})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",onClick:()=>m(!0),className:"w-full cursor-pointer rounded-full bg-primary/90 px-2 text-[12px] font-semibold text-white transition-all h-9 md:h-10 lg:h-12 lg:text-[16px] hover:bg-primary hover:ring-2 hover:ring-primary hover:ring-offset-2",children:u("subscribe")}),(0,n.jsx)(ek,{isOpen:p,onClose:()=>m(!1),warehouseIds:o})]}):(0,n.jsx)(ew.A,{sku:e,quantity:t,warehouseId:null!=r?r:void 0,onSuccess:()=>(0,eN.r)({quantity:t}),buttonProps:{disabled:f},classNames:{base:" w-full text-white h-9 md:h-10 lg:h-12 rounded-full font-semibold text-[12px] lg:text-[16px] px-2 ",enabled:"cursor-pointer hover:ring-2 hover:ring-primary hover:ring-offset-2 bg-primary/90 hover:bg-primary/100",disabled:"cursor-not-allowed bg-primary/60",adding:"bg-primary/70 cursor-normal animation-pulse ring-2 ring-primary/50 ring-offset-2",added:"bg-primary"},children:e=>{let{isAdding:t,added:r}=e;return(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[t&&(0,n.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border border-white border-b-transparent border-t-transparent"}),(0,n.jsx)("span",{children:t?u("adding"):r?u("added"):u(h)})]})}})}var e_=r(55907),eC=r(59341),eI=r(64796),ez=r(99282),eO=r(94537),eP=r(49099),eM=r(92612);
1let eA=[eo.VL.OutOfStock,eo.VL.BackOrder,eo.VL.Preorder,eo.VL.InStock],eL=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=Number(e);if(!Number.isFinite(r))return t;let n=Math.floor(Math.abs(r));return n>0?n:t},eE=e=>(null==e?void 0:e.id)!==void 0&&(null==e?void 0:e.id)!==null?String(e.id):"",eB=e=>Number((null==e?void 0:e.id)||0),eq=e=>{let t=(null==e?void 0:e.warehouseStockData)||{},r=new Set;for(let e in t){if(!Object.prototype.hasOwnProperty.call(t,e))continue;let n=t[e]||{};for(let e in n){let t=Number(e);Number.isFinite(t)&&t>0&&r.add(t)}}return Array.from(r)},eT=(e,t)=>(e=>{let t=null==e?void 0:e.items;return Array.isArray(t)?t.filter(Boolean):[]})(e).sort((e,t)=>Number(e.position||0)-Number(t.position||0)).map(r=>{let n=Number(r.option_id||0),l=(e=>{let t=String(e||"").toLowerCase();return"radio"===t?"radio":"select"===t?"select":"multi"===t?"multi":"checkbox"})(r.type),i=(r.options||[]).filter(e=>!!((null==e?void 0:e.product)&&eB(e))),a=(e=>"checkbox"===e||"multi"===e)(l)&&!(i.length<=1&&r.required),s=i.slice().sort((e,t)=>Number(e.position||0)-Number(t.position||0)).map(r=>{let l=r.product,i=eL(r.quantity,1),s=(0,g.bY)(i,l,t||void 0);return{optionId:n,selectionId:eB(r),label:r.label||(null==l?void 0:l.bundle_model_name)||l.name||l.sku||"",quantity:i,disabled:(e=>{let{parentProduct:t,product:r,quantity:n,warehouseId:l}=e;if(!l)return!1;let i=eD({product:t,productId:eE(r),warehouseId:String(l)});return!i||!(0,eI.pr)({product:r,qty:n,stockData:i}).isEnough})({parentProduct:e,product:l,quantity:i,warehouseId:t}),canChangeQuantity:!!r.can_change_quantity||a,isDefault:!!r.is_default,product:l,price:{value:s.value,unitPrice:s.unitPrice,currency:s.currency}}});return{optionId:n,title:r.title||"",required:!!r.required,type:l,position:Number(r.position||0),selections:s}}),eW=e=>{let t={};for(let r of e){let e=String(r.optionId);for(let n of(t[e]={},r.selections.filter(e=>e.isDefault&&!e.disabled)))t[e][String(n.selectionId)]=n.quantity}return t},eF=e=>{let t={};for(let r of e){if(!t[r.productId]){t[r.productId]={...r};continue}t[r.productId]={...t[r.productId],qtyPerSet:t[r.productId].qtyPerSet+r.qtyPerSet}}return Object.values(t)},eD=e=>{var t;let r=((null==(t=e.product)?void 0:t.warehouseStockData)||{})[e.productId];return(null==r?void 0:r[e.warehouseId])||null},eV=e=>{if(!e)return 0;let t=(0,ez.qg)(e,"yyyyMMdd",new Date);if((0,eO.f)(t))return t.getTime();let r=(0,eP.H)(e);return(0,eO.f)(r)?r.getTime():0},eR=e=>{let t="",r=0;for(let n of e){let e=eV(n);e>r&&(r=e,t=n)}return t},eQ=e=>{for(let t of eA)if(e.some(e=>e.stockStatus===t))return t;return eo.VL.InStock},eG=e=>{let{stock:t,shipmentConfig:r}=e,n=t.deliveryDate;if(n&&r&&t.stockStatus===eo.VL.BackOrder){let e=r[eo.Ob.Holidays]||{},t=r[eo.Ob.Workdays]||{};n=(0,eI.Wi)(n,e,t,r[eo.Ob.BufferDays]||0,r[eo.Ob.ShipBufferDays]||1)}return{...t,deliveryDate:n,leadTime:n?(0,eO.f)((0,eP.H)(n))?(0,eM.GP)((0,eP.H)(n),"PP"):n:""}},eH=(0,i.createContext)(null),eU=e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?null:t},eK=e=>{let{warehouseOptions:t,ipCountry:r,shipmentConfig:n,storeConfigDefaultWarehouseId:l}=e;if(0===t.length)return null;let i=eU(((null==n?void 0:n[eo.Ob.CountryWarehouseMap])||{})[r]);if(i&&t.includes(i))return i;let a=eU(l);return a&&t.includes(a)?a:t[0]};function eY(e){let{product:t,children:r}=e,l=(0,g.kc)(t)===eo.po.Bundle,[a]=(0,Y.lT)([J.V8.CFCountryCode]),s=(0,eC.Yb)(e=>e.productConfig),o=(0,eC.Yb)(e=>e.storeConfig),c=eU((0,e_.useSearchParams)().get("warehouse")),[d,u]=(0,i.useState)(1),[p,m]=(0,i.useState)(()=>null!==c?"manual":"auto"),x=(0,i.useMemo)(()=>l?eq(t):[],[l,t]),h=a[J.V8.CFCountryCode]||"",[f,b]=(0,i.useState)(()=>null!==c&&x.includes(c)?c:eK({warehouseOptions:x,ipCountry:h,shipmentConfig:s,storeConfigDefaultWarehouseId:null==o?void 0:o.default_warehouse_id})),v=(0,i.useMemo)(()=>l?eT(t):[],[l,t]),y=(0,i.useMemo)(()=>l?eT(t,f):[],[l,t,f]),[j,w]=(0,i.useState)(()=>eW(v));(0,i.useEffect)(()=>{w(eW(v))},[v]);let N=(0,i.useCallback)(e=>{u((e=>{let t=Number.isFinite(e)?Math.floor(Math.abs(e)):1;return t>0?t:1})(e))},[]),k=(0,i.useCallback)(e=>{b(e),m("manual")},[]),S=(0,i.useCallback)((e,t,r)=>{w(n=>(e=>{let t,{options:r,selectedOptions:n,optionId:l,selectionId:i,qty:a}=e,s=r.find(e=>e.optionId===l);if(!s)return n;let o=String(l),c=String(i),d=Math.max(0,Math.floor(Number(a)||0)),u=s.selections.find(e=>e.selectionId===i),p={...n,[o]:{...n[o]||{}}};return d>0&&(null==u?void 0:u.disabled)||("radio"===(t=s.type)||"select"===t?p[o]=d>0?{[c]:d}:{}:d>0?p[o][c]=d:delete p[o][c]),p})({options:y,selectedOptions:n,optionId:e,selectionId:t,qty:r}))}
1,[y]),{children:_,isValid:C}=(0,i.useMemo)(()=>(e=>{let{options:t,selectedOptions:r}=e,n=[],l=!0;for(let e of t){let t=r[String(e.optionId)]||{},i=Object.keys(t).filter(r=>{var n;return Number(t[r])>0&&!(null==(n=e.selections.find(e=>String(e.selectionId)===r))?void 0:n.disabled)});for(let r of(e.required&&0===i.length&&(l=!1),i)){let l=e.selections.find(e=>String(e.selectionId)===r);if(!l||l.disabled)continue;let i=eE(l.product);if(!i)continue;let a=eL(t[r],1);n.push({optionId:e.optionId,selectionId:l.selectionId,productId:i,sku:(0,g.d1)(l.product),label:l.label,qtyPerSet:a,product:l.product,unitPrice:l.price.unitPrice,currency:l.price.currency})}}return{children:n,isValid:l}})({options:y,selectedOptions:j}),[y,j]),I=(0,i.useMemo)(()=>l?(e=>{let{product:t,children:r,setsQty:n,shipmentConfig:l}=e,i=eq(t),a=eF(r),s={};for(let e of i){let r={},i=[],o=1/0;for(let l of a){let a=eD({product:t,productId:l.productId,warehouseId:String(e)});if(!a)continue;let s=(0,eI.pr)({product:l.product,qty:l.qtyPerSet*n,stockData:a}),c=l.qtyPerSet>0?Math.floor(Number(s.totalCount||0)/l.qtyPerSet):0,d={...s,optionId:l.optionId,selectionId:l.selectionId,productId:l.productId,label:l.label,qtyPerSet:l.qtyPerSet,maxSets:c,warehouseId:String(e)};i.push(s),r[l.productId]=d,o=Math.min(o,c)}if(0===i.length)continue;let c=eQ(i),d=n<=o&&o>0,u=i.filter(e=>e.stockStatus===eo.VL.BackOrder),p=u.some(e=>!e.deliveryDate),m=c!==eo.VL.BackOrder||p?"":eR(u.map(e=>e.deliveryDate)),x=d&&c===eo.VL.InStock?n:0,h=d&&c===eo.VL.BackOrder?n:0;s[String(e)]=eG({stock:{inputQty:n,stockStatus:c,isEnough:d,instockCount:c===eo.VL.InStock&&Number.isFinite(o)?o:0,backorderQty:c===eo.VL.BackOrder&&Number.isFinite(o)?o:0,totalCount:Number.isFinite(o)?o:0,shortfallQty:Math.max(n-(Number.isFinite(o)?o:0),0),instockOnDemand:x,backorderOnDemand:h,deliveryDate:m,leadTime:"",warehouseId:String(e),childStocks:r,totalSets:Number.isFinite(o)?o:0},shipmentConfig:l})}return s})({product:t,children:_,setsQty:d,shipmentConfig:s}):{},[l,t,_,d,s]),z=(0,i.useMemo)(()=>I,[I]);(0,i.useEffect)(()=>{l&&"manual"!==p&&b((e=>{let{resolvedWarehouse:t,warehouseOptions:r,computedStocks:n}=e;if(0===r.length)return null;let l=e=>e&&n[String(e)]||null,i=e=>{var t;return Number((null==(t=l(e))?void 0:t.instockCount)||0)>0},a=e=>{var t;return Number((null==(t=l(e))?void 0:t.backorderQty)||0)>0},s=r.find(e=>i(e));if(s)return i(t)?t:s;if(a(t))return t;let o=r.find(e=>a(e));return o||(t&&r.includes(t)?t:r[0])})({resolvedWarehouse:eK({warehouseOptions:x,ipCountry:h,shipmentConfig:s,storeConfigDefaultWarehouseId:null==o?void 0:o.default_warehouse_id}),warehouseOptions:x,computedStocks:z}))},[l,p,x,h,s,null==o?void 0:o.default_warehouse_id,z]);let O=(0,i.useMemo)(()=>f&&z[String(f)]||null,[z,f]),P=(0,i.useMemo)(()=>(0,eI.gP)(z),[z]),M=(0,i.useMemo)(()=>0!==x.length&&x.every(e=>(e=>{let t=!!e&&(e.instockCount>0||e.stockStatus===eo.VL.InStock),r=!!e&&(e.backorderQty>0||e.stockStatus===eo.VL.BackOrder);return!t&&!r})(z[String(e)]||null)),[x,z]),A=(0,i.useMemo)(()=>(e=>{let{children:t,setsQty:r,warehouseId:n}=e,l=0,i=ed.hf.Usd;for(let e of eF(t)){let t=e.qtyPerSet*r,a=(0,g.bY)(t,e.product,n||void 0);l+=a.value,i=a.currency||i}return{value:Number(l.toFixed(2)),currency:i}})({children:_,setsQty:d,warehouseId:f}),[_,d,f]),L=(0,i.useMemo)(()=>l&&C&&0!==_.length?[{sku:(0,g.d1)(t),quantity:d,selected_options:_.map(e=>"bundle/".concat(e.optionId,"/").concat(e.selectionId,"/").concat(e.qtyPerSet))}]:null,[l,C,t,_,d]),E=(0,i.useMemo)(()=>({isBundle:l,options:y,selectedOptions:j,selectedChildren:_,isValid:C,setsQty:d,setSetsQty:N,setSelectionQty:S,currentWarehouseId:f,warehouseOptions:x,selectWarehouse:k,computedStocks:z,bundleComputedStocks:I,currentStock:O,disabledWarehouseIds:P,isAllWarehousesOutOfStock:M,priceTotal:A,cartItems:L}),[l,y,j,_,C,d,N,S,f,x,k,z,I,O,P,M,A,L]);return(0,n.jsx)(eH.Provider,{value:E,children:r})}let e$=()=>(0,i.useContext)(eH),eZ=()=>{let e=(0,i.useContext)(eH);if(!e)throw Error("useBundleProduct must be used inside BundleProvider");return e};function eJ(e){let{content:t,className:r}=e;return(0,n.jsx)("div",{className:r+" product_short_desc",children:(0,n.jsx)(S,{content:t})})}let eX=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function e0(e){let{product:t}=e,r=(0,y.c)(),l=(e=>{let t=String((null==e?void 0:e.sku)||"");if(!t)return null;let r=new URLSearchParams;return(r.set("utm_source","bazzar"),r.set("utm_medium","productpage"),r.set("utm_content",t),r.set("sku",t),(e=>{let t=String(e||"").trim();return!!t&&new RegExp("(^|\\|)".concat(eX(t),"(\\||$)")).test("110110191|110110190|110110192|110110193|110110188|110110189|114110247|114110248|114110249|114110250|102110999|102111001|114993551|114993553|114993592|114993593|110110187|110110186|110110144|110110145|114993486|114993487|114993488|114993489|114110311|114110312|114110313|114110314|100020831|100045506|100080766|100026042|100061305|100097052|100099044|100091962|113991314|113991294|113991295|113991274|113991334|113991374|113991375|100079040|100077451|114070201|114993369|114993073|114993591")})(t))?{btnTextKey:"product.detail.leadButton.customLogoPackagingFirmware",url:"https://www.seeedstudio.com/fusion_branding_firmware.html?".concat(r.toString())}:(e=>{let t=null==e?void 0:e.categories;return!!Array.isArray(t)&&t.some(e=>{var t,r,n;return"2425"===String(null!=(n=null!=(r=null!=(t=null==e?void 0:e.id)?t:null==e?void 0:e.uid)?r:null==e?void 0:e.category_id)?n:"")})})(e)?{btnTextKey:"product.detail.leadButton.jetsonOdm",url:"https://www.seeed.cc/jetson-odm?".concat(r.toString())}:(e=>{let t=String(e||"").trim();return!!t&&new RegExp("(^|\\|)".concat(eX(t),"(\\||$)")).test("114993369|113110024|113991254|114993647|114993633|110992044|114993635|104991005|114993649|113991115|100073581|113991114|100017057|113991054|102010710|114992994|114993669|102010611|102010448|114993643|109990565|110992144|102010428|114993387|114993532|114993648|102010328|102010469|102010671|114993591|113991315|114993073|113100022|109100041|103030356|114990115|113100042|100051523|104030087|100010048|113110064|114990852|114993654|114993067|102010574|102990227|114993390|102010635|101990961|317990687|114993068|114993632|110990443|103020312|102991299|101991421|100064156|102060185|102010550|110990444|102010590|113991034|109990586|107990333|114992982|110060403|100057727|102010694|114991549|101021112|114993106|114992445|101010001|109100021|110990844|101991422|206001060|102010610|114993295|104990982|114993168|114993388|102010672|114991193|102991774|114992872|314990621|114993653|113010003|100087298|114991675|102010636|314990742|109990585|314990622|113110044|102060186|3
114990735|110061162|102010551|105100021|101990666|114992981|113991194|114992867|114990121|101990886|101990860|316030060|101990882|314990738|114993115|318020708|110010044|103030215|114993534|110061541|102010572|102010573|113990939|101991030|101991047|114991485|102991754|103030000|314990620|114990111|110991747|314990634|114992871|102010634|101991024|113060066|101991022|113991082|102010026|101020052|101990922|110992185|101990962|101991470|113060006|102991934|314990737|101990984|104990861|318020691|114993558|101991033|113991354|109020022|113990755|110992184|113991456|105990172|101991402|104990762|113990934|105990190|101990667|114990656|103990623|114993588|101991467|100075670|102010633|114993526|114992869|106990290|105100001|114993046|101991401|100088646|114993169|113020091|102991155|114993070|101990942|114992986|101020193|101991029|114990655|114992549|101990921|101990881|101020010|113991275|100093057|101991021|114993268|114993208|101991101|102010571|101070001|114993078|101990863|114993071|321990876|101990982|102991321|317060562|114992868|101991042|101991044|321990875|101991102|314990618|318020611|114993207|102991154|103030275|103020005|104030107|114992170|109990010")})(t)?{btnTextKey:"product.detail.leadButton.customBulkQuote",url:"https://www.seeed.cc/customization?".concat(r.toString())}:null})(t);return l?(0,n.jsxs)("a",{href:l.url,target:"_blank",className:"flex items-center justify-center w-full gap-0 rounded-md text-[14px] min-h-10 text-white bg-white bg-linear-to-r from-[#2a5f70] via-[#1e5b27] to-[#8fc31f] transition-all hover:ring-2 hover:ring-[#346d28] ring-offset-2",children:[r(l.btnTextKey),(0,n.jsx)(s.WL,{size:.8})]}):null}var e1=r(35461);function e9(){let{priceEmail:e}=(0,eb.B)(),{customer:t}=(0,e1.NK)(),r=(0,y.c)("product.priceConsult");if(!e)return null;let l=(null==t?void 0:t.email)||"",i=l?"mailto:".concat(e,"?body=").concat(encodeURIComponent("From: ".concat(l,"\n\n"))):"mailto:".concat(e);return(0,n.jsxs)("a",{href:i,className:"w-full flex items-center justify-center gap-2 h-9 md:h-10 lg:h-12 rounded-full font-semibold text-[12px] lg:text-[16px] px-2 bg-primary/90 text-white hover:bg-primary transition-colors cursor-pointer",children:[(0,n.jsx)(s.qx,{size:.9}),(0,n.jsx)("span",{children:r("requestInfo")})]})}function e2(){let{purchaseLimit:e,purchaseLimitChecked:t,setPurchaseLimitChecked:r}=(0,eb.B)(),l=(0,y.c)("product.purchaseLimit");return(null==e?void 0:e.clause)?(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"border border-dashed rounded-md p-2 ".concat(t?"bg-primary-100 border-primary":"border-zinc-200 hover:bg-zinc-100"),children:[(0,n.jsx)("div",{className:"flex items-center gap-1",children:(0,n.jsxs)("label",{className:"flex cursor-pointer items-center gap-1",children:[(0,n.jsx)("input",{type:"checkbox",checked:t,onChange:e=>r(e.target.checked),className:"h-4 w-4 cursor-pointer accent-primary"}),(0,n.jsx)("span",{className:"text-[12px] md:text-[13px] text-warn font-semibold",children:l("accept")})]})}),(0,n.jsx)("div",{className:"text-[12px] md:text-[13px] text-zinc-700 leading-relaxed lg:pl-6",dangerouslySetInnerHTML:{__html:e.clause}})]})}):null}function e4(e){let{product:t,isAllWarehousesOutOfStock:r,summaryContent:l,priceContent:i,optionsContent:a,controlsContent:s,addCartContent:o}=e,{isHidePrice:c,priceEmail:d,isCollapseRight:u}=(0,eb.B)();return(0,n.jsxs)("div",{className:"pb-6",children:[(0,n.jsxs)("div",{className:"flex flex-col py-3 px-3 xl:px-4 xl:py-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("h1",{className:"font-bold text-black leading-[1.4] ".concat(u?"text-[16px]":"text-[18px]"),children:(0,g.LK)(t)}),(0,n.jsxs)("div",{className:"text-[13px] text-zinc-500",children:["SKU ",t.sku]}),(0,n.jsx)(eJ,{className:"text-[13px] text-zinc-600 leading-normal ".concat(u?"hidden":"block"),content:(0,g.lL)(t)})]}),a,!c&&i&&(0,n.jsx)("div",{className:"py-3",children:i}),l]}),d?(0,n.jsx)(e9,{}):!c&&!r&&s&&(0,n.jsx)("div",{className:"flex flex-col gap-2 border-t py-3 px-3 xl:px-4 xl:py-4 border-zinc-100",children:s}),(0,n.jsxs)("div",{className:"px-4 mt-3 flex flex-col gap-4",children:[(0,n.jsx)(e2,{}),o,(0,n.jsx)(e0,{product:t})]})]})}let e5=(0,l.default)(()=>Promise.resolve().then(r.bind(r,78105)),{loadableGenerated:{webpack:()=>[78105]},ssr:!1});function e3(){var e,t;let{sku:r,purchaseLimit:l,purchaseLimitChecked:a,productStage:s,salesMoq:o}=(0,eb.B)(),c=eZ(),d=(0,y.c)("product.addCartBtn"),[u,p]=(0,i.useState)(!1),m=!c.isValid,x=!m&&(!c.currentStock||c.currentStock.stockStatus===eo.VL.OutOfStock),h=(()=>{var e;let t=null==(e=c.currentStock)?void 0:e.stockStatus;return t===eo.VL.Preorder?"preOrder":t===eo.VL.BackOrder?"backOrder":"addToCart"})(),f=m||!(null==(e=c.currentStock)?void 0:e.isEnough)||!!((null==l?void 0:l.clause)&&!a);return x?s===eo.T2.EOL?(0,n.jsx)("div",{className:"flex cursor-not-allowed h-9 w-full items-center justify-center rounded-full bg-zinc-100 px-2 text-[12px] text-zinc-400 md:h-10 lg:h-12 lg:text-[16
1px]",children:d("discontinued")}):s===eo.T2.MP&&o>0?(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)("a",{href:"https://www.seeed.cc/contacts",target:"_blank",rel:"noopener noreferrer",className:"flex h-9 w-full items-center justify-center rounded-full bg-primary/90 px-2 text-[12px] font-semibold text-white transition-all hover:bg-primary hover:ring-2 hover:ring-primary hover:ring-offset-2 md:h-10 lg:h-12 lg:text-[16px]",children:d("requestInfo")}),(0,n.jsx)("p",{className:"text-center text-xs text-danger",children:d("moq",{count:o})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",onClick:()=>p(!0),className:"w-full cursor-pointer rounded-full bg-primary/90 px-2 text-[12px] font-semibold text-white transition-all h-9 md:h-10 lg:h-12 lg:text-[16px] hover:bg-primary hover:ring-2 hover:ring-primary hover:ring-offset-2",children:d("subscribe")}),(0,n.jsx)(e5,{isOpen:u,onClose:()=>p(!1),warehouseIds:c.warehouseOptions})]}):(0,n.jsx)(ew.A,{sku:r,quantity:c.setsQty,warehouseId:null!=(t=c.currentWarehouseId)?t:void 0,cartItems:c.cartItems||void 0,onSuccess:()=>(0,eN.r)({quantity:c.setsQty}),buttonProps:{disabled:f},classNames:{base:" w-full text-white h-9 md:h-10 lg:h-12 rounded-full font-semibold text-[12px] lg:text-[16px] px-2 ",enabled:"cursor-pointer hover:ring-2 hover:ring-primary hover:ring-offset-2 bg-primary/90 hover:bg-primary/100",disabled:"cursor-not-allowed bg-primary/60",adding:"bg-primary/70 cursor-normal animation-pulse ring-2 ring-primary/50 ring-offset-2",added:"bg-primary"},children:e=>{let{isAdding:t,added:r}=e;return(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[t&&(0,n.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border border-white border-b-transparent border-t-transparent"}),(0,n.jsx)("span",{children:t?d("adding"):r?d("added"):d(h)})]})}})}function e6(e){let{className:t=""}=e,r=e$();return(null==r?void 0:r.isBundle)?(0,n.jsx)("div",{className:t,children:(0,n.jsxs)("div",{className:"flex items-end gap-1 leading-none text-price",children:[(0,n.jsx)("span",{className:"text-[12px] font-bold lg:text-[15px]",children:r.priceTotal.currency}),(0,n.jsx)("span",{className:"text-[24px] font-extrabold lg:text-[30px] xl:text-[32px]",children:(0,ec.LM)(r.priceTotal.value,r.priceTotal.currency)})]})}):null}var e7=r(22159);function e8(){var e;let t=eZ(),r=(null==(e=t.currentStock)?void 0:e.stockStatus)===eo.VL.OutOfStock;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ev.WarehouseSwitchView,{currentWarehouseId:t.currentWarehouseId,warehouseOptions:t.warehouseOptions,computedStocks:t.computedStocks,disabledWarehouseIds:t.disabledWarehouseIds,isAllWarehousesOutOfStock:t.isAllWarehousesOutOfStock,onSelectWarehouse:t.selectWarehouse}),!r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e7.A,{value:t.setsQty,onChange:t.setSetsQty,label:"Sets",min:1}),(0,n.jsx)(ej.StockSyncTipView,{currentStock:t.currentStock,currentWarehouseId:t.currentWarehouseId})]})]})}var te=r(68015);function tt(){let e=e$(),[t,r]=(0,i.useState)(!0);if(!(null==e?void 0:e.isBundle))return null;let l=new Map(e.selectedChildren.map(e=>["".concat(e.optionId,"-").concat(e.selectionId),e])),a=e.options.map(e=>{let t=e.selections.map(t=>l.get("".concat(e.optionId,"-").concat(t.selectionId))).filter(Boolean);return{optionId:e.optionId,title:e.title,children:t}}).filter(e=>e.children.length>0);return(0,n.jsxs)("div",{className:"rounded-md border border-zinc-200 bg-zinc-50",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>r(e=>!e),className:"flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2 text-left",children:[(0,n.jsx)("span",{className:"text-[13px] font-bold text-zinc-900",children:"Selected Options"}),(0,n.jsx)(s.WL,{size:.9,className:"text-zinc-500 transition-transform ".concat(t?"rotate-90":"")})]}),(0,n.jsx)(te.A,{isOpen:t,children:(0,n.jsxs)("div",{className:"space-y-3 border-t border-zinc-200 px-2.5 py-2",children:[0===a.length&&(0,n.jsx)("div",{className:"text-[12px] text-zinc-500",children:"No bundle option selected"}),a.map(e=>(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("div",{className:"text-[12px] font-bold text-zinc-900",children:e.title}),(0,n.jsx)("div",{className:"space-y-1",children:e.children.map(e=>(0,n.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2 text-[12px] text-zinc-700",children:[(0,n.jsx)("span",{className:"min-w-0 truncate",children:e.label}),(0,n.jsxs)("span",{className:"whitespace-nowrap font-semibold text-zinc-900",children:["x",e.qtyPerSet]}),(0,n.jsx)("span",{className:"whitespace-nowrap font-semibold text-zinc-900",children:(0,ec.LM)(e.unitPrice*e.qtyPerSet,e.currency)})]},"".concat(e.optionId,"-").concat(e.selectionId)))})]}
1,e.optionId))]})})]})}function tr(e){let{product:t}=e,r=eZ();return(0,n.jsx)(e4,{product:t,isAllWarehousesOutOfStock:r.isAllWarehousesOutOfStock,summaryContent:(0,n.jsx)(tt,{}),priceContent:(0,n.jsx)(e6,{}),controlsContent:(0,n.jsx)(e8,{}),addCartContent:(0,n.jsx)(e3,{})})}function tn(e){let{product:t}=e,{currentWarehouseId:r,qty:l,currentStock:i,isAllWarehousesOutOfStock:a}=(0,eb.B)(),s=e$(),o=(null==i?void 0:i.stockStatus)===eo.VL.OutOfStock;return(null==s?void 0:s.isBundle)?(0,n.jsx)(tr,{product:t}):(0,n.jsx)(e4,{product:t,isAllWarehousesOutOfStock:a,priceContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)(eu,{product:t,warehouseId:null!=r?r:void 0,qty:l}),!o&&(0,n.jsx)(em,{product:t,warehouseId:null!=r?r:void 0})]}),!o&&(0,n.jsx)(ex.default,{warehouseId:null!=r?r:void 0})]}),optionsContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ef.default,{product:t}),(0,n.jsx)(eh.default,{product:t})]}),controlsContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ev.default,{}),!o&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ey,{}),(0,n.jsx)(ej.default,{})]})]}),addCartContent:(0,n.jsx)(eS,{})})}var tl=r(42594),ti=r(46871);let ta=(0,l.default)(()=>Promise.resolve().then(r.bind(r,36279)),{loadableGenerated:{webpack:()=>[36279]},ssr:!1});function ts(e){let{product:t,warehouseId:r,isHidePrice:l,isOutOfStock:i,expandedContent:a,priceContent:o,actionContent:c}=e,{isActionExpanded:d,setIsActionExpanded:p}=(0,eb.B)(),m=(0,u.wR)(),x=(0,g.LK)(t);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed bg-black/20 inset-0 transition-opacity ".concat(d?"z-40 opacity-100 duration-0":"z-[-9999] opacity-0 duration-100 pointer-events-none "),onClick:()=>p(!1)}),(0,n.jsx)("div",{className:"fixed left-0 right-0 bottom-0 z-[60] flex flex-col justify-end",children:(0,n.jsxs)("div",{className:"bg-white shadow-[0_-4px_10px_rgba(0,0,0,0.1)] overflow-hidden py-2.5 pt-1 px-2 pb-[env(safe-area-inset-bottom)] rounded-t-2xl w-[calc(100%-3px)] mx-auto max-h-[calc(90vh-var(--layout-header-h,56px))] overflow-y-auto",children:[(0,n.jsx)("div",{className:"overflow-hidden transition-all ease-in-out ".concat(d?"mb-2.5 max-h-[999px] opacity-100 duration-200":"max-h-0 opacity-0 duration-0"),children:(0,n.jsx)("div",{className:"space-y-2 max-w-140 mx-auto pt-2 overflow-auto max-h-full transition-all ease-in-out ".concat(d?"translate-y-0 opacity-100 duration-300":"translate-y-[20px] opacity-0 duration-0"),children:m?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex gap-1 border-b border-b-zinc-100 pb-1",children:[(0,n.jsx)(tl.default,{src:(0,g.nY)(t),alt:x||t.sku||"product image",width:80,height:60,className:"rounded-sm object-contain w-20 h-15"}),(0,n.jsxs)("div",{className:"space-y-1 grow min-w-0",children:[(0,n.jsx)("div",{className:"text-black text-[12px] leading-[1.4]",children:x}),!l&&(0,n.jsx)(ta,{warehouseId:null!=r?r:void 0})]})]}),a]})})}),(0,n.jsxs)("div",{className:"max-w-140 mx-auto sticky z-10 bottom-0 bg-white pb-2.5 pt-1",children:[r&&!l&&!d&&(0,n.jsx)("div",{className:"w-full mb-1",children:!i&&(0,n.jsx)(ti.A,{warehouseId:null!=r?r:void 0,className:"w-full scale-80 origin-top text-center h-3 text-zinc-600 text-[11px] whitespace-nowrap"})}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[!l&&(0,n.jsx)("div",{className:"shrink-0 flex items-center",children:o}),(0,n.jsxs)("div",{className:"flex items-center gap-2 justify-end grow",children:[(0,n.jsx)("div",{className:"grow-1 max-w-30 shrink-0 min-w-0 relative",children:c}),(0,n.jsx)("button",{className:"shrink-0 text-zinc-500 cursor-pointer self-start w-8 h-8 bg-zinc-100 rounded-full flex items-center justify-center","aria-label":d?"Collapse":"Expand options",onClick:()=>p(!d),children:(0,n.jsx)(s.Hd,{size:1,className:"transition-transform duration-200 ".concat(d?"rotate-180":"")})})]})]})]})]})})]})}let to=(0,l.default)(()=>Promise.resolve().then(r.bind(r,38262)),{loadableGenerated:{webpack:()=>[38262]},ssr:!1}),tc=(0,l.default)(()=>Promise.resolve().then(r.bind(r,91155)),{loadableGenerated:{webpack:()=>[91155]},ssr:!1}),td=(0,l.default)(()=>Promise.resolve().then(r.bind(r,19849)),{loadableGenerated:{webpack:()=>[19849]},ssr:!1}),tu=(0,l.default)(()=>Promise.resolve().then(r.bind(r,76104)),{loadableGenerated:{webpack:()=>[76104]},ssr:!1});function tp(e){let{product:t}=e,{setIsActionExpanded:r,qty:l,currentWarehouseId:i,isHidePrice
1:a,priceEmail:s,currentStock:o}=(0,eb.B)(),c=!o||(null==o?void 0:o.stockStatus)===eo.VL.OutOfStock;return(0,n.jsx)(ts,{product:t,warehouseId:i,isHidePrice:a,isOutOfStock:c,expandedContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tu,{product:t}),(0,n.jsx)(td,{product:t}),!a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(to,{}),!c&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ey,{onFocus:()=>r(!0)}),(0,n.jsx)(tc,{})]})]}),(0,n.jsx)(e2,{})]}),priceContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eu,{product:t,warehouseId:null!=i?i:void 0,qty:l,className:"scale-80 origin-left"}),(0,n.jsxs)("span",{className:"text-zinc-500 text-[12px]",children:["x",l]})]}),actionContent:a?s&&(0,n.jsx)(e9,{}):(0,n.jsx)("div",{className:"w-full",children:(0,n.jsx)(eS,{})})})}var tm=r(89583);let tx=e=>"checkbox"===e||"multi"===e;function th(e){let{className:t=""}=e,r=e$();return(null==r?void 0:r.isBundle)&&0!==r.options.length?(0,n.jsxs)("section",{className:"bg-white space-y-3 ".concat(t),children:[!r.isValid&&(0,n.jsx)("div",{className:"flex ",children:(0,n.jsx)("div",{className:"text-[12px] font-medium text-danger bg-danger-100 p-2 rounded-md border border-dashed border-danger max-w-full",children:"Please complete required options"})}),(0,n.jsx)("div",{className:"space-y-5",children:r.options.map(e=>{let t=r.selectedOptions[String(e.optionId)]||{},l=Object.keys(t).find(r=>{var n;return Number(t[r])>0&&!(null==(n=e.selections.find(e=>String(e.selectionId)===r))?void 0:n.disabled)});return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1 text-[13px] lg:text-[14px] font-bold text-zinc-900",children:[(0,n.jsx)("span",{children:e.title}),e.required&&(0,n.jsx)("span",{className:"text-danger",children:"*"})]}),"select"===e.type?(0,n.jsxs)("select",{value:l||"",onChange:t=>{let n=Number(t.target.value),l=e.selections.find(e=>String(e.selectionId)===t.target.value);r.setSelectionQty(e.optionId,n,l?l.quantity:0)},className:"h-10 w-full rounded-md border border-zinc-200 bg-white px-2 text-[14px] outline-none focus:border-primary",children:[(0,n.jsx)("option",{value:"",children:e.required?"Select an option":"None"}),e.selections.map(e=>(0,n.jsx)("option",{value:e.selectionId,disabled:e.disabled,children:e.label},e.selectionId))]}):(0,n.jsxs)("div",{className:"space-y-1.5",children:[!e.required&&!tx(e.type)&&(0,n.jsxs)("label",{className:"grid cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-center gap-2 rounded-md border border-transparent px-2 py-2 transition hover:border-zinc-200 hover:bg-zinc-50",children:[(0,n.jsx)("input",{type:"radio",name:"bundle-option-".concat(e.optionId),checked:!l,onChange:()=>r.setSelectionQty(e.optionId,0,0),className:"h-4 w-4 accent-primary"}),(0,n.jsx)("span",{className:"min-w-0 text-[12px] md:text-[13px] text-[14px] leading-[1.35] text-zinc-700",children:"None"})]}),e.selections.map(t=>{var l,i,a;let s=(l=e.optionId,i=t.selectionId,Number((null==(a=r.selectedOptions[String(l)])?void 0:a[String(i)])||0)),o=t.disabled,c=s>0&&!o,d=tx(e.type)?"checkbox":"radio",u=(0,ec.LM)(t.price.unitPrice,t.price.currency),p="bundle-option-".concat(e.optionId,"-").concat(t.selectionId),m=tx(e.type)&&t.canChangeQuantity,x=(0,g.nY)(t.product);return(0,n.jsxs)("div",{className:"flex gap-2 items-center rounded-md py-1 transition ".concat(o?"cursor-not-allowed border-transparent opacity-50":"cursor-pointer"),children:[(0,n.jsx)("input",{type:d,id:p,name:"bundle-option-".concat(e.optionId),checked:c,disabled:o,onChange:n=>{o||r.setSelectionQty(e.optionId,t.selectionId,n.target.checked?t.quantity:0)},className:"h-4 w-4 accent-primary"}),(0,n.jsxs)("div",{className:"grow flex items-center gap-1.5",children:[x&&(0,n.jsx)("label",{htmlFor:p,className:"hidden lg:block w-15 aspect-4/3 shrink-0 ".concat(o?"cursor-not-allowed":"cursor-pointer"),children:(0,n.jsx)(tl.default,{src:x,alt:t.label||t.product.name||t.product.sku||"product image",width:60,height:45,className:"h-auto w-[100px] rounded-sm object-contain"})}),(0,n.jsx)("label",{htmlFor:p,className:"min-w-0 text-[12px] md:text-[13px] leading-[1.35] max-w-140 text-zinc-700 flex ".concat(o?"cursor-not-allowed":"cursor-pointer"),children:t.label})]}),(0,n.jsx)("span",{className:"whitespace-nowrap text-[14px] font-bold text-zinc-900 shrink-0",children:u}),(0,n.jsx)("div",{className:"shrink-0 min-w-24 flex justify-end",children:m?(0,n.jsx)(tm.A,{value:c?s:0,disabled:o,onChange:n=>r.setSelectionQty(e.optionId,t.selectionId,n)}):(0,n.jsxs)("span",{className:"min-w-8 text-right text-[14px] font-semibold text-zinc-700",children:["x",t.quantity]})})]},t.selectionId)})]})]}
1,e.optionId)})})]}):null}function tf(e){let{product:t}=e,{isHidePrice:r,priceEmail:l}=(0,eb.B)(),i=eZ(),a=!i.currentStock||i.currentStock.stockStatus===eo.VL.OutOfStock;return(0,n.jsx)(ts,{product:t,warehouseId:i.currentWarehouseId,isHidePrice:r,isOutOfStock:a,expandedContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(th,{className:"px-3"}),!r&&(0,n.jsx)(e8,{}),(0,n.jsx)(e2,{})]}),priceContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e6,{className:"scale-80 origin-left"}),(0,n.jsxs)("span",{className:"text-zinc-500 text-[12px]",children:["x",i.setsQty]})]}),actionContent:r?l&&(0,n.jsx)(e9,{}):(0,n.jsx)("div",{className:"w-full",children:(0,n.jsx)(e3,{})})})}function tb(e){let{product:t}=e,{currentWarehouseId:r,qty:l,isHidePrice:i}=(0,eb.B)(),a=e$(),s=!!(null==a?void 0:a.isBundle),o=(0,g.LK)(t)||"";return(0,n.jsxs)(n.Fragment,{children:[" ",(0,n.jsxs)("div",{className:"lg:hidden my-4 space-y-2.5 px-2.5",children:[!i&&(s?(0,n.jsx)(e6,{}):(0,n.jsx)(eu,{product:t,warehouseId:null!=r?r:void 0,qty:l})),(0,n.jsx)("h1",{className:"font-bold text-black text-[14px] leading-[1.4]",children:o}),(0,n.jsxs)("div",{className:"text-[11px] text-zinc-600 leading-1",children:["SKU ",t.sku]})]})," ",(0,n.jsxs)("div",{className:"lg:hidden space-y-3 mt-2.5",children:[!s&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ef.MultiProductsPreview,{product:t}),(0,n.jsx)(eh.ProductSelectionsPreview,{product:t})]}),s?(0,n.jsx)(tf,{product:t}):(0,n.jsx)(tp,{product:t})]})]})}let tv=(0,l.default)(()=>r.e(6221).then(r.bind(r,46221)),{loadableGenerated:{webpack:()=>[46221]},ssr:!1});function tg(e){let{product:t}=e,{setScrollOverTarget:r,scrollOverTarget:l}=(0,eb.B)(),[a,s]=(0,i.useState)(!1),o=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=o.current;if(!e)return;let t=new IntersectionObserver(e=>{let[t]=e;console.log("entry",t.isIntersecting),r(t.isIntersecting?null:"ProductGallery"),a||t.isIntersecting||s(!0)},{threshold:0});return t.observe(e),()=>t.disconnect()},[r,a,s]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-full max-w-360 lg:px-3 xl:px-4 mx-auto relative ",children:(0,n.jsxs)("div",{className:"w-full lg:flex lg:gap-3 lg:pt-3 ",children:[(0,n.jsxs)("div",{className:"lg:grow min-w-0 shrink bg-white lg:max-w-[calc(100%-420px)] xl:max-w-[calc(100%-450px)]",children:[(0,n.jsx)(v,{mediaList:(0,g.x3)(t)}),(0,n.jsx)("div",{ref:o}),(0,n.jsx)(tb,{product:t}),(0,n.jsx)(th,{className:"px-3 lg:px-4 border-t py-3 border-zinc-200"}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(es,{product:t,className:"border-t border-t-zinc-100 pb-2.5 pl-2 lg:px-2.5 "}),(0,n.jsx)(ea,{product:t,className:"border-t border-t-zinc-100 pb-2.5 pl-2 lg:px-2.5 "})]}),(0,n.jsx)(D,{product:t,className:"bg-white overflow-hidden w-full z-25 sticky top-(--layout-header-h) border-b border-t border-zinc-100 "})]}),(0,n.jsx)("div",{className:"max-lg:hidden lg:w-105 xl:w-112.5 shrink-0",children:(0,n.jsx)("div",{className:"bg-white rounded-lg sticky top-[calc(var(--layout-header-h)+12px)] overflow-y-auto max-h-[calc(100vh-max(var(--layout-header-h),var(--layout-header-expand-h))-40px)]",children:(0,n.jsx)(tn,{product:t})})})]})}),(0,n.jsx)("style",{lang:"scss",scoped:!0,children:"\n @media (min-width: 1024px) {\n body,\n html {\n background-color: #f5f5f5;\n }\n }\n "}),(0,n.jsx)(tv,{product:t})]})}
1let ty=e=>{let{product:t}=e;return(0,n.jsx)(eb.h,{product:t,children:(0,n.jsx)(eY,{product:t,children:(0,n.jsx)(tg,{product:t})})})},tj=ty},74079:(e,t,r)=>{"use strict";r.d(t,{N:()=>l,l:()=>i});var n=r(76704);function l(e){let[t,r]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!window.matchMedia)return;let t=window.matchMedia(e),n=()=>r(t.matches);n();let l=()=>n();return"function"==typeof t.addEventListener?(t.addEventListener("change",l),()=>t.removeEventListener("change",l)):(t.addListener(l),()=>t.removeListener(l))},[e]),t}function i(){let e=l("only screen and (max-width : 1024px)"),t=l("only screen and (max-width : 1120px)");return{isScreenLg:e,isScreenMd:l("only screen and (max-width : 768px)"),isScreenSm:l("only screen and (max-width : 480px)"),isScreenMxl:t}}},76104:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MultiProductsPreview:()=>p,default:()=>m});var n=r(5740),l=r(76704),i=r(49559),a=r(90597),s=r(71985),o=r(21032),c=r(74332);function d(e){return(0,l.useMemo)(()=>{if(!e)return null;let t=String((0,a.d1)(e)||""),r=(0,a.aU)(e);return r.length?r.map(e=>{try{e.url=new URL(e.url).pathname}catch(e){}return{...e,active:t===e.sku}}):null},[e])}function u(e){let{item:t,className:r}=e,l="flex items-center overflow-hidden truncate max-w-full shrink-0 hover:border-primary hover:text-primary justify-center rounded-sm border px-1.5 py-1 lg:py-1.5 text-center text-[12px] lg:text-[13px] lg:px-1.5 ".concat(null!=r?r:""," ").concat(t.active?"border-primary bg-lime-50 text-primary font-semibold":"border-zinc-200 text-t1color");return!t.url||t.active?(0,n.jsxs)("button",{type:"button",className:l,children:[" ",(0,n.jsx)("div",{className:"text-left",children:t.value})]}):(0,n.jsx)(i.N_,{href:t.url,className:l,children:(0,n.jsx)("div",{className:"text-left",children:t.value})})}function p(e){var t;let{product:r,className:l}=e;(0,c.c)("product.multiProducts");let{setIsActionExpanded:i}=(0,o.B)(),a=d(r);if(!a||0===a.length)return null;let p=[null!=(t=a.find(e=>e.active))?t:a[0],...a.filter(e=>!e.active)].slice(0,4);return(0,n.jsxs)("div",{className:"relative py-2 px-2.5 flex w-full items-center gap-1 overflow-hidden whitespace-nowrap cursor-pointer ".concat(null!=l?l:""),children:[(0,n.jsx)("div",{className:"flex items-center gap-1 grow overflow-hidden",children:p.map((e,t)=>(0,n.jsx)(u,{item:e},"".concat(e.sku,"-").concat(t)))}),a.length>4&&(0,n.jsx)("div",{className:"pl-2 bg-white/30 backdrop-blur-[5px]",children:(0,n.jsxs)("div",{onClick:()=>i(!0),className:" h-7 bg-white/80 backdrop-blur-[2px] border rounded-full border-primay pl-3 pr-1.5 shrink-0 inline-flex items-center gap-1 text-[11px] text-primary-500",children:["+",a.length-4," products",(0,n.jsx)(s.k5,{size:.5})]})})]})}function m(e){let{product:t}=e,r=d(t);return r&&0!==r.length?(0,n.jsx)("div",{className:"flex flex-wrap gap-1 lg:gap-2",children:r.map((e,t)=>(0,n.jsx)(u,{item:e},"".concat(e.sku,"-").concat(t)))}):null}},78105:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>w});var n=r(5740),l=r(76704),i=r(74332),a=r(34922),s=r(33624),o=r(83539),c=r(34263),d=r(53510),u=r(27806),p=r(96140),m=r(73117),x=r(22159),h=r(68182),f=r(21032),b=r(20989),v=r(70833),g=r(85959),y=r(63432);let j=/^\S+@\S+\.\S+$/;function w(e){let{isOpen:t,onClose:r,warehouseIds:w,title:N,onSubscribed:k}=e,S=(0,i.c)("product"),{tipError:_,tipSuccess:C}=(0,b.A)(),{customer:I}=(0,v.c)(),{productId:z,sku:O}=(0,f.B)(),[P,M]=(0,l.useState)(""),{control:A,handleSubmit:L,reset:E,setValue:B,clearErrors:q,formState:{errors:T,isSubmitting:W,isValid:F}}=(0,a.mN)({defaultValues:{qty:1,email:""},mode:"onChange",reValidateMode:"onChange"});(0,l.useEffect)(()=>{t||M("")},[t]),(0,l.useEffect)(()=>{t&&(null==I?void 0:I.email)&&B("email",String(I.email))},[t,null==I?void 0:I.email,B]);let D=e=>{let t=Number.isFinite(e)?Math.floor(e):1;return t>0?t:1},V=async e=>{if(!F)return;let t=e.email.trim(),n=D(e.qty);if(!z){let e=S("stockNotify.error.missingProductId");M(e),_(e);return}M("");try{let e=w.map(Number),l=await (0,h.o4)({body:{product_id:z,warehouse_ids:e,email:t,subscribe_source:1,desired_quantity:n}});(0,g.sendGAEvent)(y.xf.E_stock_notify,{c_product_sku:O,c_warehouse_ids:e.join(","),c_email:t,c_desired_quantity:n}),E({qty:1,email:t}),C((null==l?void 0:l.message)||S("stockNotify.success")),null==k||k(),r()}catch(t){let e=(null==t?void 0:t.message)||S("stockNotify.error.submitFailed");M(e),_(e)}},R=()=>{M("")};return(0,n.jsx)(s.Y,{isOpen:t,onOpenChange:e=>{e||r()},placement:"center",classNames:{base:"rounded-2xl max-w-110 w-[calc(100%-1.5rem)]"},children:(0,n.jsx)(o.g,{children:e=>{var t;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.c,{className:"flex justify-center pr-5 p-3 text-[12px] md:text-[14px] lg:text-[16
1px] font-semibold",children:null!=N?N:(0,n.jsx)("span",{className:"font-semibold",children:S("stockNotify.backInStockTitle")})}),(0,n.jsxs)("form",{onSubmit:L(V,R),children:[(0,n.jsx)(d.h,{className:"p-2 md:p-3 lg:p-4",children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(a.xI,{name:"qty",control:A,rules:{required:S("stockNotify.error.qtyInvalid"),validate:e=>D(Number(e))>=1||S("stockNotify.error.qtyInvalid")},render:e=>{let{field:t}=e;return(0,n.jsx)(x.A,{label:S("stockNotify.desiredQuantity"),value:t.value,min:1,isError:!!T.qty,className:"max-w-30",onChange:e=>{t.onChange(e),q("qty")}})}}),(null==(t=T.qty)?void 0:t.message)&&(0,n.jsx)("div",{className:"mt-1 text-[12px] text-danger",children:String(T.qty.message)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-[13px] font-semibold",children:S("stockNotify.email")}),(0,n.jsx)(a.xI,{name:"email",control:A,rules:{required:S("stockNotify.error.emailRequired"),validate:e=>j.test((e||"").trim())||S("stockNotify.error.emailInvalid")},render:e=>{var t;let{field:r}=e;return(0,n.jsx)(u.r,{type:"email",...r,value:r.value||"",isInvalid:!!T.email,errorMessage:null==(t=T.email)?void 0:t.message,placeholder:S("stockNotify.emailPlaceholder"),radius:"sm",color:"primary",classNames:{base:"bg-white",inputWrapper:"border-zinc-200 border",label:"text-[13px] text-t1color font-semibold"},isClearable:!0,variant:"bordered",onValueChange:e=>{r.onChange(e),q("email")}})}})]}),P?(0,n.jsx)("div",{className:"text-[12px] text-danger",children:P}):null]})}),(0,n.jsxs)(p.q,{className:"justify-center gap-2",children:[(0,n.jsx)(m.T,{type:"button",variant:"light",radius:"full",size:"sm",onPress:e,className:"lg:h-9 lg:min-w-25",children:S("stockNotify.cancel")}),(0,n.jsx)(m.T,{type:"submit",color:"primary",size:"sm",radius:"full",isLoading:W,className:"lg:h-9 lg:min-w-25 ".concat(F?"":"cursor-not-allowed bg-zinc-200 text-zinc-500"),children:S("stockNotify.submit")})]})]})]})}})})}},89583:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(5740),l=r(21513),i=r(71985);function a(e){let{value:t,onChange:r,min:a=0,max:s,disabled:o=!1,className:c,classNames:d,onBlur:u,onMinReached:p}=e,m=e=>{let t=Number.isFinite(e)?Math.floor(e):a;return t<a?a:void 0!==s&&t>s?s:t},x=e=>{if(e<a&&p)return void p();r(m(e))},h=()=>{void 0!==s&&t>=s||r(m(t+1))},f=t>a||!!p,b=(0,l.cn)("flex items-center overflow-hidden justify-between group","w-22 md:w-26 h-7 md:h-8 rounded-full border border-zinc-200","focus-within:border-primary focus-within:text-primary",o?"cursor-not-allowed text-zinc-400":"hover:border-primary hover:bg-white focus-within:bg-white",c),v=(0,l.cn)("flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center","rounded-full bg-primary text-white transition hover:bg-primary/90","disabled:cursor-not-allowed disabled:bg-zinc-200 disabled:text-zinc-400",null==d?void 0:d.addButton),g=(0,l.cn)("flex h-full w-8 cursor-pointer items-center justify-center text-[12px]","hover:bg-zinc-100 disabled:cursor-not-allowed disabled:bg-transparent","disabled:text-zinc-400",null==d?void 0:d.countButton),y=(0,l.cn)("h-full w-9 md:w-12 grow shrink-0 border-0 bg-transparent text-center","text-[14px] font-semibold outline-none disabled:text-zinc-400",null==d?void 0:d.inputClassName);return t<=0?(0,n.jsx)("button",{type:"button","aria-label":"increase quantity",disabled:o,onClick:e=>{e.stopPropagation(),h()},className:v,children:(0,n.jsx)(i.WS,{size:.8})}):(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),className:b,children:[(0,n.jsx)("button",{type:"button","aria-label":"decrease quantity",disabled:o||!f,onClick:()=>x(t-1),className:g,children:(0,n.jsx)(i.xj,{size:.65})}),(0,n.jsx)("input",{inputMode:"numeric",value:t,disabled:o,onChange:e=>{let t=Number.parseInt(e.target.value,10);x(Number.isNaN(t)?a:t)},onBlur:u,className:y}),(0,n.jsx)("button",{type:"button","aria-label":"increase quantity",disabled:o,onClick:h,className:g,children:(0,n.jsx)(i.WS,{size:.65})})]})}},91155:(e,t,r)=>{"use strict";r.r(t),r.d(t,{StockSyncTipView:()=>c,default:()=>d});var n=r(5740),l=r(53442),i=r(21032),a=r(74332),s=r(35933);let o={base:"relative max-w-100 rounded-md border-dashed border",angle:"max-lg:hidden absolute -top-1 left-14 h-2 w-2 rotate-45 border-l border-t "};function c(e){let{currentStock:t,currentWarehouseId:r}=e,i=(0,a.c)("product");
1if(!t)return null;t.isEnough&&t.backorderOnDemand;let c=!t.isEnough;t.instockOnDemand;let d=r===l.fr.US||r===l.fr.DE;return t.stockStatus===s.VL.Preorder?t.isEnough?t.leadTime?(0,n.jsxs)("div",{className:"".concat(o," border-primary bg-lime-50 px-2.5 py-2 text-[12px] text-zinc-900"),children:[(0,n.jsx)("span",{className:"".concat(o.angle,"border-primary bg-lime-50")}),(0,n.jsx)("div",{className:"text-[11px] md:text-[12px] text-zinc-800",children:(0,n.jsxs)("span",{children:[i("stockTip.preorderAvailableOn")," ",(0,n.jsx)("span",{className:"font-semibold text-primary",children:t.leadTime})]})})]}):null:(0,n.jsxs)("div",{className:"".concat(o," border-danger-300 bg-danger-50 px-2 py-1.5 text-[12px] text-danger-500"),children:[(0,n.jsx)("span",{className:"".concat(o.angle," border-danger-300 bg-danger-50")}),i("stockTip.notEnoughPrefix"),t.totalCount>0?(0,n.jsxs)(n.Fragment,{children:[" ","(",(0,n.jsx)("span",{className:"font-semibold",children:t.totalCount})," ",i("stockTip.availableSuffix"),")"]}):null,". ",i("stockTip.reduceQty")]}):t.isEnough?(0,n.jsxs)("div",{className:"".concat(o.base," border-primary bg-lime-50 px-2.5 py-2 text-[12px] text-zinc-900"),children:[(0,n.jsx)("span",{className:"".concat(o.angle," border-primary bg-lime-50")}),t.instockOnDemand>0&&(0,n.jsx)("div",{className:"text-[13px] font-semibold",children:i("stockTip.inStockTitle",{count:t.instockOnDemand})}),t.backorderOnDemand>0&&(0,n.jsx)("div",{className:"text-[13px] font-semibold",children:i("stockTip.backOrderOnlyTitle",{count:t.backorderOnDemand})}),(0,n.jsx)("div",{className:"text-[11px] md:text-[12px] text-zinc-800",children:t.leadTime?(0,n.jsxs)("span",{children:[i("stockTip.availableOn")," ",(0,n.jsx)("span",{className:"font-semibold text-primary",children:t.leadTime})]}):d?(0,n.jsx)("span",{children:i("stockTip.holidayDelay")}):null})]}):c?(0,n.jsxs)("div",{className:"".concat(o.base," border-danger-300 bg-danger-50 px-2 py-1.5 text-[12px] text-danger-500"),children:[(0,n.jsx)("span",{className:"".concat(o.angle," border-danger-300 bg-danger-50")}),i("stockTip.notEnoughPrefix"),t.totalCount>0?(0,n.jsxs)(n.Fragment,{children:[" ","(",(0,n.jsx)("span",{className:"font-semibold",children:t.totalCount})," ",i("stockTip.availableSuffix"),")"]}):null,". ",i("stockTip.reduceQty")]}):null}function d(){let{currentStock:e,currentWarehouseId:t}=(0,i.B)();return(0,n.jsx)(c,{currentStock:e,currentWarehouseId:t})}},93377:()=>{},97546:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=()=>"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}},e=>{e.O(0,[4070,3115,4825,7961,9296,1481,3204,6692,8042,2184,5142,3144,5376,2751,139,2283,4679,9793,5869,5348,8107,9153,9450,1260,3029,4924,2612,7806,6616,4922,5833,5953,7067,8128,3412,1642,4952,2928,1641,6337,2502,3540,7358],()=>e(e.s=8675)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.