efficient-web-builder 0.8.1 → 0.9.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.
- package/CHANGELOG.md +80 -1
- package/README.md +24 -5
- package/dist/chunks/{EditorPreviewCheckout-RALICX2M.js → EditorPreviewCheckout-YVSO4HE3.js} +3 -3
- package/dist/chunks/PreviewFooter-34YJU76X.js +1 -0
- package/dist/chunks/SectionEditorShell-CVWJ6DSU.js +1 -0
- package/dist/chunks/{SiteEditorProvider-4NZYBEVE.js → SiteEditorProvider-ECGZVKLG.js} +1 -1
- package/dist/chunks/StorefrontEditorChrome-YKEMJT3Z.js +1 -0
- package/dist/chunks/chunk-2XX3N727.js +153 -0
- package/dist/chunks/chunk-6CP4D6VJ.js +1 -0
- package/dist/chunks/chunk-7QXLVNFD.js +1 -0
- package/dist/chunks/chunk-EKKAVQJX.js +1 -0
- package/dist/chunks/chunk-FU5UZ4UY.js +1 -0
- package/dist/chunks/chunk-J5WPJJCW.js +2 -0
- package/dist/chunks/{chunk-6VNEBJKI.js → chunk-MEIUD5LJ.js} +1 -1
- package/dist/chunks/chunk-N3IM4XBG.js +1 -0
- package/dist/chunks/chunk-RRHBLOH4.js +1 -0
- package/dist/chunks/chunk-TUB4O4RZ.js +15 -0
- package/dist/chunks/chunk-UM3P3PXW.js +230 -0
- package/dist/chunks/chunk-XQGZKQII.js +1 -0
- package/dist/chunks/fitment-data-6NXSKODX.js +1 -0
- package/dist/chunks/render-client-VMLB4BTY.js +1 -0
- package/dist/editor.css +1 -1
- package/dist/index.d.ts +184 -4
- package/dist/index.js +908 -644
- package/dist/links.js +1 -1
- package/package.json +2 -2
- package/dist/chunks/PreviewFooter-SNJQZ6JZ.js +0 -1
- package/dist/chunks/SectionEditorShell-U5FUJW2M.js +0 -1
- package/dist/chunks/StorefrontEditorChrome-6OQOFCL6.js +0 -1
- package/dist/chunks/chunk-4MT74TMP.js +0 -1
- package/dist/chunks/chunk-764WH3TY.js +0 -11
- package/dist/chunks/chunk-CZ46NWN5.js +0 -230
- package/dist/chunks/chunk-DN65SLZM.js +0 -1
- package/dist/chunks/chunk-KZIT3J33.js +0 -1
- package/dist/chunks/chunk-RTCXXI5U.js +0 -143
- package/dist/chunks/chunk-TX7ND7AF.js +0 -1
- package/dist/chunks/chunk-WQ7W4AXL.js +0 -15
- package/dist/chunks/chunk-XMRSKZIR.js +0 -2
- package/dist/chunks/fitment-data-6EHBA26C.js +0 -1
- package/dist/chunks/render-client-ISZ5CGAI.js +0 -1
- /package/dist/chunks/{chunk-RTCXXI5U.js.LEGAL.txt → chunk-2XX3N727.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-UBYBQ3KR.js → chunk-HVOO2GNE.js} +0 -0
- /package/dist/chunks/{chunk-WQ7W4AXL.js.LEGAL.txt → chunk-TUB4O4RZ.js.LEGAL.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 — 2026-10-07
|
|
4
|
+
|
|
5
|
+
- **The Product Grid title keeps its words in the canvas.** When the head row
|
|
6
|
+
is crowded (in the editor, an empty supporting line and link draw their
|
|
7
|
+
placeholders), the supporting line now truncates first, and the title, "View
|
|
8
|
+
all" and the count stay whole. Before, the title split inside its words at
|
|
9
|
+
912 wide. Published heads that are not crowded are unchanged.
|
|
10
|
+
|
|
11
|
+
- **Needs `efficient-easel` 0.100.0 or later** (peer `^0.100.0`, was
|
|
12
|
+
`^0.99.2`). 0.100 removes the deprecated `Editor…` names, which this package
|
|
13
|
+
no longer uses. The copy box's bar no longer draws the ◆ Emphasis button
|
|
14
|
+
(E5a), and the "press the highlighter" hint under four copy rows is gone with
|
|
15
|
+
it. Saved `==words==` still shows in the theme colour.
|
|
16
|
+
|
|
17
|
+
- **`backend.media.maxUploadBytes` — the media field's size cap is the
|
|
18
|
+
backend's.** An optional number on the `media` group: the largest file a
|
|
19
|
+
media field takes before handing it to the host's panel or picker. Without it
|
|
20
|
+
the editor refuses no file for its size. It was EFFICIENT's published cap,
|
|
21
|
+
applied to every host.
|
|
22
|
+
|
|
23
|
+
- **`backend.social` — the social links join the backend contract.** A new
|
|
24
|
+
optional group on `WebsiteBackend`: `social.get(scope?)` and
|
|
25
|
+
`social.update(patch, scope?)` over `SocialLinkSettings` — one address per
|
|
26
|
+
platform, under the platform's name. The editor's Social links rows read and
|
|
27
|
+
save through it and no longer call EFFICIENT's client.
|
|
28
|
+
- **`WebsiteBackendError.fields`.** An `invalid` rejection may name the inputs
|
|
29
|
+
it refused, each with the reason (`{ instagram: "Enter a valid URL." }`); the
|
|
30
|
+
editor shows it beside that input. `social.update` is the first to use it.
|
|
31
|
+
|
|
32
|
+
- **`backend.chat` — the live chat joins the backend contract.** A new optional
|
|
33
|
+
group on `WebsiteBackend`: `chat.get(scope?)` and `chat.update(patch, scope?)`
|
|
34
|
+
over `ChatSettings` (enabled, title, subtitle, greeting). The editor's Live
|
|
35
|
+
chat panel reads and saves through it and no longer calls EFFICIENT's client.
|
|
36
|
+
Under EFFICIENT's backend nothing changes.
|
|
37
|
+
|
|
38
|
+
- **`backend.pages.linkTargets` — the link picker's pages join the backend
|
|
39
|
+
contract.** A new optional method on the `pages` group: every page a link
|
|
40
|
+
may point at, as `LinkTargetPage`s (id, slug, the page's name, and its
|
|
41
|
+
layout), in one call. The link picker reads it for its "Page" and "Anchor"
|
|
42
|
+
targets and no longer calls EFFICIENT's client. A host's backend without it
|
|
43
|
+
still has its pages listed — from `pages.list` — with no section anchors.
|
|
44
|
+
Under EFFICIENT's backend nothing changes.
|
|
45
|
+
|
|
46
|
+
- **`backend.blog` — the website's blog joins the backend contract.** A new
|
|
47
|
+
optional group on `WebsiteBackend`: `blog.posts(scope?)` answers the
|
|
48
|
+
website's published posts as `BlogPostRow`s (slug, title, excerpt, category,
|
|
49
|
+
an absolute cover address, the publish date, and the post's own path). The
|
|
50
|
+
editor reads it in two places — a section's "Blog post source", and the link
|
|
51
|
+
picker's "Blog post" target — and no longer calls EFFICIENT's client for
|
|
52
|
+
either. A host that passes its own `backend` with a `blog` gets both; one
|
|
53
|
+
without gets what it had before: a block already linked to a post says so and
|
|
54
|
+
can only be unlinked, and the link picker offers no "Blog post". Under
|
|
55
|
+
EFFICIENT's backend (no `backend` passed, or `createEfficientBackend()`)
|
|
56
|
+
nothing changes.
|
|
57
|
+
|
|
58
|
+
- **The Visual sitemap is out of the editor.** The rail's "Visual sitemap"
|
|
59
|
+
button and the page-card overlay it opened are removed. A host that wants a
|
|
60
|
+
bird's-eye view of a website's pages draws its own, outside the editor:
|
|
61
|
+
EFFICIENT's admin shows it as the Sitemap section of its Storefront Console.
|
|
62
|
+
Nothing else in the rail moves, and no prop or host message changes
|
|
63
|
+
(`storefront-editor:open-page` and `storefront-editor:new-page` are still
|
|
64
|
+
sent by the Pages panel).
|
|
65
|
+
|
|
66
|
+
- **`backend.theme` — a website's appearance joins the backend contract.** A
|
|
67
|
+
new optional group on `WebsiteBackend`: `theme.get(scope?)` and
|
|
68
|
+
`theme.update(patch, scope?)` over `SiteThemeRow` — the row behind Site
|
|
69
|
+
styles, key for key as it is stored. The editor seeds its appearance and
|
|
70
|
+
saves every Site styles change through it and no longer calls EFFICIENT's
|
|
71
|
+
client. Site styles is now offered to ANY backend that has the group
|
|
72
|
+
(`hasSiteTheme` was EFFICIENT-only); one without it is unchanged.
|
|
73
|
+
|
|
3
74
|
## 0.8.1 — 2026-10-07
|
|
4
75
|
|
|
5
76
|
- **The held hero frame stays on screen.** A hero slide with a video and no
|
|
@@ -10,7 +81,8 @@
|
|
|
10
81
|
canvas, and the source video is dropped as soon as it is drawn.
|
|
11
82
|
|
|
12
83
|
A patch cut from 0.8.0 with this one fix (branch `release/web-builder-0.8.1`),
|
|
13
|
-
so it
|
|
84
|
+
so it did not carry the 0.9.0 changes above. The fix is on `main` too
|
|
85
|
+
(#1582), so 0.9.0 has it.
|
|
14
86
|
|
|
15
87
|
## 0.8.0 — 2026-10-06
|
|
16
88
|
|
|
@@ -48,6 +120,13 @@
|
|
|
48
120
|
to change; a host only needs 0.99.2 or later installed. Nothing an operator
|
|
49
121
|
sees changes.
|
|
50
122
|
|
|
123
|
+
- **One media panel head for both editors.** The Media panel's head is
|
|
124
|
+
efficient-easel's `MediaPanelHead`, the same head the campaign designer
|
|
125
|
+
draws over the same library (owner ruling 2026-10-06: a part exists once, in
|
|
126
|
+
efficient-easel). Nothing it says or does changed; the Cancel button's sides
|
|
127
|
+
are 12px (were 10px), on the spacing scale. Needs the efficient-easel release
|
|
128
|
+
that ships `MediaPanelHead`.
|
|
129
|
+
|
|
51
130
|
- **Grid cells fill their height in the canvas.** A block in a Grid cell now
|
|
52
131
|
stretches to the cell's height in the editor, as it does on the published
|
|
53
132
|
page. The canvas sheet (built from the storefront's `app/globals.css`) makes
|
package/README.md
CHANGED
|
@@ -96,11 +96,30 @@ const backend: WebsiteBackend = {
|
|
|
96
96
|
`layout` only; store the bundle anyway — `translations` and `seo` are where
|
|
97
97
|
per-language content will live, and an absent member means "leave it".
|
|
98
98
|
- **Not behind the interface yet** (they work under EFFICIENT's backend, and are
|
|
99
|
-
absent under yours): site styles, the pinned header and footer,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
absent under yours): site styles, the pinned header and footer, menus,
|
|
100
|
+
forms, the catalog, "duplicate to page". Block
|
|
101
|
+
settings that list such data (product link targets, product sources) list
|
|
102
|
+
nothing, and a Form section's picker is inert: it offers no list, no "New
|
|
103
|
+
form" and sends no `open-form`.
|
|
104
|
+
- **`backend.pages.linkTargets`** (optional): your pages with their layouts, for
|
|
105
|
+
the link picker. Without it the picker lists `pages.list` and no anchors.
|
|
106
|
+
- **`backend.media.maxUploadBytes`** (optional): the largest file a media field
|
|
107
|
+
takes before it reaches your panel or picker; leave it out to refuse none.
|
|
108
|
+
- **`backend.theme`** (optional): `get` / `update` the website's appearance —
|
|
109
|
+
the `SiteThemeRow` behind Site styles (colour themes, fonts and sizes,
|
|
110
|
+
corners, cards, widths). `update` is handed only the keys that changed and
|
|
111
|
+
answers the whole row. Without it the editor shows no Site styles and the
|
|
112
|
+
website is drawn in the built-in look.
|
|
113
|
+
- **`backend.social`** (optional): `get` / `update` the website's social links,
|
|
114
|
+
one address per platform name. Reject a bad address with
|
|
115
|
+
`new WebsiteBackendError("invalid", message, { fields: { instagram: "…" } })`
|
|
116
|
+
and the reason is shown beside that platform's box.
|
|
117
|
+
- **`backend.chat`** (optional): `get` / `update` the live-chat bubble's
|
|
118
|
+
settings. (The Live chat panel itself is still drawn only where the site's
|
|
119
|
+
settings are — EFFICIENT's backend — until those settings cross too.)
|
|
120
|
+
- **`backend.blog`** (optional): `posts(scope?)` answers your published posts.
|
|
121
|
+
With it a section's "Blog post source" and the link picker's "Blog post"
|
|
122
|
+
list your blog; without it neither offers a list.
|
|
104
123
|
- `backend` is read once, when the editor mounts — re-mount (a `key`) to change it.
|
|
105
124
|
|
|
106
125
|
## Which blocks the editor offers (0.7.0)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{F as qt,G as _t,H as Dt,I as se,J as we,K as Ft,L as Ut,M as Xe,N as Mt,P as Ze,V as Kt,Y as Qe,Z as $t,a as Ot,b as Lt,c as Tt,ca as Wt,d as jt,da as Yt,ea as Bt}from"./chunk-EKKAVQJX.js";import{i as _e,m as fe,t as T}from"./chunk-7QXLVNFD.js";import"./chunk-RRHBLOH4.js";import{Ka as It,a as Rt,c as ee}from"./chunk-FU5UZ4UY.js";import{t as At,u as Se,v as B}from"./chunk-6CP4D6VJ.js";import{a as Je,b as ar}from"./chunk-Y6SLVHK3.js";var Ht=Je((ea,zt)=>{"use strict";var or="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";zt.exports=or});var Xt=Je((ta,Jt)=>{"use strict";var ir=Ht();function Vt(){}function Gt(){}Gt.resetWarningCache=Vt;Jt.exports=function(){function t(a,o,s,l,d,p){if(p!==ir){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Gt,resetWarningCache:Vt};return n.PropTypes=n,n}});var Qt=Je((aa,Zt)=>{"use strict";Zt.exports=Xt()();var na,ra});import{useEffect as $,useMemo as Be,useRef as le,useState as g}from"react";var w=ar(Qt(),1);import x from"react";function en(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,a=Array(e);n<e;n++)a[n]=t[n];return a}function sr(t){if(Array.isArray(t))return t}function on(t,e,n){return(e=mr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cr(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a,o,s,l,d=[],p=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(p=(a=s.call(n)).done)&&(d.push(a.value),d.length!==e);p=!0);}catch(v){u=!0,o=v}finally{try{if(!p&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return d}}function lr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function nn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tn(Object(n),!0).forEach(function(a){on(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tn(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ur(t,e){if(t==null)return{};var n,a,o=pr(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)n=s[a],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function pr(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}function sn(t,e){return sr(t)||cr(t,e)||fr(t,e)||lr()}function dr(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mr(t){var e=dr(t,"string");return typeof e=="symbol"?e:e+""}function et(t){"@babel/helpers - typeof";return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(t)}function fr(t,e){if(t){if(typeof t=="string")return en(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?en(t,e):void 0}}var j=function(e,n,a){var o=!!a,s=x.useRef(a);x.useEffect(function(){s.current=a},[a]),x.useEffect(function(){if(!o||!e)return function(){};var l=function(){if(s.current)return s.current.apply(s,arguments)};return e.on(n,l),function(){e.off(n,l)}},[o,n,e,s])},tt=function(e){var n=x.useRef(e);return x.useEffect(function(){n.current=e},[e]),n.current},ge=function(e){return e!==null&&et(e)==="object"},gr=function(e){return ge(e)&&typeof e.then=="function"},yr=function(e){return ge(e)&&typeof e.elements=="function"&&typeof e.createToken=="function"&&typeof e.createPaymentMethod=="function"&&typeof e.confirmCardPayment=="function"},rn="[object Object]",hr=function t(e,n){if(!ge(e)||!ge(n))return e===n;var a=Array.isArray(e),o=Array.isArray(n);if(a!==o)return!1;var s=Object.prototype.toString.call(e)===rn,l=Object.prototype.toString.call(n)===rn;if(s!==l)return!1;if(!s&&!a)return e===n;var d=Object.keys(e),p=Object.keys(n);if(d.length!==p.length)return!1;for(var u={},v=0;v<d.length;v+=1)u[d[v]]=!0;for(var b=0;b<p.length;b+=1)u[p[b]]=!0;var m=Object.keys(u);if(m.length!==d.length)return!1;var h=e,A=n,k=function(S){return t(h[S],A[S])};return m.every(k)},cn=function(e,n,a){return ge(e)?Object.keys(e).reduce(function(o,s){var l=!ge(n)||!hr(e[s],n[s]);return a.includes(s)?(l&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),o):l?nn(nn({},o||{}),{},on({},s,e[s])):o},null):null},ln="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",an=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ln;if(e===null||yr(e))return e;throw new Error(n)},vr=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ln;if(gr(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(o){return an(o,n)})};var a=an(e,n);return a===null?{tag:"empty"}:{tag:"sync",stripe:a}},br=function(e){!e||!e._registerWrapper||!e.registerAppInfo||(e._registerWrapper({name:"react-stripe-js",version:"6.7.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.7.0",url:"https://stripe.com/docs/stripe-js/react"}))},De=x.createContext(null);De.displayName="ElementsContext";var un=function(e,n){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return e},rt=function(e){var n=e.stripe,a=e.options,o=e.children,s=x.useMemo(function(){return vr(n)},[n]),l=x.useState(function(){return{stripe:s.tag==="sync"?s.stripe:null,elements:s.tag==="sync"?s.stripe.elements(a):null}}),d=sn(l,2),p=d[0],u=d[1];x.useEffect(function(){var m=!0,h=function(k){u(function(C){return C.stripe?C:{stripe:k,elements:k.elements(a)}})};return s.tag==="async"&&!p.stripe?s.stripePromise.then(function(A){A&&m&&h(A)}):s.tag==="sync"&&!p.stripe&&h(s.stripe),function(){m=!1}},[s,p,a]);var v=tt(n);x.useEffect(function(){v!==null&&v!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[v,n]);var b=tt(a);return x.useEffect(function(){if(p.elements){var m=cn(a,b,["clientSecret","fonts"]);m&&p.elements.update(m)}},[a,b,p.elements]),x.useEffect(function(){br(p.stripe)},[p.stripe]),x.createElement(De.Provider,{value:p},o)};rt.propTypes={stripe:w.default.any,options:w.default.object};var pn=function(e){var n=x.useContext(De);return un(n,e)},dn=function(){var e=pn("calls useElements()"),n=e.elements;return n},xr=function(e){var n=e.children,a=pn("mounts <ElementsConsumer>");return n(a)};xr.propTypes={children:w.default.func.isRequired};var mn=x.createContext(null);mn.displayName="CheckoutContext";var nt=function(e){var n=x.useContext(mn),a=x.useContext(De);if(n){if(a)throw new Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."));return n}else return un(a,e)},kr=["mode"],Cr=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},R=function(e,n,a){var o="".concat(Cr(e),"Element"),s=function(u){var v=u.id,b=u.className,m=u.options,h=m===void 0?{}:m,A=u.onBlur,k=u.onFocus,C=u.onReady,S=u.onChange,F=u.onEscape,L=u.onClick,J=u.onLoadError,te=u.onLoaderStart,Ee=u.onNetworksChange,ue=u.onConfirm,Re=u.onCancel,ne=u.onShippingAddressChange,Ie=u.onShippingRateChange,re=u.onSavedPaymentMethodRemove,Ae=u.onSavedPaymentMethodUpdate,ye=u.onAvailablePaymentMethodsChange,ae=nt("mounts <".concat(o,">")),Q="elements"in ae?ae.elements:null,W="checkoutState"in ae?ae.checkoutState:null,H=W?.type==="success"||W?.type==="loading"?W.sdk:null,he=x.useState(null),pe=sn(he,2),E=pe[0],ve=pe[1],_=x.useRef(null),oe=x.useRef(null);j(E,"blur",A),j(E,"focus",k),j(E,"escape",F),j(E,"click",L),j(E,"loaderror",J),j(E,"loaderstart",te),j(E,"networkschange",Ee),j(E,"confirm",ue),j(E,"cancel",Re),j(E,"shippingaddresschange",ne),j(E,"shippingratechange",Ie),j(E,"savedpaymentmethodremove",re),j(E,"savedpaymentmethodupdate",Ae),j(E,"availablepaymentmethodschange",ye),j(E,"change",S);var ie;C&&(e==="expressCheckout"?ie=C:ie=function(){C(E)}),j(E,"ready",ie),x.useLayoutEffect(function(){if(_.current===null&&oe.current!==null&&(Q||H)){var P=null;if(H){var V=H,be=H;switch(e){case"paymentForm":P=be.createForm(h);break;case"payment":P=V.createPaymentElement(h);break;case"address":if("mode"in h){var de=h.mode,xe=ur(h,kr);if(de==="shipping")P=V.createShippingAddressElement(xe);else if(de==="billing")P=V.createBillingAddressElement(xe);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":P=V.createExpressCheckoutElement(h);break;case"currencySelector":P=H.createCurrencySelectorElement();break;case"taxId":P=V.createTaxIdElement(h);break;case"contactDetails":P=V.createContactDetailsElement();break;default:throw new Error("<".concat(o,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else Q&&(P=Q.create(e,h));_.current=P,ve(P),P&&P.mount(oe.current)}},[Q,H,h]);var Y=tt(h);return x.useEffect(function(){if(_.current){var P=cn(h,Y,["paymentRequest"]);P&&"update"in _.current&&_.current.update(P)}},[h,Y]),x.useLayoutEffect(function(){return function(){if(_.current&&typeof _.current.destroy=="function")try{_.current.destroy(),_.current=null}catch{}}},[]),x.createElement("div",{id:v,className:b,ref:oe})},l=function(u){nt("mounts <".concat(o,">"));var v=u.id,b=u.className;return x.createElement("div",{id:v,className:b})},d=n?l:s;return d.propTypes={id:w.default.string,className:w.default.string,onChange:w.default.func,onBlur:w.default.func,onFocus:w.default.func,onReady:w.default.func,onEscape:w.default.func,onClick:w.default.func,onLoadError:w.default.func,onLoaderStart:w.default.func,onNetworksChange:w.default.func,onConfirm:w.default.func,onCancel:w.default.func,onShippingAddressChange:w.default.func,onShippingRateChange:w.default.func,onSavedPaymentMethodRemove:w.default.func,onSavedPaymentMethodUpdate:w.default.func,onAvailablePaymentMethodsChange:w.default.func,options:w.default.object},d.displayName=o,d.__elementType=e,d},I=typeof window>"u",Sr=x.createContext(null);Sr.displayName="EmbeddedCheckoutProviderContext";var fn=function(){var e=nt("calls useStripe()"),n=e.stripe;return n},ia=R("auBankAccount",I),sa=R("card",I),ca=R("cardNumber",I),la=R("cardExpiry",I),ua=R("cardCvc",I),pa=R("currencySelector",I),da=R("iban",I),gn=R("payment",I),ma=R("expressCheckout",I),fa=R("paymentRequestButton",I),ga=R("linkAuthentication",I),ya=R("contactDetails",I),ha=R("address",I),va=R("shippingAddress",I),ba=R("paymentMethodMessaging",I),xa=R("taxId",I),ka=R("issuingCardNumberDisplay",I),Ca=R("issuingCardCvcDisplay",I),Sa=R("issuingCardExpiryDisplay",I),wa=R("issuingCardPinDisplay",I),Pa=R("issuingCardCopyButton",I);function Me(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Me=function(e){return typeof e}:Me=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(t)}var vn="dahlia",wr=function(e){return e===3?"v3":e},bn="https://js.stripe.com",Pr="".concat(bn,"/").concat(vn,"/stripe.js"),Nr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Er=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,yn="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Rr=function(e){return Nr.test(e)||Er.test(e)},Ir=function(){for(var e=document.querySelectorAll('script[src^="'.concat(bn,'"]')),n=0;n<e.length;n++){var a=e[n];if(Rr(a.src))return a}return null},hn=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",a=document.createElement("script");a.src="".concat(Pr).concat(n);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(a),a},Ar=function(e,n){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"9.9.0",startTime:n})},Pe=null,Fe=null,Ue=null,Or=function(e){return function(n){e(new Error("Failed to load Stripe.js",{cause:n}))}},Lr=function(e,n){return function(){window.Stripe?e(window.Stripe):n(new Error("Stripe.js not available"))}},Tr=function(e){return Pe!==null?Pe:(Pe=new Promise(function(n,a){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&e&&console.warn(yn),window.Stripe){n(window.Stripe);return}try{var o=Ir();if(o&&e)console.warn(yn);else if(!o)o=hn(e);else if(o&&Ue!==null&&Fe!==null){var s;o.removeEventListener("load",Ue),o.removeEventListener("error",Fe),(s=o.parentNode)===null||s===void 0||s.removeChild(o),o=hn(e)}Ue=Lr(n,a),Fe=Or(a),o.addEventListener("load",Ue),o.addEventListener("error",Fe)}catch(l){a(l);return}}),Pe.catch(function(n){return Pe=null,Promise.reject(n)}))},jr=function(e,n,a){if(e===null)return null;var o=n[0];if(typeof o!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(Me(o)," instead."));var s=o.match(/^pk_test/),l=wr(e.version),d=vn;s&&l!==d&&console.warn("Stripe.js@".concat(l," was loaded on the page, but @stripe/stripe-js@").concat("9.9.0"," expected Stripe.js@").concat(d,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var p=e.apply(void 0,n);return Ar(p,a),p},Ne,xn=!1,kn=function(){return Ne||(Ne=Tr(null).catch(function(e){return Ne=null,Promise.reject(e)}),Ne)};Promise.resolve().then(function(){return kn()}).catch(function(t){xn||console.warn(t)});var Cn=function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];xn=!0;var o=Date.now();return kn().then(function(s){return jr(s,n,o)})};var qr="sf:gclid",_r="sf:fbclid",Dr=2160*60*60*1e3;function Pn(){return typeof window<"u"}function Sn(t){let e=Se.getItem(t);if(!e)return"";try{let{v:n,t:a}=JSON.parse(e);return!n||typeof a!="number"||Date.now()-a>Dr?"":n}catch{return""}}function wn(t){if(!Pn())return"";let e=t.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),n=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return n?decodeURIComponent(n[1]):""}function Nn(){if(!Pn())return{};let t=Sn(qr),e=Sn(_r),n=wn("_fbp"),a=wn("_fbc");!a&&e&&(a=`fb.1.${Date.now()}.${e}`);let o={};return t&&(o.gclid=t),e&&(o.fbclid=e),n&&(o.fbp=n),a&&(o.fbc=a),o}var En="sf:meta-purchases",Fr=20;function In(){return typeof window>"u"||window.parent!==window}function Ur(...t){try{if(In()||typeof window.fbq!="function")return;window.fbq(...t)}catch{}}var Rn=new Set;function Mr(t){if(Rn.has(t))return!1;Rn.add(t);try{let e=JSON.parse(Se.getItem(En)??"[]");if(e.includes(t))return!1;Se.setItem(En,JSON.stringify([...e,t].slice(-Fr)))}catch{}return!0}function Kr(t){return[...new Set(t.filter(we).flatMap(e=>e.components.map(n=>n.partNumber)))]}function An(t){let e=t.confirmation;In()||!Mr(e.orderNumber)||Ur("track","Purchase",{value:Number(e.grandTotal),currency:e.currency,content_type:"product",content_ids:Kr(t.lines)},{eventID:e.orderNumber})}var at="checkout-afterpay-context",Ke="checkout-gocardless-context",ot="checkout-zip-context",$e="checkout-klarna-context";function $r({evidence:t,parked:e}){return t?{action:"capture",evidence:t,parked:e}:e?{action:"settle",parked:e}:{action:"ignore"}}function Wr(t,e){let n=t.getItem(e);if(t.removeItem(e),!n)return null;try{return JSON.parse(n)}catch{return null}}var On={name:"Afterpay",legParam:"afterpay",legValues:["confirm","cancel"],storageKey:at,evidenceFrom(t,e){return e==="cancel"||(t.get("status")??"").toUpperCase()==="CANCELLED"?null:t.get("orderToken")},requestFrom:t=>({token:t})},Ln={name:"Zip",legParam:"zip",legValues:["return"],storageKey:ot,evidenceFrom(t){let e=(t.get("result")??"").toLowerCase();return e==="cancelled"||e==="declined"?null:t.get("checkoutId")},requestFrom:t=>({checkoutId:t})};async function it(t,e){let n=new URLSearchParams(e.search),a=n.get(t.legParam);if(!a||!t.legValues.includes(a))return;let o=Wr(e.storage,t.storageKey),s=t.evidenceFrom(n,a);e.scrubQuery();let l=$r({evidence:s,parked:o});if(l.action!=="ignore"){if(e.page.clearCart(),l.action==="settle"){e.page.note(`The ${t.name} payment was not completed \u2014 our team will follow up on payment.`),e.page.land(l.parked.confirmation);return}e.page.setConfirming(!0);try{let d=await e.capture(t.requestFrom(l.evidence));d.status==="paid"?e.page.markPaid():e.page.note(`${t.name} declined the payment \u2014 our team will follow up on payment.`),e.page.land(l.parked?.confirmation??d)}catch{l.parked?(e.page.note(`We could not confirm the ${t.name} payment \u2014 our team will follow up on payment.`),e.page.land(l.parked.confirmation)):e.page.fail(`We could not confirm your ${t.name} payment. Please contact us before trying again \u2014 your payment may already have been taken.`)}finally{e.page.setConfirming(!1)}}}import{Fragment as q,jsx as r,jsxs as c}from"react/jsx-runtime";function Tn(t){let e=t.indexOf(`
|
|
3
|
-
`);return e===-1?[t,""]:[t.slice(0,e),t.slice(e+1)]}function jn(t,{canParkContext:e}={canParkContext:!0}){let n=t.paymentMethods,a=[];return n.includes("card")&&a.push({key:"card",title:"Card",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("paypal")&&t.paypalClientId&&a.push({key:"paypal",title:"PayPal",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL \xB7 CARDS"})}),n.includes("afterpay")&&a.push({key:"afterpay",title:"Afterpay",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 \xD7 INTEREST-FREE"})}),n.includes("square")&&t.squareApplicationId&&t.squareLocationId&&a.push({key:"square",title:"Card (Square)",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("gocardless")&&e&&a.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),n.includes("zip")&&a.push({key:"zip",title:"Zip",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),n.includes("klarna")&&e&&a.push({key:"klarna",title:"Klarna",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),a.push({key:"bank",title:"Bank transfer",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),a}function lt({site:t,logo:e,preview:n=!1}){let{items:a,totals:o,coupon:s,refuseCoupon:l,deliveryOptions:d,shippingMethodId:p,setShippingMethodId:u,identify:v,clearCapturedCart:b}=Xe(),m=d.find(i=>i.id===p)?.pickupLocation??null,{country:h,countries:A,activeCountry:k,formatMoney:C}=se(),[S,F]=g(()=>jn(t)[0].key),[L,J]=g(!0);$(()=>{J(
|
|
4
|
-
${H.trim()}`:Q;async function nr(){if(n||ue||a.length===0||o.repricing)return;let i=a.filter(we).flatMap(f=>At(f.components,f.qty));if(i.length===0){ke("Pick a size on each wheel's product page before checking out.");return}Re(!0),ke(null);try{let y=await(X?T.createOrderAuthed:T.createOrder)({customer:{email:ne,name:`${re} ${ye}`.trim(),phone:oe.trim()||void 0,address:Nt,city:pe,state:V||void 0,zipCode:ve,country:Y},items:i,currency:o.currency,idempotencyKey:U,shippingMethodId:p??void 0,couponCode:Tt(s),...Nn()});if(_t({confirmation:y,lines:a,adsSendTo:t.googleAdsId&&t.googleAdsConversionLabel?`${t.googleAdsId}/${t.googleAdsConversionLabel}`:null}),An({confirmation:y,lines:a}),b(),X&&He&&Oe==="new")try{await fe.createAddress({label:ft.trim()||"Home",contact_name:`${re} ${ye}`.trim(),phone:oe.trim(),address:Nt,city:pe,zip_code:ve,country:Y}),yt("Address saved to your account.")}catch{yt("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}if(S==="card"&&t.paymentMethods.includes("card")){let N=await T.createPaymentIntent({idempotencyKey:U});Ve(y),Wn(N)}else if(S==="paypal"&&t.paymentMethods.includes("paypal"))Ve(y),Bn(!0);else if(S==="afterpay"&&t.paymentMethods.includes("afterpay")){let N=window.location.origin,O=await T.createAfterpayCheckout({idempotencyKey:U,confirmUrl:`${N}/checkout?afterpay=confirm`,cancelUrl:`${N}/checkout?afterpay=cancel`}),D={idempotencyKey:U,confirmation:y};B.setItem(at,JSON.stringify(D)),window.location.assign(O.redirectCheckoutUrl);return}else if(S==="square"&&t.paymentMethods.includes("square"))Ve(y),Hn(!0);else if(S==="gocardless"&&t.paymentMethods.includes("gocardless")){let N=window.location.origin,O=await T.createGocardlessBillingRequest({idempotencyKey:U,confirmUrl:`${N}/checkout?gocardless=confirm`,cancelUrl:`${N}/checkout?gocardless=cancel`}),D={idempotencyKey:U,confirmation:y};B.setItem(Ke,JSON.stringify(D)),window.location.assign(O.authorisationUrl);return}else if(S==="zip"&&t.paymentMethods.includes("zip")){let N=window.location.origin,O=await T.createZipCheckout({idempotencyKey:U,redirectUrl:`${N}/checkout?zip=return`}),D={idempotencyKey:U,confirmation:y};B.setItem(ot,JSON.stringify(D)),window.location.assign(O.redirectUrl);return}else if(S==="klarna"&&t.paymentMethods.includes("klarna")){let N=window.location.origin,O=await T.createKlarnaCheckout({idempotencyKey:U,confirmUrl:`${N}/checkout?klarna=confirm`,cancelUrl:`${N}/checkout?klarna=cancel`}),D={idempotencyKey:U,confirmation:y};B.setItem($e,JSON.stringify(D)),window.location.assign(O.redirectUrl);return}else M(y)}catch(f){let y=jt(f);y?(l(y),ke(`${y} Your order has not been placed. Place it again to continue without the code.`)):ke(f instanceof _e?f.message:"Could not place the order. Please try again."),Re(!1)}}return Te?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:bt?"Payment received":"Order received"}),c("p",{className:"text-fg-dim",children:[bt?c(q,{children:["Thank you \u2014 your payment for order"," ",r("span",{className:"font-mono text-fg",children:Te.orderNumber})," has gone through."," "]}):c(q,{children:["Thank you \u2014 your order ",r("span",{className:"font-mono text-fg",children:Te.orderNumber})," is being reviewed by our team."," "]}),X?c(q,{children:["Track it under"," ",r(ee,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):r(q,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),xt&&r("p",{className:"text-sm text-fg-dim",children:xt}),gt&&r("p",{className:"text-sm text-fg-dim",children:gt}),!X&&c("p",{className:"text-sm text-fg-dim",children:["You can also"," ",r(ee,{href:`/track?order=${encodeURIComponent(Te.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),r(ee,{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"})]}):Vn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):Jn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):Xn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):Qn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):vt?r(Yr,{payment:vt,onPaid:()=>{me(!0),M(G)},onSkip:()=>M(G)}):Yn&&G?r(Hr,{confirmation:G,clientId:t.paypalClientId??"",idemKey:U,onPaid:()=>{me(!0),M(G)},onSkip:()=>M(G)}):zn&&G?r(Gr,{confirmation:G,applicationId:t.squareApplicationId??"",locationId:t.squareLocationId??"",environment:t.squareEnvironment??"production",idemKey:U,onPaid:()=>{me(!0),M(G)},onSkip:()=>M(G)}):c("div",{ref:wt,className:"bg-bg text-fg",children:[c("header",{ref:er,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-[22px] 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:[c(ee,{href:"/",className:"inline-flex items-center gap-2.5 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",r("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),r(ee,{href:"/","aria-label":`${t.name} home`,className:"inline-flex items-center justify-center",children:r(Mt,{variant:"header",scrolled:!0,src:e?.url??null,reverse:e?.reverse??!1,reversedSrc:e?.reversed??null,inkIsDark:e?.inkIsDark??null,size:e?.size??"medium",sizePx:e?.sizePx??null,siteName:t.name})}),t.cardPayments?c("span",{className:"flex items-center justify-end gap-2.5 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[r("span",{className:"text-green",children:"\u25CF"}),r("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):r("span",{})]}),c("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:[r("span",{className:"inline-flex items-center bg-accent px-2.5 py-1 font-bold text-bg",children:"Checkout"}),r("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:"Review",state:"pending"},{n:"04",label:"Confirmed",state:"pending"}].map(i=>c("span",{className:["relative flex items-center gap-2 transition-colors",i.state==="pending"?"text-fg-dim":"text-fg",i.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[r("span",{className:i.state==="done"?"text-accent font-bold":"",children:i.n}),r("span",{children:i.label})]},i.n))})]}),c("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-9 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:[c("div",{children:[c(We,{num:"N\xB0 01",title:"Contact",children:[r(z,{label:"Email",hint:X?c(q,{children:["Signed in \xB7"," ",r("button",{type:"button",onClick:tr,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:r("input",{type:"email",value:ne,onChange:i=>Ie(i.target.value),placeholder:"you@example.com",readOnly:X!==null,className:K+(X?" opacity-70":"")})}),c(_n,{children:[r(z,{label:"First name",children:r("input",{type:"text",value:re,onChange:i=>Ae(i.target.value),className:K})}),r(z,{label:"Last name",children:r("input",{type:"text",value:ye,onChange:i=>ae(i.target.value),className:K})})]})]}),c(We,{num:"N\xB0 02",title:m?"Collection":"Shipping address",children:[m?c("div",{className:"grid gap-1.5 text-[14px] leading-[1.6]",children:[r("span",{className:"font-medium",children:m.name}),[m.address,m.city,m.state,m.zipCode,m.country].filter(Boolean).length>0&&r("span",{className:"opacity-80",children:[m.address,m.city,m.state,m.zipCode,m.country].filter(Boolean).join(", ")}),m.openingHours&&r("span",{className:"opacity-80",children:m.openingHours}),m.instructions&&r("span",{className:"opacity-80",children:m.instructions}),r("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):c(q,{children:[X!==null&&pt.length>0&&c("div",{className:"grid gap-2.5",children:[pt.map(i=>r(Ye,{active:Oe===i.id,onClick:()=>{Le(i.id),Pt(i)},title:i.label,body:i.formatted_address,price:null},i.id)),r(Ye,{active:Oe==="new",onClick:()=>Le("new"),title:"New address",body:null,price:null})]}),r(z,{label:"Address line 1",children:r("input",{type:"text",value:Q,onChange:i=>W(i.target.value),className:K})}),r(z,{label:"Address line 2",children:r("input",{type:"text",value:H,onChange:i=>he(i.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:K})}),c(_n,{cols:"three",children:[r(z,{label:"City",children:r("input",{type:"text",value:pe,onChange:i=>E(i.target.value),className:K})}),r(z,{label:Mn,children:r("input",{type:"text",value:ve,onChange:i=>_(i.target.value),className:K})}),r(z,{label:"Country",children:r(Ze,{value:Y,onChange:i=>P(i.target.value),className:K+" pr-10",style:qn,children:A.map(i=>r("option",{value:i.code,children:i.name},i.code))})})]}),r(z,{label:Kn,children:de.length>0?c(Ze,{value:V,onChange:i=>be(i.target.value),className:K+" pr-10",style:qn,children:[r("option",{value:"",children:"Select\u2026"}),de.map(i=>r("option",{value:i.code||i.name,children:i.name},i.code||i.name))]}):r("input",{type:"text",value:V,onChange:i=>be(i.target.value),className:K})})]}),r(z,{label:"Phone",children:r("input",{type:"tel",value:oe,onChange:i=>ie(i.target.value),placeholder:"+44 7700 900000",className:K})}),!m&&X!==null&&Oe==="new"&&c(q,{children:[r(Un,{checked:He,onChange:mt,label:"Save this address to my account"}),He&&r(z,{label:"Address label",children:r("input",{type:"text",value:ft,onChange:i=>$n(i.target.value),placeholder:"Home",className:K})})]}),!m&&r(Un,{checked:te,onChange:Ee,label:"Billing address is the same as shipping"})]}),r(We,{num:"N\xB0 03",title:"Shipping",children:c("div",{className:"grid gap-2.5",children:[d.map(i=>{let f=i.pickupLocation,y=f?[f.address,f.city,f.state,f.zipCode].filter(Boolean).join(", "):null;return r(Ye,{active:p===i.id,onClick:()=>u(i.id),title:f?`${i.name} \u2014 ${f.name}`:i.name,body:f?[y,f.openingHours,f.instructions,i.description].filter(Boolean).join(" \xB7 "):i.description||null,price:o.freeShipping||i.amount===0?"Free":C(i.amount,o.currency),tag:i.tag||void 0},i.id)}),d.length===0&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})}),c(We,{num:"N\xB0 04",title:"Payment",children:[r("div",{className:"grid gap-2.5",children:qe.map(i=>r(Ye,{active:S===i.key,onClick:()=>F(i.key),title:i.title,body:i.body,price:i.price,tag:i.tag},i.key))}),S==="card"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):S==="paypal"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll approve the payment with PayPal on the payment step after placing the order."}):S==="afterpay"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):S==="square"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):S==="gocardless"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):S==="zip"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Zip to approve four instalments, then brought straight back."}):S==="klarna"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Klarna to choose how to pay, then brought straight back."}):r("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."})]})]}),c("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(--surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[c("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-3.5 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[r("span",{children:"Your order"}),r(ee,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit \u2197"})]}),r("div",{className:"flex flex-col px-6 py-2",children:a.length===0?c("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",r(ee,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):a.map(i=>r(Jr,{slug:i.slug,name:i.name,qty:i.qty,config:i.config,configSummary:Xr(i.config),price:Dt(i,o.currency)??0,currency:o.currency},i.id))}),r("div",{className:"border-t border-line px-6 pt-5",children:r(Yt,{customerEmail:ne})}),c("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[r(ce,{label:"Subtotal",value:C(o.subtotal,o.currency)}),o.discount>0&&s?.valid&&r(ce,{label:`Coupon \xB7 ${s.code}`,value:c("span",{className:"font-semibold text-green",children:["\u2212 ",C(o.discount,o.currency)]})}),s?.deferred&&r(ce,{label:`Coupon \xB7 ${s.code}`,value:Lt}),s?.valid&&s.effects?.gift&&r(ce,{label:`Free gift \xB7 ${s.effects.gift.partNumber}${s.effects.gift.quantity>1?` \xD7${s.effects.gift.quantity}`:""}`,value:r("span",{className:"font-semibold text-green",children:"Free"})}),r(ce,{label:"Shipping",value:o.freeShipping||o.shipping===0?r("span",{className:"font-semibold text-green",children:"Free"}):C(o.shipping,o.currency)}),o.tax&&(o.tax.charged?r(ce,{label:o.tax.inclusive?`${o.tax.name} included \xB7 ${o.tax.rate}%`:o.tax.name,value:C(o.tax.amount,o.currency)}):o.tax.name?r(ce,{label:o.tax.name,value:"Calculated at checkout"}):null)]}),c("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:[r("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),r("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:o.repricing?"\u2026":C(o.grand,o.currency)})]}),c("div",{className:"flex flex-col gap-2.5 px-6 pt-[18px] pb-6",children:[ht&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:ht}),o.hasUnpricedLine&&c("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 ",o.currency,". Remove them, or switch region, to continue."]}),r("button",{type:"button",onClick:nr,disabled:ue||a.length===0||o.hasUnpricedLine||o.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",a.length===0||ue||o.hasUnpricedLine||o.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:ue?c(q,{children:["Building order\u2026 ",r("span",{children:"\xB7"})]}):o.repricing?c(q,{children:["Updating total\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:[S==="bank"?"Place order":"Continue to payment"," \xB7"," ",C(o.grand,o.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})})]})]})]}),r("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:r("span",{children:Kt({legalName:t.legalName,foundedYear:t.foundedYear,siteName:t.name})})})]})}var K="w-full border-2 border-line bg-bg px-4 py-3.5 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",qn={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 We({num:t,title:e,children:n}){return c("section",{className:"mb-6 border border-line bg-bg",children:[c("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t}),r("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:e})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function _n({cols:t="two",children:e}){return r("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:e})}function z({label:t,hint:e,children:n}){return c("div",{className:"relative flex flex-col gap-2",children:[r("label",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-fg",children:t}),n,e&&r("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:e})]})}function Ye({active:t,onClick:e,title:n,body:a,price:o,tag:s}){return c("button",{type:"button",onClick:e,"aria-pressed":t,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-[18px] border bg-bg px-[22px] py-[18px] 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(--line))]"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&r("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),r("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&r("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),c("span",{className:"flex min-w-0 flex-col gap-1",children:[c("span",{className:"flex flex-wrap items-baseline gap-2.5 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,s&&r("span",{className:"border px-1.5 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(--line))"},children:s})]}),a&&r("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:a})]}),r("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:o})]})}function Yr({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=se(),o=Be(()=>Cn(t.publishableKey),[t.publishableKey]),s=Be(()=>{if(typeof document>"u")return;let l=getComputedStyle(document.documentElement),d=(u,v)=>l.getPropertyValue(u).trim()||v,p=document.documentElement.getAttribute("data-theme")!=="light";return{theme:p?"night":"stripe",variables:{colorPrimary:d("--accent",p?"#c9a461":"#8a6a2a"),colorBackground:d("--surface",p?"#131313":"#ffffff"),colorText:d("--fg",p?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:a(Number(t.amount),t.currency)})," ","by card to confirm it now."]}),r(rt,{stripe:o,options:{clientSecret:t.clientSecret,appearance:s},children:r(Br,{payment:t,onPaid:e,onSkip:n})})]})]})})}function Br({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=se(),o=fn(),s=dn(),[l,d]=g(!1),[p,u]=g(null);async function v(){if(!o||!s||l)return;d(!0),u(null);let b=await o.confirmPayment({elements:s,redirect:"if_required"});if(b.error){u(b.error.message??"Payment failed. Please try again."),d(!1);return}let m=b.paymentIntent?.status;if(m==="succeeded"||m==="processing"){e();return}u("Payment did not complete. Please try again."),d(!1)}return c("div",{className:"flex flex-col gap-4",children:[r(gn,{}),p&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:p}),r("button",{type:"button",onClick:v,disabled:!o||!s||l,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!o||!s||l?"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:l?c(q,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:["Pay ",a(Number(t.amount),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:n,disabled:l,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 \u2014 our team will be in touch"})]})}var Dn="paypal-sdk-js",st=null;function zr(t,e){let n=`${t}|${e}`;if(st?.key===n)return st.promise;let a=new Promise((o,s)=>{document.getElementById(Dn)?.remove();let l=document.createElement("script");l.id=Dn;let d=new URLSearchParams({"client-id":t,currency:e,intent:"capture"});l.src=`https://www.paypal.com/sdk/js?${d}`,l.onload=()=>{let p=window.paypal;p?o(p):s(new Error("PayPal SDK loaded without its namespace"))},l.onerror=()=>s(new Error("PayPal SDK failed to load")),document.head.appendChild(l)});return st={key:n,promise:a},a}function Hr({confirmation:t,clientId:e,idemKey:n,onPaid:a,onSkip:o}){let{formatMoney:s}=se(),l=le(null),[d,p]=g(!1),[u,v]=g(null),b=le(a);return b.current=a,$(()=>{let m=!1,h=null;return zr(e,t.currency).then(A=>{if(!(m||!l.current))return h=A.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await T.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async k=>{try{if((await T.capturePaypalOrder({idempotencyKey:n,paypalOrderId:k.orderID})).status==="paid"){b.current();return}v("PayPal did not complete the payment. Please try again.")}catch(C){v(C instanceof _e?C.message:"PayPal payment failed. Please try again.")}},onError:()=>{v("PayPal could not process the payment. Please try again.")}}),h.render(l.current).then(()=>{m||p(!0)})}).catch(()=>{m||v("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{m=!0,h?.close?.()}},[e,t.currency,n]),r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:s(Number(t.grandTotal),t.currency)})," ","with PayPal to confirm it now."]}),!d&&!u&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),r("div",{ref:l}),u&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:u}),r("button",{type:"button",onClick:o,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 \u2014 our team will be in touch"})]})]})})}var Fn="square-web-sdk",ct=null;function Vr(t){let e=t==="sandbox"?"sandbox":"production";if(ct?.key===e)return ct.promise;let n=new Promise((a,o)=>{document.getElementById(Fn)?.remove();let s=document.createElement("script");s.id=Fn,s.src=e==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",s.onload=()=>{let l=window.Square;l?a(l):o(new Error("Square SDK loaded without its namespace"))},s.onerror=()=>o(new Error("Square SDK failed to load")),document.head.appendChild(s)});return ct={key:e,promise:n},n}function Gr({confirmation:t,applicationId:e,locationId:n,environment:a,idemKey:o,onPaid:s,onSkip:l}){let{formatMoney:d}=se(),p=le(null),u=le(null),v=le(null),[b,m]=g(!1),[h,A]=g(!1),[k,C]=g(null);$(()=>{let F=!1,L=null;return Vr(a).then(async J=>{if(F||!p.current)return;let te=J.payments(e,n);v.current=te,L=await te.card(),await L.attach(p.current),u.current=L,F||m(!0)}).catch(()=>{F||C("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{F=!0,L?.destroy?.()}},[e,n,a]);async function S(){let F=u.current;if(!(!F||h)){A(!0),C(null);try{let L=await F.tokenize();if(L.status!=="OK"||!L.token){C(L.errors?.[0]?.message??"Please check the card details and try again."),A(!1);return}let J;try{J=(await v.current?.verifyBuyer?.(L.token,{amount:String(t.grandTotal),currencyCode:t.currency,intent:"CHARGE"}))?.token}catch{}if((await T.chargeSquare({idempotencyKey:o,sourceId:L.token,...J?{verificationToken:J}:{}})).status==="paid"){s();return}C("Square did not complete the payment. Please try again.")}catch(L){C(L instanceof _e?L.message:"Square payment failed. Please try again.")}A(!1)}}return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:d(Number(t.grandTotal),t.currency)})," ","by card to confirm it now."]}),!b&&!k&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),r("div",{ref:p}),k&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:k}),r("button",{type:"button",onClick:S,disabled:!b||h,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!b||h?"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:h?c(q,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:["Pay ",d(Number(t.grandTotal),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:l,disabled:h,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 \u2014 our team will be in touch"})]})]})})}function Un({checked:t,onChange:e,label:n,sub:a}){return c("div",{className:"flex items-start gap-3 border-t border-line py-3.5 first:border-t-0 first:pt-0",children:[r("button",{type:"button",onClick:()=>e(!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&&r("span",{className:"text-[13px] text-accent",children:"\u2713"})}),c("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,a&&r("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:a})]})]})}function Jr({slug:t,name:e,qty:n,config:a,configSummary:o,price:s,currency:l}){let{catalog:d}=Xe(),{formatMoney:p}=se(),u=d.find(k=>k.slug===t),v=u?.spokes??5,b=u?.mesh??!1,m=a.find(k=>k.gold)?.label,h=u?.finishes.find(k=>k.name===m&&k.src)??u?.finishes.find(k=>k.src),A=u?.finishes[0]?.color??Ut;return c("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-3.5 border-b border-line py-4 last:border-b-0",children:[c("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[r("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}),h?.src?r(It,{src:h.src,alt:`${e.lead}${e.accent} \u2014 ${h.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-1.5"}):r("div",{className:"block w-[78%]",style:{color:A},children:r(Wt,{spokes:v,mesh:b,className:"block w-full"})})]}),c("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[e.lead,r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:e.accent})]}),r("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:o})]}),r("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:p(s,l)})]})}function ce({label:t,value:e}){return c("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[r("span",{children:t}),r("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:e})]})}function Xr(t){return t.map(e=>e.label).join(" \xB7 ")}import{jsx as ze}from"react/jsx-runtime";function Zr(){let{settings:t,websiteName:e}=$t(),n=e?{...Qe,name:e}:Qe,a=t?{url:t.logoUrl,reversed:t.logoReversed??null,inkIsDark:t.logoInkIsDark??null,reverse:t.reverseLogo,size:t.logoSize,sizePx:t.logoSizePx}:null;return ze("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:ze(Ot,{children:ze(Ft,{preview:!0,children:ze(lt,{site:n,logo:a,preview:!0})})})})}export{Zr as default};
|
|
3
|
+
`);return e===-1?[t,""]:[t.slice(0,e),t.slice(e+1)]}function jn(t,{canParkContext:e}={canParkContext:!0}){let n=t.paymentMethods,a=[];return n.includes("card")&&a.push({key:"card",title:"Card",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("paypal")&&t.paypalClientId&&a.push({key:"paypal",title:"PayPal",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL \xB7 CARDS"})}),n.includes("afterpay")&&a.push({key:"afterpay",title:"Afterpay",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 \xD7 INTEREST-FREE"})}),n.includes("square")&&t.squareApplicationId&&t.squareLocationId&&a.push({key:"square",title:"Card (Square)",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("gocardless")&&e&&a.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),n.includes("zip")&&a.push({key:"zip",title:"Zip",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),n.includes("klarna")&&e&&a.push({key:"klarna",title:"Klarna",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),a.push({key:"bank",title:"Bank transfer",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),a}function lt({site:t,logo:e,preview:n=!1}){let{items:a,totals:o,coupon:s,refuseCoupon:l,deliveryOptions:d,shippingMethodId:p,setShippingMethodId:u,identify:v,clearCapturedCart:b}=Xe(),m=d.find(i=>i.id===p)?.pickupLocation??null,{country:h,countries:A,activeCountry:k,formatMoney:C}=se(),[S,F]=g(()=>jn(t)[0].key),[L,J]=g(!0);$(()=>{J(At(B))},[]);let[te,Ee]=g(!0),[ue,Re]=g(!1),[ne,Ie]=g(""),[re,Ae]=g(""),[ye,ae]=g(""),[Q,W]=g(""),[H,he]=g(""),[pe,E]=g(""),[ve,_]=g(""),[oe,ie]=g(""),[Y,P]=g(()=>h||A[0]?.code||""),[V,be]=g(""),[de,xe]=g([]),Mn=Be(()=>A.find(i=>i.code===Y)??k,[A,Y,k])?.postalLabel||"Postal Code",Kn=de[0]?.divisionType||"State / Province";$(()=>{if(!Y){xe([]);return}let i=!1;return T.listCountrySubdivisions(Y).then(f=>{i||(xe(f),be(""))}),()=>{i=!0}},[Y]);let[X,ut]=g(null),[pt,dt]=g([]),[Oe,Le]=g("new"),[He,mt]=g(!1),[ft,$n]=g("Home"),[gt,yt]=g(null),[U]=g(()=>Bt()),[Te,M]=g(null),[ht,ke]=g(null),[vt,Wn]=g(null),[Yn,Bn]=g(!1),[zn,Hn]=g(!1),[G,Ve]=g(null),[bt,me]=g(!1),[xt,Z]=g(null),[Vn,Gn]=g(!1),[Jn,kt]=g(!1),[Xn,Zn]=g(!1),[Qn,Ct]=g(!1),St=le(!1);$(()=>{n||St.current||!a.some(we)||(St.current=!0,qt({lines:a,currency:o.currency,value:o.subtotal-o.discount,coupon:s?.valid?s.code:void 0}))},[a,o,s,n]),$(()=>{v(ne,re.trim()||void 0)},[ne,re,v]);let wt=le(null),[je,er]=g(null);$(()=>{let i=wt.current;if(!je||!i)return;let f=()=>i.style.setProperty("--sf-checkout-header-h",`${je.offsetHeight}px`);f();let y=new ResizeObserver(f);return y.observe(je),()=>y.disconnect()},[je]),$(()=>{let i=y=>({setConfirming:y,land:M,markPaid:()=>me(!0),note:Z,fail:ke,clearCart:b}),f={search:window.location.search,storage:B,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};it(On,{...f,capture:T.captureAfterpayPayment,page:i(Gn)}),it(Ln,{...f,capture:T.captureZipPayment,page:i(Zn)})},[]),$(()=>{let f=new URLSearchParams(window.location.search).get("gocardless");if(f!=="confirm"&&f!=="cancel")return;let y=B.getItem(Ke);if(B.removeItem(Ke),window.history.replaceState(null,"",window.location.pathname),!y)return;let N;try{N=JSON.parse(y)}catch{return}if(b(),f==="cancel"){Z("The direct debit was not set up \u2014 our team will follow up on payment."),M(N.confirmation);return}kt(!0),T.completeGocardlessPayment({idempotencyKey:N.idempotencyKey}).then(O=>{O.status==="paid"?me(!0):O.status==="declined"?Z("The direct debit was declined \u2014 our team will follow up on payment."):Z("Your direct debit is set up \u2014 the payment is collecting and will clear in a few days.")}).catch(()=>{Z("We could not confirm the direct debit \u2014 our team will follow up on payment.")}).finally(()=>{M(N.confirmation),kt(!1)})},[]),$(()=>{let i=new URLSearchParams(window.location.search),f=i.get("klarna");if(f!=="confirm"&&f!=="cancel")return;let y=B.getItem($e);B.removeItem($e);let N=i.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!y)return;let O;try{O=JSON.parse(y)}catch{return}if(b(),f==="cancel"||!N){Z("The Klarna payment was not completed \u2014 our team will follow up on payment."),M(O.confirmation);return}Ct(!0),T.captureKlarnaPayment({idempotencyKey:O.idempotencyKey,authorizationToken:N}).then(D=>{D.status==="paid"?me(!0):D.status==="declined"?Z("Klarna declined the payment \u2014 our team will follow up on payment."):Z("Your Klarna payment is being reviewed \u2014 we'll confirm the outcome shortly.")}).catch(()=>{Z("We could not confirm the Klarna payment \u2014 our team will follow up on payment.")}).finally(()=>{M(O.confirmation),Ct(!1)})},[]);function Pt(i){let[f,y]=Tn(i.address);W(f),he(y),E(i.city),_(i.zip_code),i.country&&P(i.country),i.phone&&ie(i.phone)}$(()=>{let i=!1;return(async()=>{try{let[f,y,N]=await Promise.all([fe.me(),fe.myProfile().catch(()=>null),fe.myAddresses().catch(()=>[])]);if(i)return;ut(f);let O=N.filter(Ce=>Ce.is_active);dt(O),Ie(f.email);let D=(y?.contact_name??"").split(/\s+/);Ae(f.first_name||D[0]||""),ae(f.last_name||D.slice(1).join(" "));let Et=f.phone||y?.phone;Et&&ie(Et);let Ge=O.find(Ce=>Ce.id===f.default_delivery_location)??O[0];if(Ge)Le(Ge.id),Pt(Ge);else if(y){let[Ce,rr]=Tn(y.address??"");W(Ce),he(rr),E(y.city??""),_(y.zip_code??""),y.country&&P(y.country)}}catch{}})(),()=>{i=!0}},[]);function tr(){fe.logout(),ut(null),dt([]),Le("new"),mt(!1)}let qe=Be(()=>jn(t,{canParkContext:L}),[t,L]);$(()=>{qe.some(i=>i.key===S)||F(qe[0].key)},[qe,S]);let Nt=H.trim()?`${Q}
|
|
4
|
+
${H.trim()}`:Q;async function nr(){if(n||ue||a.length===0||o.repricing)return;let i=a.filter(we).flatMap(f=>jt(f.components,f.qty));if(i.length===0){ke("Pick a size on each wheel's product page before checking out.");return}Re(!0),ke(null);try{let y=await(X?T.createOrderAuthed:T.createOrder)({customer:{email:ne,name:`${re} ${ye}`.trim(),phone:oe.trim()||void 0,address:Nt,city:pe,state:V||void 0,zipCode:ve,country:Y},items:i,currency:o.currency,idempotencyKey:U,shippingMethodId:p??void 0,couponCode:Lt(s),...Nn()});if(_t({confirmation:y,lines:a,adsSendTo:t.googleAdsId&&t.googleAdsConversionLabel?`${t.googleAdsId}/${t.googleAdsConversionLabel}`:null}),An({confirmation:y,lines:a}),b(),X&&He&&Oe==="new")try{await fe.createAddress({label:ft.trim()||"Home",contact_name:`${re} ${ye}`.trim(),phone:oe.trim(),address:Nt,city:pe,zip_code:ve,country:Y}),yt("Address saved to your account.")}catch{yt("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}if(S==="card"&&t.paymentMethods.includes("card")){let N=await T.createPaymentIntent({idempotencyKey:U});Ve(y),Wn(N)}else if(S==="paypal"&&t.paymentMethods.includes("paypal"))Ve(y),Bn(!0);else if(S==="afterpay"&&t.paymentMethods.includes("afterpay")){let N=window.location.origin,O=await T.createAfterpayCheckout({idempotencyKey:U,confirmUrl:`${N}/checkout?afterpay=confirm`,cancelUrl:`${N}/checkout?afterpay=cancel`}),D={idempotencyKey:U,confirmation:y};B.setItem(at,JSON.stringify(D)),window.location.assign(O.redirectCheckoutUrl);return}else if(S==="square"&&t.paymentMethods.includes("square"))Ve(y),Hn(!0);else if(S==="gocardless"&&t.paymentMethods.includes("gocardless")){let N=window.location.origin,O=await T.createGocardlessBillingRequest({idempotencyKey:U,confirmUrl:`${N}/checkout?gocardless=confirm`,cancelUrl:`${N}/checkout?gocardless=cancel`}),D={idempotencyKey:U,confirmation:y};B.setItem(Ke,JSON.stringify(D)),window.location.assign(O.authorisationUrl);return}else if(S==="zip"&&t.paymentMethods.includes("zip")){let N=window.location.origin,O=await T.createZipCheckout({idempotencyKey:U,redirectUrl:`${N}/checkout?zip=return`}),D={idempotencyKey:U,confirmation:y};B.setItem(ot,JSON.stringify(D)),window.location.assign(O.redirectUrl);return}else if(S==="klarna"&&t.paymentMethods.includes("klarna")){let N=window.location.origin,O=await T.createKlarnaCheckout({idempotencyKey:U,confirmUrl:`${N}/checkout?klarna=confirm`,cancelUrl:`${N}/checkout?klarna=cancel`}),D={idempotencyKey:U,confirmation:y};B.setItem($e,JSON.stringify(D)),window.location.assign(O.redirectUrl);return}else M(y)}catch(f){let y=Tt(f);y?(l(y),ke(`${y} Your order has not been placed. Place it again to continue without the code.`)):ke(f instanceof _e?f.message:"Could not place the order. Please try again."),Re(!1)}}return Te?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:bt?"Payment received":"Order received"}),c("p",{className:"text-fg-dim",children:[bt?c(q,{children:["Thank you \u2014 your payment for order"," ",r("span",{className:"font-mono text-fg",children:Te.orderNumber})," has gone through."," "]}):c(q,{children:["Thank you \u2014 your order ",r("span",{className:"font-mono text-fg",children:Te.orderNumber})," is being reviewed by our team."," "]}),X?c(q,{children:["Track it under"," ",r(ee,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):r(q,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),xt&&r("p",{className:"text-sm text-fg-dim",children:xt}),gt&&r("p",{className:"text-sm text-fg-dim",children:gt}),!X&&c("p",{className:"text-sm text-fg-dim",children:["You can also"," ",r(ee,{href:`/track?order=${encodeURIComponent(Te.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),r(ee,{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"})]}):Vn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):Jn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):Xn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):Qn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):vt?r(Yr,{payment:vt,onPaid:()=>{me(!0),M(G)},onSkip:()=>M(G)}):Yn&&G?r(Hr,{confirmation:G,clientId:t.paypalClientId??"",idemKey:U,onPaid:()=>{me(!0),M(G)},onSkip:()=>M(G)}):zn&&G?r(Gr,{confirmation:G,applicationId:t.squareApplicationId??"",locationId:t.squareLocationId??"",environment:t.squareEnvironment??"production",idemKey:U,onPaid:()=>{me(!0),M(G)},onSkip:()=>M(G)}):c("div",{ref:wt,className:"bg-bg text-fg",children:[c("header",{ref:er,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-[22px] 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:[c(ee,{href:"/",className:"inline-flex items-center gap-2.5 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",r("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),r(ee,{href:"/","aria-label":`${t.name} home`,className:"inline-flex items-center justify-center",children:r(Kt,{variant:"header",scrolled:!0,src:e?.url??null,reverse:e?.reverse??!1,reversedSrc:e?.reversed??null,inkIsDark:e?.inkIsDark??null,size:e?.size??"medium",sizePx:e?.sizePx??null,siteName:t.name})}),t.cardPayments?c("span",{className:"flex items-center justify-end gap-2.5 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[r("span",{className:"text-green",children:"\u25CF"}),r("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):r("span",{})]}),c("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:[r("span",{className:"inline-flex items-center bg-accent px-2.5 py-1 font-bold text-bg",children:"Checkout"}),r("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:"Review",state:"pending"},{n:"04",label:"Confirmed",state:"pending"}].map(i=>c("span",{className:["relative flex items-center gap-2 transition-colors",i.state==="pending"?"text-fg-dim":"text-fg",i.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[r("span",{className:i.state==="done"?"text-accent font-bold":"",children:i.n}),r("span",{children:i.label})]},i.n))})]}),c("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-9 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:[c("div",{children:[c(We,{num:"N\xB0 01",title:"Contact",children:[r(z,{label:"Email",hint:X?c(q,{children:["Signed in \xB7"," ",r("button",{type:"button",onClick:tr,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:r("input",{type:"email",value:ne,onChange:i=>Ie(i.target.value),placeholder:"you@example.com",readOnly:X!==null,className:K+(X?" opacity-70":"")})}),c(_n,{children:[r(z,{label:"First name",children:r("input",{type:"text",value:re,onChange:i=>Ae(i.target.value),className:K})}),r(z,{label:"Last name",children:r("input",{type:"text",value:ye,onChange:i=>ae(i.target.value),className:K})})]})]}),c(We,{num:"N\xB0 02",title:m?"Collection":"Shipping address",children:[m?c("div",{className:"grid gap-1.5 text-[14px] leading-[1.6]",children:[r("span",{className:"font-medium",children:m.name}),[m.address,m.city,m.state,m.zipCode,m.country].filter(Boolean).length>0&&r("span",{className:"opacity-80",children:[m.address,m.city,m.state,m.zipCode,m.country].filter(Boolean).join(", ")}),m.openingHours&&r("span",{className:"opacity-80",children:m.openingHours}),m.instructions&&r("span",{className:"opacity-80",children:m.instructions}),r("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):c(q,{children:[X!==null&&pt.length>0&&c("div",{className:"grid gap-2.5",children:[pt.map(i=>r(Ye,{active:Oe===i.id,onClick:()=>{Le(i.id),Pt(i)},title:i.label,body:i.formatted_address,price:null},i.id)),r(Ye,{active:Oe==="new",onClick:()=>Le("new"),title:"New address",body:null,price:null})]}),r(z,{label:"Address line 1",children:r("input",{type:"text",value:Q,onChange:i=>W(i.target.value),className:K})}),r(z,{label:"Address line 2",children:r("input",{type:"text",value:H,onChange:i=>he(i.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:K})}),c(_n,{cols:"three",children:[r(z,{label:"City",children:r("input",{type:"text",value:pe,onChange:i=>E(i.target.value),className:K})}),r(z,{label:Mn,children:r("input",{type:"text",value:ve,onChange:i=>_(i.target.value),className:K})}),r(z,{label:"Country",children:r(Qe,{value:Y,onChange:i=>P(i.target.value),className:K+" pr-10",style:qn,children:A.map(i=>r("option",{value:i.code,children:i.name},i.code))})})]}),r(z,{label:Kn,children:de.length>0?c(Qe,{value:V,onChange:i=>be(i.target.value),className:K+" pr-10",style:qn,children:[r("option",{value:"",children:"Select\u2026"}),de.map(i=>r("option",{value:i.code||i.name,children:i.name},i.code||i.name))]}):r("input",{type:"text",value:V,onChange:i=>be(i.target.value),className:K})})]}),r(z,{label:"Phone",children:r("input",{type:"tel",value:oe,onChange:i=>ie(i.target.value),placeholder:"+44 7700 900000",className:K})}),!m&&X!==null&&Oe==="new"&&c(q,{children:[r(Un,{checked:He,onChange:mt,label:"Save this address to my account"}),He&&r(z,{label:"Address label",children:r("input",{type:"text",value:ft,onChange:i=>$n(i.target.value),placeholder:"Home",className:K})})]}),!m&&r(Un,{checked:te,onChange:Ee,label:"Billing address is the same as shipping"})]}),r(We,{num:"N\xB0 03",title:"Shipping",children:c("div",{className:"grid gap-2.5",children:[d.map(i=>{let f=i.pickupLocation,y=f?[f.address,f.city,f.state,f.zipCode].filter(Boolean).join(", "):null;return r(Ye,{active:p===i.id,onClick:()=>u(i.id),title:f?`${i.name} \u2014 ${f.name}`:i.name,body:f?[y,f.openingHours,f.instructions,i.description].filter(Boolean).join(" \xB7 "):i.description||null,price:o.freeShipping||i.amount===0?"Free":C(i.amount,o.currency),tag:i.tag||void 0},i.id)}),d.length===0&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})}),c(We,{num:"N\xB0 04",title:"Payment",children:[r("div",{className:"grid gap-2.5",children:qe.map(i=>r(Ye,{active:S===i.key,onClick:()=>F(i.key),title:i.title,body:i.body,price:i.price,tag:i.tag},i.key))}),S==="card"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):S==="paypal"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll approve the payment with PayPal on the payment step after placing the order."}):S==="afterpay"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):S==="square"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):S==="gocardless"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):S==="zip"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Zip to approve four instalments, then brought straight back."}):S==="klarna"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Klarna to choose how to pay, then brought straight back."}):r("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."})]})]}),c("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(--surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[c("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-3.5 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[r("span",{children:"Your order"}),r(ee,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit \u2197"})]}),r("div",{className:"flex flex-col px-6 py-2",children:a.length===0?c("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",r(ee,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):a.map(i=>r(Jr,{slug:i.slug,name:i.name,qty:i.qty,config:i.config,configSummary:Xr(i.config),price:Ft(i,o.currency)??0,currency:o.currency},i.id))}),r("div",{className:"border-t border-line px-6 pt-5",children:r(Yt,{customerEmail:ne})}),c("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[r(ce,{label:"Subtotal",value:C(o.subtotal,o.currency)}),o.discount>0&&s?.valid&&r(ce,{label:`Coupon \xB7 ${s.code}`,value:c("span",{className:"font-semibold text-green",children:["\u2212 ",C(o.discount,o.currency)]})}),s?.deferred&&r(ce,{label:`Coupon \xB7 ${s.code}`,value:Ot}),s?.valid&&s.effects?.gift&&r(ce,{label:`Free gift \xB7 ${s.effects.gift.partNumber}${s.effects.gift.quantity>1?` \xD7${s.effects.gift.quantity}`:""}`,value:r("span",{className:"font-semibold text-green",children:"Free"})}),r(ce,{label:"Shipping",value:o.freeShipping||o.shipping===0?r("span",{className:"font-semibold text-green",children:"Free"}):C(o.shipping,o.currency)}),o.tax&&(o.tax.charged?r(ce,{label:o.tax.inclusive?`${o.tax.name} included \xB7 ${o.tax.rate}%`:o.tax.name,value:C(o.tax.amount,o.currency)}):o.tax.name?r(ce,{label:o.tax.name,value:"Calculated at checkout"}):null)]}),c("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:[r("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),r("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:o.repricing?"\u2026":C(o.grand,o.currency)})]}),c("div",{className:"flex flex-col gap-2.5 px-6 pt-[18px] pb-6",children:[ht&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:ht}),o.hasUnpricedLine&&c("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 ",o.currency,". Remove them, or switch region, to continue."]}),r("button",{type:"button",onClick:nr,disabled:ue||a.length===0||o.hasUnpricedLine||o.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",a.length===0||ue||o.hasUnpricedLine||o.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:ue?c(q,{children:["Building order\u2026 ",r("span",{children:"\xB7"})]}):o.repricing?c(q,{children:["Updating total\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:[S==="bank"?"Place order":"Continue to payment"," \xB7"," ",C(o.grand,o.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})})]})]})]}),r("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:r("span",{children:Mt({legalName:t.legalName,foundedYear:t.foundedYear,siteName:t.name})})})]})}var K="w-full border-2 border-line bg-bg px-4 py-3.5 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",qn={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 We({num:t,title:e,children:n}){return c("section",{className:"mb-6 border border-line bg-bg",children:[c("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t}),r("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:e})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function _n({cols:t="two",children:e}){return r("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:e})}function z({label:t,hint:e,children:n}){return c("div",{className:"relative flex flex-col gap-2",children:[r("label",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-fg",children:t}),n,e&&r("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:e})]})}function Ye({active:t,onClick:e,title:n,body:a,price:o,tag:s}){return c("button",{type:"button",onClick:e,"aria-pressed":t,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-[18px] border bg-bg px-[22px] py-[18px] 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(--line))]"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&r("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),r("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&r("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),c("span",{className:"flex min-w-0 flex-col gap-1",children:[c("span",{className:"flex flex-wrap items-baseline gap-2.5 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,s&&r("span",{className:"border px-1.5 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(--line))"},children:s})]}),a&&r("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:a})]}),r("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:o})]})}function Yr({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=se(),o=Be(()=>Cn(t.publishableKey),[t.publishableKey]),s=Be(()=>{if(typeof document>"u")return;let l=getComputedStyle(document.documentElement),d=(u,v)=>l.getPropertyValue(u).trim()||v,p=document.documentElement.getAttribute("data-theme")!=="light";return{theme:p?"night":"stripe",variables:{colorPrimary:d("--accent",p?"#c9a461":"#8a6a2a"),colorBackground:d("--surface",p?"#131313":"#ffffff"),colorText:d("--fg",p?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:a(Number(t.amount),t.currency)})," ","by card to confirm it now."]}),r(rt,{stripe:o,options:{clientSecret:t.clientSecret,appearance:s},children:r(Br,{payment:t,onPaid:e,onSkip:n})})]})]})})}function Br({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=se(),o=fn(),s=dn(),[l,d]=g(!1),[p,u]=g(null);async function v(){if(!o||!s||l)return;d(!0),u(null);let b=await o.confirmPayment({elements:s,redirect:"if_required"});if(b.error){u(b.error.message??"Payment failed. Please try again."),d(!1);return}let m=b.paymentIntent?.status;if(m==="succeeded"||m==="processing"){e();return}u("Payment did not complete. Please try again."),d(!1)}return c("div",{className:"flex flex-col gap-4",children:[r(gn,{}),p&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:p}),r("button",{type:"button",onClick:v,disabled:!o||!s||l,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!o||!s||l?"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:l?c(q,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:["Pay ",a(Number(t.amount),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:n,disabled:l,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 \u2014 our team will be in touch"})]})}var Dn="paypal-sdk-js",st=null;function zr(t,e){let n=`${t}|${e}`;if(st?.key===n)return st.promise;let a=new Promise((o,s)=>{document.getElementById(Dn)?.remove();let l=document.createElement("script");l.id=Dn;let d=new URLSearchParams({"client-id":t,currency:e,intent:"capture"});l.src=`https://www.paypal.com/sdk/js?${d}`,l.onload=()=>{let p=window.paypal;p?o(p):s(new Error("PayPal SDK loaded without its namespace"))},l.onerror=()=>s(new Error("PayPal SDK failed to load")),document.head.appendChild(l)});return st={key:n,promise:a},a}function Hr({confirmation:t,clientId:e,idemKey:n,onPaid:a,onSkip:o}){let{formatMoney:s}=se(),l=le(null),[d,p]=g(!1),[u,v]=g(null),b=le(a);return b.current=a,$(()=>{let m=!1,h=null;return zr(e,t.currency).then(A=>{if(!(m||!l.current))return h=A.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await T.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async k=>{try{if((await T.capturePaypalOrder({idempotencyKey:n,paypalOrderId:k.orderID})).status==="paid"){b.current();return}v("PayPal did not complete the payment. Please try again.")}catch(C){v(C instanceof _e?C.message:"PayPal payment failed. Please try again.")}},onError:()=>{v("PayPal could not process the payment. Please try again.")}}),h.render(l.current).then(()=>{m||p(!0)})}).catch(()=>{m||v("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{m=!0,h?.close?.()}},[e,t.currency,n]),r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:s(Number(t.grandTotal),t.currency)})," ","with PayPal to confirm it now."]}),!d&&!u&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),r("div",{ref:l}),u&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:u}),r("button",{type:"button",onClick:o,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 \u2014 our team will be in touch"})]})]})})}var Fn="square-web-sdk",ct=null;function Vr(t){let e=t==="sandbox"?"sandbox":"production";if(ct?.key===e)return ct.promise;let n=new Promise((a,o)=>{document.getElementById(Fn)?.remove();let s=document.createElement("script");s.id=Fn,s.src=e==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",s.onload=()=>{let l=window.Square;l?a(l):o(new Error("Square SDK loaded without its namespace"))},s.onerror=()=>o(new Error("Square SDK failed to load")),document.head.appendChild(s)});return ct={key:e,promise:n},n}function Gr({confirmation:t,applicationId:e,locationId:n,environment:a,idemKey:o,onPaid:s,onSkip:l}){let{formatMoney:d}=se(),p=le(null),u=le(null),v=le(null),[b,m]=g(!1),[h,A]=g(!1),[k,C]=g(null);$(()=>{let F=!1,L=null;return Vr(a).then(async J=>{if(F||!p.current)return;let te=J.payments(e,n);v.current=te,L=await te.card(),await L.attach(p.current),u.current=L,F||m(!0)}).catch(()=>{F||C("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{F=!0,L?.destroy?.()}},[e,n,a]);async function S(){let F=u.current;if(!(!F||h)){A(!0),C(null);try{let L=await F.tokenize();if(L.status!=="OK"||!L.token){C(L.errors?.[0]?.message??"Please check the card details and try again."),A(!1);return}let J;try{J=(await v.current?.verifyBuyer?.(L.token,{amount:String(t.grandTotal),currencyCode:t.currency,intent:"CHARGE"}))?.token}catch{}if((await T.chargeSquare({idempotencyKey:o,sourceId:L.token,...J?{verificationToken:J}:{}})).status==="paid"){s();return}C("Square did not complete the payment. Please try again.")}catch(L){C(L instanceof _e?L.message:"Square payment failed. Please try again.")}A(!1)}}return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-3.5",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-2.5 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:d(Number(t.grandTotal),t.currency)})," ","by card to confirm it now."]}),!b&&!k&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),r("div",{ref:p}),k&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:k}),r("button",{type:"button",onClick:S,disabled:!b||h,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!b||h?"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:h?c(q,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:["Pay ",d(Number(t.grandTotal),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:l,disabled:h,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 \u2014 our team will be in touch"})]})]})})}function Un({checked:t,onChange:e,label:n,sub:a}){return c("div",{className:"flex items-start gap-3 border-t border-line py-3.5 first:border-t-0 first:pt-0",children:[r("button",{type:"button",onClick:()=>e(!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&&r("span",{className:"text-[13px] text-accent",children:"\u2713"})}),c("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,a&&r("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:a})]})]})}function Jr({slug:t,name:e,qty:n,config:a,configSummary:o,price:s,currency:l}){let{catalog:d}=Xe(),{formatMoney:p}=se(),u=d.find(k=>k.slug===t),v=u?.spokes??5,b=u?.mesh??!1,m=a.find(k=>k.gold)?.label,h=u?.finishes.find(k=>k.name===m&&k.src)??u?.finishes.find(k=>k.src),A=u?.finishes[0]?.color??$t;return c("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-3.5 border-b border-line py-4 last:border-b-0",children:[c("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[r("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}),h?.src?r(Rt,{src:h.src,alt:`${e.lead}${e.accent} \u2014 ${h.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-1.5"}):r("div",{className:"block w-[78%]",style:{color:A},children:r(Wt,{spokes:v,mesh:b,className:"block w-full"})})]}),c("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[e.lead,r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:e.accent})]}),r("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:o})]}),r("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:p(s,l)})]})}function ce({label:t,value:e}){return c("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[r("span",{children:t}),r("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:e})]})}function Xr(t){return t.map(e=>e.label).join(" \xB7 ")}import{jsx as ze}from"react/jsx-runtime";function Zr(){let{settings:t,websiteName:e}=It(),n=e?{...Ze,name:e}:Ze,a=t?{url:t.logoUrl,reversed:t.logoReversed??null,inkIsDark:t.logoInkIsDark??null,reverse:t.reverseLogo,size:t.logoSize,sizePx:t.logoSizePx}:null;return ze("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:ze(Dt,{children:ze(Ut,{preview:!0,children:ze(lt,{site:n,logo:a,preview:!0})})})})}export{Zr as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{W as m}from"./chunk-2XX3N727.js";import{i as c}from"./chunk-J5WPJJCW.js";import"./chunk-MEIUD5LJ.js";import{Ec as u,dd as d}from"./chunk-TUB4O4RZ.js";import"./chunk-HVOO2GNE.js";import"./chunk-EKKAVQJX.js";import"./chunk-7QXLVNFD.js";import"./chunk-RRHBLOH4.js";import{Ha as s,Ka as a,La as f,Pa as g}from"./chunk-FU5UZ4UY.js";import"./chunk-6CP4D6VJ.js";import"./chunk-Y6SLVHK3.js";import{Render as I}from"efficient-easel/render";import{jsx as p}from"react/jsx-runtime";function i({footerBlock:r,rootProps:e,headerSettings:o,siteName:t,legalName:l,foundedYear:n,socialLinks:h}){let v=d({root:{props:{...e??{},kind:u}},content:[r],zones:{}});return p(s.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:t,legalName:l??null,foundedYear:n??null,socialLinks:h??g},children:p(I,{config:m,data:v})})}import{jsx as k}from"react/jsx-runtime";function P(){let{footerBlock:r,editFooter:e}=c(),{settings:o,websiteName:t}=a();if(!r)return null;let l=o?{logoUrl:o.logoUrl,logoReversed:o.logoReversed??null,logoInkIsDark:o.logoInkIsDark??null}:null;return k("div",{className:"sf-preview-footer-pick",onClick:e?n=>{n.stopPropagation(),e()}:void 0,style:e?{cursor:"pointer"}:void 0,title:e?"Edit the site footer \u2192":void 0,children:k(i,{footerBlock:r,headerSettings:l,siteName:t?.trim()||f})})}export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as xe}from"./chunk-MEIUD5LJ.js";import{e as be,g as Pe,k as we,m as f,n as w,o as Ee,r as Ce,s as Ie,u as Re,v as Me}from"./chunk-UM3P3PXW.js";import{g as v,h as _}from"./chunk-XQGZKQII.js";import{$c as ge,Ih as he,K as de,Kh as E,Mh as Ae,N as pe,P as me,Q as ue,Zc as fe,ad as ye,fd as ke,h as ae,od as Se,tg as Te,vg as ve,xg as P}from"./chunk-TUB4O4RZ.js";import"./chunk-HVOO2GNE.js";import"./chunk-FU5UZ4UY.js";import"./chunk-6CP4D6VJ.js";import"./chunk-Y6SLVHK3.js";import{Fragment as Ne,useCallback as je,useEffect as x,useRef as Le,useState as Oe}from"react";import{SaveState as Ze}from"efficient-easel/chrome";import{parseZoneKey as N,zoneKey as et}from"efficient-easel/data";import{useTreeDrag as tt}from"efficient-easel/drag";import{TrashIcon as $e}from"efficient-easel/icons";import{LayersTree as ot,Subtree as Be,TreeRow as L,TreeRowAction as ze,TreeSeam as nt}from"efficient-easel/tree";import{saveIndicator as rt}from"efficient-easel/autosave";import{useEasel as st}from"efficient-easel/easel";import{Fragment as De,jsx as n,jsxs as k}from"react/jsx-runtime";var O=$=>C=>{C.target.closest(".es-tree-select, button")||$()};function it(){let{saveState:$,readOnly:C}=ke(),i=Se(),{appState:Fe,selectedItem:b,config:B}=st(e=>e),[T,c]=Oe(f),[K,W]=Oe(null),r=Fe.data.content?.[0]??null,g=r?.props.id??null,S=r?.type===me,He=r?.type===ue,U=Le(null),z=Le(null);Re(z);let Y=fe(),h=ye();x(()=>{let e=z.current;if(!h||!e)return;let t=o=>{o.key==="Escape"&&ge()};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[h]),x(()=>{if(g&&U.current!==g){if(U.current=g,S){c(w);return}b||i.select({index:0})}},[g,b,i,S]);let{setSelectedHeroId:q,setSelectHandler:V}=ve(),D=T.kind==="ticker"?T.heroId:null,I=je(e=>{e&&(c(t=>t.kind==="ticker"&&t.heroId===e?t:{kind:"ticker",heroId:e}),v(e))},[]);x(()=>{q(D)},[D,q]),x(()=>{V(I)},[V,I]);let{selectNode:_e}=Ie({mode:T,setMode:c,onOpenPart:v}),F=e=>B.components[e]?.label??e,G=e=>ae(e,"section",F(e)),Ke=()=>{if(S){c(w);return}c(f),i.select({index:0})},J=!S&&T.kind==="puck"&&b?.props.id===g,a=r?E(r.type)?.spec??null:null,d=r&&a?`${r.props.id}:${a.slot}`:null,Q=r&&a&&Array.isArray(r.props[a.slot])?r.props[a.slot]:[],H=e=>Ae(e,F),X=(e,t)=>{!r||!a||!d||(c(f),a.slider?(_(String(r.props.id),e),i.select({index:e,zone:d}),v(String(r.props.id))):(i.select({index:e,zone:d}),v(t)))},j=()=>{if(!r||!a||!d)return;let e=Q.length;i.insertComponent(d,a.childType,e),c(f),a.slider?requestAnimationFrame(()=>{_(String(r.props.id),e),i.select({index:e,zone:d})}):i.select({index:e,zone:d})},We=e=>{d&&(i.removeComponent(d,e),c(f),i.select(null))},Z=e=>de(B,e),ee=e=>{let{parentId:t,slot:o}=N(e),s=m=>{if(!m)return null;if(String(m.props.id)===t)return m;for(let p of Z(m.type)){let u=Array.isArray(m.props[p])?m.props[p]:[];for(let y of u){let M=s(y);if(M)return M}}return null},l=s(r)?.props[o];return Array.isArray(l)?l.length:0},te=(e,t,o)=>{let s=Math.min(Math.max(o,0),ee(e)),l=t<s?s-1:s;l!==t&&(i.reorderComponent(e,t,l),c(f),i.select({index:l,zone:e}))},A=tt({keyOf:e=>e.id,readOnly:!!C,canDrop:(e,t)=>et(t)===e.zone&&t.index>=0&&t.index<=ee(e.zone),onDrop:(e,t)=>te(e.zone,e.index,t.index),onStep:(e,t)=>te(e.zone,e.index,t<0?e.index-1:e.index+2)}),R=(e,t)=>n(nt,{...C?{}:A.seam({place:{...N(e),index:t}})},`seam:${e}:${t}`),Ue=e=>Z(e.type).flatMap(t=>(Array.isArray(e.props[t])?e.props[t]:[]).map((s,l)=>({child:s,zone:`${e.props.id}:${t}`,index:l}))),oe=e=>{let t=e.props;if(e.type==="FooterMenu"){let o=t.menu;return t.heading||o?.name||"Menu"}if(e.type==="FooterText"){let o=typeof t.text=="string"?t.text.trim():"";return o?o.length>28?`${o.slice(0,28)}\u2026`:o:"Text"}return e.type==="FooterEmailSignup"?t.heading||"Email signup":F(e.type)},ne=(e,t,o)=>{c(f),i.select({index:t,zone:e}),v(o)},re=(e,t,o)=>{i.insertComponent(e,t,o),c(f),i.select({index:o,zone:e}),W(null)},Ye=(e,t)=>{i.removeComponent(e,t),c(f),i.select(null)},qe=(e,t,o)=>n(xe,{choices:o,open:K===e,onToggle:()=>W(K===e?null:e),onPick:s=>re(e,s,t)}),se=(e,t)=>{let o=Ue(e),s=E(e.type),l=s?.choices??null,m=s?.source==="footer"?oe:H;return k(De,{children:[o.map(({child:p,zone:u,index:y})=>{let M=b?.props.id===p.props.id,Je=pe(B,p.type,t),ie=m(p),le=String(p.props.id),ce=()=>ne(u,y,le),{rowProps:Qe,...Xe}=A.row({item:{id:le,zone:u,index:y},place:{...N(u),index:y}},{onClick:O(ce)});return k(Ne,{children:[y===0&&R(u,0),n(L,{icon:n(P,{type:p.type,size:13}),name:ie,selected:M,onSelect:ce,...Xe,actions:n(ze,{kind:"delete",label:`Delete ${ie}`,onClick:()=>Ye(u,y),children:n($e,{size:13})}),rowProps:Qe}),Je&&n(Be,{children:se(p,t+1)}),R(u,y+1)]},String(p.props.id??`${u}-${y}`))}),s&&l?qe(`${e.props.id}:${s.slot}`,o.length,l):null]})},Ve=r?.type==="HeroSingle",Ge=!!r&&(!!a||He||S||Ve);return k("div",{ref:z,className:"sf-editor es-editor",style:we(Pe),children:[n("div",{className:"sf-section-bar",children:n(Ze,{...rt($),role:"status"})}),k("div",{className:"sf-body",children:[h&&Y?n("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:n(be,{panel:Y,pick:h})}):Ge&&r&&k("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[n("div",{className:"sf-panel-head",children:n("button",{type:"button",className:`sf-panel-title sf-panel-title--btn ${J?"is-selected":""}`,"aria-pressed":J,title:S?"Header settings":`${G(r.type)} settings`,onClick:Ke,children:G(r.type)})}),n(ot,{className:"sf-tree sf-scroll",rootProps:A.rootProps(),children:n(Be,{children:S?n(L,{icon:n(P,{type:"header",size:13}),name:"Header settings",selected:T.kind==="header",onSelect:()=>c(w),rowProps:{onClick:O(()=>c(w))}}):a?k(De,{children:[Q.map((e,t)=>{let o=b?.props.id===e.props.id,s=H(e),l=String(e.props.id),m=()=>X(t,l),{rowProps:p,...u}=A.row({item:{id:l,zone:d,index:t},place:{...N(d),index:t}},{onClick:O(m)});return k(Ne,{children:[t===0&&R(d,0),n(L,{icon:n(P,{type:e.type,size:13}),name:s,selected:o,onSelect:m,...u,actions:n(ze,{kind:"delete",label:`Delete ${s}`,onClick:()=>We(t),children:n($e,{size:13})}),rowProps:p}),R(d,t+1)]},String(e.props.id??t))}),k("button",{type:"button",className:"sf-add-card",onClick:j,children:[n("span",{className:"sf-plus sf-plus--sm",children:"+"}),a.addLabel]}),r.type==="Hero"&&g&&n(L,{icon:n(P,{type:"ticker",size:13}),name:Te,selected:D===g,onSelect:()=>I(g),rowProps:{onClick:O(()=>I(g))}})]}):se(r,1)})})]}),n("div",{className:"sf-center",children:n("div",{className:"sf-preview-host",children:n(Me,{})})}),n(he,{value:{selectChild:(e,t,o,s)=>E(s)?.source==="section"?X(t,o):ne(e,t,o),addChild:(e,t,o,s,l)=>E(l)?.source==="section"?j():re(`${e}:${t}`,o,s),childRowName:H,blockRowName:oe},children:n(Ce,{mode:T,onOpenWebsiteSettings:()=>c(Ee),onSelectNode:_e,hideNodeActions:!0})})]})]})}export{it as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{b as n}from"./chunk-
|
|
1
|
+
"use client";import{b as n}from"./chunk-HVOO2GNE.js";import"./chunk-Y6SLVHK3.js";import{useEffect as r,useState as u}from"react";import{createEasel as c,EaselProvider as p}from"efficient-easel/easel";import{jsx as E}from"react/jsx-runtime";function m({config:a,data:d,onChange:o,permissions:e,children:f}){let[t]=u(()=>c({config:a,data:d,permissions:e}));r(()=>{t.setConfig(a)},[t,a]),r(()=>{if(!o)return;let i=t.getState().appState.data;return t.subscribe(()=>{let s=t.getState().appState.data;s!==i&&(i=s,o(s))})},[t,o]),r(()=>{e&&t.setPermissions(e)},[t,e]);let l=n();return E(p,{easel:t,hotkeys:l.ownsDocument,children:f})}export{m as default};
|