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.
Files changed (158) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/chunks/EditorPreviewCheckout-2FW4VEOK.js +4 -0
  3. package/dist/chunks/{SiteEditorProvider-JF3MS6J7.js → SiteEditorProvider-LW5QSBKM.js} +1 -1
  4. package/dist/chunks/chunk-4QN263UJ.js +412 -0
  5. package/dist/chunks/chunk-GOHV3G3C.js +1 -0
  6. package/dist/chunks/chunk-PWSMCGXO.js +1 -0
  7. package/dist/chunks/chunk-SEIKSSUW.js +1 -0
  8. package/dist/chunks/chunk-XEZ7BYVZ.js +1 -0
  9. package/dist/chunks/{fitment-data-KWJP5ZQB.js → fitment-data-BRGBDG7Y.js} +1 -1
  10. package/dist/consent.js +1 -1
  11. package/dist/contract.js +19 -3
  12. package/dist/editor/components/EditorPreviewCheckout.js +1 -1
  13. package/dist/editor/components/HeaderSettingsPanel.js +1 -1
  14. package/dist/editor/lib/document/blocks/commerce/Collections/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
  16. package/dist/editor/lib/document/blocks/commerce/WheelDiagram/fields.d.ts +2 -0
  17. package/dist/editor/lib/document/blocks/commerce/WheelDiagram/fields.js +1 -0
  18. package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
  19. package/dist/editor/lib/document/blocks/commerce/index.js +1 -1
  20. package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -1
  21. package/dist/editor/lib/document/box-header-for-site.d.ts +5 -0
  22. package/dist/editor/lib/document/box-header-for-site.js +1 -1
  23. package/dist/editor/lib/document/box-header.d.ts +2 -0
  24. package/dist/editor/lib/document/box-header.js +1 -1
  25. package/dist/editor/lib/document/config.d.ts +1 -0
  26. package/dist/editor/lib/document/config.js +1 -1
  27. package/dist/editor/lib/efficient-block-sources.js +1 -1
  28. package/dist/editor/lib/header-settings-source.js +1 -1
  29. package/dist/editor/lib/storefront-editor-words.d.ts +3 -1
  30. package/dist/editor/lib/storefront-editor-words.js +1 -1
  31. package/dist/editor.css +1 -1
  32. package/dist/index.d.ts +12 -1
  33. package/dist/index.js +229 -66
  34. package/dist/links.js +1 -1
  35. package/dist/render/app/globals.css +7 -4
  36. package/dist/render/built-with.json +1 -1
  37. package/dist/render/components/BundleCard.js +1 -1
  38. package/dist/render/components/CollectionCard.d.ts +3 -0
  39. package/dist/render/components/CollectionCard.js +1 -1
  40. package/dist/render/components/Collections.d.ts +2 -1
  41. package/dist/render/components/Collections.js +1 -1
  42. package/dist/render/components/CompatibleTyres.js +1 -1
  43. package/dist/render/components/ContactRouting.d.ts +6 -0
  44. package/dist/render/components/ContactRouting.js +1 -1
  45. package/dist/render/components/CountrySelect.js +1 -1
  46. package/dist/render/components/FooterGroup.js +1 -1
  47. package/dist/render/components/FooterLogo.js +1 -1
  48. package/dist/render/components/FooterPayment.js +1 -1
  49. package/dist/render/components/FooterSection.js +1 -1
  50. package/dist/render/components/FooterSocial.js +1 -1
  51. package/dist/render/components/FooterText.js +1 -1
  52. package/dist/render/components/GridCardTemplate.js +1 -1
  53. package/dist/render/components/Header.js +1 -1
  54. package/dist/render/components/ProductCard.js +1 -1
  55. package/dist/render/components/ProductHeroPanel.d.ts +3 -1
  56. package/dist/render/components/ProductHeroPanel.js +1 -1
  57. package/dist/render/components/SpecTable.d.ts +2 -1
  58. package/dist/render/components/SpecTable.js +1 -1
  59. package/dist/render/components/WheelCardFrame.d.ts +3 -10
  60. package/dist/render/components/WheelCardFrame.js +1 -1
  61. package/dist/render/components/WheelDiagram.d.ts +16 -0
  62. package/dist/render/components/WheelDiagram.js +1 -0
  63. package/dist/render/components/card-pieces/CardName.js +1 -1
  64. package/dist/render/components/card-pieces/CardPrice.js +1 -1
  65. package/dist/render/components/card-pieces/CardSurfaceFrame.d.ts +12 -0
  66. package/dist/render/components/card-pieces/CardSurfaceFrame.js +1 -0
  67. package/dist/render/components/card-pieces/ProductCardState.d.ts +1 -0
  68. package/dist/render/components/card-pieces/ProductCardState.js +1 -1
  69. package/dist/render/components/card-pieces/card-row.js +1 -1
  70. package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
  71. package/dist/render/components/catalog/ShopperChips.d.ts +7 -4
  72. package/dist/render/components/catalog/ShopperChips.js +1 -1
  73. package/dist/render/components/catalog/ShopperFilters.d.ts +1 -0
  74. package/dist/render/components/catalog/ShopperFilters.js +1 -1
  75. package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
  76. package/dist/render/components/checkout/checkout-parts.js +1 -1
  77. package/dist/render/components/checkout/checkout-state.d.ts +5 -0
  78. package/dist/render/components/checkout/checkout-state.js +3 -3
  79. package/dist/render/components/pdp-dynamic/DynamicSpecTable.d.ts +3 -0
  80. package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
  81. package/dist/render/components/pdp-dynamic/DynamicWheelDiagram.d.ts +6 -0
  82. package/dist/render/components/pdp-dynamic/DynamicWheelDiagram.js +1 -0
  83. package/dist/render/components/pdp-dynamic/KindGate.d.ts +2 -1
  84. package/dist/render/components/pdp-dynamic/KindGate.js +1 -1
  85. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  86. package/dist/render/components/wheels-plp/PlpFacetRows.d.ts +6 -4
  87. package/dist/render/components/wheels-plp/PlpFacetRows.js +1 -1
  88. package/dist/render/components/wheels-plp/PlpSidebar.d.ts +19 -14
  89. package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
  90. package/dist/render/components/wheels-plp/PlpTypePicker.d.ts +2 -5
  91. package/dist/render/lib/api/index.d.ts +6 -1
  92. package/dist/render/lib/api/index.js +1 -1
  93. package/dist/render/lib/api/types.d.ts +28 -0
  94. package/dist/render/lib/checkout/pay-first.d.ts +1 -0
  95. package/dist/render/lib/checkout/pay-first.js +1 -1
  96. package/dist/render/lib/consent/rules.js +1 -1
  97. package/dist/render/lib/content/collection-card-look.d.ts +13 -0
  98. package/dist/render/lib/content/collection-card-look.js +1 -0
  99. package/dist/render/lib/content/contact-card-seed.js +1 -1
  100. package/dist/render/lib/content/facet-row-seed.d.ts +14 -0
  101. package/dist/render/lib/content/facet-row-seed.js +1 -1
  102. package/dist/render/lib/content/filter-card-seed.js +1 -1
  103. package/dist/render/lib/content/hero-option-seed.js +1 -1
  104. package/dist/render/lib/content/square-box.d.ts +4 -0
  105. package/dist/render/lib/content/square-box.js +1 -0
  106. package/dist/render/lib/countries.js +1 -1
  107. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
  108. package/dist/render/lib/document/blocks/commerce/Collections/meta.d.ts +4 -0
  109. package/dist/render/lib/document/blocks/commerce/Collections/meta.js +1 -1
  110. package/dist/render/lib/document/blocks/commerce/Collections/render.js +1 -1
  111. package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.d.ts +4 -0
  112. package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.js +1 -1
  113. package/dist/render/lib/document/blocks/commerce/FilterBlock/render.js +1 -1
  114. package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/render.js +1 -1
  115. package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
  116. package/dist/render/lib/document/blocks/commerce/WheelDiagram/meta.d.ts +2 -0
  117. package/dist/render/lib/document/blocks/commerce/WheelDiagram/meta.js +1 -0
  118. package/dist/render/lib/document/blocks/commerce/WheelDiagram/render.d.ts +2 -0
  119. package/dist/render/lib/document/blocks/commerce/WheelDiagram/render.js +1 -0
  120. package/dist/render/lib/document/blocks/commerce/metas.d.ts +1 -0
  121. package/dist/render/lib/document/blocks/commerce/metas.js +1 -1
  122. package/dist/render/lib/document/blocks/commerce/renders.d.ts +1 -0
  123. package/dist/render/lib/document/blocks/commerce/renders.js +1 -1
  124. package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
  125. package/dist/render/lib/document/card-templates.d.ts +2 -0
  126. package/dist/render/lib/document/card-templates.js +1 -1
  127. package/dist/render/lib/document/current-record.js +1 -1
  128. package/dist/render/lib/document/lazy-draws.js +1 -1
  129. package/dist/render/lib/document/render-config.d.ts +4 -0
  130. package/dist/render/lib/document/render-config.js +1 -1
  131. package/dist/render/lib/document/section-to-box-rows-collections.d.ts +1 -0
  132. package/dist/render/lib/document/section-to-box-rows-collections.js +1 -0
  133. package/dist/render/lib/document/section-to-box-rows-detail.js +1 -1
  134. package/dist/render/lib/document/section-to-box-rows-listing.js +1 -1
  135. package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
  136. package/dist/render/lib/document/section-to-box-rows-service.js +1 -1
  137. package/dist/render/lib/document/section-to-box-rows-spec.js +1 -1
  138. package/dist/render/lib/document/template-product-kind.d.ts +1 -0
  139. package/dist/render/lib/document/template-product-kind.js +1 -1
  140. package/dist/render/lib/next-fonts.js +1 -1
  141. package/dist/render/lib/sections/gallery-toolbar.js +1 -1
  142. package/dist/render/lib/storefront-page-groups.js +1 -1
  143. package/dist/render/lib/wheels/fitments.js +1 -1
  144. package/dist/render/lib/wheels/price-display.d.ts +5 -1
  145. package/dist/render/lib/wheels/price-display.js +1 -1
  146. package/dist/render/lib/wheels/wheel-specs.js +1 -1
  147. package/dist/words.d.ts +20 -1
  148. package/dist/words.js +4 -4
  149. package/package.json +5 -4
  150. package/dist/chunks/EditorPreviewCheckout-BXTY7X47.js +0 -4
  151. package/dist/chunks/chunk-KJQS4BOV.js +0 -1
  152. package/dist/chunks/chunk-KNUGQTUV.js +0 -1
  153. package/dist/chunks/chunk-QNBU3FGY.js +0 -1
  154. package/dist/chunks/chunk-YCB5WS3U.js +0 -1
  155. package/dist/chunks/chunk-Z2TVM6MN.js +0 -389
  156. package/dist/render/components/ProductCardChrome.d.ts +0 -38
  157. package/dist/render/components/ProductCardChrome.js +0 -1
  158. /package/dist/chunks/{chunk-Z2TVM6MN.js.LEGAL.txt → chunk-4QN263UJ.js.LEGAL.txt} +0 -0
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as r}from"react/jsx-runtime";import z from"../catalog/ClearAllButton.js";import{useState as T}from"react";import{useCurrency as E}from"../CurrencyContext.js";import{useEnglish as F}from"../EnglishVariant.js";import{formatPrice as u}from"../../lib/commerce.js";import{facetRow as A}from"../../lib/content/facet-row-seed.js";import{optionCardRows as _}from"../../lib/sections/filter-option-rows.js";import{hasActivePlpFilters as L,isDeadPlpOption as g,PLP_FACET_LABELS as M}from"../../lib/wheels/plp-filters.js";import R from"./PlpFacetRows.js";import O from"./PlpInStockToggle.js";import D from"./PlpTypePicker.js";import I from"./PlpTyreSizeBoxes.js";function U({facets:o,filters:t,typeOptions:c,sizeBoxes:m,sizeMatches:k,noun:s,priceBounds:n,inStockCount:f,onToggle:N,onPickType:w,onPickSize:P,onPriceMax:S,onInStockOnly:C,onClearAll:$,owner:x,editing:h=!1}){const{currency:y}=E(),p=F(),[d,b]=T({});return r("aside",{className:"-mx-3 w-[calc(100%+1.5rem)] flex-none px-3 lg:sticky lg:[--sf-plp-rail-gap:16px] lg:[--sf-plp-rail-top:calc(var(--sf-header-h,88px)+var(--sf-plp-rail-gap))] lg:top-[var(--sf-plp-rail-top)] lg:max-h-[calc(100svh-var(--sf-plp-rail-top)-var(--sf-plp-rail-gap))] lg:w-[292px] lg:overflow-y-auto lg:overscroll-contain lg:pr-[22px]",children:[r("div",{className:"flex items-center justify-between pb-2",children:[a("h2",{className:"font-display text-[18px] font-medium uppercase tracking-[-0.01em]",children:"Filter"}),L(t)&&a(z,{onClick:$,size:"text-[11px]"})]}),c.length>0&&a("div",{className:"pb-1 pt-1",children:a(D,{options:c,noun:s.many,onPick:w,owner:x,editing:h})}),f!==null&&a("div",{className:"border-t border-line py-2",children:a(O,{checked:t.inStockOnly,count:f,noun:s.many,onChange:C})}),m&&a(v,{label:p(M.tyreSizes),open:!d.tyreSizes,onToggle:()=>b(e=>({...e,tyreSizes:!e.tyreSizes})),children:!d.tyreSizes&&a("div",{className:"pb-3",children:a(I,{boxes:m,composed:t.tyreSizes[0]??"",matches:k,noun:s.many,onPick:P})})}),o.map(e=>{if(e.options.length===0)return null;const i=!d[e.key],j=_(e.options,{item:l=>A(l,l.checked),selected:l=>l.checked,press:l=>()=>N(e.key,l.value),label:l=>`${p(e.label)}: ${l.label} (${l.count} ${s.many})`,disabled:g});return a(v,{label:p(e.label),open:i,onToggle:()=>b(l=>({...l,[e.key]:!l[e.key]})),children:i&&a(R,{owner:x,rows:j,dead:e.options.map(g),label:p(e.label),className:"pb-3",editing:h})},e.key)}),n&&r("div",{className:"border-t border-line py-3",children:[r("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:["Price · per ",s.one]}),a("input",{type:"range",min:n.min,max:n.max,step:5,value:t.priceMax??n.max,onChange:e=>{const i=Number(e.target.value);S(i>=n.max?null:i)},className:"mt-2 w-full accent-[var(--accent)]","aria-label":`Maximum price per ${s.one}`}),r("div",{className:"mt-1.5 flex justify-between font-mono text-[11px] tabular-nums",children:[a("span",{className:"text-fg-dim",children:u(n.min,y)}),r("span",{children:["Up to ",u(t.priceMax??n.max,y)]})]})]})]})}function v({label:o,open:t,onToggle:c,children:m}){return r("div",{className:"border-t border-line",children:[r("button",{type:"button",onClick:c,"aria-expanded":t,"aria-label":`${t?"Collapse":"Expand"} ${o} filters`,className:"flex w-full cursor-pointer items-center justify-between py-3 text-left",children:[a("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:o}),a("span",{"aria-hidden":"true",className:`font-mono text-[10px] text-fg-dim transition-transform ${t?"rotate-180":""}`,children:"▾"})]}),m]})}export{U as default};
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import E from"../catalog/ClearAllButton.js";import{useState as F}from"react";import{say as A}from"efficient-web-builder/format/lib/editor-words";import{useCurrency as _}from"../CurrencyContext.js";import{useEnglish as L}from"../EnglishVariant.js";import{formatPrice as g}from"../../lib/commerce.js";import{facetRow as M}from"../../lib/content/facet-row-seed.js";import{optionCardRows as R}from"../../lib/sections/filter-option-rows.js";import{hasActivePlpFilters as O,isDeadPlpOption as N,PLP_FACET_LABELS as D}from"../../lib/wheels/plp-filters.js";import I from"./PlpFacetRows.js";import U from"./PlpInStockToggle.js";import q from"./PlpTypePicker.js";import G from"./PlpTyreSizeBoxes.js";function H({facets:o,filters:t,typeOptions:c=[],sizeBoxes:m=null,sizeMatches:w=null,noun:s,priceBounds:n=null,inStockCount:x,onToggle:P,onPickType:S,onPickSize:C,onPriceMax:$,onInStockOnly:j,onClearAll:z,price:d,foot:h,owner:b,editing:y=!1}){const{currency:u}=_(),p=L(),[f,v]=F({});return r("aside",{className:"-mx-3 w-[calc(100%+1.5rem)] flex-none px-3 lg:sticky lg:[--sf-plp-rail-gap:16px] lg:[--sf-plp-rail-top:calc(var(--sf-header-h,88px)+var(--sf-plp-rail-gap))] lg:top-[var(--sf-plp-rail-top)] lg:max-h-[calc(100svh-var(--sf-plp-rail-top)-var(--sf-plp-rail-gap))] lg:w-[292px] lg:overflow-y-auto lg:overscroll-contain lg:pr-[22px]",children:[r("div",{className:"flex items-center justify-between pb-2",children:[e("h2",{className:"font-display text-[18px] font-medium uppercase tracking-[-0.01em]",children:A("Filter")}),O(t)&&e(E,{onClick:z,size:"text-[11px]"})]}),c.length>0&&e("div",{className:"pb-1 pt-1",children:e(q,{options:c,noun:s.many,onPick:S??(()=>{}),owner:b,editing:y})}),x!==null&&e("div",{className:"border-t border-line py-2",children:e(U,{checked:t.inStockOnly,count:x,noun:s.many,onChange:j})}),m&&e(k,{label:p(D.tyreSizes),open:!f.tyreSizes,onToggle:()=>v(l=>({...l,tyreSizes:!l.tyreSizes})),children:!f.tyreSizes&&e("div",{className:"pb-3",children:e(G,{boxes:m,composed:t.tyreSizes[0]??"",matches:w,noun:s.many,onPick:C??(()=>{})})})}),o.map(l=>{if(l.options.length===0)return null;const i=!f[l.key],T=R(l.options,{item:a=>M(a,a.checked),selected:a=>a.checked,press:a=>()=>P(l.key,a.value),label:a=>`${p(l.label)}: ${a.label} (${a.count} ${s.many})`,disabled:N});return e(k,{label:p(l.label),open:i,onToggle:()=>v(a=>({...a,[l.key]:!a[l.key]})),children:i&&e(I,{owner:b,rows:T,dead:l.options.map(N),label:p(l.label),className:"pb-3",editing:y})},l.key)}),d?r("div",{className:"border-t border-line py-3",children:[e("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:d.label}),e("div",{className:"mt-2",children:d.control})]}):n&&r("div",{className:"border-t border-line py-3",children:[r("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:["Price · per ",s.one]}),e("input",{type:"range",min:n.min,max:n.max,step:5,value:t.priceMax??n.max,onChange:l=>{const i=Number(l.target.value);$?.(i>=n.max?null:i)},className:"mt-2 w-full accent-[var(--accent)]","aria-label":`Maximum price per ${s.one}`}),r("div",{className:"mt-1.5 flex justify-between font-mono text-[11px] tabular-nums",children:[e("span",{className:"text-fg-dim",children:g(n.min,u)}),r("span",{children:["Up to ",g(t.priceMax??n.max,u)]})]})]}),h&&e("div",{className:"border-t border-line py-3",children:h})]})}function k({label:o,open:t,onToggle:c,children:m}){return r("div",{className:"border-t border-line",children:[r("button",{type:"button",onClick:c,"aria-expanded":t,"aria-label":`${t?"Collapse":"Expand"} ${o} filters`,className:"flex w-full cursor-pointer items-center justify-between py-3 text-left",children:[e("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:o}),e("span",{"aria-hidden":"true",className:`font-mono text-[10px] text-fg-dim transition-transform ${t?"rotate-180":""}`,children:"▾"})]}),m]})}export{H as default};
@@ -1,13 +1,10 @@
1
- import type { SlotComponent } from "efficient-easel/blocks";
2
1
  import { type PlpTypeOption } from "../../lib/wheels/plp-filters.js";
3
2
  import type { ProductKind } from "../../lib/api/index.js";
3
+ import { type RailOwner } from "./PlpFacetRows.js";
4
4
  export default function PlpTypePicker({ options, noun, onPick, owner, editing, }: {
5
5
  options: PlpTypeOption[];
6
6
  noun: string;
7
7
  onPick: (kind: ProductKind | null) => void;
8
- owner: {
9
- id: string;
10
- facetTemplate?: SlotComponent;
11
- };
8
+ owner: RailOwner;
12
9
  editing?: boolean;
13
10
  }): import("react").JSX.Element | null;
@@ -3,6 +3,7 @@ import type { TyreFitVehicleQuery } from "../tyres/tyre-vehicle-fitment.js";
3
3
  import type { SocialPlatform } from "efficient-web-builder/format/lib/content/social-links";
4
4
  import type { SiteThemeRow, SiteThemeRowPatch } from "efficient-web-builder/format/lib/site-theme-row";
5
5
  import type { VideoFrames } from "efficient-web-builder/format/lib/web-backend";
6
+ import type { LengthUnit } from "efficient-easel/screen/lib/content/length-units";
6
7
  export declare const API_URL: string;
7
8
  export declare class ApiError extends Error {
8
9
  status: number;
@@ -333,7 +334,9 @@ export declare const fitment: {
333
334
  getStockFitment: (make: string, model: string, year: number, modification: string, region?: string) => Promise<StockFitment | null>;
334
335
  };
335
336
  export declare const products: {
336
- listWheels: (process?: string | null, opts?: ListReadOpts) => Promise<WheelSummary[]>;
337
+ listWheels: (process?: string | null, opts?: ListReadOpts & {
338
+ maxRows?: number;
339
+ }) => Promise<WheelSummary[]>;
337
340
  listWheelsBySlug: (slugs: readonly string[], opts?: ListReadOpts) => Promise<WheelSummary[]>;
338
341
  listCatalog: (kinds: readonly ProductKind[], vehicle?: TyreFitVehicleQuery | null, opts?: {
339
342
  maxRows?: number;
@@ -530,6 +533,7 @@ export interface AdminHeaderSettings {
530
533
  logo_position: "left" | "center" | "right";
531
534
  logo_size: "small" | "medium" | "large";
532
535
  logo_size_px: number | null;
536
+ logo_size_unit?: LengthUnit | null;
533
537
  reverse_logo: boolean;
534
538
  menu: string | null;
535
539
  menu_handle: string | null;
@@ -546,6 +550,7 @@ export interface AdminHeaderSettings {
546
550
  menu_position: "left" | "center" | "right" | "beside";
547
551
  menu_split: number;
548
552
  menu_gap_px?: number | null;
553
+ menu_gap_unit?: LengthUnit | null;
549
554
  menu_row: "top" | "bottom" | "inline";
550
555
  account_enabled?: boolean;
551
556
  cart_enabled?: boolean;
@@ -1 +1 @@
1
- import{PREVIEW_TOKEN_HEADER as st,SITE_HOST_HEADER as nt,SITE_SLUG_HEADER as ot}from"../site-headers.js";import{PRODUCT_API_BASE as it,PRODUCT_BACKEND_URL as D}from"./origins.js";import{backendHopHeaders as ct,clientIpFromForwardedFor as dt,FORWARDED_FOR_HEADER as ut,hopCachingOf as lt}from"../forwarded-for.js";import pt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as yt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as U}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as x}from"../wheels/renderable-finishes.js";const ht=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const N="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",ft=new Set([502,503,504]),I=0,gt="This editor runs on its host's own backend, which does not serve this request.",wt=5e3,mt=15e3,St=()=>typeof window>"u"?wt:mt;function H(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(St())}const F=t=>t instanceof Error&&t.name==="TimeoutError",M=(t,e)=>ft.has(t)?N:e,Pt=["admin","venue"];let B="admin";function ie(t){B=Pt.includes(t)?t:"admin"}function Ot(){return B}const bt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let q=null;function ce(t){q=t&&bt.test(t)?t:null}function At(){return q}function Tt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=K();return!e||/[?&]site=/.test(t)?t:E(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...g}=e;if(typeof window<"u"&&!yt())throw new m(I,gt,null);if(typeof window>"u"&&o===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const r=typeof FormData<"u"&&g.body instanceof FormData;let a;try{a=await fetch(`${o??ht}${Tt(t)}`,{...g,headers:{...r?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:g.signal??H({...g,audience:p})})}catch(y){throw y instanceof TypeError||F(y)?new m(I,N,null):y}let n;try{n=await a.text()}catch(y){throw F(y)?new m(I,N,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(a.status,a.ok?"Expected JSON but received a non-JSON response":M(a.status,a.statusText),n)}if(!a.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??M(a.status,a.statusText);throw new m(a.status,y,c)}return c}let b=null;async function G(){return b||(b=Rt().finally(()=>{b=null}),b)}async function Rt(){const t=P.takeLegacyRefresh(),e=await Et.refresh(t??void 0);return P.setTokens(e.access),e.access}async function W(){return P.getAccess()??G()}async function h(t,e={}){let s;try{s=await W()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await G();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function j(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function z(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Et={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await W();return await z(),t},me:z,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as Ct,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as $t,isSvgUrl as _t}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Ut}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Nt,webRuntimeSiteSlug as K}from"efficient-web-builder/format/lib/web-runtime";function w(t){if(typeof t=="string")return t.startsWith("/media/")?Ct(t):t;if(Array.isArray(t))return t.map(w);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[w(l),p])):w(o);return e}return t}import{PRODUCT_API_BASE as Pe}from"./origins.js";const V=typeof window>"u"&&D!=="",It=V?D:it,vt=Nt,O=()=>({baseUrl:vt(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const X=100,Z=50;function k(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(X)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function kt(t,e){return k("/wheels",{process:t},e)}const Y=X;function Jt(t,e){return k("/wheels",{slug:t.join(",")},e)}function Lt(t,e,s){return k("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function Dt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function J(t,e,s=()=>!1,o=()=>!1){const l=[];let p=null;try{for(let g=0;g<Z;g++){const r=await i(await e(p),await u());if(l.push(...r.results),p=Dt(r.next),!p)break;if(o(l))return l}p&&console.warn(`[${t}] stopped at ${Z} pages (${l.length} rows); catalog may be truncated`)}catch(g){if(s(g))throw g;console.warn(`[${t}] product API unavailable, returning []`,g)}return l}const Q=t=>t instanceof m&&t.status===400;function tt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?U([e]):[e])}async function et(){return(await xt()).host}async function xt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(nt)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Ht(){try{const{headers:t}=await import("next/headers");return dt((await t()).get(ut))}catch{return null}}async function Ft(){try{const{headers:t}=await import("next/headers");return(await t()).get(ot)||null}catch{return null}}async function Mt(){const t=await Ft();if(t)return`site=${encodeURIComponent(t)}`;const e=await et();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=K();return e?E(t,`site=${encodeURIComponent(e)}`):t}return E(t,await Mt())}function E(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Bt="preview";async function qt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(st)}catch{return null}}async function Gt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function L(t,e){const s=await qt();if(s===null)return[await f(t),await u(e)];const o=E(await f(t),`${Bt}=${encodeURIComponent(s)}`),{next:l,cache:p,...g}=e??{},r=await u({...g,cache:"no-store"}),a=await Gt();return a&&(r.headers={...r.headers,"user-agent":a}),[o,r]}async function Wt(t){if(!V)return;const[e,s]=await Promise.all([et(),Ht()]),o=ct(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await Wt(lt(t)),s={baseUrl:It,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const ye={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(A){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(T("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},he={listWheels:async(t,e={})=>{const s=await J("products.listWheels",async o=>await f(kt(t,o)),e.throwOnFailure?()=>!0:void 0);return U(w(s))},listWheelsBySlug:async(t,e={})=>{const s=[...new Set(t.map(r=>r.trim()).filter(Boolean))];if(s.length===0)return[];const o=[];for(let r=0;r<s.length;r+=Y)o.push(s.slice(r,r+Y));const l=await Promise.all(o.map(r=>J("products.listWheelsBySlug",async a=>await f(Jt(r,a)),e.throwOnFailure?()=>!0:Q))),p=new Set(s),g=l.flat().filter(r=>p.has(r.slug));return U(w(g))},listCatalog:async(t,e,s={})=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const o=await J("products.listCatalog",async l=>await f(Lt(t,e,l)),Q,s.maxRows===void 0?void 0:l=>tt([...l]).length>=s.maxRows);return tt(w(o))},getWheel:async t=>x(w(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>w(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async(t={})=>{try{return await i(await f(d("/bundles")),await u())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return w(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return w(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>w(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await L(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return w(await i(o,l))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const s=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+s,await u())).map(l=>({...l,coverImage:v(l.coverImage)??""}))}catch(o){if(e)throw o;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",o),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(d("/checkouts/release"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await j(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await j(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=H({method:"GET"}),e=await i(...await L(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&_t(s)){const p=await $t(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await L(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},fe={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class jt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const C=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},$=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,zt=t=>`${$(t)}currencies/`,Kt="/api/storefront/media/ingest/";class Vt extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function Xt(){const t=Ut();if(!t)throw new Vt;return`${Kt}?${new URLSearchParams({site:t})}`}const Zt="X-Puck-Media-Manifest",rt=pt.contentHash,_={"X-Media-Manifest":rt,[Zt]:rt},ge=at({});function at(t){return(e,s={})=>{const o=At(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??Ot()})}}function Yt(t={}){const e=at(t),s=t.siteDrafts===!0,o=r=>C("header-settings",r,s),l=r=>C("theme-settings",r,s),p=r=>C("chat-settings",r,s),g=r=>C("social-settings",r,s);return{findPageBySlug:async(r,a,n)=>{const c=new URLSearchParams({slug:r});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:a}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new jt(r,S.length);return S[0]??null},getPageById:(r,a)=>e(`/api/storefront/pages/${r}/`,{token:a}),saveLayout:(r,a,n,c,y)=>e(`/api/storefront/pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(r,a,n)=>e(`/api/storefront/pages/${r}/duplicate/`,{method:"POST",body:JSON.stringify({title:a.title,slug:a.slug}),token:n}),geocode:(r,a,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:r,country:n}:{q:r})}`,{token:a}),listBlockSources:r=>e("/api/storefront/block-sources/",{token:r}),listRecordTypes:r=>e("/api/storefront/record-types/",{token:r}),createPagePreviewLink:(r,a)=>e(`/api/storefront/pages/${r}/preview-link/`,{method:"POST",token:a}),claimPageEditLock:(r,a,n,c=!1)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:a}),releasePageEditLock:(r,a)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"DELETE",token:a}),createTemplate:(r,a,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:r,layout:a}),headers:_,token:n}),getTemplate:(r,a)=>e(`/api/storefront/page-templates/${r}/`,{token:a}),saveTemplateLayout:(r,a,n)=>e(`/api/storefront/page-templates/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:_,token:n}),listTemplatePages:async(r,a)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(r,a,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}&slug=${encodeURIComponent(a)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(r,a,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:r,...a}),headers:_,token:n}),saveTemplatePageLayout:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:_,token:n}),deleteTemplatePage:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"DELETE",token:a,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},createPage:(r,a,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:r,slug:a,layout:n}),token:c}),deletePage:(r,a)=>e(`/api/storefront/pages/${r}/`,{method:"DELETE",token:a}),getHeaderSettings:(r,a)=>e(o(a),{token:r}),listMenus:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/menus/?${n}`,{token:r});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(r,a)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(r,a={})=>{const n=new URLSearchParams;a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:r});return w(y)},listProducts:async(r,a={})=>{const n=new URLSearchParams;a.kinds?.length&&n.set("kind",a.kinds.join(",")),a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:r});return w(y)},getWheelDetail:async(r,a,n={})=>{const c=new URLSearchParams({slug:a});return n.siteId&&c.set("site",n.siteId),x(w(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:r})))},updateHeaderSettings:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSite:(r,a)=>e($(r),{token:a}),listSites:async r=>{const a=await e("/api/storefront/sites/?no_page=true",{token:r});return Array.isArray(a)?a:a.results??[]},listSiteCurrencies:async(r,a)=>{const n=await e(zt(r),{token:a});return Array.isArray(n)?n:[]},publishSite:(r,a)=>e(`${$(r)}publish/`,{method:"POST",token:a}),getSiteLiveState:(r,a)=>e(`${$(r)}live-state/`,{token:a}),getThemeSettings:(r,a)=>e(l(a),{token:r}),updateThemeSettings:(r,a,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getMyPreferences:async r=>(await e("/api/auth/me/",{token:r})).preferences??{},updateMyPreferences:(r,a)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:r}),token:a}),getChatSettings:(r,a)=>e(p(a),{token:r}),updateChatSettings:(r,a,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSocialSettings:(r,a)=>e(g(a),{token:r}),updateSocialSettings:(r,a,n)=>e(g(n),{method:"PATCH",body:JSON.stringify(r),token:a}),uploadHeaderLogo:(r,a,n)=>{const c=new FormData;return c.append("logo",r),e(o(n),{method:"PATCH",body:c,token:a})},clearHeaderLogo:(r,a)=>e(o(a),{method:"PATCH",body:JSON.stringify({logo:null}),token:r}),setHeaderLogoFromAsset:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:r}),token:a}),uploadMedia:async(r,a)=>{const n=new FormData;return n.append("file",r),e(Xt(),{method:"POST",body:n,token:a})},listMedia:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("kind",a);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]}}}const we=Yt({siteDrafts:!0});export{ht as API_URL,jt as AmbiguousPageSlugError,m as ApiError,mt as BROWSER_READ_TIMEOUT_MS,gt as EFFICIENT_CLIENT_CLOSED_MESSAGE,Vt as MediaUploadDestinationError,Bt as PREVIEW_PARAM,Pe as PRODUCT_API_BASE,wt as SERVER_READ_TIMEOUT_MS,N as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,ge as adminFetch,Et as api,i as apiFetch,E as appendSiteQuery,fe as bookings,Yt as createStorefrontAdmin,H as defaultRequestDeadline,Xt as editorMediaUploadPath,Ot as editorPortalAudience,At as editorRequestLanguage,ye as fitment,he as products,St as readDeadlineMs,Ht as resolveClientIp,w as resolveMediaUrls,qt as resolvePreviewToken,et as resolveSiteHost,xt as resolveSiteHostSource,Ft as resolveSiteSlug,ce as setEditorLanguage,ie as setEditorPortalAudience,we as storefrontAdmin};
1
+ import{PREVIEW_TOKEN_HEADER as st,SITE_HOST_HEADER as nt,SITE_SLUG_HEADER as ot}from"../site-headers.js";import{PRODUCT_API_BASE as it,PRODUCT_BACKEND_URL as D}from"./origins.js";import{backendHopHeaders as ct,clientIpFromForwardedFor as dt,FORWARDED_FOR_HEADER as ut,hopCachingOf as lt}from"../forwarded-for.js";import pt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as yt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as E}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as x}from"../wheels/renderable-finishes.js";const ht=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const N="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",ft=new Set([502,503,504]),I=0,gt="This editor runs on its host's own backend, which does not serve this request.",wt=5e3,mt=15e3,St=()=>typeof window>"u"?wt:mt;function H(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(St())}const F=t=>t instanceof Error&&t.name==="TimeoutError",M=(t,e)=>ft.has(t)?N:e,Pt=["admin","venue"];let B="admin";function ie(t){B=Pt.includes(t)?t:"admin"}function Ot(){return B}const bt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let q=null;function ce(t){q=t&&bt.test(t)?t:null}function At(){return q}function Tt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=K();return!e||/[?&]site=/.test(t)?t:C(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...g}=e;if(typeof window<"u"&&!yt())throw new m(I,gt,null);if(typeof window>"u"&&o===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const r=typeof FormData<"u"&&g.body instanceof FormData;let a;try{a=await fetch(`${o??ht}${Tt(t)}`,{...g,headers:{...r?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:g.signal??H({...g,audience:p})})}catch(y){throw y instanceof TypeError||F(y)?new m(I,N,null):y}let n;try{n=await a.text()}catch(y){throw F(y)?new m(I,N,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(a.status,a.ok?"Expected JSON but received a non-JSON response":M(a.status,a.statusText),n)}if(!a.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??M(a.status,a.statusText);throw new m(a.status,y,c)}return c}let b=null;async function G(){return b||(b=Rt().finally(()=>{b=null}),b)}async function Rt(){const t=P.takeLegacyRefresh(),e=await Et.refresh(t??void 0);return P.setTokens(e.access),e.access}async function W(){return P.getAccess()??G()}async function h(t,e={}){let s;try{s=await W()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await G();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function j(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function z(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Et={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await W();return await z(),t},me:z,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as Ct,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as $t,isSvgUrl as _t}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Ut}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Nt,webRuntimeSiteSlug as K}from"efficient-web-builder/format/lib/web-runtime";function w(t){if(typeof t=="string")return t.startsWith("/media/")?Ct(t):t;if(Array.isArray(t))return t.map(w);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[w(l),p])):w(o);return e}return t}import{PRODUCT_API_BASE as Pe}from"./origins.js";const V=typeof window>"u"&&D!=="",It=V?D:it,vt=Nt,O=()=>({baseUrl:vt(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const X=100,Z=50;function k(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(X)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function kt(t,e){return k("/wheels",{process:t},e)}const Y=X;function Jt(t,e){return k("/wheels",{slug:t.join(",")},e)}function Lt(t,e,s){return k("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function Dt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function J(t,e,s=()=>!1,o=()=>!1){const l=[];let p=null;try{for(let g=0;g<Z;g++){const r=await i(await e(p),await u());if(l.push(...r.results),p=Dt(r.next),!p)break;if(o(l))return l}p&&console.warn(`[${t}] stopped at ${Z} pages (${l.length} rows); catalog may be truncated`)}catch(g){if(s(g))throw g;console.warn(`[${t}] product API unavailable, returning []`,g)}return l}const Q=t=>t instanceof m&&t.status===400;function tt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?E([e]):[e])}async function et(){return(await xt()).host}async function xt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(nt)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Ht(){try{const{headers:t}=await import("next/headers");return dt((await t()).get(ut))}catch{return null}}async function Ft(){try{const{headers:t}=await import("next/headers");return(await t()).get(ot)||null}catch{return null}}async function Mt(){const t=await Ft();if(t)return`site=${encodeURIComponent(t)}`;const e=await et();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=K();return e?C(t,`site=${encodeURIComponent(e)}`):t}return C(t,await Mt())}function C(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Bt="preview";async function qt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(st)}catch{return null}}async function Gt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function L(t,e){const s=await qt();if(s===null)return[await f(t),await u(e)];const o=C(await f(t),`${Bt}=${encodeURIComponent(s)}`),{next:l,cache:p,...g}=e??{},r=await u({...g,cache:"no-store"}),a=await Gt();return a&&(r.headers={...r.headers,"user-agent":a}),[o,r]}async function Wt(t){if(!V)return;const[e,s]=await Promise.all([et(),Ht()]),o=ct(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await Wt(lt(t)),s={baseUrl:It,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const ye={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(A){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(T("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},he={listWheels:async(t,e={})=>{const s=await J("products.listWheels",async o=>await f(kt(t,o)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:o=>E([...o]).length>=e.maxRows);return E(w(s))},listWheelsBySlug:async(t,e={})=>{const s=[...new Set(t.map(r=>r.trim()).filter(Boolean))];if(s.length===0)return[];const o=[];for(let r=0;r<s.length;r+=Y)o.push(s.slice(r,r+Y));const l=await Promise.all(o.map(r=>J("products.listWheelsBySlug",async a=>await f(Jt(r,a)),e.throwOnFailure?()=>!0:Q))),p=new Set(s),g=l.flat().filter(r=>p.has(r.slug));return E(w(g))},listCatalog:async(t,e,s={})=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const o=await J("products.listCatalog",async l=>await f(Lt(t,e,l)),Q,s.maxRows===void 0?void 0:l=>tt([...l]).length>=s.maxRows);return tt(w(o))},getWheel:async t=>x(w(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>w(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async(t={})=>{try{return await i(await f(d("/bundles")),await u())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return w(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return w(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>w(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await L(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return w(await i(o,l))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const s=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+s,await u())).map(l=>({...l,coverImage:v(l.coverImage)??""}))}catch(o){if(e)throw o;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",o),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(d("/checkouts/release"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await j(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await j(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=H({method:"GET"}),e=await i(...await L(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&_t(s)){const p=await $t(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await L(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},fe={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class jt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const $=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},_=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,zt=t=>`${_(t)}currencies/`,Kt="/api/storefront/media/ingest/";class Vt extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function Xt(){const t=Ut();if(!t)throw new Vt;return`${Kt}?${new URLSearchParams({site:t})}`}const Zt="X-Puck-Media-Manifest",rt=pt.contentHash,U={"X-Media-Manifest":rt,[Zt]:rt},ge=at({});function at(t){return(e,s={})=>{const o=At(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??Ot()})}}function Yt(t={}){const e=at(t),s=t.siteDrafts===!0,o=r=>$("header-settings",r,s),l=r=>$("theme-settings",r,s),p=r=>$("chat-settings",r,s),g=r=>$("social-settings",r,s);return{findPageBySlug:async(r,a,n)=>{const c=new URLSearchParams({slug:r});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:a}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new jt(r,S.length);return S[0]??null},getPageById:(r,a)=>e(`/api/storefront/pages/${r}/`,{token:a}),saveLayout:(r,a,n,c,y)=>e(`/api/storefront/pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(r,a,n)=>e(`/api/storefront/pages/${r}/duplicate/`,{method:"POST",body:JSON.stringify({title:a.title,slug:a.slug}),token:n}),geocode:(r,a,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:r,country:n}:{q:r})}`,{token:a}),listBlockSources:r=>e("/api/storefront/block-sources/",{token:r}),listRecordTypes:r=>e("/api/storefront/record-types/",{token:r}),createPagePreviewLink:(r,a)=>e(`/api/storefront/pages/${r}/preview-link/`,{method:"POST",token:a}),claimPageEditLock:(r,a,n,c=!1)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:a}),releasePageEditLock:(r,a)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"DELETE",token:a}),createTemplate:(r,a,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:r,layout:a}),headers:U,token:n}),getTemplate:(r,a)=>e(`/api/storefront/page-templates/${r}/`,{token:a}),saveTemplateLayout:(r,a,n)=>e(`/api/storefront/page-templates/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:n}),listTemplatePages:async(r,a)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(r,a,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}&slug=${encodeURIComponent(a)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(r,a,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:r,...a}),headers:U,token:n}),saveTemplatePageLayout:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:n}),deleteTemplatePage:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"DELETE",token:a,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},createPage:(r,a,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:r,slug:a,layout:n}),token:c}),deletePage:(r,a)=>e(`/api/storefront/pages/${r}/`,{method:"DELETE",token:a}),getHeaderSettings:(r,a)=>e(o(a),{token:r}),listMenus:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/menus/?${n}`,{token:r});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(r,a)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(r,a={})=>{const n=new URLSearchParams;a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:r});return w(y)},listProducts:async(r,a={})=>{const n=new URLSearchParams;a.kinds?.length&&n.set("kind",a.kinds.join(",")),a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:r});return w(y)},getWheelDetail:async(r,a,n={})=>{const c=new URLSearchParams({slug:a});return n.siteId&&c.set("site",n.siteId),x(w(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:r})))},updateHeaderSettings:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSite:(r,a)=>e(_(r),{token:a}),listSites:async r=>{const a=await e("/api/storefront/sites/?no_page=true",{token:r});return Array.isArray(a)?a:a.results??[]},listSiteCurrencies:async(r,a)=>{const n=await e(zt(r),{token:a});return Array.isArray(n)?n:[]},publishSite:(r,a)=>e(`${_(r)}publish/`,{method:"POST",token:a}),getSiteLiveState:(r,a)=>e(`${_(r)}live-state/`,{token:a}),getThemeSettings:(r,a)=>e(l(a),{token:r}),updateThemeSettings:(r,a,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getMyPreferences:async r=>(await e("/api/auth/me/",{token:r})).preferences??{},updateMyPreferences:(r,a)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:r}),token:a}),getChatSettings:(r,a)=>e(p(a),{token:r}),updateChatSettings:(r,a,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSocialSettings:(r,a)=>e(g(a),{token:r}),updateSocialSettings:(r,a,n)=>e(g(n),{method:"PATCH",body:JSON.stringify(r),token:a}),uploadHeaderLogo:(r,a,n)=>{const c=new FormData;return c.append("logo",r),e(o(n),{method:"PATCH",body:c,token:a})},clearHeaderLogo:(r,a)=>e(o(a),{method:"PATCH",body:JSON.stringify({logo:null}),token:r}),setHeaderLogoFromAsset:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:r}),token:a}),uploadMedia:async(r,a)=>{const n=new FormData;return n.append("file",r),e(Xt(),{method:"POST",body:n,token:a})},listMedia:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("kind",a);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]}}}const we=Yt({siteDrafts:!0});export{ht as API_URL,jt as AmbiguousPageSlugError,m as ApiError,mt as BROWSER_READ_TIMEOUT_MS,gt as EFFICIENT_CLIENT_CLOSED_MESSAGE,Vt as MediaUploadDestinationError,Bt as PREVIEW_PARAM,Pe as PRODUCT_API_BASE,wt as SERVER_READ_TIMEOUT_MS,N as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,ge as adminFetch,Et as api,i as apiFetch,C as appendSiteQuery,fe as bookings,Yt as createStorefrontAdmin,H as defaultRequestDeadline,Xt as editorMediaUploadPath,Ot as editorPortalAudience,At as editorRequestLanguage,ye as fitment,he as products,St as readDeadlineMs,Ht as resolveClientIp,w as resolveMediaUrls,qt as resolvePreviewToken,et as resolveSiteHost,xt as resolveSiteHostSource,Ft as resolveSiteSlug,ce as setEditorLanguage,ie as setEditorPortalAudience,we as storefrontAdmin};
@@ -1549,6 +1549,7 @@ export interface components {
1549
1549
  };
1550
1550
  cornerStyle: "square" | "small" | "large";
1551
1551
  cornerRadiusPx?: number | null;
1552
+ cornerRadiusUnit?: "px" | "vw" | null;
1552
1553
  cardShadow: "none" | "soft" | "lifted";
1553
1554
  shadowColor: string;
1554
1555
  cardGap: "tight" | "normal" | "roomy";
@@ -1571,8 +1572,15 @@ export interface components {
1571
1572
  };
1572
1573
  textStyles?: components["schemas"]["ThemeTextStyle"][] | null;
1573
1574
  siteWidth: number;
1575
+ siteWidthUnit?: "px" | "%" | "vw" | null;
1574
1576
  siteGutter: number;
1577
+ siteGutterUnit?: "px" | "%" | "vw" | null;
1578
+ siteGutterPhone?: number | null;
1579
+ siteGutterPhoneUnit?: "px" | "%" | "vw" | null;
1575
1580
  blockGap?: number | null;
1581
+ blockGapUnit?: "px" | "%" | "vw" | null;
1582
+ blockGapPhone?: number | null;
1583
+ blockGapPhoneUnit?: "px" | "%" | "vw" | null;
1576
1584
  heroBackgroundFollowsWidth: boolean;
1577
1585
  sectionBackgroundWidth: "full" | "content" | null;
1578
1586
  sectionContentWidth: "full" | "content" | null;
@@ -1598,14 +1606,32 @@ export interface components {
1598
1606
  font?: string;
1599
1607
  color?: string;
1600
1608
  size?: number;
1609
+ sizeTablet?: number;
1601
1610
  sizePhone?: number;
1611
+ sizeUnit?: "px" | "vw";
1612
+ sizeUnitTablet?: "px" | "vw";
1613
+ sizeUnitPhone?: "px" | "vw";
1602
1614
  weight?: number;
1603
1615
  italic?: boolean;
1604
1616
  lineHeight?: number;
1617
+ lineHeightTablet?: number;
1618
+ lineHeightPhone?: number;
1605
1619
  letterSpacing?: number;
1620
+ letterSpacingTablet?: number;
1621
+ letterSpacingPhone?: number;
1606
1622
  paragraphSpacing?: number;
1623
+ paragraphSpacingTablet?: number;
1624
+ paragraphSpacingPhone?: number;
1625
+ paragraphSpacingUnit?: "px" | "%" | "vw";
1626
+ paragraphSpacingUnitTablet?: "px" | "%" | "vw";
1627
+ paragraphSpacingUnitPhone?: "px" | "%" | "vw";
1607
1628
  letterCase?: "none" | "upper" | "capitalize" | "lower";
1608
1629
  largestSize?: number;
1630
+ largestSizeTablet?: number;
1631
+ largestSizePhone?: number;
1632
+ largestSizeUnit?: "px" | "vw";
1633
+ largestSizeUnitTablet?: "px" | "vw";
1634
+ largestSizeUnitPhone?: "px" | "vw";
1609
1635
  };
1610
1636
  WordStyle: {
1611
1637
  font?: string | null;
@@ -1635,6 +1661,7 @@ export interface components {
1635
1661
  logoPosition: "left" | "center" | "right";
1636
1662
  logoSize: "small" | "medium" | "large";
1637
1663
  logoSizePx: number | null;
1664
+ logoSizeUnit?: "px" | "%" | "vw" | null;
1638
1665
  reverseLogo: boolean;
1639
1666
  menuHandle: string | null;
1640
1667
  menuItems: {
@@ -1649,6 +1676,7 @@ export interface components {
1649
1676
  menuSplit: number;
1650
1677
  menuRow: "top" | "bottom" | "inline";
1651
1678
  menuGapPx?: number | null;
1679
+ menuGapUnit?: "px" | "%" | "vw" | null;
1652
1680
  searchEnabled: boolean;
1653
1681
  searchPosition: "left" | "right";
1654
1682
  searchRow: "top" | "bottom";
@@ -22,6 +22,7 @@ export declare function goodsShapeOf(goods: {
22
22
  email: string;
23
23
  firstName: string;
24
24
  lastName: string;
25
+ company: string;
25
26
  phone: string;
26
27
  address: string;
27
28
  city: string;
@@ -1 +1 @@
1
- import{loadStripe as s}from"@stripe/stripe-js";import{ApiError as o,products as p}from"../api/index.js";const h=2;function x(e){return e==="card"}const d="checkout_unavailable",l="checkout_waiting",N="committed",T="We could not check your payment. Please try again.",k="Your last change was not saved. This is your order as placed.",_="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.",u=1e4;async function C(e,n=u){let t;const r=new Promise(a=>{t=setTimeout(()=>a(void 0),n)}),i=(async()=>{try{return(await(await s(e.publishableKey))?.retrievePaymentIntent(e.clientSecret))?.paymentIntent?.status}catch{return}})();try{return await Promise.race([i,r])}finally{clearTimeout(t)}}const I=new Set(["none","requires_payment_method","canceled"]);async function w(e,n=u){let t;const r=new Promise(i=>{t=setTimeout(()=>i(void 0),n)});try{return await Promise.race([p.releaseCheckout({idempotencyKey:e}).then(i=>i.status,()=>{}),r])}finally{clearTimeout(t)}}function c(e,n){return e instanceof o&&typeof e.data=="object"&&e.data!==null&&e.data.code===n}function E(e){return c(e,d)}function b(e){return c(e,l)}function A(e){return e instanceof o&&e.status>=400&&e.status<500&&e.status!==408}function O(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])}function P(e){return e.orderNumber||e.checkoutNumber}function m(e){return e.orderNumber?{kind:"placed",order:e}:{kind:e.status==="released"?"refunded":e.status==="expired"?"expired":"pending",checkoutNumber:e.checkoutNumber}}async function S({checkoutNumber:e,resend:n,page:t}){t.setConfirming(!0);let r;try{r=m(await n())}catch{r={kind:"pending",checkoutNumber:e}}r.kind==="placed"?(t.markPaid(),t.track(r.order),t.land(r.order)):t.unplaced({...r,checkoutNumber:r.checkoutNumber||e}),t.setConfirming(!1)}export{_ as BANK_WAITING,N as CHECKOUT_COMMITTED,d as CHECKOUT_UNAVAILABLE,l as CHECKOUT_WAITING,I as DROPPABLE_INTENT,u as INTENT_READ_MS,k as LOST_CHANGE,T as NOT_CHECKED,h as PAY_FIRST_FLOW,E as checkoutGone,b as checkoutWaiting,O as goodsShapeOf,P as orderReference,m as payFirstOutcome,x as paysFirst,C as readIntentStatus,A as refusedForGood,w as releaseHeldCheckout,S as settlePayFirst};
1
+ import{loadStripe as s}from"@stripe/stripe-js";import{ApiError as o,products as p}from"../api/index.js";const h=2;function x(e){return e==="card"}const d="checkout_unavailable",l="checkout_waiting",N="committed",T="We could not check your payment. Please try again.",k="Your last change was not saved. This is your order as placed.",_="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.",u=1e4;async function C(e,n=u){let t;const r=new Promise(a=>{t=setTimeout(()=>a(void 0),n)}),i=(async()=>{try{return(await(await s(e.publishableKey))?.retrievePaymentIntent(e.clientSecret))?.paymentIntent?.status}catch{return}})();try{return await Promise.race([i,r])}finally{clearTimeout(t)}}const I=new Set(["none","requires_payment_method","canceled"]);async function w(e,n=u){let t;const r=new Promise(i=>{t=setTimeout(()=>i(void 0),n)});try{return await Promise.race([p.releaseCheckout({idempotencyKey:e}).then(i=>i.status,()=>{}),r])}finally{clearTimeout(t)}}function c(e,n){return e instanceof o&&typeof e.data=="object"&&e.data!==null&&e.data.code===n}function E(e){return c(e,d)}function b(e){return c(e,l)}function A(e){return e instanceof o&&e.status>=400&&e.status<500&&e.status!==408}function O(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 P(e){return e.orderNumber||e.checkoutNumber}function m(e){return e.orderNumber?{kind:"placed",order:e}:{kind:e.status==="released"?"refunded":e.status==="expired"?"expired":"pending",checkoutNumber:e.checkoutNumber}}async function S({checkoutNumber:e,resend:n,page:t}){t.setConfirming(!0);let r;try{r=m(await n())}catch{r={kind:"pending",checkoutNumber:e}}r.kind==="placed"?(t.markPaid(),t.track(r.order),t.land(r.order)):t.unplaced({...r,checkoutNumber:r.checkoutNumber||e}),t.setConfirming(!1)}export{_ as BANK_WAITING,N as CHECKOUT_COMMITTED,d as CHECKOUT_UNAVAILABLE,l as CHECKOUT_WAITING,I as DROPPABLE_INTENT,u as INTENT_READ_MS,k as LOST_CHANGE,T as NOT_CHECKED,h as PAY_FIRST_FLOW,E as checkoutGone,b as checkoutWaiting,O as goodsShapeOf,P as orderReference,m as payFirstOutcome,x as paysFirst,C as readIntentStatus,A as refusedForGood,w as releaseHeldCheckout,S as settlePayFirst};
@@ -1 +1 @@
1
- const m=1,s="Ads on. Shopper can opt out.",i="Ads and analytics off until Accept",r={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:s,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:i,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}},p="Honoured: ads off",l=new Set(["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","IS","LI","NO"]),c={US:"us",PR:"us",GU:"us",VI:"us",AS:"us",MP:"us",CA:"ca",AU:"au",NZ:"nz",GB:"uk"};function u(o){const e=(o??"").trim().toUpperCase();return e?c[e]?c[e]:l.has(e)?"eu":"other":"other"}const h=new Set(["Pacific/Honolulu","Pacific/Guam","Pacific/Saipan","Pacific/Pago_Pago","America/Puerto_Rico","America/St_Thomas"]),d=new Set(["New_York","Chicago","Denver","Los_Angeles","Phoenix","Anchorage","Adak","Boise","Detroit","Juneau","Sitka","Metlakatla","Yakutat","Nome","Menominee","Indianapolis","Louisville","Fort_Wayne","Knox_IN"]),f=new Set(["Toronto","Vancouver","Edmonton","Winnipeg","Halifax","St_Johns","Regina","Montreal","Moncton","Glace_Bay","Goose_Bay","Iqaluit","Whitehorse","Dawson","Dawson_Creek","Fort_Nelson","Creston","Cambridge_Bay","Inuvik","Rankin_Inlet","Resolute","Swift_Current","Atikokan","Blanc-Sablon","Nipigon","Thunder_Bay","Rainy_River","Pangnirtung","Yellowknife","Coral_Harbour"]);function y(o){const e=(o??"").trim();if(!e)return"other";if(e==="Europe/London"||e==="Europe/Belfast"||e==="GB"||e==="GB-Eire"||e==="Europe/Guernsey"||e==="Europe/Jersey"||e==="Europe/Isle_of_Man")return"uk";if(e.startsWith("Europe/")||e==="Atlantic/Canary"||e==="Atlantic/Madeira"||e==="Atlantic/Azores"||e==="Atlantic/Reykjavik"||e==="Atlantic/Faroe")return"eu";if(e.startsWith("Australia/")||e==="Antarctica/Macquarie")return"au";if(e==="Pacific/Auckland"||e==="Pacific/Chatham"||e==="NZ"||e==="NZ-CHAT")return"nz";if(e.startsWith("US/")||h.has(e))return"us";if(e.startsWith("Canada/"))return"ca";if(e.startsWith("America/")){const n=e.slice(8),t=n.split("/")[0];if(t==="Indiana"||t==="Kentucky"||t==="North_Dakota"||d.has(n))return"us";if(f.has(n))return"ca"}return"other"}function C(o,e){const n=y(o);if(!e)return n;const t=u(e);return r[n].model==="opt-in"?n:(r[t].model==="opt-in",t)}function A(o){const e=new Set,n=[];for(const t of o){const a=u(t);a==="other"||e.has(a)||(e.add(a),n.push(r[a]))}return n.push(r.other),n}function g(o){const e=[...o.googleAds?["Google"]:[],...o.meta?["Facebook","Instagram"]:[]];return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function k(o,e,n){const t=g(n),a=t?`We use cookies to count visits and to show you ${e} ads on ${t}.`:"We use cookies to count visits.";return o.model==="opt-in"?{heading:t?"Cookies and ads":"Cookies",before:`${a} Nothing loads until you choose. You can change this at any time with `,link:o.footerLink,after:" at the bottom of every page."}:{heading:t?"Cookies and ads":"Cookies",before:`${a} You can say no at any time: choose Privacy choices, or use `,link:o.footerLink,after:" at the bottom of every page."}}const w={necessary:{name:"Necessary",body:"Cart, checkout, your country and currency, sign-in, and this choice. The site cannot work without them.",bodyNoSale:"What the site needs to work, such as remembering this choice. The site cannot work without them."},analytics:{name:"Analytics",body:"Counts visits and pages so we can improve the site. Google Analytics and our own visit count."},ads:{body:"Google Ads and Meta (Facebook, Instagram) tags, and the order details we send to them to measure our ads.",bodyNoSale:"Google Ads and Meta (Facebook, Instagram) tags, which measure our ads."}},E={title:"Opt-out request honoured",body:"Your browser sent a Global Privacy Control signal. We have turned off sale and sharing of your information for ads."},P={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on"};export{P as CONSENT_BUTTONS,p as CONSENT_GPC_RULE,r as CONSENT_RULES,m as CONSENT_RULES_VERSION,E as GPC_HONOURED,w as PANEL_ROWS,g as adPlaces,k as bannerWords,u as regionOfCountry,y as regionOfTimeZone,A as rulesForCountries,C as visitorRegion};
1
+ const m=1,s="Ads on. Shopper can opt out.",i="Ads and analytics off until Accept",r={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:s,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:i,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}},p="Honoured: ads off",l=new Set(["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","IS","LI","NO"]),c={US:"us",PR:"us",GU:"us",VI:"us",AS:"us",MP:"us",CA:"ca",AU:"au",NZ:"nz",GB:"uk"};function u(o){const e=(o??"").trim().toUpperCase();return e?Object.hasOwn(c,e)?c[e]:l.has(e)?"eu":"other":"other"}const h=new Set(["Pacific/Honolulu","Pacific/Guam","Pacific/Saipan","Pacific/Pago_Pago","America/Puerto_Rico","America/St_Thomas"]),d=new Set(["New_York","Chicago","Denver","Los_Angeles","Phoenix","Anchorage","Adak","Boise","Detroit","Juneau","Sitka","Metlakatla","Yakutat","Nome","Menominee","Indianapolis","Louisville","Fort_Wayne","Knox_IN"]),f=new Set(["Toronto","Vancouver","Edmonton","Winnipeg","Halifax","St_Johns","Regina","Montreal","Moncton","Glace_Bay","Goose_Bay","Iqaluit","Whitehorse","Dawson","Dawson_Creek","Fort_Nelson","Creston","Cambridge_Bay","Inuvik","Rankin_Inlet","Resolute","Swift_Current","Atikokan","Blanc-Sablon","Nipigon","Thunder_Bay","Rainy_River","Pangnirtung","Yellowknife","Coral_Harbour"]);function y(o){const e=(o??"").trim();if(!e)return"other";if(e==="Europe/London"||e==="Europe/Belfast"||e==="GB"||e==="GB-Eire"||e==="Europe/Guernsey"||e==="Europe/Jersey"||e==="Europe/Isle_of_Man")return"uk";if(e.startsWith("Europe/")||e==="Atlantic/Canary"||e==="Atlantic/Madeira"||e==="Atlantic/Azores"||e==="Atlantic/Reykjavik"||e==="Atlantic/Faroe")return"eu";if(e.startsWith("Australia/")||e==="Antarctica/Macquarie")return"au";if(e==="Pacific/Auckland"||e==="Pacific/Chatham"||e==="NZ"||e==="NZ-CHAT")return"nz";if(e.startsWith("US/")||h.has(e))return"us";if(e.startsWith("Canada/"))return"ca";if(e.startsWith("America/")){const n=e.slice(8),t=n.split("/")[0];if(t==="Indiana"||t==="Kentucky"||t==="North_Dakota"||d.has(n))return"us";if(f.has(n))return"ca"}return"other"}function C(o,e){const n=y(o);if(!e)return n;const t=u(e);return r[n].model==="opt-in"?n:(r[t].model==="opt-in",t)}function A(o){const e=new Set,n=[];for(const t of o){const a=u(t);a==="other"||e.has(a)||(e.add(a),n.push(r[a]))}return n.push(r.other),n}function g(o){const e=[...o.googleAds?["Google"]:[],...o.meta?["Facebook","Instagram"]:[]];return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function k(o,e,n){const t=g(n),a=t?`We use cookies to count visits and to show you ${e} ads on ${t}.`:"We use cookies to count visits.";return o.model==="opt-in"?{heading:t?"Cookies and ads":"Cookies",before:`${a} Nothing loads until you choose. You can change this at any time with `,link:o.footerLink,after:" at the bottom of every page."}:{heading:t?"Cookies and ads":"Cookies",before:`${a} You can say no at any time: choose Privacy choices, or use `,link:o.footerLink,after:" at the bottom of every page."}}const w={necessary:{name:"Necessary",body:"Cart, checkout, your country and currency, sign-in, and this choice. The site cannot work without them.",bodyNoSale:"What the site needs to work, such as remembering this choice. The site cannot work without them."},analytics:{name:"Analytics",body:"Counts visits and pages so we can improve the site. Google Analytics and our own visit count."},ads:{body:"Google Ads and Meta (Facebook, Instagram) tags, and the order details we send to them to measure our ads.",bodyNoSale:"Google Ads and Meta (Facebook, Instagram) tags, which measure our ads."}},E={title:"Opt-out request honoured",body:"Your browser sent a Global Privacy Control signal. We have turned off sale and sharing of your information for ads."},P={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on"};export{P as CONSENT_BUTTONS,p as CONSENT_GPC_RULE,r as CONSENT_RULES,m as CONSENT_RULES_VERSION,E as GPC_HONOURED,w as PANEL_ROWS,g as adPlaces,k as bannerWords,u as regionOfCountry,y as regionOfTimeZone,A as rulesForCountries,C as visitorRegion};
@@ -0,0 +1,13 @@
1
+ export declare const COLLECTION_HOVER_ZOOM = 104;
2
+ export declare const COLLECTION_HOVER_ZOOM_CLASS = "group-hover:scale-[1.04]";
3
+ export declare const COLLECTION_DARKEN = 40;
4
+ export declare const COLLECTION_HOVER_DARKEN = 30;
5
+ export declare const COLLECTION_WASH_CLASS = "[background:rgba(0,0,0,0.4)] group-hover:[background:rgba(0,0,0,0.3)]";
6
+ export declare const COLLECTIONS_ROOM_BELOW: {
7
+ readonly bottom: 120;
8
+ readonly bottomPhone: 70;
9
+ };
10
+ export declare const COLLECTIONS_ROOM_Y = "py-[120px]";
11
+ export declare const COLLECTIONS_ROOM_Y_PHONE = "max-view-wide:py-[70px]";
12
+ export declare const COLLECTIONS_ROOM_BOTTOM = "pb-[120px]";
13
+ export declare const COLLECTIONS_ROOM_BOTTOM_PHONE = "max-view-wide:pb-[70px]";
@@ -0,0 +1 @@
1
+ const O=104,o="group-hover:scale-[1.04]",t=40,L=30,C="[background:rgba(0,0,0,0.4)] group-hover:[background:rgba(0,0,0,0.3)]",_={bottom:120,bottomPhone:70},p="py-[120px]",e="max-view-wide:py-[70px]",r="pb-[120px]",E="max-view-wide:pb-[70px]";export{_ as COLLECTIONS_ROOM_BELOW,r as COLLECTIONS_ROOM_BOTTOM,E as COLLECTIONS_ROOM_BOTTOM_PHONE,p as COLLECTIONS_ROOM_Y,e as COLLECTIONS_ROOM_Y_PHONE,t as COLLECTION_DARKEN,L as COLLECTION_HOVER_DARKEN,O as COLLECTION_HOVER_ZOOM,o as COLLECTION_HOVER_ZOOM_CLASS,C as COLLECTION_WASH_CLASS};
@@ -1 +1 @@
1
- import{BOX_HIDE_WHEN_ROW_EMPTY as E,CARD_ROW_LINK_PROP as u}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as o,CONTAINER_BLOCKS_SLOT as l}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as n}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as b,DIM as r,INNER_BOX as S,LABEL_FACE as N,TEXT as c,boxPadding as d,seedNodes as f,token as T}from"efficient-web-builder/format/lib/document/seed-parts";const _="template",h="reasonTemplate",L="channelTemplate",y={key:"title",label:"Title",plain:!0},$=[{key:"eyebrow",label:"Eyebrow",plain:!0},y,{key:"copy",label:"Body",multiline:!0},{key:"response",label:"Response time"}],M=[y],V=[{key:"label",label:"Label",plain:!0},{key:"value",label:"Value",plain:!0},{key:"sub",label:"Sub line",plain:!0},{key:"href",label:"Link",kind:"link"}],Y=["Text","ImageBlock",o],p=(e,t)=>({...N,...T("label",e),letterSpacing:t,lineHeight:1.5}),m={...p(12,.24),color:"main"},P={textStyle:"heading-3",...T("headingSmall",26),weight:500,case:"upper",lineHeight:1.05,letterSpacing:-.02},x={textStyle:"heading-1",...T("body",14),weight:400,case:"none",lineHeight:1.5,letterSpacing:0,color:"muted"},C=p(12,.22),A=p(12,.2),w={...p(12,.3),color:"main"},R={textStyle:"heading-3",...T("headingSmall",24),weight:500,case:"none",lineHeight:1.2,letterSpacing:-.02},H={...p(12,.2),color:"muted"},s=(e,t,i={})=>({...S,name:e,gap:t,gapPhone:t,...i}),B=()=>({type:o,props:s("Topic",16,{justify:"between",...d(40,32),sectionHeightMode:"fixed",sectionHeightValue:240,sectionHeightUnit:"px"}),slots:{[l]:[{type:o,props:s("Head",16),slots:{[l]:[n("eyebrow",{...c,tag:"p",widthFit:"fill"},m),n("title",{...c,tag:"h3",widthFit:"fill"},P)]}},{type:o,props:s("Foot",24),slots:{[l]:[n("copy",{...r,tag:"p",widthFit:"fill"},x),{type:o,props:{...b,name:"Response",direction:"row",justify:"between",align:"center",gap:16,gapPhone:16,phoneRow:2,sharePhone:"content",wrapPhone:"nowrap",...d(0,0),sectionPaddingTop:16,sectionPaddingTopPhone:16,sectionBorder:{top:1},[E]:["response"]},slots:{[l]:[{type:"Text",props:{...r,tag:"p",text:"Response",_partStyles:{text:C}}},n("response",{...c,tag:"p"},C)]}}]}}]}}),I=()=>({type:o,props:{...s("Reason",0),...d(12,16),sectionBorder:{width:1}},slots:{[l]:[n("title",{...r,tag:"p"},A)]}}),k=()=>({type:o,props:{...s("Channel",12),...d(32,20,20,20),sectionPaddingLeft:22,sectionPaddingTopTablet:20,sectionPaddingRightTablet:20,sectionPaddingBottomTablet:20,sectionPaddingLeftTablet:20,sectionBorder:{bottom:1}},slots:{[l]:[n("label",{...c,tag:"p",widthFit:"fill"},w),{type:o,props:{...s("Value",0),[u]:"href"},slots:{[l]:[n("value",{...c,tag:"p",widthFit:"fill"},R)]}},n("sub",{...r,tag:"p",widthFit:"fill"},H)]}});function g(e,t,i){return f([e],(O,a)=>a==="0"?`${t}~${i}`:`${t}~${i}.${a.slice(2)}`)}const F=e=>typeof e.id=="string"&&e.id.trim()?e.id:"ContactRouting";function U(e){const t=e[_]===void 0,i=e[h]===void 0,O=e[L]===void 0;if(!t&&!i&&!O)return e;const a=F(e);return{...e,...t?{[_]:g(B(),a,"topic")}:{},...i?{[h]:g(I(),a,"reason")}:{},...O?{[L]:g(k(),a,"channel")}:{}}}export{V as CONTACT_CHANNEL_FIELDS,L as CONTACT_CHANNEL_SLOT,M as CONTACT_REASON_FIELDS,h as CONTACT_REASON_SLOT,Y as CONTACT_TEMPLATE_ALLOW,$ as CONTACT_TOPIC_FIELDS,_ as CONTACT_TOPIC_SLOT,k as contactChannelSeed,I as contactReasonSeed,B as contactTopicSeed,U as withContactTemplates};
1
+ import{BOX_HIDE_WHEN_ROW_EMPTY as C,CARD_ROW_LINK_PROP as E}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as o,CONTAINER_BLOCKS_SLOT as l}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as n}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as S,DIM as r,INNER_BOX as b,TEXT as c,boxPadding as d,labelStyle as N,seedNodes as f,token as O}from"efficient-web-builder/format/lib/document/seed-parts";const h="template",_="reasonTemplate",L="channelTemplate",y={key:"title",label:"Title",plain:!0},$=[{key:"eyebrow",label:"Eyebrow",plain:!0},y,{key:"copy",label:"Body",multiline:!0},{key:"response",label:"Response time"}],M=[y],V=[{key:"label",label:"Label",plain:!0},{key:"value",label:"Value",plain:!0},{key:"sub",label:"Sub line",plain:!0},{key:"href",label:"Link",kind:"link"}],Y=["Text","ImageBlock",o],p=(e,t)=>({...N(e),letterSpacing:t,lineHeight:1.5}),m={...p(12,.24),color:"main"},P={textStyle:"heading-3",...O("headingSmall",26),weight:500,case:"upper",lineHeight:1.05,letterSpacing:-.02},x={textStyle:"heading-1",...O("body",14),weight:400,case:"none",lineHeight:1.5,letterSpacing:0,color:"muted"},u=p(12,.22),w=p(12,.2),A={...p(12,.3),color:"main"},R={textStyle:"heading-3",...O("headingSmall",24),weight:500,case:"none",lineHeight:1.2,letterSpacing:-.02},H={...p(12,.2),color:"muted"},s=(e,t,i={})=>({...b,name:e,gap:t,gapPhone:t,...i}),I=()=>({type:o,props:s("Topic",16,{justify:"between",...d(40,32),sectionHeightMode:"fixed",sectionHeightValue:240,sectionHeightUnit:"px"}),slots:{[l]:[{type:o,props:s("Head",16),slots:{[l]:[n("eyebrow",{...c,tag:"p",widthFit:"fill"},m),n("title",{...c,tag:"h3",widthFit:"fill"},P)]}},{type:o,props:s("Foot",24),slots:{[l]:[n("copy",{...r,tag:"p",widthFit:"fill"},x),{type:o,props:{...S,name:"Response",direction:"row",justify:"between",align:"center",gap:16,gapPhone:16,phoneRow:2,sharePhone:"content",wrapPhone:"nowrap",...d(0,0),sectionPaddingTop:16,sectionPaddingTopPhone:16,sectionBorder:{top:1},[C]:["response"]},slots:{[l]:[{type:"Text",props:{...r,tag:"p",text:"Response",_partStyles:{text:u}}},n("response",{...c,tag:"p"},u)]}}]}}]}}),B=()=>({type:o,props:{...s("Reason",0),...d(12,16),sectionBorder:{width:1}},slots:{[l]:[n("title",{...r,tag:"p"},w)]}}),k=()=>({type:o,props:{...s("Channel",12),...d(32,20,20,20),sectionPaddingLeft:22,sectionPaddingTopTablet:20,sectionPaddingRightTablet:20,sectionPaddingBottomTablet:20,sectionPaddingLeftTablet:20,sectionBorder:{bottom:1}},slots:{[l]:[n("label",{...c,tag:"p",widthFit:"fill"},A),{type:o,props:{...s("Value",0),[E]:"href"},slots:{[l]:[n("value",{...c,tag:"p",widthFit:"fill"},R)]}},n("sub",{...r,tag:"p",widthFit:"fill"},H)]}});function g(e,t,i){return f([e],(T,a)=>a==="0"?`${t}~${i}`:`${t}~${i}.${a.slice(2)}`)}const F=e=>typeof e.id=="string"&&e.id.trim()?e.id:"ContactRouting";function U(e){const t=e[h]===void 0,i=e[_]===void 0,T=e[L]===void 0;if(!t&&!i&&!T)return e;const a=F(e);return{...e,...t?{[h]:g(I(),a,"topic")}:{},...i?{[_]:g(B(),a,"reason")}:{},...T?{[L]:g(k(),a,"channel")}:{}}}export{V as CONTACT_CHANNEL_FIELDS,L as CONTACT_CHANNEL_SLOT,M as CONTACT_REASON_FIELDS,_ as CONTACT_REASON_SLOT,Y as CONTACT_TEMPLATE_ALLOW,$ as CONTACT_TOPIC_FIELDS,h as CONTACT_TOPIC_SLOT,k as contactChannelSeed,B as contactReasonSeed,I as contactTopicSeed,U as withContactTemplates};
@@ -126,6 +126,20 @@ export declare const NAMED_EXCEPTIONS: readonly [{
126
126
  readonly reason: "The colour dot inside its 1 px ring (13 px less the ring each side), as the old rail drew it.";
127
127
  readonly owner: "storefront sections owner";
128
128
  readonly due: "2026-12-18";
129
+ }, {
130
+ readonly part: "Tick box";
131
+ readonly kind: "corner";
132
+ readonly value: 2;
133
+ readonly reason: "The browser's own checkbox corners (2 px on 16 px), below the shell's smallest corner step (--radius-sm 4 px); kept so the tick box keeps the rail's look.";
134
+ readonly owner: "storefront sections owner";
135
+ readonly due: "2026-12-18";
136
+ }, {
137
+ readonly part: "Tick";
138
+ readonly kind: "corner";
139
+ readonly value: 1;
140
+ readonly reason: "The tick box's ground inside its 1 px ring follows the box's 2 px corners (2 - 1).";
141
+ readonly owner: "storefront sections owner";
142
+ readonly due: "2026-12-18";
129
143
  }, {
130
144
  readonly part: "aside";
131
145
  readonly kind: "padding";
@@ -1 +1 @@
1
- import{BOX_SWATCH_PROP as d}from"efficient-web-builder/format/lib/content/box-background";import{BOX_ROW_IMAGE_PROP as x}from"efficient-web-builder/format/lib/content/box-card-rule";import{BOX_HIDE_WHEN_ROW_EMPTY as p}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as t,CONTAINER_BLOCKS_SLOT as n}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as k}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as _,DIM as C,INNER_BOX as s,TEXT as m,boxPadding as c,seedNodes as b}from"efficient-web-builder/format/lib/document/seed-parts";const T="facetTemplate",I="Filter option template",B=[{key:"facetLabel",label:"Filter option"},{key:"facetName",label:"Type name"},{key:"facetCount",label:"Option count"},{key:"facetColour",label:"Option colour",kind:"colour"},{key:"facetTickFill",label:"Tick box fill",kind:"colour"},{key:"facetTick",label:"Tick mark",kind:"image"},{key:"facetTickMark",label:"Tick box shown"},{key:"facetRadioMark",label:"Round mark shown"},{key:"facetDot",label:"Round mark dot",kind:"colour"}],y="sf-facet-tick-picture",E="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%271%200.75%2014%2014%27%20id%3D%27"+y+"%27%3E%3Cpath%20d%3D%27M3.2%208%206.4%2011.2%2012.8%203.2%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.56%27%2F%3E%3C%2Fsvg%3E",W="--sf-facet-tick",K="[&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[background-image:none]! [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[background-color:var(--accent-ink)]! [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[-webkit-mask:var(--sf-facet-tick)_center/cover_no-repeat] [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[mask:var(--sf-facet-tick)_center/cover_no-repeat]";function X(e,r){return{facetLabel:e.label,facetName:"",facetCount:String(e.count),facetColour:e.swatch??"",facetTickFill:r?"main":"",facetTick:r?E:"",facetTickMark:"tick",facetRadioMark:"",facetDot:""}}function H(e,r){return{facetLabel:"",facetName:e.label,facetCount:String(e.count),facetColour:"",facetTickFill:r?"main":"",facetTick:"",facetTickMark:"",facetRadioMark:"radio",facetDot:r?"main":""}}const z=["Text","ImageBlock",t],h={..._,direction:"row",align:"center",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap"},i=(e,r)=>({...s,widthFit:"fixed",width:e,minWidth:e,sectionHeightMode:"fixed",sectionHeightValue:e,sectionHeightUnit:"px",...r}),f=13,l=10,o="2026-12-18",a="storefront sections owner",G=[{part:"facetLabel",kind:"size",value:f,reason:"The old rail's option words were 13 px; kept so no facet word moves.",owner:a,due:o},{part:"facetName",kind:"size",value:f,reason:"A type's name takes the facet words' 13 px, so the type picker has the same rail look.",owner:a,due:o},{part:"Option",kind:"gap",value:l,reason:"The old rail's 10 px between the option and its count; kept so no word moves.",owner:a,due:o},{part:"Choice",kind:"gap",value:l,reason:"The old rail's 10 px between tick box, dot and words; kept so no word moves.",owner:a,due:o},{part:"Tick box",kind:"padding",value:1,reason:"The 1 px ring round the tick box, drawn as the Box's own Fill inside 1 px padding.",owner:a,due:o},{part:"Radio",kind:"padding",value:1,reason:"The 1 px ring round the round mark, drawn as the Box's own Fill inside 1 px padding.",owner:a,due:o},{part:"Radio ground",kind:"padding",value:3,reason:"The 3 px between the round mark's ring and its 8 px dot, as the browser's own radio.",owner:a,due:o},{part:"Tick",kind:"box",value:14,reason:"The tick box's ground inside its 1 px ring: 16 px less the ring each side, the browser's own checkbox size.",owner:a,due:o},{part:"Radio ground",kind:"box",value:14,reason:"The round mark's ground inside its 1 px ring: 16 px less the ring each side, the browser's own radio size.",owner:a,due:o},{part:"Ring",kind:"box",value:13,reason:"The colour dot's 1 px ring as the old rail drew it (13 px round); kept so no swatch or word moves.",owner:a,due:o},{part:"Colour",kind:"box",value:11,reason:"The colour dot inside its 1 px ring (13 px less the ring each side), as the old rail drew it.",owner:a,due:o},{part:"aside",kind:"padding",value:22,reason:"The rail box's right padding at lg (PlpSidebar lg:pr-[22px]): 12 px room for the picked frame plus main's 10 px scrollbar room, so the content stays main's 258 px wide.",owner:a,due:o}],R={size:f,case:"capitalize",lineHeight:1.5},O={size:f,case:"none",lineHeight:1.5},A={textStyle:"body-5",size:11,case:"none",letterSpacing:0,lineHeight:1.5},w="muted",g="surface",F=()=>({type:t,props:{...h,name:"Option",justify:"between",gap:l,gapPhone:l,...c(4,12)},slots:{[n]:[{type:t,props:{...h,name:"Choice",gap:l,gapPhone:l,minWidth:0},slots:{[n]:[{type:t,props:{...s,name:"Tick mark",[p]:["facetTickMark"]},slots:{[n]:[{type:t,props:{...i(16,{sectionCorners:2,fillColor:w,[d]:"facetTickFill",...c(1,1)}),name:"Tick box"},slots:{[n]:[{type:t,props:{...i(14,{sectionCorners:1,fillColor:g,[d]:"facetTickFill",[x]:"facetTick",...c(0,0)}),name:"Tick"}}]}}]}},{type:t,props:{...s,name:"Round mark",[p]:["facetRadioMark"]},slots:{[n]:[{type:t,props:{...i(16,{sectionCorners:8,fillColor:w,[d]:"facetTickFill",...c(1,1)}),name:"Radio"},slots:{[n]:[{type:t,props:{...i(14,{sectionCorners:7,fillColor:g,...c(3,3)}),name:"Radio ground"},slots:{[n]:[{type:t,props:{...i(8,{sectionCorners:4,[d]:"facetDot",...c(0,0)}),name:"Dot"}}]}}]}}]}},{type:t,props:{...s,name:"Swatch",[p]:["facetColour"]},slots:{[n]:[{type:t,props:{...i(13,{sectionCorners:7,sectionBorder:{width:1}}),name:"Ring"},slots:{[n]:[{type:t,props:{...i(11,{sectionCorners:6,[d]:"facetColour"}),name:"Colour"}}]}}]}},{type:t,props:{...s,name:"Label",[p]:["facetLabel"]},slots:{[n]:[k("facetLabel",{...m,tag:"span",minWidth:0},R)]}},{type:t,props:{...s,name:"Name",[p]:["facetName"]},slots:{[n]:[k("facetName",{...m,tag:"span",minWidth:0},O)]}}]}},k("facetCount",{...C,tag:"span"},A)]}});function L(e){return b([F()],(r,u)=>u==="0"?`${e}~facet`:`${e}~facet.${u.slice(2)}`)}function U(e){if(e[T]!==void 0)return e;const r=typeof e.id=="string"&&e.id.trim()?e.id:"AlloyWheelsListing";return{...e,[T]:L(r)}}export{B as FACET_ROW_FIELDS,z as FACET_TEMPLATE_ALLOW,I as FACET_TEMPLATE_LABEL,T as FACET_TEMPLATE_SLOT,E as FACET_TICK,K as FACET_TICK_INK_CLASS,y as FACET_TICK_MARK,W as FACET_TICK_VAR,G as NAMED_EXCEPTIONS,X as facetRow,L as facetRowSeed,H as typeRow,U as withFacetTemplate};
1
+ import{BOX_SWATCH_PROP as c}from"efficient-web-builder/format/lib/content/box-background";import{BOX_ROW_IMAGE_PROP as C}from"efficient-web-builder/format/lib/content/box-card-rule";import{BOX_HIDE_WHEN_ROW_EMPTY as l}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as t,CONTAINER_BLOCKS_SLOT as r}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as f}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as y,DIM as R,INNER_BOX as d,TEXT as m,boxPadding as i,seedNodes as E}from"efficient-web-builder/format/lib/document/seed-parts";import{roundBox as p,squareBox as T}from"./square-box.js";const h="facetTemplate",X="Filter option template",z=[{key:"facetLabel",label:"Filter option"},{key:"facetName",label:"Type name"},{key:"facetCount",label:"Option count"},{key:"facetColour",label:"Option colour",kind:"colour"},{key:"facetTickFill",label:"Tick box fill",kind:"colour"},{key:"facetTick",label:"Tick mark",kind:"image"},{key:"facetTickMark",label:"Tick box shown"},{key:"facetRadioMark",label:"Round mark shown"},{key:"facetDot",label:"Round mark dot",kind:"colour"}],O="sf-facet-tick-picture",v="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%271%200.75%2014%2014%27%20id%3D%27"+O+"%27%3E%3Cpath%20d%3D%27M3.2%208%206.4%2011.2%2012.8%203.2%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.56%27%2F%3E%3C%2Fsvg%3E",H="--sf-facet-tick",G="[&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[background-image:none]! [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[background-color:var(--accent-ink)]! [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[-webkit-mask:var(--sf-facet-tick)_center/cover_no-repeat] [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[mask:var(--sf-facet-tick)_center/cover_no-repeat]";function U(e,n){return{facetLabel:e.label,facetName:"",facetCount:String(e.count),facetColour:e.swatch??"",facetTickFill:n?"main":"",facetTick:n?v:"",facetTickMark:"tick",facetRadioMark:"",facetDot:""}}function $(e,n){return{facetLabel:"",facetName:e.label,facetCount:String(e.count),facetColour:"",facetTickFill:n?"main":"",facetTick:"",facetTickMark:"",facetRadioMark:"radio",facetDot:n?"main":""}}const Y=["Text","ImageBlock",t],x={...y,direction:"row",align:"center",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap"},k=13,s=10,w=2,g=1,o="2026-12-18",a="storefront sections owner",j=[{part:"facetLabel",kind:"size",value:k,reason:"The old rail's option words were 13 px; kept so no facet word moves.",owner:a,due:o},{part:"facetName",kind:"size",value:k,reason:"A type's name takes the facet words' 13 px, so the type picker has the same rail look.",owner:a,due:o},{part:"Option",kind:"gap",value:s,reason:"The old rail's 10 px between the option and its count; kept so no word moves.",owner:a,due:o},{part:"Choice",kind:"gap",value:s,reason:"The old rail's 10 px between tick box, dot and words; kept so no word moves.",owner:a,due:o},{part:"Tick box",kind:"padding",value:1,reason:"The 1 px ring round the tick box, drawn as the Box's own Fill inside 1 px padding.",owner:a,due:o},{part:"Radio",kind:"padding",value:1,reason:"The 1 px ring round the round mark, drawn as the Box's own Fill inside 1 px padding.",owner:a,due:o},{part:"Radio ground",kind:"padding",value:3,reason:"The 3 px between the round mark's ring and its 8 px dot, as the browser's own radio.",owner:a,due:o},{part:"Tick",kind:"box",value:14,reason:"The tick box's ground inside its 1 px ring: 16 px less the ring each side, the browser's own checkbox size.",owner:a,due:o},{part:"Radio ground",kind:"box",value:14,reason:"The round mark's ground inside its 1 px ring: 16 px less the ring each side, the browser's own radio size.",owner:a,due:o},{part:"Ring",kind:"box",value:13,reason:"The colour dot's 1 px ring as the old rail drew it (13 px round); kept so no swatch or word moves.",owner:a,due:o},{part:"Colour",kind:"box",value:11,reason:"The colour dot inside its 1 px ring (13 px less the ring each side), as the old rail drew it.",owner:a,due:o},{part:"Tick box",kind:"corner",value:w,reason:"The browser's own checkbox corners (2 px on 16 px), below the shell's smallest corner step (--radius-sm 4 px); kept so the tick box keeps the rail's look.",owner:a,due:o},{part:"Tick",kind:"corner",value:g,reason:"The tick box's ground inside its 1 px ring follows the box's 2 px corners (2 - 1).",owner:a,due:o},{part:"aside",kind:"padding",value:22,reason:"The rail box's right padding at lg (PlpSidebar lg:pr-[22px]): 12 px room for the picked frame plus main's 10 px scrollbar room, so the content stays main's 258 px wide.",owner:a,due:o}],A={size:k,case:"capitalize",lineHeight:1.5},F={size:k,case:"none",lineHeight:1.5},L={textStyle:"body-5",size:11,case:"none",letterSpacing:0,lineHeight:1.5},_="muted",b="surface",N=()=>({type:t,props:{...x,name:"Option",justify:"between",gap:s,gapPhone:s,...i(4,12)},slots:{[r]:[{type:t,props:{...x,name:"Choice",gap:s,gapPhone:s,minWidth:0},slots:{[r]:[{type:t,props:{...d,name:"Tick mark",[l]:["facetTickMark"]},slots:{[r]:[{type:t,props:{...T(16,{sectionCorners:w,fillColor:_,[c]:"facetTickFill",...i(1,1)}),name:"Tick box"},slots:{[r]:[{type:t,props:{...T(14,{sectionCorners:g,fillColor:b,[c]:"facetTickFill",[C]:"facetTick",...i(0,0)}),name:"Tick"}}]}}]}},{type:t,props:{...d,name:"Round mark",[l]:["facetRadioMark"]},slots:{[r]:[{type:t,props:{...p(16,{fillColor:_,[c]:"facetTickFill",...i(1,1)}),name:"Radio"},slots:{[r]:[{type:t,props:{...p(14,{fillColor:b,...i(3,3)}),name:"Radio ground"},slots:{[r]:[{type:t,props:{...p(8,{[c]:"facetDot",...i(0,0)}),name:"Dot"}}]}}]}}]}},{type:t,props:{...d,name:"Swatch",[l]:["facetColour"]},slots:{[r]:[{type:t,props:{...p(13,{sectionBorder:{width:1}}),name:"Ring"},slots:{[r]:[{type:t,props:{...p(11,{[c]:"facetColour"}),name:"Colour"}}]}}]}},{type:t,props:{...d,name:"Label",[l]:["facetLabel"]},slots:{[r]:[f("facetLabel",{...m,tag:"span",minWidth:0},A)]}},{type:t,props:{...d,name:"Name",[l]:["facetName"]},slots:{[r]:[f("facetName",{...m,tag:"span",minWidth:0},F)]}}]}},f("facetCount",{...R,tag:"span"},L)]}});function P(e){return E([N()],(n,u)=>u==="0"?`${e}~facet`:`${e}~facet.${u.slice(2)}`)}function q(e){if(e[h]!==void 0)return e;const n=typeof e.id=="string"&&e.id.trim()?e.id:"AlloyWheelsListing";return{...e,[h]:P(n)}}export{z as FACET_ROW_FIELDS,Y as FACET_TEMPLATE_ALLOW,X as FACET_TEMPLATE_LABEL,h as FACET_TEMPLATE_SLOT,v as FACET_TICK,G as FACET_TICK_INK_CLASS,O as FACET_TICK_MARK,H as FACET_TICK_VAR,j as NAMED_EXCEPTIONS,U as facetRow,P as facetRowSeed,$ as typeRow,q as withFacetTemplate};
@@ -1 +1 @@
1
- import{CARD_LIST_TYPE as c,CARD_ROW_FIELD_PROP as f}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as n,CONTAINER_BLOCKS_SLOT as p}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as r}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as L,DIM as s,INNER_BOX as E,TEXT as l,boxPadding as m,seedNodes as O,token as d}from"efficient-web-builder/format/lib/document/seed-parts";const I="options",R=["Text","ImageBlock",n,c],b=["Text","ImageBlock",n],u=(e,t)=>({textStyle:"body-5",...d("label",e),case:"upper",letterSpacing:t,lineHeight:1.2}),P=u(12,.32),T=u(12,.18),_={textStyle:"body-5",...d("label",11),case:"upper",letterSpacing:.14,lineHeight:1.2,color:"main"},a=(e,t,i={})=>({...L,direction:"row",align:"center",gap:e,gapPhone:e,phoneRow:2,sharePhone:"content",...t?{wrapPhone:"nowrap"}:{},...i}),x=()=>({type:n,props:{...a(8,!0),name:"Option",...m(8,12),sectionBorder:{width:1}},slots:{[p]:[r("label",{...l,tag:"p"},T),r("count",{...s,tag:"p"},T)]}});function S(e){const t=o=>o==="0"?`${e}~group`:`${e}~group.${o.slice(2)}`,i={type:n,props:{...E,name:"Group",gap:12,gapPhone:12},slots:{[p]:[r("label",{...s,tag:"p"},P),{type:n,props:{...a(8,!1,{align:"start",wrap:!0}),name:"Options"},slots:{[p]:[{type:c,props:{[f]:I},slots:{template:[x()]}}]}}]}};return O([i],(o,h)=>t(h))}function w(e){const t={type:n,props:{...a(8,!0),name:"Chip",...m(4,8),sectionBorder:{width:1}},slots:{[p]:[r("label",{...l,tag:"p"},_),r("mark",{...l,tag:"p"},_)]}};return O([t],(i,o)=>o==="0"?`${e}~chip`:`${e}~chip.${o.slice(2)}`)}const g=(e,t)=>typeof e.id=="string"&&e.id.trim()?e.id:t;function A(e){return e.template!==void 0?e:{...e,template:S(g(e,"FilterBlock"))}}function N(e){return e.template!==void 0?e:{...e,template:w(g(e,"FilterChipsBlock"))}}export{b as FILTER_CHIPS_TEMPLATE_ALLOW,I as FILTER_OPTIONS_FIELD,R as FILTER_TEMPLATE_ALLOW,S as filterCardSeed,w as filterChipSeed,N as withFilterChipsTemplate,A as withFilterTemplate};
1
+ import{CARD_LIST_TYPE as s,CARD_ROW_FIELD_PROP as h}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as n,CONTAINER_BLOCKS_SLOT as p}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as r}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as f,DIM as m,INNER_BOX as L,TEXT as l,boxPadding as O,labelStyle as E,seedNodes as T}from"efficient-web-builder/format/lib/document/seed-parts";const I="options",y=["Text","ImageBlock",n,s],A=["Text","ImageBlock",n],a=(t,e)=>({...E(t),letterSpacing:e,lineHeight:1.2}),P=a(12,.32),_=a(12,.18),d={...a(11,.14),color:"main"},c=(t,e,i={})=>({...f,direction:"row",align:"center",gap:t,gapPhone:t,phoneRow:2,sharePhone:"content",...e?{wrapPhone:"nowrap"}:{},...i}),w=()=>({type:n,props:{...c(8,!0),name:"Option",...O(8,12),sectionBorder:{width:1}},slots:{[p]:[r("label",{...l,tag:"p"},_),r("count",{...m,tag:"p"},_)]}});function x(t){const e=o=>o==="0"?`${t}~group`:`${t}~group.${o.slice(2)}`,i={type:n,props:{...L,name:"Group",gap:12,gapPhone:12},slots:{[p]:[r("label",{...m,tag:"p"},P),{type:n,props:{...c(8,!1,{align:"start",wrap:!0}),name:"Options"},slots:{[p]:[{type:s,props:{[h]:I},slots:{template:[w()]}}]}}]}};return T([i],(o,g)=>e(g))}function C(t){const e={type:n,props:{...c(8,!0),name:"Chip",...O(4,8),sectionBorder:{width:1}},slots:{[p]:[r("label",{...l,tag:"p"},d),r("mark",{...l,tag:"p"},d)]}};return T([e],(i,o)=>o==="0"?`${t}~chip`:`${t}~chip.${o.slice(2)}`)}const u=(t,e)=>typeof t.id=="string"&&t.id.trim()?t.id:e;function N(t){return t.template!==void 0?t:{...t,template:x(u(t,"FilterBlock"))}}function b(t){return t.template!==void 0?t:{...t,template:C(u(t,"FilterChipsBlock"))}}export{A as FILTER_CHIPS_TEMPLATE_ALLOW,I as FILTER_OPTIONS_FIELD,y as FILTER_TEMPLATE_ALLOW,x as filterCardSeed,C as filterChipSeed,b as withFilterChipsTemplate,N as withFilterTemplate};
@@ -1 +1 @@
1
- import{BOX_SWATCH_PROP as d}from"efficient-web-builder/format/lib/content/box-background";import{BOX_HIDE_WHEN_ROW_EMPTY as O}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as t,CONTAINER_BLOCKS_SLOT as i}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as r}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as l,DIM as _,INNER_BOX as p,TEXT as c,boxPadding as a,seedNodes as h,token as T}from"efficient-web-builder/format/lib/document/seed-parts";const m="optionTemplate",b="Option template",f=[{key:"swatch",label:"Finish colour",kind:"colour"},{key:"name",label:"Finish name"},{key:"label",label:"Option"},{key:"note",label:"Option note"}],x=["Text",t],s=(e,o,n={})=>({textStyle:"body-5",...T("label",e),case:"upper",letterSpacing:o,lineHeight:1.5,...n}),w={...l,direction:"row",align:"center",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap"},E=()=>({type:t,props:{...l,direction:"column",name:"Option",...a(12,12),sectionBorder:{width:2}},slots:{[i]:[{type:t,props:{...w,name:"Finish",gap:12,gapPhone:12,[O]:["swatch"]},slots:{[i]:[{type:t,props:{...p,name:"Swatch"},slots:{[i]:[{type:t,props:{...p,name:"Dot",...a(9,9),sectionCorners:10,sectionBorder:{width:1},[d]:"swatch"}}]}},r("name",{...c,tag:"span",minWidth:0},s(12,.18,{weight:700}))]}},{type:t,props:{...p,name:"Words",gap:4,gapPhone:4,...a(0,4),[O]:["label"]},slots:{[i]:[r("label",{...c,tag:"span"},s(14,.18)),r("note",{..._,tag:"span"},s(11,.12))]}}]}});function P(e){return h([E()],(o,n)=>n==="0"?`${e}~option`:`${e}~option.${n.slice(2)}`)}function H(e){if(e[m]!==void 0)return e;const o=typeof e.id=="string"&&e.id.trim()?e.id:"ProductHero";return{...e,[m]:P(o)}}export{x as HERO_OPTION_ALLOW,f as HERO_OPTION_FIELDS,m as HERO_OPTION_SLOT,b as HERO_OPTION_SLOT_LABEL,P as heroOptionSeed,H as withHeroOptionTemplate};
1
+ import{BOX_SWATCH_PROP as d}from"efficient-web-builder/format/lib/content/box-background";import{BOX_HIDE_WHEN_ROW_EMPTY as s}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as o,CONTAINER_BLOCKS_SLOT as i}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as r}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as O,DIM as _,INNER_BOX as l,TEXT as c,boxPadding as p,labelStyle as h,seedNodes as T}from"efficient-web-builder/format/lib/document/seed-parts";import{roundBox as w}from"./square-box.js";const m="optionTemplate",B="Option template",H=[{key:"swatch",label:"Finish colour",kind:"colour"},{key:"name",label:"Finish name"},{key:"label",label:"Option"},{key:"note",label:"Option note"}],R=["Text",o],a=(e,t,n={})=>({...h(e),letterSpacing:t,lineHeight:1.5,...n}),E={...O,direction:"row",align:"center",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap"},P=()=>({type:o,props:{...O,direction:"column",name:"Option",...p(12,12),sectionBorder:{width:2}},slots:{[i]:[{type:o,props:{...E,name:"Finish",gap:12,gapPhone:12,[s]:["swatch"]},slots:{[i]:[{type:o,props:{...l,name:"Swatch"},slots:{[i]:[{type:o,props:{...w(20,{...p(0,0),sectionBorder:{width:1},[d]:"swatch"}),name:"Dot"}}]}},r("name",{...c,tag:"span",minWidth:0},a(12,.18,{weight:700}))]}},{type:o,props:{...l,name:"Words",gap:4,gapPhone:4,...p(0,4),[s]:["label"]},slots:{[i]:[r("label",{...c,tag:"span"},a(14,.18)),r("note",{..._,tag:"span"},a(11,.12))]}}]}});function g(e){return T([P()],(t,n)=>n==="0"?`${e}~option`:`${e}~option.${n.slice(2)}`)}function b(e){if(e[m]!==void 0)return e;const t=typeof e.id=="string"&&e.id.trim()?e.id:"ProductHero";return{...e,[m]:g(t)}}export{R as HERO_OPTION_ALLOW,H as HERO_OPTION_FIELDS,m as HERO_OPTION_SLOT,B as HERO_OPTION_SLOT_LABEL,g as heroOptionSeed,b as withHeroOptionTemplate};
@@ -0,0 +1,4 @@
1
+ type Props = Record<string, unknown>;
2
+ export declare const squareBox: (size: number, look?: Props) => Props;
3
+ export declare const roundBox: (size: number, look?: Props) => Props;
4
+ export {};
@@ -0,0 +1 @@
1
+ import{markBoxProps as e}from"efficient-web-builder/format/lib/document/seed-parts";const t=(o,r={})=>{const{fillColor:s,...n}=e(o,void 0);return{...n,...r}},c=(o,r={})=>t(o,{sectionCorners:Math.ceil(o/2),...r});export{c as roundBox,t as squareBox};
@@ -1 +1 @@
1
- const a=[{code:"US",name:"United States"},{code:"GB",name:"United Kingdom"},{code:"AU",name:"Australia"},{code:"CA",name:"Canada"},{code:"IE",name:"Ireland"},{code:"NZ",name:"New Zealand"},{code:"DE",name:"Germany"},{code:"FR",name:"France"},{code:"IT",name:"Italy"},{code:"ES",name:"Spain"},{code:"NL",name:"Netherlands"},{code:"BE",name:"Belgium"},{code:"AT",name:"Austria"},{code:"CH",name:"Switzerland"},{code:"SE",name:"Sweden"},{code:"NO",name:"Norway"},{code:"DK",name:"Denmark"},{code:"FI",name:"Finland"},{code:"PT",name:"Portugal"},{code:"PL",name:"Poland"},{code:"JP",name:"Japan"},{code:"SG",name:"Singapore"},{code:"AE",name:"United Arab Emirates"},{code:"HK",name:"Hong Kong"},{code:"ZA",name:"South Africa"}],n=Object.fromEntries(a.map(e=>[e.code,e.name]));function o(e){return n[e]??e}export{a as COUNTRY_OPTIONS,o as countryName};
1
+ const a=[{code:"US",name:"United States"},{code:"GB",name:"United Kingdom"},{code:"AU",name:"Australia"},{code:"CA",name:"Canada"},{code:"IE",name:"Ireland"},{code:"NZ",name:"New Zealand"},{code:"DE",name:"Germany"},{code:"FR",name:"France"},{code:"IT",name:"Italy"},{code:"ES",name:"Spain"},{code:"NL",name:"Netherlands"},{code:"BE",name:"Belgium"},{code:"AT",name:"Austria"},{code:"CH",name:"Switzerland"},{code:"SE",name:"Sweden"},{code:"NO",name:"Norway"},{code:"DK",name:"Denmark"},{code:"FI",name:"Finland"},{code:"PT",name:"Portugal"},{code:"PL",name:"Poland"},{code:"JP",name:"Japan"},{code:"SG",name:"Singapore"},{code:"AE",name:"United Arab Emirates"},{code:"HK",name:"Hong Kong"},{code:"ZA",name:"South Africa"}],n=Object.fromEntries(a.map(e=>[e.code,e.name]));function o(e){return(Object.hasOwn(n,e)?n[e]:void 0)??e}export{a as COUNTRY_OPTIONS,o as countryName};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import r from"../../../../../components/wheels-plp/AlloyWheelsListing.js";import{hidableText as n}from"efficient-easel/screen/lib/document/hidable";import{asPlpSortKey as m,listingHiddenFacets as g}from"../../../../wheels/plp-filters.js";import{cardHoverOf as f}from"efficient-web-builder/format/lib/animation/hover";import{phHide as a}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{headInOwnBox as h}from"efficient-web-builder/render/lib/sections/section-to-box";import{FACET_TEMPLATE_SLOT as c}from"../../../../content/facet-row-seed.js";import{AlloyWheelsListingMeta as s,ALLOYWHEELSLISTING_PH as d}from"./meta.js";const k={...s,render:e=>{const t=h(e),i=o=>t?void 0:o;return l(r,{titleLevel:e.titleLevel,heading:i(a(e.heading,d.heading,e.editor)),intro:i(a(e.intro,d.intro,e.editor)),omitHead:t,askForCar:e.askForCar!==!1,gateHeading:n(e.gateHeading),gateIntro:n(e.gateIntro),perPage:e.perPage,columns:e.columns,defaultSort:m(e.defaultSort),ownerId:typeof e.id=="string"?e.id:"",template:e.template,facetTemplate:e[c],hover:f(e,"AlloyWheelsListing"),hiddenFacets:g(e),showPrice:e.showPrice,showInStock:e.showInStock!==!1,kinds:e.kinds,products:e.products,wheels:e.wheels,fieldUsage:e.fieldUsage,editing:e.editor?.isEditing})}};export{k as AlloyWheelsListingRender};
1
+ import{jsx as l}from"react/jsx-runtime";import{PAGE_TITLE_LEVEL_PROP as r}from"efficient-web-builder/format/lib/document/one-h1";import m from"../../../../../components/wheels-plp/AlloyWheelsListing.js";import{hidableText as n}from"efficient-easel/screen/lib/document/hidable";import{asPlpSortKey as g,listingHiddenFacets as f}from"../../../../wheels/plp-filters.js";import{cardHoverOf as h}from"efficient-web-builder/format/lib/animation/hover";import{phHide as a}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{headInOwnBox as c}from"efficient-web-builder/render/lib/sections/section-to-box";import{FACET_TEMPLATE_SLOT as s}from"../../../../content/facet-row-seed.js";import{AlloyWheelsListingMeta as L,ALLOYWHEELSLISTING_PH as d}from"./meta.js";const k={...L,render:e=>{const t=c(e),i=o=>t?void 0:o;return l(m,{titleLevel:e[r],heading:i(a(e.heading,d.heading,e.editor)),intro:i(a(e.intro,d.intro,e.editor)),omitHead:t,askForCar:e.askForCar!==!1,gateHeading:n(e.gateHeading),gateIntro:n(e.gateIntro),perPage:e.perPage,columns:e.columns,defaultSort:g(e.defaultSort),ownerId:typeof e.id=="string"?e.id:"",template:e.template,facetTemplate:e[s],hover:h(e,"AlloyWheelsListing"),hiddenFacets:f(e),showPrice:e.showPrice,showInStock:e.showInStock!==!1,kinds:e.kinds,products:e.products,wheels:e.wheels,fieldUsage:e.fieldUsage,editing:e.editor?.isEditing})}};export{k as AlloyWheelsListingRender};
@@ -3,5 +3,9 @@ export declare const CollectionsSlots: {
3
3
  cards: {
4
4
  type: "slot";
5
5
  };
6
+ template: {
7
+ type: "slot";
8
+ allow: string[];
9
+ };
6
10
  };
7
11
  export declare const CollectionsMeta: Omit<BlockRender, "render">;
@@ -1 +1 @@
1
- const l={cards:{type:"slot"}},o={label:"Collections",fields:l,defaultProps:{columns:3,limit:6}};export{o as CollectionsMeta,l as CollectionsSlots};
1
+ import{cardTemplateSlot as t}from"efficient-web-builder/format/lib/content/card-template";const l={cards:{type:"slot"},template:t()},e={label:"Collections",fields:l,defaultProps:{columns:3,limit:6}};export{e as CollectionsMeta,l as CollectionsSlots};
@@ -1 +1 @@
1
- import{jsx as m}from"react/jsx-runtime";import r from"../../../../../components/Collections.js";import{readPartStyles as a}from"efficient-web-builder/render/lib/document/part-styles";import{parseSectionHeadPlacement as c}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as o}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHideDefault as n}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{CollectionsMeta as l}from"./meta.js";const H={...l,render:e=>{const t=c(e.headPlacement)==="own-box",i=d=>t?void 0:d;return m(r,{eyebrow:i(n(e.eyebrow,o.sectionNumber,e.editor)),heading:i(n(e.heading,o.sectionHeading,e.editor)),omitHead:t,nodeId:typeof e.id=="string"?e.id:void 0,partStyles:a(e),editing:e.editor?.isEditing,columns:e.columns,limit:e.limit,cards:e.cards})}};export{H as CollectionsRender};
1
+ import{jsx as m}from"react/jsx-runtime";import r from"../../../../../components/Collections.js";import{readPartStyles as a}from"efficient-web-builder/render/lib/document/part-styles";import{parseSectionHeadPlacement as l}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as n}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHideDefault as o}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{CollectionsMeta as c}from"./meta.js";const H={...c,render:e=>{const t=l(e.headPlacement)==="own-box",i=d=>t?void 0:d;return m(r,{eyebrow:i(o(e.eyebrow,n.sectionNumber,e.editor)),heading:i(o(e.heading,n.sectionHeading,e.editor)),omitHead:t,nodeId:typeof e.id=="string"?e.id:void 0,partStyles:a(e),editing:e.editor?.isEditing,columns:e.columns,limit:e.limit,cards:e.cards,template:e.template})}};export{H as CollectionsRender};
@@ -4,5 +4,9 @@ export declare const FilterBlockSlots: {
4
4
  type: "slot";
5
5
  allow: ("Flex" | "Text" | "ImageBlock" | "CardList")[];
6
6
  };
7
+ facetTemplate: {
8
+ type: "slot";
9
+ allow: ("Flex" | "Text" | "ImageBlock")[];
10
+ };
7
11
  };
8
12
  export declare const FilterBlockMeta: Omit<BlockRender, "render">;