efficient-storefront-blocks 0.122.0 → 0.123.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/chunks/{EditorPreviewCheckout-HGXPPOPY.js → EditorPreviewCheckout-GKVO7FIF.js} +1 -1
- package/dist/chunks/SiteEditorProvider-INLF7RK2.js +1 -0
- package/dist/chunks/chunk-3UESM7IL.js +1 -0
- package/dist/chunks/{chunk-7OV26TMN.js → chunk-A4GCH4L7.js} +1 -1
- package/dist/chunks/{chunk-PNXEY4EH.js → chunk-ABH43N7O.js} +1 -1
- package/dist/chunks/chunk-HG7XPHVS.js +34 -0
- package/dist/chunks/chunk-HG7XPHVS.js.LEGAL.txt +31 -0
- package/dist/chunks/chunk-JRGIFGZA.js +1 -0
- package/dist/chunks/chunk-MFXGST7A.js +342 -0
- package/dist/chunks/{fitment-data-QP4XEFXC.js → fitment-data-6YOZL3W4.js} +1 -1
- package/dist/chunks/section-css-style-TIXCQNGX.js +1 -0
- package/dist/editor/components/CategorySource.d.ts +5 -2
- package/dist/editor/components/CategorySource.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +2 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +33 -65
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/BoxHeaderBar.js +1 -1
- package/dist/render/components/FinishSwatches.js +2 -2
- package/dist/render/components/FooterLogo.js +1 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FooterSection.js +1 -1
- package/dist/render/components/FooterSocial.js +1 -1
- package/dist/render/components/GridCardTemplate.js +1 -1
- package/dist/render/components/HeaderNavItem.js +1 -1
- package/dist/render/components/LegalLine.js +1 -1
- package/dist/render/components/MenuLinkBlock.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/SectionGroupBody.js +1 -1
- package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
- package/dist/render/components/card-pieces/CardEyebrow.js +1 -1
- package/dist/render/components/card-pieces/CardName.js +1 -1
- package/dist/render/components/card-pieces/CardPicture.js +1 -1
- package/dist/render/components/card-pieces/CardPrice.js +1 -1
- package/dist/render/components/card-pieces/CardProductBadge.js +1 -1
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
- package/dist/render/components/card-pieces/CardSizes.js +1 -1
- package/dist/render/components/card-pieces/CardSpecs.js +1 -1
- package/dist/render/components/card-pieces/CardSurfaceFrame.js +1 -1
- package/dist/render/components/card-pieces/card-row.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +3 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/lib/block-parts.d.ts +5 -0
- package/dist/render/lib/block-parts.js +1 -0
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.d.ts +3 -3
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.d.ts +4 -4
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/meta.d.ts +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.d.ts +3 -3
- package/dist/words.d.ts +4 -0
- package/dist/words.js +2 -2
- package/package.json +3 -3
- package/dist/chunks/SiteEditorProvider-R3ZNQPAI.js +0 -1
- package/dist/chunks/chunk-NYZMVYQ4.js +0 -1
- package/dist/chunks/chunk-TAV4GVJC.js +0 -342
- /package/dist/chunks/{chunk-TAV4GVJC.js.LEGAL.txt → chunk-MFXGST7A.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-IJC4EEZC.js → chunk-PGKDGGEE.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-storefront-blocks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.123.1",
|
|
4
4
|
"description": "The EFFICIENT storefront's website editor — the website builder assembled with the storefront's own sections — for an app that edits a storefront website inside its own page. Built from the efficient-storefront-blocks repository.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -103,9 +103,9 @@
|
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"@stripe/react-stripe-js": "^6.7.0",
|
|
105
105
|
"@stripe/stripe-js": "^9.9.0",
|
|
106
|
-
"efficient-easel": "^37.
|
|
106
|
+
"efficient-easel": "^37.1.0",
|
|
107
107
|
"efficient-shell": "^13.24.1",
|
|
108
|
-
"efficient-web-builder": "^73.
|
|
108
|
+
"efficient-web-builder": "^73.1.0",
|
|
109
109
|
"next": ">=16",
|
|
110
110
|
"react": ">=19",
|
|
111
111
|
"react-dom": ">=19"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{lo as r}from"./chunk-TAV4GVJC.js";import"./chunk-PNXEY4EH.js";import"./chunk-IJC4EEZC.js";import"./chunk-Y6SLVHK3.js";import{jsx as o}from"react/jsx-runtime";import e from"efficient-easel/screen/components/ScreenStoreProvider";function a(t){return o(e,{...t,parts:r})}export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as xe,_ as _t,aa as Rt,ba as Nt,da as G,g as wt}from"./chunk-7OV26TMN.js";import{Di as xt,Fi as ze,Gi as Ve,Ii as St,Ve as Ct,Vi as Ce,Wi as Et,Zi as Xe,_i as Pt}from"./chunk-PNXEY4EH.js";import{d as vt,p as de}from"./chunk-IJC4EEZC.js";import{createContext as Ln,useContext as Ot,useEffect as An,useMemo as Se,useState as At}from"react";function It(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function fe(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 Ye=4,Yr=1,Qr={unit:"set",spares:0,spareSide:"left"};function Lt(e){return e.unit==="single"?1:Ye+e.spares}function jr(e,t){return[{partNumber:e.partNumber,wheels:Lt(t),prices:e.prices}]}function Zr(e,t){let n=Lt(t)-Ye;if(n<=0||e.length===0)return e;let r=Nn(e),o=r?r[t.spareSide]:0;return e.map((i,a)=>a===o?{...i,wheels:i.wheels+n}:i)}function Nn(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 kn(e,t){return t.spares>0?`${e} + spare`:e}function Jr(e){return e.unit==="single"?"Single":kn(`Set of ${Ye}`,e)}var eo="data-add-to-basket",Qe=9,In="en",kt=new Map;function Te(e,t,n){let r=`${e}|${t??""}|${n??""}`,o=kt.get(r);return o||(o=new Intl.NumberFormat(In,{style:"currency",currency:e,...t===void 0?{}:{minimumFractionDigits:t},...n===void 0?{}:{maximumFractionDigits:n}}),kt.set(r,o)),o}function Y(e,t,n=0){return Te(t,0,n).format(e)}function to(e,t){return Te(t).format(e)}function no(e,t){let n=e.savings[t];if(n===void 0)return null;let r=Y(n,t);return e.savingIsFrom?`Save from ${r}`:`Save ${r}`}import{jsx as Dn}from"react/jsx-runtime";var Tn="storefront-country",Tt=Tn,je=Ln(null);function On(e){return Mt(e,"catalogue")}function Mn(e){return Mt(e,"money")}function Mt(e,t){let n=new Map(e.map(r=>[r.code,r.decimalPlaces]));return(r,o)=>{if(!o)return"";let i=n.get(o)??0;return Te(o,t==="money"?i:0,i).format(r)}}function so({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=Se(()=>t??[],[t]),a=Se(()=>n??[],[n]),l=Se(()=>r||i.find(g=>g.isDefault)?.code||i[0]?.code||"",[r,i]),c=Se(()=>o||a.find(g=>g.isDefault)?.code||a[0]?.code||"",[o,a]),[u,m]=At(c),[b,d]=At(!1);An(()=>{let g=de.getItem(Tt);g&&a.some(L=>L.code===g)&&m(g),d(!0)},[a]);function P(g){m(g),de.setItem(Tt,g)}let k=Se(()=>{let g=a.find(y=>y.code===u)??null,L=g?.currency,I=L&&i.some(y=>y.code===L)?L:l,A=On(i),_=Mn(i);return{country:u,currency:I,setCountry:P,currencies:i,countries:a,activeCountry:g,formatPrice:(y,U)=>A(y,U??I),formatMoney:(y,U)=>_(y,U??I),ready:b}},[u,i,a,l,b]);return Dn(je.Provider,{value:k,children:e})}function Dt(e){let t=Ot(je);if(!t&&!e?.optional)throw new Error("useCurrency must be used within a CurrencyProvider");return t}function lo(){return Ot(je)?.country??""}import{createContext as Qn,useCallback as E,useContext as jn,useEffect as z,useMemo as jt,useRef as Q,useState as w}from"react";function Ft(){return"/edit"}function $t(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var Ht="We'll confirm this discount when you place your order.",mo="Confirmed at checkout";function go(e){return e&&(e.valid||e.deferred)?e.code:void 0}var Ut="coupon_code: ";function ho(e){return!(e instanceof xe)||e.status!==400||!e.message.startsWith(Ut)?null:e.message.slice(Ut.length)}function Bt(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 Oe="Price on request",Un="Request a quote",qt="from ",xo="From ",So="each",Wt="Free",vo="Updating";function Ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Je(e,t){let n=e?.[t];return Ze(n)?n:null}function Eo(e,t,n,r){let o=Je(e,n),i=Je(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function Po(e,t,n,r){if(n==null&&r==null)return!0;let o=Je(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var $n={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function Hn(e,t,n){if(!Ze(e))return $n;let r=Ze(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function wo(e,t,n=""){return!e.priced||e.unit==null?Oe:`${n}${Y(e.unit,t)}`}function _o(e,t){return e.was==null?null:Y(e.was,t)}function Bn(e,t,n=1){let r=fe(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((a,l)=>a+l.wheels,0),i=Math.min(...e.map(a=>a.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var qn={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function Ro(e,t,n,r=1){let o=Hn(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 a=Bn(t.components,n,r);return a.priced?{priced:!0,unit:a.unit,isFrom:a.isFrom,was:null,onSale:!1,setTotal:a.setTotal,fromSetTotal:i}:{...qn,fromSetTotal:i}}function Wn(e,t){return!e.priced||e.unit==null?Oe:`${e.isFrom?qt:""}${Y(e.unit,t)}`}function No(e,t){return e.was==null?null:Y(e.was,t)}function ko(e,t){return!e.priced||e.unit==null?Un:Wn(e,t)}function Io(e,t){let n=e.savings[t];if(n===void 0||e.components.length===0)return null;let r=0;for(let i of e.components){let a=i.prices?.[t];if(typeof a!="number")return null;r+=a*i.quantity}let o=Y(r-n,t);return{was:Y(r,t),amount:e.savingIsFrom?`${qt}${o}`:o}}var Gn=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function Gt(e){return Gn.test(e.trim())}var Kt="sf:ga-purchases",Kn=20;function Vt(){return typeof window>"u"||window.parent!==window}function ve(...e){try{if(Vt()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function zn(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:fe(e.components,t)??0,quantity:e.qty}}function et(e,t){return e.filter(Me).map(n=>zn(n,t))}function Do(e){ve("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=et([e],t);n.length!==0&&ve("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function Fo(e){let t=et(e.lines,e.currency);t.length!==0&&ve("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var zt=new Set;function Vn(e){if(zt.has(e))return!1;zt.add(e);try{let t=JSON.parse(de.getItem(Kt)??"[]");if(t.includes(e))return!1;de.setItem(Kt,JSON.stringify([...t,e].slice(-Kn)))}catch{}return!0}function Uo(e){let t=e.confirmation;if(Vt()||!Vn(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);ve("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:et(e.lines,n)}),e.adsSendTo&&ve("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var Xn="Arranged after review",Yt="Calculated at checkout",Yn=Yt,Bo=Yt;function Qt({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function qo(e){switch(e){case"arranged":return Xn;case"pending":return Yn;case"free":return Wt;case"charged":return null}}import{jsx as tr}from"react/jsx-runtime";var Zn=400,Jn=400,er=1500;function Me(e){return(e.components?.length??0)>0}function Zt(e,t){return{code:e,valid:t.valid,deferred:$t(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function en(e,t){return fe(e.components,t)}function tt(e,t){let n=en(e,t);return n===null?null:n*e.qty}function Jt(e){return e!=="tyre"}var tn=Qn(null);function ti({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=Dt(),[i,a]=w(t),[l,c]=w([]),[u,m]=w([]),[b,d]=w([]),[P,k]=w(!1),g=Q(new Set),[L,I]=w([]),[A,_]=w(!1),[y,U]=w(null),[V,J]=w(null),[T,C]=w(null),[R,x]=w(0),ee=E(()=>x(s=>s+1),[]),[pe,me]=w(void 0),[K,qe]=w(null),[v,O]=w(null),[ge,ie]=w(!1),[M,he]=w(null),te=Q(void 0),H=E(()=>a(!0),[]),ae=E(()=>a(!1),[]),X=E(()=>a(s=>!s),[]);z(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&H()},[H,t]);let $=Ft(),Re=Q($);z(()=>{Re.current!==$&&(Re.current=$,t||ae())},[$,t,ae]);let F=E(s=>{qe(p=>p?.country===s?.country&&p?.subdivision===s?.subdivision&&p?.postcode===s?.postcode?p:s)},[]),Ne=E((s,p)=>{_(!0),!(!p||!Jt(s))&&I(f=>f.includes(p)?f:[...f,p])},[]),se=A||l.length>0,le=Q(!0);z(()=>(le.current=!0,()=>{le.current=!1}),[]),z(()=>{if(t)return;let s=[...L,...l.filter(f=>Jt(f.kind)).map(f=>f.slug)],p=[...new Set(s)].filter(f=>f&&!g.current.has(f));if(p.length!==0){for(let f of p)g.current.add(f);G.listWheelsBySlug(p).then(f=>{if(!le.current||f.length===0)return;let h=new Set(f.map(S=>S.slug));m(S=>[...S.filter(re=>!h.has(re.slug)),...f])})}},[t,L,l]),z(()=>{if(t||!se||P)return;let s=!0;return G.listBundles().then(p=>{s&&(d(p),k(!0))}),()=>{s=!1}},[t,se,P]);let B=y?.deliveryOptions??[],ye=y?.courier??null;z(()=>{y&&he(s=>s&&B.some(p=>p.id===s)?s:B[0]?.id??null)},[y]);let ne=E(()=>l.filter(Me).flatMap(s=>It(s.components,s.qty)),[l]),ue=E(async(s,p)=>{let f=s.trim().toUpperCase();if(!f)return;let h=ne();if(h.length===0){O({code:f,valid:!1,message:"Add a wheel to the cart first."});return}ie(!0),te.current=p;try{let S=await G.validateCoupon({code:f,items:h,currency:n,shippingMethodId:M??void 0,customerEmail:p});O(Zt(f,S))}catch{O({code:f,valid:!1,unchecked:!0,message:"Could not check that code. Please try again."})}finally{ie(!1)}},[ne,n,M]),ke=E(()=>{O(null),te.current=void 0},[]),Ie=E(s=>{if(!v)return;let{code:p}=v;O(f=>f&&f.code===p?{code:p,valid:!1,refused:!0,message:s}:f)},[v]);z(()=>{if(!v||v.refused)return;let s=v.code,p=h=>h!==null&&h.code===s&&!h.refused,f=setTimeout(async()=>{let h=ne();if(h.length===0){O(S=>p(S)?{code:s,valid:!1,message:"Add a wheel to the cart first."}:S);return}ie(!0);try{let S=await G.validateCoupon({code:s,items:h,currency:n,shippingMethodId:M??void 0,customerEmail:te.current});O(re=>p(re)?Zt(s,S):re)}catch{}finally{ie(!1)}},Zn);return()=>clearTimeout(f)},[l,n,M]);let N=v&&!v.refused?v.code:void 0;z(()=>{if(t)return;let s=!0,p=l,f=setTimeout(async()=>{let h=ne();if(h.length===0){U(null),J(null),me(void 0);return}try{let S=await G.quoteCart({items:h,currency:n,shippingMethodId:M??void 0,couponCode:N,customerEmail:te.current||void 0,country:K?.country||r||void 0,subdivision:K?.country&&K.subdivision||void 0,postcode:K?.country&&K.postcode||void 0});if(!s)return;U(S),J(p),C(null)}catch{if(!s)return;C(p)}me(N)},Jn);return()=>{s=!1,clearTimeout(f)}},[l,n,M,N,r,K,R]);let q=E(s=>{c(p=>{let f=p.findIndex(h=>h.id===s.id);return f===-1?[...p,s]:p.map((h,S)=>S===f?{...h,qty:Math.min(Qe,h.qty+s.qty)}:h)}),Xt(s,n)},[n]),Le=E(s=>{c(p=>p.filter(f=>f.id!==s))},[]),lt=E((s,p)=>{let f=Math.max(1,Math.min(Qe,p));c(h=>h.map(S=>S.id===s?{...S,qty:f}:S))},[]),ut=E(s=>{c(s)},[]),[be,Sn]=w(null),ct=Q(null);ct.current=be;let W=Q(null),We=Q(""),dt=E((s,p)=>{let f=s.trim().toLowerCase();Gt(f)&&Sn(h=>h&&h.email===f&&h.firstName===(p??"")?h:{email:f,firstName:p??""})},[]);z(()=>{if(t||!be)return;let s=Bt(l.filter(Me),h=>tt(h,n)===null?Oe:o(tt(h,n),n)),p={email:be.email,firstName:be.firstName,currency:n,items:s},f=JSON.stringify(p);if(f!==We.current)return W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{W.current=null,We.current=f,G.captureCart(p).catch(h=>{})},er),()=>{W.current&&(clearTimeout(W.current),W.current=null)}},[l,be,n,t]);let ft=E(()=>{W.current&&(clearTimeout(W.current),W.current=null);let s=ct.current;s&&(We.current="",G.captureCart({email:s.email,firstName:s.firstName,currency:n,items:[]}).catch(p=>{}))},[n]),pt=jt(()=>{let s=l.reduce((D,ce)=>{let Ae=tt(ce,n);return Ae===null?D:D+Ae},0),p=l.some(D=>en(D,n)===null),f=l.reduce((D,ce)=>D+ce.qty,0),h=v?.valid?v.effects:void 0,S=h?Math.min(s,Number(h.discountAmount)):0,re=y?.bundleDiscount??0,En=y?.appliedBundles??[],Ge=!!h?.freeShipping,yt=B.find(D=>D.id===M),bt=Ge?0:y?.shipping??yt?.amount??0,Pn=Qt({quoted:y!==null,optionCount:B.length,chosenAmount:yt?.amount,couponWaivesFreight:Ge}),Ke={};for(let D of h?.freeUnits??[])Ke[D.partNumber]=(Ke[D.partNumber]??0)+D.quantity;let wn=y?.tax??null,_n=y?y.grandTotal:s-S-re+bt;return{sets:f,units:l.reduce((D,ce)=>D+(ce.components??[]).reduce((Ae,Rn)=>Ae+Rn.wheels*ce.qty,0),0),subtotal:s,hasUnpricedLine:p,discount:S,bundleDiscount:re,appliedBundles:En,shipping:bt,freeShipping:Ge,shippingStatus:Pn,freeUnitsByPartNumber:Ke,tax:wn,grand:_n,repricing:!!v?.refused&&y!==null&&pe===v?.code,quoted:y!==null&&V===l,serverSubtotal:y?.subtotal??null,quoteFailed:T===l,currency:n}},[l,n,v,B,M,y,pe,V,T]),mt=Q(!0),gt=E(s=>{mt.current=s},[]),ht=E(s=>{q(s),mt.current&&H()},[q,H]),vn=jt(()=>({isOpen:i,preview:t,open:H,close:ae,toggle:X,items:l,catalog:u,bundles:b,warmCatalog:Ne,add:q,addAndOpen:ht,setAutoOpen:gt,remove:Le,setQty:lt,replaceItems:ut,identify:dt,clearCapturedCart:ft,coupon:v,applyCoupon:ue,removeCoupon:ke,refuseCoupon:Ie,couponBusy:ge,deliveryOptions:B,setQuoteDestination:F,courier:ye,requote:ee,shippingMethodId:M,setShippingMethodId:he,totals:pt}),[i,t,H,ae,X,l,u,b,Ne,q,ht,gt,Le,lt,ut,dt,ft,v,ue,ke,Ie,ge,B,F,ye,ee,M,pt]);return tr(tn.Provider,{value:vn,children:e})}function nn(){let e=jn(tn);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as dr}from"react";function rn(e){return/(?:^|\|)(?:slug|xhost):/.test(e)}function on(e,t,n,r){for(;e.size>=t;){let o,i;for(let[l,c]of e){if(c.expiresAt<=r){o=l;break}i===void 0&&n(l)&&(i=l)}let a=o??i??e.keys().next().value;if(a===void 0)return;e.delete(a)}}var nr=6e4,rr=5e3,or=500,De=new Map;async function ir(e){let{host:t,matchesRequestHost:n}=await _t();if(!t)return"";let r=await Rt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}async function an(e,t){if(await Nt()!==null)return t();let n=await ir(e);if(!n)return t();let r=Date.now(),o=De.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),a=i.outcome.state==="failed",l=a?rr:nr,c=De.get(n)?.lastGood,u=i.outcome.state==="ok"?i:a?c:void 0,m=a&&u?u:i;return on(De,or,rn,r),De.set(n,{load:m,expiresAt:r+l,lastGood:u}),m}var ar=404;function sr(e){if(e instanceof xe&&e.status===ar)return{state:"absent"};let t=e instanceof xe?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var lr="[storefront:chrome-load-failed]";function ur(e,t){console.error(`${lr} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function sn(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=sr(o);return i.state==="failed"&&ur(e,i),{value:n,outcome:i}}}function cr(e){return e==="production"?"silent":"banner"}var ui=cr("production");function fr(e,t){return e?.trim()||t}function yi({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=fr(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var pr={name:Ce,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,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:Xe},bi=dr(async()=>an("site",()=>sn("site",async()=>{let e=await G.getSite();return{name:Et(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,consentEnabled:e.consentEnabled??!1,consentPrivacyPage:e.consentPrivacyPage??null,consentNoticeOptOut:e.consentNoticeOptOut??!1,privacyPage:e.privacyPage??null,termsPage:e.termsPage??null,footerCookieSettings:e.footerCookieSettings??!0,footerSitemap:e.footerSitemap??!0,socialLinks:Pt(e.socialLinks)}},pr)));var Ci={name:Ce,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,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:Xe};import{jsx as mr}from"react/jsx-runtime";function Si({tone:e="bad",role:t,children:n}){return mr("div",{role:t,className:["border bg-surface px-4 py-3 text-[14px] leading-relaxed text-fg",e==="good"?"border-accent":e==="bad"?"border-alert":"border-line"].join(" "),children:n})}import{jsx as Pe,jsxs as nt}from"react/jsx-runtime";import{useEffect as Fe,useId as br,useRef as un,useState as Ue}from"react";import{useRootIsDark as Cr}from"efficient-shell/theme";import{efficientClientOpen as gr}from"efficient-easel/screen/lib/session";var Ee=new Map,hr=64;async function yr(e){if(!gr())return null;try{let t=await fetch(`${vt()}/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 ln(e){let t=Ee.get(e);if(t)return t;let n=yr(e);if(Ee.set(e,n),Ee.size>hr){let r=Ee.keys().next();r.done||Ee.delete(r.value)}return n}var xr=202/22,Sr=.88,Hi=16,vr="invert(1)";function Bi({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,color:o=null,onLightSurface:i,reversedSrc:a,inkIsDark:l,size:c="medium",sizePx:u,sizeUnit:m,wordmark:b,siteName:d=Ce,fitToContainer:P=!1,fitWordmarkToContainer:k=!1,fitFloorPx:g,hideClass:L,hideAttrs:I}){let A=b&&b.trim()?b.trim():d,[_,y]=Ue(null),U=un(null),V=N=>{U.current=N};Fe(()=>{y(U.current?.ownerDocument??null)},[]);let J=!Cr({doc:_,whenUnset:!0}),T=n&&n.trim()?n.trim():null,C=!!T&&wt(T),R=i??(J&&t),x=o&&o.trim()?o.trim():null,ee=r&&!x,pe=`logo-color-${br().replace(/[^A-Za-z0-9_-]/g,"")}`,me=ee&&C&&T&&a!=null?{reversed:a,inkIsDark:l??null}:null,K=me!==null,[qe,v]=Ue(null);Fe(()=>{if(!ee||!T||!C||K){v(null);return}let N=!1;return v(null),ln(T).then(q=>{N||v(q)}),()=>{N=!0}},[ee,T,C,K]);let O=me??qe,ge=!!O&&O.inkIsDark!==null&&(R?!O.inkIsDark:O.inkIsDark),ie=ee&&!!T&&!C&&!R,M=ge&&O?O.reversed:T,he=M?[M]:[],[te,H]=Ue(0);Fe(()=>{H(0)},[T,ge]);let ae=e==="footer"?Ve:ze[c],X=u&&u>0?u:ae,$=(u&&u>0?Ct(u,m,"size",St):null)??`${X}px`,Re=Math.round(X*xr),F=te<he.length?he[te]:null,[Ne,se]=Ue(M),le=F!==null&&F===Ne,B=un(null);Fe(()=>{let N=B.current;if(!N||!N.complete)return;if(N.naturalWidth>0||N.naturalHeight>0){se(F);return}let q=!1;return N.decode().then(()=>!q&&se(F),()=>!q&&H(Le=>Le+1)),()=>{q=!0}},[F]);let ye=P||k,ne=`calc(100cqi / ${((A.length+1)*Sr).toFixed(2)})`,ue=ye&&g&&g>0?$===`${X}px`?`${Math.min(g,X)}px`:`min(${g}px, ${$})`:null,ke=ye?ue===null?`min(${$}, ${ne})`:`clamp(${ue}, ${ne}, ${$})`:$,Ie=nt("span",{className:`font-display font-bold tracking-[0.18em] ${ue===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:ke,lineHeight:1,...x?{color:x}:{}},"aria-label":A,children:[A,Pe("span",{className:"text-accent",style:x?{color:x}:void 0,children:"."})]});return nt("span",{ref:V,className:xt("inline-flex items-center",L??""),...I,children:[!le&&Ie,x&&F&&Pe("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:nt("filter",{id:pe,colorInterpolationFilters:"sRGB",children:[Pe("feFlood",{style:{floodColor:x}}),Pe("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),F&&Pe("img",{ref:B,src:F,alt:A,width:Re,height:X,className:"shrink-0 object-contain",style:{...le?{height:$,width:"auto",...P?{maxWidth:"100cqi"}:{}}:{display:"none"},...ie?{filter:vr}:{},...x?{filter:`url(#${pe})`}:{}},onLoad:()=>se(F),onError:()=>H(N=>N+1)},F)]})}var Wi="w-full border-2 border-line bg-bg px-4 py-4 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",cn="w-0 min-w-0 flex-1",Gi="w-0 min-w-[7rem] flex-1";import{jsx as we,jsxs as Pr}from"react/jsx-runtime";function Er({spokes:e,mesh:t=!1,className:n}){let a=c=>Math.round(c*1e3)/1e3,l=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(l.push({x1:a(100+Math.cos(u)*22),y1:a(100+Math.sin(u)*22),x2:a(100+Math.cos(u)*86),y2:a(100+Math.sin(u)*86),main:!0}),t){let m=u+Math.PI/e;l.push({x1:a(100+Math.cos(m)*22*1.4),y1:a(100+Math.sin(m)*22*1.4),x2:a(100+Math.cos(m)*78),y2:a(100+Math.sin(m)*78),main:!1})}}return Pr("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:[we("circle",{cx:100,cy:100,r:92,strokeWidth:2}),we("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),we("circle",{cx:100,cy:100,r:22,strokeWidth:2}),we("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),l.map((c,u)=>we("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},u))]})}var Xi="#c9a461",dn=[{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"}],Yi={name:"",color:"var(--fg)",family:"silver",src:""};function wr(e,t){let n=r=>{let o=dn.findIndex(i=>i.f===r);return o===-1?dn.length:o};return n(e)-n(t)||e.localeCompare(t)}function Qi(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(wr)}import{useEffect as _r,useRef as fn,useState as Rr}from"react";import{jsx as oe,jsxs as rt}from"react/jsx-runtime";function Nr({customerEmail:e,disabled:t=!1}){let{coupon:n,applyCoupon:r,removeCoupon:o,couponBusy:i}=nn(),[a,l]=Rr(""),c=fn(!1),u=fn(null);_r(()=>{!c.current||n===null||(c.current=!1,u.current?.focus())},[n]);async function m(){t||i||!a.trim()||(c.current=!0,await r(a,e),l(""))}return rt("div",{className:"flex flex-col gap-2",children:[n===null?rt("div",{className:"flex border border-line",children:[oe("input",{type:"text",value:a,onChange:b=>l(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),m())},placeholder:"Coupon code","aria-label":"Coupon code",disabled:t,className:`${cn} bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim`}),oe("button",{type:"button",onClick:()=>{m()},disabled:i||t,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:i?"\u2026":"Apply"})]}):rt("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",n.valid?"border-accent":"border-line"].join(" "),style:n.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[oe("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",n.valid?"text-accent":n.deferred||n.unchecked?"text-fg":"text-fg-dim line-through"].join(" "),children:n.code}),n.unchecked&&oe("button",{type:"button",onClick:()=>{r(n.code,e)},disabled:i||t,className:"ml-auto font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:text-fg disabled:cursor-wait disabled:opacity-60",children:i?"\u2026":"Try again"}),!t&&oe("button",{ref:u,type:"button",onClick:o,"aria-label":`Remove coupon ${n.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),n?.deferred?oe("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:Ht}):n&&!n.valid&&n.message&&oe("p",{role:"alert",className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:n.message})]})}var ot="Ads on. Shopper can opt out.",$e="Ads and analytics off until Accept",kr={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:ot,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:$e,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:ot,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:ot,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:$e,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:$e,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:$e,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function Ir(e){let t=[...e.googleAds?["Google"]:[],...e.meta?["Facebook","Instagram"]:[]];return t.length<=1?t.join(""):`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function oa(e,t,n){let r=Ir(n),o=r?`We use cookies to count visits and to show you ${t} ads on ${r}.`:"We use cookies to count visits.";return e.model==="opt-in"?{heading:r?"Cookies and ads":"Cookies",before:`${o} Nothing loads until you choose. You can change this at any time with `,link:e.footerLink,after:" at the bottom of every page."}:{heading:r?"Cookies and ads":"Cookies",before:`${o} You can say no at any time: choose Privacy choices, or use `,link:e.footerLink,after:" at the bottom of every page."}}var ia={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on",close:"Close",cookieSettings:"Cookie settings"};var Lr={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var Ar=Lr;function ua(e=Ar){if(e.asked)return e.ads?"granted":"denied"}function da(){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)}`}import{Children as Or,isValidElement as Mr,useEffect as mn,useId as Dr,useLayoutEffect as yn,useRef as j,useState as gn}from"react";var He=(e,t)=>!!e[t]&&!e[t].disabled;function it(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(He(e,i))return i}return t}function at(e,t){return it(e,t===1?-1:e.length,t)}function st(e,t){return He(e,t)?t:Math.max(at(e,1),0)}function pn(e,t,n){let{open:r,focus:o}=e,i=a=>({...e,...a});if(t.length===1&&/\S/.test(t)){let a=e.typed+t.toLowerCase(),l=n.findIndex((c,u)=>He(n,u)&&c.label.toLowerCase().startsWith(a));return{state:i({open:!0,typed:a,focus:l>=0?l: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:it(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:it(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:at(n,1)}),handled:!0};case"End":return{state:i({focus:at(n,-1)}),handled:!0};case"Enter":case" ":return He(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{placeMenu as Fr}from"efficient-shell/ui";import{Fragment as Gr,jsx as Z,jsxs as bn}from"react/jsx-runtime";var hn={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function Ur({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[a,l]=gn(!1),c=r!==void 0,u=c?r:a,[m,b]=gn(0),d=j({text:"",timer:0}),P=j(null),k=j(null),g=j(null),L=Dr(),I=j(null),A=e.findIndex(C=>C.value===t),_=C=>{C!==u&&(c||l(C),C?o?.():i?.())},y=C=>{let R=e[C];!R||R.disabled||(n(R.value),_(!1),k.current?.focus())},U=C=>{let R={open:u,focus:u?m:st(e,A),typed:d.current.text},x=pn(R,C,e);return!x.handled&&x.state.open===u?!1:(x.state.typed!==R.typed&&(d.current.text=x.state.typed,window.clearTimeout(d.current.timer),d.current.timer=window.setTimeout(()=>{d.current.text=""},500)),b(x.state.focus),x.commit!==void 0?y(x.commit):_(x.state.open),x.refocus&&k.current?.focus(),x.handled)},V=j(U);V.current=U;let J=j(()=>_(!1));J.current=()=>_(!1);let T=C=>{u||(I.current=C.nativeEvent,V.current(C.key)&&C.preventDefault())};return mn(()=>{if(!u)return;let C=x=>{P.current?.contains(x.target)||J.current()},R=x=>{x!==I.current&&V.current(x.key)&&x.preventDefault()};return document.addEventListener("mousedown",C),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",R)}},[u]),mn(()=>{u&&(d.current.text||b(st(e,A)))},[u]),yn(()=>{if(!u||!g.current)return;g.current.children.item(m)?.scrollIntoView({block:"nearest"})},[m,u]),{open:u,toggle:()=>_(!u),close:()=>_(!1),focusIdx:m,setFocusIdx:b,pick:C=>y(e.findIndex(R=>R.value===C)),wrapRef:P,triggerRef:k,listRef:g,listId:L,onTriggerKeyDown:T,activeId:u?`${L}-${m}`:void 0}}var $r={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-3 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 ${hn.label} 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 ${hn.body} 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-4 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 Hr(e,t){yn(()=>{let n=e.current,r=n?.ownerDocument.defaultView;if(!n||!r)return;let o=()=>{let i=n.style;i.top=i.bottom=i.marginTop=i.marginBottom=i.maxHeight=i.overflowY=i.translate="";let a=n.offsetParent??n.parentElement;if(!a)return;let l=a.getBoundingClientRect(),c=n.getBoundingClientRect(),u=Math.abs(c.right-l.right)<Math.abs(c.left-l.left)?"end":"start",m=Fr({trigger:{left:l.left,right:l.right,top:l.top,bottom:l.bottom},menu:{width:c.width,height:c.height},bounds:{left:0,top:0,right:r.innerWidth,bottom:r.innerHeight},align:u,side:"bottom"});if(m.side==="top"){i.top="auto",i.bottom="100%",i.marginTop="0px";let d=m.top+Math.min(c.height,m.maxHeight);i.marginBottom=`${Math.max(0,l.top-d)}px`}m.maxHeight<c.height&&(i.maxHeight=`${m.maxHeight}px`,i.overflowY="auto");let b=m.left-c.left;b&&(i.translate=`${b}px`)};return o(),r.addEventListener("resize",o),r.addEventListener("scroll",o,!0),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o,!0)}},[e,t])}function Br(e){return e.split(" ").map(t=>t==="left-0"?"right-0":t).join(" ")}function qr({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:a,listRef:l,ariaLabel:c,align:u="start"}){let m=$r[t],b=j(null);return Hr(b,n.length),Z("ul",{ref:d=>{b.current=d,l&&(l.current=d)},id:e,role:"listbox","aria-label":c,...m.pickerMarker?{"data-picker-menu":""}:{},className:u==="end"?Br(m.list):m.list,children:n.map((d,P)=>{let k=d.value===r;return Z("li",{id:`${e}-${P}`,role:"option","aria-selected":k,"aria-disabled":d.disabled||void 0,onMouseEnter:()=>!d.disabled&&i(P),onMouseDown:g=>{g.preventDefault(),d.disabled||a(d.value)},className:m.item(P===o,k&&d.value!=="",!!d.disabled,P===n.length-1),style:m.itemStyle?.(k),children:d.meta===void 0?d.label:bn(Gr,{children:[d.lead,Z("span",{className:"flex-1 whitespace-nowrap",children:d.label}),Z("span",{className:"ml-auto text-[12px] opacity-50",children:d.meta})]})},`${d.value}_${P}`)})})}function Wr({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:a,id:l,"aria-label":c,align:u}){let m=Or.toArray(r).flatMap(g=>{if(!Mr(g))return[];if(g.type!=="option")return[];let I=g.props,A=I.value!==void 0?String(I.value):"",_=I.children,y=typeof _=="string"||typeof _=="number"?String(_):A;return[{value:A,label:y,disabled:!!I.disabled}]}),b=e??"",d=Ur({items:m,value:b,onPick:g=>t?.({target:{value:g}})}),k=m.find(g=>g.value===b)?.label??m[0]?.label??"";return bn("div",{ref:d.wrapRef,className:"relative",children:[a&&Z("input",{type:"hidden",name:a,value:b}),Z("button",{ref:g=>{d.triggerRef.current=g},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":d.open,"aria-controls":d.open?d.listId:void 0,"aria-activedescendant":d.activeId,"aria-label":c,id:l,onClick:()=>!n&&d.toggle(),onKeyDown:g=>!n&&d.onTriggerKeyDown(g),className:`block w-full ${o??""}`,style:i,children:Z("span",{className:"block w-full truncate text-left",children:k})}),d.open&&Z(qr,{id:d.listId,tone:"select",items:m,value:b,focusIdx:d.focusIdx,onFocus:d.setFocusIdx,onPick:d.pick,listRef:d.listRef,align:u})]})}import{jsx as _e,jsxs as Be}from"react/jsx-runtime";var Kr="font-mono text-[length:var(--size-label,12px)]",zr="font-semibold uppercase tracking-[0.22em] text-fg";function Cn(e){return`${e??Kr} ${zr}`}function xn(){return _e("span",{className:"text-accent",children:" *"})}function Vr({children:e,required:t,labelFace:n}){return Be("span",{className:Cn(n),children:[e,t?_e(xn,{}):null]})}function Xr({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:a,children:l}){let c=a?`flex flex-col gap-2 ${a}`:"flex flex-col gap-2",u=n?_e("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?Be("div",{className:c,children:[Be("label",{htmlFor:o,className:Cn(i),children:[e,t?_e(xn,{}):null]}),l,u]}):Be("label",{htmlFor:o,className:c,children:[_e(Vr,{required:t,labelFace:i,children:e}),l]})}export{Ft as a,mo as b,go as c,ho as d,It as e,Ye as f,Yr as g,Qr as h,jr as i,Zr as j,Nn as k,kn as l,Jr as m,eo as n,Qe as o,Te as p,Y as q,to as r,no as s,Oe as t,Un as u,qt as v,xo as w,So as x,Wt as y,vo as z,Je as A,Eo as B,Po as C,Hn as D,wo as E,_o as F,Bn as G,Ro as H,Wn as I,No as J,ko as K,Io as L,Gt as M,Do as N,Fo as O,Uo as P,Bo as Q,qo as R,so as S,Dt as T,lo as U,Me as V,tt as W,ti as X,nn as Y,yi as Z,pr as _,Ci as $,Wi as aa,cn as ba,Gi as ca,Er as da,Xi as ea,dn as fa,Yi as ga,wr as ha,Qi as ia,Nr as ja,Si as ka,Hi as la,Bi as ma,kr as na,oa,ia as pa,Lr as qa,ua as ra,da as sa,Ur as ta,qr as ua,Wr as va,Vr as wa,Xr as xa};
|