efficient-storefront-blocks 0.80.0 → 0.81.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 (133) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/chunks/{EditorPreviewCheckout-PSONSVRR.js → EditorPreviewCheckout-OIN6G67Y.js} +4 -4
  3. package/dist/chunks/{SiteEditorProvider-PWHW2UA6.js → SiteEditorProvider-PXXYEDUI.js} +1 -1
  4. package/dist/chunks/{chunk-MCCDGDRW.js → chunk-EEBM2KUO.js} +1 -1
  5. package/dist/chunks/{chunk-3Q66B5NU.js → chunk-K3VUREAB.js} +1 -1
  6. package/dist/chunks/chunk-SXRBNRRO.js +320 -0
  7. package/dist/chunks/{fitment-data-Q2TJ6FBU.js → fitment-data-WHDQR3A2.js} +1 -1
  8. package/dist/editor/components/PreviewProductPicker.js +1 -1
  9. package/dist/editor/lib/document/blocks/commerce/DetailRows/fields.js +1 -1
  10. package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
  11. package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
  12. package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/commerce/RelatedProducts/fields.js +1 -1
  14. package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
  16. package/dist/editor/lib/document/blocks/commerce/page-rules.d.ts +2 -0
  17. package/dist/editor/lib/document/blocks/commerce/page-rules.js +1 -1
  18. package/dist/editor/lib/document/config.d.ts +1 -0
  19. package/dist/editor/lib/document/config.js +1 -1
  20. package/dist/editor/lib/document/section-text-regions.d.ts +1 -0
  21. package/dist/editor/lib/document/section-text-regions.js +1 -0
  22. package/dist/index.js +28 -28
  23. package/dist/render/app/globals.css +17 -17
  24. package/dist/render/built-with.json +1 -1
  25. package/dist/render/components/AppointmentBooking.js +1 -1
  26. package/dist/render/components/CheckoutCTA.js +1 -1
  27. package/dist/render/components/CollectionCard.js +1 -1
  28. package/dist/render/components/Collections.js +1 -1
  29. package/dist/render/components/CompatibleTyres.js +1 -1
  30. package/dist/render/components/ConsentBanner.js +1 -1
  31. package/dist/render/components/ContactCards.js +1 -1
  32. package/dist/render/components/ContactRouting.js +1 -1
  33. package/dist/render/components/DeliveryOptions.js +1 -1
  34. package/dist/render/components/DetailRows.js +1 -1
  35. package/dist/render/components/EuTyreLabels.d.ts +1 -1
  36. package/dist/render/components/EuTyreLabels.js +1 -1
  37. package/dist/render/components/Events.js +1 -1
  38. package/dist/render/components/FitmentTable.js +1 -1
  39. package/dist/render/components/FooterDivider.js +1 -1
  40. package/dist/render/components/FooterSection.js +1 -1
  41. package/dist/render/components/FooterSocial.js +1 -1
  42. package/dist/render/components/FormBlock.js +1 -1
  43. package/dist/render/components/GalleryCard.js +1 -1
  44. package/dist/render/components/GalleryGrid.js +1 -1
  45. package/dist/render/components/GalleryItem.js +1 -1
  46. package/dist/render/components/GalleryShowcase.js +1 -1
  47. package/dist/render/components/LinkedProductHero.d.ts +2 -1
  48. package/dist/render/components/MessagingCards.js +1 -1
  49. package/dist/render/components/ProductCard.js +1 -1
  50. package/dist/render/components/ProductCardChrome.d.ts +4 -3
  51. package/dist/render/components/ProductCardChrome.js +1 -1
  52. package/dist/render/components/ProductGallery.js +1 -1
  53. package/dist/render/components/ProductGridSection.d.ts +7 -6
  54. package/dist/render/components/ProductGridSection.js +1 -1
  55. package/dist/render/components/ProductHeroPanel.d.ts +7 -2
  56. package/dist/render/components/ProductHeroPanel.js +1 -1
  57. package/dist/render/components/ProductLightbox.js +1 -1
  58. package/dist/render/components/RateTable.js +1 -1
  59. package/dist/render/components/ReviewForm.js +1 -1
  60. package/dist/render/components/Reviews.js +1 -1
  61. package/dist/render/components/SectionBand.d.ts +5 -2
  62. package/dist/render/components/SectionBand.js +1 -1
  63. package/dist/render/components/SectionBandChoice.d.ts +5 -0
  64. package/dist/render/components/SectionBandChoice.js +1 -0
  65. package/dist/render/components/SpecTable.js +1 -1
  66. package/dist/render/components/SubmitBuild.js +1 -1
  67. package/dist/render/components/Subscribe.js +1 -1
  68. package/dist/render/components/ThemedSelect.d.ts +4 -2
  69. package/dist/render/components/ThemedSelect.js +1 -1
  70. package/dist/render/components/TyreVehicleFitment.d.ts +2 -2
  71. package/dist/render/components/TyreVehicleFitment.js +1 -1
  72. package/dist/render/components/WheelCardFrame.js +1 -1
  73. package/dist/render/components/WheelPlaceholder.d.ts +3 -1
  74. package/dist/render/components/WheelPlaceholder.js +1 -1
  75. package/dist/render/components/booking/BookingRegions.js +1 -1
  76. package/dist/render/components/buy-row.d.ts +1 -1
  77. package/dist/render/components/buy-row.js +1 -1
  78. package/dist/render/components/card-pieces/CardPicture.d.ts +1 -1
  79. package/dist/render/components/card-pieces/CardPicture.js +1 -1
  80. package/dist/render/components/card-spin.d.ts +7 -0
  81. package/dist/render/components/card-spin.js +1 -0
  82. package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
  83. package/dist/render/components/catalog/CatalogVehiclePicker.js +1 -1
  84. package/dist/render/components/catalog/PriceRange.d.ts +6 -0
  85. package/dist/render/components/catalog/PriceRange.js +1 -0
  86. package/dist/render/components/catalog/SortSelect.d.ts +8 -0
  87. package/dist/render/components/catalog/SortSelect.js +1 -0
  88. package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
  89. package/dist/render/components/checkout/checkout-parts.js +1 -1
  90. package/dist/render/components/fitment/FitmentFinder.js +1 -1
  91. package/dist/render/components/fitment/FitmentPickerGrid.js +1 -1
  92. package/dist/render/components/fitment/StockFitmentCard.js +1 -1
  93. package/dist/render/components/pdp-dynamic/DynamicBundleOffer.js +1 -1
  94. package/dist/render/components/pdp-dynamic/DynamicDetailRows.js +1 -1
  95. package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
  96. package/dist/render/components/pdp-dynamic/DynamicProductHero.d.ts +2 -1
  97. package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.d.ts +3 -2
  98. package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
  99. package/dist/render/components/pdp-dynamic/DynamicTyreSizes.js +1 -1
  100. package/dist/render/components/pdp-dynamic/KindGate.js +1 -1
  101. package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
  102. package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +3 -2
  103. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  104. package/dist/render/components/wheels-plp/PlpCard.d.ts +3 -2
  105. package/dist/render/components/wheels-plp/PlpCard.js +1 -1
  106. package/dist/render/components/wheels-plp/PlpToolbar.d.ts +16 -0
  107. package/dist/render/components/wheels-plp/PlpToolbar.js +1 -0
  108. package/dist/render/lib/catalog/relationships.js +1 -1
  109. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
  110. package/dist/render/lib/document/blocks/commerce/DetailRows/render.js +1 -1
  111. package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.js +1 -1
  112. package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
  113. package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
  114. package/dist/render/lib/document/blocks/commerce/RelatedProducts/render.js +1 -1
  115. package/dist/render/lib/sections/catalog-text-size.d.ts +7 -0
  116. package/dist/render/lib/sections/catalog-text-size.js +1 -0
  117. package/dist/render/lib/sections/fill-row.js +1 -1
  118. package/dist/render/lib/sections/grid-no-hole.d.ts +1 -1
  119. package/dist/render/lib/sections/grid-no-hole.js +1 -1
  120. package/dist/render/lib/sections/product-hero-text-regions.d.ts +3 -0
  121. package/dist/render/lib/sections/product-hero-text-regions.js +1 -0
  122. package/dist/render/lib/sections/section-band.d.ts +2 -0
  123. package/dist/render/lib/sections/section-band.js +1 -0
  124. package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
  125. package/dist/render/lib/wheels/lug-count.d.ts +1 -0
  126. package/dist/render/lib/wheels/lug-count.js +1 -1
  127. package/dist/words.d.ts +13 -1
  128. package/dist/words.js +5 -5
  129. package/package.json +3 -2
  130. package/dist/chunks/chunk-6MHGEO3D.js +0 -320
  131. /package/dist/chunks/{chunk-X5W6GJLI.js → chunk-5O3W5AUB.js} +0 -0
  132. /package/dist/chunks/{chunk-JUGY3EKR.js → chunk-PBQWSV3B.js} +0 -0
  133. /package/dist/chunks/{chunk-6MHGEO3D.js.LEGAL.txt → chunk-SXRBNRRO.js.LEGAL.txt} +0 -0
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r,Fragment as x}from"react/jsx-runtime";import S from"next/link";import{useEffect as D,useMemo as Y,useRef as j,useState as v}from"react";import{stripeAppearance as Q}from"../../lib/checkout/stripe-appearance.js";import{Elements as V,PaymentElement as Z,useElements as J,useStripe as X}from"@stripe/react-stripe-js";import{loadStripe as ee}from"@stripe/stripe-js";import{useCurrency as R}from"../CurrencyContext.js";import{Notice as I}from"../Notice.js";import{resolveCopyright as te}from"../../lib/content/site.js";import{ApiError as O,products as T}from"../../lib/api/index.js";import re from"efficient-web-builder/render/components/Logo";import{NOT_CHECKED as _,orderReference as ne}from"../../lib/checkout/pay-first.js";import{CheckoutStateProvider as ae,useCheckout as ie}from"./checkout-state.js";import{CheckoutContact as oe,CheckoutOrderSummary as ce,CheckoutPayment as se,CheckoutShippingAddress as le,CheckoutShippingMethod as de}from"./checkout-parts.js";function me(t){return e(ae,{...t,children:e(fe,{})})}function pe({order:t,paid:n}){const{formatMoney:p}=R();if(!t.grandTotal||!t.currency)return null;const u=i=>p(Number(i),t.currency),h=Number(t.freightCharge??0),s=Number(t.discountAmount??0);return r("dl",{className:"grid w-full max-w-sm grid-cols-[1fr_auto] gap-x-6 gap-y-1 border-y border-line py-3 text-left text-sm",children:[(t.shippingMethod||h>0)&&r(x,{children:[r("dt",{className:"text-fg-dim",children:["Delivery",t.shippingMethod?` · ${t.shippingMethod}`:""]}),e("dd",{className:"text-right font-mono",children:u(t.freightCharge??"0")})]}),s>0&&r(x,{children:[r("dt",{className:"text-fg-dim",children:["Discount",t.couponCode?` · ${t.couponCode}`:""]}),r("dd",{className:"text-right font-mono",children:["−",u(t.discountAmount??"0")]})]}),e("dt",{className:"text-fg",children:n?"Total paid":"Order total"}),e("dd",{className:"text-right font-mono text-fg",children:u(t.grandTotal)})]})}function ue({result:t}){const n=e("span",{className:"font-mono text-fg",children:t.checkoutNumber});return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:t.kind==="refunded"||t.kind==="expired"?"Order not placed":t.kind==="processing"?"Payment processing":"Payment received"}),e("p",{className:"text-fg-dim",children:t.kind==="refunded"?r(x,{children:["An item sold out or an offer ended while you paid for checkout ",n,". Your payment is refunded to your card."]}):t.kind==="expired"?r(x,{children:["The hold on checkout ",n," ran out before your payment arrived. Your payment is refunded to your card."]}):t.kind==="processing"?r(x,{children:["Your payment for checkout ",n," is being processed. When it goes through, we will email your order confirmation."]}):r(x,{children:["Thank you — your payment for checkout ",n," has gone through. We will email you the order number shortly."]})}),e(S,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]})}function fe(){const{site:t,logo:n,items:p,placing:u,email:h,me:s,addressSaveNote:i,idemKey:f,confirmation:o,setConfirmation:m,payment:d,paypalStep:k,squareStep:g,pendingConf:c,paid:y,setPaid:b,payNote:N,afterpayConfirming:E,gocardlessConfirming:l,zipConfirming:a,klarnaConfirming:w,cardConfirming:P,checkoutResult:q,confirmCardPayment:L,cardStillProcessing:z,renewCardPayment:F,holdRenewed:H,leaveCardPayment:G,checkoutRootRef:U,setCheckoutHeaderEl:W}=ie();return o?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:y?"Payment received":"Order received"}),r("p",{className:"text-fg-dim",children:[y?r(x,{children:["Thank you — your payment for order"," ",e("span",{className:"font-mono text-fg",children:o.orderNumber})," has gone through."," "]}):r(x,{children:["Thank you — your order ",e("span",{className:"font-mono text-fg",children:o.orderNumber})," is being reviewed by our team."," "]}),s?r(x,{children:["Track it under"," ",e(S,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):e(x,{children:"We’ve emailed you a link to set a password and track it."})]}),e(pe,{order:o,paid:y}),N&&e("p",{className:"text-sm text-fg-dim",children:N}),i&&e("p",{className:"text-sm text-fg-dim",children:i}),!s&&r("p",{className:"text-sm text-fg-dim",children:["You can also"," ",e(S,{href:`/track?order=${encodeURIComponent(o.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email — no password needed."]}),e(S,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):q?e(ue,{result:q}):P?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Placing your order — one moment."})]}):E?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay — one moment."})]}):l?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Setting up your direct debit…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless — one moment."})]}):a?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip — one moment."})]}):w?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna — one moment."})]}):d&&c?e(xe,{payment:d,checkout:c,holdRenewed:H,onPaid:L,onProcessing:z,onRenew:F,onBack:G}):k&&c?e(be,{confirmation:c,clientId:t.paypalClientId??"",idemKey:f,onPaid:()=>{b(!0),m(c)},onSkip:()=>m(c)}):g&&c?e(ke,{confirmation:c,applicationId:t.squareApplicationId??"",locationId:t.squareLocationId??"",environment:t.squareEnvironment??"production",idemKey:f,onPaid:()=>{b(!0),m(c)},onSkip:()=>m(c)}):r("div",{ref:U,className:"bg-bg text-fg",children:[r("header",{ref:W,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[r(S,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["←",e("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),e(S,{href:"/","aria-label":`${t.name} home`,className:"inline-flex items-center justify-center",children:e(re,{variant:"header",scrolled:!0,src:n?.url??null,reverse:n?.reverse??!1,reversedSrc:n?.reversed??null,inkIsDark:n?.inkIsDark??null,size:n?.size??"medium",sizePx:n?.sizePx??null,siteName:t.name})}),t.cardPayments?r("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[e("span",{className:"text-green",children:"●"}),e("span",{className:"max-[640px]:hidden",children:"Encrypted ·"})," Stripe"]}):e("span",{})]}),r("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[e("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),e("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(C=>r("span",{className:["relative flex items-center gap-2 transition-colors",C.state==="pending"?"text-fg-dim":"text-fg",C.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[e("span",{className:C.state==="done"?"text-accent font-bold":"",children:C.n}),e("span",{children:C.label})]},C.n))})]}),r("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-8 max-[1100px]:pb-20",children:[r("div",{children:[e(oe,{}),e(le,{}),e(de,{}),e(se,{})]}),e(ce,{})]}),e("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:e("span",{children:te({legalName:t.legalName,foundedYear:t.foundedYear,siteName:t.name})})})]})}function xe({payment:t,checkout:n,holdRenewed:p,onPaid:u,onProcessing:h,onRenew:s,onBack:i}){const{formatMoney:f}=R(),o=e("span",{className:"text-fg",children:f(Number(t.amount),t.currency)}),m=Y(()=>ee(t.publishableKey),[t.publishableKey]),d=Y(()=>Q(),[]);return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:ne(n)}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:n.orderNumber?r(x,{children:["Your order is placed. Pay ",o," by card to confirm it now."]}):p?r(x,{children:["Your hold ran out, so your items are held again",n.expiresAt?` until ${B(n.expiresAt)}`:"",". Enter your card again, then pay ",o,"."]}):r(x,{children:["Your items are held",n.expiresAt?` until ${B(n.expiresAt)}`:"",". Pay ",o," by card to place your order."]})}),e(V,{stripe:m,options:{clientSecret:t.clientSecret,appearance:d},children:e(he,{payment:t,checkout:n,onPaid:u,onProcessing:h,onRenew:s,onBack:i})},t.clientSecret)]})]})})}function B(t){return new Date(t).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}const ge=5;function he({payment:t,checkout:n,onPaid:p,onProcessing:u,onRenew:h,onBack:s}){const{formatMoney:i}=R(),f=X(),o=J(),[m,d]=v(!1),[k,g]=v(null),c=j(!1);async function y(){try{return(await f.retrievePaymentIntent(t.clientSecret)).paymentIntent?.status}catch{return}}async function b(l){let a=l;for(let w=0;a==="processing"&&w<ge;w+=1)await new Promise(P=>setTimeout(P,1e3)),a=await y()??a;if(a==="succeeded"){p();return}if(a==="processing"){u();return}g("Payment did not complete. Please try again."),d(!1)}async function N(){if(!f||!o||m)return;d(!0),g(null),c.current=!0;const l=await f.confirmPayment({elements:o,redirect:"if_required"}).catch(()=>null);if(!l){const a=await y();if(a==="succeeded"||a==="processing"){await b(a);return}g(a===void 0?_:"Payment failed. Please try again."),d(!1);return}if(l.error){if(!n.orderNumber&&l.error.code==="payment_intent_unexpected_state"){const a=await y();if(a==="succeeded"||a==="processing"){await b(a);return}if(a===void 0){g(_),d(!1);return}await h(a==="canceled"),d(!1);return}g(l.error.message??"Payment failed. Please try again."),d(!1);return}await b(l.paymentIntent?.status)}async function E(){if(m)return;if(!c.current){s();return}d(!0),g(null);const l=await y();if(l==="succeeded"||l==="processing"){await b(l);return}if(d(!1),l===void 0){g(_);return}s()}return r("div",{className:"flex flex-col gap-4",children:[e(Z,{}),k&&e(I,{role:"alert",children:k}),e("button",{type:"button",onClick:N,disabled:!f||!o||m,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!f||!o||m?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:m?r(x,{children:["Processing… ",e("span",{children:"·"})]}):r(x,{children:["Pay ",i(Number(t.amount),t.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),!n.orderNumber&&!m&&r("button",{type:"button",onClick:E,className:"inline-flex items-center gap-3 self-start font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["←",e("span",{children:"Back to checkout"})]})]})}const M="paypal-sdk-js";let A=null;function ye(t,n){const p=`${t}|${n}`;if(A?.key===p)return A.promise;const u=new Promise((h,s)=>{document.getElementById(M)?.remove();const i=document.createElement("script");i.id=M;const f=new URLSearchParams({"client-id":t,currency:n,intent:"capture"});i.src=`https://www.paypal.com/sdk/js?${f}`,i.onload=()=>{const o=window.paypal;o?h(o):s(new Error("PayPal SDK loaded without its namespace"))},i.onerror=()=>s(new Error("PayPal SDK failed to load")),document.head.appendChild(i)});return A={key:p,promise:u},u}function be({confirmation:t,clientId:n,idemKey:p,onPaid:u,onSkip:h}){const{formatMoney:s}=R(),i=j(null),[f,o]=v(!1),[m,d]=v(null),k=j(u);return k.current=u,D(()=>{let g=!1,c=null;return ye(n,t.currency).then(y=>{if(!(g||!i.current))return c=y.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await T.createPaypalOrder({idempotencyKey:p})).paypalOrderId,onApprove:async b=>{try{if((await T.capturePaypalOrder({idempotencyKey:p,paypalOrderId:b.orderID})).status==="paid"){k.current();return}d("PayPal did not complete the payment. Please try again.")}catch(N){d(N instanceof O?N.message:"PayPal payment failed. Please try again.")}},onError:()=>{d("PayPal could not process the payment. Please try again.")}}),c.render(i.current).then(()=>{g||o(!0)})}).catch(()=>{g||d("PayPal could not be loaded. You can pay later — your order stands either way.")}),()=>{g=!0,c?.close?.()}},[n,t.currency,p]),e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:s(Number(t.grandTotal),t.currency)})," ","with PayPal to confirm it now."]}),!f&&!m&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal…"}),e("div",{ref:i}),m&&e(I,{role:"alert",children:m}),e("button",{type:"button",onClick:h,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}const $="square-web-sdk";let K=null;function Ne(t){const n=t==="sandbox"?"sandbox":"production";if(K?.key===n)return K.promise;const p=new Promise((u,h)=>{document.getElementById($)?.remove();const s=document.createElement("script");s.id=$,s.src=n==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",s.onload=()=>{const i=window.Square;i?u(i):h(new Error("Square SDK loaded without its namespace"))},s.onerror=()=>h(new Error("Square SDK failed to load")),document.head.appendChild(s)});return K={key:n,promise:p},p}function ke({confirmation:t,applicationId:n,locationId:p,environment:u,idemKey:h,onPaid:s,onSkip:i}){const{formatMoney:f}=R(),o=j(null),m=j(null),d=j(null),[k,g]=v(!1),[c,y]=v(!1),[b,N]=v(null);D(()=>{let l=!1,a=null;return Ne(u).then(async w=>{if(l||!o.current)return;const P=w.payments(n,p);d.current=P,a=await P.card(),await a.attach(o.current),m.current=a,l||g(!0)}).catch(()=>{l||N("Square could not be loaded. You can pay later — your order stands either way.")}),()=>{l=!0,a?.destroy?.()}},[n,p,u]);async function E(){const l=m.current;if(!(!l||c)){y(!0),N(null);try{const a=await l.tokenize();if(a.status!=="OK"||!a.token){N(a.errors?.[0]?.message??"Please check the card details and try again."),y(!1);return}let w;try{w=(await d.current?.verifyBuyer?.(a.token,{amount:String(t.grandTotal),currencyCode:t.currency,intent:"CHARGE"}))?.token}catch{}if((await T.chargeSquare({idempotencyKey:h,sourceId:a.token,...w?{verificationToken:w}:{}})).status==="paid"){s();return}N("Square did not complete the payment. Please try again.")}catch(a){N(a instanceof O?a.message:"Square payment failed. Please try again.")}y(!1)}}return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:f(Number(t.grandTotal),t.currency)})," ","by card to confirm it now."]}),!k&&!b&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form…"}),e("div",{ref:o}),b&&e(I,{role:"alert",children:b}),e("button",{type:"button",onClick:E,disabled:!k||c,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!k||c?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:c?r(x,{children:["Processing… ",e("span",{children:"·"})]}):r(x,{children:["Pay ",f(Number(t.grandTotal),t.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:i,disabled:c,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}export{ue as PayFirstResultView,me as default};
1
+ "use client";import{jsx as e,jsxs as r,Fragment as x}from"react/jsx-runtime";import S from"next/link";import{useEffect as D,useMemo as Y,useRef as j,useState as v}from"react";import{stripeAppearance as Q}from"../../lib/checkout/stripe-appearance.js";import{Elements as V,PaymentElement as Z,useElements as J,useStripe as X}from"@stripe/react-stripe-js";import{loadStripe as ee}from"@stripe/stripe-js";import{useCurrency as R}from"../CurrencyContext.js";import{Notice as I}from"../Notice.js";import{resolveCopyright as te}from"../../lib/content/site.js";import{ApiError as O,products as T}from"../../lib/api/index.js";import re from"efficient-web-builder/render/components/Logo";import{NOT_CHECKED as _,orderReference as ne}from"../../lib/checkout/pay-first.js";import{CheckoutStateProvider as ae,useCheckout as ie}from"./checkout-state.js";import{CheckoutContact as oe,CheckoutOrderSummary as se,CheckoutPayment as ce,CheckoutShippingAddress as le,CheckoutShippingMethod as de}from"./checkout-parts.js";function me(t){return e(ae,{...t,children:e(fe,{})})}function pe({order:t,paid:n}){const{formatMoney:p}=R();if(!t.grandTotal||!t.currency)return null;const u=i=>p(Number(i),t.currency),h=Number(t.freightCharge??0),c=Number(t.discountAmount??0);return r("dl",{className:"grid w-full max-w-sm grid-cols-[1fr_auto] gap-x-6 gap-y-1 border-y border-line py-3 text-left text-sm",children:[(t.shippingMethod||h>0)&&r(x,{children:[r("dt",{className:"text-fg-dim",children:["Delivery",t.shippingMethod?` · ${t.shippingMethod}`:""]}),e("dd",{className:"text-right font-mono",children:u(t.freightCharge??"0")})]}),c>0&&r(x,{children:[r("dt",{className:"text-fg-dim",children:["Discount",t.couponCode?` · ${t.couponCode}`:""]}),r("dd",{className:"text-right font-mono",children:["−",u(t.discountAmount??"0")]})]}),e("dt",{className:"text-fg",children:n?"Total paid":"Order total"}),e("dd",{className:"text-right font-mono text-fg",children:u(t.grandTotal)})]})}function ue({result:t}){const n=e("span",{className:"font-mono text-fg",children:t.checkoutNumber});return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:t.kind==="refunded"||t.kind==="expired"?"Order not placed":t.kind==="processing"?"Payment processing":"Payment received"}),e("p",{className:"text-fg-dim",children:t.kind==="refunded"?r(x,{children:["An item sold out or an offer ended while you paid for checkout ",n,". Your payment is refunded to your card."]}):t.kind==="expired"?r(x,{children:["The hold on checkout ",n," ran out before your payment arrived. Your payment is refunded to your card."]}):t.kind==="processing"?r(x,{children:["Your payment for checkout ",n," is being processed. When it goes through, we will email your order confirmation."]}):r(x,{children:["Thank you — your payment for checkout ",n," has gone through. We will email you the order number shortly."]})}),e(S,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]})}function fe(){const{site:t,logo:n,items:p,placing:u,email:h,me:c,addressSaveNote:i,idemKey:f,confirmation:o,setConfirmation:m,payment:d,paypalStep:k,squareStep:g,pendingConf:s,paid:y,setPaid:b,payNote:N,afterpayConfirming:E,gocardlessConfirming:l,zipConfirming:a,klarnaConfirming:w,cardConfirming:P,checkoutResult:q,confirmCardPayment:L,cardStillProcessing:z,renewCardPayment:F,holdRenewed:H,leaveCardPayment:G,checkoutRootRef:U,setCheckoutHeaderEl:W}=ie();return o?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:y?"Payment received":"Order received"}),r("p",{className:"text-fg-dim",children:[y?r(x,{children:["Thank you — your payment for order"," ",e("span",{className:"font-mono text-fg",children:o.orderNumber})," has gone through."," "]}):r(x,{children:["Thank you — your order ",e("span",{className:"font-mono text-fg",children:o.orderNumber})," is being reviewed by our team."," "]}),c?r(x,{children:["Track it under"," ",e(S,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):e(x,{children:"We’ve emailed you a link to set a password and track it."})]}),e(pe,{order:o,paid:y}),N&&e("p",{className:"text-sm text-fg-dim",children:N}),i&&e("p",{className:"text-sm text-fg-dim",children:i}),!c&&r("p",{className:"text-sm text-fg-dim",children:["You can also"," ",e(S,{href:`/track?order=${encodeURIComponent(o.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email — no password needed."]}),e(S,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):q?e(ue,{result:q}):P?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Placing your order — one moment."})]}):E?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay — one moment."})]}):l?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Setting up your direct debit…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless — one moment."})]}):a?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip — one moment."})]}):w?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna — one moment."})]}):d&&s?e(xe,{payment:d,checkout:s,holdRenewed:H,onPaid:L,onProcessing:z,onRenew:F,onBack:G}):k&&s?e(be,{confirmation:s,clientId:t.paypalClientId??"",idemKey:f,onPaid:()=>{b(!0),m(s)},onSkip:()=>m(s)}):g&&s?e(ke,{confirmation:s,applicationId:t.squareApplicationId??"",locationId:t.squareLocationId??"",environment:t.squareEnvironment??"production",idemKey:f,onPaid:()=>{b(!0),m(s)},onSkip:()=>m(s)}):r("div",{ref:U,className:"bg-bg text-fg",children:[r("header",{ref:W,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[r(S,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["←",e("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),e(S,{href:"/","aria-label":`${t.name} home`,className:"inline-flex items-center justify-center",children:e(re,{variant:"header",scrolled:!0,src:n?.url??null,reverse:n?.reverse??!1,reversedSrc:n?.reversed??null,inkIsDark:n?.inkIsDark??null,size:n?.size??"medium",sizePx:n?.sizePx??null,siteName:t.name})}),t.cardPayments?r("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[e("span",{className:"text-green",children:"●"}),e("span",{className:"max-[640px]:hidden",children:"Encrypted ·"})," Stripe"]}):e("span",{})]}),r("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",children:[e("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),e("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(C=>r("span",{className:["relative flex items-center gap-2 transition-colors",C.state==="pending"?"text-fg-dim":"text-fg",C.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[e("span",{className:C.state==="done"?"text-accent font-bold":"",children:C.n}),e("span",{children:C.label})]},C.n))})]}),r("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-view-desktop:grid-cols-1 max-view-desktop:gap-10 max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))] max-view-desktop:pt-8 max-view-desktop:pb-20",children:[r("div",{children:[e(oe,{}),e(le,{}),e(de,{}),e(ce,{})]}),e(se,{})]}),e("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:e("span",{children:te({legalName:t.legalName,foundedYear:t.foundedYear,siteName:t.name})})})]})}function xe({payment:t,checkout:n,holdRenewed:p,onPaid:u,onProcessing:h,onRenew:c,onBack:i}){const{formatMoney:f}=R(),o=e("span",{className:"text-fg",children:f(Number(t.amount),t.currency)}),m=Y(()=>ee(t.publishableKey),[t.publishableKey]),d=Y(()=>Q(),[]);return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:ne(n)}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:n.orderNumber?r(x,{children:["Your order is placed. Pay ",o," by card to confirm it now."]}):p?r(x,{children:["Your hold ran out, so your items are held again",n.expiresAt?` until ${B(n.expiresAt)}`:"",". Enter your card again, then pay ",o,"."]}):r(x,{children:["Your items are held",n.expiresAt?` until ${B(n.expiresAt)}`:"",". Pay ",o," by card to place your order."]})}),e(V,{stripe:m,options:{clientSecret:t.clientSecret,appearance:d},children:e(he,{payment:t,checkout:n,onPaid:u,onProcessing:h,onRenew:c,onBack:i})},t.clientSecret)]})]})})}function B(t){return new Date(t).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}const ge=5;function he({payment:t,checkout:n,onPaid:p,onProcessing:u,onRenew:h,onBack:c}){const{formatMoney:i}=R(),f=X(),o=J(),[m,d]=v(!1),[k,g]=v(null),s=j(!1);async function y(){try{return(await f.retrievePaymentIntent(t.clientSecret)).paymentIntent?.status}catch{return}}async function b(l){let a=l;for(let w=0;a==="processing"&&w<ge;w+=1)await new Promise(P=>setTimeout(P,1e3)),a=await y()??a;if(a==="succeeded"){p();return}if(a==="processing"){u();return}g("Payment did not complete. Please try again."),d(!1)}async function N(){if(!f||!o||m)return;d(!0),g(null),s.current=!0;const l=await f.confirmPayment({elements:o,redirect:"if_required"}).catch(()=>null);if(!l){const a=await y();if(a==="succeeded"||a==="processing"){await b(a);return}g(a===void 0?_:"Payment failed. Please try again."),d(!1);return}if(l.error){if(!n.orderNumber&&l.error.code==="payment_intent_unexpected_state"){const a=await y();if(a==="succeeded"||a==="processing"){await b(a);return}if(a===void 0){g(_),d(!1);return}await h(a==="canceled"),d(!1);return}g(l.error.message??"Payment failed. Please try again."),d(!1);return}await b(l.paymentIntent?.status)}async function E(){if(m)return;if(!s.current){c();return}d(!0),g(null);const l=await y();if(l==="succeeded"||l==="processing"){await b(l);return}if(d(!1),l===void 0){g(_);return}c()}return r("div",{className:"flex flex-col gap-4",children:[e(Z,{}),k&&e(I,{role:"alert",children:k}),e("button",{type:"button",onClick:N,disabled:!f||!o||m,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!f||!o||m?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:m?r(x,{children:["Processing… ",e("span",{children:"·"})]}):r(x,{children:["Pay ",i(Number(t.amount),t.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),!n.orderNumber&&!m&&r("button",{type:"button",onClick:E,className:"inline-flex items-center gap-3 self-start font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["←",e("span",{children:"Back to checkout"})]})]})}const M="paypal-sdk-js";let A=null;function ye(t,n){const p=`${t}|${n}`;if(A?.key===p)return A.promise;const u=new Promise((h,c)=>{document.getElementById(M)?.remove();const i=document.createElement("script");i.id=M;const f=new URLSearchParams({"client-id":t,currency:n,intent:"capture"});i.src=`https://www.paypal.com/sdk/js?${f}`,i.onload=()=>{const o=window.paypal;o?h(o):c(new Error("PayPal SDK loaded without its namespace"))},i.onerror=()=>c(new Error("PayPal SDK failed to load")),document.head.appendChild(i)});return A={key:p,promise:u},u}function be({confirmation:t,clientId:n,idemKey:p,onPaid:u,onSkip:h}){const{formatMoney:c}=R(),i=j(null),[f,o]=v(!1),[m,d]=v(null),k=j(u);return k.current=u,D(()=>{let g=!1,s=null;return ye(n,t.currency).then(y=>{if(!(g||!i.current))return s=y.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await T.createPaypalOrder({idempotencyKey:p})).paypalOrderId,onApprove:async b=>{try{if((await T.capturePaypalOrder({idempotencyKey:p,paypalOrderId:b.orderID})).status==="paid"){k.current();return}d("PayPal did not complete the payment. Please try again.")}catch(N){d(N instanceof O?N.message:"PayPal payment failed. Please try again.")}},onError:()=>{d("PayPal could not process the payment. Please try again.")}}),s.render(i.current).then(()=>{g||o(!0)})}).catch(()=>{g||d("PayPal could not be loaded. You can pay later — your order stands either way.")}),()=>{g=!0,s?.close?.()}},[n,t.currency,p]),e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:c(Number(t.grandTotal),t.currency)})," ","with PayPal to confirm it now."]}),!f&&!m&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal…"}),e("div",{ref:i}),m&&e(I,{role:"alert",children:m}),e("button",{type:"button",onClick:h,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}const $="square-web-sdk";let K=null;function Ne(t){const n=t==="sandbox"?"sandbox":"production";if(K?.key===n)return K.promise;const p=new Promise((u,h)=>{document.getElementById($)?.remove();const c=document.createElement("script");c.id=$,c.src=n==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",c.onload=()=>{const i=window.Square;i?u(i):h(new Error("Square SDK loaded without its namespace"))},c.onerror=()=>h(new Error("Square SDK failed to load")),document.head.appendChild(c)});return K={key:n,promise:p},p}function ke({confirmation:t,applicationId:n,locationId:p,environment:u,idemKey:h,onPaid:c,onSkip:i}){const{formatMoney:f}=R(),o=j(null),m=j(null),d=j(null),[k,g]=v(!1),[s,y]=v(!1),[b,N]=v(null);D(()=>{let l=!1,a=null;return Ne(u).then(async w=>{if(l||!o.current)return;const P=w.payments(n,p);d.current=P,a=await P.card(),await a.attach(o.current),m.current=a,l||g(!0)}).catch(()=>{l||N("Square could not be loaded. You can pay later — your order stands either way.")}),()=>{l=!0,a?.destroy?.()}},[n,p,u]);async function E(){const l=m.current;if(!(!l||s)){y(!0),N(null);try{const a=await l.tokenize();if(a.status!=="OK"||!a.token){N(a.errors?.[0]?.message??"Please check the card details and try again."),y(!1);return}let w;try{w=(await d.current?.verifyBuyer?.(a.token,{amount:String(t.grandTotal),currencyCode:t.currency,intent:"CHARGE"}))?.token}catch{}if((await T.chargeSquare({idempotencyKey:h,sourceId:a.token,...w?{verificationToken:w}:{}})).status==="paid"){c();return}N("Square did not complete the payment. Please try again.")}catch(a){N(a instanceof O?a.message:"Square payment failed. Please try again.")}y(!1)}}return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:f(Number(t.grandTotal),t.currency)})," ","by card to confirm it now."]}),!k&&!b&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form…"}),e("div",{ref:o}),b&&e(I,{role:"alert",children:b}),e("button",{type:"button",onClick:E,disabled:!k||s,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!k||s?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:s?r(x,{children:["Processing… ",e("span",{children:"·"})]}):r(x,{children:["Pay ",f(Number(t.grandTotal),t.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:i,disabled:s,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}export{ue as PayFirstResultView,me as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as N,jsxs as a}from"react/jsx-runtime";import{useId as E}from"react";import W from"next/image";import T from"next/link";import{lineTotal as K,useCart as X}from"../CartContext.js";import{useCurrency as Z}from"../CurrencyContext.js";import{Notice as R}from"../Notice.js";import{FREE_PRICE as F}from"../../lib/wheels/price-display.js";import J from"../CouponField.js";import{COUPON_DEFERRED_TOTAL as Q}from"../../lib/cart/coupon-preview.js";import{orderReference as V}from"../../lib/checkout/pay-first.js";import{shippingWords as ee,TAX_PENDING as te}from"../../lib/cart/shipping-status.js";import{DEFAULT_FINISH_COLOR as ne}from"../../lib/wheels/finish-defaults.js";import $ from"../ThemedSelect.js";import f from"../WebFormField.js";import ae from"../WheelSvg.js";import{NO_PAYMENT_METHOD_NOTE as re,SHIPPING_RETRY_NOTE as ie,useCheckout as k}from"./checkout-state.js";import{FIELD_INPUT_CLASS as g}from"../../lib/field-input.js";function Ee(){const{email:t,setEmail:i,firstName:n,setFirstName:l,lastName:c,setLastName:u,me:o,checkoutSignOut:y}=k(),x=E();return a(w,{num:"N° 01",title:"Contact",children:[e(f,{label:"Email",htmlFor:x,hint:o?a(N,{children:["Signed in ·"," ",e("button",{type:"button",onClick:y,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:e("input",{id:x,type:"email",value:t,onChange:d=>i(d.target.value),placeholder:"you@example.com",readOnly:o!==null,className:g+(o?" opacity-70":"")})}),a(M,{children:[e(f,{label:"First name",children:e("input",{type:"text",value:n,onChange:d=>l(d.target.value),className:g})}),e(f,{label:"Last name",children:e("input",{type:"text",value:c,onChange:d=>u(d.target.value),className:g})})]})]})}function Fe(){const{pickupLocation:t,servedCountries:i,address1:n,setAddress1:l,address2:c,setAddress2:u,city:o,setCity:y,postcode:x,setPostcode:d,phone:b,setPhone:s,country:p,setCountry:m,subdivision:C,setSubdivision:h,subdivisions:A,destination:ce,postcodeLabel:U,subdivisionLabel:z,me:I,savedAddresses:L,selectedAddressId:_,setSelectedAddressId:P,saveAddress:O,setSaveAddress:D,saveLabel:H,setSaveLabel:q,fillFromAddress:G}=k(),B=E(),j=E();return a(w,{num:"N° 02",title:t?"Collection":"Shipping address",children:[t?a("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[e("span",{className:"font-medium",children:t.name}),[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).length>0&&e("span",{className:"opacity-80",children:[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).join(", ")}),t.openingHours&&e("span",{className:"opacity-80",children:t.openingHours}),t.instructions&&e("span",{className:"opacity-80",children:t.instructions}),e("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):a(N,{children:[I!==null&&L.length>0&&a("div",{className:"grid gap-3",children:[L.map(r=>e(S,{active:_===r.id,onClick:()=>{P(r.id),G(r)},title:r.label,body:r.formatted_address,price:null},r.id)),e(S,{active:_==="new",onClick:()=>P("new"),title:"New address",body:null,price:null})]}),e(f,{label:"Address line 1",children:e("input",{type:"text",value:n,onChange:r=>l(r.target.value),className:g})}),e(f,{label:"Address line 2",children:e("input",{type:"text",value:c,onChange:r=>u(r.target.value),placeholder:"Apartment, unit, garage bay…",className:g})}),a(M,{cols:"three",children:[e(f,{label:"City",children:e("input",{type:"text",value:o,onChange:r=>y(r.target.value),className:g})}),e(f,{label:U,children:e("input",{type:"text",value:x,onChange:r=>d(r.target.value),className:g})}),e(f,{label:"Country",separate:!0,htmlFor:B,children:e($,{id:B,value:p,onChange:r=>m(r.target.value),className:g+" pr-10",style:Y,children:i.map(r=>e("option",{value:r.code,children:r.name},r.code))})})]}),e(f,{label:z,separate:!0,htmlFor:j,children:A.length>0?a($,{id:j,value:C,onChange:r=>h(r.target.value),className:g+" pr-10",style:Y,children:[e("option",{value:"",children:"Select…"}),A.map(r=>e("option",{value:r.code||r.name,children:r.name},r.code||r.name))]}):e("input",{id:j,type:"text",value:C,onChange:r=>h(r.target.value),className:g})})]}),e(f,{label:"Phone",children:e("input",{type:"tel",value:b,onChange:r=>s(r.target.value),className:g})}),!t&&I!==null&&_==="new"&&a(N,{children:[e(le,{checked:O,onChange:D,label:"Save this address to my account"}),O&&e(f,{label:"Address label",children:e("input",{type:"text",value:H,onChange:r=>q(r.target.value),placeholder:"Home",className:g})})]})]})}function Ae(){const{totals:t,coupon:i,deliveryOptions:n,shippingMethodId:l,setShippingMethodId:c,pickupLocation:u,formatMoney:o,city:y,destination:x,courierUnavailable:d,retryCourier:b}=k();return e(w,{num:"N° 03",title:"Shipping",children:a("div",{className:"grid gap-3",children:[n.map(s=>{const p=s.pickupLocation,m=p?[p.address,p.city,p.state,p.zipCode].filter(Boolean).join(", "):null;return e(S,{active:l===s.id,onClick:()=>c(s.id),title:p?`${s.name} — ${p.name}`:s.name,body:p?[m,p.openingHours,p.instructions,s.description].filter(Boolean).join(" · "):s.description||null,price:t.freeShipping||s.amount===0?F:o(s.amount,t.currency),tag:s.tag||void 0},s.id)}),d?a("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:[ie," ",e("button",{type:"button",onClick:b,className:"underline transition-colors hover:text-accent",children:"Try again"})]}):n.length===0&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})})}function Ie(){const{payChoice:t,setPayChoice:i,placing:n,payment:l,payOptions:c,noPaymentMethod:u}=k();return a(w,{num:"N° 04",title:"Payment",children:[u&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:re}),e("div",{className:"grid gap-3",children:c.map(o=>e(S,{active:t===o.key,onClick:()=>i(o.key),title:o.title,body:o.body,price:o.price,tag:o.tag},o.key))}),t==="card"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="paypal"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll approve the payment with PayPal on the payment step after placing the order."}):t==="afterpay"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):t==="square"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="gocardless"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):t==="zip"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Zip to approve four instalments, then brought straight back."}):t==="klarna"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Klarna to choose how to pay, then brought straight back."}):t==="bank"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."}):null]})}function Le(){const{site:t,items:i,totals:n,coupon:l,formatMoney:c,payChoice:u,placing:o,email:y,orderError:x,payment:d,noPaymentMethod:b,unpaidOrder:s,placeOrder:p}=k();return a("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-[1100px]:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[a("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[e("span",{children:"Your order"}),e(T,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit ↗"})]}),e("div",{className:"flex flex-col px-6 py-2",children:i.length===0?a("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",e(T,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog →"})]}):i.map(m=>e(oe,{slug:m.slug,name:m.name,qty:m.qty,config:m.config,configSummary:se(m.config),price:K(m,n.currency)??0,currency:n.currency},m.id))}),e("div",{className:"border-t border-line px-6 pt-5",children:e(J,{customerEmail:y})}),a("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[e(v,{label:"Subtotal",value:c(n.subtotal,n.currency)}),n.discount>0&&l?.valid&&e(v,{label:`Coupon · ${l.code}`,value:a("span",{className:"font-semibold text-green",children:["− ",c(n.discount,n.currency)]})}),l?.deferred&&e(v,{label:`Coupon · ${l.code}`,value:Q}),l?.valid&&l.effects?.gift&&e(v,{label:`Free gift · ${l.effects.gift.partNumber}${l.effects.gift.quantity>1?` ×${l.effects.gift.quantity}`:""}`,value:e("span",{className:"font-semibold text-green",children:F})}),e(v,{label:"Shipping",value:n.shippingStatus==="free"?e("span",{className:"font-semibold text-green",children:F}):ee(n.shippingStatus)??c(n.shipping,n.currency)}),n.tax&&(n.tax.charged?e(v,{label:n.tax.inclusive?`${n.tax.name} included · ${n.tax.rate}%`:n.tax.name,value:c(n.tax.amount,n.currency)}):n.tax.name?e(v,{label:n.tax.name,value:te}):null)]}),a("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[e("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),e("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:n.repricing?"…":c(n.grand,n.currency)})]}),a("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[x&&e(R,{role:"alert",children:x}),n.hasUnpricedLine&&a(R,{role:"status",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),e("button",{type:"button",onClick:p,disabled:o||!s&&(b||i.length===0||n.hasUnpricedLine||n.repricing),className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",o||!s&&(i.length===0||b||n.hasUnpricedLine||n.repricing)?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:o?a(N,{children:["Building order… ",e("span",{children:"·"})]}):b?a(N,{children:["No online payment ",e("span",{children:"·"})]}):s?a(N,{children:["Try payment again · ",V(s),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}):n.repricing?a(N,{children:["Updating total… ",e("span",{children:"·"})]}):a(N,{children:[u==="bank"?"Place order":"Continue to payment"," ·"," ",c(n.grand,n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})})]})]})}const Y={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function w({num:t,title:i,children:n}){return a("section",{className:"mb-6 border border-line bg-bg",children:[a("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t}),e("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:i})]}),e("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function M({cols:t="two",children:i}){return e("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:i})}function S({active:t,onClick:i,title:n,body:l,price:c,tag:u}){return a("button",{type:"button",onClick:i,"aria-pressed":t,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",t?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&e("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&e("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),a("span",{className:"flex min-w-0 flex-col gap-1",children:[a("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,u&&e("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:u})]}),l&&e("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:l})]}),e("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:c})]})}function le({checked:t,onChange:i,label:n,sub:l}){return a("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[e("button",{type:"button",onClick:()=>i(!t),"aria-pressed":t,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",t?"border-accent":"border-line"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:t&&e("span",{className:"text-[13px] text-accent",children:"✓"})}),a("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,l&&e("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:l})]})]})}function oe({slug:t,name:i,qty:n,config:l,configSummary:c,price:u,currency:o}){const{catalog:y}=X(),{formatMoney:x}=Z(),d=y.find(h=>h.slug===t),b=d?.spokes??5,s=d?.mesh??!1,p=l.find(h=>h.gold)?.label,m=d?.finishes.find(h=>h.name===p&&h.src)??d?.finishes.find(h=>h.src),C=d?.finishes[0]?.color??ne;return a("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[a("div",{className:"relative aspect-square",children:[e("div",{className:"flex h-full w-full items-center justify-center overflow-hidden border border-line bg-surface",children:m?.src?e(W,{src:m.src,alt:`${i.lead}${i.accent} — ${m.name}`,width:120,height:120,sizes:"60px",className:"block h-full w-full object-contain p-2"}):e("div",{className:"block w-[78%]",style:{color:C},children:e(ae,{spokes:b,mesh:s,className:"block w-full"})})}),e("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:n})]}),a("div",{className:"flex min-w-0 flex-col gap-0.5",children:[a("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[i.lead,e("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:i.accent})]}),e("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:c})]}),e("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:x(u,o)})]})}function v({label:t,value:i}){return a("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[e("span",{children:t}),e("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:i})]})}function se(t){return t.map(i=>i.label).join(" · ")}export{Ee as CheckoutContact,Le as CheckoutOrderSummary,Ie as CheckoutPayment,Fe as CheckoutShippingAddress,Ae as CheckoutShippingMethod};
1
+ "use client";import{jsx as e,Fragment as N,jsxs as a}from"react/jsx-runtime";import{useId as E}from"react";import W from"next/image";import T from"next/link";import{lineTotal as K,useCart as X}from"../CartContext.js";import{useCurrency as Z}from"../CurrencyContext.js";import{Notice as R}from"../Notice.js";import{FREE_PRICE as F}from"../../lib/wheels/price-display.js";import J from"../CouponField.js";import{COUPON_DEFERRED_TOTAL as Q}from"../../lib/cart/coupon-preview.js";import{orderReference as V}from"../../lib/checkout/pay-first.js";import{shippingWords as ee,TAX_PENDING as te}from"../../lib/cart/shipping-status.js";import{DEFAULT_FINISH_COLOR as ne}from"../../lib/wheels/finish-defaults.js";import $ from"../ThemedSelect.js";import f from"../WebFormField.js";import ae from"../WheelSvg.js";import{NO_PAYMENT_METHOD_NOTE as re,SHIPPING_RETRY_NOTE as ie,useCheckout as k}from"./checkout-state.js";import{FIELD_INPUT_CLASS as g}from"../../lib/field-input.js";function Ee(){const{email:t,setEmail:i,firstName:n,setFirstName:l,lastName:c,setLastName:u,me:o,checkoutSignOut:y}=k(),x=E();return a(w,{num:"N° 01",title:"Contact",children:[e(f,{label:"Email",htmlFor:x,hint:o?a(N,{children:["Signed in ·"," ",e("button",{type:"button",onClick:y,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:e("input",{id:x,type:"email",value:t,onChange:d=>i(d.target.value),placeholder:"you@example.com",readOnly:o!==null,className:g+(o?" opacity-70":"")})}),a(M,{children:[e(f,{label:"First name",children:e("input",{type:"text",value:n,onChange:d=>l(d.target.value),className:g})}),e(f,{label:"Last name",children:e("input",{type:"text",value:c,onChange:d=>u(d.target.value),className:g})})]})]})}function Fe(){const{pickupLocation:t,servedCountries:i,address1:n,setAddress1:l,address2:c,setAddress2:u,city:o,setCity:y,postcode:x,setPostcode:d,phone:b,setPhone:s,country:p,setCountry:m,subdivision:C,setSubdivision:h,subdivisions:A,destination:ce,postcodeLabel:U,subdivisionLabel:z,me:I,savedAddresses:L,selectedAddressId:_,setSelectedAddressId:P,saveAddress:O,setSaveAddress:D,saveLabel:H,setSaveLabel:q,fillFromAddress:G}=k(),B=E(),j=E();return a(w,{num:"N° 02",title:t?"Collection":"Shipping address",children:[t?a("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[e("span",{className:"font-medium",children:t.name}),[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).length>0&&e("span",{className:"opacity-80",children:[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).join(", ")}),t.openingHours&&e("span",{className:"opacity-80",children:t.openingHours}),t.instructions&&e("span",{className:"opacity-80",children:t.instructions}),e("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):a(N,{children:[I!==null&&L.length>0&&a("div",{className:"grid gap-3",children:[L.map(r=>e(S,{active:_===r.id,onClick:()=>{P(r.id),G(r)},title:r.label,body:r.formatted_address,price:null},r.id)),e(S,{active:_==="new",onClick:()=>P("new"),title:"New address",body:null,price:null})]}),e(f,{label:"Address line 1",children:e("input",{type:"text",value:n,onChange:r=>l(r.target.value),className:g})}),e(f,{label:"Address line 2",children:e("input",{type:"text",value:c,onChange:r=>u(r.target.value),placeholder:"Apartment, unit, garage bay…",className:g})}),a(M,{cols:"three",children:[e(f,{label:"City",children:e("input",{type:"text",value:o,onChange:r=>y(r.target.value),className:g})}),e(f,{label:U,children:e("input",{type:"text",value:x,onChange:r=>d(r.target.value),className:g})}),e(f,{label:"Country",separate:!0,htmlFor:B,children:e($,{id:B,value:p,onChange:r=>m(r.target.value),className:g+" pr-10",style:Y,children:i.map(r=>e("option",{value:r.code,children:r.name},r.code))})})]}),e(f,{label:z,separate:!0,htmlFor:j,children:A.length>0?a($,{id:j,value:C,onChange:r=>h(r.target.value),className:g+" pr-10",style:Y,children:[e("option",{value:"",children:"Select…"}),A.map(r=>e("option",{value:r.code||r.name,children:r.name},r.code||r.name))]}):e("input",{id:j,type:"text",value:C,onChange:r=>h(r.target.value),className:g})})]}),e(f,{label:"Phone",children:e("input",{type:"tel",value:b,onChange:r=>s(r.target.value),className:g})}),!t&&I!==null&&_==="new"&&a(N,{children:[e(le,{checked:O,onChange:D,label:"Save this address to my account"}),O&&e(f,{label:"Address label",children:e("input",{type:"text",value:H,onChange:r=>q(r.target.value),placeholder:"Home",className:g})})]})]})}function Ae(){const{totals:t,coupon:i,deliveryOptions:n,shippingMethodId:l,setShippingMethodId:c,pickupLocation:u,formatMoney:o,city:y,destination:x,courierUnavailable:d,retryCourier:b}=k();return e(w,{num:"N° 03",title:"Shipping",children:a("div",{className:"grid gap-3",children:[n.map(s=>{const p=s.pickupLocation,m=p?[p.address,p.city,p.state,p.zipCode].filter(Boolean).join(", "):null;return e(S,{active:l===s.id,onClick:()=>c(s.id),title:p?`${s.name} — ${p.name}`:s.name,body:p?[m,p.openingHours,p.instructions,s.description].filter(Boolean).join(" · "):s.description||null,price:t.freeShipping||s.amount===0?F:o(s.amount,t.currency),tag:s.tag||void 0},s.id)}),d?a("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:[ie," ",e("button",{type:"button",onClick:b,className:"underline transition-colors hover:text-accent",children:"Try again"})]}):n.length===0&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})})}function Ie(){const{payChoice:t,setPayChoice:i,placing:n,payment:l,payOptions:c,noPaymentMethod:u}=k();return a(w,{num:"N° 04",title:"Payment",children:[u&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:re}),e("div",{className:"grid gap-3",children:c.map(o=>e(S,{active:t===o.key,onClick:()=>i(o.key),title:o.title,body:o.body,price:o.price,tag:o.tag},o.key))}),t==="card"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="paypal"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll approve the payment with PayPal on the payment step after placing the order."}):t==="afterpay"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):t==="square"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="gocardless"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):t==="zip"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Zip to approve four instalments, then brought straight back."}):t==="klarna"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Klarna to choose how to pay, then brought straight back."}):t==="bank"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."}):null]})}function Le(){const{site:t,items:i,totals:n,coupon:l,formatMoney:c,payChoice:u,placing:o,email:y,orderError:x,payment:d,noPaymentMethod:b,unpaidOrder:s,placeOrder:p}=k();return a("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-view-desktop:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[a("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[e("span",{children:"Your order"}),e(T,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit ↗"})]}),e("div",{className:"flex flex-col px-6 py-2",children:i.length===0?a("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",e(T,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog →"})]}):i.map(m=>e(oe,{slug:m.slug,name:m.name,qty:m.qty,config:m.config,configSummary:se(m.config),price:K(m,n.currency)??0,currency:n.currency},m.id))}),e("div",{className:"border-t border-line px-6 pt-5",children:e(J,{customerEmail:y})}),a("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[e(v,{label:"Subtotal",value:c(n.subtotal,n.currency)}),n.discount>0&&l?.valid&&e(v,{label:`Coupon · ${l.code}`,value:a("span",{className:"font-semibold text-green",children:["− ",c(n.discount,n.currency)]})}),l?.deferred&&e(v,{label:`Coupon · ${l.code}`,value:Q}),l?.valid&&l.effects?.gift&&e(v,{label:`Free gift · ${l.effects.gift.partNumber}${l.effects.gift.quantity>1?` ×${l.effects.gift.quantity}`:""}`,value:e("span",{className:"font-semibold text-green",children:F})}),e(v,{label:"Shipping",value:n.shippingStatus==="free"?e("span",{className:"font-semibold text-green",children:F}):ee(n.shippingStatus)??c(n.shipping,n.currency)}),n.tax&&(n.tax.charged?e(v,{label:n.tax.inclusive?`${n.tax.name} included · ${n.tax.rate}%`:n.tax.name,value:c(n.tax.amount,n.currency)}):n.tax.name?e(v,{label:n.tax.name,value:te}):null)]}),a("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[e("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),e("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:n.repricing?"…":c(n.grand,n.currency)})]}),a("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[x&&e(R,{role:"alert",children:x}),n.hasUnpricedLine&&a(R,{role:"status",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),e("button",{type:"button",onClick:p,disabled:o||!s&&(b||i.length===0||n.hasUnpricedLine||n.repricing),className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",o||!s&&(i.length===0||b||n.hasUnpricedLine||n.repricing)?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:o?a(N,{children:["Building order… ",e("span",{children:"·"})]}):b?a(N,{children:["No online payment ",e("span",{children:"·"})]}):s?a(N,{children:["Try payment again · ",V(s),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}):n.repricing?a(N,{children:["Updating total… ",e("span",{children:"·"})]}):a(N,{children:[u==="bank"?"Place order":"Continue to payment"," ·"," ",c(n.grand,n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})})]})]})}const Y={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function w({num:t,title:i,children:n}){return a("section",{className:"mb-6 border border-line bg-bg",children:[a("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t}),e("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:i})]}),e("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function M({cols:t="two",children:i}){return e("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:i})}function S({active:t,onClick:i,title:n,body:l,price:c,tag:u}){return a("button",{type:"button",onClick:i,"aria-pressed":t,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",t?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&e("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&e("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),a("span",{className:"flex min-w-0 flex-col gap-1",children:[a("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,u&&e("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:u})]}),l&&e("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:l})]}),e("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:c})]})}function le({checked:t,onChange:i,label:n,sub:l}){return a("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[e("button",{type:"button",onClick:()=>i(!t),"aria-pressed":t,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",t?"border-accent":"border-line"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:t&&e("span",{className:"text-[13px] text-accent",children:"✓"})}),a("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,l&&e("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:l})]})]})}function oe({slug:t,name:i,qty:n,config:l,configSummary:c,price:u,currency:o}){const{catalog:y}=X(),{formatMoney:x}=Z(),d=y.find(h=>h.slug===t),b=d?.spokes??5,s=d?.mesh??!1,p=l.find(h=>h.gold)?.label,m=d?.finishes.find(h=>h.name===p&&h.src)??d?.finishes.find(h=>h.src),C=d?.finishes[0]?.color??ne;return a("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[a("div",{className:"relative aspect-square",children:[e("div",{className:"flex h-full w-full items-center justify-center overflow-hidden border border-line bg-surface",children:m?.src?e(W,{src:m.src,alt:`${i.lead}${i.accent} — ${m.name}`,width:120,height:120,sizes:"60px",className:"block h-full w-full object-contain p-2"}):e("div",{className:"block w-[78%]",style:{color:C},children:e(ae,{spokes:b,mesh:s,className:"block w-full"})})}),e("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:n})]}),a("div",{className:"flex min-w-0 flex-col gap-0.5",children:[a("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[i.lead,e("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:i.accent})]}),e("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:c})]}),e("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:x(u,o)})]})}function v({label:t,value:i}){return a("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[e("span",{children:t}),e("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:i})]})}function se(t){return t.map(i=>i.label).join(" · ")}export{Ee as CheckoutContact,Le as CheckoutOrderSummary,Ie as CheckoutPayment,Fe as CheckoutShippingAddress,Ae as CheckoutShippingMethod};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as n,Fragment as x}from"react/jsx-runtime";import P from"../SectionBand.js";import S from"next/link";import{useEffect as M,useMemo as F,useRef as E}from"react";import{appendVehicleParams as $}from"../../lib/wheels/plp-vehicle-params.js";import{shopHrefForVehicle as j,shouldLeaveForTheShop as L}from"../../lib/wheels/picker-goes-to-the-shop.js";import z from"efficient-web-builder/render/components/SectionHeader";import{withRMark as T}from"efficient-web-builder/render/components/RMark";import b from"./FitmentPickerGrid.js";import V from"./StockFitmentCard.js";import{useVehicleFit as _}from"./useVehicleFit.js";import{say as O}from"efficient-web-builder/format/lib/editor-words";const f={body:"text-[length:var(--size-body,18px)]",headingSmall:"text-[length:var(--size-headingSmall,30px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,14px)]"};function R(o,i,c){if(!c)return o;const[s,m=""]=o.split("?"),r=$(new URLSearchParams(m),i).toString();return r?`${s}?${r}`:s}function Y({num:o,title:i,description:c,ctaText:s,ctaHref:m,layout:h="full",omitHead:r=!1,initialMakes:k=[],editing:l=!1}){const{cascade:e}=_({initialMakes:k,editing:l,autoApply:!0}),a=h==="bar",u=E(!1),y=F(()=>{if(!a)return e;const d=v=>(...N)=>{u.current=!0,v(...N)};return{...e,setMake:d(e.setMake),setModel:d(e.setModel),setYear:d(e.setYear),setModification:d(e.setModification)}},[a,e]);M(()=>{a&&(typeof window>"u"||L({shopperPicked:u.current,fullyPicked:e.fullyPicked,editing:l,pathname:window.location.pathname})&&window.location.assign(j(e.vehicle)))},[a,e.fullyPicked,e.vehicle,l]);const w=!r&&!a&&!!(o||i||c),p=!a&&s&&m?{text:s,href:m}:null,g=p?R(p.href,e.vehicle,e.fullyPicked):null;return n(P,{className:a?r?"pt-0 pb-8 max-[1100px]:pb-5":"py-8 max-[1100px]:py-5":r?"pt-0 pb-20 max-[1100px]:pb-[60px]":"py-20 max-[1100px]:py-[60px]",children:[w&&t(z,{num:o,title:i,description:c,accent:!0}),a?n("div",{className:"flex flex-wrap items-center gap-5",children:[!r&&i?.trim()&&t("p",{className:`font-heading3 ${f.headingSmall} [font-weight:var(--sf-heading-weight-strong,600)] leading-none tracking-[-0.02em] whitespace-nowrap`,children:T(i)}),t("div",{className:"min-w-[320px] flex-1 basis-0",children:t(b,{cascade:y,compact:!0,editing:l})})]}):t(b,{cascade:e,editing:l}),!a&&t(V,{loading:e.loading.stock,error:e.cascadeError,data:e.fullyPicked?e.stock:null}),!a&&n("div",{className:"mt-10 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-8",children:[t("p",{className:`max-w-[680px] font-serif ${f.body} italic leading-[1.55] text-fg-dim`,children:e.fullyPicked?n(x,{children:["Your car ·"," ",n("strong",{className:"font-display [font-weight:var(--sf-heading-weight-strong,500)] not-italic text-fg",children:[e.vehicle.year," ",e.makeName," ",e.modelName," ",e.modName]}),e.stock&&t("span",{className:"ml-3 not-italic text-accent",children:"OEM fitment loaded."})]}):n(x,{children:["Tell us four things — ",t("em",{className:"not-italic text-accent",children:"make, model, year, trim"})," — and we'll show the OEM stock fitment for your car."]})}),p&&g&&n(S,{href:g,className:`group inline-flex items-center gap-4 border border-btn bg-btn px-8 py-5 font-mono ${f.labelLarge} uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg`,children:[p.text,t("span",{className:"transition-transform group-hover:translate-x-[4px]",children:"→"})]})]}),l&&e.makeOptions.length===0&&!e.loading.models&&t("p",{className:`mt-4 font-mono ${f.labelSmall} uppercase tracking-[0.24em] text-fg-dim`,children:O("Vehicle catalog unavailable in this preview — the picker fills from the live fitment API on the published site.")})]})}export{Y as default,R as fitmentCtaHref};
1
+ "use client";import{jsx as t,jsxs as i,Fragment as x}from"react/jsx-runtime";import P from"../SectionBand.js";import S from"next/link";import{useEffect as M,useMemo as F,useRef as E}from"react";import{appendVehicleParams as $}from"../../lib/wheels/plp-vehicle-params.js";import{shopHrefForVehicle as j,shouldLeaveForTheShop as L}from"../../lib/wheels/picker-goes-to-the-shop.js";import z from"efficient-web-builder/render/components/SectionHeader";import{withRMark as T}from"efficient-web-builder/render/components/RMark";import k from"./FitmentPickerGrid.js";import V from"./StockFitmentCard.js";import{useVehicleFit as _}from"./useVehicleFit.js";import{say as O}from"efficient-web-builder/format/lib/editor-words";const f={body:"text-[length:var(--size-body,18px)]",headingSmall:"text-[length:var(--size-headingSmall,30px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,14px)]"};function R(l,n,c){if(!c)return l;const[s,m=""]=l.split("?"),r=$(new URLSearchParams(m),n).toString();return r?`${s}?${r}`:s}function Y({num:l,title:n,description:c,ctaText:s,ctaHref:m,layout:h="full",omitHead:r=!1,initialMakes:b=[],editing:o=!1}){const{cascade:e}=_({initialMakes:b,editing:o,autoApply:!0}),a=h==="bar",u=E(!1),w=F(()=>{if(!a)return e;const d=y=>(...N)=>{u.current=!0,y(...N)};return{...e,setMake:d(e.setMake),setModel:d(e.setModel),setYear:d(e.setYear),setModification:d(e.setModification)}},[a,e]);M(()=>{a&&(typeof window>"u"||L({shopperPicked:u.current,fullyPicked:e.fullyPicked,editing:o,pathname:window.location.pathname})&&window.location.assign(j(e.vehicle)))},[a,e.fullyPicked,e.vehicle,o]);const v=!r&&!a&&!!(l||n||c),p=!a&&s&&m?{text:s,href:m}:null,g=p?R(p.href,e.vehicle,e.fullyPicked):null;return i(P,{className:a?r?"pt-0 pb-8 max-view-desktop:pb-5":"py-8 max-view-desktop:py-5":r?"pt-0 pb-20 max-view-desktop:pb-[60px]":"py-20 max-view-desktop:py-[60px]",children:[v&&t(z,{num:l,title:n,description:c,accent:!0}),a?i("div",{className:"flex flex-wrap items-center gap-5",children:[!r&&n?.trim()&&t("p",{className:`font-heading3 ${f.headingSmall} [font-weight:var(--sf-heading-weight-strong,600)] leading-none tracking-[-0.02em] whitespace-nowrap`,children:T(n)}),t("div",{className:"min-w-[320px] flex-1 basis-0",children:t(k,{cascade:w,compact:!0,editing:o})})]}):t(k,{cascade:e,editing:o}),!a&&t(V,{loading:e.loading.stock,error:e.cascadeError,data:e.fullyPicked?e.stock:null}),!a&&i("div",{className:"mt-10 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-8",children:[t("p",{className:`max-w-[680px] font-serif ${f.body} italic leading-[1.55] text-fg-dim`,children:e.fullyPicked?i(x,{children:["Your car ·"," ",i("strong",{className:"font-display [font-weight:var(--sf-heading-weight-strong,500)] not-italic text-fg",children:[e.vehicle.year," ",e.makeName," ",e.modelName," ",e.modName]}),e.stock&&t("span",{className:"ml-3 not-italic text-accent",children:"OEM fitment loaded."})]}):i(x,{children:["Tell us four things — ",t("em",{className:"not-italic text-accent",children:"make, model, year, trim"})," — and we'll show the OEM stock fitment for your car."]})}),p&&g&&i(S,{href:g,className:`group inline-flex items-center gap-4 border border-btn bg-btn px-8 py-5 font-mono ${f.labelLarge} uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg`,children:[p.text,t("span",{className:"transition-transform group-hover:translate-x-[4px]",children:"→"})]})]}),o&&e.makeOptions.length===0&&!e.loading.models&&t("p",{className:`mt-4 font-mono ${f.labelSmall} uppercase tracking-[0.24em] text-fg-dim`,children:O("Vehicle catalog unavailable in this preview — the picker fills from the live fitment API on the published site.")})]})}export{Y as default,R as fitmentCtaHref};
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as t}from"react/jsx-runtime";import{PickerField as a}from"./PickerField.js";import{vehicleLevelStates as m}from"./vehicle-level-state.js";import{VEHICLE_FIELD_LABEL as n}from"../../lib/wheels/vehicle-field-focus.js";function p({cascade:e,compact:i=!1,editing:d=!1}){const{vehicle:o}=e,l=m(e),s=t("div",{className:["grid gap-[2px] border border-line bg-line",i?"grid-cols-1 @min-[20rem]:grid-cols-2 @min-[39rem]:grid-cols-4":"grid-cols-4 max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1"].join(" "),children:[r(a,{label:n.make,placeholder:l.make.placeholder,disabled:l.make.disabled,value:o.make,options:e.makeOptions,onChange:e.setMake,compact:i,editing:d}),r(a,{label:n.model,placeholder:l.model.placeholder,disabled:l.model.disabled,value:o.model,options:e.modelOptions,onChange:e.setModel,compact:i,editing:d}),r(a,{label:n.year,placeholder:l.year.placeholder,disabled:l.year.disabled,value:o.year!==null?String(o.year):"",options:e.yearOptions,onChange:e.setYear,compact:i,editing:d}),r(a,{label:n.trim,placeholder:l.trim.placeholder,disabled:l.trim.disabled,value:o.modification,options:e.modOptions,onChange:e.setModification,compact:i,editing:d})]});return i?r("div",{className:"@container",children:s}):s}export{p as default};
1
+ "use client";import{jsx as r,jsxs as t}from"react/jsx-runtime";import{PickerField as a}from"./PickerField.js";import{vehicleLevelStates as m}from"./vehicle-level-state.js";import{VEHICLE_FIELD_LABEL as n}from"../../lib/wheels/vehicle-field-focus.js";function p({cascade:e,compact:i=!1,editing:d=!1}){const{vehicle:o}=e,l=m(e),s=t("div",{className:["grid gap-[2px] border border-line bg-line",i?"grid-cols-1 @min-[20rem]:grid-cols-2 @min-[39rem]:grid-cols-4":"grid-cols-4 max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1"].join(" "),children:[r(a,{label:n.make,placeholder:l.make.placeholder,disabled:l.make.disabled,value:o.make,options:e.makeOptions,onChange:e.setMake,compact:i,editing:d}),r(a,{label:n.model,placeholder:l.model.placeholder,disabled:l.model.disabled,value:o.model,options:e.modelOptions,onChange:e.setModel,compact:i,editing:d}),r(a,{label:n.year,placeholder:l.year.placeholder,disabled:l.year.disabled,value:o.year!==null?String(o.year):"",options:e.yearOptions,onChange:e.setYear,compact:i,editing:d}),r(a,{label:n.trim,placeholder:l.trim.placeholder,disabled:l.trim.disabled,value:o.modification,options:e.modOptions,onChange:e.setModification,compact:i,editing:d})]});return i?r("div",{className:"@container",children:s}):s}export{p as default};
@@ -1 +1 @@
1
- "use client";import{jsx as l,jsxs as a}from"react/jsx-runtime";const t={body:"text-[length:var(--size-body,17px)]",labelSmall:"text-[length:var(--size-label,11px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function s({loading:o,error:n,data:e}){return o?l("div",{className:`mt-10 border border-line bg-bg p-6 font-mono ${t.labelLarge} uppercase tracking-[0.24em] text-fg-dim`,children:"Loading stock fitment…"}):n?a("div",{className:`mt-10 border border-line bg-bg p-6 font-mono ${t.labelLarge} uppercase tracking-[0.22em] text-fg-dim`,children:["Couldn't load stock fitment — ",l("span",{className:"text-accent",children:n})]}):e?a("div",{className:"mt-10 grid grid-cols-4 gap-[2px] border border-line bg-line max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1",children:[l(r,{label:"Bolt pattern",value:e.boltPattern??"—"}),l(r,{label:"PCD",value:e.pcd??"—"}),l(r,{label:"Hub bore",value:e.centreBore?`${e.centreBore} mm`:"—"}),l(r,{label:"ET range",value:e.etRange&&e.etRange.length===2?`${e.etRange[0]} – ${e.etRange[1]}`:"—"}),l(r,{label:"OEM front",value:e.frontWheels.length?e.frontWheels.join(" · "):"—"}),l(r,{label:"OEM rear",value:e.rearWheels.length?e.rearWheels.join(" · "):"—"}),l(r,{label:"OEM front tyres",value:e.frontTyres.length?e.frontTyres.join(" · "):"—"}),l(r,{label:"OEM rear tyres",value:e.rearTyres.length?e.rearTyres.join(" · "):"—"})]}):null}function r({label:o,value:n}){return a("div",{className:"flex min-h-[96px] flex-col gap-2 bg-bg px-5 py-5",children:[l("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.26em] text-fg-dim`,children:o}),l("span",{className:`mt-auto font-display ${t.body} font-medium tracking-[-0.01em] text-fg`,children:n})]})}export{s as default};
1
+ "use client";import{jsx as l,jsxs as s}from"react/jsx-runtime";const t={body:"text-[length:var(--size-body,17px)]",labelSmall:"text-[length:var(--size-label,11px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function a({loading:o,error:n,data:e}){return o?l("div",{className:`mt-10 border border-line bg-bg p-6 font-mono ${t.labelLarge} uppercase tracking-[0.24em] text-fg-dim`,children:"Loading stock fitment…"}):n?s("div",{className:`mt-10 border border-line bg-bg p-6 font-mono ${t.labelLarge} uppercase tracking-[0.22em] text-fg-dim`,children:["Couldn't load stock fitment — ",l("span",{className:"text-accent",children:n})]}):e?s("div",{className:"mt-10 grid grid-cols-4 gap-[2px] border border-line bg-line max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1",children:[l(r,{label:"Bolt pattern",value:e.boltPattern??"—"}),l(r,{label:"PCD",value:e.pcd??"—"}),l(r,{label:"Hub bore",value:e.centreBore?`${e.centreBore} mm`:"—"}),l(r,{label:"ET range",value:e.etRange&&e.etRange.length===2?`${e.etRange[0]} – ${e.etRange[1]}`:"—"}),l(r,{label:"OEM front",value:e.frontWheels.length?e.frontWheels.join(" · "):"—"}),l(r,{label:"OEM rear",value:e.rearWheels.length?e.rearWheels.join(" · "):"—"}),l(r,{label:"OEM front tyres",value:e.frontTyres.length?e.frontTyres.join(" · "):"—"}),l(r,{label:"OEM rear tyres",value:e.rearTyres.length?e.rearTyres.join(" · "):"—"})]}):null}function r({label:o,value:n}){return s("div",{className:"flex min-h-[96px] flex-col gap-2 bg-bg px-5 py-5",children:[l("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.26em] text-fg-dim`,children:o}),l("span",{className:`mt-auto font-display ${t.body} font-medium tracking-[-0.01em] text-fg`,children:n})]})}export{a as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import u from"../SectionBand.js";import B from"../BundleCard.js";import{cardImageShapeTokens as m}from"efficient-web-builder/format/lib/content/card-image-shape";import N from"efficient-web-builder/render/components/SectionHeader";import O from"./KindGate.js";import{useCurrency as _}from"../CurrencyContext.js";import{renderGold as f,renderHeadline as j}from"efficient-web-builder/render/components/goldPhrases";import{useCurrentProduct as k}from"../../lib/document/current-product.js";import{say as C}from"efficient-web-builder/format/lib/editor-words";const x="border-b border-line py-[120px] max-[1100px]:py-20",g="border-b border-line pt-0 pb-[120px] max-[1100px]:pt-0 max-[1100px]:pb-20",S=["alloy-wheel"],y={2:"grid-cols-2 max-[800px]:grid-cols-1",3:"grid-cols-3 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1"};function D(r){return e(O,{kinds:S,type:"BundleOffer",editing:r.editing,children:e(v,{...r})})}function v({num:r,title:o,description:t,columns:d=3,editing:b=!1,omitHead:n=!1,cardImage:i}){const l=k(),{currency:h}=_(),s=l?.product.kind==="alloy-wheel"?l.product.source.bundles??[]:[],c=n?null:e(N,{num:r?f(r):void 0,title:o?j(o,!1):void 0,description:t?f(t):void 0,accent:!0});return s.length===0?b?a(u,{className:n?g:x,style:m(i),children:[c,e("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:C("Bundles containing this product appear here on a product page.")})]}):null:a(u,{className:n?g:x,style:m(i),children:[c,e("div",{className:`mt-10 grid gap-6 ${y[d]??y[3]}`,children:s.slice(0,d).map(p=>e(B,{bundle:p,currency:h},p.slug))})]})}export{D as default,S as supportedKinds};
1
+ "use client";import{jsx as e,jsxs as p}from"react/jsx-runtime";import u from"../SectionBand.js";import w from"../BundleCard.js";import{cardImageShapeTokens as m}from"efficient-web-builder/format/lib/content/card-image-shape";import B from"efficient-web-builder/render/components/SectionHeader";import N from"./KindGate.js";import{useCurrency as k}from"../CurrencyContext.js";import{renderGold as f,renderHeadline as v}from"efficient-web-builder/render/components/goldPhrases";import{useCurrentProduct as O}from"../../lib/document/current-product.js";import{say as _}from"efficient-web-builder/format/lib/editor-words";const x="border-b border-line py-[120px] max-view-desktop:py-20",g="border-b border-line pt-0 pb-[120px] max-view-desktop:pt-0 max-view-desktop:pb-20",j=["alloy-wheel"],y={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"};function C(r){return e(N,{kinds:j,type:"BundleOffer",editing:r.editing,children:e(S,{...r})})}function S({num:r,title:o,description:t,columns:d=3,editing:b=!1,omitHead:n=!1,cardImage:i}){const s=O(),{currency:h}=k(),l=s?.product.kind==="alloy-wheel"?s.product.source.bundles??[]:[],c=n?null:e(B,{num:r?f(r):void 0,title:o?v(o,!1):void 0,description:t?f(t):void 0,accent:!0});return l.length===0?b?p(u,{className:n?g:x,style:m(i),children:[c,e("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:_("Bundles containing this product appear here on a product page.")})]}):null:p(u,{className:n?g:x,style:m(i),children:[c,e("div",{className:`mt-10 grid gap-6 ${y[d]??y[3]}`,children:l.slice(0,d).map(a=>e(w,{bundle:a,currency:h},a.slug))})]})}export{C as default,j as supportedKinds};
@@ -1 +1 @@
1
- "use client";import{jsx as s}from"react/jsx-runtime";import y from"../SectionBand.js";import f from"../DetailRows.js";import R from"./KindGate.js";import x from"./RecordPhotoGallery.js";import{useCurrentProduct as D}from"../../lib/document/current-product.js";import{SAMPLE_RECORD as b,recordFacts as k,recordPictures as p,useCurrentRecord as S,useDrawsOtherRecord as B}from"../../lib/document/current-record.js";import{detailShotTag as P,pickDetailShots as T}from"../../lib/wheels/detail-shots.js";import{selectedStuds as N}from"../../lib/wheels/selected-studs.js";import{useSampleProduct as v}from"./useSampleProduct.js";import{say as C}from"efficient-web-builder/format/lib/editor-words";const F=["alloy-wheel"];function h(e,n){return e.finishes.find(t=>t.name===n)??e.finishes[0]}function L(e,n){return(h(e,n)?.features??[]).map(t=>({eyebrow:t.eyebrow,title:t.heading,copy:t.description,tag:t.mark,image:t.image||void 0}))}function j(e,n,t){const r=T(h(e,n),t);return r.rows.map(i=>({eyebrow:i.eyebrow?.trim()||void 0,title:i.title,copy:i.line||void 0,image:i.url,tag:P(i,r,t),imageShape:"square"}))}function E(e){return B(!!e.editing)?s(G,{...e}):s(R,{kinds:F,type:"DetailRows",editing:e.editing,children:s(K,{...e})})}function w(e){const n=k(e),t=p(e)[0];return!n.length&&!t&&!e.title.trim()?[]:[{title:e.title,specs:n,image:t?.url||void 0}]}function G({startLeft:e,padTop:n,padBottom:t,editing:r=!1}){const i=S(),o=i?w(i):r?w(b):[];if(o.length===0)return null;const a=i?p(i,{firstField:!0}):[];return a.length&&(o[0]={...o[0],media:s(x,{pictures:a,name:i?.title??"",editing:r,fit:"column"})}),s(f,{rows:o,startLeft:e,padTop:n,padBottom:t,editing:r})}function K({rowsFrom:e,startLeft:n,padTop:t,padBottom:r,editing:i=!1}){const o=D(),a=v(i&&!o),c=o?.product??a,l=c?.kind==="alloy-wheel"?c.source:null,u=o?o.selection.shown.finish:void 0,g=o?N(o.selection):null,d=e==="details",m=l?d?j(l,u,g):L(l,u):[];return d&&m.length===0?i?s(y,{className:"border-b border-line py-14 max-[1100px]:py-10",children:s("p",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:C("No detail shots on this finish yet. Tick a close-up on the design's renderings and give it a title. This section is hidden on the live page until then.")})}):null:s(f,{rows:m,startLeft:n,padTop:t,padBottom:r,editing:i})}export{E as default,w as recordDetailRows,F as supportedKinds};
1
+ "use client";import{jsx as s}from"react/jsx-runtime";import y from"../SectionBand.js";import f from"../DetailRows.js";import R from"./KindGate.js";import D from"./RecordPhotoGallery.js";import{useCurrentProduct as x}from"../../lib/document/current-product.js";import{SAMPLE_RECORD as b,recordFacts as k,recordPictures as p,useCurrentRecord as S,useDrawsOtherRecord as B}from"../../lib/document/current-record.js";import{detailShotTag as P,pickDetailShots as T}from"../../lib/wheels/detail-shots.js";import{selectedStuds as v}from"../../lib/wheels/selected-studs.js";import{useSampleProduct as N}from"./useSampleProduct.js";import{say as C}from"efficient-web-builder/format/lib/editor-words";const F=["alloy-wheel"];function h(e,o){return e.finishes.find(t=>t.name===o)??e.finishes[0]}function L(e,o){return(h(e,o)?.features??[]).map(t=>({eyebrow:t.eyebrow,title:t.heading,copy:t.description,tag:t.mark,image:t.image||void 0}))}function j(e,o,t){const r=T(h(e,o),t);return r.rows.map(i=>({eyebrow:i.eyebrow?.trim()||void 0,title:i.title,copy:i.line||void 0,image:i.url,tag:P(i,r,t),imageShape:"square"}))}function E(e){return B(!!e.editing)?s(G,{...e}):s(R,{kinds:F,type:"DetailRows",editing:e.editing,children:s(K,{...e})})}function w(e){const o=k(e),t=p(e)[0];return!o.length&&!t&&!e.title.trim()?[]:[{title:e.title,specs:o,image:t?.url||void 0}]}function G({startLeft:e,padTop:o,padBottom:t,editing:r=!1}){const i=S(),n=i?w(i):r?w(b):[];if(n.length===0)return null;const a=i?p(i,{firstField:!0}):[];return a.length&&(n[0]={...n[0],media:s(D,{pictures:a,name:i?.title??"",editing:r,fit:"column"})}),s(f,{rows:n,startLeft:e,padTop:o,padBottom:t,editing:r})}function K({rowsFrom:e,startLeft:o,padTop:t,padBottom:r,editing:i=!1}){const n=x(),a=N(i&&!n),c=n?.product??a,l=c?.kind==="alloy-wheel"?c.source:null,d=n?n.selection.shown.finish:void 0,g=n?v(n.selection):null,u=e==="details",m=l?u?j(l,d,g):L(l,d):[];return u&&m.length===0?i?s(y,{className:"border-b border-line py-14 max-view-desktop:py-10",children:s("p",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:C("No detail shots on this finish yet. Tick a close-up on the design's renderings and give it a title. This section is hidden on the live page until then.")})}):null:s(f,{rows:m,startLeft:o,padTop:t,padBottom:r,editing:i})}export{E as default,w as recordDetailRows,F as supportedKinds};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as E}from"react/jsx-runtime";import I from"efficient-web-builder/render/components/Btn";import B,{GALLERY_GRID_ATTR as C,GalleryLinksContext as j}from"../GalleryItem.js";import{SharedPartKinds as D}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as F}from"efficient-web-builder/render/components/goldPhrases";import K from"efficient-web-builder/render/components/SectionHeader";import U from"./KindGate.js";import Z from"./RecordPhotoGallery.js";import{headIsEmpty as $,ownPadding as z}from"../../lib/sections/own-padding.js";import{PLP_KINDS as V}from"../../lib/catalog/plp-item.js";import{useCurrentProduct as W}from"../../lib/document/current-product.js";import{SAMPLE_PICTURE_COUNT as S,SAMPLE_RECORD as X,recordPictures as Y,useCurrentRecord as q,useDrawsOtherRecord as J}from"../../lib/document/current-record.js";import{mediaGroupVehicle as Q}from"../../lib/content/source-values.js";import{useSampleProduct as ee}from"./useSampleProduct.js";import{say as _}from"efficient-web-builder/format/lib/editor-words";import{resolveGalleryLayout as re}from"efficient-web-builder/format/lib/content/gallery-layout";const te=V,O=["photos","lifestyle","accessories","others"];function ie(e,o){if(!e)return[];if(o==="all")return O.flatMap(s=>e[s]??[]);const r=O.includes(o)?o:null;return r?e[r]??[]:[]}const T="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",L="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]";function oe(e){return J(!!e.editing)?t(ae,{...e}):t(U,{kinds:te,type:"GalleryB",editing:e.editing,children:t(se,{...e})})}function ae(e){const{editing:o=!1}=e,r=q(),s=r?Y(r,{firstField:!0}).map(a=>({images:[a.url],eyebrow:a.alt&&a.alt!==r.title?a.alt:void 0,...a.video?{video:a.video}:{}})):o?Array.from({length:S},()=>({images:[""]})):[];return t(R,{...e,tiles:s,owner:{name:(r??X).title},photosOnly:!0,emptyHint:_("This record’s pictures appear here on its page. A record with no pictures draws nothing.")})}function Ne(e){const{rows:o,limit:r,layout:s,editing:a=!1,title:u}=e,c=typeof r=="number"&&r>0?Math.floor(r):void 0,h=o.filter(n=>typeof n.cover=="string"&&n.cover).map(n=>({images:[n.cover],...n.video?{video:n.video}:{}})),d=a&&h.length===0?Array.from({length:c??S},()=>({images:[""]})):h;return t(R,{...e,tiles:c?d.slice(0,c):d,owner:{name:(u??"").replace(/==/g,"").trim()},photosOnly:!0,tilesAcross:re(s)?.across===3?3:4,emptyHint:_("The website’s pictures appear here, in the order they are put in. A website with no pictures draws nothing.")})}function se({omitHead:e=!1,num:o,title:r,linkText:s,linkHref:a,galleryHref:u="/gallery",submitHref:c="/contact",zone:h="all",photoDisplay:d="covers",previewHover:n,display:w,displayPhone:g,styleOwner:x,editing:p=!1,padTop:G,padBottom:v}){const b=W(),N=ee(p&&!b),f=b?.product??N,y=ie(f?.mediaGroups,h).map(i=>({images:(i.items??[]).filter(m=>m.kind==="image").map(m=>m.url),vehicle:Q(i),finish:i.finish})).filter(i=>i.images.length>0),P=(d==="auto"?y.length>=4?"covers":"all":d)==="all"?y.flatMap(i=>i.images.map(m=>({images:[m],vehicle:i.vehicle,finish:i.finish}))):y;return t(R,{omitHead:e,num:o,title:r,linkText:s,linkHref:a,galleryHref:u,submitHref:c,previewHover:n,display:w,displayPhone:g,styleOwner:x,editing:p,padTop:G,padBottom:v,tiles:f?P.map(i=>({images:i.images,eyebrow:i.vehicle||void 0,meta:i.finish})):[],owner:{name:f?.name??"",href:f?.href,process:f?.eyebrow},emptyHint:_("This product’s photos appear here on a product page. Add media groups in the product’s Media tab.")})}function R({omitHead:e=!1,num:o,title:r,linkText:s,linkHref:a,galleryHref:u="/gallery",submitHref:c="/contact",previewHover:h,display:d,displayPhone:n,styleOwner:w,editing:g=!1,tiles:x,owner:p,emptyHint:G,photosOnly:v=!1,tilesAcross:b,padTop:N,padBottom:f}){const y=s?{text:s,href:a||"#"}:void 0,A=r?F(r,!1):void 0,P=e?null:t(K,{num:o,title:A,link:y}),i=!g&&$(o,r,y?.text)?null:P,m=z(N,f);return x.length===0?g?t("section",{className:e?L:T,style:m,children:E("div",{className:M,children:[i,t("p",{className:"mt-8 border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:G})]})}):null:t("section",{className:e?L:T,style:m,children:E("div",{className:M,children:[i,v?t(Z,{pictures:x.map(l=>({url:l.images[0]??"",alt:l.eyebrow,video:l.video})),name:p.name,editing:g,...b?{fit:"tiles",across:b}:{}}):t(j.Provider,{value:{galleryHref:u,submitHref:c,previewHover:h,display:d,displayPhone:n,styleOwner:w,photosOnly:v},children:t(D,{children:t("div",{[C]:"",className:"grid grid-cols-4 gap-2 max-[1500px]:grid-cols-3 max-[800px]:grid-cols-1 max-[800px]:gap-1",children:x.map((l,k)=>t(B,{image:l.images[0],photos:l.images.slice(1).map(H=>({src:H})),href:p.href,process:p.process,eyebrow:l.eyebrow,name:p.name,meta:l.meta,editing:g},`${l.eyebrow}-${k}`))})})}),!v&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(I,{href:u,variant:"ghost",children:"See Gallery"})})]})})}export{Ne as SourcedGalleryGrid,oe as default,te as supportedKinds};
1
+ "use client";import{jsx as t,jsxs as E}from"react/jsx-runtime";import I from"efficient-web-builder/render/components/Btn";import B,{GALLERY_GRID_ATTR as C,GalleryLinksContext as j}from"../GalleryItem.js";import{SharedPartKinds as D}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as F}from"efficient-web-builder/render/components/goldPhrases";import K from"efficient-web-builder/render/components/SectionHeader";import U from"./KindGate.js";import Z from"./RecordPhotoGallery.js";import{headIsEmpty as $,ownPadding as z}from"../../lib/sections/own-padding.js";import{PLP_KINDS as V}from"../../lib/catalog/plp-item.js";import{useCurrentProduct as W}from"../../lib/document/current-product.js";import{SAMPLE_PICTURE_COUNT as S,SAMPLE_RECORD as X,recordPictures as Y,useCurrentRecord as q,useDrawsOtherRecord as J}from"../../lib/document/current-record.js";import{mediaGroupVehicle as Q}from"../../lib/content/source-values.js";import{useSampleProduct as ee}from"./useSampleProduct.js";import{say as _}from"efficient-web-builder/format/lib/editor-words";import{resolveGalleryLayout as re}from"efficient-web-builder/format/lib/content/gallery-layout";const te=V,O=["photos","lifestyle","accessories","others"];function ie(e,o){if(!e)return[];if(o==="all")return O.flatMap(s=>e[s]??[]);const r=O.includes(o)?o:null;return r?e[r]??[]:[]}const T="relative z-[2] bg-bg py-[120px] max-view-wide:py-[70px]",L="relative z-[2] bg-bg pt-0 pb-[120px] max-view-wide:pt-0 max-view-wide:pb-[70px]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]";function oe(e){return J(!!e.editing)?t(ae,{...e}):t(U,{kinds:te,type:"GalleryB",editing:e.editing,children:t(se,{...e})})}function ae(e){const{editing:o=!1}=e,r=q(),s=r?Y(r,{firstField:!0}).map(a=>({images:[a.url],eyebrow:a.alt&&a.alt!==r.title?a.alt:void 0,...a.video?{video:a.video}:{}})):o?Array.from({length:S},()=>({images:[""]})):[];return t(R,{...e,tiles:s,owner:{name:(r??X).title},photosOnly:!0,emptyHint:_("This record’s pictures appear here on its page. A record with no pictures draws nothing.")})}function Ne(e){const{rows:o,limit:r,layout:s,editing:a=!1,title:u}=e,d=typeof r=="number"&&r>0?Math.floor(r):void 0,h=o.filter(n=>typeof n.cover=="string"&&n.cover).map(n=>({images:[n.cover],...n.video?{video:n.video}:{}})),c=a&&h.length===0?Array.from({length:d??S},()=>({images:[""]})):h;return t(R,{...e,tiles:d?c.slice(0,d):c,owner:{name:(u??"").replace(/==/g,"").trim()},photosOnly:!0,tilesAcross:re(s)?.across===3?3:4,emptyHint:_("The website’s pictures appear here, in the order they are put in. A website with no pictures draws nothing.")})}function se({omitHead:e=!1,num:o,title:r,linkText:s,linkHref:a,galleryHref:u="/gallery",submitHref:d="/contact",zone:h="all",photoDisplay:c="covers",previewHover:n,display:b,displayPhone:g,styleOwner:v,editing:p=!1,padTop:G,padBottom:x}){const w=W(),N=ee(p&&!w),f=w?.product??N,y=ie(f?.mediaGroups,h).map(i=>({images:(i.items??[]).filter(m=>m.kind==="image").map(m=>m.url),vehicle:Q(i),finish:i.finish})).filter(i=>i.images.length>0),P=(c==="auto"?y.length>=4?"covers":"all":c)==="all"?y.flatMap(i=>i.images.map(m=>({images:[m],vehicle:i.vehicle,finish:i.finish}))):y;return t(R,{omitHead:e,num:o,title:r,linkText:s,linkHref:a,galleryHref:u,submitHref:d,previewHover:n,display:b,displayPhone:g,styleOwner:v,editing:p,padTop:G,padBottom:x,tiles:f?P.map(i=>({images:i.images,eyebrow:i.vehicle||void 0,meta:i.finish})):[],owner:{name:f?.name??"",href:f?.href,process:f?.eyebrow},emptyHint:_("This product’s photos appear here on a product page. Add media groups in the product’s Media tab.")})}function R({omitHead:e=!1,num:o,title:r,linkText:s,linkHref:a,galleryHref:u="/gallery",submitHref:d="/contact",previewHover:h,display:c,displayPhone:n,styleOwner:b,editing:g=!1,tiles:v,owner:p,emptyHint:G,photosOnly:x=!1,tilesAcross:w,padTop:N,padBottom:f}){const y=s?{text:s,href:a||"#"}:void 0,A=r?F(r,!1):void 0,P=e?null:t(K,{num:o,title:A,link:y}),i=!g&&$(o,r,y?.text)?null:P,m=z(N,f);return v.length===0?g?t("section",{className:e?L:T,style:m,children:E("div",{className:M,children:[i,t("p",{className:"mt-8 border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:G})]})}):null:t("section",{className:e?L:T,style:m,children:E("div",{className:M,children:[i,x?t(Z,{pictures:v.map(l=>({url:l.images[0]??"",alt:l.eyebrow,video:l.video})),name:p.name,editing:g,...w?{fit:"tiles",across:w}:{}}):t(j.Provider,{value:{galleryHref:u,submitHref:d,previewHover:h,display:c,displayPhone:n,styleOwner:b,photosOnly:x},children:t(D,{children:t("div",{[C]:"",className:"grid grid-cols-4 gap-2 max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1 max-view-wide:gap-1",children:v.map((l,k)=>t(B,{image:l.images[0],photos:l.images.slice(1).map(H=>({src:H})),href:p.href,process:p.process,eyebrow:l.eyebrow,name:p.name,meta:l.meta,editing:g},`${l.eyebrow}-${k}`))})})}),!x&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(I,{href:u,variant:"ghost",children:"See Gallery"})})]})})}export{Ne as SourcedGalleryGrid,oe as default,te as supportedKinds};
@@ -1,9 +1,10 @@
1
1
  import type { ReactNode } from "react";
2
+ import { type HeroTextRegionProps } from "../ProductHeroPanel.js";
2
3
  import type { StoreProduct } from "../../lib/catalog/store-product.js";
3
4
  import type { HeroPricePlacement } from "../../lib/sections/hero-price-placement.js";
4
5
  import type { HeroLayout, HeroTextAlign } from "../../lib/sections/hero-arrangement.js";
5
6
  import type { HeroGalleryMode, HeroImageFit } from "../../lib/sections/hero-gallery.js";
6
- interface HeroArrangement {
7
+ interface HeroArrangement extends HeroTextRegionProps {
7
8
  heroLayout?: HeroLayout;
8
9
  imageRatio?: number;
9
10
  textAlign?: HeroTextAlign;
@@ -1,4 +1,5 @@
1
1
  import { type CardImageBackground } from "efficient-web-builder/format/lib/content/card-image-background";
2
+ import type { CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
2
3
  import { type CardIndexFormat, type CardOutline } from "efficient-web-builder/format/lib/sections/product-card-style";
3
4
  export declare const supportedKinds: readonly ("alloy-wheel" | "tyre")[];
4
5
  interface Props {
@@ -24,8 +25,8 @@ interface Props {
24
25
  showCardPage?: boolean;
25
26
  coverIndex?: number;
26
27
  imageBackground?: CardImageBackground;
27
- spinOnHover?: boolean;
28
+ hover?: CardHoverDrawn;
28
29
  }
29
30
  export default function DynamicRelatedProducts(props: Props): import("react").JSX.Element;
30
- export declare function RelatedProductsBody({ num, title, description, columns, cardCount, relationship: key, footnote, footnoteLinkText, footnoteLinkHref, editing, omitHead, cardImage, outline, indexBadge, showBadge, showCardPrice, showCardFinishes, showCardSizes, showCardBuy, showCardPage, coverIndex, imageBackground, spinOnHover, }: Props): import("react").JSX.Element | null;
31
+ export declare function RelatedProductsBody({ num, title, description, columns, cardCount, relationship: key, footnote, footnoteLinkText, footnoteLinkHref, editing, omitHead, cardImage, outline, indexBadge, showBadge, showCardPrice, showCardFinishes, showCardSizes, showCardBuy, showCardPage, coverIndex, imageBackground, hover, }: Props): import("react").JSX.Element | null;
31
32
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as O}from"react/jsx-runtime";import I from"../SectionBand.js";import{useScopeClass as W}from"../../lib/use-scope-class.js";import{GRID_CARD_SHOW as k}from"../../lib/sections/card-show-defaults.js";import{useEffect as V,useState as X}from"react";import{resolveCardImageBackground as Z,THEME_CARD_IMAGE_BG as q}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as B}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_COVER_INDEX as J}from"../../lib/wheels/cover-rendering.js";import{DEFAULT_CARD_INDEX_FORMAT as Q,DEFAULT_CARD_OUTLINE as Y,cardIndexCss as ee}from"efficient-web-builder/format/lib/sections/product-card-style";import re from"../CompatibleTyres.js";import oe from"../ProductCard.js";import{CARD_ROWS_GRID_CLASS as te,cardRowsGridStyle as ie}from"../WheelCardFrame.js";import{ProductCardChromeProvider as se}from"../ProductCardChrome.js";import{gridClassImageSizes as ne}from"../../lib/sections/card-image-sizes.js";import{fillRowCss as ae}from"../../lib/sections/fill-row.js";import le from"efficient-web-builder/render/components/SectionHeader";import de from"../ViewMoreLink.js";import{useSiteMenuLinks as ce}from"../catalog/SiteMenuLinks.js";import{renderGold as F,renderHeadline as me}from"efficient-web-builder/render/components/goldPhrases";import pe from"./KindGate.js";import{loadProductCatalog as ue}from"../useProductCatalog.js";import{PLP_KINDS as fe}from"../../lib/catalog/plp-item.js";import{relatedCardCount as he,relatedViewMore as ge}from"../../lib/catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as xe,relationshipApplies as Ce,relationshipByKey as ye}from"../../lib/catalog/relationships.js";import{useCurrentProduct as we}from"../../lib/document/current-product.js";import{PLACEHOLDER_RELATED as H}from"../../lib/wheels/placeholder-wheel.js";import{say as T}from"efficient-web-builder/format/lib/editor-words";const G={label:"text-[length:var(--size-label,13px)]"},be=fe,$={2:"grid-cols-2 max-[800px]:grid-cols-1",3:"grid-cols-3 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1"};function Se(r){return e(pe,{kinds:be,type:"RelatedProducts",editing:r.editing,children:e(_e,{...r})})}function _e({num:r,title:t,description:c,columns:n=3,cardCount:S,relationship:_=xe,footnote:E,footnoteLinkText:R,footnoteLinkHref:D,editing:o=!1,omitHead:x=!1,cardImage:i,outline:m,indexBadge:p,showBadge:C,showCardPrice:y,showCardFinishes:a,showCardSizes:l,showCardBuy:u,showCardPage:f,coverIndex:h,imageBackground:g,spinOnHover:w}){const d=we(),U=ce(),L=he(S),[j,N]=X([]);V(()=>{if(d||!o)return;let A=!1;return ue().then(M=>{const K=M.length>0?M:H;A||N(K)}).catch(()=>{A||N(H)}),()=>{A=!0}},[d,o]);const s=ye(_);if(!s)return null;const P=ge(s,U),v=x?null:e(le,{num:r?F(r):void 0,title:me(t||s.heading,!1),description:c?F(c):void 0,accent:!0});if(!d)return o?e(z,{header:v,wheels:j.slice(0,L),columns:n,viewMore:P,cardImage:i,outline:m,indexBadge:p,showBadge:C,showCardPrice:y,showCardFinishes:a,showCardSizes:l,showCardBuy:u,showCardPage:f,coverIndex:h,imageBackground:g,spinOnHover:w}):null;if(!Ce(s,d.product.kind))return o?e(I,{className:"border-b border-line py-14 max-[1100px]:py-10",style:B(i),children:e("p",{className:`font-mono ${G.label} uppercase tracking-[0.18em] text-fg-dim`,children:T("“{relationship}” does not apply to this product. It is hidden on the live page.",{relationship:T(s.label)})})}):null;const b=s.resolve(d.product,d.relatedWheels);return b.kind==="tyre"?e(re,{omitHead:x,columns:n,cardImage:i,outline:m,indexBadge:p,num:r,title:t||s.heading,description:c,tyres:[...b.tyres].slice(0,L),footnote:E,footnoteLinkText:R,footnoteLinkHref:D,viewMore:P,editing:o}):b.wheels.length===0?o?O(I,{className:"border-b border-line py-[120px] max-[1100px]:py-20",style:B(i),children:[v,e("p",{className:`border-t border-line py-6 font-mono ${G.label} uppercase tracking-[0.18em] text-fg-dim`,children:T("Related products appear here on a product page.")})]}):null:e(z,{header:v,wheels:[...b.wheels].slice(0,L),columns:n,viewMore:P,cardImage:i,outline:m,indexBadge:p,showBadge:C,showCardPrice:y,showCardFinishes:a,showCardSizes:l,showCardBuy:u,showCardPage:f,coverIndex:h,imageBackground:g,spinOnHover:w})}function z({header:r,wheels:t,columns:c,viewMore:n,cardImage:S,outline:_,indexBadge:E,showBadge:R,showCardPrice:D,showCardFinishes:o,showCardSizes:x,showCardBuy:i,showCardPage:m,coverIndex:p,imageBackground:C,spinOnHover:y}){const a=W("rp");if(t.length===0)return null;const l=$[Math.min(4,Math.max(2,c))]??$[3],u=E??Q,f=ee(a,u),h=ae(a,l,{cards:t.length});return O(I,{className:"border-b border-line py-[120px] max-[1100px]:py-20",style:B(S),children:[f&&e("style",{children:f}),h&&e("style",{children:h}),r,e(se,{imageSizes:ne(l,t.length),imageBackgroundFill:Z(C,q),spinOnHover:y??!0,coverIndex:p??J,outline:_??Y,indexBadge:u,showBadge:R??!0,showCardPrice:D??!0,showCardFinishes:o??!0,showCardSizes:x??k.showCardSizes,showCardBuy:i??k.showCardBuy,showCardPage:m??k.showCardPage,children:e("div",{className:`${a} grid gap-[2px] ${te} bg-[var(--catalog-grid-bg)] ${l}`,style:ie("2px"),children:t.map((g,w)=>e(oe,{wheel:g,variant:"catalog"},`${g.slug}-${w}`))})}),e("div",{className:"mt-10 flex",children:e(de,{href:n.href,label:n.label})})]})}export{_e as RelatedProductsBody,Se as default,be as supportedKinds};
1
+ "use client";import{jsx as e,jsxs as F}from"react/jsx-runtime";import A from"../SectionBand.js";import{useScopeClass as W}from"../../lib/use-scope-class.js";import{GRID_CARD_SHOW as I}from"../../lib/sections/card-show-defaults.js";import{useEffect as V,useState as X}from"react";import{resolveCardImageBackground as Z,THEME_CARD_IMAGE_BG as q}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as B}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_COVER_INDEX as J}from"../../lib/wheels/cover-rendering.js";import{DEFAULT_CARD_INDEX_FORMAT as Q,DEFAULT_CARD_OUTLINE as Y,cardIndexCss as ee}from"efficient-web-builder/format/lib/sections/product-card-style";import re from"../CompatibleTyres.js";import oe from"../ProductCard.js";import{CARD_ROWS_GRID_CLASS as te,cardRowsGridStyle as ie}from"../WheelCardFrame.js";import{ProductCardChromeProvider as se}from"../ProductCardChrome.js";import{gridClassImageSizes as ae}from"../../lib/sections/card-image-sizes.js";import{fillRowCss as ne}from"../../lib/sections/fill-row.js";import le from"efficient-web-builder/render/components/SectionHeader";import de from"../ViewMoreLink.js";import{useSiteMenuLinks as ce}from"../catalog/SiteMenuLinks.js";import{renderGold as G,renderHeadline as me}from"efficient-web-builder/render/components/goldPhrases";import pe from"./KindGate.js";import{loadProductCatalog as ue}from"../useProductCatalog.js";import{PLP_KINDS as fe}from"../../lib/catalog/plp-item.js";import{relatedCardCount as he,relatedViewMore as ge}from"../../lib/catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as Ce,relationshipApplies as we,relationshipByKey as xe}from"../../lib/catalog/relationships.js";import{useCurrentProduct as ye}from"../../lib/document/current-product.js";import{PLACEHOLDER_RELATED as O}from"../../lib/wheels/placeholder-wheel.js";import{say as T}from"efficient-web-builder/format/lib/editor-words";const H={label:"text-[length:var(--size-label,13px)]"},ve=fe,$={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"};function be(r){return e(pe,{kinds:ve,type:"RelatedProducts",editing:r.editing,children:e(Se,{...r})})}function Se({num:r,title:t,description:c,columns:a=3,cardCount:b,relationship:S=Ce,footnote:_,footnoteLinkText:k,footnoteLinkHref:E,editing:o=!1,omitHead:C=!1,cardImage:i,outline:m,indexBadge:p,showBadge:w,showCardPrice:x,showCardFinishes:n,showCardSizes:l,showCardBuy:u,showCardPage:f,coverIndex:h,imageBackground:g,hover:y}){const d=ye(),U=ce(),R=he(b),[j,N]=X([]);V(()=>{if(d||!o)return;let P=!1;return ue().then(M=>{const K=M.length>0?M:O;P||N(K)}).catch(()=>{P||N(O)}),()=>{P=!0}},[d,o]);const s=xe(S);if(!s)return null;const D=ge(s,U),L=C?null:e(le,{num:r?G(r):void 0,title:me(t||s.heading,!1),description:c?G(c):void 0,accent:!0});if(!d)return o?e(z,{header:L,wheels:j.slice(0,R),columns:a,viewMore:D,cardImage:i,outline:m,indexBadge:p,showBadge:w,showCardPrice:x,showCardFinishes:n,showCardSizes:l,showCardBuy:u,showCardPage:f,coverIndex:h,imageBackground:g,hover:y}):null;if(!we(s,d.product.kind))return o?e(A,{className:"border-b border-line py-14 max-view-desktop:py-10",style:B(i),children:e("p",{className:`font-mono ${H.label} uppercase tracking-[0.18em] text-fg-dim`,children:T("“{relationship}” does not apply to this product. It is hidden on the live page.",{relationship:T(s.label)})})}):null;const v=s.resolve(d.product,d.relatedWheels);return v.kind==="tyre"?e(re,{omitHead:C,columns:a,cardImage:i,outline:m,indexBadge:p,num:r,title:t||s.heading,description:c,tyres:[...v.tyres].slice(0,R),footnote:_,footnoteLinkText:k,footnoteLinkHref:E,viewMore:D,editing:o}):v.wheels.length===0?o?F(A,{className:"border-b border-line py-[120px] max-view-desktop:py-20",style:B(i),children:[L,e("p",{className:`border-t border-line py-6 font-mono ${H.label} uppercase tracking-[0.18em] text-fg-dim`,children:T("Related products appear here on a product page.")})]}):null:e(z,{header:L,wheels:[...v.wheels].slice(0,R),columns:a,viewMore:D,cardImage:i,outline:m,indexBadge:p,showBadge:w,showCardPrice:x,showCardFinishes:n,showCardSizes:l,showCardBuy:u,showCardPage:f,coverIndex:h,imageBackground:g,hover:y})}function z({header:r,wheels:t,columns:c,viewMore:a,cardImage:b,outline:S,indexBadge:_,showBadge:k,showCardPrice:E,showCardFinishes:o,showCardSizes:C,showCardBuy:i,showCardPage:m,coverIndex:p,imageBackground:w,hover:x}){const n=W("rp");if(t.length===0)return null;const l=$[Math.min(4,Math.max(2,c))]??$[3],u=_??Q,f=ee(n,u),h=ne(n,l,{cards:t.length});return F(A,{className:"border-b border-line py-[120px] max-view-desktop:py-20",style:B(b),children:[f&&e("style",{children:f}),h&&e("style",{children:h}),r,e(se,{imageSizes:ae(l,t.length),imageBackgroundFill:Z(w,q),hover:x,coverIndex:p??J,outline:S??Y,indexBadge:u,showBadge:k??!0,showCardPrice:E??!0,showCardFinishes:o??!0,showCardSizes:C??I.showCardSizes,showCardBuy:i??I.showCardBuy,showCardPage:m??I.showCardPage,children:e("div",{className:`${n} grid gap-[2px] ${te} bg-[var(--catalog-grid-bg)] ${l}`,style:ie("2px"),children:t.map((g,y)=>e(oe,{wheel:g,variant:"catalog"},`${g.slug}-${y}`))})}),e("div",{className:"mt-10 flex",children:e(de,{href:a.href,label:a.label})})]})}export{Se as RelatedProductsBody,be as default,ve as supportedKinds};
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as d}from"react/jsx-runtime";import m from"../SectionBand.js";import b from"../SectionFootnote.js";import h from"efficient-web-builder/render/components/SectionHeader";import S from"../TyreCard.js";import{useCurrency as N}from"../CurrencyContext.js";import{renderGold as l,renderHeadline as z}from"efficient-web-builder/render/components/goldPhrases";import T from"./KindGate.js";import{useCurrentProduct as _}from"../../lib/document/current-product.js";import{TYRE_ILLUSTRATION_NOTE as k}from"../../lib/wheels/tyre-render.js";import{useSampleProduct as E}from"./useSampleProduct.js";import{say as A}from"efficient-web-builder/format/lib/editor-words";const u="border-b border-line py-[120px] max-[1100px]:py-20",f="border-b border-line pt-0 pb-[120px] max-[1100px]:pt-0 max-[1100px]:pb-20",B=[],P=["tyre"];function U(t){return r(T,{kinds:P,type:"TyreSizes",editing:t.editing,children:r(j,{...t})})}function j({num:t,title:s,description:o,editing:i=!1,omitHead:e=!1}){const n=_(),x=E(i&&!n),p=n?.product??x,c=p?.kind==="tyre"?p.source.variants:[],a=e?null:r(h,{num:t?l(t):void 0,title:z(s||"Available *sizes.*",!1),description:l(o||"Every size this tyre is made in, with its own price and stock."),accent:!0});if(c.length===0)return i?d(m,{className:e?f:u,children:[a,r("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:A("This product’s sizes appear here on a product page.")})]}):null;const y=c.some(g=>!g.image);return d(m,{className:e?f:u,children:[a,r(D,{variants:c,fieldUsage:n?.fieldUsage??B}),r(b,{text:y?k:""})]})}function D({variants:t,fieldUsage:s}){const{currency:o,formatPrice:i}=N();return r("div",{className:"grid grid-cols-3 gap-2 max-[1100px]:grid-cols-2 max-[720px]:grid-cols-1",children:t.map(e=>r(S,{fieldUsage:s,size:e.size,specs:e.specs,prices:e.prices,image:e.image,inStock:e.inStock,currency:o,formatPrice:i},e.sku))})}export{U as default,P as supportedKinds};
1
+ "use client";import{jsx as r,jsxs as p}from"react/jsx-runtime";import m from"../SectionBand.js";import b from"../SectionFootnote.js";import h from"efficient-web-builder/render/components/SectionHeader";import S from"../TyreCard.js";import{useCurrency as k}from"../CurrencyContext.js";import{renderGold as l,renderHeadline as N}from"efficient-web-builder/render/components/goldPhrases";import z from"./KindGate.js";import{useCurrentProduct as T}from"../../lib/document/current-product.js";import{TYRE_ILLUSTRATION_NOTE as w}from"../../lib/wheels/tyre-render.js";import{useSampleProduct as _}from"./useSampleProduct.js";import{say as v}from"efficient-web-builder/format/lib/editor-words";const u="border-b border-line py-[120px] max-view-desktop:py-20",f="border-b border-line pt-0 pb-[120px] max-view-desktop:pt-0 max-view-desktop:pb-20",E=[],A=["tyre"];function B(t){return r(z,{kinds:A,type:"TyreSizes",editing:t.editing,children:r(P,{...t})})}function P({num:t,title:s,description:o,editing:i=!1,omitHead:e=!1}){const n=T(),y=_(i&&!n),d=n?.product??y,c=d?.kind==="tyre"?d.source.variants:[],a=e?null:r(h,{num:t?l(t):void 0,title:N(s||"Available *sizes.*",!1),description:l(o||"Every size this tyre is made in, with its own price and stock."),accent:!0});if(c.length===0)return i?p(m,{className:e?f:u,children:[a,r("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:v("This product’s sizes appear here on a product page.")})]}):null;const x=c.some(g=>!g.image);return p(m,{className:e?f:u,children:[a,r(U,{variants:c,fieldUsage:n?.fieldUsage??E}),r(b,{text:x?w:""})]})}function U({variants:t,fieldUsage:s}){const{currency:o,formatPrice:i}=k();return r("div",{className:"grid grid-cols-3 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1",children:t.map(e=>r(S,{fieldUsage:s,size:e.size,specs:e.specs,prices:e.prices,image:e.image,inStock:e.inStock,currency:o,formatPrice:i},e.sku))})}export{B as default,A as supportedKinds};
@@ -1 +1 @@
1
- "use client";import{Fragment as a,jsx as n}from"react/jsx-runtime";import l from"../SectionBand.js";import{SECTION_LABELS as c}from"efficient-web-builder/format/lib/document/section-catalog";import{useCurrentProduct as d}from"../../lib/document/current-product.js";import{PLP_KIND_LABELS as m}from"../../lib/catalog/plp-item.js";import{say as r}from"efficient-web-builder/format/lib/editor-words";function u({kinds:e,type:o,editing:i=!1,children:s}){const t=d();return!t||e.includes(t.product.kind)?n(a,{children:s}):i?n(l,{className:"border-b border-line py-14 max-[1100px]:py-10",children:n("p",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:r("{section} does not apply to {kind}. It is hidden on the live page.",{section:r(c[o]??o),kind:p(t.product.kind)})})}):null}function p(e){switch(e){case"alloy-wheel":return r("Alloy wheels");case"tyre":return r("Tyres");default:return m[e]}}export{u as default};
1
+ "use client";import{Fragment as a,jsx as n}from"react/jsx-runtime";import l from"../SectionBand.js";import{SECTION_LABELS as d}from"efficient-web-builder/format/lib/document/section-catalog";import{useCurrentProduct as c}from"../../lib/document/current-product.js";import{PLP_KIND_LABELS as m}from"../../lib/catalog/plp-item.js";import{say as r}from"efficient-web-builder/format/lib/editor-words";function u({kinds:e,type:o,editing:i=!1,children:s}){const t=c();return!t||e.includes(t.product.kind)?n(a,{children:s}):i?n(l,{className:"border-b border-line py-14 max-view-desktop:py-10",children:n("p",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:r("{section} does not apply to {kind}. It is hidden on the live page.",{section:r(d[o]??o),kind:p(t.product.kind)})})}):null}function p(e){switch(e){case"alloy-wheel":return r("Alloy wheels");case"tyre":return r("Tyres");default:return m[e]}}export{u as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,Fragment as m,jsxs as c}from"react/jsx-runtime";import{useCallback as B,useRef as C,useState as E}from"react";import{sizedImage as M}from"efficient-web-builder/format/lib/sized-image";import P from"efficient-web-builder/render/components/Placeholder";import A,{LightboxClose as U,LIGHTBOX_CLOSE_TINT as z}from"../Lightbox.js";import{GALLERY_GRID_ATTR as L}from"../GalleryItem.js";const R="(max-width: 1600px) 100vw, 1600px",G="(max-width: 1100px) 100vw, 50vw",D="(max-width: 800px) 30vw, 200px",H="100vw";function b(r,l){return r.video?l?`Play video of ${l}`:"Play video":l?`Open photo of ${l}`:"Open photo"}function Z({small:r=!1}){return t("span",{"aria-hidden":!0,"data-play-badge":"",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:t("span",{className:`flex items-center justify-center rounded-full bg-bg/75 text-fg ${r?"h-8 w-8 text-[length:12px]":"h-16 w-16 text-[length:22px]"}`,children:"▶"})})}const F="relative block w-full overflow-hidden bg-surface-2",X="block h-[min(78vh,820px)] w-full object-cover max-[800px]:h-[min(70vh,560px)]",W="block aspect-[4/5] max-h-[80vh] w-full object-cover",q="grid grid-cols-4 gap-2",Y="relative block aspect-square w-full overflow-hidden bg-surface-2",I="block h-full w-full object-cover",J="grid grid-cols-6 gap-2 max-[800px]:grid-cols-4",K={3:"grid grid-cols-3 gap-2 max-[800px]:grid-cols-2",4:"grid grid-cols-4 gap-2 max-[800px]:grid-cols-2"},Q="relative block aspect-[4/5] w-full overflow-hidden bg-surface-2",V="(max-width: 800px) 50vw, 25vw",ee="cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",$="absolute top-1/2 z-[2] flex h-14 w-14 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,22px)] text-fg-dim transition-colors hover:border-accent hover:text-accent max-[700px]:h-11 max-[700px]:w-11";function te({pictures:r,name:l,editing:g=!1,fit:v="section",across:S=4}){const[j,w]=E(!1),[i,f]=E(0),x=C(null),O=B(e=>{e?x.current=e:(x.current?.pause(),x.current=null)},[]),o=r.length,y=v==="column";if(o===0)return null;const _=()=>f(e=>(e-1+o)%o),N=()=>f(e=>(e+1)%o),T=e=>{f(e),w(!0)},a=r[Math.min(i,o-1)],d=(e,s,n,p)=>e.url?t("span",{className:`${n} relative`,children:t(P,{label:e.alt||l||"photo",src:e.url,alt:e.alt||l,sizes:s,objectFit:"cover",showBackground:!1})}):t("span",{"aria-hidden":!0,className:`${n} bg-surface-2`}),u=v==="tiles",h=(e,s,n)=>{const p=c(m,{children:[u?d(e,V,I,800):n?y?d(e,G,W,1200):d(e,R,X,1600):d(e,D,I,400),e.video&&t(Z,{small:!n&&!u})]}),k=u?Q:n?F:Y;return g?t("div",{className:k,children:p}):t("button",{type:"button","aria-label":b(e,l),onClick:()=>T(s),className:`${k} ${ee}`,children:p})};return c(m,{children:[u?t("ul",{[L]:"","data-record-gallery":"tiles",className:K[S===3?3:4],children:r.map((e,s)=>t("li",{children:h(e,s,!1)},`${e.url}-${s}`))}):c("div",{[L]:"","data-record-gallery":"",className:"flex flex-col gap-2",children:[h(r[0],0,!0),o>1&&t("ul",{className:y?q:J,children:r.slice(1).map((e,s)=>t("li",{children:h(e,s+1,!1)},`${e.url}-${s+1}`))})]}),!g&&t(A,{open:j,onClose:()=>w(!1),label:b(a,l),onPrev:o>1?_:void 0,onNext:o>1?N:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:c("div",{onClick:e=>e.stopPropagation(),className:"relative flex h-full w-full items-center justify-center",children:[t(U,{className:"absolute right-0 top-0 z-[3] flex h-12 w-12 cursor-pointer items-center justify-center border border-line font-mono text-[length:var(--size-label,18px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:z},children:"✕"}),a.video?t("video",{ref:O,controls:!0,playsInline:!0,preload:"metadata",poster:a.url,src:a.video,"aria-label":b(a,l),className:"block max-h-[calc(100vh-120px)] max-w-full bg-bg"},`video-${i}`):t("img",{...M(a.url,{fallbackWidth:1600}),sizes:H,alt:`${a.alt||l||"Photo"} — ${i+1} of ${o}`,className:"block max-h-[calc(100vh-120px)] max-w-full object-contain"},`photo-${i}`),o>1&&c(m,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:_,className:`${$} left-0`,children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:N,className:`${$} right-0`,children:"▷"}),c("span",{"data-gallery-counter":"",className:"absolute bottom-0 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[i+1," / ",o]})]})]})})]})}export{te as default,b as pictureLabel};
1
+ "use client";import{jsx as t,Fragment as b,jsxs as c}from"react/jsx-runtime";import{useCallback as B,useRef as C,useState as E}from"react";import{sizedImage as M}from"efficient-web-builder/format/lib/sized-image";import P from"efficient-web-builder/render/components/Placeholder";import A,{LightboxClose as U,LIGHTBOX_CLOSE_TINT as z}from"../Lightbox.js";import{GALLERY_GRID_ATTR as L}from"../GalleryItem.js";const R="(max-width: 1600px) 100vw, 1600px",G="(max-width: 1100px) 100vw, 50vw",D="(max-width: 800px) 30vw, 200px",H="100vw";function p(r,l){return r.video?l?`Play video of ${l}`:"Play video":l?`Open photo of ${l}`:"Open photo"}function Z({small:r=!1}){return t("span",{"aria-hidden":!0,"data-play-badge":"",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:t("span",{className:`flex items-center justify-center rounded-full bg-bg/75 text-fg ${r?"h-8 w-8 text-[length:12px]":"h-16 w-16 text-[length:22px]"}`,children:"▶"})})}const F="relative block w-full overflow-hidden bg-surface-2",X="block h-[min(78vh,820px)] w-full object-cover max-view-wide:h-[min(70vh,560px)]",W="block aspect-[4/5] max-h-[80vh] w-full object-cover",q="grid grid-cols-4 gap-2",Y="relative block aspect-square w-full overflow-hidden bg-surface-2",I="block h-full w-full object-cover",J="grid grid-cols-6 gap-2 max-view-wide:grid-cols-4",K={3:"grid grid-cols-3 gap-2 max-view-wide:grid-cols-2",4:"grid grid-cols-4 gap-2 max-view-wide:grid-cols-2"},Q="relative block aspect-[4/5] w-full overflow-hidden bg-surface-2",V="(max-width: 800px) 50vw, 25vw",ee="cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",$="absolute top-1/2 z-[2] flex h-14 w-14 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,22px)] text-fg-dim transition-colors hover:border-accent hover:text-accent max-[700px]:h-11 max-[700px]:w-11";function te({pictures:r,name:l,editing:g=!1,fit:v="section",across:S=4}){const[j,w]=E(!1),[i,f]=E(0),h=C(null),O=B(e=>{e?h.current=e:(h.current?.pause(),h.current=null)},[]),o=r.length,y=v==="column";if(o===0)return null;const _=()=>f(e=>(e-1+o)%o),N=()=>f(e=>(e+1)%o),T=e=>{f(e),w(!0)},a=r[Math.min(i,o-1)],d=(e,s,n,m)=>e.url?t("span",{className:`${n} relative`,children:t(P,{label:e.alt||l||"photo",src:e.url,alt:e.alt||l,sizes:s,objectFit:"cover",showBackground:!1})}):t("span",{"aria-hidden":!0,className:`${n} bg-surface-2`}),u=v==="tiles",x=(e,s,n)=>{const m=c(b,{children:[u?d(e,V,I,800):n?y?d(e,G,W,1200):d(e,R,X,1600):d(e,D,I,400),e.video&&t(Z,{small:!n&&!u})]}),k=u?Q:n?F:Y;return g?t("div",{className:k,children:m}):t("button",{type:"button","aria-label":p(e,l),onClick:()=>T(s),className:`${k} ${ee}`,children:m})};return c(b,{children:[u?t("ul",{[L]:"","data-record-gallery":"tiles",className:K[S===3?3:4],children:r.map((e,s)=>t("li",{children:x(e,s,!1)},`${e.url}-${s}`))}):c("div",{[L]:"","data-record-gallery":"",className:"flex flex-col gap-2",children:[x(r[0],0,!0),o>1&&t("ul",{className:y?q:J,children:r.slice(1).map((e,s)=>t("li",{children:x(e,s+1,!1)},`${e.url}-${s+1}`))})]}),!g&&t(A,{open:j,onClose:()=>w(!1),label:p(a,l),onPrev:o>1?_:void 0,onNext:o>1?N:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:c("div",{onClick:e=>e.stopPropagation(),className:"relative flex h-full w-full items-center justify-center",children:[t(U,{className:"absolute right-0 top-0 z-[3] flex h-12 w-12 cursor-pointer items-center justify-center border border-line font-mono text-[length:var(--size-label,18px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:z},children:"✕"}),a.video?t("video",{ref:O,controls:!0,playsInline:!0,preload:"metadata",poster:a.url,src:a.video,"aria-label":p(a,l),className:"block max-h-[calc(100vh-120px)] max-w-full bg-bg"},`video-${i}`):t("img",{...M(a.url,{fallbackWidth:1600}),sizes:H,alt:`${a.alt||l||"Photo"} — ${i+1} of ${o}`,className:"block max-h-[calc(100vh-120px)] max-w-full object-contain"},`photo-${i}`),o>1&&c(b,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:_,className:`${$} left-0`,children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:N,className:`${$} right-0`,children:"▷"}),c("span",{"data-gallery-counter":"",className:"absolute bottom-0 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[i+1," / ",o]})]})]})})]})}export{te as default,p as pictureLabel};
@@ -1,4 +1,5 @@
1
1
  import { type CardImageBackground } from "efficient-web-builder/format/lib/content/card-image-background";
2
+ import type { CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
2
3
  import { type CardIndexFormat, type CardOutline } from "efficient-web-builder/format/lib/sections/product-card-style";
3
4
  import { type FieldUsageAnswer } from "../../lib/content/field-usage.js";
4
5
  import type { ProductSummary, WheelSummary } from "../../lib/api/index.js";
@@ -25,7 +26,7 @@ export interface AlloyWheelsListingProps {
25
26
  editing?: boolean;
26
27
  coverIndex?: number;
27
28
  cardImage?: number | null;
28
- spinOnHover?: boolean;
29
+ hover?: CardHoverDrawn;
29
30
  imageBackground?: CardImageBackground;
30
31
  showBadge?: boolean;
31
32
  showCardSizes?: boolean;
@@ -40,4 +41,4 @@ export declare const PLP_GATE_DEFAULTS: {
40
41
  readonly heading: "Let's find wheels that fit your car.";
41
42
  readonly intro: "Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you.";
42
43
  };
43
- export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing, coverIndex, cardImage, spinOnHover, imageBackground, showBadge, showCardSizes, showCardBuy, showCardPage, showCardPrice, showCardFinishes, outline, indexBadge, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
44
+ export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, products, wheels, requestQuery, editing, coverIndex, cardImage, hover, imageBackground, showBadge, showCardSizes, showCardBuy, showCardPage, showCardPrice, showCardFinishes, outline, indexBadge, titleLevel, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as s,Fragment as se}from"react/jsx-runtime";import{LISTING_CARD_SHOW as I}from"../../lib/sections/card-show-defaults.js";import{useScopeClass as Qe}from"../../lib/use-scope-class.js";import{useCallback as m,useEffect as Ze,useMemo as l,useRef as et,useState as tt}from"react";import{CARD_IMAGE_BG_OFF as ot,resolveCardImageBackground as rt}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as nt}from"efficient-web-builder/format/lib/content/card-image-shape";import{cardIndexCss as st,DEFAULT_CARD_INDEX_FORMAT as it,DEFAULT_CARD_OUTLINE as lt}from"efficient-web-builder/format/lib/sections/product-card-style";import{answersForKind as ie}from"../../lib/content/field-usage.js";import{useCurrency as at}from"../CurrencyContext.js";import ct from"../NoCurrencyNote.js";import{usePreviewDevice as pt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as mt,renderHeadline as dt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as ht}from"../useProductCatalog.js";import{scrollBehavior as ut}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as ft,PLP_GRID_GAP_VAR as gt,plpGridVars as yt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as xt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as St,cardRowsGridStyle as wt}from"../WheelCardFrame.js";import{applyPlpFilters as bt,asPlpSortKey as Ct,buildPlpFacets as Nt,buildPlpTypeOptions as vt,buildTyreSizeBoxes as Pt,EMPTY_PLP_FILTERS as le,hasActivePlpFilters as kt,paginatePlp as _t,pickTyreSize as Tt,plpTyreSizeBoxesShown as At,plpInStockCount as zt,plpOpeningSort as Ft,plpPriceBounds as Ot,plpShownKinds as Bt,plpSortKeysFor as It,PLP_SORT_LABELS as Lt}from"../../lib/wheels/plp-filters.js";import{itemKind as z,itemSlug as L,itemTyreSizes as Vt,plpBrandVaries as Rt,plpProcessVaries as Et,plpItemsOfKinds as Dt,plpKindNoun as V,resolvePlpKinds as Kt}from"../../lib/catalog/plp-item.js";import{plpGateWords as jt,plpVehicleCopy as Gt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Mt,oemTyreSizes as $t}from"../../lib/tyres/tyre-vehicle-fitment.js";import Wt from"../TyreSummaryCard.js";import{wheelsFittingVehicle as Ht}from"../../lib/wheels/plp-fitment-match.js";import Ut from"./PlpActiveChips.js";import{DEFAULT_COVER_INDEX as Xt}from"../../lib/wheels/cover-rendering.js";import Yt from"./PlpCard.js";import qt from"./PlpPagination.js";import Jt from"./PlpSidebar.js";import Qt from"./PlpVehicleBar.js";import Zt from"./PlpVehicleGate.js";import{useVehicleCatalog as eo}from"./useVehicleCatalog.js";import{useVehicleFit as to}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as oo}from"./usePlpFiltersInUrl.js";import{say as R}from"efficient-web-builder/format/lib/editor-words";const jo={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function ro({level:C,className:N,children:v}){return r(C===2?"h2":"h1",{className:N,children:v})}const no=[];function so({heading:C="",intro:N="",askForCar:v=!0,gateHeading:E="",gateIntro:ae="",perPage:D=24,columns:ce,defaultSort:pe="recommended",hiddenFacets:me=[],fieldUsage:g=no,showPrice:K=!0,showInStock:de=!0,kinds:he,products:ue,wheels:fe,requestQuery:ge,editing:d=!1,coverIndex:ye=Xt,cardImage:xe,spinOnHover:Se=!1,imageBackground:we,showBadge:be=!0,showCardSizes:Ce,showCardBuy:Ne,showCardPage:ve,showCardPrice:Pe,showCardFinishes:ke,outline:_e=lt,indexBadge:j=it,titleLevel:Te}){const{currency:a}=at(),Ae=rt(we,ot),h=Kt(he),G=pt(),M=ft(ce),ze=yt(M,d?G:null),Fe=xt(M,d?G:null),$=Qe("plp"),F=st($,j),Oe=ht(),W=ue??fe??Oe??[],H=l(()=>Dt(W,h),[W,h.join(",")]),o=to({editing:d,enabled:v,autoApply:!0}),[Be,O]=tt(!1),Ie=Ft(pe,h),y=o.applied?.vehicle??null,[t,w]=oo({editing:d,openingSort:Ie,appliedVehicle:y,vehicleRestored:o.restored,requestQuery:ge}),p=Bt(h,t.kind),i=m(e=>w(e),[w]),U=m((e,u)=>{const c=t[e],qe=c.map(String).includes(u)?c.filter(Je=>String(Je)!==u):[...c,e==="diameters"?Number(u):u];i({...t,[e]:qe,page:1})},[t,i]),X=m(e=>i({...t,priceMax:e,page:1}),[t,i]),Y=m(e=>i({...t,inStockOnly:e,page:1}),[t,i]),q=m(e=>i({...le,kind:e,inStockOnly:t.inStockOnly,priceMax:t.priceMax,sort:t.sort}),[t.inStockOnly,t.priceMax,t.sort,i]),Le=m(e=>i({...t,sort:e,page:1}),[t,i]),Ve=m(e=>{i({...t,page:e}),typeof window<"u"&&window.scrollTo({top:0,behavior:ut()})},[t,i]),J=m(()=>i({...le,sort:t.sort}),[t.sort,i]),{clear:k}=o,Q=m(()=>{k(),O(!0),w(e=>({...e,page:1}))},[k]),Re=m(()=>{k(),O(!1),w(e=>({...e,page:1}))},[k]),_=y?[y.make,y.model,y.year,y.modification].join("|"):"",T=et(null);Ze(()=>{if(o.restored){if(T.current===null){T.current=_;return}T.current!==_&&(T.current=_,w(e=>e.page===1?e:{...e,page:1}))}},[o.restored,_,w]);const A=eo({catalog:H,shownKinds:h,vehicle:y,editing:d}),n=l(()=>{if(!o.fit)return A;const e=A.filter(c=>z(c)==="alloy-wheel"),u=new Set(Ht(e,o.fit).map(c=>c.slug));return A.filter(c=>z(c)!=="alloy-wheel"||u.has(L(c)))},[A,o.fit]),b=me.join(","),Ee=l(()=>{const e=new Set(b?b.split(","):[]);return Nt(n,t,a,p,g).filter(u=>!e.has(u.key))},[n,t,a,b,p.join(","),g]),x=l(()=>bt(n,t,a),[n,t,a]),Z=p.length>1,De=l(()=>ie(g,"alloy-wheel"),[g]),Ke=l(()=>ie(g,"tyre"),[g]),ee=l(()=>Rt(x),[x]),je=l(()=>Et(x),[x]),Ge=l(()=>K?Ot(n,a):null,[n,a,K]),Me=l(()=>zt(n,t,a),[n,t,a]),$e=l(()=>vt(n,h,t,a),[n,h.join(","),t,a]),We=m((e,u)=>{const c=Tt(n.flatMap(Vt),t.tyreSizes[0]??"",e,u);i({...t,tyreSizes:c?[c]:[],page:1})},[n,t,i]),He=l(()=>{const e=new Set(b?b.split(","):[]);return!At(n,p)||e.has("tyreSizes")?null:Pt(n,t,a)},[n,t,a,b,p.join(","),g]),f=l(()=>_t(x,t.page,D),[x,t.page,D]),S=V(p),B=Gt(p),te=jt(E,ae,p,h),oe=p.length===1&&p[0]==="tyre",re=o.applied?.stock??null,P=l(()=>$t(re),[re]),Ue=l(()=>n.filter(e=>p.includes(z(e))).length,[n,p.join(",")]),ne=H.length===0,Xe=!ne&&n.length===0,Ye=v&&!d&&!o.applied&&!Be;return h.length===0?null:s("section",{style:nt(xe),children:[v&&r(Qt,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:oe&&P.length>0?`Takes ${P.join(" · ")}`:null,resolving:o.resolving,unresolved:oe?!!o.applied&&!o.resolving&&P.length===0:o.unresolved,matchCount:Ue,copy:B,onAmend:Re,onClear:Q}),Ye&&r(Zt,{cascade:o.cascade,heading:te.heading,intro:te.intro,ready:o.restored,copy:B,onSkip:()=>O(!0)}),s("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(C||N)&&s("header",{className:"mb-6",children:[C&&r(ro,{level:Te,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:dt(C,!1)}),N&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:mt(N)})]}),s("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(Jt,{facets:Ee,filters:t,typeOptions:$e,sizeBoxes:He,sizeMatches:t.tyreSizes.length>0?x.length:null,noun:S,priceBounds:Ge,inStockCount:de?Me:null,onToggle:U,onPickType:q,onPickSize:We,onPriceMax:X,onInStockOnly:Y,onClearAll:J}),s("div",{className:"min-w-0 flex-1",children:[s("div",{className:"mb-4 flex min-h-[34px] flex-wrap items-center justify-between gap-x-4 gap-y-2 border-b border-line pb-3",children:[s("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-4 gap-y-2",children:[r("p",{className:"font-mono text-[12px] tabular-nums tracking-[0.08em]",children:f.total===0?s("span",{className:"text-fg-dim",children:["No ",S.many]}):s(se,{children:[s("span",{children:[f.from,"–",f.to]}),s("span",{className:"text-fg-dim",children:[" of ",f.total," ",S.many]})]})}),r(Ut,{filters:t,onToggle:U,onPriceMax:X,onInStockOnly:Y,onPickType:q})]}),s("label",{className:"flex items-center gap-2 font-mono text-[11px] uppercase tracking-[0.16em] text-fg-dim",children:["Sort by",r("select",{value:t.sort,onChange:e=>Le(Ct(e.target.value)),className:"cursor-pointer border border-line bg-transparent px-2 py-2 font-mono text-[12px] normal-case tracking-normal text-fg",children:It(h).map(e=>r("option",{value:e,children:Lt[e]},e))})]})]}),ne?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:d?S.many==="wheels"?R("No wheels in this website's catalog yet — curate products to see them here."):S.many==="tyres"?R("No tyres in this website's catalog yet — curate products to see them here."):R("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):Xe?s("div",{className:"border border-line p-10",children:[s("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:B.nothingFits}),s("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",S.many]})]}):f.total===0?s("div",{className:"border border-line p-10",children:[s("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",S.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),kt(t)&&r("button",{type:"button",onClick:J,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):s(se,{children:[F&&r("style",{children:F}),r("div",{className:`${F?`${$} plp-card-grid`:"plp-card-grid"} ${St}`,style:{...ze,...wt(`var(${gt})`)},children:f.items.map(e=>z(e)==="tyre"?r(Wt,{item:e,currency:a,fitSize:P.length>0?Mt(e.sizes,P):null,kindLabel:Z?V(["tyre"]).one:null,showBrand:ee,editing:d,fieldUsage:Ke},`tyre:${L(e)}`):r(Yt,{wheel:e,colours:t.finishes,fit:o.fit,editing:d,kindLabel:Z?V(["alloy-wheel"]).one:null,showBrand:ee,coverIndex:ye,fieldUsage:De,showProcess:je,spinOnHover:Se,imageBackgroundFill:Ae,showBadge:be,outline:_e,indexBadge:j,showCardSizes:Ce??I.showCardSizes,showCardBuy:Ne??I.showCardBuy,showCardPage:ve??I.showCardPage,showCardPrice:Pe??!0,showCardFinishes:ke??!0,imageSizes:Fe},`wheel:${L(e)}`))})]}),r(qt,{page:f.page,pageCount:f.pageCount,onPage:Ve}),r(ct,{editing:d})]})]})]})]})}export{jo as PLP_GATE_DEFAULTS,so as default};
1
+ "use client";import{jsx as r,jsxs as p,Fragment as se}from"react/jsx-runtime";import{LISTING_CARD_SHOW as O}from"../../lib/sections/card-show-defaults.js";import{useScopeClass as Qe}from"../../lib/use-scope-class.js";import{useCallback as d,useEffect as Ze,useMemo as i,useRef as et,useState as tt}from"react";import{CARD_IMAGE_BG_OFF as ot,resolveCardImageBackground as rt}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as nt}from"efficient-web-builder/format/lib/content/card-image-shape";import{cardIndexCss as st,DEFAULT_CARD_INDEX_FORMAT as it,DEFAULT_CARD_OUTLINE as lt}from"efficient-web-builder/format/lib/sections/product-card-style";import{answersForKind as ie}from"../../lib/content/field-usage.js";import{useCurrency as at}from"../CurrencyContext.js";import ct from"../NoCurrencyNote.js";import{usePreviewDevice as pt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as dt,renderHeadline as mt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as ht}from"../useProductCatalog.js";import{scrollBehavior as ut}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as ft,PLP_GRID_GAP_VAR as gt,plpGridVars as yt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as St}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as xt,cardRowsGridStyle as wt}from"../WheelCardFrame.js";import{applyPlpFilters as bt,buildPlpFacets as Ct,buildPlpTypeOptions as Pt,buildTyreSizeBoxes as kt,EMPTY_PLP_FILTERS as le,hasActivePlpFilters as vt,paginatePlp as Nt,pickTyreSize as Tt,plpTyreSizeBoxesShown as _t,plpInStockCount as At,plpOpeningSort as zt,plpPriceBounds as Ft,plpShownKinds as Bt,plpSortKeysFor as It,PLP_SORT_LABELS as Ot}from"../../lib/wheels/plp-filters.js";import{itemKind as z,itemSlug as R,itemTyreSizes as Rt,plpBrandVaries as Lt,plpProcessVaries as Vt,plpItemsOfKinds as Et,plpKindNoun as L,resolvePlpKinds as Dt}from"../../lib/catalog/plp-item.js";import{plpGateWords as Gt,plpVehicleCopy as Kt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as jt,oemTyreSizes as Mt}from"../../lib/tyres/tyre-vehicle-fitment.js";import $t from"../TyreSummaryCard.js";import{wheelsFittingVehicle as Wt}from"../../lib/wheels/plp-fitment-match.js";import Ut from"./PlpActiveChips.js";import{DEFAULT_COVER_INDEX as Ht}from"../../lib/wheels/cover-rendering.js";import Xt from"./PlpCard.js";import Yt from"./PlpPagination.js";import qt from"./PlpSidebar.js";import{PlpResultRange as Jt,PlpToolbar as Qt}from"./PlpToolbar.js";import Zt from"../catalog/SortSelect.js";import eo from"./PlpVehicleBar.js";import to from"./PlpVehicleGate.js";import{useVehicleCatalog as oo}from"./useVehicleCatalog.js";import{useVehicleFit as ro}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as no}from"./usePlpFiltersInUrl.js";import{say as V}from"efficient-web-builder/format/lib/editor-words";const Wo={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function so({level:C,className:P,children:k}){return r(C===2?"h2":"h1",{className:P,children:k})}const io=[];function lo({heading:C="",intro:P="",askForCar:k=!0,gateHeading:E="",gateIntro:ae="",perPage:D=24,columns:ce,defaultSort:pe="recommended",hiddenFacets:de=[],fieldUsage:f=io,showPrice:G=!0,showInStock:me=!0,kinds:he,products:ue,wheels:fe,requestQuery:ge,editing:m=!1,coverIndex:ye=Ht,cardImage:Se,hover:xe,imageBackground:we,showBadge:be=!0,showCardSizes:Ce,showCardBuy:Pe,showCardPage:ke,showCardPrice:ve,showCardFinishes:Ne,outline:Te=lt,indexBadge:K=it,titleLevel:_e}){const{currency:l}=at(),Ae=rt(we,ot),h=Dt(he),j=pt(),M=ft(ce),ze=yt(M,m?j:null),Fe=St(M,m?j:null),$=Qe("plp"),F=st($,K),Be=ht(),W=ue??fe??Be??[],U=i(()=>Et(W,h),[W,h.join(",")]),o=ro({editing:m,enabled:k,autoApply:!0}),[Ie,B]=tt(!1),Oe=zt(pe,h),g=o.applied?.vehicle??null,[e,x]=no({editing:m,openingSort:Oe,appliedVehicle:g,vehicleRestored:o.restored,requestQuery:ge}),c=Bt(h,e.kind),s=d(t=>x(t),[x]),H=d((t,u)=>{const a=e[t],qe=a.map(String).includes(u)?a.filter(Je=>String(Je)!==u):[...a,t==="diameters"?Number(u):u];s({...e,[t]:qe,page:1})},[e,s]),X=d(t=>s({...e,priceMax:t,page:1}),[e,s]),Y=d(t=>s({...e,inStockOnly:t,page:1}),[e,s]),q=d(t=>s({...le,kind:t,inStockOnly:e.inStockOnly,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMax,e.sort,s]),Re=d(t=>s({...e,sort:t,page:1}),[e,s]),Le=d(t=>{s({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:ut()})},[e,s]),J=d(()=>s({...le,sort:e.sort}),[e.sort,s]),{clear:N}=o,Q=d(()=>{N(),B(!0),x(t=>({...t,page:1}))},[N]),Ve=d(()=>{N(),B(!1),x(t=>({...t,page:1}))},[N]),T=g?[g.make,g.model,g.year,g.modification].join("|"):"",_=et(null);Ze(()=>{if(o.restored){if(_.current===null){_.current=T;return}_.current!==T&&(_.current=T,x(t=>t.page===1?t:{...t,page:1}))}},[o.restored,T,x]);const A=oo({catalog:U,shownKinds:h,vehicle:g,editing:m}),n=i(()=>{if(!o.fit)return A;const t=A.filter(a=>z(a)==="alloy-wheel"),u=new Set(Wt(t,o.fit).map(a=>a.slug));return A.filter(a=>z(a)!=="alloy-wheel"||u.has(R(a)))},[A,o.fit]),w=de.join(","),Ee=i(()=>{const t=new Set(w?w.split(","):[]);return Ct(n,e,l,c,f).filter(u=>!t.has(u.key))},[n,e,l,w,c.join(","),f]),y=i(()=>bt(n,e,l),[n,e,l]),Z=c.length>1,De=i(()=>ie(f,"alloy-wheel"),[f]),Ge=i(()=>ie(f,"tyre"),[f]),ee=i(()=>Lt(y),[y]),Ke=i(()=>Vt(y),[y]),je=i(()=>G?Ft(n,l):null,[n,l,G]),Me=i(()=>At(n,e,l),[n,e,l]),$e=i(()=>Pt(n,h,e,l),[n,h.join(","),e,l]),We=d((t,u)=>{const a=Tt(n.flatMap(Rt),e.tyreSizes[0]??"",t,u);s({...e,tyreSizes:a?[a]:[],page:1})},[n,e,s]),Ue=i(()=>{const t=new Set(w?w.split(","):[]);return!_t(n,c)||t.has("tyreSizes")?null:kt(n,e,l)},[n,e,l,w,c.join(","),f]),S=i(()=>Nt(y,e.page,D),[y,e.page,D]),b=L(c),I=Kt(c),te=Gt(E,ae,c,h),oe=c.length===1&&c[0]==="tyre",re=o.applied?.stock??null,v=i(()=>Mt(re),[re]),He=i(()=>n.filter(t=>c.includes(z(t))).length,[n,c.join(",")]),ne=U.length===0,Xe=!ne&&n.length===0,Ye=k&&!m&&!o.applied&&!Ie;return h.length===0?null:p("section",{style:nt(Se),children:[k&&r(eo,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:oe&&v.length>0?`Takes ${v.join(" · ")}`:null,resolving:o.resolving,unresolved:oe?!!o.applied&&!o.resolving&&v.length===0:o.unresolved,matchCount:He,copy:I,onAmend:Ve,onClear:Q}),Ye&&r(to,{cascade:o.cascade,heading:te.heading,intro:te.intro,ready:o.restored,copy:I,onSkip:()=>B(!0)}),p("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(C||P)&&p("header",{className:"mb-6",children:[C&&r(so,{level:_e,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:mt(C,!1)}),P&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:dt(P)})]}),p("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(qt,{facets:Ee,filters:e,typeOptions:$e,sizeBoxes:Ue,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:b,priceBounds:je,inStockCount:me?Me:null,onToggle:H,onPickType:q,onPickSize:We,onPriceMax:X,onInStockOnly:Y,onClearAll:J}),p("div",{className:"min-w-0 flex-1",children:[r(Qt,{className:"mb-4",start:p(se,{children:[r(Jt,{total:S.total,range:{from:S.from,to:S.to},noun:b}),r(Ut,{filters:e,onToggle:H,onPriceMax:X,onInStockOnly:Y,onPickType:q})]}),end:r(Zt,{value:e.sort,keys:It(h),labels:Ot,onChange:Re})}),ne?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:m?b.many==="wheels"?V("No wheels in this website's catalog yet — curate products to see them here."):b.many==="tyres"?V("No tyres in this website's catalog yet — curate products to see them here."):V("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):Xe?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:I.nothingFits}),p("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",b.many]})]}):S.total===0?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",b.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),vt(e)&&r("button",{type:"button",onClick:J,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):p(se,{children:[F&&r("style",{children:F}),r("div",{className:`${F?`${$} plp-card-grid`:"plp-card-grid"} ${xt}`,style:{...ze,...wt(`var(${gt})`)},children:S.items.map(t=>z(t)==="tyre"?r($t,{item:t,currency:l,fitSize:v.length>0?jt(t.sizes,v):null,kindLabel:Z?L(["tyre"]).one:null,showBrand:ee,editing:m,fieldUsage:Ge},`tyre:${R(t)}`):r(Xt,{wheel:t,colours:e.finishes,fit:o.fit,editing:m,kindLabel:Z?L(["alloy-wheel"]).one:null,showBrand:ee,coverIndex:ye,fieldUsage:De,showProcess:Ke,hover:xe,imageBackgroundFill:Ae,showBadge:be,outline:Te,indexBadge:K,showCardSizes:Ce??O.showCardSizes,showCardBuy:Pe??O.showCardBuy,showCardPage:ke??O.showCardPage,showCardPrice:ve??!0,showCardFinishes:Ne??!0,imageSizes:Fe},`wheel:${R(t)}`))})]}),r(Yt,{page:S.page,pageCount:S.pageCount,onPage:Le}),r(ct,{editing:m})]})]})]})]})}export{Wo as PLP_GATE_DEFAULTS,lo as default};
@@ -1,3 +1,4 @@
1
+ import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
1
2
  import type { WheelSummary } from "../../lib/api/index.js";
2
3
  import { type CardIndexFormat, type CardOutline } from "efficient-web-builder/format/lib/sections/product-card-style";
3
4
  import type { FieldUsageAnswer } from "../../lib/content/field-usage.js";
@@ -13,7 +14,7 @@ export interface PlpCardProps {
13
14
  showProcess?: boolean;
14
15
  coverIndex?: number;
15
16
  fieldUsage?: readonly FieldUsageAnswer[];
16
- spinOnHover?: boolean;
17
+ hover?: CardHoverDrawn;
17
18
  imageBackgroundFill?: string;
18
19
  showBadge?: boolean;
19
20
  outline?: CardOutline;
@@ -25,4 +26,4 @@ export interface PlpCardProps {
25
26
  showCardFinishes?: boolean;
26
27
  imageSizes?: string;
27
28
  }
28
- export default function PlpCard({ wheel, colours, fit, editing, brandPlate, kindLabel, showBrand, showProcess, coverIndex, fieldUsage, spinOnHover, imageBackgroundFill, showBadge, outline, indexBadge, showCardSizes, showCardBuy, showCardPage, showCardPrice, showCardFinishes, imageSizes, }: PlpCardProps): import("react").JSX.Element;
29
+ export default function PlpCard({ wheel, colours, fit, editing, brandPlate, kindLabel, showBrand, showProcess, coverIndex, fieldUsage, hover, imageBackgroundFill, showBadge, outline, indexBadge, showCardSizes, showCardBuy, showCardPage, showCardPrice, showCardFinishes, imageSizes, }: PlpCardProps): import("react").JSX.Element;