efficient-storefront-blocks 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +11 -6
  3. package/dist/chunks/EditorPreviewCheckout-B2WE4PQG.js +4 -0
  4. package/dist/chunks/{PreviewFooter-WL76Z4NK.js → PreviewFooter-WMJGEJ4V.js} +1 -1
  5. package/dist/chunks/SectionEditorShell-CS47KTY2.js +1 -0
  6. package/dist/chunks/SiteEditorProvider-SL2RMYRJ.js +1 -0
  7. package/dist/chunks/chunk-7LORPJCG.js +230 -0
  8. package/dist/chunks/chunk-AVM4NCES.js +16 -0
  9. package/dist/chunks/{chunk-I5J42GI3.js.LEGAL.txt → chunk-AVM4NCES.js.LEGAL.txt} +1 -1
  10. package/dist/chunks/chunk-F3PA63EP.js +1 -0
  11. package/dist/chunks/chunk-HHGLC5XH.js +153 -0
  12. package/dist/chunks/chunk-HHGLC5XH.js.LEGAL.txt +5 -0
  13. package/dist/chunks/chunk-MWOOPV76.js +1 -0
  14. package/dist/chunks/{chunk-QL3UVEEM.js → chunk-TCRMUJVM.js} +1 -1
  15. package/dist/chunks/chunk-Y2YO7JHE.js +1 -0
  16. package/dist/chunks/{fitment-data-3PTG4BJX.js → fitment-data-XD2SVBL7.js} +1 -1
  17. package/dist/chunks/render-client-LEJJONKA.js +1 -0
  18. package/dist/contract.js +1 -1
  19. package/dist/editor.css +1 -1
  20. package/dist/index.js +28 -215
  21. package/dist/links.js +1 -1
  22. package/package.json +5 -5
  23. package/dist/chunks/EditorPreviewCheckout-D2J57RZY.js +0 -4
  24. package/dist/chunks/SectionEditorShell-U3CXCPYO.js +0 -1
  25. package/dist/chunks/SiteEditorProvider-5HGJJCOZ.js +0 -1
  26. package/dist/chunks/chunk-BAXOL3AI.js +0 -1
  27. package/dist/chunks/chunk-I5J42GI3.js +0 -16
  28. package/dist/chunks/chunk-MSHAAJSK.js +0 -230
  29. package/dist/chunks/chunk-NQIIJI3Z.js +0 -1
  30. package/dist/chunks/chunk-R2JQPRJX.js +0 -1
  31. package/dist/chunks/chunk-XNYKOAQ3.js +0 -153
  32. package/dist/chunks/chunk-XNYKOAQ3.js.LEGAL.txt +0 -4
  33. package/dist/chunks/render-client-DYF6CWVJ.js +0 -1
  34. /package/dist/chunks/{gallery-builds-data-SWA6XKFF.js → gallery-builds-data-VVHHVNYW.js} +0 -0
  35. /package/dist/chunks/{headers-VF4VTX37.js → headers-UYHEZDAT.js} +0 -0
@@ -1 +0,0 @@
1
- var c={siteSlug:null,shopOrigin:""},s=c;function S(e){s={siteSlug:e.siteSlug?.trim()||null,shopOrigin:(e.shopOrigin??"").trim().replace(/\/+$/,"")}}function b(){return s.siteSlug}function E(){return s.shopOrigin}import{activateEaselSession as v,backendOf as _,createEaselSession as k,currentEaselSession as a,deactivateEaselSession as R,EFFICIENT_BACKEND as y,efficientClientOpen as B,isEfficientBackend as w,provideDefaultBackend as O,resetAmbientEaselSession as L,sessionRegistry as A,setSessionBridgedSite as U,setSessionDocumentSite as W}from"efficient-easel/screen/lib/session";var r="https://cdn.inovit.com"?.replace(/\/+$/,"");function o(e,t){let n=a().hostBackend?.media.resolve;if(!(!n||n===g))return n(e,t)??e}function d(e){return/^(?:https?:)?\/\//i.test(e)||/^(?:data|blob):/i.test(e)}function f(e){return o(e)??l(e)}function l(e){return!r||d(e)?e:r+e.replace(/^\/media/,"")}var g=e=>l(e),p="";function N(e){if(!e)return null;let t=o(e);return t!==void 0?t:e.startsWith("/")?`${p}${e}`:e}function D(e){return/^https?:\/\//i.test(e)&&!(r&&e.startsWith(r+"/"))}function $(e){if(!e)return;let t=o(e);return t!==void 0?t:e.startsWith("/media/")?f(e):e}function M(e){let t=e.split("?")[0],n=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(n.replace(/^[0-9a-f]{32}_/i,""))||n}catch{return n}}var m="/videos/products/";function P(e){return!!e&&e.includes(m)}function u(e){return{getItem(t){try{return e()?.getItem(t)??null}catch{return null}},setItem(t,n){try{e()?.setItem(t,n)}catch{}},removeItem(t){try{e()?.removeItem(t)}catch{}}}}var i="__storefront_probe__";function F(e){try{e.setItem(i,i);let t=e.getItem(i)===i;return e.removeItem(i),t}catch{return!1}}var V=u(()=>typeof window>"u"?null:window.localStorage),K=u(()=>typeof window>"u"?null:window.sessionStorage);function X(e){return u(()=>e.defaultView?.localStorage??null)}export{_ as a,k as b,a as c,y as d,B as e,w as f,O as g,A as h,f as i,g as j,N as k,D as l,$ as m,M as n,P as o,S as p,b as q,E as r,F as s,V as t,K as u,X as v};
@@ -1 +0,0 @@
1
- import{f as nt,i as me,p as rt,r as ot,t as q}from"./chunk-QL3UVEEM.js";import{Ma as de,Na as Ze,Qa as Re,Ra as et}from"./chunk-BAXOL3AI.js";import{e as Je,r as tt,t as re}from"./chunk-NQIIJI3Z.js";import{createContext as Qt,useContext as jt,useEffect as Jt,useMemo as pe,useState as at}from"react";function it(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function oe(e,t){if(e.length===0)return null;let n=0;for(let r of e){let o=r.prices?.[t];if(typeof o!="number"||!Number.isFinite(o)||o<=0)return null;n+=o*r.wheels}return n}var Me=4,sr=1,ar={unit:"set",spares:0,spareSide:"left"};function st(e){return e.unit==="single"?1:Me+e.spares}function lr(e,t){return[{partNumber:e.partNumber,wheels:st(t),prices:e.prices}]}function ur(e,t){let n=st(t)-Me;if(n<=0||e.length===0)return e;let r=Xt(e),o=r?r[t.spareSide]:0;return e.map((i,s)=>s===o?{...i,wheels:i.wheels+n}:i)}function Xt(e){let t,n;for(let r=0;r<e.length;r+=1){let o=e[r].hand;if(o!=="left"&&o!=="right")continue;if((o==="left"?t:n)!==void 0)return null;o==="left"?t=r:n=r}return t!==void 0&&n!==void 0?{left:t,right:n}:null}function Yt(e,t){return t.spares>0?`${e} + spare`:e}function cr(e){return e.unit==="single"?"Single":Yt(`Set of ${Me}`,e)}var dr="data-add-to-basket",De=9,Oe="en";function fe(e,t,n=0){return new Intl.NumberFormat(Oe,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:n}).format(e)}import{jsx as tn}from"react/jsx-runtime";var lt="storefront-country",ut=Qt(null);function Zt(e){return ct(e,"catalogue")}function en(e){return ct(e,"money")}function ct(e,t){let n=new Map(e.map(o=>[o.code,o.decimalPlaces])),r=new Map;return(o,i)=>{if(!i)return"";let s=r.get(i);if(!s){let u=n.get(i)??0;s=new Intl.NumberFormat(Oe,{style:"currency",currency:i,minimumFractionDigits:t==="money"?u:0,maximumFractionDigits:u}),r.set(i,s)}return s.format(o)}}function yr({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=pe(()=>t??[],[t]),s=pe(()=>n??[],[n]),u=pe(()=>r||i.find(C=>C.isDefault)?.code||i[0]?.code||"",[r,i]),c=pe(()=>o||s.find(C=>C.isDefault)?.code||s[0]?.code||"",[o,s]),[l,d]=at(c),[f,P]=at(!1);Jt(()=>{let C=re.getItem(lt);C&&s.some(L=>L.code===C)&&d(C),P(!0)},[s]);function w(C){d(C),re.setItem(lt,C)}let h=pe(()=>{let C=s.find(I=>I.code===l)??null,L=C?.currency,N=L&&i.some(I=>I.code===L)?L:u,M=Zt(i),x=en(i);return{country:l,currency:N,setCountry:w,currencies:i,countries:s,activeCountry:C,formatPrice:(I,S)=>M(I,S??N),formatMoney:(I,S)=>x(I,S??N),ready:f}},[l,i,s,u,f]);return tn(ut.Provider,{value:h,children:e})}function dt(){let e=jt(ut);if(!e)throw new Error("useCurrency must be used within a CurrencyProvider");return e}import{createContext as pn,useCallback as _,useContext as gn,useEffect as X,useMemo as St,useRef as ie,useState as A}from"react";function ft(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var pt="We'll confirm this discount when you place your order.",xr="Confirmed at checkout";function Sr(e){return e&&(e.valid||e.deferred)?e.code:void 0}var mt="coupon_code: ";function vr(e){return!(e instanceof me)||e.status!==400||!e.message.startsWith(mt)?null:e.message.slice(mt.length)}function gt(e,t){return e.map(n=>({qty:n.qty,slug:n.slug,name:`${n.name.lead}${n.name.accent}`.trim(),finish:n.finishName,size:n.size,kind:n.kind,sku:n.sku,pack:n.pack,priceLabel:t(n)}))}var Pe="Price on request",rn="Request a quote";function Fe(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ue(e,t){let n=e?.[t];return Fe(n)?n:null}function Ir(e,t,n,r){let o=Ue(e,n),i=Ue(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function wr(e,t,n,r){if(n==null&&r==null)return!0;let o=Ue(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var on={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function sn(e,t,n){if(!Fe(e))return on;let r=Fe(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function Tr(e,t,n=""){return!e.priced||e.unit==null?Pe:`${n}${fe(e.unit,t)}`}function Nr(e,t){return e.was==null?null:fe(e.was,t)}function an(e,t,n=1){let r=oe(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((s,u)=>s+u.wheels,0),i=Math.min(...e.map(s=>s.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var ln={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function kr(e,t,n,r=1){let o=sn(e.prices[n],e.msrpPrices?.[n],4),i=o.setTotal==null?null:o.setTotal*r;if(!t)return{priced:o.priced,unit:o.unit,isFrom:!0,was:o.was,onSale:o.onSale,setTotal:null,fromSetTotal:i};let s=an(t.components,n,r);return s.priced?{priced:!0,unit:s.unit,isFrom:s.isFrom,was:null,onSale:!1,setTotal:s.setTotal,fromSetTotal:i}:{...ln,fromSetTotal:i}}function un(e,t){return!e.priced||e.unit==null?Pe:`${e.isFrom?"from ":""}${fe(e.unit,t)}`}function _r(e,t){return e.was==null?null:fe(e.was,t)}function Ar(e,t){return!e.priced||e.unit==null?rn:un(e,t)}var cn=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function yt(e){return cn.test(e.trim())}var bt="sf:ga-purchases",dn=20;function Ct(){return typeof window>"u"||window.parent!==window}function ge(...e){try{if(Ct()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function mn(e,t){let n=e.config.find(r=>r.gold)?.label;return{item_id:`${e.slug}|${e.finishName}|${e.size}`,item_name:`${e.name.lead}${e.name.accent}`.trim(),...n?{item_variant:n}:{},price:oe(e.components,t)??0,quantity:e.qty}}function $e(e,t){return e.filter(Le).map(n=>mn(n,t))}function Ur(e){ge("event","view_item",{currency:e.currency,value:e.pricePerSet,items:[{item_id:e.itemId,item_name:e.itemName,...e.variant?{item_variant:e.variant}:{},price:e.pricePerSet,quantity:1}]})}function xt(e,t){let n=$e([e],t);n.length!==0&&ge("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function $r(e){let t=$e(e.lines,e.currency);t.length!==0&&ge("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var ht=new Set;function fn(e){if(ht.has(e))return!1;ht.add(e);try{let t=JSON.parse(re.getItem(bt)??"[]");if(t.includes(e))return!1;re.setItem(bt,JSON.stringify([...t,e].slice(-dn)))}catch{}return!0}function qr(e){let t=e.confirmation;if(Ct()||!fn(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);ge("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:$e(e.lines,n)}),e.adsSendTo&&ge("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}import{jsx as Cn}from"react/jsx-runtime";var yn=400,bn=400,hn=1500;function Le(e){return(e.components?.length??0)>0}function vt(e,t){return{code:e,valid:t.valid,deferred:ft(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function Pt(e,t){return oe(e.components,t)}function qe(e,t){let n=Pt(e,t);return n===null?null:n*e.qty}function Et(e){return e!=="tyre"}var Lt=pn(null);function jr({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=dt(),[i,s]=A(t),[u,c]=A([]),[l,d]=A([]),[f,P]=A([]),[w,h]=A(!1),[C,L]=A(!1),[N,M]=A(!1),[x,I]=A(!1),[S,H]=A(null),[W,Q]=A(void 0),b=ie(r),v=ie("");b.current=b.current||r;let[m,K]=A(null),[j,z]=A(!1),[R,J]=A(null),Z=ie(void 0),D=_(()=>s(!0),[]),Ce=_(()=>s(!1),[]),O=_(()=>s(a=>!a),[]);X(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&D()},[D,t]);let xe=_(a=>{I(!0),Et(a)&&M(!0)},[]),ee=N||u.some(a=>Et(a.kind)),ae=x||u.length>0;X(()=>{if(t||!ee||w)return;let a=!0;return q.listWheels().then(p=>{a&&(d(p),h(!0))}),()=>{a=!1}},[t,ee,w]),X(()=>{if(t||!ae||C)return;let a=!0;return q.listBundles().then(p=>{a&&(P(p),L(!0))}),()=>{a=!1}},[t,ae,C]);let U=S?.deliveryOptions??[];X(()=>{U.length!==0&&J(a=>a&&U.some(p=>p.id===a)?a:U[0]?.id??null)},[S]);let V=_(()=>u.filter(Le).flatMap(a=>it(a.components,a.qty)),[u]),le=_(async(a,p)=>{let y=a.trim().toUpperCase();if(!y)return;let g=V();if(g.length===0){K({code:y,valid:!1,message:"Add a wheel to the cart first."});return}z(!0),Z.current=p;try{let T=await q.validateCoupon({code:y,items:g,currency:n,shippingMethodId:R??void 0,customerEmail:p});K(vt(y,T))}catch{K({code:y,valid:!1,message:"Could not check that code. Please try again."})}finally{z(!1)}},[V,n,R]),te=_(()=>{K(null),Z.current=void 0},[]),Se=_(a=>{if(!m)return;let{code:p}=m;K(y=>y&&y.code===p?{code:p,valid:!1,refused:!0,message:a}:y)},[m]);X(()=>{if(!m||m.refused)return;let a=m.code,p=g=>g!==null&&g.code===a&&!g.refused,y=setTimeout(async()=>{let g=V();if(g.length===0){K(T=>p(T)?{code:a,valid:!1,message:"Add a wheel to the cart first."}:T);return}z(!0);try{let T=await q.validateCoupon({code:a,items:g,currency:n,shippingMethodId:R??void 0,customerEmail:Z.current});K(ce=>p(ce)?vt(a,T):ce)}catch{}finally{z(!1)}},yn);return()=>clearTimeout(y)},[u,n,R]);let ve=m&&!m.refused?m.code:void 0;X(()=>{if(t)return;let a=!0,p=setTimeout(async()=>{let y=V();if(y.length===0){H(null),Q(void 0);return}try{let g=await q.quoteCart({items:y,currency:n,shippingMethodId:R??void 0,couponCode:ve,customerEmail:Z.current||void 0,country:b.current||void 0,subdivision:v.current||void 0});if(!a)return;H(g)}catch{if(!a)return}Q(ve)},bn);return()=>{a=!1,clearTimeout(p)}},[u,n,R,ve,r]);let E=_(a=>{c(p=>{let y=p.findIndex(g=>g.id===a.id);return y===-1?[...p,a]:p.map((g,T)=>T===y?{...g,qty:Math.min(De,g.qty+a.qty)}:g)}),xt(a,n)},[n]),F=_(a=>{c(p=>p.filter(y=>y.id!==a))},[]),G=_((a,p)=>{let y=Math.max(1,Math.min(De,p));c(g=>g.map(T=>T.id===a?{...T,qty:y}:T))},[]),ze=_(a=>{c(a)},[]),[ue,Ht]=A(null),Ve=ie(null);Ve.current=ue;let $=ie(null),_e=ie(""),Ge=_((a,p)=>{let y=a.trim().toLowerCase();yt(y)&&Ht(g=>g&&g.email===y&&g.firstName===(p??"")?g:{email:y,firstName:p??""})},[]);X(()=>{if(t||!ue)return;let a=gt(u.filter(Le),g=>qe(g,n)===null?Pe:o(qe(g,n),n)),p={email:ue.email,firstName:ue.firstName,currency:n,items:a},y=JSON.stringify(p);if(y!==_e.current)return $.current&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,_e.current=y,q.captureCart(p).catch(g=>{})},hn),()=>{$.current&&(clearTimeout($.current),$.current=null)}},[u,ue,n,t]);let Xe=_(()=>{$.current&&(clearTimeout($.current),$.current=null);let a=Ve.current;a&&(_e.current="",q.captureCart({email:a.email,firstName:a.firstName,currency:n,items:[]}).catch(p=>{}))},[n]),Ye=St(()=>{let a=u.reduce((k,ne)=>{let Ee=qe(ne,n);return Ee===null?k:k+Ee},0),p=u.some(k=>Pt(k,n)===null),y=u.reduce((k,ne)=>k+ne.qty,0),g=m?.valid?m.effects:void 0,T=g?Math.min(a,Number(g.discountAmount)):0,ce=S?.bundleDiscount??0,Wt=S?.appliedBundles??[],Qe=!!g?.freeShipping,Bt=U.find(k=>k.id===R),je=Qe?0:S?.shipping??Bt?.amount??0,Ae={};for(let k of g?.freeUnits??[])Ae[k.partNumber]=(Ae[k.partNumber]??0)+k.quantity;let zt=S?.tax??null,Vt=S?S.grandTotal:a-T-ce+je;return{sets:y,units:u.reduce((k,ne)=>k+(ne.components??[]).reduce((Ee,Gt)=>Ee+Gt.wheels*ne.qty,0),0),subtotal:a,hasUnpricedLine:p,discount:T,bundleDiscount:ce,appliedBundles:Wt,shipping:je,freeShipping:Qe,freeUnitsByPartNumber:Ae,tax:zt,grand:Vt,repricing:!!m?.refused&&S!==null&&W===m?.code,currency:n}},[u,n,m,U,R,S,W]),Kt=St(()=>({isOpen:i,preview:t,open:D,close:Ce,toggle:O,items:u,catalog:l,bundles:f,warmCatalog:xe,add:E,remove:F,setQty:G,replaceItems:ze,identify:Ge,clearCapturedCart:Xe,coupon:m,applyCoupon:le,removeCoupon:te,refuseCoupon:Se,couponBusy:j,deliveryOptions:U,shippingMethodId:R,setShippingMethodId:J,totals:Ye}),[i,t,D,Ce,O,u,l,f,xe,E,F,G,ze,Ge,Xe,m,le,te,Se,j,U,R,Ye]);return Cn(Lt.Provider,{value:Kt,children:e})}function It(){let e=gn(Lt);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as kn}from"react";function wt(e,t,n,r){for(;e.size>=t;){let o,i;for(let[u,c]of e){if(c.expiresAt<=r){o=u;break}i===void 0&&n(u)&&(i=u)}let s=o??i??e.keys().next().value;if(s===void 0)return;e.delete(s)}}var xn=6e4,Sn=5e3,vn=500,Ie=new Map;async function En(e){let{host:t,matchesRequestHost:n}=await rt();if(!t)return"";let r=await ot();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}var Pn=e=>e.includes("|slug:")||e.includes("|xhost:");async function Tt(e,t){let n=await En(e);if(!n)return t();let r=Date.now(),o=Ie.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),s=i.outcome.state==="failed",u=s?Sn:xn,c=Ie.get(n)?.lastGood,l=i.outcome.state==="ok"?i:s?c:void 0,d=s&&l?l:i;return wt(Ie,vn,Pn,r),Ie.set(n,{load:d,expiresAt:r+u,lastGood:l}),d}var Ln=404;function In(e){if(e instanceof me&&e.status===Ln)return{state:"absent"};let t=e instanceof me?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var wn="[storefront:chrome-load-failed]";function Tn(e,t){console.error(`${wn} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function Nt(e,t,n,r){try{let o=await t();return r?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){let i=In(o);return i.state==="failed"&&Tn(e,i),{value:n,outcome:i}}}function Nn(e){return e==="production"?"silent":"banner"}var io=Nn("production");function _n(e,t){return e?.trim()||t}function po({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=_n(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var An={name:de,legalName:null,foundedYear:null,faviconUrl:null,currencies:[],defaultCurrency:null,countries:[],defaultCountry:null,commerceEnabled:!0,cardPayments:!1,paymentMethods:[],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,mapsApiKey:null,mapsMapId:null,socialLinks:Re},go=kn(async()=>Tt("site",()=>Nt("site",async()=>{let e=await q.getSite();return{name:Ze(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,mapsApiKey:e.mapsApiKey??null,mapsMapId:e.mapsMapId??null,socialLinks:et(e.socialLinks)}},An)));var yo={name:de,legalName:null,foundedYear:null,faviconUrl:null,currencies:[{code:"USD",symbol:"$",decimalPlaces:2,isDefault:!0}],defaultCurrency:"USD",countries:[{code:"US",name:"United States",currency:"USD",url:"",isDefault:!0,chargeTax:!1,taxDisplay:"none",taxName:"",taxRate:null,postalLabel:"Zip Code"}],defaultCountry:"US",commerceEnabled:!0,cardPayments:!0,paymentMethods:["card"],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,mapsApiKey:null,mapsMapId:null,socialLinks:Re};import{useEffect as we,useRef as _t,useState as Te}from"react";var ye=new Map,Rn=64;async function Mn(e){if(!Je())return null;try{let t=await fetch(`${tt()}/logo-analysis.json?url=${encodeURIComponent(e)}`);if(!t.ok)return null;let n=await t.json();if(!n||typeof n!="object")return null;let{reversed:r,inkIsDark:o}=n;return typeof r!="string"?null:{reversed:r,inkIsDark:typeof o=="boolean"?o:null}}catch{return null}}function kt(e){let t=ye.get(e);if(t)return t;let n=Mn(e);if(ye.set(e,n),ye.size>Rn){let r=ye.keys().next();r.done||ye.delete(r.value)}return n}import{jsx as At,jsxs as Rt}from"react/jsx-runtime";var Dn={small:54,medium:66,large:84},On=44,Fn=202/22,Lo=16,Io=140,Un=.88,wo=16,$n="invert(1)";function qn({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,onLightSurface:o,reversedSrc:i,inkIsDark:s,size:u="medium",sizePx:c,wordmark:l,siteName:d=de,fitToContainer:f=!1,fitWordmarkToContainer:P=!1,fitFloorPx:w}){let h=l&&l.trim()?l.trim():d,[C,L]=Te(!1),N=_t(null),M=E=>{N.current=E};we(()=>{let E=N.current?.ownerDocument??document,F=()=>{L(E.documentElement.getAttribute("data-theme")==="light")};F();let G=new MutationObserver(F);return G.observe(E.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>G.disconnect()},[]);let x=n&&n.trim()?n.trim():null,I=!!x&&nt(x),S=o??(C&&t),H=r&&I&&x&&i!=null?{reversed:i,inkIsDark:s??null}:null,W=H!==null,[Q,b]=Te(null);we(()=>{if(!r||!x||!I||W){b(null);return}let E=!1;return b(null),kt(x).then(F=>{E||b(F)}),()=>{E=!0}},[r,x,I,W]);let v=H??Q,m=!!v&&v.inkIsDark!==null&&(S?!v.inkIsDark:v.inkIsDark),K=r&&!!x&&!I&&!S,j=m&&v?v.reversed:x,z=j?[j]:[],[R,J]=Te(0);we(()=>{J(0)},[x,m]);let Z=e==="footer"?On:Dn[u],D=c&&c>0?c:Z,Ce=Math.round(D*Fn),O=R<z.length?z[R]:null,[xe,ee]=Te(j),ae=O!==null&&O===xe,U=_t(null);we(()=>{let E=U.current;if(!E||!E.complete)return;if(E.naturalWidth>0||E.naturalHeight>0){ee(O);return}let F=!1;return E.decode().then(()=>!F&&ee(O),()=>!F&&J(G=>G+1)),()=>{F=!0}},[O]);let V=f||P,le=`calc(100cqi / ${((h.length+1)*Un).toFixed(2)})`,te=V&&w&&w>0?Math.min(w,D):null,Se=V?te===null?`min(${D}px, ${le})`:`clamp(${te}px, ${le}, ${D}px)`:`${D}px`;return Rt("span",{ref:M,className:"inline-flex items-center",children:[!ae&&Rt("span",{className:`font-display font-bold tracking-[0.18em] ${te===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:Se,lineHeight:1},"aria-label":h,children:[h,At("span",{className:"text-accent",children:"."})]}),O&&At("img",{ref:U,src:O,alt:h,width:Ce,height:D,className:"shrink-0 object-contain",style:{...ae?{height:`${D}px`,width:"auto",...f?{maxWidth:"100cqi"}:{}}:{display:"none"},...K?{filter:$n}:{}},onLoad:()=>ee(O),onError:()=>J(E=>E+1)},O)]})}import{Children as Kn,isValidElement as Wn,useEffect as Dt,useId as Bn,useLayoutEffect as zn,useRef as Y,useState as Ot}from"react";var Ne=(e,t)=>!!e[t]&&!e[t].disabled;function He(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(Ne(e,i))return i}return t}function Ke(e,t){return He(e,t===1?-1:e.length,t)}function We(e,t){return Ne(e,t)?t:Math.max(Ke(e,1),0)}function Mt(e,t,n){let{open:r,focus:o}=e,i=s=>({...e,...s});if(t.length===1&&/\S/.test(t)){let s=e.typed+t.toLowerCase(),u=n.findIndex((c,l)=>Ne(n,l)&&c.label.toLowerCase().startsWith(s));return{state:i({open:!0,typed:s,focus:u>=0?u:o}),handled:!0}}if(!r)return t==="ArrowDown"||t==="ArrowUp"||t==="Enter"||t===" "?{state:i({open:!0,typed:""}),handled:!0}:{state:e,handled:!1};switch(t){case"ArrowDown":return{state:i({focus:He(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:He(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:Ke(n,1)}),handled:!0};case"End":return{state:i({focus:Ke(n,-1)}),handled:!0};case"Enter":case" ":return Ne(n,o)?{state:i({open:!1,typed:""}),commit:o,refocus:!0,handled:!0}:{state:e,handled:!0};case"Escape":return{state:i({open:!1,typed:""}),refocus:!0,handled:!0};case"Tab":return{state:i({open:!1,typed:""}),handled:!1};default:return{state:e,handled:!1}}}import{Fragment as Qn,jsx as B,jsxs as Ft}from"react/jsx-runtime";function Vn({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[s,u]=Ot(!1),c=r!==void 0,l=c?r:s,[d,f]=Ot(0),P=Y({text:"",timer:0}),w=Y(null),h=Y(null),C=Y(null),L=Bn(),N=Y(null),M=e.findIndex(b=>b.value===t),x=b=>{b!==l&&(c||u(b),b?o?.():i?.())},I=b=>{let v=e[b];!v||v.disabled||(n(v.value),x(!1),h.current?.focus())},S=b=>{let v={open:l,focus:l?d:We(e,M),typed:P.current.text},m=Mt(v,b,e);return!m.handled&&m.state.open===l?!1:(m.state.typed!==v.typed&&(P.current.text=m.state.typed,window.clearTimeout(P.current.timer),P.current.timer=window.setTimeout(()=>{P.current.text=""},500)),f(m.state.focus),m.commit!==void 0?I(m.commit):x(m.state.open),m.refocus&&h.current?.focus(),m.handled)},H=Y(S);H.current=S;let W=Y(()=>x(!1));W.current=()=>x(!1);let Q=b=>{l||(N.current=b.nativeEvent,H.current(b.key)&&b.preventDefault())};return Dt(()=>{if(!l)return;let b=m=>{w.current?.contains(m.target)||W.current()},v=m=>{m!==N.current&&H.current(m.key)&&m.preventDefault()};return document.addEventListener("mousedown",b),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",v)}},[l]),Dt(()=>{l&&(P.current.text||f(We(e,M)))},[l]),zn(()=>{if(!l||!C.current)return;C.current.children.item(d)?.scrollIntoView({block:"nearest"})},[d,l]),{open:l,toggle:()=>x(!l),close:()=>x(!1),focusIdx:d,setFocusIdx:f,pick:b=>I(e.findIndex(v=>v.value===b)),wrapRef:w,triggerRef:h,listRef:C,listId:L,onTriggerKeyDown:Q,activeId:l?`${L}-${d}`:void 0}}var Gn={select:{list:"absolute left-0 top-full z-50 mt-1 max-h-[280px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:(e,t,n)=>["px-3 py-2.5 font-mono text-[13px] font-semibold uppercase tracking-[0.1em] transition-colors whitespace-nowrap",n?"cursor-not-allowed opacity-40":"cursor-pointer",e&&!n?"bg-accent text-bg":"bg-bg text-fg"].join(" ")},cell:{list:"absolute left-0 top-full z-50 mt-1 max-h-[320px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:e=>["cursor-pointer whitespace-nowrap px-6 py-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.1em] transition-colors",e?"bg-accent text-bg":"bg-bg text-fg"].join(" "),pickerMarker:!0},hairline:{list:"absolute left-0 top-full z-50 max-h-[320px] w-full overflow-y-auto border border-line bg-bg shadow-[0_6px_20px_rgba(0,0,0,0.10)]",item:(e,t)=>["flex cursor-pointer items-center justify-between gap-4 border-b border-line px-4 py-3 text-left text-[length:var(--size-body,14px)] transition-colors last:border-b-0",t?"border-fg font-medium text-fg":e?"border-fg text-fg":"text-fg-dim"].join(" "),pickerMarker:!0},region:{list:"absolute right-0 top-full z-[200] mt-2 flex min-w-[240px] flex-col border border-line bg-surface text-fg",item:(e,t,n,r)=>["flex w-full cursor-pointer items-center gap-3 px-3.5 py-3 text-left transition-colors","font-mono text-[13px] uppercase tracking-[0.18em]",e?"bg-surface-2 text-fg":"",r?"":"border-b border-line",t?"text-accent":""].join(" "),itemStyle:e=>e?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"}}};function Xn({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:s,listRef:u,ariaLabel:c}){let l=Gn[t];return B("ul",{ref:u,id:e,role:"listbox","aria-label":c,...l.pickerMarker?{"data-picker-menu":""}:{},className:l.list,children:n.map((d,f)=>{let P=d.value===r;return B("li",{id:`${e}-${f}`,role:"option","aria-selected":P,"aria-disabled":d.disabled||void 0,onMouseEnter:()=>!d.disabled&&i(f),onMouseDown:w=>{w.preventDefault(),d.disabled||s(d.value)},className:l.item(f===o,P&&d.value!=="",!!d.disabled,f===n.length-1),style:l.itemStyle?.(P),children:d.meta===void 0?d.label:Ft(Qn,{children:[B("span",{className:"flex-1 whitespace-nowrap",children:d.label}),B("span",{className:"ml-auto text-[12px] opacity-50",children:d.meta})]})},`${d.value}_${f}`)})})}function Yn({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:s,id:u,"aria-label":c}){let l=Kn.toArray(r).flatMap(h=>{if(!Wn(h))return[];if(h.type!=="option")return[];let L=h.props,N=L.value!==void 0?String(L.value):"",M=L.children,x=typeof M=="string"||typeof M=="number"?String(M):N;return[{value:N,label:x,disabled:!!L.disabled}]}),d=e??"",f=Vn({items:l,value:d,onPick:h=>t?.({target:{value:h}})}),w=l.find(h=>h.value===d)?.label??l[0]?.label??"";return Ft("div",{ref:f.wrapRef,className:"relative",children:[s&&B("input",{type:"hidden",name:s,value:d}),B("button",{ref:h=>{f.triggerRef.current=h},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":f.open,"aria-controls":f.open?f.listId:void 0,"aria-activedescendant":f.activeId,"aria-label":c,id:u,onClick:()=>!n&&f.toggle(),onKeyDown:h=>!n&&f.onTriggerKeyDown(h),className:`block w-full ${o??""}`,style:i,children:B("span",{className:"block w-full truncate text-left",children:w})}),f.open&&B(Xn,{id:f.listId,tone:"select",items:l,value:d,focusIdx:f.focusIdx,onFocus:f.setFocusIdx,onPick:f.pick,listRef:f.listRef})]})}var Fo="#c9a461",Ut=[{f:"black",label:"Black",hex:"#171717"},{f:"silver",label:"Silver",hex:"#cccccc"},{f:"bronze",label:"Bronze",hex:"#8a6438"},{f:"graphite",label:"Graphite",hex:"#3a3c3f"},{f:"red",label:"Candy Red",hex:"#7a0f14"}],Uo={name:"",color:"var(--fg)",family:"silver",src:""};function jn(e,t){let n=r=>{let o=Ut.findIndex(i=>i.f===r);return o===-1?Ut.length:o};return n(e)-n(t)||e.localeCompare(t)}function $o(e){let t=new Set;for(let n of e)for(let r of n.finishes??[])r?.family&&t.add(r.family);return[...t].sort(jn)}import{jsx as be,jsxs as ke}from"react/jsx-runtime";var Jn="font-mono text-[length:var(--size-label,12px)]",Zn="font-semibold uppercase tracking-[0.22em] text-fg";function $t(e){return`${e??Jn} ${Zn}`}function qt(){return be("span",{className:"text-accent",children:" *"})}function er({children:e,required:t,labelFace:n}){return ke("span",{className:$t(n),children:[e,t?be(qt,{}):null]})}function tr({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:s,children:u}){let c=s?`flex flex-col gap-2 ${s}`:"flex flex-col gap-2",l=n?be("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?ke("div",{className:c,children:[ke("label",{htmlFor:o,className:$t(i),children:[e,t?be(qt,{}):null]}),u,l]}):ke("label",{htmlFor:o,className:c,children:[be(er,{required:t,labelFace:i,children:e}),u]})}import{jsx as he,jsxs as rr}from"react/jsx-runtime";function nr({spokes:e,mesh:t=!1,className:n}){let s=c=>Math.round(c*1e3)/1e3,u=[];for(let c=0;c<e;c++){let l=c/e*Math.PI*2-Math.PI/2;if(u.push({x1:s(100+Math.cos(l)*22),y1:s(100+Math.sin(l)*22),x2:s(100+Math.cos(l)*86),y2:s(100+Math.sin(l)*86),main:!0}),t){let d=l+Math.PI/e;u.push({x1:s(100+Math.cos(d)*22*1.4),y1:s(100+Math.sin(d)*22*1.4),x2:s(100+Math.cos(d)*78),y2:s(100+Math.sin(d)*78),main:!1})}}return rr("svg",{viewBox:"0 0 200 200",fill:"none",stroke:"currentColor",className:n??"block h-[70%] w-[70%] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",children:[he("circle",{cx:100,cy:100,r:92,strokeWidth:2}),he("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),he("circle",{cx:100,cy:100,r:22,strokeWidth:2}),he("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),u.map((c,l)=>he("line",{x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:"currentColor",strokeWidth:c.main?6:3,strokeLinecap:"round",opacity:c.main?1:.5},l))]})}import{useState as or}from"react";import{jsx as se,jsxs as Be}from"react/jsx-runtime";function ir({customerEmail:e}){let{coupon:t,applyCoupon:n,removeCoupon:r,couponBusy:o}=It(),[i,s]=or("");async function u(){o||!i.trim()||(await n(i,e),s(""))}return Be("div",{className:"flex flex-col gap-2",children:[t===null?Be("div",{className:"flex border border-line",children:[se("input",{type:"text",value:i,onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),u())},placeholder:"Coupon code","aria-label":"Coupon code",className:"flex-1 bg-transparent px-3.5 py-3.5 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim"}),se("button",{type:"button",onClick:()=>{u()},disabled:o,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:o?"\u2026":"Apply"})]}):Be("div",{className:["flex items-center justify-between gap-3 border px-3.5 py-3",t.valid?"border-accent":"border-line"].join(" "),style:t.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[se("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",t.valid?"text-accent":t.deferred?"text-fg":"text-fg-dim line-through"].join(" "),children:t.code}),se("button",{type:"button",onClick:r,"aria-label":`Remove coupon ${t.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),t?.deferred?se("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:pt}):t&&!t.valid&&t.message&&se("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:t.message})]})}function Qo(){let e=typeof crypto<"u"?crypto:void 0;if(typeof e?.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}export{xr as a,Sr as b,vr as c,it as d,Me as e,sr as f,ar as g,lr as h,ur as i,Xt as j,Yt as k,cr as l,dr as m,De as n,Oe as o,fe as p,Pe as q,rn as r,Ue as s,Ir as t,wr as u,sn as v,Tr as w,Nr as x,an as y,kr as z,un as A,_r as B,Ar as C,yt as D,Ur as E,$r as F,qr as G,yr as H,dt as I,Le as J,qe as K,jr as L,It as M,po as N,An as O,yo as P,Dn as Q,On as R,Lo as S,Io as T,wo as U,qn as V,Vn as W,Xn as X,Yn as Y,Fo as Z,Ut as _,Uo as $,jn as aa,$o as ba,er as ca,tr as da,nr as ea,ir as fa,Qo as ga};