efficient-storefront-blocks 0.68.0 → 0.74.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 (149) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +5 -5
  3. package/dist/chunks/EditorPreviewCheckout-YQ3F5MSG.js +4 -0
  4. package/dist/chunks/{SiteEditorProvider-A7YYACG3.js → SiteEditorProvider-Z33JB5BA.js} +1 -1
  5. package/dist/chunks/chunk-5OFEWRWI.js +1 -0
  6. package/dist/chunks/{chunk-FL3KMJAT.js → chunk-BZDVZUF4.js} +1 -1
  7. package/dist/chunks/{chunk-EPJ5SM3A.js → chunk-QJDTP7K6.js} +1 -1
  8. package/dist/chunks/chunk-UGXNUQRA.js +246 -0
  9. package/dist/chunks/chunk-UJW4B64R.js +1 -0
  10. package/dist/chunks/{fitment-data-RXCNCZLU.js → fitment-data-DHKRLKNI.js} +1 -1
  11. package/dist/contract.js +10 -2
  12. package/dist/editor/components/CategorySource.js +1 -1
  13. package/dist/editor/components/HeaderSettingsPanel.d.ts +4 -7
  14. package/dist/editor/components/HeaderSettingsPanel.js +1 -1
  15. package/dist/editor/components/PreviewHeader.d.ts +0 -1
  16. package/dist/editor/components/PreviewHeader.js +1 -11
  17. package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
  18. package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
  19. package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
  20. package/dist/editor/lib/document/blocks/service/ContactCards/fields.d.ts +2 -0
  21. package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -0
  22. package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
  23. package/dist/editor/lib/document/blocks/service/FooterDivider/fields.js +1 -1
  24. package/dist/editor/lib/document/blocks/service/FooterMenu/fields.js +1 -1
  25. package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.d.ts +2 -0
  26. package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.js +1 -0
  27. package/dist/editor/lib/document/blocks/service/FooterPayment/fields.d.ts +2 -0
  28. package/dist/editor/lib/document/blocks/service/FooterPayment/fields.js +1 -0
  29. package/dist/editor/lib/document/blocks/service/MessagingCards/fields.d.ts +2 -0
  30. package/dist/editor/lib/document/blocks/service/MessagingCards/fields.js +1 -0
  31. package/dist/editor/lib/document/blocks/service/OpeningHours/fields.d.ts +2 -0
  32. package/dist/editor/lib/document/blocks/service/OpeningHours/fields.js +1 -0
  33. package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
  34. package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
  35. package/dist/editor/lib/document/blocks/service/index.js +1 -1
  36. package/dist/editor/lib/document/config.d.ts +2 -0
  37. package/dist/editor/lib/document/config.js +1 -1
  38. package/dist/editor/lib/efficient-block-sources.js +1 -1
  39. package/dist/editor/lib/header-settings-source.d.ts +2 -1
  40. package/dist/editor/lib/header-settings-source.js +1 -1
  41. package/dist/editor/lib/storefront-editor-words.d.ts +25 -7
  42. package/dist/editor/lib/storefront-editor-words.js +1 -1
  43. package/dist/editor.css +1 -1
  44. package/dist/index.d.ts +3 -3
  45. package/dist/index.js +193 -318
  46. package/dist/links.d.ts +0 -2
  47. package/dist/links.js +1 -1
  48. package/dist/render/app/globals.css +41 -13
  49. package/dist/render/built-with.json +1 -1
  50. package/dist/render/components/ChatLauncher.js +1 -1
  51. package/dist/render/components/ContactCards.d.ts +13 -0
  52. package/dist/render/components/ContactCards.js +1 -0
  53. package/dist/render/components/CopyText.d.ts +4 -0
  54. package/dist/render/components/CopyText.js +1 -0
  55. package/dist/render/components/Events.d.ts +3 -0
  56. package/dist/render/components/Events.js +1 -1
  57. package/dist/render/components/FooterMessaging.d.ts +5 -0
  58. package/dist/render/components/FooterMessaging.js +1 -0
  59. package/dist/render/components/FooterPayment.d.ts +11 -0
  60. package/dist/render/components/FooterPayment.js +1 -0
  61. package/dist/render/components/GalleryItem.js +1 -1
  62. package/dist/render/components/GalleryShowcase.js +1 -1
  63. package/dist/render/components/Header.d.ts +2 -1
  64. package/dist/render/components/Header.js +1 -1
  65. package/dist/render/components/HeaderCallButton.d.ts +9 -0
  66. package/dist/render/components/HeaderCallButton.js +1 -0
  67. package/dist/render/components/MessagingCards.d.ts +9 -0
  68. package/dist/render/components/MessagingCards.js +1 -0
  69. package/dist/render/components/OpeningHours.d.ts +12 -0
  70. package/dist/render/components/OpeningHours.js +1 -0
  71. package/dist/render/components/QrCode.d.ts +5 -0
  72. package/dist/render/components/QrCode.js +1 -0
  73. package/dist/render/components/Reviews.d.ts +14 -4
  74. package/dist/render/components/Reviews.js +1 -1
  75. package/dist/render/components/checkout/CheckoutPageClient.d.ts +2 -25
  76. package/dist/render/components/checkout/CheckoutPageClient.js +1 -3
  77. package/dist/render/components/checkout/checkout-parts.d.ts +5 -0
  78. package/dist/render/components/checkout/checkout-parts.js +1 -0
  79. package/dist/render/components/checkout/checkout-state.d.ts +169 -0
  80. package/dist/render/components/checkout/checkout-state.js +3 -0
  81. package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.d.ts +6 -0
  82. package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
  83. package/dist/render/components/pdp-dynamic/RecordPhotoGallery.d.ts +3 -2
  84. package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
  85. package/dist/render/lib/api/index.d.ts +1 -0
  86. package/dist/render/lib/api/types.d.ts +3 -0
  87. package/dist/render/lib/document/blocks/commerce/GalleryB/render.js +1 -1
  88. package/dist/render/lib/document/blocks/service/ContactCards/meta.d.ts +7 -0
  89. package/dist/render/lib/document/blocks/service/ContactCards/meta.js +1 -0
  90. package/dist/render/lib/document/blocks/service/ContactCards/render.d.ts +4 -0
  91. package/dist/render/lib/document/blocks/service/ContactCards/render.js +1 -0
  92. package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
  93. package/dist/render/lib/document/blocks/service/Footer/meta.js +1 -1
  94. package/dist/render/lib/document/blocks/service/FooterGroup/meta.js +1 -1
  95. package/dist/render/lib/document/blocks/service/FooterMessaging/meta.d.ts +2 -0
  96. package/dist/render/lib/document/blocks/service/FooterMessaging/meta.js +1 -0
  97. package/dist/render/lib/document/blocks/service/FooterMessaging/render.d.ts +2 -0
  98. package/dist/render/lib/document/blocks/service/FooterMessaging/render.js +1 -0
  99. package/dist/render/lib/document/blocks/service/FooterPayment/meta.d.ts +3 -0
  100. package/dist/render/lib/document/blocks/service/FooterPayment/meta.js +1 -0
  101. package/dist/render/lib/document/blocks/service/FooterPayment/render.d.ts +2 -0
  102. package/dist/render/lib/document/blocks/service/FooterPayment/render.js +1 -0
  103. package/dist/render/lib/document/blocks/service/MessagingCards/meta.d.ts +2 -0
  104. package/dist/render/lib/document/blocks/service/MessagingCards/meta.js +1 -0
  105. package/dist/render/lib/document/blocks/service/MessagingCards/render.d.ts +4 -0
  106. package/dist/render/lib/document/blocks/service/MessagingCards/render.js +1 -0
  107. package/dist/render/lib/document/blocks/service/OpeningHours/meta.d.ts +11 -0
  108. package/dist/render/lib/document/blocks/service/OpeningHours/meta.js +1 -0
  109. package/dist/render/lib/document/blocks/service/OpeningHours/render.d.ts +4 -0
  110. package/dist/render/lib/document/blocks/service/OpeningHours/render.js +1 -0
  111. package/dist/render/lib/document/blocks/service/Reviews/meta.d.ts +6 -0
  112. package/dist/render/lib/document/blocks/service/Reviews/meta.js +1 -1
  113. package/dist/render/lib/document/blocks/service/Reviews/render.js +1 -1
  114. package/dist/render/lib/document/blocks/service/metas.d.ts +5 -0
  115. package/dist/render/lib/document/blocks/service/metas.js +1 -1
  116. package/dist/render/lib/document/blocks/service/renders.d.ts +5 -0
  117. package/dist/render/lib/document/blocks/service/renders.js +1 -1
  118. package/dist/render/lib/document/blocks/text-part-shapes.json +147 -6
  119. package/dist/render/lib/document/card-templates.d.ts +2 -0
  120. package/dist/render/lib/document/card-templates.js +1 -0
  121. package/dist/render/lib/document/footer-page-blocks.d.ts +1 -0
  122. package/dist/render/lib/document/footer-page-blocks.js +1 -1
  123. package/dist/render/lib/document/lazy-draws.js +1 -1
  124. package/dist/render/lib/document/render-config.d.ts +2 -0
  125. package/dist/render/lib/document/render-config.js +1 -1
  126. package/dist/render/lib/document/section-to-box-rows-reviews.d.ts +1 -0
  127. package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -0
  128. package/dist/render/lib/links/link-rules.d.ts +1 -1
  129. package/dist/render/lib/links/link-rules.js +1 -1
  130. package/dist/render/lib/qr.d.ts +5 -0
  131. package/dist/render/lib/qr.js +1 -0
  132. package/dist/render/lib/sections/messaging.d.ts +45 -0
  133. package/dist/render/lib/sections/messaging.js +1 -0
  134. package/dist/render/lib/sections/opening-hours.d.ts +53 -0
  135. package/dist/render/lib/sections/opening-hours.js +1 -0
  136. package/dist/render/lib/sections/reviews.d.ts +1 -0
  137. package/dist/render/lib/sections/reviews.js +1 -0
  138. package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
  139. package/dist/render/lib/wheels/collections.js +1 -1
  140. package/dist/words.d.ts +51 -12
  141. package/dist/words.js +4 -4
  142. package/package.json +4 -4
  143. package/dist/chunks/EditorPreviewCheckout-HFP2TRRR.js +0 -4
  144. package/dist/chunks/chunk-CFYEYTU6.js +0 -254
  145. package/dist/chunks/chunk-YACB7UXA.js +0 -1
  146. package/dist/chunks/chunk-YTQS5GY6.js +0 -1
  147. package/dist/render/components/useStorefrontReviews.d.ts +0 -2
  148. package/dist/render/components/useStorefrontReviews.js +0 -1
  149. /package/dist/chunks/{chunk-CFYEYTU6.js.LEGAL.txt → chunk-UGXNUQRA.js.LEGAL.txt} +0 -0
@@ -1 +1 @@
1
- "use client";import{jsx as o,Fragment as I,jsxs as s}from"react/jsx-runtime";import te from"next/link";import{usePathname as Ke}from"next/navigation";import{useCallback as Ve,useEffect as O,useState as p}from"react";import{useCart as qe}from"./CartContext.js";import{useSearch as Ye}from"./SearchContext.js";import Je,{useCountrySelectShows as Xe}from"./CountrySelect.js";import{resolveCountryShowAs as Qe}from"../lib/content/country-show-as.js";import ne from"./HeaderNavItem.js";import Ze from"efficient-web-builder/render/components/Logo";import et from"./MenuPlaceholderLabel.js";import{withRMark as re}from"efficient-web-builder/render/components/RMark";import{AccountButton as tt,CartButton as nt,SearchButton as rt}from"./HeaderTools.js";import{useHeaderBar as ot}from"./useHeaderBar.js";import{useModalDismiss as st}from"./useModalDismiss.js";import at from"./ThemeToggle.js";import{products as lt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as it}from"../lib/header-settings-fetch.js";import{HEADER_MENU_PLACEHOLDER_COUNT as ct}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as dt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as mt,resolveChromeWidth as ut}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as ht}from"../lib/content/header-theme.js";import{headerSolidBackground as ft,isProductPage as pt}from"../lib/content/header-bar.js";import{surfaceIsLight as gt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as bt,HEADER_SET_HEIGHT_CSS as xt}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_ATTR as vt,HEADER_INK_OVERRIDE_ATTR as yt,resolveHeaderInkMode as wt}from"efficient-web-builder/render/lib/document/header-ink";const oe={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},St=Array.from({length:ct},()=>({href:"#",label:o(et,{})}));function kt({previewSettings:g,initialSettings:$,editorPreview:T,showThemeToggle:se,wordmark:ae,hideLogo:le,hideMenu:ie,siteName:L,commerceEnabled:b=!0}={}){const M=Ke(),[ce,de]=p(!1);O(()=>{const e=v.current?.ownerDocument??document,t=()=>de(e.querySelector(`[${vt}="light"]`)!=null);t();const f=requestAnimationFrame(t);return()=>cancelAnimationFrame(f)},[M]);const z=pt(M),[c,w]=p(!1),{open:me,totals:ue}=qe(),{open:he}=Ye(),[C,fe]=p(!1),[pe,ge]=p(null),[be,xe]=p(null),[n,ve]=p($??null),r=g??(n?{logoUrl:n.logoUrl,reverseLogo:n.reverseLogo,logoReversed:n.logoReversed,logoInkIsDark:n.logoInkIsDark,logoPosition:n.logoPosition,logoSize:n.logoSize,logoSizePx:n.logoSizePx,menuItems:(n.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[]})),menuSplit:n.menuSplit??3,menuPosition:n.menuPosition,menuRow:n.menuRow,menuGapPx:n.menuGapPx??null,searchEnabled:n.searchEnabled,searchPosition:n.searchPosition,searchRow:n.searchRow,countrySelectorEnabled:n.countrySelectorEnabled,countrySelectorShowAs:n.countrySelectorShowAs,countryUrls:n.countryUrls,accountEnabled:n.accountEnabled,cartEnabled:n.cartEnabled,utilStyle:n.utilStyle,navTextCase:n.navTextCase,lightReverseText:n.lightReverseText,topTextColor:n.topTextColor,transparentTop:n.transparentTop,surface:n.surface,theme:n.theme,width:n.width,heightPx:n.heightPx,sticky:n.sticky}:null),ye=le?null:r?.logoUrl??null,we=r?.reverseLogo??!1,Se=r?.logoReversed??null,ke=r?.logoInkIsDark??null,i=r?.logoPosition??"center",Ne=r?.logoSize??"medium",Pe=r?.logoSizePx??null,B=Math.min(Math.max(r?.menuSplit??3,1),4),Ee=(r?.menuPosition??"left")==="center",Ie=(r?.menuPosition??"left")==="beside",U=(r?.menuRow??"top")==="inline",F=r?.menuGapPx??null,$e=F!=null?{gap:`${F}px`}:void 0,S=U?oe.inline:oe.stacked,Te=r?.searchEnabled??!1,G=r?.searchPosition??"right",Le=r?.countrySelectorEnabled??!0,Ce=Qe(r?.countrySelectorShowAs),_=r?.accountEnabled??!0,_e=r?.cartEnabled??!0,A=(r?.utilStyle??"icon")==="text",a=`mono-eyebrow${(r?.navTextCase??"uppercase")==="capitalised"?" mono-eyebrow-plain":""}`,W=r?.countryUrls??{},Ae=ut(r?.width),De=mt(Ae)??void 0,Re=r?.heightPx??bt.default,K=r?.sticky??"always",k=wt(r?.topTextColor),m=ht(r?.theme),N=Object.keys(W),V=Xe(N.length?N:void 0),x=Le?o(Je,{countries:N.length?N:void 0,urls:g?void 0:W,showAs:Ce}):null,{headerRef:v,scrolled:q,navHidden:He}=ot({stickyMode:K,heightPx:Re}),je=m?JSON.stringify(m.style):null;O(()=>{const e=v.current?.ownerDocument??document,t=e.defaultView??window,f=ee=>ee?gt(t.getComputedStyle(ee).getPropertyValue("--bg")):null,Z=()=>{fe(e.documentElement.getAttribute("data-theme")==="light"),ge(f(e.body)),xe(f(v.current))};Z();const j=new MutationObserver(Z);return j.observe(e.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e.body&&j.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>j.disconnect()},[v,je]);const y=se??dt?o(at,{}):null;O(()=>{if(!it({editorPreview:!!T,hasPreviewSettings:!!g,hasInitialSettings:!!$}))return;let e=!1;return lt.getHeaderSettings().then(t=>!e&&ve(t)).catch(t=>{console.warn("[header] settings fetch failed; using built-in defaults",t)}),()=>{e=!0}},[T,g,$]);const P=q||z,Y=ft(C,z),J=k==="auto"?ce:k==="light",Oe=P||!J,Me=P?be??C:(pe??C)&&!J,ze=k==="auto"?null:{[yt]:k},Be=Ve(()=>w(!1),[]);st({active:c,onDismiss:Be});const d=(e,t,f="start")=>o(ne,{item:e,dropdownAlign:f},t),Ue=!ie&&(r?.menuItems?.length??0)>0,X=!!T||!!g,l=Ue?r.menuItems.map(e=>({href:e.url||"",label:re(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(t=>({href:t.url||"",label:re(t.label),plainLabel:t.label}))})):X?St.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Fe=l.length>0||b&&_||!!x&&V||!!y,Ge=i==="center"?l.slice(0,B):i==="right"?l:[],We=i==="center"?l.slice(B):i==="left"?l:[],E=Te&&b?o(rt,{onClick:X?void 0:he,asText:A}):null,D=b&&_?o(tt,{asText:A}):null,R=e=>b&&_e?o(nt,{onClick:me,count:ue.sets,asText:A,className:e}):null,u=s(I,{children:[G==="left"?E:null,x,y,D,R(),G==="right"?E:null]}),H=(e,t=!1)=>o(te,{href:"/","aria-label":L?`${L} home`:"Home",className:e,children:o(Ze,{variant:"header",scrolled:Oe,src:ye,reverse:we,onLightSurface:Me,reversedSrc:Se,inkIsDark:ke,size:Ne,sizePx:Pe,wordmark:ae,siteName:L,fitToContainer:t})}),h=H("inline-flex shrink-0 items-center justify-center"),Q="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(I,{children:[o("header",{ref:v,"data-scrolled":q||void 0,...ze,className:["sf-site-header",...m?[m.className]:[],K==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",P?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:xt,...He?{transform:"translateY(-100%)"}:null,...P?{background:Y,color:"var(--fg)","--sf-header-ground":Y}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:De,children:[Ee?s("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?o("nav",{className:`${a} flex items-center gap-8`,children:u}):o("div",{className:"flex items-center",children:h}),o("nav",{className:`${a} flex items-center justify-center gap-8`,children:l.map((e,t)=>d(e,`${e.href}-${t}`,"center"))}),i==="right"?o("div",{className:"flex items-center justify-end",children:h}):o("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):i==="center"?s("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[o("nav",{className:`${a} flex items-center gap-8`,children:Ge.map((e,t)=>d(e,`${e.href}-${t}`))}),h,s("nav",{className:`${a} flex items-center justify-end gap-8`,children:[We.map((e,t)=>d(e,`${e.href}-${t}`,"end")),u]})]}):Ie?s("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:$e,children:[h,o("nav",{className:`${a} flex items-center gap-8`,children:l.map((e,t)=>d(e,`${e.href}-${t}`))})]}),o("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):o("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:i==="right"?s(I,{children:[s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,t)=>d(e,`${e.href}-${t}`)),u]}),h]}):s(I,{children:[h,s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,t)=>d(e,`${e.href}-${t}`)),u]})]})}),!U&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[H(Q,!0),s("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[E,x,y,D,R()]})]}),o("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:l.map((e,t)=>d(e,`${e.href}-${t}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[H(Q,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[E,D,R(a),Fe&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>w(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[l.map((e,t)=>o(ne,{item:e,mobile:!0,onNavigate:()=>w(!1)},`${e.href}-${t}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[b&&_&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),o(te,{href:"/account",onClick:()=>w(!1),className:"mono-eyebrow underline",children:"Your account"})]}),x&&V&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),x]}),y&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),y]})]})]})]})}export{kt as default};
1
+ "use client";import{jsx as r,Fragment as $,jsxs as a}from"react/jsx-runtime";import oe from"next/link";import{usePathname as Ye}from"next/navigation";import{useCallback as Je,useEffect as M,useState as p}from"react";import{useCart as Xe}from"./CartContext.js";import{useSearch as Qe}from"./SearchContext.js";import Ze,{useCountrySelectShows as et}from"./CountrySelect.js";import{resolveCountryShowAs as tt}from"../lib/content/country-show-as.js";import re from"./HeaderNavItem.js";import nt from"efficient-web-builder/render/components/Logo";import ot from"./MenuPlaceholderLabel.js";import{withRMark as ae}from"efficient-web-builder/render/components/RMark";import{AccountButton as rt,CartButton as at,SearchButton as lt}from"./HeaderTools.js";import st from"./HeaderCallButton.js";import{useHeaderBar as ct}from"./useHeaderBar.js";import{useModalDismiss as it}from"./useModalDismiss.js";import dt from"./ThemeToggle.js";import{products as mt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as ut}from"../lib/header-settings-fetch.js";import{HEADER_MENU_PLACEHOLDER_COUNT as ht}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as ft}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as pt,resolveChromeWidth as gt}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as bt}from"../lib/content/header-theme.js";import{headerSolidBackground as xt,isProductPage as vt}from"../lib/content/header-bar.js";import{surfaceIsLight as yt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as wt,HEADER_SET_HEIGHT_CSS as St}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_ATTR as kt,HEADER_INK_OVERRIDE_ATTR as Nt,resolveHeaderInkMode as Pt}from"efficient-web-builder/render/lib/document/header-ink";const le={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},Et=Array.from({length:ht},()=>({href:"#",label:r(ot,{})}));function It({previewSettings:g,initialSettings:T,editorPreview:L,showThemeToggle:se,wordmark:ce,hideLogo:ie,hideMenu:de,siteName:C,commerceEnabled:b=!0}={}){const z=Ye(),[me,ue]=p(!1);M(()=>{const e=v.current?.ownerDocument??document,n=()=>ue(e.querySelector(`[${kt}="light"]`)!=null);n();const f=requestAnimationFrame(n);return()=>cancelAnimationFrame(f)},[z]);const U=vt(z),[i,w]=p(!1),{open:he,totals:fe}=Xe(),{open:pe}=Qe(),[_,ge]=p(!1),[be,xe]=p(null),[ve,ye]=p(null),[t,we]=p(T??null),o=g??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[]})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),Se=ie?null:o?.logoUrl??null,ke=o?.reverseLogo??!1,Ne=o?.logoReversed??null,Pe=o?.logoInkIsDark??null,c=o?.logoPosition??"center",Ee=o?.logoSize??"medium",Ie=o?.logoSizePx??null,F=Math.min(Math.max(o?.menuSplit??3,1),4),$e=(o?.menuPosition??"left")==="center",Te=(o?.menuPosition??"left")==="beside",G=(o?.menuRow??"top")==="inline",W=o?.menuGapPx??null,Le=W!=null?{gap:`${W}px`}:void 0,S=G?le.inline:le.stacked,Ce=o?.searchEnabled??!1,K=o?.searchPosition??"right",_e=o?.countrySelectorEnabled??!0,He=tt(o?.countrySelectorShowAs),H=o?.accountEnabled??!0,Ae=o?.cartEnabled??!0,A=(o?.utilStyle??"icon")==="text",l=`mono-eyebrow${(o?.navTextCase??"uppercase")==="capitalised"?" mono-eyebrow-plain":""}`,V=o?.countryUrls??{},De=gt(o?.width),Re=pt(De)??void 0,je=o?.heightPx??wt.default,q=o?.sticky??"always",k=Pt(o?.topTextColor),m=bt(o?.theme),N=Object.keys(V),Y=et(N.length?N:void 0),x=_e?r(Ze,{countries:N.length?N:void 0,urls:g?void 0:V,showAs:He}):null,{headerRef:v,scrolled:J,navHidden:Oe}=ct({stickyMode:q,heightPx:je}),Be=m?JSON.stringify(m.style):null;M(()=>{const e=v.current?.ownerDocument??document,n=e.defaultView??window,f=ne=>ne?yt(n.getComputedStyle(ne).getPropertyValue("--bg")):null,te=()=>{ge(e.documentElement.getAttribute("data-theme")==="light"),xe(f(e.body)),ye(f(v.current))};te();const B=new MutationObserver(te);return B.observe(e.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e.body&&B.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>B.disconnect()},[v,Be]);const y=se??ft?r(dt,{}):null;M(()=>{if(!ut({editorPreview:!!L,hasPreviewSettings:!!g,hasInitialSettings:!!T}))return;let e=!1;return mt.getHeaderSettings().then(n=>!e&&we(n)).catch(n=>{console.warn("[header] settings fetch failed; using built-in defaults",n)}),()=>{e=!0}},[L,g,T]);const P=J||U,X=xt(_,U),Q=k==="auto"?me:k==="light",Me=P||!Q,ze=P?ve??_:(be??_)&&!Q,Ue=k==="auto"?null:{[Nt]:k},Fe=Je(()=>w(!1),[]);it({active:i,onDismiss:Fe});const d=(e,n,f="start")=>r(re,{item:e,dropdownAlign:f},n),Ge=!de&&(o?.menuItems?.length??0)>0,E=!!L||!!g,s=Ge?o.menuItems.map(e=>({href:e.url||"",label:ae(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(n=>({href:n.url||"",label:ae(n.label),plainLabel:n.label}))})):E?Et.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],We=s.length>0||b&&H||!!x&&Y||!!y,Ke=c==="center"?s.slice(0,F):c==="right"?s:[],Ve=c==="center"?s.slice(F):c==="left"?s:[],I=Ce&&b?r(lt,{onClick:E?void 0:pe,asText:A}):null,D=b&&H?r(rt,{asText:A}):null,R=e=>b&&Ae?r(at,{onClick:he,count:fe.sets,asText:A,className:e}):null,qe=o?.callPhone??"",Z=o?.callHref??"",j=e=>o?.callButton&&(Z||E)?r(st,{href:E?"":Z,label:e?"Call":qe||"Call"}):null,u=a($,{children:[K==="left"?I:null,x,y,D,R(),K==="right"?I:null,j(!1)]}),O=(e,n=!1)=>r(oe,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(nt,{variant:"header",scrolled:Me,src:Se,reverse:ke,onLightSurface:ze,reversedSrc:Ne,inkIsDark:Pe,size:Ee,sizePx:Ie,wordmark:ce,siteName:C,fitToContainer:n})}),h=O("inline-flex shrink-0 items-center justify-center"),ee="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return a($,{children:[r("header",{ref:v,"data-scrolled":J||void 0,...Ue,className:["sf-site-header",...m?[m.className]:[],q==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",P?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:St,...Oe?{transform:"translateY(-100%)"}:null,...P?{background:X,color:"var(--fg)","--sf-header-ground":X}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:a("div",{className:"w-full",style:Re,children:[$e?a("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[c==="right"?r("nav",{className:`${l} flex items-center gap-8`,children:u}):r("div",{className:"flex items-center",children:h}),r("nav",{className:`${l} flex items-center justify-center gap-8`,children:s.map((e,n)=>d(e,`${e.href}-${n}`,"center"))}),c==="right"?r("div",{className:"flex items-center justify-end",children:h}):r("nav",{className:`${l} flex items-center justify-end gap-8`,children:u})]}):c==="center"?a("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${l} flex items-center gap-8`,children:Ke.map((e,n)=>d(e,`${e.href}-${n}`))}),h,a("nav",{className:`${l} flex items-center justify-end gap-8`,children:[Ve.map((e,n)=>d(e,`${e.href}-${n}`,"end")),u]})]}):Te?a("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:[a("div",{className:"flex items-center gap-8",style:Le,children:[h,r("nav",{className:`${l} flex items-center gap-8`,children:s.map((e,n)=>d(e,`${e.href}-${n}`))})]}),r("nav",{className:`${l} flex items-center justify-end gap-8`,children:u})]}):r("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:c==="right"?a($,{children:[a("nav",{className:`${l} flex items-center gap-8`,children:[s.map((e,n)=>d(e,`${e.href}-${n}`)),u]}),h]}):a($,{children:[h,a("nav",{className:`${l} flex items-center gap-8`,children:[s.map((e,n)=>d(e,`${e.href}-${n}`)),u]})]})}),!G&&a("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[a("div",{className:"flex items-center justify-between",children:[O(ee,!0),a("div",{className:`${l} flex shrink-0 items-center gap-5`,children:[I,x,y,D,R(),j(!1)]})]}),r("nav",{className:`${l} flex items-center gap-6 border-t border-line/60 pt-3`,children:s.map((e,n)=>d(e,`${e.href}-${n}`))})]}),a("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[O(ee,!0),a("div",{className:"flex shrink-0 items-center gap-4",children:[I,D,R(l),j(!0),We&&a("button",{type:"button","aria-label":i?"Close menu":"Open menu","aria-expanded":i,onClick:()=>w(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${i?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${i?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${i?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),i&&a("div",{"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[s.map((e,n)=>r(re,{item:e,mobile:!0,onNavigate:()=>w(!1)},`${e.href}-${n}`)),a("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[b&&H&&a("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(oe,{href:"/account",onClick:()=>w(!1),className:"mono-eyebrow underline",children:"Your account"})]}),x&&Y&&a("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),x]}),y&&a("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),y]})]})]})]})}export{It as default};
@@ -0,0 +1,9 @@
1
+ export interface HeaderCall {
2
+ callButton?: boolean;
3
+ callPhone?: string;
4
+ callHref?: string;
5
+ }
6
+ export default function HeaderCallButton({ href, label }: {
7
+ href: string;
8
+ label: string;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as n}from"react/jsx-runtime";const r="sf-button inline-flex shrink-0 items-center whitespace-nowrap border border-btn bg-btn px-3 py-2 font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.12em] text-btn-ink transition-colors hover:border-btn-2 hover:bg-btn-2";function a({href:e,label:t}){return e?n("a",{href:e,className:r,"data-header-call":"",children:t}):n("span",{className:r,"data-header-call":"",children:t})}export{a as default};
@@ -0,0 +1,9 @@
1
+ import { type MessagingChannel } from "../lib/sections/messaging.js";
2
+ interface MessagingCardsProps {
3
+ title?: string;
4
+ description?: string;
5
+ channels: readonly MessagingChannel[];
6
+ contained: boolean;
7
+ }
8
+ export default function MessagingCards({ title, description, channels, contained }: MessagingCardsProps): import("react").JSX.Element | null;
9
+ export {};
@@ -0,0 +1 @@
1
+ import{jsx as a,jsxs as r}from"react/jsx-runtime";import x from"efficient-web-builder/render/components/BlockFrame";import{renderGold as o,renderHeadline as n,splitParagraphs as c}from"efficient-web-builder/render/components/goldPhrases";import g from"./CopyText.js";import f from"./QrCode.js";import{MESSAGING_ACTION as i,MESSAGING_WORDS as s}from"../lib/sections/messaging.js";function h({title:d,description:l,channels:m,contained:t}){return m.length?a(x,{contained:t,className:"py-6",children:r("div",{className:"flex flex-col gap-6",children:[(d||l)&&r("div",{className:"flex max-w-[680px] flex-col gap-3",children:[d&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:n(d,!1)}),l&&c(l).map((e,p)=>a("p",{className:"text-[15px] leading-[1.6] opacity-85",children:o(e)},p))]}),a("ul",{className:"grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4","data-messaging-cards":"",children:m.map(e=>r("li",{className:"flex min-w-0 flex-col items-center gap-3 rounded-[var(--radius-card,12px)] border border-line p-3 text-center md:p-5",children:[a("p",{className:"font-heading2 text-[18px] font-medium leading-tight",children:e.name}),e.qr?a(f,{text:e.qr,label:s.qrLabel(e.name,e.handle),className:"aspect-square w-full max-w-40 rounded-sm"}):a("p",{className:"grid aspect-square w-full max-w-40 place-items-center rounded-sm border border-dashed border-line p-3 text-[13px] text-fg-dim",children:s.searchFor(e.name)}),r("div",{className:"mt-auto flex flex-col items-center gap-1.5",children:[e.handle&&a("p",{className:"break-all text-[14px] text-fg-dim",children:e.handle}),e.href?r("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:i,children:[s.open(e.name),r("span",{className:"sr-only",children:[" ",s.opensApp]})]}):e.handle?a(g,{text:e.handle,className:i}):a("p",{className:"text-[14px] text-fg-dim",children:s.scanWith(e.name)})]})]},e.app))})]})}):null}export{h as default};
@@ -0,0 +1,12 @@
1
+ import { type OpeningMoment, type OpeningRow } from "../lib/sections/opening-hours.js";
2
+ export type OpeningHoursShow = "badge" | "week";
3
+ export declare const OPENING_TICK_MS = 30000;
4
+ interface OpeningHoursProps {
5
+ show: OpeningHoursShow;
6
+ title?: string;
7
+ row: OpeningRow | null;
8
+ contained: boolean;
9
+ now?: OpeningMoment;
10
+ }
11
+ export default function OpeningHours({ show, title, row, contained, now }: OpeningHoursProps): import("react").JSX.Element | null;
12
+ export {};
@@ -0,0 +1 @@
1
+ "use client";import{jsx as n,jsxs as s}from"react/jsx-runtime";import{useEffect as x,useState as h}from"react";import f from"efficient-web-builder/render/components/BlockFrame";import{renderHeadline as g}from"efficient-web-builder/render/components/goldPhrases";import{OPENING_WORDS as c,badgeLabel as b,momentIn as k,openingStatus as N,weekLines as y}from"../lib/sections/opening-hours.js";const v=3e4;function I({show:t,title:r,row:a,contained:o,now:i}){const[d,u]=h(i??null),m=a?.zone??"",p=!!a?.week;if(x(()=>{if(i){u(i);return}if(!p)return;const e=()=>u(k(m,Date.now()));e();const l=setInterval(e,v);return()=>clearInterval(l)},[i,m,p]),!a)return null;if(t==="badge"){if(!a.week)return null;const e=d?N(a.week,d):null;return n(f,{contained:o,className:"py-6",children:n(_,{label:e?b(e):null,open:e?.open??!1})})}return!a.week&&!a.hours.length?null:n(f,{contained:o,className:"py-6",children:s("div",{className:"flex max-w-[560px] flex-col gap-4",children:[r&&n("h2",{className:"font-heading3 text-[length:min(var(--size-headingSmall,28px),var(--sf-heading-max,9999px))] font-medium leading-[1.1] tracking-[-0.02em]",children:g(r,!1)}),a.week?n("ul",{className:"flex flex-col text-[15px]",children:y(a.week).map(e=>{const l=d!==null&&d.day===e.day;return s("li",{"aria-current":l?"date":void 0,className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 rounded-sm border-b border-line px-3 py-2.5 last:border-b-0",style:l?{background:"color-mix(in oklab, var(--accent) 12%, transparent)"}:void 0,children:[s("span",{className:l?"font-medium":void 0,children:[e.name,l&&n("span",{className:"opacity-70",children:` · ${c.today}`})]}),n("span",{className:e.closed?"tabular-nums opacity-60":"tabular-nums",children:e.closed?c.closed:e.periods})]},e.day)})}):n("div",{className:"flex flex-col gap-1 text-[15px] leading-[1.6]",children:a.hours.map((e,l)=>n("p",{children:e},l))})]})})}function _({label:t,open:r}){return t===null?s("span",{"aria-hidden":!0,className:"invisible inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-[14px]",children:[n("span",{className:"h-2 w-2 rounded-full"}),c.openNow]}):s("span",{className:"inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-[14px] tabular-nums",style:{background:r?"color-mix(in oklab, var(--green) 16%, transparent)":"color-mix(in oklab, var(--fg) 8%, transparent)"},children:[n("span",{"aria-hidden":!0,className:r?"h-2 w-2 shrink-0 rounded-full bg-green":"h-2 w-2 shrink-0 rounded-full bg-current opacity-50"}),t]})}export{v as OPENING_TICK_MS,I as default};
@@ -0,0 +1,5 @@
1
+ export default function QrCode({ text, label, className }: {
2
+ text: string;
3
+ label: string;
4
+ className?: string;
5
+ }): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ import{jsx as i,jsxs as o}from"react/jsx-runtime";import{QR_QUIET as e,qrPath as d}from"../lib/qr.js";function f({text:t,label:a,className:l}){const s=d(t);if(!s)return null;const r=s.size+e*2;return o("svg",{role:"img","aria-label":a,viewBox:`${-e} ${-e} ${r} ${r}`,shapeRendering:"crispEdges",className:l,"data-qr":"",children:[i("rect",{x:-e,y:-e,width:r,height:r,fill:"#fff"}),i("path",{d:s.path,fill:"#000"})]})}export{f as default};
@@ -1,12 +1,22 @@
1
+ import type { ReactNode } from "react";
1
2
  import type { SectionEyebrowLook } from "efficient-web-builder/format/lib/sections/section-eyebrow-look";
3
+ export interface ReviewCard {
4
+ key: string;
5
+ quote: string;
6
+ title?: string;
7
+ name: string;
8
+ meta?: string;
9
+ rating?: number;
10
+ }
2
11
  export interface ReviewsProps {
3
12
  eyebrow?: string;
4
13
  look?: SectionEyebrowLook;
5
14
  title?: string;
6
15
  columns?: 1 | 2 | 3;
7
- limit?: number;
8
- designCode?: string;
9
- omitHead?: boolean;
16
+ rows?: readonly ReviewCard[];
10
17
  editing?: boolean;
18
+ sample?: boolean;
19
+ cards?: ReactNode;
20
+ omitHead?: boolean;
11
21
  }
12
- export default function Reviews({ look, eyebrow, title, columns, limit, designCode, omitHead, editing, }?: ReviewsProps): import("react").JSX.Element | null;
22
+ export default function Reviews({ look, eyebrow, title, columns, rows, editing, sample, cards, omitHead, }: ReviewsProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as b,jsxs as n}from"react/jsx-runtime";import w from"efficient-web-builder/render/components/SectionEyebrow";import{renderHeadline as y,splitParagraphs as N}from"efficient-web-builder/render/components/goldPhrases";import S from"./RatingStars.js";import{useStorefrontReviews as M}from"./useStorefrontReviews.js";import{say as t}from"efficient-web-builder/format/lib/editor-words";const i={headingMediumUpTo800:"max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,19px)]",label:"text-[length:var(--size-label,12px)]"},A=()=>[{id:"sample-review-1",authorName:t("Sample reviewer"),rating:5,title:t("Sample review title"),body:t("Approved customer reviews appear here automatically — this card is only a preview of the section's shape."),designCode:"",createdAt:""},{id:"sample-review-2",authorName:t("Sample reviewer"),rating:4,title:"",body:t("Reviews are collected by the Review Form section and wait for your approval before they show."),designCode:"",createdAt:""},{id:"sample-review-3",authorName:t("Sample reviewer"),rating:5,title:t("Another sample"),body:t("Set a product design code on this section to show one product's reviews; leave it blank for the whole store."),designCode:"",createdAt:""}];function R(o){const r=new Date(o);return Number.isNaN(r.getTime())?"":r.toLocaleDateString("en-US",{month:"long",year:"numeric"})}const k="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",_="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function z({look:o,eyebrow:r,title:l,columns:x,limit:h,designCode:f,omitHead:m=!1,editing:p=!1}={}){const s=M(h??6,f),u=Math.min(3,Math.max(1,x??3)),d=!(s&&s.length>0)&&p,c=s&&s.length>0?s:d?A():[];return!p&&c.length===0?null:e("section",{className:"relative z-[2] border-t border-line bg-surface",children:n("div",{className:m?_:k,children:[m?null:n(b,{children:[(r??"").trim()&&e(w,{text:r??"",look:o,className:"mb-4 block"}),(l??"").trim()&&e("h2",{className:`mb-12 font-heading2 ${i.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg max-[800px]:mb-8 ${i.headingMediumUpTo800}`,children:y(l??"",!1)})]}),e("div",{className:"sf-card grid grid-cols-1 gap-px border border-line bg-line min-[700px]:[grid-template-columns:repeat(var(--rv-cols),minmax(0,1fr))]",style:{"--rv-cols":String(u)},children:c.map(a=>n("article",{className:["flex flex-col gap-4 bg-bg p-10 max-[800px]:p-8",d?"opacity-60":""].join(" "),children:[e(S,{rating:a.rating}),a.title.trim()&&e("h3",{className:`font-display ${i.bodyLarge} font-medium uppercase leading-[1.2] tracking-[-0.01em] text-fg`,children:a.title}),e("div",{className:`flex-1 font-serif ${i.bodySmall} leading-[1.65] text-fg-dim`,children:N(a.body).map((v,g)=>e("p",{className:g?"mt-3":"",children:v},g))}),n("footer",{className:"flex items-baseline justify-between gap-4 border-t border-line pt-5",children:[e("span",{className:`font-mono ${i.label} uppercase tracking-[0.22em] text-fg`,children:a.authorName}),e("span",{className:`font-mono ${i.label} uppercase tracking-[0.18em] text-fg-dim`,children:R(a.createdAt)})]})]},a.id))})]})})}export{z as default};
1
+ import{jsx as e,Fragment as h,jsxs as i}from"react/jsx-runtime";import u from"efficient-web-builder/render/components/SectionEyebrow";import{renderHeadline as b,splitParagraphs as v}from"efficient-web-builder/render/components/goldPhrases";import N from"./RatingStars.js";const t={headingMediumUpTo800:"max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,19px)]",label:"text-[length:var(--size-label,12px)]"},y="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function k({look:p,eyebrow:n,title:r,columns:x,rows:s=[],editing:d=!1,sample:o=!1,cards:g,omitHead:l=!1}){const c=Math.min(3,Math.max(1,x??3));return!d&&s.length===0?null:e("section",{className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:l?M:y,children:[l?null:i(h,{children:[(n??"").trim()&&e(u,{text:n??"",look:p,className:"mb-4 block"}),(r??"").trim()&&e("h2",{className:`mb-12 font-heading2 ${t.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg max-[800px]:mb-8 ${t.headingMediumUpTo800}`,children:b(r??"",!1)})]}),e("div",{className:"sf-card grid grid-cols-1 gap-px border border-line bg-line min-[700px]:[grid-template-columns:repeat(var(--rv-cols),minmax(0,1fr))]",style:{"--rv-cols":String(c)},children:g??s.map(a=>i("article",{className:["flex flex-col gap-4 bg-bg p-10 max-[800px]:p-8",o?"opacity-60":""].join(" "),children:[a.rating!==void 0&&e(N,{rating:a.rating}),(a.title??"").trim()&&e("h3",{className:`font-display ${t.bodyLarge} font-medium uppercase leading-[1.2] tracking-[-0.01em] text-fg`,children:a.title}),e("div",{className:`flex-1 font-serif ${t.bodySmall} leading-[1.65] text-fg-dim`,children:v(a.quote).map((f,m)=>e("p",{className:m?"mt-3":"",children:f},m))}),i("footer",{className:"flex items-baseline justify-between gap-4 border-t border-line pt-5",children:[e("span",{className:`font-mono ${t.label} uppercase tracking-[0.22em] text-fg`,children:a.name}),e("span",{className:`font-mono ${t.label} uppercase tracking-[0.18em] text-fg-dim`,children:a.meta??""})]})]},a.key))})]})})}export{k as default};
@@ -1,25 +1,2 @@
1
- import { type SiteIdentity } from "../../lib/content/site.js";
2
- type PayKey = "card" | "paypal" | "afterpay" | "square" | "gocardless" | "zip" | "klarna" | "bank";
3
- interface PayOption {
4
- key: PayKey;
5
- title: React.ReactNode;
6
- body: React.ReactNode;
7
- price: React.ReactNode;
8
- tag?: string;
9
- }
10
- export declare function buildPayOptions(site: SiteIdentity, { canParkContext, }?: {
11
- canParkContext: boolean;
12
- }): PayOption[];
13
- export default function CheckoutPageClient({ site, logo, preview, }: {
14
- site: SiteIdentity;
15
- logo?: {
16
- url: string | null;
17
- reversed: string | null;
18
- inkIsDark: boolean | null;
19
- reverse: boolean;
20
- size: "small" | "medium" | "large";
21
- sizePx: number | null;
22
- } | null;
23
- preview?: boolean;
24
- }): import("react").JSX.Element;
25
- export {};
1
+ import { type CheckoutProps } from "./checkout-state.js";
2
+ export default function CheckoutPageClient(props: CheckoutProps): import("react").JSX.Element;
@@ -1,3 +1 @@
1
- "use client";import{jsx as e,Fragment as E,jsxs as r}from"react/jsx-runtime";import Kt from"next/image";import M from"next/link";import{useEffect as S,useMemo as pe,useRef as U,useState as s}from"react";import{Elements as Tt,PaymentElement as Ot,useElements as qt,useStripe as Bt}from"@stripe/react-stripe-js";import{loadStripe as Lt}from"@stripe/stripe-js";import{isOrderable as ot,lineTotal as $t,useCart as it}from"../CartContext.js";import{useCurrency as W}from"../CurrencyContext.js";import{FREE_PRICE as _e}from"../../lib/wheels/price-display.js";import{resolveCopyright as Yt}from"../../lib/content/site.js";import{getClickIds as zt}from"../../lib/click-ids.js";import{adConsentForOrder as Ft}from"../../lib/consent/choice.js";import{trackBeginCheckout as Mt,trackPurchase as Ut}from"../../lib/google-tag.js";import{trackMetaPurchase as Dt}from"../../lib/meta-pixel.js";import{ApiError as je,api as ne,products as A}from"../../lib/api/index.js";import{uuid as Ht}from"../../lib/uuid.js";import{orderLinesForSets as Gt}from"../../lib/commerce.js";import{canPersist as Wt,safeSessionStorage as B}from"efficient-web-builder/format/lib/safe-storage";import{AFTERPAY_CONTEXT_KEY as Zt,AFTERPAY_RETURN as Xt,GOCARDLESS_CONTEXT_KEY as Re,KLARNA_CONTEXT_KEY as Ke,ZIP_CONTEXT_KEY as Jt,ZIP_RETURN as Qt,runWalletReturn as ct}from"../../lib/checkout/wallet-return.js";import{matchSubdivision as Vt}from"../../lib/checkout/match-subdivision.js";import en from"../CouponField.js";import{COUPON_DEFERRED_TOTAL as tn,couponCodeForOrder as nn,couponRefusedByOrder as rn}from"../../lib/cart/coupon-preview.js";import{shippingWords as an,TAX_PENDING as on}from"../../lib/cart/shipping-status.js";import{DEFAULT_FINISH_COLOR as cn}from"../../lib/wheels/finish-defaults.js";import sn from"efficient-web-builder/render/components/Logo";import st from"../ThemedSelect.js";import T from"../WebFormField.js";import ln from"../WheelSvg.js";function lt(n){const o=n.indexOf(`
2
- `);return o===-1?[n,""]:[n.slice(0,o),n.slice(o+1)]}function dt(n,{canParkContext:o}={canParkContext:!0}){const d=n.paymentMethods,i=[];return d.includes("card")&&i.push({key:"card",title:"Card",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA · MC · AMEX"})}),d.includes("paypal")&&n.paypalClientId&&i.push({key:"paypal",title:"PayPal",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL · CARDS"})}),d.includes("afterpay")&&i.push({key:"afterpay",title:"Afterpay",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 × INTEREST-FREE"})}),d.includes("square")&&n.squareApplicationId&&n.squareLocationId&&i.push({key:"square",title:"Card (Square)",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA · MC · AMEX"})}),d.includes("gocardless")&&o&&i.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),d.includes("zip")&&i.push({key:"zip",title:"Zip",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),d.includes("klarna")&&o&&i.push({key:"klarna",title:"Klarna",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),i.push({key:"bank",title:"Bank transfer",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),i}function dn({site:n,logo:o,preview:d=!1}){const{items:i,totals:a,coupon:l,refuseCoupon:m,deliveryOptions:x,shippingMethodId:h,setShippingMethodId:y,setQuoteDestination:N,identify:P,clearCapturedCart:w}=it(),u=x.find(t=>t.id===h)?.pickupLocation??null,{country:L,countries:b,activeCountry:_,formatMoney:$}=W(),[f,C]=s(()=>dt(n)[0].key),[F,Z]=s(!0);S(()=>{Z(Wt(B))},[]);const[X,qe]=s(!1),[J,Be]=s(""),[Q,Le]=s(""),[fe,$e]=s(""),[ge,he]=s(""),[xe,ye]=s(""),[be,ke]=s(""),[Ne,ve]=s(""),[we,Ce]=s(""),[v,Pe]=s(()=>L||b[0]?.code||""),[H,re]=s(""),[V,Ye]=s([]),[ze,Se]=s(null),[ae,oe]=s(null),gt=pe(()=>b.find(t=>t.code===v)??_,[b,v,_])?.postalLabel||"Postal Code",ht=V[0]?.divisionType||"State / Province";S(()=>{if(!v){Ye([]),Se(v);return}Se(null);let t=!1;return A.listCountrySubdivisions(v).then(c=>{t||(Ye(c),Se(v),re(""))}),()=>{t=!0}},[v]),S(()=>{N(v?{country:v,subdivision:H}:null)},[v,H,N]),S(()=>()=>N(null),[N]);const[Y,Fe]=s(null),[Me,Ue]=s([]),[ie,ce]=s("new"),[Ae,De]=s(!1),[He,xt]=s("Home"),[Ge,We]=s(null),[j]=s(()=>Ht()),[se,R]=s(null),[Ze,ee]=s(null),[Xe,yt]=s(null),[bt,kt]=s(!1),[Nt,vt]=s(!1),[O,Ee]=s(null),[Je,G]=s(!1),[Qe,z]=s(null),[wt,Ct]=s(!1),[Pt,Ve]=s(!1),[St,At]=s(!1),[Et,et]=s(!1),tt=U(!1);S(()=>{d||tt.current||!i.some(ot)||(tt.current=!0,Mt({lines:i,currency:a.currency,value:a.subtotal-a.discount,coupon:l?.valid?l.code:void 0}))},[i,a,l,d]),S(()=>{P(J,Q.trim()||void 0)},[J,Q,P]);const nt=U(null),[le,It]=s(null);S(()=>{const t=nt.current;if(!le||!t)return;const c=()=>t.style.setProperty("--sf-checkout-header-h",`${le.offsetHeight}px`);c();const p=new ResizeObserver(c);return p.observe(le),()=>p.disconnect()},[le]),S(()=>{const t=p=>({setConfirming:p,land:R,markPaid:()=>G(!0),note:z,fail:ee,clearCart:w}),c={search:window.location.search,storage:B,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};ct(Xt,{...c,capture:A.captureAfterpayPayment,page:t(Ct)}),ct(Qt,{...c,capture:A.captureZipPayment,page:t(At)})},[]),S(()=>{const c=new URLSearchParams(window.location.search).get("gocardless");if(c!=="confirm"&&c!=="cancel")return;const p=B.getItem(Re);if(B.removeItem(Re),window.history.replaceState(null,"",window.location.pathname),!p)return;let k;try{k=JSON.parse(p)}catch{return}if(w(),c==="cancel"){z("The direct debit was not set up — our team will follow up on payment."),R(k.confirmation);return}Ve(!0),A.completeGocardlessPayment({idempotencyKey:k.idempotencyKey}).then(g=>{g.status==="paid"?G(!0):g.status==="declined"?z("The direct debit was declined — our team will follow up on payment."):z("Your direct debit is set up — the payment is collecting and will clear in a few days.")}).catch(()=>{z("We could not confirm the direct debit — our team will follow up on payment.")}).finally(()=>{R(k.confirmation),Ve(!1)})},[]),S(()=>{const t=new URLSearchParams(window.location.search),c=t.get("klarna");if(c!=="confirm"&&c!=="cancel")return;const p=B.getItem(Ke);B.removeItem(Ke);const k=t.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!p)return;let g;try{g=JSON.parse(p)}catch{return}if(w(),c==="cancel"||!k){z("The Klarna payment was not completed — our team will follow up on payment."),R(g.confirmation);return}et(!0),A.captureKlarnaPayment({idempotencyKey:g.idempotencyKey,authorizationToken:k}).then(I=>{I.status==="paid"?G(!0):I.status==="declined"?z("Klarna declined the payment — our team will follow up on payment."):z("Your Klarna payment is being reviewed — we'll confirm the outcome shortly.")}).catch(()=>{z("We could not confirm the Klarna payment — our team will follow up on payment.")}).finally(()=>{R(g.confirmation),et(!1)})},[]);function rt(t){const[c,p]=lt(t.address);he(c),ye(p),ke(t.city),ve(t.zip_code),t.country&&Pe(t.country),t.phone&&Ce(t.phone),oe({country:t.country||null,state:t.state??""})}S(()=>{if(ae){if((ae.country||v)!==v){oe(null);return}ze===v&&(re(Vt(v,ae.state,V)),oe(null))}},[ae,v,ze,V]),S(()=>{let t=!1;return(async()=>{try{const[c,p,k]=await Promise.all([ne.me(),ne.myProfile().catch(()=>null),ne.myAddresses().catch(()=>[])]);if(t)return;Fe(c);const g=k.filter(te=>te.is_active);Ue(g),Be(c.email);const I=(p?.contact_name??"").split(/\s+/);Le(c.first_name||I[0]||""),$e(c.last_name||I.slice(1).join(" "));const q=c.phone||p?.phone;q&&Ce(q);const Ie=g.find(te=>te.id===c.default_delivery_location)??g[0];if(Ie)ce(Ie.id),rt(Ie);else if(p){const[te,Rt]=lt(p.address??"");he(te),ye(Rt),ke(p.city??""),ve(p.zip_code??""),p.country&&Pe(p.country),oe({country:p.country||null,state:p.state??""})}}catch{}})(),()=>{t=!0}},[]);function _t(){ne.logout(),Fe(null),Ue([]),ce("new"),De(!1)}const de=pe(()=>dt(n,{canParkContext:F}),[n,F]);S(()=>{de.some(t=>t.key===f)||C(de[0].key)},[de,f]);const at=xe.trim()?`${ge}
3
- ${xe.trim()}`:ge;async function jt(){if(d||X||i.length===0||a.repricing)return;const t=i.filter(ot).flatMap(c=>Gt(c.components,c.qty));if(t.length===0){ee("Pick a size on each wheel's product page before checking out.");return}qe(!0),ee(null);try{const c=Y?A.createOrderAuthed:A.createOrder,p=Ft(),k=await c({customer:{email:J,name:`${Q} ${fe}`.trim(),phone:we.trim()||void 0,address:at,city:be,state:H||void 0,zipCode:Ne,country:v},items:t,currency:a.currency,idempotencyKey:j,shippingMethodId:h??void 0,couponCode:nn(l),...p==="denied"?{}:zt(),...p?{adConsent:p}:{}});if(Ut({confirmation:k,lines:i,adsSendTo:n.googleAdsId&&n.googleAdsConversionLabel?`${n.googleAdsId}/${n.googleAdsConversionLabel}`:null}),Dt({confirmation:k,lines:i}),w(),Y&&Ae&&ie==="new")try{await ne.createAddress({label:He.trim()||"Home",contact_name:`${Q} ${fe}`.trim(),phone:we.trim(),address:at,city:be,zip_code:Ne,state:H,country:v}),We("Address saved to your account.")}catch{We("We couldn't save the address to your account — you can add it under Account → Addresses.")}if(f==="card"&&n.paymentMethods.includes("card")){const g=await A.createPaymentIntent({idempotencyKey:j});Ee(k),yt(g)}else if(f==="paypal"&&n.paymentMethods.includes("paypal"))Ee(k),kt(!0);else if(f==="afterpay"&&n.paymentMethods.includes("afterpay")){const g=window.location.origin,I=await A.createAfterpayCheckout({idempotencyKey:j,confirmUrl:`${g}/checkout?afterpay=confirm`,cancelUrl:`${g}/checkout?afterpay=cancel`}),q={idempotencyKey:j,confirmation:k};B.setItem(Zt,JSON.stringify(q)),window.location.assign(I.redirectCheckoutUrl);return}else if(f==="square"&&n.paymentMethods.includes("square"))Ee(k),vt(!0);else if(f==="gocardless"&&n.paymentMethods.includes("gocardless")){const g=window.location.origin,I=await A.createGocardlessBillingRequest({idempotencyKey:j,confirmUrl:`${g}/checkout?gocardless=confirm`,cancelUrl:`${g}/checkout?gocardless=cancel`}),q={idempotencyKey:j,confirmation:k};B.setItem(Re,JSON.stringify(q)),window.location.assign(I.authorisationUrl);return}else if(f==="zip"&&n.paymentMethods.includes("zip")){const g=window.location.origin,I=await A.createZipCheckout({idempotencyKey:j,redirectUrl:`${g}/checkout?zip=return`}),q={idempotencyKey:j,confirmation:k};B.setItem(Jt,JSON.stringify(q)),window.location.assign(I.redirectUrl);return}else if(f==="klarna"&&n.paymentMethods.includes("klarna")){const g=window.location.origin,I=await A.createKlarnaCheckout({idempotencyKey:j,confirmUrl:`${g}/checkout?klarna=confirm`,cancelUrl:`${g}/checkout?klarna=cancel`}),q={idempotencyKey:j,confirmation:k};B.setItem(Ke,JSON.stringify(q)),window.location.assign(I.redirectUrl);return}else R(k)}catch(c){const p=rn(c);p?(m(p),ee(`${p} Your order has not been placed. Place it again to continue without the code.`)):ee(c instanceof je?c.message:"Could not place the order. Please try again."),qe(!1)}}return se?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:Je?"Payment received":"Order received"}),r("p",{className:"text-fg-dim",children:[Je?r(E,{children:["Thank you — your payment for order"," ",e("span",{className:"font-mono text-fg",children:se.orderNumber})," has gone through."," "]}):r(E,{children:["Thank you — your order ",e("span",{className:"font-mono text-fg",children:se.orderNumber})," is being reviewed by our team."," "]}),Y?r(E,{children:["Track it under"," ",e(M,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):e(E,{children:"We’ve emailed you a link to set a password and track it."})]}),Qe&&e("p",{className:"text-sm text-fg-dim",children:Qe}),Ge&&e("p",{className:"text-sm text-fg-dim",children:Ge}),!Y&&r("p",{className:"text-sm text-fg-dim",children:["You can also"," ",e(M,{href:`/track?order=${encodeURIComponent(se.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email — no password needed."]}),e(M,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):wt?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay — one moment."})]}):Pt?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Setting up your direct debit…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless — one moment."})]}):St?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip — one moment."})]}):Et?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna — one moment."})]}):Xe?e(pn,{payment:Xe,onPaid:()=>{G(!0),R(O)},onSkip:()=>R(O)}):bt&&O?e(fn,{confirmation:O,clientId:n.paypalClientId??"",idemKey:j,onPaid:()=>{G(!0),R(O)},onSkip:()=>R(O)}):Nt&&O?e(hn,{confirmation:O,applicationId:n.squareApplicationId??"",locationId:n.squareLocationId??"",environment:n.squareEnvironment??"production",idemKey:j,onPaid:()=>{G(!0),R(O)},onSkip:()=>R(O)}):r("div",{ref:nt,className:"bg-bg text-fg",children:[r("header",{ref:It,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[r(M,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["←",e("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),e(M,{href:"/","aria-label":`${n.name} home`,className:"inline-flex items-center justify-center",children:e(sn,{variant:"header",scrolled:!0,src:o?.url??null,reverse:o?.reverse??!1,reversedSrc:o?.reversed??null,inkIsDark:o?.inkIsDark??null,size:o?.size??"medium",sizePx:o?.sizePx??null,siteName:n.name})}),n.cardPayments?r("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[e("span",{className:"text-green",children:"●"}),e("span",{className:"max-[640px]:hidden",children:"Encrypted ·"})," Stripe"]}):e("span",{})]}),r("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[e("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),e("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(t=>r("span",{className:["relative flex items-center gap-2 transition-colors",t.state==="pending"?"text-fg-dim":"text-fg",t.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[e("span",{className:t.state==="done"?"text-accent font-bold":"",children:t.n}),e("span",{children:t.label})]},t.n))})]}),r("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-8 max-[1100px]:pb-20",children:[r("div",{children:[r(ue,{num:"N° 01",title:"Contact",children:[e(T,{label:"Email",hint:Y?r(E,{children:["Signed in ·"," ",e("button",{type:"button",onClick:_t,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:e("input",{type:"email",value:J,onChange:t=>Be(t.target.value),placeholder:"you@example.com",readOnly:Y!==null,className:K+(Y?" opacity-70":"")})}),r(ut,{children:[e(T,{label:"First name",children:e("input",{type:"text",value:Q,onChange:t=>Le(t.target.value),className:K})}),e(T,{label:"Last name",children:e("input",{type:"text",value:fe,onChange:t=>$e(t.target.value),className:K})})]})]}),r(ue,{num:"N° 02",title:u?"Collection":"Shipping address",children:[u?r("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[e("span",{className:"font-medium",children:u.name}),[u.address,u.city,u.state,u.zipCode,u.country].filter(Boolean).length>0&&e("span",{className:"opacity-80",children:[u.address,u.city,u.state,u.zipCode,u.country].filter(Boolean).join(", ")}),u.openingHours&&e("span",{className:"opacity-80",children:u.openingHours}),u.instructions&&e("span",{className:"opacity-80",children:u.instructions}),e("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):r(E,{children:[Y!==null&&Me.length>0&&r("div",{className:"grid gap-3",children:[Me.map(t=>e(me,{active:ie===t.id,onClick:()=>{ce(t.id),rt(t)},title:t.label,body:t.formatted_address,price:null},t.id)),e(me,{active:ie==="new",onClick:()=>ce("new"),title:"New address",body:null,price:null})]}),e(T,{label:"Address line 1",children:e("input",{type:"text",value:ge,onChange:t=>he(t.target.value),className:K})}),e(T,{label:"Address line 2",children:e("input",{type:"text",value:xe,onChange:t=>ye(t.target.value),placeholder:"Apartment, unit, garage bay…",className:K})}),r(ut,{cols:"three",children:[e(T,{label:"City",children:e("input",{type:"text",value:be,onChange:t=>ke(t.target.value),className:K})}),e(T,{label:gt,children:e("input",{type:"text",value:Ne,onChange:t=>ve(t.target.value),className:K})}),e(T,{label:"Country",separate:!0,children:e(st,{value:v,onChange:t=>Pe(t.target.value),className:K+" pr-10",style:pt,children:b.map(t=>e("option",{value:t.code,children:t.name},t.code))})})]}),e(T,{label:ht,separate:!0,children:V.length>0?r(st,{value:H,onChange:t=>re(t.target.value),className:K+" pr-10",style:pt,children:[e("option",{value:"",children:"Select…"}),V.map(t=>e("option",{value:t.code||t.name,children:t.name},t.code||t.name))]}):e("input",{type:"text",value:H,onChange:t=>re(t.target.value),className:K})})]}),e(T,{label:"Phone",children:e("input",{type:"tel",value:we,onChange:t=>Ce(t.target.value),placeholder:"+44 7700 900000",className:K})}),!u&&Y!==null&&ie==="new"&&r(E,{children:[e(xn,{checked:Ae,onChange:De,label:"Save this address to my account"}),Ae&&e(T,{label:"Address label",children:e("input",{type:"text",value:He,onChange:t=>xt(t.target.value),placeholder:"Home",className:K})})]})]}),e(ue,{num:"N° 03",title:"Shipping",children:r("div",{className:"grid gap-3",children:[x.map(t=>{const c=t.pickupLocation,p=c?[c.address,c.city,c.state,c.zipCode].filter(Boolean).join(", "):null;return e(me,{active:h===t.id,onClick:()=>y(t.id),title:c?`${t.name} — ${c.name}`:t.name,body:c?[p,c.openingHours,c.instructions,t.description].filter(Boolean).join(" · "):t.description||null,price:a.freeShipping||t.amount===0?_e:$(t.amount,a.currency),tag:t.tag||void 0},t.id)}),x.length===0&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})}),r(ue,{num:"N° 04",title:"Payment",children:[e("div",{className:"grid gap-3",children:de.map(t=>e(me,{active:f===t.key,onClick:()=>C(t.key),title:t.title,body:t.body,price:t.price,tag:t.tag},t.key))}),f==="card"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):f==="paypal"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll approve the payment with PayPal on the payment step after placing the order."}):f==="afterpay"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):f==="square"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):f==="gocardless"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):f==="zip"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Zip to approve four instalments, then brought straight back."}):f==="klarna"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Klarna to choose how to pay, then brought straight back."}):e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."})]})]}),r("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-[1100px]:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[r("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[e("span",{children:"Your order"}),e(M,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit ↗"})]}),e("div",{className:"flex flex-col px-6 py-2",children:i.length===0?r("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",e(M,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog →"})]}):i.map(t=>e(yn,{slug:t.slug,name:t.name,qty:t.qty,config:t.config,configSummary:bn(t.config),price:$t(t,a.currency)??0,currency:a.currency},t.id))}),e("div",{className:"border-t border-line px-6 pt-5",children:e(en,{customerEmail:J})}),r("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[e(D,{label:"Subtotal",value:$(a.subtotal,a.currency)}),a.discount>0&&l?.valid&&e(D,{label:`Coupon · ${l.code}`,value:r("span",{className:"font-semibold text-green",children:["− ",$(a.discount,a.currency)]})}),l?.deferred&&e(D,{label:`Coupon · ${l.code}`,value:tn}),l?.valid&&l.effects?.gift&&e(D,{label:`Free gift · ${l.effects.gift.partNumber}${l.effects.gift.quantity>1?` ×${l.effects.gift.quantity}`:""}`,value:e("span",{className:"font-semibold text-green",children:_e})}),e(D,{label:"Shipping",value:a.shippingStatus==="free"?e("span",{className:"font-semibold text-green",children:_e}):an(a.shippingStatus)??$(a.shipping,a.currency)}),a.tax&&(a.tax.charged?e(D,{label:a.tax.inclusive?`${a.tax.name} included · ${a.tax.rate}%`:a.tax.name,value:$(a.tax.amount,a.currency)}):a.tax.name?e(D,{label:a.tax.name,value:on}):null)]}),r("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[e("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),e("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:a.repricing?"…":$(a.grand,a.currency)})]}),r("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[Ze&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:Ze}),a.hasUnpricedLine&&r("p",{className:"border border-amber-300 bg-amber-50 px-3 py-2 text-[13px] text-amber-800",children:["One or more items have no price in ",a.currency,". Remove them, or switch region, to continue."]}),e("button",{type:"button",onClick:jt,disabled:X||i.length===0||a.hasUnpricedLine||a.repricing,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",i.length===0||X||a.hasUnpricedLine||a.repricing?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:X?r(E,{children:["Building order… ",e("span",{children:"·"})]}):a.repricing?r(E,{children:["Updating total… ",e("span",{children:"·"})]}):r(E,{children:[f==="bank"?"Place order":"Continue to payment"," ·"," ",$(a.grand,a.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})})]})]})]}),e("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:e("span",{children:Yt({legalName:n.legalName,foundedYear:n.foundedYear,siteName:n.name})})})]})}const K="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",pt={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function ue({num:n,title:o,children:d}){return r("section",{className:"mb-6 border border-line bg-bg",children:[r("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n}),e("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:o})]}),e("div",{className:"flex flex-col gap-4 px-6 py-6",children:d})]})}function ut({cols:n="two",children:o}){return e("div",{className:["grid gap-3 max-[640px]:grid-cols-1",n==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:o})}function me({active:n,onClick:o,title:d,body:i,price:a,tag:l}){return r("button",{type:"button",onClick:o,"aria-pressed":n,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",n?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:n?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[n&&e("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",n?"border-accent":"border-fg-dim"].join(" "),children:n&&e("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),r("span",{className:"flex min-w-0 flex-col gap-1",children:[r("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[d,l&&e("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:l})]}),i&&e("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:i})]}),e("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:a})]})}function pn({payment:n,onPaid:o,onSkip:d}){const{formatMoney:i}=W(),a=pe(()=>Lt(n.publishableKey),[n.publishableKey]),l=pe(()=>{if(typeof document>"u")return;const m=getComputedStyle(document.documentElement),x=(y,N)=>m.getPropertyValue(y).trim()||N,h=document.documentElement.getAttribute("data-theme")!=="light";return{theme:h?"night":"stripe",variables:{colorPrimary:x("--accent",h?"#c9a461":"#8a6a2a"),colorBackground:x("--site-surface",h?"#131313":"#ffffff"),colorText:x("--fg",h?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:i(Number(n.amount),n.currency)})," ","by card to confirm it now."]}),e(Tt,{stripe:a,options:{clientSecret:n.clientSecret,appearance:l},children:e(un,{payment:n,onPaid:o,onSkip:d})})]})]})})}function un({payment:n,onPaid:o,onSkip:d}){const{formatMoney:i}=W(),a=Bt(),l=qt(),[m,x]=s(!1),[h,y]=s(null);async function N(){if(!a||!l||m)return;x(!0),y(null);const P=await a.confirmPayment({elements:l,redirect:"if_required"});if(P.error){y(P.error.message??"Payment failed. Please try again."),x(!1);return}const w=P.paymentIntent?.status;if(w==="succeeded"||w==="processing"){o();return}y("Payment did not complete. Please try again."),x(!1)}return r("div",{className:"flex flex-col gap-4",children:[e(Ot,{}),h&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:h}),e("button",{type:"button",onClick:N,disabled:!a||!l||m,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!a||!l||m?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:m?r(E,{children:["Processing… ",e("span",{children:"·"})]}):r(E,{children:["Pay ",i(Number(n.amount),n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:d,disabled:m,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})}const mt="paypal-sdk-js";let Te=null;function mn(n,o){const d=`${n}|${o}`;if(Te?.key===d)return Te.promise;const i=new Promise((a,l)=>{document.getElementById(mt)?.remove();const m=document.createElement("script");m.id=mt;const x=new URLSearchParams({"client-id":n,currency:o,intent:"capture"});m.src=`https://www.paypal.com/sdk/js?${x}`,m.onload=()=>{const h=window.paypal;h?a(h):l(new Error("PayPal SDK loaded without its namespace"))},m.onerror=()=>l(new Error("PayPal SDK failed to load")),document.head.appendChild(m)});return Te={key:d,promise:i},i}function fn({confirmation:n,clientId:o,idemKey:d,onPaid:i,onSkip:a}){const{formatMoney:l}=W(),m=U(null),[x,h]=s(!1),[y,N]=s(null),P=U(i);return P.current=i,S(()=>{let w=!1,u=null;return mn(o,n.currency).then(L=>{if(!(w||!m.current))return u=L.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await A.createPaypalOrder({idempotencyKey:d})).paypalOrderId,onApprove:async b=>{try{if((await A.capturePaypalOrder({idempotencyKey:d,paypalOrderId:b.orderID})).status==="paid"){P.current();return}N("PayPal did not complete the payment. Please try again.")}catch(_){N(_ instanceof je?_.message:"PayPal payment failed. Please try again.")}},onError:()=>{N("PayPal could not process the payment. Please try again.")}}),u.render(m.current).then(()=>{w||h(!0)})}).catch(()=>{w||N("PayPal could not be loaded. You can pay later — your order stands either way.")}),()=>{w=!0,u?.close?.()}},[o,n.currency,d]),e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:l(Number(n.grandTotal),n.currency)})," ","with PayPal to confirm it now."]}),!x&&!y&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal…"}),e("div",{ref:m}),y&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:y}),e("button",{type:"button",onClick:a,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}const ft="square-web-sdk";let Oe=null;function gn(n){const o=n==="sandbox"?"sandbox":"production";if(Oe?.key===o)return Oe.promise;const d=new Promise((i,a)=>{document.getElementById(ft)?.remove();const l=document.createElement("script");l.id=ft,l.src=o==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",l.onload=()=>{const m=window.Square;m?i(m):a(new Error("Square SDK loaded without its namespace"))},l.onerror=()=>a(new Error("Square SDK failed to load")),document.head.appendChild(l)});return Oe={key:o,promise:d},d}function hn({confirmation:n,applicationId:o,locationId:d,environment:i,idemKey:a,onPaid:l,onSkip:m}){const{formatMoney:x}=W(),h=U(null),y=U(null),N=U(null),[P,w]=s(!1),[u,L]=s(!1),[b,_]=s(null);S(()=>{let f=!1,C=null;return gn(i).then(async F=>{if(f||!h.current)return;const Z=F.payments(o,d);N.current=Z,C=await Z.card(),await C.attach(h.current),y.current=C,f||w(!0)}).catch(()=>{f||_("Square could not be loaded. You can pay later — your order stands either way.")}),()=>{f=!0,C?.destroy?.()}},[o,d,i]);async function $(){const f=y.current;if(!(!f||u)){L(!0),_(null);try{const C=await f.tokenize();if(C.status!=="OK"||!C.token){_(C.errors?.[0]?.message??"Please check the card details and try again."),L(!1);return}let F;try{F=(await N.current?.verifyBuyer?.(C.token,{amount:String(n.grandTotal),currencyCode:n.currency,intent:"CHARGE"}))?.token}catch{}if((await A.chargeSquare({idempotencyKey:a,sourceId:C.token,...F?{verificationToken:F}:{}})).status==="paid"){l();return}_("Square did not complete the payment. Please try again.")}catch(C){_(C instanceof je?C.message:"Square payment failed. Please try again.")}L(!1)}}return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:x(Number(n.grandTotal),n.currency)})," ","by card to confirm it now."]}),!P&&!b&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form…"}),e("div",{ref:h}),b&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:b}),e("button",{type:"button",onClick:$,disabled:!P||u,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!P||u?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:u?r(E,{children:["Processing… ",e("span",{children:"·"})]}):r(E,{children:["Pay ",x(Number(n.grandTotal),n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:m,disabled:u,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}function xn({checked:n,onChange:o,label:d,sub:i}){return r("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[e("button",{type:"button",onClick:()=>o(!n),"aria-pressed":n,"aria-label":d,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",n?"border-accent":"border-line"].join(" "),style:n?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:n&&e("span",{className:"text-[13px] text-accent",children:"✓"})}),r("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[d,i&&e("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:i})]})]})}function yn({slug:n,name:o,qty:d,config:i,configSummary:a,price:l,currency:m}){const{catalog:x}=it(),{formatMoney:h}=W(),y=x.find(b=>b.slug===n),N=y?.spokes??5,P=y?.mesh??!1,w=i.find(b=>b.gold)?.label,u=y?.finishes.find(b=>b.name===w&&b.src)??y?.finishes.find(b=>b.src),L=y?.finishes[0]?.color??cn;return r("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[r("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[e("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:d}),u?.src?e(Kt,{src:u.src,alt:`${o.lead}${o.accent} — ${u.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-2"}):e("div",{className:"block w-[78%]",style:{color:L},children:e(ln,{spokes:N,mesh:P,className:"block w-full"})})]}),r("div",{className:"flex min-w-0 flex-col gap-0.5",children:[r("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[o.lead,e("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:o.accent})]}),e("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:a})]}),e("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:h(l,m)})]})}function D({label:n,value:o}){return r("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[e("span",{children:n}),e("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:o})]})}function bn(n){return n.map(o=>o.label).join(" · ")}export{dt as buildPayOptions,dn as default};
1
+ "use client";import{jsx as e,Fragment as N,jsxs as r}from"react/jsx-runtime";import S from"next/link";import{useEffect as D,useMemo as T,useRef as j,useState as v}from"react";import{Elements as O,PaymentElement as z,useElements as L,useStripe as M}from"@stripe/react-stripe-js";import{loadStripe as $}from"@stripe/stripe-js";import{useCurrency as E}from"../CurrencyContext.js";import{resolveCopyright as F}from"../../lib/content/site.js";import{ApiError as A,products as R}from"../../lib/api/index.js";import U from"efficient-web-builder/render/components/Logo";import{CheckoutStateProvider as G,useCheckout as H}from"./checkout-state.js";import{CheckoutContact as Q,CheckoutOrderSummary as V,CheckoutPayment as W,CheckoutShippingAddress as Z,CheckoutShippingMethod as J}from"./checkout-parts.js";function X(t){return e(G,{...t,children:e(ee,{})})}function ee(){const{site:t,logo:a,items:l,placing:m,email:p,me:o,addressSaveNote:n,idemKey:d,confirmation:s,setConfirmation:c,payment:f,paypalStep:x,squareStep:y,pendingConf:i,paid:k,setPaid:h,payNote:g,afterpayConfirming:q,gocardlessConfirming:b,zipConfirming:u,klarnaConfirming:P,checkoutRootRef:C,setCheckoutHeaderEl:_}=H();return s?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:k?"Payment received":"Order received"}),r("p",{className:"text-fg-dim",children:[k?r(N,{children:["Thank you — your payment for order"," ",e("span",{className:"font-mono text-fg",children:s.orderNumber})," has gone through."," "]}):r(N,{children:["Thank you — your order ",e("span",{className:"font-mono text-fg",children:s.orderNumber})," is being reviewed by our team."," "]}),o?r(N,{children:["Track it under"," ",e(S,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):e(N,{children:"We’ve emailed you a link to set a password and track it."})]}),g&&e("p",{className:"text-sm text-fg-dim",children:g}),n&&e("p",{className:"text-sm text-fg-dim",children:n}),!o&&r("p",{className:"text-sm text-fg-dim",children:["You can also"," ",e(S,{href:`/track?order=${encodeURIComponent(s.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email — no password needed."]}),e(S,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):q?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay — one moment."})]}):b?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Setting up your direct debit…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless — one moment."})]}):u?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip — one moment."})]}):P?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna — one moment."})]}):f?e(te,{payment:f,onPaid:()=>{h(!0),c(i)},onSkip:()=>c(i)}):x&&i?e(ae,{confirmation:i,clientId:t.paypalClientId??"",idemKey:d,onPaid:()=>{h(!0),c(i)},onSkip:()=>c(i)}):y&&i?e(se,{confirmation:i,applicationId:t.squareApplicationId??"",locationId:t.squareLocationId??"",environment:t.squareEnvironment??"production",idemKey:d,onPaid:()=>{h(!0),c(i)},onSkip:()=>c(i)}):r("div",{ref:C,className:"bg-bg text-fg",children:[r("header",{ref:_,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[r(S,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["←",e("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),e(S,{href:"/","aria-label":`${t.name} home`,className:"inline-flex items-center justify-center",children:e(U,{variant:"header",scrolled:!0,src:a?.url??null,reverse:a?.reverse??!1,reversedSrc:a?.reversed??null,inkIsDark:a?.inkIsDark??null,size:a?.size??"medium",sizePx:a?.sizePx??null,siteName:t.name})}),t.cardPayments?r("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[e("span",{className:"text-green",children:"●"}),e("span",{className:"max-[640px]:hidden",children:"Encrypted ·"})," Stripe"]}):e("span",{})]}),r("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[e("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),e("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(w=>r("span",{className:["relative flex items-center gap-2 transition-colors",w.state==="pending"?"text-fg-dim":"text-fg",w.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[e("span",{className:w.state==="done"?"text-accent font-bold":"",children:w.n}),e("span",{children:w.label})]},w.n))})]}),r("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-8 max-[1100px]:pb-20",children:[r("div",{children:[e(Q,{}),e(Z,{}),e(J,{}),e(W,{})]}),e(V,{})]}),e("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:e("span",{children:F({legalName:t.legalName,foundedYear:t.foundedYear,siteName:t.name})})})]})}function te({payment:t,onPaid:a,onSkip:l}){const{formatMoney:m}=E(),p=T(()=>$(t.publishableKey),[t.publishableKey]),o=T(()=>{if(typeof document>"u")return;const n=getComputedStyle(document.documentElement),d=(c,f)=>n.getPropertyValue(c).trim()||f,s=document.documentElement.getAttribute("data-theme")!=="light";return{theme:s?"night":"stripe",variables:{colorPrimary:d("--accent",s?"#c9a461":"#8a6a2a"),colorBackground:d("--site-surface",s?"#131313":"#ffffff"),colorText:d("--fg",s?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:m(Number(t.amount),t.currency)})," ","by card to confirm it now."]}),e(O,{stripe:p,options:{clientSecret:t.clientSecret,appearance:o},children:e(re,{payment:t,onPaid:a,onSkip:l})})]})]})})}function re({payment:t,onPaid:a,onSkip:l}){const{formatMoney:m}=E(),p=M(),o=L(),[n,d]=v(!1),[s,c]=v(null);async function f(){if(!p||!o||n)return;d(!0),c(null);const x=await p.confirmPayment({elements:o,redirect:"if_required"});if(x.error){c(x.error.message??"Payment failed. Please try again."),d(!1);return}const y=x.paymentIntent?.status;if(y==="succeeded"||y==="processing"){a();return}c("Payment did not complete. Please try again."),d(!1)}return r("div",{className:"flex flex-col gap-4",children:[e(z,{}),s&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:s}),e("button",{type:"button",onClick:f,disabled:!p||!o||n,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!p||!o||n?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:n?r(N,{children:["Processing… ",e("span",{children:"·"})]}):r(N,{children:["Pay ",m(Number(t.amount),t.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:l,disabled:n,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})}const B="paypal-sdk-js";let I=null;function ne(t,a){const l=`${t}|${a}`;if(I?.key===l)return I.promise;const m=new Promise((p,o)=>{document.getElementById(B)?.remove();const n=document.createElement("script");n.id=B;const d=new URLSearchParams({"client-id":t,currency:a,intent:"capture"});n.src=`https://www.paypal.com/sdk/js?${d}`,n.onload=()=>{const s=window.paypal;s?p(s):o(new Error("PayPal SDK loaded without its namespace"))},n.onerror=()=>o(new Error("PayPal SDK failed to load")),document.head.appendChild(n)});return I={key:l,promise:m},m}function ae({confirmation:t,clientId:a,idemKey:l,onPaid:m,onSkip:p}){const{formatMoney:o}=E(),n=j(null),[d,s]=v(!1),[c,f]=v(null),x=j(m);return x.current=m,D(()=>{let y=!1,i=null;return ne(a,t.currency).then(k=>{if(!(y||!n.current))return i=k.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await R.createPaypalOrder({idempotencyKey:l})).paypalOrderId,onApprove:async h=>{try{if((await R.capturePaypalOrder({idempotencyKey:l,paypalOrderId:h.orderID})).status==="paid"){x.current();return}f("PayPal did not complete the payment. Please try again.")}catch(g){f(g instanceof A?g.message:"PayPal payment failed. Please try again.")}},onError:()=>{f("PayPal could not process the payment. Please try again.")}}),i.render(n.current).then(()=>{y||s(!0)})}).catch(()=>{y||f("PayPal could not be loaded. You can pay later — your order stands either way.")}),()=>{y=!0,i?.close?.()}},[a,t.currency,l]),e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:o(Number(t.grandTotal),t.currency)})," ","with PayPal to confirm it now."]}),!d&&!c&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal…"}),e("div",{ref:n}),c&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:c}),e("button",{type:"button",onClick:p,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}const Y="square-web-sdk";let K=null;function oe(t){const a=t==="sandbox"?"sandbox":"production";if(K?.key===a)return K.promise;const l=new Promise((m,p)=>{document.getElementById(Y)?.remove();const o=document.createElement("script");o.id=Y,o.src=a==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",o.onload=()=>{const n=window.Square;n?m(n):p(new Error("Square SDK loaded without its namespace"))},o.onerror=()=>p(new Error("Square SDK failed to load")),document.head.appendChild(o)});return K={key:a,promise:l},l}function se({confirmation:t,applicationId:a,locationId:l,environment:m,idemKey:p,onPaid:o,onSkip:n}){const{formatMoney:d}=E(),s=j(null),c=j(null),f=j(null),[x,y]=v(!1),[i,k]=v(!1),[h,g]=v(null);D(()=>{let b=!1,u=null;return oe(m).then(async P=>{if(b||!s.current)return;const C=P.payments(a,l);f.current=C,u=await C.card(),await u.attach(s.current),c.current=u,b||y(!0)}).catch(()=>{b||g("Square could not be loaded. You can pay later — your order stands either way.")}),()=>{b=!0,u?.destroy?.()}},[a,l,m]);async function q(){const b=c.current;if(!(!b||i)){k(!0),g(null);try{const u=await b.tokenize();if(u.status!=="OK"||!u.token){g(u.errors?.[0]?.message??"Please check the card details and try again."),k(!1);return}let P;try{P=(await f.current?.verifyBuyer?.(u.token,{amount:String(t.grandTotal),currencyCode:t.currency,intent:"CHARGE"}))?.token}catch{}if((await R.chargeSquare({idempotencyKey:p,sourceId:u.token,...P?{verificationToken:P}:{}})).status==="paid"){o();return}g("Square did not complete the payment. Please try again.")}catch(u){g(u instanceof A?u.message:"Square payment failed. Please try again.")}k(!1)}}return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:d(Number(t.grandTotal),t.currency)})," ","by card to confirm it now."]}),!x&&!h&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form…"}),e("div",{ref:s}),h&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:h}),e("button",{type:"button",onClick:q,disabled:!x||i,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!x||i?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:i?r(N,{children:["Processing… ",e("span",{children:"·"})]}):r(N,{children:["Pay ",d(Number(t.grandTotal),t.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:n,disabled:i,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}export{X as default};
@@ -0,0 +1,5 @@
1
+ export declare function CheckoutContact(): import("react").JSX.Element;
2
+ export declare function CheckoutShippingAddress(): import("react").JSX.Element;
3
+ export declare function CheckoutShippingMethod(): import("react").JSX.Element;
4
+ export declare function CheckoutPayment(): import("react").JSX.Element;
5
+ export declare function CheckoutOrderSummary(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as e,Fragment as y,jsxs as a}from"react/jsx-runtime";import M from"next/image";import P from"next/link";import{lineTotal as D,useCart as H}from"../CartContext.js";import{useCurrency as G}from"../CurrencyContext.js";import{FREE_PRICE as _}from"../../lib/wheels/price-display.js";import W from"../CouponField.js";import{COUPON_DEFERRED_TOTAL as K}from"../../lib/cart/coupon-preview.js";import{shippingWords as X,TAX_PENDING as Z}from"../../lib/cart/shipping-status.js";import{DEFAULT_FINISH_COLOR as J}from"../../lib/wheels/finish-defaults.js";import O from"../ThemedSelect.js";import f from"../WebFormField.js";import Q from"../WheelSvg.js";import{useCheckout as N}from"./checkout-state.js";function xe(){const{email:t,setEmail:i,firstName:n,setFirstName:l,lastName:c,setLastName:s,me:p,checkoutSignOut:x}=N();return a(C,{num:"N° 01",title:"Contact",children:[e(f,{label:"Email",hint:p?a(y,{children:["Signed in ·"," ",e("button",{type:"button",onClick:x,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:e("input",{type:"email",value:t,onChange:m=>i(m.target.value),placeholder:"you@example.com",readOnly:p!==null,className:g+(p?" opacity-70":"")})}),a($,{children:[e(f,{label:"First name",children:e("input",{type:"text",value:n,onChange:m=>l(m.target.value),className:g})}),e(f,{label:"Last name",children:e("input",{type:"text",value:c,onChange:m=>s(m.target.value),className:g})})]})]})}function be(){const{pickupLocation:t,servedCountries:i,address1:n,setAddress1:l,address2:c,setAddress2:s,city:p,setCity:x,postcode:m,setPostcode:o,phone:d,setPhone:u,country:S,setCountry:v,subdivision:k,setSubdivision:h,subdivisions:A,destination:ne,postcodeLabel:R,subdivisionLabel:T,me:L,savedAddresses:F,selectedAddressId:j,setSelectedAddressId:B,saveAddress:E,setSaveAddress:Y,saveLabel:z,setSaveLabel:U,fillFromAddress:q}=N();return a(C,{num:"N° 02",title:t?"Collection":"Shipping address",children:[t?a("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[e("span",{className:"font-medium",children:t.name}),[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).length>0&&e("span",{className:"opacity-80",children:[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).join(", ")}),t.openingHours&&e("span",{className:"opacity-80",children:t.openingHours}),t.instructions&&e("span",{className:"opacity-80",children:t.instructions}),e("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):a(y,{children:[L!==null&&F.length>0&&a("div",{className:"grid gap-3",children:[F.map(r=>e(w,{active:j===r.id,onClick:()=>{B(r.id),q(r)},title:r.label,body:r.formatted_address,price:null},r.id)),e(w,{active:j==="new",onClick:()=>B("new"),title:"New address",body:null,price:null})]}),e(f,{label:"Address line 1",children:e("input",{type:"text",value:n,onChange:r=>l(r.target.value),className:g})}),e(f,{label:"Address line 2",children:e("input",{type:"text",value:c,onChange:r=>s(r.target.value),placeholder:"Apartment, unit, garage bay…",className:g})}),a($,{cols:"three",children:[e(f,{label:"City",children:e("input",{type:"text",value:p,onChange:r=>x(r.target.value),className:g})}),e(f,{label:R,children:e("input",{type:"text",value:m,onChange:r=>o(r.target.value),className:g})}),e(f,{label:"Country",separate:!0,children:e(O,{value:S,onChange:r=>v(r.target.value),className:g+" pr-10",style:I,children:i.map(r=>e("option",{value:r.code,children:r.name},r.code))})})]}),e(f,{label:T,separate:!0,children:A.length>0?a(O,{value:k,onChange:r=>h(r.target.value),className:g+" pr-10",style:I,children:[e("option",{value:"",children:"Select…"}),A.map(r=>e("option",{value:r.code||r.name,children:r.name},r.code||r.name))]}):e("input",{type:"text",value:k,onChange:r=>h(r.target.value),className:g})})]}),e(f,{label:"Phone",children:e("input",{type:"tel",value:d,onChange:r=>u(r.target.value),placeholder:"+44 7700 900000",className:g})}),!t&&L!==null&&j==="new"&&a(y,{children:[e(V,{checked:E,onChange:Y,label:"Save this address to my account"}),E&&e(f,{label:"Address label",children:e("input",{type:"text",value:z,onChange:r=>U(r.target.value),placeholder:"Home",className:g})})]})]})}function ye(){const{totals:t,coupon:i,deliveryOptions:n,shippingMethodId:l,setShippingMethodId:c,pickupLocation:s,formatMoney:p,city:x,destination:m}=N();return e(C,{num:"N° 03",title:"Shipping",children:a("div",{className:"grid gap-3",children:[n.map(o=>{const d=o.pickupLocation,u=d?[d.address,d.city,d.state,d.zipCode].filter(Boolean).join(", "):null;return e(w,{active:l===o.id,onClick:()=>c(o.id),title:d?`${o.name} — ${d.name}`:o.name,body:d?[u,d.openingHours,d.instructions,o.description].filter(Boolean).join(" · "):o.description||null,price:t.freeShipping||o.amount===0?_:p(o.amount,t.currency),tag:o.tag||void 0},o.id)}),n.length===0&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})})}function ve(){const{payChoice:t,setPayChoice:i,placing:n,payment:l,payOptions:c}=N();return a(C,{num:"N° 04",title:"Payment",children:[e("div",{className:"grid gap-3",children:c.map(s=>e(w,{active:t===s.key,onClick:()=>i(s.key),title:s.title,body:s.body,price:s.price,tag:s.tag},s.key))}),t==="card"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="paypal"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll approve the payment with PayPal on the payment step after placing the order."}):t==="afterpay"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):t==="square"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="gocardless"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):t==="zip"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Zip to approve four instalments, then brought straight back."}):t==="klarna"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Klarna to choose how to pay, then brought straight back."}):e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."})]})}function Ne(){const{site:t,items:i,totals:n,coupon:l,formatMoney:c,payChoice:s,placing:p,email:x,orderError:m,payment:o,placeOrder:d}=N();return a("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-[1100px]:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[a("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[e("span",{children:"Your order"}),e(P,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit ↗"})]}),e("div",{className:"flex flex-col px-6 py-2",children:i.length===0?a("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",e(P,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog →"})]}):i.map(u=>e(ee,{slug:u.slug,name:u.name,qty:u.qty,config:u.config,configSummary:te(u.config),price:D(u,n.currency)??0,currency:n.currency},u.id))}),e("div",{className:"border-t border-line px-6 pt-5",children:e(W,{customerEmail:x})}),a("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[e(b,{label:"Subtotal",value:c(n.subtotal,n.currency)}),n.discount>0&&l?.valid&&e(b,{label:`Coupon · ${l.code}`,value:a("span",{className:"font-semibold text-green",children:["− ",c(n.discount,n.currency)]})}),l?.deferred&&e(b,{label:`Coupon · ${l.code}`,value:K}),l?.valid&&l.effects?.gift&&e(b,{label:`Free gift · ${l.effects.gift.partNumber}${l.effects.gift.quantity>1?` ×${l.effects.gift.quantity}`:""}`,value:e("span",{className:"font-semibold text-green",children:_})}),e(b,{label:"Shipping",value:n.shippingStatus==="free"?e("span",{className:"font-semibold text-green",children:_}):X(n.shippingStatus)??c(n.shipping,n.currency)}),n.tax&&(n.tax.charged?e(b,{label:n.tax.inclusive?`${n.tax.name} included · ${n.tax.rate}%`:n.tax.name,value:c(n.tax.amount,n.currency)}):n.tax.name?e(b,{label:n.tax.name,value:Z}):null)]}),a("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[e("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),e("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:n.repricing?"…":c(n.grand,n.currency)})]}),a("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[m&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:m}),n.hasUnpricedLine&&a("p",{className:"border border-amber-300 bg-amber-50 px-3 py-2 text-[13px] text-amber-800",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),e("button",{type:"button",onClick:d,disabled:p||i.length===0||n.hasUnpricedLine||n.repricing,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",i.length===0||p||n.hasUnpricedLine||n.repricing?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:p?a(y,{children:["Building order… ",e("span",{children:"·"})]}):n.repricing?a(y,{children:["Updating total… ",e("span",{children:"·"})]}):a(y,{children:[s==="bank"?"Place order":"Continue to payment"," ·"," ",c(n.grand,n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})})]})]})}const g="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",I={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function C({num:t,title:i,children:n}){return a("section",{className:"mb-6 border border-line bg-bg",children:[a("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t}),e("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:i})]}),e("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function $({cols:t="two",children:i}){return e("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:i})}function w({active:t,onClick:i,title:n,body:l,price:c,tag:s}){return a("button",{type:"button",onClick:i,"aria-pressed":t,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",t?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&e("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&e("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),a("span",{className:"flex min-w-0 flex-col gap-1",children:[a("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,s&&e("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:s})]}),l&&e("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:l})]}),e("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:c})]})}function V({checked:t,onChange:i,label:n,sub:l}){return a("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[e("button",{type:"button",onClick:()=>i(!t),"aria-pressed":t,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",t?"border-accent":"border-line"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:t&&e("span",{className:"text-[13px] text-accent",children:"✓"})}),a("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,l&&e("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:l})]})]})}function ee({slug:t,name:i,qty:n,config:l,configSummary:c,price:s,currency:p}){const{catalog:x}=H(),{formatMoney:m}=G(),o=x.find(h=>h.slug===t),d=o?.spokes??5,u=o?.mesh??!1,S=l.find(h=>h.gold)?.label,v=o?.finishes.find(h=>h.name===S&&h.src)??o?.finishes.find(h=>h.src),k=o?.finishes[0]?.color??J;return a("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[a("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[e("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:n}),v?.src?e(M,{src:v.src,alt:`${i.lead}${i.accent} — ${v.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-2"}):e("div",{className:"block w-[78%]",style:{color:k},children:e(Q,{spokes:d,mesh:u,className:"block w-full"})})]}),a("div",{className:"flex min-w-0 flex-col gap-0.5",children:[a("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[i.lead,e("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:i.accent})]}),e("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:c})]}),e("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:m(s,p)})]})}function b({label:t,value:i}){return a("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[e("span",{children:t}),e("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:i})]})}function te(t){return t.map(i=>i.label).join(" · ")}export{xe as CheckoutContact,Ne as CheckoutOrderSummary,ve as CheckoutPayment,be as CheckoutShippingAddress,ye as CheckoutShippingMethod};
@@ -0,0 +1,169 @@
1
+ import { type SiteIdentity } from "../../lib/content/site.js";
2
+ import type { ShopAddress, ShopMe } from "../../lib/api/index.js";
3
+ import { type LandingOrder } from "../../lib/checkout/wallet-return.js";
4
+ type PayKey = "card" | "paypal" | "afterpay" | "square" | "gocardless" | "zip" | "klarna" | "bank";
5
+ interface PayOption {
6
+ key: PayKey;
7
+ title: React.ReactNode;
8
+ body: React.ReactNode;
9
+ price: React.ReactNode;
10
+ tag?: string;
11
+ }
12
+ export declare function buildPayOptions(site: SiteIdentity, { canParkContext, }?: {
13
+ canParkContext: boolean;
14
+ }): PayOption[];
15
+ export interface CheckoutProps {
16
+ site: SiteIdentity;
17
+ logo?: {
18
+ url: string | null;
19
+ reversed: string | null;
20
+ inkIsDark: boolean | null;
21
+ reverse: boolean;
22
+ size: "small" | "medium" | "large";
23
+ sizePx: number | null;
24
+ } | null;
25
+ preview?: boolean;
26
+ }
27
+ declare function useCheckoutState({ site, logo, preview }: CheckoutProps): {
28
+ site: SiteIdentity;
29
+ logo: {
30
+ url: string | null;
31
+ reversed: string | null;
32
+ inkIsDark: boolean | null;
33
+ reverse: boolean;
34
+ size: "small" | "medium" | "large";
35
+ sizePx: number | null;
36
+ } | null | undefined;
37
+ items: import("../CartContext.js").CartLine[];
38
+ totals: {
39
+ sets: number;
40
+ units: number;
41
+ subtotal: number;
42
+ hasUnpricedLine: boolean;
43
+ discount: number;
44
+ bundleDiscount: number;
45
+ appliedBundles: import("../../lib/api/index.js").AppliedBundle[];
46
+ shipping: number;
47
+ freeShipping: boolean;
48
+ shippingStatus: import("../../lib/cart/shipping-status.js").ShippingStatus;
49
+ freeUnitsByPartNumber: Record<string, number>;
50
+ tax: {
51
+ name: string;
52
+ rate: number;
53
+ amount: number;
54
+ inclusive: boolean;
55
+ charged: boolean;
56
+ } | null;
57
+ grand: number;
58
+ repricing: boolean;
59
+ currency: import("../../lib/api/index.js").Currency;
60
+ };
61
+ coupon: import("../CartContext.js").AppliedCoupon | null;
62
+ deliveryOptions: {
63
+ id: string;
64
+ name: string;
65
+ description: string;
66
+ tag: string;
67
+ amount: number;
68
+ methodType: "delivery" | "pickup";
69
+ pickupLocation: import("../../lib/api/types.js").components["schemas"]["PickupLocation"] | null;
70
+ }[];
71
+ shippingMethodId: string | null;
72
+ setShippingMethodId: (id: string) => void;
73
+ pickupLocation: {
74
+ id: string;
75
+ name: string;
76
+ address: string;
77
+ city: string;
78
+ state: string;
79
+ zipCode: string;
80
+ country: string;
81
+ openingHours: string;
82
+ instructions: string;
83
+ } | null;
84
+ servedCountries: import("../../lib/content/site.js").SiteCountry[];
85
+ formatMoney: (amount: number, currency?: string) => string;
86
+ payChoice: PayKey;
87
+ setPayChoice: import("react").Dispatch<import("react").SetStateAction<PayKey>>;
88
+ placing: boolean;
89
+ email: string;
90
+ setEmail: import("react").Dispatch<import("react").SetStateAction<string>>;
91
+ firstName: string;
92
+ setFirstName: import("react").Dispatch<import("react").SetStateAction<string>>;
93
+ lastName: string;
94
+ setLastName: import("react").Dispatch<import("react").SetStateAction<string>>;
95
+ address1: string;
96
+ setAddress1: import("react").Dispatch<import("react").SetStateAction<string>>;
97
+ address2: string;
98
+ setAddress2: import("react").Dispatch<import("react").SetStateAction<string>>;
99
+ city: string;
100
+ setCity: import("react").Dispatch<import("react").SetStateAction<string>>;
101
+ postcode: string;
102
+ setPostcode: import("react").Dispatch<import("react").SetStateAction<string>>;
103
+ phone: string;
104
+ setPhone: import("react").Dispatch<import("react").SetStateAction<string>>;
105
+ country: string;
106
+ setCountry: import("react").Dispatch<import("react").SetStateAction<string>>;
107
+ subdivision: string;
108
+ setSubdivision: import("react").Dispatch<import("react").SetStateAction<string>>;
109
+ subdivisions: {
110
+ code: string;
111
+ name: string;
112
+ divisionType: string;
113
+ }[];
114
+ destination: import("../../lib/content/site.js").SiteCountry | null;
115
+ postcodeLabel: string;
116
+ subdivisionLabel: string;
117
+ me: ShopMe | null;
118
+ savedAddresses: ShopAddress[];
119
+ selectedAddressId: string;
120
+ setSelectedAddressId: import("react").Dispatch<import("react").SetStateAction<string>>;
121
+ saveAddress: boolean;
122
+ setSaveAddress: import("react").Dispatch<import("react").SetStateAction<boolean>>;
123
+ saveLabel: string;
124
+ setSaveLabel: import("react").Dispatch<import("react").SetStateAction<string>>;
125
+ addressSaveNote: string | null;
126
+ idemKey: string;
127
+ confirmation: LandingOrder | null;
128
+ setConfirmation: import("react").Dispatch<import("react").SetStateAction<LandingOrder | null>>;
129
+ orderError: string | null;
130
+ payment: {
131
+ clientSecret: string;
132
+ publishableKey: string;
133
+ amount: string;
134
+ currency: string;
135
+ orderNumber: string;
136
+ } | null;
137
+ paypalStep: boolean;
138
+ squareStep: boolean;
139
+ pendingConf: {
140
+ orderNumber: string;
141
+ status: string;
142
+ total: string;
143
+ currency: string;
144
+ freightCharge: string;
145
+ discountAmount: string;
146
+ grandTotal: string;
147
+ shippingMethod?: string | null;
148
+ couponCode?: string | null;
149
+ } | null;
150
+ paid: boolean;
151
+ setPaid: import("react").Dispatch<import("react").SetStateAction<boolean>>;
152
+ payNote: string | null;
153
+ afterpayConfirming: boolean;
154
+ gocardlessConfirming: boolean;
155
+ zipConfirming: boolean;
156
+ klarnaConfirming: boolean;
157
+ checkoutRootRef: import("react").RefObject<HTMLDivElement | null>;
158
+ setCheckoutHeaderEl: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
159
+ fillFromAddress: (a: ShopAddress) => void;
160
+ checkoutSignOut: () => void;
161
+ payOptions: PayOption[];
162
+ placeOrder: () => Promise<void>;
163
+ };
164
+ export type CheckoutState = ReturnType<typeof useCheckoutState>;
165
+ export declare function CheckoutStateProvider({ children, ...props }: CheckoutProps & {
166
+ children: React.ReactNode;
167
+ }): import("react").JSX.Element;
168
+ export declare function useCheckout(): CheckoutState;
169
+ export {};