efficient-storefront-blocks 0.96.0 → 0.98.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 +53 -0
- package/dist/chunks/EditorPreviewCheckout-2FW4VEOK.js +4 -0
- package/dist/chunks/{SiteEditorProvider-JF3MS6J7.js → SiteEditorProvider-LW5QSBKM.js} +1 -1
- package/dist/chunks/chunk-4QN263UJ.js +412 -0
- package/dist/chunks/chunk-GOHV3G3C.js +1 -0
- package/dist/chunks/chunk-PWSMCGXO.js +1 -0
- package/dist/chunks/chunk-SEIKSSUW.js +1 -0
- package/dist/chunks/chunk-XEZ7BYVZ.js +1 -0
- package/dist/chunks/{fitment-data-KWJP5ZQB.js → fitment-data-BRGBDG7Y.js} +1 -1
- package/dist/consent.js +1 -1
- package/dist/contract.js +19 -3
- package/dist/editor/components/EditorPreviewCheckout.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/Collections/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/WheelDiagram/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/WheelDiagram/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -1
- package/dist/editor/lib/document/box-header-for-site.d.ts +5 -0
- package/dist/editor/lib/document/box-header-for-site.js +1 -1
- package/dist/editor/lib/document/box-header.d.ts +2 -0
- package/dist/editor/lib/document/box-header.js +1 -1
- package/dist/editor/lib/document/config.d.ts +1 -0
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/efficient-block-sources.js +1 -1
- package/dist/editor/lib/header-settings-source.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +3 -1
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +229 -66
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +7 -4
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/BundleCard.js +1 -1
- package/dist/render/components/CollectionCard.d.ts +3 -0
- package/dist/render/components/CollectionCard.js +1 -1
- package/dist/render/components/Collections.d.ts +2 -1
- package/dist/render/components/Collections.js +1 -1
- package/dist/render/components/CompatibleTyres.js +1 -1
- package/dist/render/components/ContactRouting.d.ts +6 -0
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/CountrySelect.js +1 -1
- package/dist/render/components/FooterGroup.js +1 -1
- package/dist/render/components/FooterLogo.js +1 -1
- package/dist/render/components/FooterPayment.js +1 -1
- package/dist/render/components/FooterSection.js +1 -1
- package/dist/render/components/FooterSocial.js +1 -1
- package/dist/render/components/FooterText.js +1 -1
- package/dist/render/components/GridCardTemplate.js +1 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/ProductCard.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +3 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/SpecTable.d.ts +2 -1
- package/dist/render/components/SpecTable.js +1 -1
- package/dist/render/components/WheelCardFrame.d.ts +3 -10
- package/dist/render/components/WheelCardFrame.js +1 -1
- package/dist/render/components/WheelDiagram.d.ts +16 -0
- package/dist/render/components/WheelDiagram.js +1 -0
- package/dist/render/components/card-pieces/CardName.js +1 -1
- package/dist/render/components/card-pieces/CardPrice.js +1 -1
- package/dist/render/components/card-pieces/CardSurfaceFrame.d.ts +12 -0
- package/dist/render/components/card-pieces/CardSurfaceFrame.js +1 -0
- package/dist/render/components/card-pieces/ProductCardState.d.ts +1 -0
- package/dist/render/components/card-pieces/ProductCardState.js +1 -1
- package/dist/render/components/card-pieces/card-row.js +1 -1
- package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
- package/dist/render/components/catalog/ShopperChips.d.ts +7 -4
- package/dist/render/components/catalog/ShopperChips.js +1 -1
- package/dist/render/components/catalog/ShopperFilters.d.ts +1 -0
- package/dist/render/components/catalog/ShopperFilters.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
- package/dist/render/components/checkout/checkout-parts.js +1 -1
- package/dist/render/components/checkout/checkout-state.d.ts +5 -0
- package/dist/render/components/checkout/checkout-state.js +3 -3
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.d.ts +3 -0
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicWheelDiagram.d.ts +6 -0
- package/dist/render/components/pdp-dynamic/DynamicWheelDiagram.js +1 -0
- package/dist/render/components/pdp-dynamic/KindGate.d.ts +2 -1
- package/dist/render/components/pdp-dynamic/KindGate.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpFacetRows.d.ts +6 -4
- package/dist/render/components/wheels-plp/PlpFacetRows.js +1 -1
- package/dist/render/components/wheels-plp/PlpSidebar.d.ts +19 -14
- package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
- package/dist/render/components/wheels-plp/PlpTypePicker.d.ts +2 -5
- package/dist/render/lib/api/index.d.ts +6 -1
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/types.d.ts +28 -0
- package/dist/render/lib/checkout/pay-first.d.ts +1 -0
- package/dist/render/lib/checkout/pay-first.js +1 -1
- package/dist/render/lib/consent/rules.js +1 -1
- package/dist/render/lib/content/collection-card-look.d.ts +13 -0
- package/dist/render/lib/content/collection-card-look.js +1 -0
- package/dist/render/lib/content/contact-card-seed.js +1 -1
- package/dist/render/lib/content/facet-row-seed.d.ts +14 -0
- package/dist/render/lib/content/facet-row-seed.js +1 -1
- package/dist/render/lib/content/filter-card-seed.js +1 -1
- package/dist/render/lib/content/hero-option-seed.js +1 -1
- package/dist/render/lib/content/square-box.d.ts +4 -0
- package/dist/render/lib/content/square-box.js +1 -0
- package/dist/render/lib/countries.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/Collections/meta.d.ts +4 -0
- package/dist/render/lib/document/blocks/commerce/Collections/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/Collections/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.d.ts +4 -0
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/WheelDiagram/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/WheelDiagram/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/WheelDiagram/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/WheelDiagram/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/metas.d.ts +1 -0
- package/dist/render/lib/document/blocks/commerce/metas.js +1 -1
- package/dist/render/lib/document/blocks/commerce/renders.d.ts +1 -0
- package/dist/render/lib/document/blocks/commerce/renders.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
- package/dist/render/lib/document/card-templates.d.ts +2 -0
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/current-record.js +1 -1
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/document/render-config.d.ts +4 -0
- package/dist/render/lib/document/render-config.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-collections.d.ts +1 -0
- package/dist/render/lib/document/section-to-box-rows-collections.js +1 -0
- package/dist/render/lib/document/section-to-box-rows-detail.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-listing.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-service.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-spec.js +1 -1
- package/dist/render/lib/document/template-product-kind.d.ts +1 -0
- package/dist/render/lib/document/template-product-kind.js +1 -1
- package/dist/render/lib/next-fonts.js +1 -1
- package/dist/render/lib/sections/gallery-toolbar.js +1 -1
- package/dist/render/lib/storefront-page-groups.js +1 -1
- package/dist/render/lib/wheels/fitments.js +1 -1
- package/dist/render/lib/wheels/price-display.d.ts +5 -1
- package/dist/render/lib/wheels/price-display.js +1 -1
- package/dist/render/lib/wheels/wheel-specs.js +1 -1
- package/dist/words.d.ts +20 -1
- package/dist/words.js +4 -4
- package/package.json +5 -4
- package/dist/chunks/EditorPreviewCheckout-BXTY7X47.js +0 -4
- package/dist/chunks/chunk-KJQS4BOV.js +0 -1
- package/dist/chunks/chunk-KNUGQTUV.js +0 -1
- package/dist/chunks/chunk-QNBU3FGY.js +0 -1
- package/dist/chunks/chunk-YCB5WS3U.js +0 -1
- package/dist/chunks/chunk-Z2TVM6MN.js +0 -389
- package/dist/render/components/ProductCardChrome.d.ts +0 -38
- package/dist/render/components/ProductCardChrome.js +0 -1
- /package/dist/chunks/{chunk-Z2TVM6MN.js.LEGAL.txt → chunk-4QN263UJ.js.LEGAL.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.98.0 - 2026-11-11
|
|
4
|
+
|
|
5
|
+
**A major for hosts (major version zero, so a minor number):** the peers move to `efficient-web-builder` `^67.3.0` (was `^66.0.0`), `efficient-easel` `^34.1.0` (was `^33.0.0`) and `efficient-shell` `^12.33.0` (was `^12.30.0`) (#470, #486). The editor words change what a host types (#482). The wheel card frame needs a product card state (#488). From main at `86c28134`: #474, #478, #479, #470, #480, #476, #481, #482, #483, #484, #486, #488.
|
|
6
|
+
|
|
7
|
+
**For hosts:**
|
|
8
|
+
- Install web-builder 67.3.0 or later, easel 34.1.0 or later and shell 12.33.0 or later with this release (#470, #486).
|
|
9
|
+
- A host that vendors `src/` (the storefront) re-vendors with `node scripts/sync-storefront-blocks.mjs`, then runs `just check`. In the same bump:
|
|
10
|
+
- `package.json`: efficient-web-builder `67.3.0` (or later 67), efficient-easel `^34.1.0`, efficient-shell `^12.33.0`; `packages/storefront-blocks/vendored.json` and `packages/storefront-blocks/package.json` peers to match.
|
|
11
|
+
- Pass the stored site units to the web-builder 67 emitters in `app/layout.tsx` (corner, site width, side space, block gap): until then a site at 2vw draws 2px live (#482).
|
|
12
|
+
- The checkout logo reads `logo.sizeUnit`; the switch to the Box header reads `headerLogoPx` (#486).
|
|
13
|
+
- `scripts/probe-phone-390.tsx:231` draws `WheelCardFrame` with no provider: draw each card inside a `WheelCardStateProvider`, as `scripts/harness/plp-spec-line.tsx:182` does (#488).
|
|
14
|
+
- A host catalogue typed as `WebsiteEditorCatalogue` adds 3 phrases: "On card hover" and the two hover hints (#482).
|
|
15
|
+
- A host that reads `STOREFRONT_BLOCKS_WORDS["Always"]`, or types `"Always"` as a `StorefrontBlocksPhrase`, reads it as a web-builder phrase (`WebBuilderPhrase`) (#482). It stays in `WebsiteEditorPhrase`.
|
|
16
|
+
- admin-portal (blocks range `^0.93.0` now): raise the blocks range to `^0.98.0` and efficient-easel to `^34.1.0`; take the host steps of 0.94.0 to 0.97.0 too.
|
|
17
|
+
- No stored page moves.
|
|
18
|
+
|
|
19
|
+
- **BREAKING: peers `efficient-web-builder` `^67.3.0`, `efficient-easel` `^34.1.0`, `efficient-shell` `^12.33.0`** (#470 to `^67.1.0`, #486 to `^67.3.0`). Peer and dev, here and in `package/`.
|
|
20
|
+
- **BREAKING: "Always" moves to the web-builder phrases** (#482). `WebsiteEditorCatalogue` gains 3 required keys. `SiteThemeRow` gains 6 optional unit keys (`corner_radius_unit`, `site_width_unit`, `site_gutter_unit`, `site_gutter_phone_unit`, `block_gap_unit`, `block_gap_phone_unit`; null = px).
|
|
21
|
+
- **BREAKING: the wheel card frame needs a product card state** (#488). `WheelCardFrame` names its whole-card link from `useProductCardState()` and throws when drawn outside a product card's state; `CardSurfaceFrame` `label` is required. No export is removed. admin-portal: no step.
|
|
22
|
+
- **Header lengths draw in their stored unit** (#486). `AdminHeaderSettings` gains `logo_size_unit` and `menu_gap_unit`; `CheckoutProps.logo` gains `sizeUnit`; new export `pxLength`. The header, the checkout logo and the panel readouts draw and show the stored unit; converters copy px only.
|
|
23
|
+
- **Collections: each card draws from one card template** (#470). Collections has a `template` slot; a new insert gets the Collections card seed (`collectionCardSeed`). The host's Collections Box row is `section-to-box-rows-collections` (new side-effect module). The card's hover zoom, wash and the room below the cards have one home.
|
|
24
|
+
- **The Spec Table Box row holds a Sheet with a Wheel Diagram block** (#481). New exports: the `WheelDiagram` block, `components/WheelDiagram`, `wheelSheetOf`, `useDeclaredTemplateProductKind`. New optional props: `KindGate` `label`, `SpecTable` `diagramElsewhere`. Live bytes do not change.
|
|
25
|
+
- **Stored keys read registries by own key only** (#484): a stored type such as "toString" reads as no entry (31 reads). New exports `drawnBlock` and `headerLogoPx`.
|
|
26
|
+
- **Checkout buyers can name their company** (#478): an optional company field on the Contact card sends `customer.companyName`.
|
|
27
|
+
- **Kit cards show the kit price** (#474): the /bundles card and the grid card's Price piece show the price in the shopper's currency, with the separate-parts total struck through. New export `bundlePrice`.
|
|
28
|
+
- **Tyre cards print the tread pattern** under the name (#479).
|
|
29
|
+
- Internal (no change to the published package): guards read web-builder's `PRESS_NEEDS_SET` (#480) and its option-row rule (#483); the editor-side UI check runs from `efficient-shell-checker` (#476).
|
|
30
|
+
|
|
31
|
+
## 0.97.0 - 2026-11-10
|
|
32
|
+
|
|
33
|
+
**A major for hosts (major version zero, so a minor number):** the peers move to `efficient-web-builder` `^66.0.0` (was `^65.0.0`), `efficient-easel` `^33.0.0` (was `^30.1.0`) and `efficient-shell` `^12.30.0` (was `^12.22.0`) (#473). Product card exports are removed (#468). From main at `0c72c43e`: #466, #469, #471, #468, #472, #473, #475.
|
|
34
|
+
|
|
35
|
+
**For hosts:**
|
|
36
|
+
- Install web-builder 66.0.0, easel 33.0.0 or later and shell 12.30.0 or later with this release (#473). easel 34 is outside web-builder 66's range; a later blocks release moves to web-builder 67 and easel ^34.1.
|
|
37
|
+
- A host that vendors `src/` (the storefront) re-vendors with `node scripts/sync-storefront-blocks.mjs` (this removes the vendored `ProductCardChrome.tsx`), then runs `just check`. In the same bump:
|
|
38
|
+
- `package.json`: efficient-easel `^33.0.0`, efficient-shell `^12.30.0`, efficient-web-builder `66.0.0` (#473); `packages/storefront-blocks/vendored.json` and `packages/storefront-blocks/package.json` peers to match.
|
|
39
|
+
- `scripts/test-section-presets.tsx:440` and the loop at `:456-462`: the Manifesto words Box Left/Right expect `"site"` (web-builder 66, #473).
|
|
40
|
+
- `scripts/harness/plp-spec-line.tsx`: delete lines 52 (`CardBuyButton` import), 186, 187, 190 and 194 (#468).
|
|
41
|
+
- `scripts/test-card-price-line.tsx`: delete line 182 (#468).
|
|
42
|
+
- `scripts/probe-phone-390.tsx:231`: delete `name` from `createElement(WheelCardFrame, { href, name, wide })`, or draw each card inside a `WheelCardStateProvider` (#468).
|
|
43
|
+
- Optional: pass `maxRows` to `products.listWheels` from the related-wheels read, so a product page stops paging once its row is full (#469).
|
|
44
|
+
- admin-portal: efficient-easel `^30.1.0` -> `^33.0.0` and the blocks range `^0.97.0`; shell `^12.33.0` is already inside `^12.30.0`; no code step.
|
|
45
|
+
- storefront #1947 (site length units contract) takes this release: its `check:contract` compares `types.ts` with its `openapi.yml` (#475).
|
|
46
|
+
- No stored page moves.
|
|
47
|
+
|
|
48
|
+
- **BREAKING: peers `efficient-web-builder` `^66.0.0`, `efficient-easel` `^33.0.0`, `efficient-shell` `^12.30.0`** (#473). Peer and dev, here and in `package/`. Every acting `CardTemplateRows` call is named once (`cardPressTitlesOf`); `pageTitleTag`, `pageTitleDemoted` and `PAGE_TITLE_LEVEL_PROP` come from web-builder `one-h1`. No blocks export is removed by #473.
|
|
49
|
+
- **BREAKING: product cards use the builder's Box link** (#468). One `CardSurfaceFrame` for `GridCardTemplate` and `WheelCardFrame`; no control sits inside a link; focus is an inset accent ring; the card root is `<article>`, not `<a>`. Removed: `WheelCardFrame` props `identityLink`, `wholeCardLink`, `containerProps`, `plate`, `name`, `sizes`, `buy` and the no-`href` path (`href` is now required); the module `render/components/ProductCardChrome` (`ProductCardChrome`, `ProductCardChromeProvider`, `useProductCardChrome`, `showCardBuy`, `showCardPage`). Added: `PRODUCT_CARD_CHROME`.
|
|
50
|
+
- **The Filters "Side rail" look draws through the listing's rail** (#471). `PlpSidebar` gets an optional `facetTemplate` slot (and `RailOwner`, price and foot props); the separate Filters rail is gone. 0 Filters rail nodes on stored US sites.
|
|
51
|
+
- **Site lengths carry their unit in the API types** (#475). `src/render/lib/api/types.ts` is generated again from the storefront contract: the text-style, corner, logo and menu lengths gain their optional `*Unit` keys (null = px).
|
|
52
|
+
- **`products.listWheels` takes an optional `maxRows`** (#469). With it, paging stops once that many listable wheels are held; without it, nothing changes.
|
|
53
|
+
- **Seeds take the label face from web-builder seed-parts** (#466): `labelStyle(px)` or `LABEL_FACE`. Every seeded prop is the same value. The hero option Dot is a fixed 20 px square Box (`squareBox` in `src/render/lib/content/square-box.ts`); it still draws 20 x 20 px.
|
|
54
|
+
- Tools: `scripts/panel-picture.tsx` and `scripts/capture-panel.tsx` draw an editor panel picture that keeps every inline style React wrote (#472). No file in `src/` or `package/` changes.
|
|
55
|
+
|
|
3
56
|
## 0.96.0 - 2026-11-10
|
|
4
57
|
|
|
5
58
|
**A major for hosts (major version zero, so a minor number):** the peers move to `efficient-web-builder` `^65.0.0` (was `^64.0.0`) and `efficient-shell` `^12.22.0` (was `^12.18.0`) (#460). `efficient-easel` `^30.1.0` does not change. `AlloyWheelsListingProps.cardImage` is removed (#458). From main at `fa80ccad`: #458, #459, #463, #465, #460.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";import{$ as gr,N as sr,O as cr,P as lr,Q as ur,R as dr,S as ye,U as dt,V as pr,W as mr,X as St,Y as fr,_ as Jt,aa as yr,b as ar,c as Gt,d as or,e as ir,fa as hr,ga as Ke,ia as br,na as vr,oa as Qe,ra as Vt,ta as ae,ua as te,y as Nt}from"./chunk-PWSMCGXO.js";import{i as de,o as Ze,v as U}from"./chunk-SEIKSSUW.js";import{he as tr,je as ge,ne as nr}from"./chunk-XEZ7BYVZ.js";import{m as rr,n as ut,o as ue}from"./chunk-GOHV3G3C.js";import{a as Ht,b as mo}from"./chunk-Y6SLVHK3.js";var kr=Ht((Pi,Cr)=>{"use strict";var go="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Cr.exports=go});var Sr=Ht((Ni,Nr)=>{"use strict";var yo=kr();function wr(){}function Pr(){}Pr.resetWarningCache=wr;Nr.exports=function(){function e(r,o,s,u,m,f){if(f!==yo){var d=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 d.name="Invariant Violation",d}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Pr,resetWarningCache:wr};return n.PropTypes=n,n}});var Rr=Ht((Ri,Er)=>{"use strict";Er.exports=Sr()();var Si,Ei});import{useEffect as qa,useMemo as Ta,useRef as nt,useState as $e}from"react";import{rootIsDark as fo}from"efficient-shell/format";function xr(){if(typeof document>"u")return;let e=getComputedStyle(document.documentElement),t=(r,o)=>e.getPropertyValue(r).trim()||o,n=fo({whenUnset:!0});return{theme:n?"night":"stripe",variables:{colorPrimary:t("--accent",n?"#c9a461":"#8a6a2a"),colorBackground:t("--site-surface",n?"#131313":"#ffffff"),colorText:t("--fg",n?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}}var L=mo(Rr(),1);import I from"react";function Or(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ho(e){if(Array.isArray(e))return e}function _r(e,t,n){return(t=wo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bo(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,s,u,m=[],f=!0,d=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(f=(r=s.call(n)).done)&&(m.push(r.value),m.length!==t);f=!0);}catch(y){d=!0,o=y}finally{try{if(!f&&n.return!=null&&(u=n.return(),Object(u)!==u))return}finally{if(d)throw o}}return m}}function vo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ar(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ar(Object(n),!0).forEach(function(r){_r(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ar(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xo(e,t){if(e==null)return{};var n,r,o=Co(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Co(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Fr(e,t){return ho(e)||bo(e,t)||Po(e,t)||vo()}function ko(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wo(e){var t=ko(e,"string");return typeof t=="symbol"?t:t+""}function Xt(e){"@babel/helpers - typeof";return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xt(e)}function Po(e,t){if(e){if(typeof e=="string")return Or(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Or(e,t):void 0}}var z=function(t,n,r){var o=!!r,s=I.useRef(r);I.useEffect(function(){s.current=r},[r]),I.useEffect(function(){if(!o||!t)return function(){};var u=function(){if(s.current)return s.current.apply(s,arguments)};return t.on(n,u),function(){t.off(n,u)}},[o,n,t,s])},Zt=function(t){var n=I.useRef(t);return I.useEffect(function(){n.current=t},[t]),n.current},et=function(t){return t!==null&&Xt(t)==="object"},No=function(t){return et(t)&&typeof t.then=="function"},So=function(t){return et(t)&&typeof t.elements=="function"&&typeof t.createToken=="function"&&typeof t.createPaymentMethod=="function"&&typeof t.confirmCardPayment=="function"},Tr="[object Object]",Eo=function e(t,n){if(t===n)return!0;if(!et(t)||!et(n))return t===n;var r=Array.isArray(t),o=Array.isArray(n);if(r!==o)return!1;var s=Object.prototype.toString.call(t)===Tr,u=Object.prototype.toString.call(n)===Tr;if(s!==u)return!1;if(!s&&!r)return t===n;var m=Object.keys(t),f=Object.keys(n);if(m.length!==f.length)return!1;for(var d={},y=0;y<m.length;y+=1)d[m[y]]=!0;for(var h=0;h<f.length;h+=1)d[f[h]]=!0;var C=Object.keys(d);if(C.length!==m.length)return!1;var b=t,P=n,E=function(V){return e(b[V],P[V])};return C.every(E)},qr=function(t,n,r){return et(t)?Object.keys(t).reduce(function(o,s){var u=!et(n)||!Eo(t[s],n[s]);return r.includes(s)?(u&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),o):u?Ir(Ir({},o||{}),{},_r({},s,t[s])):o},null):null},Mr="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.",Lr=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mr;if(t===null||So(t))return t;throw new Error(n)},Ro=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mr;if(No(t))return{tag:"async",stripePromise:Promise.resolve(t).then(function(o){return Lr(o,n)})};var r=Lr(t,n);return r===null?{tag:"empty"}:{tag:"sync",stripe:r}},Oo=function(t){!t||!t._registerWrapper||!t.registerAppInfo||(t._registerWrapper({name:"react-stripe-js",version:"6.12.0"}),t.registerAppInfo({name:"react-stripe-js",version:"6.12.0",url:"https://stripe.com/docs/stripe-js/react"}))},Et=I.createContext(null);Et.displayName="ElementsContext";var Dr=function(t,n){if(!t)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 t},en=function(t){var n=t.stripe,r=t.options,o=t.children,s=I.useMemo(function(){return Ro(n)},[n]),u=I.useState(function(){return{stripe:s.tag==="sync"?s.stripe:null,elements:s.tag==="sync"?s.stripe.elements(r):null}}),m=Fr(u,2),f=m[0],d=m[1];I.useEffect(function(){var C=!0,b=function(E){d(function(A){return A.stripe?A:{stripe:E,elements:E.elements(r)}})};return s.tag==="async"&&!f.stripe?s.stripePromise.then(function(P){P&&C&&b(P)}):s.tag==="sync"&&!f.stripe&&b(s.stripe),function(){C=!1}},[s,f,r]);var y=Zt(n);I.useEffect(function(){y!==null&&y!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[y,n]);var h=Zt(r);return I.useEffect(function(){if(f.elements){var C=qr(r,h,["clientSecret","fonts"]);C&&f.elements.update(C)}},[r,h,f.elements]),I.useEffect(function(){Oo(f.stripe)},[f.stripe]),I.createElement(Et.Provider,{value:f},o)};en.propTypes={stripe:L.default.any,options:L.default.object};var jr=function(t){var n=I.useContext(Et);return Dr(n,t)},Kr=function(){var t=jr("calls useElements()"),n=t.elements;return n},Ao=function(t){var n=t.children,r=jr("mounts <ElementsConsumer>");return n(r)};Ao.propTypes={children:L.default.func.isRequired};var Io=I.createContext(null);Io.displayName="CheckoutContext";var Ur=I.createContext(null);Ur.displayName="CheckoutSdkContext";var Qt=function(t){var n=I.useContext(Ur),r=I.useContext(Et);if(n){if(r)throw new Error("You cannot wrap the part of your app that ".concat(t," in both a checkout provider and <Elements> provider."));return n}else return Dr(r,t)},To=["mode"],Lo=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},_=function(t,n,r){var o="".concat(Lo(t),"Element"),s=function(d){var y=d.id,h=d.className,C=d.options,b=C===void 0?{}:C,P=d.onBlur,E=d.onFocus,A=d.onReady,V=d.onChange,O=d.onEscape,k=d.onClick,W=d.onLoadError,X=d.onLoaderStart,q=d.onNetworksChange,oe=d.onConfirm,he=d.onCancel,Te=d.onShippingAddressChange,pe=d.onShippingRateChange,B=d.onSavedPaymentMethodRemove,le=d.onSavedPaymentMethodUpdate,me=d.onAvailablePaymentMethodsChange,$=Qt("mounts <".concat(o,">")),x="elements"in $?$.elements:null,Z="checkoutSdk"in $?$.checkoutSdk:null,rt=I.useState(null),Ye=Fr(rt,2),j=Ye[0],Be=Ye[1],Q=I.useRef(null),Le=I.useRef(null);z(j,"blur",P),z(j,"focus",E),z(j,"escape",O),z(j,"click",k),z(j,"loaderror",W),z(j,"loaderstart",X),z(j,"networkschange",q),z(j,"confirm",oe),z(j,"cancel",he),z(j,"shippingaddresschange",Te),z(j,"shippingratechange",pe),z(j,"savedpaymentmethodremove",B),z(j,"savedpaymentmethodupdate",le),z(j,"availablepaymentmethodschange",me),z(j,"change",V);var Pe;A&&(t==="expressCheckout"?Pe=A:Pe=function(){A(j)}),z(j,"ready",Pe),I.useLayoutEffect(function(){if(Q.current===null&&Le.current!==null&&(x||Z)){var T=null;if(Z){var G=Z,ze=Z;switch(t){case"paymentForm":T=ze.createForm(b);break;case"payment":T=G.createPaymentElement(b);break;case"address":if("mode"in b){var Ne=b.mode,_e=xo(b,To);if(Ne==="shipping")T=G.createShippingAddressElement(_e);else if(Ne==="billing")T=G.createBillingAddressElement(_e);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":T=G.createExpressCheckoutElement(b);break;case"currencySelector":T=Z.createCurrencySelectorElement();break;case"taxId":T=G.createTaxIdElement(b);break;case"contactDetails":T=G.createContactDetailsElement();break;case"linkSignup":if("createLinkSignupElement"in Z)T=Z.createLinkSignupElement(b);else throw new Error("<LinkSignupElement> requires <CheckoutElementsProvider> and is not supported inside <CheckoutFormProvider>.");break;case"terms":T=G.createTermsElement(b);break;default:throw new Error("<".concat(o,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else x&&(T=x.create(t,b));Q.current=T,Be(T),T&&T.mount(Le.current)}},[x,Z,b]);var be=Zt(b);return I.useEffect(function(){if(Q.current){var T=qr(b,be,["paymentRequest"]);T&&"update"in Q.current&&Q.current.update(T)}},[b,be]),I.useLayoutEffect(function(){return function(){if(Q.current&&typeof Q.current.destroy=="function")try{Q.current.destroy(),Q.current=null}catch{}}},[]),I.createElement("div",{id:y,className:h,ref:Le})},u=function(d){Qt("mounts <".concat(o,">"));var y=d.id,h=d.className;return I.createElement("div",{id:y,className:h})},m=n?u:s;return m.propTypes={id:L.default.string,className:L.default.string,onChange:L.default.func,onBlur:L.default.func,onFocus:L.default.func,onReady:L.default.func,onEscape:L.default.func,onClick:L.default.func,onLoadError:L.default.func,onLoaderStart:L.default.func,onNetworksChange:L.default.func,onConfirm:L.default.func,onCancel:L.default.func,onShippingAddressChange:L.default.func,onShippingRateChange:L.default.func,onSavedPaymentMethodRemove:L.default.func,onSavedPaymentMethodUpdate:L.default.func,onAvailablePaymentMethodsChange:L.default.func,options:L.default.object},m.displayName=o,m.__elementType=t,m},F=typeof window>"u",_o=I.createContext(null);_o.displayName="EmbeddedCheckoutProviderContext";var Wr=function(){var t=Qt("calls useStripe()"),n=t.stripe;return n},Ai=_("auBankAccount",F),Ii=_("card",F),Ti=_("cardNumber",F),Li=_("cardExpiry",F),_i=_("cardCvc",F),Fi=_("currencySelector",F),qi=_("iban",F),$r=_("payment",F),Mi=_("expressCheckout",F),Di=_("paymentRequestButton",F),ji=_("linkAuthentication",F),Ki=_("linkSignup",F),Ui=_("contactDetails",F),Wi=_("address",F),$i=_("shippingAddress",F),Yi=_("paymentMethodMessaging",F),Bi=_("taxId",F),zi=_("issuingCardNumberDisplay",F),Hi=_("issuingCardCvcDisplay",F),Gi=_("issuingCardExpiryDisplay",F),Ji=_("issuingCardPinDisplay",F),Vi=_("issuingCardCopyButton",F),Xi=_("terms",F);function At(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?At=function(t){return typeof t}:At=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(e)}var zr="dahlia",Fo=function(t){return t===3?"v3":t},Hr="https://js.stripe.com",qo="".concat(Hr,"/").concat(zr,"/stripe.js"),Mo=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Do=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,Yr="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",jo=function(t){return Mo.test(t)||Do.test(t)},Ko=function(){for(var t=document.querySelectorAll('script[src^="'.concat(Hr,'"]')),n=0;n<t.length;n++){var r=t[n];if(jo(r.src))return r}return null},Br=function(t){var n=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(qo).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(r),r},Uo=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"9.17.0",startTime:n})},pt=null,Rt=null,Ot=null,Wo=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},$o=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},Yo=function(t){return pt!==null?pt:(pt=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&t&&console.warn(Yr),window.Stripe){n(window.Stripe);return}try{var o=Ko();if(o&&t)console.warn(Yr);else if(!o)o=Br(t);else if(o&&Ot!==null&&Rt!==null){var s;o.removeEventListener("load",Ot),o.removeEventListener("error",Rt),(s=o.parentNode)===null||s===void 0||s.removeChild(o),o=Br(t)}Ot=$o(n,r),Rt=Wo(r),o.addEventListener("load",Ot),o.addEventListener("error",Rt)}catch(u){r(u);return}}),pt.catch(function(n){return pt=null,Promise.reject(n)}))},Bo=function(t,n,r){if(t===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(At(o)," instead."));var s=o.match(/^pk_test/),u=Fo(t.version),m=zr;s&&u!==m&&console.warn("Stripe.js@".concat(u," was loaded on the page, but @stripe/stripe-js@").concat("9.17.0"," expected Stripe.js@").concat(m,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var f=t.apply(void 0,n);return Uo(f,r),f},mt,Gr=!1,Jr=function(){return mt||(mt=Yo(null).catch(function(t){return mt=null,Promise.reject(t)}),mt)};Promise.resolve().then(function(){return Jr()}).catch(function(e){Gr||console.warn(e)});var It=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];Gr=!0;var o=Date.now();return Jr().then(function(s){return Bo(s,n,o)})};var tn=2;function Vr(e){return e==="card"}var zo="checkout_unavailable",Ho="checkout_waiting",Xr="committed",Oe="We could not check your payment. Please try again.",nn="Your last change was not saved. This is your order as placed.",Zr="Your bank is still waiting for you to approve this payment, so your order stays as it was. Finish the approval, or try again in a few minutes.",Qr=1e4;async function ea(e,t=Qr){let n,r=new Promise(s=>{n=setTimeout(()=>s(void 0),t)}),o=(async()=>{try{return(await(await It(e.publishableKey))?.retrievePaymentIntent(e.clientSecret))?.paymentIntent?.status}catch{return}})();try{return await Promise.race([o,r])}finally{clearTimeout(n)}}var ta=new Set(["none","requires_payment_method","canceled"]);async function rn(e,t=Qr){let n,r=new Promise(o=>{n=setTimeout(()=>o(void 0),t)});try{return await Promise.race([U.releaseCheckout({idempotencyKey:e}).then(o=>o.status,()=>{}),r])}finally{clearTimeout(n)}}function na(e,t){return e instanceof de&&typeof e.data=="object"&&e.data!==null&&e.data.code===t}function Tt(e){return na(e,zo)}function an(e){return na(e,Ho)}function on(e){return e instanceof de&&e.status>=400&&e.status<500&&e.status!==408}function ra(e){return JSON.stringify([e.email,e.firstName,e.lastName,e.phone,e.address,e.city,e.subdivision,e.postcode,e.country,e.lines,e.shippingMethodId,e.couponCode,e.currency,e.shopperId,e.company])}function Lt(e){return e.orderNumber||e.checkoutNumber}function Go(e){return e.orderNumber?{kind:"placed",order:e}:{kind:e.status==="released"?"refunded":e.status==="expired"?"expired":"pending",checkoutNumber:e.checkoutNumber}}async function aa({checkoutNumber:e,resend:t,page:n}){n.setConfirming(!0);let r;try{r=Go(await t())}catch{r={kind:"pending",checkoutNumber:e}}r.kind==="placed"?(n.markPaid(),n.track(r.order),n.land(r.order)):n.unplaced({...r,checkoutNumber:r.checkoutNumber||e}),n.setConfirming(!1)}import{createContext as ai,useContext as oi,useEffect as J,useMemo as ya,useRef as H,useState as w}from"react";var Jo="sf:gclid",Vo="sf:fbclid",Xo=2160*60*60*1e3;function sa(){return typeof window<"u"}function oa(e){let t=ut.getItem(e);if(!t)return"";try{let{v:n,t:r}=JSON.parse(t);return!n||typeof r!="number"||Date.now()-r>Xo?"":n}catch{return""}}function ia(e){if(!sa())return"";let t=e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),n=document.cookie.match(new RegExp(`(?:^|; )${t}=([^;]*)`));return n?decodeURIComponent(n[1]):""}function ca(){if(!sa())return{};let e=oa(Jo),t=oa(Vo),n=ia("_fbp"),r=ia("_fbc");!r&&t&&(r=`fb.1.${Date.now()}.${t}`);let o={};return e&&(o.gclid=e),t&&(o.fbclid=t),n&&(o.fbp=n),r&&(o.fbc=r),o}var la="sf:meta-purchases",Zo=20;function da(){return typeof window>"u"||window.parent!==window}function Qo(...e){try{if(da()||typeof window.fbq!="function")return;window.fbq(...e)}catch{}}var ua=new Set;function ei(e){if(ua.has(e))return!1;ua.add(e);try{let t=JSON.parse(ut.getItem(la)??"[]");if(t.includes(e))return!1;ut.setItem(la,JSON.stringify([...t,e].slice(-Zo)))}catch{}return!0}function ti(e){return[...new Set(e.filter(dt).flatMap(t=>t.components.map(n=>n.partNumber)))]}function pa(e){let t=e.confirmation;da()||!ei(t.orderNumber)||Qo("track","Purchase",{value:Number(t.grandTotal),currency:t.currency,content_type:"product",content_ids:ti(e.lines)},{eventID:t.orderNumber})}var sn="checkout-afterpay-context",_t="checkout-gocardless-context",cn="checkout-zip-context",Ft="checkout-klarna-context";function ni({evidence:e,parked:t}){return e?{action:"capture",evidence:e,parked:t}:t?{action:"settle",parked:t}:{action:"ignore"}}function ri(e,t){let n=e.getItem(t);if(e.removeItem(t),!n)return null;try{return JSON.parse(n)}catch{return null}}var ma={name:"Afterpay",legParam:"afterpay",legValues:["confirm","cancel"],storageKey:sn,evidenceFrom(e,t){return t==="cancel"||(e.get("status")??"").toUpperCase()==="CANCELLED"?null:e.get("orderToken")},requestFrom:e=>({token:e})},fa={name:"Zip",legParam:"zip",legValues:["return"],storageKey:cn,evidenceFrom(e){let t=(e.get("result")??"").toLowerCase();return t==="cancelled"||t==="declined"?null:e.get("checkoutId")},requestFrom:e=>({checkoutId:e})};async function ln(e,t){let n=new URLSearchParams(t.search),r=n.get(e.legParam);if(!r||!e.legValues.includes(r))return;let o=ri(t.storage,e.storageKey),s=e.evidenceFrom(n,r);t.scrubQuery();let u=ni({evidence:s,parked:o});if(u.action!=="ignore"){if(t.page.clearCart(),u.action==="settle"){t.page.note(`The ${e.name} payment was not completed \u2014 our team will follow up on payment.`),t.page.land(u.parked.confirmation);return}t.page.setConfirming(!0);try{let m=await t.capture(e.requestFrom(u.evidence));m.status==="paid"?t.page.markPaid():t.page.note(`${e.name} declined the payment \u2014 our team will follow up on payment.`),t.page.land(u.parked?.confirmation??m)}catch{u.parked?(t.page.note(`We could not confirm the ${e.name} payment \u2014 our team will follow up on payment.`),t.page.land(u.parked.confirmation)):t.page.fail(`We could not confirm your ${e.name} payment. Please contact us before trying again \u2014 your payment may already have been taken.`)}finally{t.page.setConfirming(!1)}}}function ga(e,t,n){let r=(t??"").trim();if(!r)return"";if(n.length===0)return r;let o=r.toUpperCase(),s=`${e.toUpperCase()}-${o}`,u=n.find(m=>m.code&&m.code.toUpperCase()===o)??n.find(m=>m.code&&m.code.toUpperCase()===s)??n.find(m=>m.name.toUpperCase()===o);return u?u.code||u.name:""}import{jsx as we}from"react/jsx-runtime";function ha(e){let t=e.indexOf(`
|
|
3
|
+
`);return t===-1?[e,""]:[e.slice(0,t),e.slice(t+1)]}function ba(e,{canParkContext:t}={canParkContext:!0}){let n=e.paymentMethods,r=[];return n.includes("card")&&r.push({key:"card",title:"Card",body:null,price:we("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("paypal")&&e.paypalClientId&&r.push({key:"paypal",title:"PayPal",body:null,price:we("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL \xB7 CARDS"})}),n.includes("afterpay")&&r.push({key:"afterpay",title:"Afterpay",body:null,price:we("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 \xD7 INTEREST-FREE"})}),n.includes("square")&&e.squareApplicationId&&e.squareLocationId&&r.push({key:"square",title:"Card (Square)",body:null,price:we("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("gocardless")&&t&&r.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:we("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),n.includes("zip")&&r.push({key:"zip",title:"Zip",body:null,price:we("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),n.includes("klarna")&&t&&r.push({key:"klarna",title:"Klarna",body:null,price:we("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),n.includes("bank")&&r.push({key:"bank",title:"Bank transfer",body:null,price:we("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),r}var Ca="This shop does not take payment online yet. Please contact the shop to order.",tt=class extends Error{};function va(e,t){if(!e.orderNumber&&Tt(t))return t.message;let n=t instanceof de?` (${t.message})`:"";return e.orderNumber?`Your order ${e.orderNumber} is saved, but the payment did not start${n}. Try the payment again \u2014 your order will not be placed twice.`:`Your items are held under ${e.checkoutNumber}, but the payment did not start${n}. Try the payment again \u2014 you will not be charged twice.`}var xa=new Set(["paypal","square","afterpay","gocardless","zip","klarna"]),Ue=e=>JSON.parse(e),ka="Shipping cannot be calculated right now. Please try again.";function ii({site:e,logo:t,preview:n=!1}){let{items:r,totals:o,coupon:s,refuseCoupon:u,deliveryOptions:m,shippingMethodId:f,setShippingMethodId:d,setQuoteDestination:y,courier:h,requote:C,identify:b,clearCapturedCart:P,replaceItems:E,removeCoupon:A}=St(),V=m.find(a=>a.id===f)?.pickupLocation??null,{country:O,countries:k,activeCountry:W,formatMoney:X}=ye(),[q,oe]=w(()=>ba(e)[0]?.key??null),[he,Te]=w(!0);J(()=>{Te(rr(ue))},[]);let[pe,B]=w(!1),[le,me]=w(""),[$,x]=w(""),[Z,rt]=w(""),[Ye,j]=w(""),[Be,Q]=w(""),[Le,Pe]=w(""),[be,T]=w(""),[G,ze]=w(""),[Ne,_e]=w(""),[D,ft]=w(()=>O||k[0]?.code||""),[Se,gt]=w(""),[at,fn]=w([]),[jt,Kt]=w(null),[yt,ot]=w(null),gn=ya(()=>k.find(a=>a.code===D)??W,[k,D,W]),Ma=gn?.postalLabel||"Postal Code",Da=at[0]?.divisionType||"State / Province";J(()=>{if(!D){fn([]),Kt(D);return}Kt(null);let a=!1;return U.listCountrySubdivisions(D).then(l=>{a||(fn(l),Kt(D),gt(""))}),()=>{a=!0}},[D]);let yn=Be.trim()!==""&&be.trim()!==""&&G.trim()!==""&&jt===D&&(at.length===0||Se!=="")?G.trim():"";J(()=>{y(D?{country:D,subdivision:Se,postcode:yn}:null)},[D,Se,yn,y]),J(()=>()=>y(null),[y]);let ja=h?.status==="unavailable",Ka=C,[ht,hn]=w(null),[Ua,bn]=w([]),[vn,Ut]=w("new"),[xn,Cn]=w(!1),[Wt,Wa]=w("Home"),[$a,kn]=w(null),[Ya,wn]=w(null),[it,bt]=w(()=>Qe()),Pn=H(null),[Nn,fe]=w(null),[Ba,ie]=w(null),[Sn,vt]=w(null),[En,za]=w(!1),[Rn,Ha]=w(!1),[Ee,He]=w(null),[Ga,Ge]=w(!1),[se,ve]=w(null),[Ja,xe]=w(null),[Va,Xa]=w(!1),[Za,On]=w(!1),[Qa,eo]=w(!1),[to,An]=w(!1),[In,no]=w(!1),[ro,$t]=w(!1),[Yt,Tn]=w(null),Fe=H(null),st=H(r),qe=H(null),Je=H(null),Ln=!!(Nn||Yt&&Yt.kind!=="processing"||In||En||Rn||Sn&&Ee?.orderNumber);J(()=>{Ln&&(E([]),A())},[Ln,E,A]);let _n=H(!1);J(()=>{n||_n.current||!r.some(dt)||(_n.current=!0,sr({lines:r,currency:o.currency,value:o.subtotal-o.discount,coupon:s?.valid?s.code:void 0}))},[r,o,s,n]),J(()=>{b(le,$.trim()||void 0)},[le,$,b]);let Fn=H(null),[xt,ao]=w(null);J(()=>{let a=Fn.current;if(!xt||!a)return;let l=()=>a.style.setProperty("--sf-checkout-header-h",`${xt.offsetHeight}px`);l();let p=new ResizeObserver(l);return p.observe(xt),()=>p.disconnect()},[xt]),J(()=>{let a=p=>({setConfirming:p,land:fe,markPaid:()=>Ge(!0),note:xe,fail:ie,clearCart:P}),l={search:window.location.search,storage:ue,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};ln(ma,{...l,capture:U.captureAfterpayPayment,page:a(Xa)}),ln(fa,{...l,capture:U.captureZipPayment,page:a(eo)})},[]),J(()=>{let l=new URLSearchParams(window.location.search).get("gocardless");if(l!=="confirm"&&l!=="cancel")return;let p=ue.getItem(_t);if(ue.removeItem(_t),window.history.replaceState(null,"",window.location.pathname),!p)return;let N;try{N=JSON.parse(p)}catch{return}if(P(),l==="cancel"){xe("The direct debit was not set up \u2014 our team will follow up on payment."),fe(N.confirmation);return}On(!0),U.completeGocardlessPayment({idempotencyKey:N.idempotencyKey}).then(g=>{g.status==="paid"?Ge(!0):g.status==="declined"?xe("The direct debit was declined \u2014 our team will follow up on payment."):xe("Your direct debit is set up \u2014 the payment is collecting and will clear in a few days.")}).catch(()=>{xe("We could not confirm the direct debit \u2014 our team will follow up on payment.")}).finally(()=>{fe(N.confirmation),On(!1)})},[]),J(()=>{let a=new URLSearchParams(window.location.search),l=a.get("klarna");if(l!=="confirm"&&l!=="cancel")return;let p=ue.getItem(Ft);ue.removeItem(Ft);let N=a.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!p)return;let g;try{g=JSON.parse(p)}catch{return}if(P(),l==="cancel"||!N){xe("The Klarna payment was not completed \u2014 our team will follow up on payment."),fe(g.confirmation);return}An(!0),U.captureKlarnaPayment({idempotencyKey:g.idempotencyKey,authorizationToken:N}).then(M=>{M.status==="paid"?Ge(!0):M.status==="declined"?xe("Klarna declined the payment \u2014 our team will follow up on payment."):xe("Your Klarna payment is being reviewed \u2014 we'll confirm the outcome shortly.")}).catch(()=>{xe("We could not confirm the Klarna payment \u2014 our team will follow up on payment.")}).finally(()=>{fe(g.confirmation),An(!1)})},[]);function qn(a){let[l,p]=ha(a.address);Q(l),Pe(p),T(a.city),ze(a.zip_code),a.country&&ft(a.country),a.phone&&_e(a.phone),ot({country:a.country||null,state:a.state??""})}J(()=>{if(yt){if((yt.country||D)!==D){ot(null);return}jt===D&&(gt(ga(D,yt.state,at)),ot(null))}},[yt,D,jt,at]),J(()=>{let a=!1;return(async()=>{try{let[l,p,N]=await Promise.all([Ze.me(),Ze.myProfile().catch(()=>null),Ze.myAddresses().catch(()=>[])]);if(a)return;hn(l);let g=N.filter(K=>K.is_active);bn(g),me(l.email);let M=(p?.contact_name??"").split(/\s+/);x(l.first_name||M[0]||""),rt(l.last_name||M.slice(1).join(" "));let R=l.phone||p?.phone;R&&_e(R);let ne=g.find(K=>K.id===l.default_delivery_location)??g[0];if(ne)Ut(ne.id),qn(ne);else if(p){let[K,re]=ha(p.address??"");Q(K),Pe(re),T(p.city??""),ze(p.zip_code??""),p.country&&ft(p.country),ot({country:p.country||null,state:p.state??""})}}catch{}})(),()=>{a=!0}},[]);function oo(){Ze.logout(),hn(null),bn([]),Ut("new"),Cn(!1),me(""),x(""),rt(""),j(""),Q(""),Pe(""),T(""),ze(""),_e(""),ft(O||k[0]?.code||""),gt(""),ot(null)}let Ve=ya(()=>ba(e,{canParkContext:he}),[e,he]);J(()=>{Ve.some(a=>a.key===q)||oe(Ve[0]?.key??null)},[Ve,q]);let io=Ve.length===0,Ct=Le.trim()?`${Be}
|
|
4
|
+
${Le.trim()}`:Be,so=ra({email:le,firstName:$,lastName:Z,company:Ye.trim(),phone:Ne,address:Ct,city:be,subdivision:Se,postcode:G,country:D,lines:r.map(a=>[a.id,a.qty]),shippingMethodId:f,couponCode:Gt(s),currency:o.currency,shopperId:ht?.id??null}),ee=JSON.stringify([so,q]),Re=H(null),Bt=H(null),kt=H(!1),Ce=H(!1),Xe=H(null),wt=H(!1),ce=H(ee);ce.current=ee;let Mn=H(pe);Mn.current=pe;let Dn=()=>Ce.current&&ce.current!==Re.current,Me=H(null);J(()=>{Mn.current||(ee!==Me.current&&(Me.current=null),!(!Ce.current||!se||se.orderNumber)&&(ee===Re.current||ee===Me.current||Pt(se)))},[ee,se]);async function Pt(a){if(wt.current)return null;wt.current=!0,B(!0);try{let l=Xe.current?await ea(Xe.current):"none";if(l==="succeeded"||l==="processing")return Ce.current=!1,ve(null),ke("card"),l==="succeeded"?await De(void 0,a):Hn(a),null;if(l===void 0||!ta.has(l))return Me.current=ce.current,ve(a),ie(l==="requires_action"?Zr:Oe),null;let p=await rn(it);if(p==="committed")return Ce.current=!1,ve(null),ke("card"),await De(void 0,a),null;if(p!=="released")return Me.current=ce.current,ve(a),ie(Oe),null;Ce.current=!1,Xe.current=null,Me.current=null,ie(null),ve(null);let N=Qe();return bt(N),N}finally{wt.current=!1,B(!1)}}async function co(){if(!(n||pe||wt.current)){if(se){if((Ce.current?ee!==Re.current:ct())&&!se.orderNumber){let N=await Pt(se);N&&ce.current===ee&&await jn(N);return}B(!0),ie(null),kt.current=!1,await zt();let l=Ue(ce.current)[1],p=se.orderNumber?l:"card";if(p&&xa.has(p)&&ct()&&Ue(ce.current)[0]!==Bt.current){Kn(se);return}ke(p),p!==q&&oe(p),await Gn(se,p,!se.orderNumber);return}await jn(it)}}async function jn(a){if(r.length===0||o.repricing||!q||!Ve.some(R=>R.key===q))return;let l=r.filter(dt).flatMap(R=>ir(R.components,R.qty));if(l.length===0){ie("Pick a size on each wheel's product page before checking out.");return}B(!0),ie(null);let p,N=a,g=q,M=!1;try{let R=ht?U.createOrderAuthed:U.createOrder,ne=vr(),K={customer:{email:le,name:`${$} ${Z}`.trim(),phone:Ne.trim()||void 0,companyName:Ye.trim()||void 0,address:Ct,city:be,state:Se||void 0,zipCode:G,country:D},items:l,currency:o.currency,idempotencyKey:a,shippingMethodId:f??void 0,couponCode:Gt(s),...ne==="denied"?{}:ca(),...ne?{adConsent:ne}:{},...Vr(q)?{checkoutFlow:tn}:{}};Fe.current=()=>R(K),wn(null),Bt.current=null,kt.current=!1,Xe.current=null,Ce.current=!1,Me.current=null,Re.current=ee,st.current=r;let re=qe.current,Xn=re?.key===K.idempotencyKey&&(re.shape!==ee&&(!!K.checkoutFlow||!!re.method||!!re.plainMethod)||!!K.checkoutFlow&&!!re.plainMethod);Xn&&(Je.current=K.idempotencyKey);let Zn=Yn(K,R),Qn=Xn||!K.checkoutFlow&&Je.current===K.idempotencyKey,er=!Zn&&!Qn&&!K.checkoutFlow&&!!re&&!re.method;er&&(re.plainMethod=q,re.plainLines=r,re.plainShape=ee);let je=await(Qn?Wn(K,R):R(K).then(lt=>({answer:lt,request:K})).catch(lt=>(Zn?Un(lt,K.idempotencyKey):er&&on(lt)&&(re.plainMethod=""),lo(lt,K,R))));if(!je)return;p=je.answer,N=je.request.idempotencyKey,g=je.method??g,ke(g),M=ct()||g!==Ue(ce.current)[1],je.method&&je.method!==q&&oe(je.method),p.orderNumber&&(Bn(p),P()),await zt()}catch(R){let ne=or(R);ne?(u(ne),ie(`${ne} Your order has not been placed. Place it again to continue without the code.`)):R instanceof tt?ie(Oe):ie(R instanceof de?R.message:"Could not place the order. Please try again."),B(!1);return}if(g&&xa.has(g)&&(M||ct())){Kn(p);return}await Gn(p,g,!1,N)}function Kn(a){Bt.current=Ue(ce.current)[0],ie(`${va(a,null)} ${nn}`),ve(a),B(!1)}function Un(a,l){on(a)&&!an(a)&&qe.current?.key===l&&(qe.current=null)}async function lo(a,l,p){if(Tt(a))return $n(l,p);if(!an(a))throw a;return Je.current=l.idempotencyKey,Wn(l,p,!0)}async function Wn(a,l,p=!1){let N=await rn(a.idempotencyKey);if(N==="released")return ce.current===ee?$n(a,l):(bt(Qe()),B(!1),null);if(N!=="committed")throw new tt;let g=qe.current?.key===a.idempotencyKey?qe.current:null;if(st.current=g?.lines??r,g?.method&&!p){Je.current=null,Fe.current=g.send;let ne=await g.send().catch(()=>{throw new tt});return Re.current=g.shape,{answer:ne,request:a,method:g.method}}let M=g&&!g.method?g.send:()=>l({...a,checkoutFlow:tn});Fe.current=M;let R=await M().catch(()=>null);if(!R&&g?.plainMethod)throw new tt;return R?.orderNumber&&R.status!==Xr?(Je.current=null,g?.plainMethod&&(st.current=g.plainLines),g&&(Re.current=g.plainMethod?g.plainShape:g.shape),{answer:R,request:a,method:g?.plainMethod||void 0}):(B(!1),g&&(Re.current=g.shape),ke("card"),await zn("",R?async()=>R:()=>Promise.reject(new Error("The order request did not answer."))),await zt(),null)}function ct(){let a=Re.current;return a!==null&&Ue(a)[0]!==Ue(ce.current)[0]}function ke(a){a!==Ue(ce.current)[1]&&(kt.current=!0),wn(kt.current||ct()?nn:null)}async function $n(a,l){let p={...a,idempotencyKey:Qe()};Je.current=null,bt(p.idempotencyKey),Fe.current=()=>l(p),Yn(p,l);try{return{answer:await l(p),request:p}}catch(N){throw Un(N,p.idempotencyKey),N}}function Yn(a,l){return qe.current?.key===a.idempotencyKey?!1:(qe.current={key:a.idempotencyKey,send:()=>l(a),lines:r,shape:ee,method:a.checkoutFlow?"":q??"",plainMethod:"",plainLines:r,plainShape:ee},!0)}function Bn(a){cr({confirmation:a,lines:st.current,adsSendTo:e.googleAdsId&&e.googleAdsConversionLabel?`${e.googleAdsId}/${e.googleAdsConversionLabel}`:null}),pa({confirmation:a,lines:st.current})}async function De(a,l=Ee){if(!l)return;let p=a?async()=>a:Fe.current;if(l.orderNumber||!p){Ge(!0),fe(l);return}await zn(l.checkoutNumber,p)}async function zn(a,l){P(),await aa({checkoutNumber:a,resend:l,page:{setConfirming:no,land:fe,markPaid:()=>Ge(!0),track:Bn,unplaced:Tn}})}function Hn(a=Ee){if(a){if(a.orderNumber){fe(a);return}P(),Tn({kind:"processing",checkoutNumber:a.checkoutNumber})}}async function zt(){let a=JSON.stringify([Wt.trim(),$,Z,Ne.trim(),Ct,be,Se,G,D]);if(!(!ht||!xn||vn!=="new"||Pn.current===a))try{await Ze.createAddress({label:Wt.trim()||"Home",contact_name:`${$} ${Z}`.trim(),phone:Ne.trim(),address:Ct,city:be,zip_code:G,state:Se,country:D}),Pn.current=a,kn("Address saved to your account.")}catch{kn("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}}async function Gn(a,l=q,p=!1,N=it){ve(null);try{if(l==="card"&&e.paymentMethods.includes("card")){let g=await U.createPaymentIntent({idempotencyKey:N});if(Xe.current=g,p&&Dn()){await Pt(a);return}let M=a;if(p){let R=await Fe.current?.().catch(()=>null);if(R?.orderNumber){ke("card"),await De(R,a);return}if(M=Jn(a,R)??{...a,expiresAt:null},Dn()){await Pt(a);return}}ke("card"),He(M),$t(!1),vt(g)}else if(l==="paypal"&&e.paymentMethods.includes("paypal"))He(a),za(!0);else if(l==="afterpay"&&e.paymentMethods.includes("afterpay")){let g=window.location.origin,M=await U.createAfterpayCheckout({idempotencyKey:N,confirmUrl:`${g}/checkout?afterpay=confirm`,cancelUrl:`${g}/checkout?afterpay=cancel`}),R={idempotencyKey:N,confirmation:a};ue.setItem(sn,JSON.stringify(R)),window.location.assign(M.redirectCheckoutUrl);return}else if(l==="square"&&e.paymentMethods.includes("square"))He(a),Ha(!0);else if(l==="gocardless"&&e.paymentMethods.includes("gocardless")){let g=window.location.origin,M=await U.createGocardlessBillingRequest({idempotencyKey:N,confirmUrl:`${g}/checkout?gocardless=confirm`,cancelUrl:`${g}/checkout?gocardless=cancel`}),R={idempotencyKey:N,confirmation:a};ue.setItem(_t,JSON.stringify(R)),window.location.assign(M.authorisationUrl);return}else if(l==="zip"&&e.paymentMethods.includes("zip")){let g=window.location.origin,M=await U.createZipCheckout({idempotencyKey:N,redirectUrl:`${g}/checkout?zip=return`}),R={idempotencyKey:N,confirmation:a};ue.setItem(cn,JSON.stringify(R)),window.location.assign(M.redirectUrl);return}else if(l==="klarna"&&e.paymentMethods.includes("klarna")){let g=window.location.origin,M=await U.createKlarnaCheckout({idempotencyKey:N,confirmUrl:`${g}/checkout?klarna=confirm`,cancelUrl:`${g}/checkout?klarna=cancel`}),R={idempotencyKey:N,confirmation:a};ue.setItem(Ft,JSON.stringify(R)),window.location.assign(M.redirectUrl);return}else ke(l),fe(a)}catch(g){if((p||l==="card")&&g instanceof de&&g.status===409){ke(l),await De(void 0,a);return}Vn(a,g),B(!1)}}function Jn(a,l){return l&&!l.orderNumber&&l.status==="open"&&l.checkoutNumber===a.checkoutNumber?l:null}function Vn(a,l){ie(va(a,l)),!a.orderNumber&&Tt(l)?(Ce.current=!1,bt(Qe())):ve(a)}async function uo(a){if(!Ee)return;let l=Ee;try{let p=await U.createPaymentIntent({idempotencyKey:it}),N=await Fe.current?.().catch(()=>null);if(N?.orderNumber){await De(N);return}let g=Jn(l,N);He(g??{...l,expiresAt:null}),$t(a&&g!==null),Xe.current=p,vt(p)}catch(p){if(p instanceof de&&p.status===409){await De();return}vt(null),He(null),Vn(l,p),B(!1)}}function po(){Ee&&(Ce.current=!0,ve(Ee),vt(null),He(null),$t(!1),B(!1))}return{site:e,logo:t,items:r,totals:o,coupon:s,deliveryOptions:m,courierUnavailable:ja,retryCourier:Ka,shippingMethodId:f,setShippingMethodId:d,pickupLocation:V,servedCountries:k,formatMoney:X,payChoice:q,setPayChoice:oe,placing:pe,email:le,setEmail:me,firstName:$,setFirstName:x,lastName:Z,setLastName:rt,company:Ye,setCompany:j,address1:Be,setAddress1:Q,address2:Le,setAddress2:Pe,city:be,setCity:T,postcode:G,setPostcode:ze,phone:Ne,setPhone:_e,country:D,setCountry:ft,subdivision:Se,setSubdivision:gt,subdivisions:at,destination:gn,postcodeLabel:Ma,subdivisionLabel:Da,me:ht,savedAddresses:Ua,selectedAddressId:vn,setSelectedAddressId:Ut,saveAddress:xn,setSaveAddress:Cn,saveLabel:Wt,setSaveLabel:Wa,addressSaveNote:$a,lostChangeNote:Ya,idemKey:it,confirmation:Nn,setConfirmation:fe,orderError:Ba,payment:Sn,paypalStep:En,squareStep:Rn,pendingConf:Ee,paid:Ga,setPaid:Ge,unpaidOrder:se,payNote:Ja,afterpayConfirming:Va,gocardlessConfirming:Za,zipConfirming:Qa,klarnaConfirming:to,cardConfirming:In,checkoutResult:Yt,confirmCardPayment:De,cardStillProcessing:Hn,renewCardPayment:uo,holdRenewed:ro,leaveCardPayment:po,checkoutRootRef:Fn,setCheckoutHeaderEl:ao,fillFromAddress:qn,checkoutSignOut:oo,payOptions:Ve,noPaymentMethod:io,placeOrder:co}}var wa=ai(null);function Pa({children:e,...t}){let n=ii(t);return we(wa.Provider,{value:n,children:e})}function Ae(){let e=oi(wa);if(!e)throw new Error("useCheckout must be used inside CheckoutStateProvider");return e}import{useId as un}from"react";import{Fragment as Ie,jsx as i,jsxs as S}from"react/jsx-runtime";function Sa(){let{email:e,setEmail:t,firstName:n,setFirstName:r,lastName:o,setLastName:s,company:u,setCompany:m,me:f,checkoutSignOut:d}=Ae(),y=un();return S(Mt,{num:"N\xB0 01",title:"Contact",children:[i(ae,{label:"Email",htmlFor:y,hint:f?S(Ie,{children:["Signed in \xB7"," ",i("button",{type:"button",onClick:d,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:i("input",{id:y,type:"email",value:e,onChange:h=>t(h.target.value),placeholder:"you@example.com",readOnly:f!==null,className:te+(f?" opacity-70":"")})}),S(Ia,{children:[i(ae,{label:"First name",children:i("input",{type:"text",value:n,onChange:h=>r(h.target.value),className:te})}),i(ae,{label:"Last name",children:i("input",{type:"text",value:o,onChange:h=>s(h.target.value),className:te})})]}),i(ae,{label:"Company (optional)",children:i("input",{type:"text",value:u,onChange:h=>m(h.target.value),autoComplete:"organization",className:te})})]})}function Ea(){let{pickupLocation:e,servedCountries:t,address1:n,setAddress1:r,address2:o,setAddress2:s,city:u,setCity:m,postcode:f,setPostcode:d,phone:y,setPhone:h,country:C,setCountry:b,subdivision:P,setSubdivision:E,subdivisions:A,destination:V,postcodeLabel:O,subdivisionLabel:k,me:W,savedAddresses:X,selectedAddressId:q,setSelectedAddressId:oe,saveAddress:he,setSaveAddress:Te,saveLabel:pe,setSaveLabel:B,fillFromAddress:le}=Ae(),me=un(),$=un();return S(Mt,{num:"N\xB0 02",title:e?"Collection":"Shipping address",children:[e?S("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[i("span",{className:"font-medium",children:e.name}),[e.address,e.city,e.state,e.zipCode,e.country].filter(Boolean).length>0&&i("span",{className:"opacity-80",children:[e.address,e.city,e.state,e.zipCode,e.country].filter(Boolean).join(", ")}),e.openingHours&&i("span",{className:"opacity-80",children:e.openingHours}),e.instructions&&i("span",{className:"opacity-80",children:e.instructions}),i("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):S(Ie,{children:[W!==null&&X.length>0&&S("div",{className:"grid gap-3",children:[X.map(x=>i(qt,{active:q===x.id,onClick:()=>{oe(x.id),le(x)},title:x.label,body:x.formatted_address,price:null},x.id)),i(qt,{active:q==="new",onClick:()=>oe("new"),title:"New address",body:null,price:null})]}),i(ae,{label:"Address line 1",children:i("input",{type:"text",value:n,onChange:x=>r(x.target.value),className:te})}),i(ae,{label:"Address line 2",children:i("input",{type:"text",value:o,onChange:x=>s(x.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:te})}),S(Ia,{cols:"three",children:[i(ae,{label:"City",children:i("input",{type:"text",value:u,onChange:x=>m(x.target.value),className:te})}),i(ae,{label:O,children:i("input",{type:"text",value:f,onChange:x=>d(x.target.value),className:te})}),i(ae,{label:"Country",separate:!0,htmlFor:me,children:i(Vt,{id:me,value:C,onChange:x=>b(x.target.value),className:te+" pr-10",style:Na,children:t.map(x=>i("option",{value:x.code,children:x.name},x.code))})})]}),i(ae,{label:k,separate:!0,htmlFor:$,children:A.length>0?S(Vt,{id:$,value:P,onChange:x=>E(x.target.value),className:te+" pr-10",style:Na,children:[i("option",{value:"",children:"Select\u2026"}),A.map(x=>i("option",{value:x.code||x.name,children:x.name},x.code||x.name))]}):i("input",{id:$,type:"text",value:P,onChange:x=>E(x.target.value),className:te})})]}),i(ae,{label:"Phone",children:i("input",{type:"tel",value:y,onChange:x=>h(x.target.value),className:te})}),!e&&W!==null&&q==="new"&&S(Ie,{children:[i(si,{checked:he,onChange:Te,label:"Save this address to my account"}),he&&i(ae,{label:"Address label",children:i("input",{type:"text",value:pe,onChange:x=>B(x.target.value),placeholder:"Home",className:te})})]})]})}function Ra(){let{totals:e,coupon:t,deliveryOptions:n,shippingMethodId:r,setShippingMethodId:o,pickupLocation:s,formatMoney:u,city:m,destination:f,courierUnavailable:d,retryCourier:y}=Ae();return i(Mt,{num:"N\xB0 03",title:"Shipping",children:S("div",{className:"grid gap-3",children:[n.map(h=>{let C=h.pickupLocation,b=C?[C.address,C.city,C.state,C.zipCode].filter(Boolean).join(", "):null;return i(qt,{active:r===h.id,onClick:()=>o(h.id),title:C?`${h.name} \u2014 ${C.name}`:h.name,body:C?[b,C.openingHours,C.instructions,h.description].filter(Boolean).join(" \xB7 "):h.description||null,price:e.freeShipping||h.amount===0?Nt:u(h.amount,e.currency),tag:h.tag||void 0},h.id)}),d?S("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:[ka," ",i("button",{type:"button",onClick:y,className:"underline transition-colors hover:text-accent",children:"Try again"})]}):n.length===0&&i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})})}function Oa(){let{payChoice:e,setPayChoice:t,placing:n,payment:r,payOptions:o,noPaymentMethod:s}=Ae();return S(Mt,{num:"N\xB0 04",title:"Payment",children:[s&&i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:Ca}),i("div",{className:"grid gap-3",children:o.map(u=>i(qt,{active:e===u.key,onClick:()=>t(u.key),title:u.title,body:u.body,price:u.price,tag:u.tag},u.key))}),e==="card"?i("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."}):e==="paypal"?i("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."}):e==="afterpay"?i("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."}):e==="square"?i("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."}):e==="gocardless"?i("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."}):e==="zip"?i("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."}):e==="klarna"?i("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."}):e==="bank"?i("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."}):null]})}function Aa(){let{site:e,items:t,totals:n,coupon:r,formatMoney:o,payChoice:s,placing:u,email:m,orderError:f,payment:d,noPaymentMethod:y,unpaidOrder:h,placeOrder:C}=Ae();return S("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-view-desktop:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[S("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[i("span",{children:"Your order"}),i(ge,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit \u2197"})]}),i("div",{className:"flex flex-col px-6 py-2",children:t.length===0?S("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",i(ge,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):t.map(b=>i(ci,{slug:b.slug,name:b.name,qty:b.qty,config:b.config,configSummary:li(b.config),price:pr(b,n.currency)??0,currency:n.currency},b.id))}),i("div",{className:"border-t border-line px-6 pt-5",children:i(hr,{customerEmail:m})}),S("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[i(We,{label:"Subtotal",value:o(n.subtotal,n.currency)}),n.discount>0&&r?.valid&&i(We,{label:`Coupon \xB7 ${r.code}`,value:S("span",{className:"font-semibold text-green",children:["\u2212 ",o(n.discount,n.currency)]})}),r?.deferred&&i(We,{label:`Coupon \xB7 ${r.code}`,value:ar}),r?.valid&&r.effects?.gift&&i(We,{label:`Free gift \xB7 ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` \xD7${r.effects.gift.quantity}`:""}`,value:i("span",{className:"font-semibold text-green",children:Nt})}),i(We,{label:"Shipping",value:n.shippingStatus==="free"?i("span",{className:"font-semibold text-green",children:Nt}):ur(n.shippingStatus)??o(n.shipping,n.currency)}),n.tax&&(n.tax.charged?i(We,{label:n.tax.inclusive?`${n.tax.name} included \xB7 ${n.tax.rate}%`:n.tax.name,value:o(n.tax.amount,n.currency)}):n.tax.name?i(We,{label:n.tax.name,value:lr}):null)]}),S("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:[i("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),i("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:n.repricing?"\u2026":o(n.grand,n.currency)})]}),S("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[f&&i(Ke,{role:"alert",children:f}),n.hasUnpricedLine&&S(Ke,{role:"status",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),i("button",{type:"button",onClick:C,disabled:u||!h&&(y||t.length===0||n.hasUnpricedLine||n.repricing),className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",u||!h&&(t.length===0||y||n.hasUnpricedLine||n.repricing)?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:u?S(Ie,{children:["Building order\u2026 ",i("span",{children:"\xB7"})]}):y?S(Ie,{children:["No online payment ",i("span",{children:"\xB7"})]}):h?S(Ie,{children:["Try payment again \xB7 ",Lt(h),i("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]}):n.repricing?S(Ie,{children:["Updating total\u2026 ",i("span",{children:"\xB7"})]}):S(Ie,{children:[s==="bank"?"Place order":"Continue to payment"," \xB7"," ",o(n.grand,n.currency),i("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})})]})]})}var Na={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 Mt({num:e,title:t,children:n}){return S("section",{className:"mb-6 border border-line bg-bg",children:[S("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[i("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e}),i("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:t})]}),i("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function Ia({cols:e="two",children:t}){return i("div",{className:["grid gap-3 max-[640px]:grid-cols-1",e==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:t})}function qt({active:e,onClick:t,title:n,body:r,price:o,tag:s}){return S("button",{type:"button",onClick:t,"aria-pressed":e,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",e?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:e?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[e&&i("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),i("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",e?"border-accent":"border-fg-dim"].join(" "),children:e&&i("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),S("span",{className:"flex min-w-0 flex-col gap-1",children:[S("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,s&&i("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:s})]}),r&&i("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),i("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:o})]})}function si({checked:e,onChange:t,label:n,sub:r}){return S("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[i("button",{type:"button",onClick:()=>t(!e),"aria-pressed":e,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",e?"border-accent":"border-line"].join(" "),style:e?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:e&&i("span",{className:"text-[13px] text-accent",children:"\u2713"})}),S("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,r&&i("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:r})]})]})}function ci({slug:e,name:t,qty:n,config:r,configSummary:o,price:s,currency:u}){let{catalog:m}=St(),{formatMoney:f}=ye(),d=m.find(E=>E.slug===e),y=d?.spokes??5,h=d?.mesh??!1,C=r.find(E=>E.gold)?.label,b=d?.finishes.find(E=>E.name===C&&E.src)??d?.finishes.find(E=>E.src),P=d?.finishes[0]?.color??yr;return S("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[S("div",{className:"relative aspect-square",children:[i("div",{className:"flex h-full w-full items-center justify-center overflow-hidden border border-line bg-surface",children:b?.src?i(tr,{src:b.src,alt:`${t.lead}${t.accent} \u2014 ${b.name}`,width:120,height:120,sizes:"60px",className:"block h-full w-full object-contain p-2"}):i("div",{className:"block w-[78%]",style:{color:P},children:i(gr,{spokes:y,mesh:h,className:"block w-full"})})}),i("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})]}),S("div",{className:"flex min-w-0 flex-col gap-0.5",children:[S("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[t.lead,i("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:t.accent})]}),i("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:o})]}),i("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:f(s,u)})]})}function We({label:e,value:t}){return S("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[i("span",{children:e}),i("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:t})]})}function li(e){return e.map(t=>t.label).join(" \xB7 ")}import{Fragment as Y,jsx as c,jsxs as v}from"react/jsx-runtime";function mn(e){return c(Pa,{...e,children:c(pi,{})})}function ui({order:e,paid:t}){let{formatMoney:n}=ye();if(!e.grandTotal||!e.currency)return null;let r=u=>n(Number(u),e.currency),o=Number(e.freightCharge??0),s=Number(e.discountAmount??0);return v("dl",{className:"grid w-full max-w-sm grid-cols-[1fr_auto] gap-x-6 gap-y-1 border-y border-line py-3 text-left text-sm",children:[(e.shippingMethod||o>0)&&v(Y,{children:[v("dt",{className:"text-fg-dim",children:["Delivery",e.shippingMethod?` \xB7 ${e.shippingMethod}`:""]}),c("dd",{className:"text-right font-mono",children:r(e.freightCharge??"0")})]}),s>0&&v(Y,{children:[v("dt",{className:"text-fg-dim",children:["Discount",e.couponCode?` \xB7 ${e.couponCode}`:""]}),v("dd",{className:"text-right font-mono",children:["\u2212",r(e.discountAmount??"0")]})]}),c("dt",{className:"text-fg",children:t?"Total paid":"Order total"}),c("dd",{className:"text-right font-mono text-fg",children:r(e.grandTotal)})]})}function di({result:e,lostChangeNote:t=null}){let n=c("span",{className:"font-mono text-fg",children:e.checkoutNumber});return v("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:e.kind==="refunded"||e.kind==="expired"?"Order not placed":e.kind==="processing"?"Payment processing":"Payment received"}),c("p",{className:"text-fg-dim",children:e.kind==="refunded"?v(Y,{children:["An item sold out or an offer ended while you paid for checkout ",n,". Your payment goes back to your card."]}):e.kind==="expired"?v(Y,{children:["The hold on checkout ",n," ran out before your payment arrived. Your payment goes back to your card."]}):e.kind==="processing"?v(Y,{children:["Your payment for checkout ",n," is being processed. When it goes through, we will email your order confirmation."]}):v(Y,{children:["Thank you \u2014 your payment",e.checkoutNumber?v(Y,{children:[" for checkout ",n]}):null," has gone through. We will email you the order number shortly."]})}),t&&e.kind!=="refunded"&&e.kind!=="expired"&&c("p",{className:"text-sm text-fg-dim",children:t}),c(ge,{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"})]})}function pi(){let{site:e,logo:t,items:n,placing:r,email:o,me:s,addressSaveNote:u,lostChangeNote:m,idemKey:f,confirmation:d,setConfirmation:y,payment:h,paypalStep:C,squareStep:b,pendingConf:P,paid:E,setPaid:A,payNote:V,afterpayConfirming:O,gocardlessConfirming:k,zipConfirming:W,klarnaConfirming:X,cardConfirming:q,checkoutResult:oe,confirmCardPayment:he,cardStillProcessing:Te,renewCardPayment:pe,holdRenewed:B,leaveCardPayment:le,checkoutRootRef:me,setCheckoutHeaderEl:$}=Ae();return d?v("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:E?"Payment received":"Order received"}),v("p",{className:"text-fg-dim",children:[E?v(Y,{children:["Thank you \u2014 your payment for order"," ",c("span",{className:"font-mono text-fg",children:d.orderNumber})," has gone through."," "]}):v(Y,{children:["Thank you \u2014 your order ",c("span",{className:"font-mono text-fg",children:d.orderNumber})," is being reviewed by our team."," "]}),s?v(Y,{children:["Track it under"," ",c(ge,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):c(Y,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),c(ui,{order:d,paid:E}),m&&c("p",{className:"text-sm text-fg-dim",children:m}),V&&c("p",{className:"text-sm text-fg-dim",children:V}),u&&c("p",{className:"text-sm text-fg-dim",children:u}),!s&&v("p",{className:"text-sm text-fg-dim",children:["You can also"," ",c(ge,{href:`/track?order=${encodeURIComponent(d.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),c(ge,{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"})]}):oe?c(di,{result:oe,lostChangeNote:m}):q?v("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Placing your order \u2014 one moment."})]}):O?v("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):k?v("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):W?v("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):X?v("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):h&&P?c(mi,{payment:h,checkout:P,holdRenewed:B,onPaid:he,onProcessing:Te,onRenew:pe,onBack:le}):C&&P?c(hi,{confirmation:P,clientId:e.paypalClientId??"",idemKey:f,onPaid:()=>{A(!0),y(P)},onSkip:()=>y(P)}):b&&P?c(vi,{confirmation:P,applicationId:e.squareApplicationId??"",locationId:e.squareLocationId??"",environment:e.squareEnvironment??"production",idemKey:f,onPaid:()=>{A(!0),y(P)},onSkip:()=>y(P)}):v("div",{ref:me,className:"bg-bg text-fg",children:[v("header",{ref:$,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[v(ge,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",c("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),c(ge,{href:"/","aria-label":`${e.name} home`,className:"inline-flex items-center justify-center",children:c(br,{variant:"header",scrolled:!0,src:t?.url??null,reverse:t?.reverse??!1,reversedSrc:t?.reversed??null,inkIsDark:t?.inkIsDark??null,size:t?.size??"medium",sizePx:t?.sizePx??null,sizeUnit:t?.sizeUnit??null,siteName:e.name})}),e.cardPayments?v("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[c("span",{className:"text-green",children:"\u25CF"}),c("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):c("span",{})]}),v("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-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",children:[c("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),c("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(x=>v("span",{className:["relative flex items-center gap-2 transition-colors",x.state==="pending"?"text-fg-dim":"text-fg",x.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[c("span",{className:x.state==="done"?"text-accent font-bold":"",children:x.n}),c("span",{children:x.label})]},x.n))})]}),v("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-view-desktop:grid-cols-1 max-view-desktop:gap-10 max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))] max-view-desktop:pt-8 max-view-desktop:pb-20",children:[v("div",{children:[c(Sa,{}),c(Ea,{}),c(Ra,{}),c(Oa,{})]}),c(Aa,{})]}),c("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:c("span",{children:fr({legalName:e.legalName,foundedYear:e.foundedYear,siteName:e.name})})})]})}function mi({payment:e,checkout:t,holdRenewed:n,onPaid:r,onProcessing:o,onRenew:s,onBack:u}){let{formatMoney:m}=ye(),f=c("span",{className:"text-fg",children:m(Number(e.amount),e.currency)}),d=Ta(()=>It(e.publishableKey),[e.publishableKey]),y=Ta(()=>xr(),[]);return c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:v("div",{className:"w-full max-w-xl border border-line bg-bg",children:[v("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[c("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:Lt(t)}),c("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),v("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:t.orderNumber?v(Y,{children:["Your order is placed. Pay ",f," by card to confirm it now."]}):n?v(Y,{children:["Your hold ran out, so your items are held again",t.expiresAt?` until ${La(t.expiresAt)}`:"",". Enter your card again, then pay ",f,"."]}):v(Y,{children:["Your items are held",t.expiresAt?` until ${La(t.expiresAt)}`:"",". Pay ",f," by card to place your order."]})}),c(en,{stripe:d,options:{clientSecret:e.clientSecret,appearance:y},children:c(gi,{payment:e,checkout:t,onPaid:r,onProcessing:o,onRenew:s,onBack:u})},e.clientSecret)]})]})})}function La(e){return new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}var fi=5;function gi({payment:e,checkout:t,onPaid:n,onProcessing:r,onRenew:o,onBack:s}){let{formatMoney:u}=ye(),m=Wr(),f=Kr(),[d,y]=$e(!1),[h,C]=$e(null),b=nt(!1);async function P(){try{return(await m.retrievePaymentIntent(e.clientSecret)).paymentIntent?.status}catch{return}}async function E(O){let k=O;for(let W=0;k==="processing"&&W<fi;W+=1)await new Promise(X=>setTimeout(X,1e3)),k=await P()??k;if(k==="succeeded"){n();return}if(k==="processing"){r();return}C("Payment did not complete. Please try again."),y(!1)}async function A(){if(!m||!f||d)return;y(!0),C(null),b.current=!0;let O=await m.confirmPayment({elements:f,redirect:"if_required"}).catch(()=>null);if(!O){let k=await P();if(k==="succeeded"||k==="processing"){await E(k);return}C(k===void 0?Oe:"Payment failed. Please try again."),y(!1);return}if(O.error){if(!t.orderNumber&&O.error.code==="payment_intent_unexpected_state"){let k=await P();if(k==="succeeded"||k==="processing"){await E(k);return}if(k===void 0){C(Oe),y(!1);return}await o(k==="canceled"),y(!1);return}C(O.error.message??"Payment failed. Please try again."),y(!1);return}await E(O.paymentIntent?.status)}async function V(){if(d)return;if(!b.current){s();return}y(!0),C(null);let O=await P();if(O==="succeeded"||O==="processing"){await E(O);return}if(y(!1),O===void 0){C(Oe);return}s()}return v("div",{className:"flex flex-col gap-4",children:[c($r,{}),h&&c(Ke,{role:"alert",children:h}),c("button",{type:"button",onClick:A,disabled:!m||!f||d,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!m||!f||d?"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:d?v(Y,{children:["Processing\u2026 ",c("span",{children:"\xB7"})]}):v(Y,{children:["Pay ",u(Number(e.amount),e.currency),c("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),!t.orderNumber&&!d&&v("button",{type:"button",onClick:V,className:"inline-flex items-center gap-3 self-start font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",c("span",{children:"Back to checkout"})]})]})}var _a="paypal-sdk-js",dn=null;function yi(e,t){let n=`${e}|${t}`;if(dn?.key===n)return dn.promise;let r=new Promise((o,s)=>{document.getElementById(_a)?.remove();let u=document.createElement("script");u.id=_a;let m=new URLSearchParams({"client-id":e,currency:t,intent:"capture"});u.src=`https://www.paypal.com/sdk/js?${m}`,u.onload=()=>{let f=window.paypal;f?o(f):s(new Error("PayPal SDK loaded without its namespace"))},u.onerror=()=>s(new Error("PayPal SDK failed to load")),document.head.appendChild(u)});return dn={key:n,promise:r},r}function hi({confirmation:e,clientId:t,idemKey:n,onPaid:r,onSkip:o}){let{formatMoney:s}=ye(),u=nt(null),[m,f]=$e(!1),[d,y]=$e(null),h=nt(r);return h.current=r,qa(()=>{let C=!1,b=null;return yi(t,e.currency).then(P=>{if(!(C||!u.current))return b=P.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await U.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async E=>{try{if((await U.capturePaypalOrder({idempotencyKey:n,paypalOrderId:E.orderID})).status==="paid"){h.current();return}y("PayPal did not complete the payment. Please try again.")}catch(A){y(A instanceof de?A.message:"PayPal payment failed. Please try again.")}},onError:()=>{y("PayPal could not process the payment. Please try again.")}}),b.render(u.current).then(()=>{C||f(!0)})}).catch(()=>{C||y("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{C=!0,b?.close?.()}},[t,e.currency,n]),c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:v("div",{className:"w-full max-w-xl border border-line bg-bg",children:[v("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[c("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e.orderNumber}),c("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),v("div",{className:"flex flex-col gap-4 px-6 py-6",children:[v("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",c("span",{className:"text-fg",children:s(Number(e.grandTotal),e.currency)})," ","with PayPal to confirm it now."]}),!m&&!d&&c("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),c("div",{ref:u}),d&&c(Ke,{role:"alert",children:d}),c("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 Fa="square-web-sdk",pn=null;function bi(e){let t=e==="sandbox"?"sandbox":"production";if(pn?.key===t)return pn.promise;let n=new Promise((r,o)=>{document.getElementById(Fa)?.remove();let s=document.createElement("script");s.id=Fa,s.src=t==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",s.onload=()=>{let u=window.Square;u?r(u):o(new Error("Square SDK loaded without its namespace"))},s.onerror=()=>o(new Error("Square SDK failed to load")),document.head.appendChild(s)});return pn={key:t,promise:n},n}function vi({confirmation:e,applicationId:t,locationId:n,environment:r,idemKey:o,onPaid:s,onSkip:u}){let{formatMoney:m}=ye(),f=nt(null),d=nt(null),y=nt(null),[h,C]=$e(!1),[b,P]=$e(!1),[E,A]=$e(null);qa(()=>{let O=!1,k=null;return bi(r).then(async W=>{if(O||!f.current)return;let X=W.payments(t,n);y.current=X,k=await X.card(),await k.attach(f.current),d.current=k,O||C(!0)}).catch(()=>{O||A("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{O=!0,k?.destroy?.()}},[t,n,r]);async function V(){let O=d.current;if(!(!O||b)){P(!0),A(null);try{let k=await O.tokenize();if(k.status!=="OK"||!k.token){A(k.errors?.[0]?.message??"Please check the card details and try again."),P(!1);return}let W;try{W=(await y.current?.verifyBuyer?.(k.token,{amount:String(e.grandTotal),currencyCode:e.currency,intent:"CHARGE"}))?.token}catch{}if((await U.chargeSquare({idempotencyKey:o,sourceId:k.token,...W?{verificationToken:W}:{}})).status==="paid"){s();return}A("Square did not complete the payment. Please try again.")}catch(k){A(k instanceof de?k.message:"Square payment failed. Please try again.")}P(!1)}}return c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:v("div",{className:"w-full max-w-xl border border-line bg-bg",children:[v("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[c("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e.orderNumber}),c("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),v("div",{className:"flex flex-col gap-4 px-6 py-6",children:[v("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",c("span",{className:"text-fg",children:m(Number(e.grandTotal),e.currency)})," ","by card to confirm it now."]}),!h&&!E&&c("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),c("div",{ref:f}),E&&c(Ke,{role:"alert",children:E}),c("button",{type:"button",onClick:V,disabled:!h||b,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!h||b?"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:b?v(Y,{children:["Processing\u2026 ",c("span",{children:"\xB7"})]}):v(Y,{children:["Pay ",m(Number(e.grandTotal),e.currency),c("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),c("button",{type:"button",onClick:u,disabled:b,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"})]})]})})}import{jsx as Dt}from"react/jsx-runtime";function xi(){let{settings:e,websiteName:t}=nr(),n=t?{...Jt,name:t}:Jt,r=e?{url:e.logoUrl,reversed:e.logoReversed??null,inkIsDark:e.logoInkIsDark??null,reverse:e.reverseLogo,size:e.logoSize,sizePx:e.logoSizePx,sizeUnit:e.logoSizeUnit??null}:null;return Dt("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:Dt(dr,{children:Dt(mr,{preview:!0,children:Dt(mn,{site:n,logo:r,preview:!0})})})})}export{xi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{ir as r}from"./chunk-4QN263UJ.js";import"./chunk-XEZ7BYVZ.js";import"./chunk-GOHV3G3C.js";import"./chunk-Y6SLVHK3.js";import{jsx as o}from"react/jsx-runtime";import e from"efficient-easel/screen/components/ScreenStoreProvider";function a(t){return o(e,{...t,parts:r})}export{a as default};
|