efficient-storefront-blocks 0.125.5 → 0.125.6

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 (104) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/chunks/CustomHtmlCodeWindow-KAHNIUZO.js +26 -0
  3. package/dist/chunks/{EditorPreviewCheckout-3ZX2DIIL.js → EditorPreviewCheckout-M5LLO3H2.js} +1 -1
  4. package/dist/chunks/SiteEditorProvider-6P7LYLL2.js +1 -0
  5. package/dist/chunks/{chunk-5SWY36EZ.js → chunk-4SIPG47B.js} +1 -1
  6. package/dist/chunks/chunk-7ARO3R4C.js +9 -0
  7. package/dist/chunks/chunk-7SLHEYYR.js +337 -0
  8. package/dist/chunks/chunk-COR5IL6E.js +2 -0
  9. package/dist/chunks/{chunk-4WRJWM6K.js → chunk-FD3ICZTF.js} +1 -1
  10. package/dist/chunks/{chunk-RGLTNGJH.js → chunk-L6MXM22Q.js} +1 -1
  11. package/dist/chunks/chunk-SB3V6PTJ.js +1 -0
  12. package/dist/chunks/chunk-SQ6D33WV.js +96 -0
  13. package/dist/chunks/{chunk-ACYEMD5J.js → chunk-UREPZPIT.js} +1 -1
  14. package/dist/chunks/{fitment-data-CFDAFXJB.js → fitment-data-BQFU5HN3.js} +1 -1
  15. package/dist/chunks/section-css-style-VF2FOE3B.js +1 -0
  16. package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
  17. package/dist/editor.css +1 -1
  18. package/dist/index.d.ts +29 -2
  19. package/dist/index.js +32 -32
  20. package/dist/render/built-with.json +1 -1
  21. package/dist/render/components/AppointmentBooking.js +1 -1
  22. package/dist/render/components/CheckoutCTA.js +1 -1
  23. package/dist/render/components/Collections.js +1 -1
  24. package/dist/render/components/ContactRouting.d.ts +3 -1
  25. package/dist/render/components/ContactRouting.js +1 -1
  26. package/dist/render/components/DeliveryOptions.js +1 -1
  27. package/dist/render/components/FormBlock.js +1 -1
  28. package/dist/render/components/GalleryShowcase.js +1 -1
  29. package/dist/render/components/ProductHeroPanel.js +1 -1
  30. package/dist/render/components/ReviewForm.js +1 -1
  31. package/dist/render/components/Reviews.js +1 -1
  32. package/dist/render/components/SectionBand.d.ts +2 -1
  33. package/dist/render/components/SectionBand.js +1 -1
  34. package/dist/render/components/SectionNotice.js +1 -1
  35. package/dist/render/components/SectionPadScope.d.ts +23 -0
  36. package/dist/render/components/SectionPadScope.js +1 -0
  37. package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
  38. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  39. package/dist/render/lib/content/block-own-pads.d.ts +27 -0
  40. package/dist/render/lib/content/block-own-pads.js +1 -0
  41. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
  42. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
  43. package/dist/render/lib/document/blocks/commerce/BundleOffer/meta.js +1 -1
  44. package/dist/render/lib/document/blocks/commerce/BundleOffer/render.js +1 -1
  45. package/dist/render/lib/document/blocks/commerce/CatalogFilterBar/meta.js +1 -1
  46. package/dist/render/lib/document/blocks/commerce/CatalogFilterBar/render.js +1 -1
  47. package/dist/render/lib/document/blocks/commerce/CheckoutCTA/meta.js +1 -1
  48. package/dist/render/lib/document/blocks/commerce/CheckoutCTA/render.js +1 -1
  49. package/dist/render/lib/document/blocks/commerce/Collections/meta.js +1 -1
  50. package/dist/render/lib/document/blocks/commerce/Collections/render.js +1 -1
  51. package/dist/render/lib/document/blocks/commerce/CompatibleTyres/meta.js +1 -1
  52. package/dist/render/lib/document/blocks/commerce/CompatibleTyres/render.js +1 -1
  53. package/dist/render/lib/document/blocks/commerce/DeliveryOptions/meta.js +1 -1
  54. package/dist/render/lib/document/blocks/commerce/DeliveryOptions/render.js +1 -1
  55. package/dist/render/lib/document/blocks/commerce/EuTyreLabel/meta.js +1 -1
  56. package/dist/render/lib/document/blocks/commerce/EuTyreLabel/render.js +1 -1
  57. package/dist/render/lib/document/blocks/commerce/FitmentFinder/meta.js +1 -1
  58. package/dist/render/lib/document/blocks/commerce/FitmentFinder/render.js +1 -1
  59. package/dist/render/lib/document/blocks/commerce/FitmentTable/meta.js +1 -1
  60. package/dist/render/lib/document/blocks/commerce/FitmentTable/render.js +1 -1
  61. package/dist/render/lib/document/blocks/commerce/Gallery/meta.js +1 -1
  62. package/dist/render/lib/document/blocks/commerce/Gallery/render.js +1 -1
  63. package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
  64. package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
  65. package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.js +1 -1
  66. package/dist/render/lib/document/blocks/commerce/RelatedProducts/render.js +1 -1
  67. package/dist/render/lib/document/blocks/commerce/SpecTable/meta.js +1 -1
  68. package/dist/render/lib/document/blocks/commerce/SpecTable/render.js +1 -1
  69. package/dist/render/lib/document/blocks/commerce/TyreFitment/meta.js +1 -1
  70. package/dist/render/lib/document/blocks/commerce/TyreFitment/render.js +1 -1
  71. package/dist/render/lib/document/blocks/commerce/TyreSizes/meta.js +1 -1
  72. package/dist/render/lib/document/blocks/commerce/TyreSizes/render.js +1 -1
  73. package/dist/render/lib/document/blocks/service/AppointmentBooking/meta.js +1 -1
  74. package/dist/render/lib/document/blocks/service/AppointmentBooking/render.js +1 -1
  75. package/dist/render/lib/document/blocks/service/ContactRouting/meta.js +1 -1
  76. package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
  77. package/dist/render/lib/document/blocks/service/Form/meta.js +1 -1
  78. package/dist/render/lib/document/blocks/service/Form/render.js +1 -1
  79. package/dist/render/lib/document/blocks/service/ReviewForm/meta.js +1 -1
  80. package/dist/render/lib/document/blocks/service/ReviewForm/render.js +1 -1
  81. package/dist/render/lib/document/blocks/service/Reviews/meta.js +1 -1
  82. package/dist/render/lib/document/blocks/service/Reviews/render.js +1 -1
  83. package/dist/render/lib/document/blocks/service/SubmitBuild/meta.js +1 -1
  84. package/dist/render/lib/document/blocks/service/SubmitBuild/render.js +1 -1
  85. package/dist/render/lib/document/blocks/service/Subscribe/meta.js +1 -1
  86. package/dist/render/lib/document/blocks/service/Subscribe/render.js +1 -1
  87. package/dist/render/lib/document/blocks/service/SubscribeBlogs/meta.js +1 -1
  88. package/dist/render/lib/document/blocks/service/SubscribeBlogs/render.js +1 -1
  89. package/dist/render/lib/document/pads-itself.d.ts +16 -0
  90. package/dist/render/lib/document/pads-itself.js +1 -0
  91. package/dist/routine-index.json +1 -1
  92. package/dist/value-index.json +1 -1
  93. package/package.json +2 -2
  94. package/dist/chunks/CustomHtmlCodeWindow-HSZVKXL4.js +0 -26
  95. package/dist/chunks/SiteEditorProvider-6X2YHTVA.js +0 -1
  96. package/dist/chunks/chunk-AEBQM5LZ.js +0 -2
  97. package/dist/chunks/chunk-B3U6XXDZ.js +0 -337
  98. package/dist/chunks/chunk-GATK7RJE.js +0 -7
  99. package/dist/chunks/chunk-HKL2EKLO.js +0 -96
  100. package/dist/chunks/section-css-style-TKWJ7WU2.js +0 -1
  101. /package/dist/chunks/{chunk-B3U6XXDZ.js.LEGAL.txt → chunk-7SLHEYYR.js.LEGAL.txt} +0 -0
  102. /package/dist/chunks/{chunk-3DCSW3PN.js → chunk-ECMYL3O7.js} +0 -0
  103. /package/dist/chunks/{chunk-ACYEMD5J.js.LEGAL.txt → chunk-UREPZPIT.js.LEGAL.txt} +0 -0
  104. /package/dist/chunks/{chunk-5NGS7VFJ.js → chunk-VYXOE5FY.js} +0 -0
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "74.7.0"
2
+ "efficient-web-builder": "74.9.1"
3
3
  }
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{BookingFormProvider as A,useBookingForm as C}from"./booking/BookingFormState.js";import{useBookingPreview as _}from"efficient-web-builder/render/lib/document/booking-preview";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{BookingChoose as D,BookingConfirmed as I,BookingDetails as L,BookingHead as P}from"./booking/BookingRegions.js";import{HideTaker as u}from"efficient-web-builder/render/components/ViewHideRoot";import j from"./SectionBand.js";import{siteSideRoom as z}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as F}from"efficient-web-builder/render/components/SideSpaceOnce";function T(t={}){const n=_();return e(A,{editing:t.editing,previewConfirmation:!!t.nodeId&&n===t.nodeId,children:e($,{...t})})}const x="mx-auto max-w-[var(--sf-site-width,1600px)] px-[min(24px,var(--sf-site-gutter,40px))] py-16 view-wide:px-[var(--sf-site-gutter,40px)] view-wide:py-[88px]",c="grid gap-8 min-[960px]:grid-cols-[minmax(0,1fr)_minmax(360px,0.8fr)] min-[960px]:gap-12";function $({eyebrow:t,heading:n,intro:v,buttonLabel:b,successMessage:S,boxes:r,inBoxes:h=!1,omitHead:l=!1,nodeId:k="AppointmentBooking",serviceTemplate:B,timeTemplate:N}){const a=F()?`${x} ${z("box").onceFrame}`:x,{fieldPrefix:E,editing:w,services:d,currency:M,serviceId:R,setServiceId:O,requiresPayment:q,date:G,earliestDate:H,setDate:J,setDateTouched:K,availability:Q,loadingSlots:U,noSlotsMessage:V,selectedStart:W,setSelectedStart:X,customerTimezone:Y,name:Z,setName:ee,email:te,setEmail:ie,phone:oe,setPhone:ne,notes:re,setNotes:ae,confirmation:p,submitting:se,error:me,canSubmit:ce,handleSubmit:f,sample:y}=C(),s=y?e("p",{className:"mb-6 font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:o("Example form — add an active service in {place}.",{place:o("Storefront → Booking Services")})}):null,m=d===void 0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading appointments…"}):d?.length===0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:w?o("Add an active service in {place}.",{place:o("Storefront → Booking Services")}):"Appointments are not available right now."}):null;if(h&&r&&!l)return e(u,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:a,children:[s,p?e(r,{className:`${c} items-start`}):i("form",{onSubmit:f,children:[e(r,{className:`${c} items-start`}),m]})]})});const g=p?e(I,{successMessage:S}):m||i("form",{onSubmit:f,className:c,children:[e(D,{owner:{id:k,type:"AppointmentBooking",serviceTemplate:B,timeTemplate:N}}),e(L,{buttonLabel:b})]});return l?i(j,{className:"relative z-[2] border-t border-line bg-surface",column:a,children:[s,g]}):e(u,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:a,children:[s,e(P,{eyebrow:t,heading:n,intro:v}),g]})})}export{$ as AppointmentBookingBody,T as default};
1
+ "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{BookingFormProvider as C,useBookingForm as P}from"./booking/BookingFormState.js";import{useBookingPreview as _}from"efficient-web-builder/render/lib/document/booking-preview";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{BookingChoose as D,BookingConfirmed as I,BookingDetails as L,BookingHead as j}from"./booking/BookingRegions.js";import{HideTaker as x}from"efficient-web-builder/render/components/ViewHideRoot";import z from"./SectionBand.js";import{siteSideRoom as F}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as R}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as T}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as $}from"./SectionPadScope.js";function E(t={}){const n=_();return e(C,{editing:t.editing,previewConfirmation:!!t.nodeId&&n===t.nodeId,children:e(M,{...t})})}const v="mx-auto max-w-[var(--sf-site-width,1600px)] px-[min(24px,var(--sf-site-gutter,40px))] py-16 view-wide:px-[var(--sf-site-gutter,40px)] view-wide:py-[88px]",m="grid gap-8 min-[960px]:grid-cols-[minmax(0,1fr)_minmax(360px,0.8fr)] min-[960px]:gap-12";function M({eyebrow:t,heading:n,intro:S,buttonLabel:b,successMessage:h,boxes:r,inBoxes:k=!1,omitHead:c=!1,nodeId:B="AppointmentBooking",serviceTemplate:w,timeTemplate:N}){const l=R()?`${v} ${F("box").onceFrame}`:v,d=T(l,$()),{fieldPrefix:O,editing:y,services:p,currency:q,serviceId:G,setServiceId:H,requiresPayment:J,date:K,earliestDate:Q,setDate:U,setDateTouched:V,availability:W,loadingSlots:X,noSlotsMessage:Y,selectedStart:Z,setSelectedStart:ee,customerTimezone:te,name:ie,setName:oe,email:ne,setEmail:re,phone:ae,setPhone:se,notes:me,setNotes:ce,confirmation:f,submitting:le,error:de,canSubmit:pe,handleSubmit:g,sample:A}=P(),a=A?e("p",{className:"mb-6 font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:o("Example form — add an active service in {place}.",{place:o("Storefront → Booking Services")})}):null,s=p===void 0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading appointments…"}):p?.length===0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:y?o("Add an active service in {place}.",{place:o("Storefront → Booking Services")}):"Appointments are not available right now."}):null;if(k&&r&&!c)return e(x,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{...d,children:[a,f?e(r,{className:`${m} items-start`}):i("form",{onSubmit:g,children:[e(r,{className:`${m} items-start`}),s]})]})});const u=f?e(I,{successMessage:h}):s||i("form",{onSubmit:g,className:m,children:[e(D,{owner:{id:B,type:"AppointmentBooking",serviceTemplate:w,timeTemplate:N}}),e(L,{buttonLabel:b})]});return c?i(z,{className:"relative z-[2] border-t border-line bg-surface",column:l,padOnColumn:!0,children:[a,u]}):e(x,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{...d,children:[a,e(j,{eyebrow:t,heading:n,intro:S}),u]})})}export{M as AppointmentBookingBody,E as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as p}from"react/jsx-runtime";import d from"efficient-web-builder/render/components/BlockFrame";import f from"efficient-web-builder/render/components/Btn";import h from"efficient-web-builder/render/components/SectionEyebrow";import{renderGold as r,renderHeadline as g,splitParagraphs as u}from"efficient-web-builder/render/components/goldPhrases";function v({eyebrow:m,title:n,body:t,ctaText:a,ctaHref:s,secondaryText:i,secondaryHref:l,contained:c}){return e(d,{contained:c,className:"py-6",children:p("div",{className:"flex flex-col items-center gap-5 px-6 py-16 text-center max-view-wide:py-10",children:[m&&e(h,{text:m,scaled:!1}),n&&e("h2",{className:"max-w-[720px] font-display text-[min(44px,var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-view-wide:text-[min(30px,var(--sf-heading-max,9999px))]",children:g(n,!1)}),t&&u(t).map((o,x)=>e("p",{className:"max-w-[560px] text-[16px] leading-[1.6] opacity-85",children:r(o)},x)),(a||i)&&p("div",{className:"mt-2 flex items-center gap-6",children:[a&&e(f,{href:s||"/checkout",variant:"primary",children:r(a)}),i&&e("a",{href:l||"#",className:"font-mono text-[13px] uppercase tracking-[0.2em] underline underline-offset-4 opacity-70 hover:opacity-100",children:r(i)})]})]})})}export{v as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import f from"efficient-web-builder/render/components/BlockFrame";import h from"efficient-web-builder/render/components/Btn";import u from"efficient-web-builder/render/components/SectionEyebrow";import{renderGold as r,renderHeadline as g,splitParagraphs as v}from"efficient-web-builder/render/components/goldPhrases";import{withRootPad as w}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as k}from"./SectionPadScope.js";function y({eyebrow:t,title:m,body:n,ctaText:a,ctaHref:p,secondaryText:i,secondaryHref:s,contained:c}){const l=k();return e(f,{contained:c,...w("py-6",l),children:o("div",{className:"flex flex-col items-center gap-5 px-6 py-16 text-center max-view-wide:py-10",children:[t&&e(u,{text:t,scaled:!1}),m&&e("h2",{className:"max-w-[720px] font-display text-[min(44px,var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-view-wide:text-[min(30px,var(--sf-heading-max,9999px))]",children:g(m,!1)}),n&&v(n).map((d,x)=>e("p",{className:"max-w-[560px] text-[16px] leading-[1.6] opacity-85",children:r(d)},x)),(a||i)&&o("div",{className:"mt-2 flex items-center gap-6",children:[a&&e(h,{href:p||"/checkout",variant:"primary",children:r(a)}),i&&e("a",{href:s||"#",className:"font-mono text-[13px] uppercase tracking-[0.2em] underline underline-offset-4 opacity-70 hover:opacity-100",children:r(i)})]})]})})}export{y as default};
@@ -1 +1 @@
1
- "use client";import{Fragment as u,jsx as e,jsxs as t}from"react/jsx-runtime";import{useScopeClass as N}from"../lib/use-scope-class.js";import T from"efficient-web-builder/render/components/SectionHeader";import{SectionTextParts as w}from"efficient-web-builder/render/lib/document/editing-bridges";import{CollectionCardStyleContext as $}from"./CollectionCard.js";import{fillRowCss as S}from"../lib/sections/fill-row.js";import{renderHeadline as A}from"efficient-web-builder/render/components/goldPhrases";import{CONTENT_CAP_GUTTER as c}from"../lib/sections/content-cap-gutter.js";import{FRAME_ROOM_DESKTOP_BOTTOM as F,FRAME_ROOM_DESKTOP_Y as P,FRAME_ROOM_NO_TOP as v,FRAME_ROOM_NO_TOP_PHONE as y,FRAME_ROOM_PHONE_BOTTOM as H,FRAME_ROOM_PHONE_Y as j}from"../lib/sections/band-padding.js";import{withSideOnce as B}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as I}from"efficient-web-builder/render/components/SideSpaceOnce";function b({editing:s,nodeId:r,children:i}){return!s||!r?e(u,{children:i}):e(w,{nodeId:r,sectionType:"Collections",children:i})}const L=`${c} ${P} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${j}`,k=`${c} ${v} ${F} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${y} ${H}`,D=`${c} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]`,K={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5"};function U({eyebrow:s,heading:r,columns:i,showPrice:x,cardStyle:M,layout:g,limit:n,cards:l,template:a,omitHead:d=!1,nodeId:m,partStyles:E,editing:O=!1}={}){const C=I(),o=N("cg"),R=typeof n=="number"&&n>0,h=g==="list"?"grid-cols-1":i===void 0?"grid-cols-3":K[Math.min(5,Math.max(2,Math.round(i)))]??"grid-cols-3",f=`${o} grid ${h} gap-4 max-view-wide:grid-cols-1 max-view-wide:gap-3`,p=S(o,f,{limit:n}),_=Number(a?.blockCount??0)>0;return t("section",{className:B(d?_?D:k:L,C),children:[d?null:e(T,{num:s!==void 0?s:"01 / Collections",accentNum:!0,title:r!==void 0?A(r,!1):t(u,{children:["Three ranges,",e("br",{}),"one standard."]}),link:{text:"View all",href:"/wheels"}}),l&&e(b,{editing:O,nodeId:m,children:t($.Provider,{value:{showPrice:x,cardStyle:M,partStyles:E,editing:O,ownerId:m,Template:_?a:void 0},children:[R&&e("style",{children:`.${o} > *:nth-child(n+${n+1}){display:none}`}),p&&e("style",{children:p}),e(l,{className:f,minEmptyHeight:260})]})})]})}export{U as default};
1
+ "use client";import{Fragment as u,jsx as e,jsxs as s}from"react/jsx-runtime";import{useScopeClass as T}from"../lib/use-scope-class.js";import N from"efficient-web-builder/render/components/SectionHeader";import{SectionTextParts as P}from"efficient-web-builder/render/lib/document/editing-bridges";import{CollectionCardStyleContext as S}from"./CollectionCard.js";import{fillRowCss as $}from"../lib/sections/fill-row.js";import{renderHeadline as A}from"efficient-web-builder/render/components/goldPhrases";import{CONTENT_CAP_GUTTER as c}from"../lib/sections/content-cap-gutter.js";import{FRAME_ROOM_DESKTOP_BOTTOM as F,FRAME_ROOM_DESKTOP_Y as v,FRAME_ROOM_NO_TOP as y,FRAME_ROOM_NO_TOP_PHONE as H,FRAME_ROOM_PHONE_BOTTOM as j,FRAME_ROOM_PHONE_Y as B}from"../lib/sections/band-padding.js";import{withSideOnce as I}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as b}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as L}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as k}from"./SectionPadScope.js";function D({editing:i,nodeId:o,children:r}){return!i||!o?e(u,{children:r}):e(P,{nodeId:o,sectionType:"Collections",children:r})}const K=`${c} ${v} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${B}`,U=`${c} ${y} ${F} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${H} ${j}`,W=`${c} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]`,X={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5"};function Y({eyebrow:i,heading:o,columns:r,showPrice:x,cardStyle:M,layout:g,limit:t,cards:l,template:d,omitHead:a=!1,nodeId:m,partStyles:E,editing:O=!1}={}){const R=b(),C=k(),n=T("cg"),h=typeof t=="number"&&t>0,w=g==="list"?"grid-cols-1":r===void 0?"grid-cols-3":X[Math.min(5,Math.max(2,Math.round(r)))]??"grid-cols-3",p=`${n} grid ${w} gap-4 max-view-wide:grid-cols-1 max-view-wide:gap-3`,f=$(n,p,{limit:t}),_=Number(d?.blockCount??0)>0;return s("section",{...L(I(a?_?W:U:K,R),C),children:[a?null:e(N,{num:i!==void 0?i:"01 / Collections",accentNum:!0,title:o!==void 0?A(o,!1):s(u,{children:["Three ranges,",e("br",{}),"one standard."]}),link:{text:"View all",href:"/wheels"}}),l&&e(D,{editing:O,nodeId:m,children:s(S.Provider,{value:{showPrice:x,cardStyle:M,partStyles:E,editing:O,ownerId:m,Template:_?d:void 0},children:[h&&e("style",{children:`.${n} > *:nth-child(n+${t+1}){display:none}`}),f&&e("style",{children:f}),e(l,{className:p,minEmptyHeight:260})]})})]})}export{Y as default};
@@ -3,6 +3,7 @@ import type { Form } from "../lib/api/index.js";
3
3
  import { type ContactChannel, type RoutingGroup } from "efficient-web-builder/format/lib/content/contact";
4
4
  import type { SlotComponent } from "efficient-easel/blocks";
5
5
  import type { CardPressTitle } from "efficient-web-builder/render/lib/document/card-press-titles";
6
+ import { type SplitPads } from "./SectionPadScope.js";
6
7
  export declare const CHANNEL_HINTS: {
7
8
  readonly label: "Label";
8
9
  readonly value: "Value";
@@ -20,6 +21,7 @@ export declare function topicFieldOf(form: Pick<Form, "fields"> | null | undefin
20
21
  idFor: (option: string) => string | undefined;
21
22
  } | null;
22
23
  export interface ContactRoutingProps {
24
+ pads?: SplitPads;
23
25
  routingNumber?: string;
24
26
  routingTagline?: string;
25
27
  groups: RoutingGroup[];
@@ -56,5 +58,5 @@ export interface ContactRoutingTemplates {
56
58
  };
57
59
  }
58
60
  export declare const fieldClass: string;
59
- export default function ContactRouting({ routingNumber, routingTagline, groups, formNumber, formHeading, metaLines, showOther, otherLabel, otherNoteTitle, otherNoteBody, buttonText, consent, channels, formSlug, form: injectedForm, editing, showSent, initialActiveId, onActiveChange, reasonExtras, omitHead, templates, }: ContactRoutingProps): import("react").JSX.Element;
61
+ export default function ContactRouting({ routingNumber, routingTagline, groups, formNumber, formHeading, metaLines, showOther, otherLabel, otherNoteTitle, otherNoteBody, buttonText, consent, channels, formSlug, form: injectedForm, editing, showSent, initialActiveId, onActiveChange, reasonExtras, omitHead, templates, pads, }: ContactRoutingProps): import("react").JSX.Element;
60
62
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as m,Fragment as ue}from"react/jsx-runtime";import fe from"./SectionBand.js";import{HideTaker as be,usePeekViewHide as xe,useTakeViewHide as he,withViewHide as ge}from"efficient-web-builder/render/components/ViewHideRoot";import{useEffect as L,useState as K}from"react";import{useRootIsDark as ye}from"efficient-shell/theme";import{OTHER_REASON_ID as k}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as we,FormHoneypot as ve,successMessageFor as ke,useBoundForm as Ce,useFormSubmission as Te}from"./formSubmission.js";import Ne from"efficient-web-builder/render/components/SectionEyebrow";import{InsideSiteColumn as R,useSectionEdge as Se}from"efficient-web-builder/render/components/SiteGutterFrame";import{sectionEdgeBandAttrs as Ie}from"efficient-web-builder/render/lib/content/section-edge";import $e,{FieldCaption as Oe}from"./WebFormField.js";import{scrollBehavior as Re}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as Fe,renderGold as N,renderHeadline as _e,splitParagraphs as Ee}from"efficient-web-builder/render/components/goldPhrases";import{say as S}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as Ae}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as ze,encodePartRow as He}from"efficient-web-builder/render/lib/document/text-parts";import{CardTemplateRows as F}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as _}from"efficient-web-builder/format/lib/content/card-template";import{CONTACT_CHANNEL_SLOT as Q,CONTACT_REASON_SLOT as Le,CONTACT_TOPIC_SLOT as je}from"../lib/content/contact-card-seed.js";import{showsSentOnCanvas as Me}from"../lib/content/thanks-slot.js";import{ThanksCard as Pe}from"./ThanksCard.js";import{groundCell as Ve}from"./card-ground-cell.js";import{withSideOnce as qe}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as Be}from"efficient-web-builder/render/components/SideSpaceOnce";const b={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,18px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},j={label:"Label",value:"Value",sub:"Sub line"};function Xe(a,o){return a.map((t,r)=>o?{...t,at:r,label:t.label||S(j.label),value:t.value||S(j.value),sub:t.sub||S(j.sub)}:{...t,at:r}).filter(t=>!t.hidden)}function Y(a,o){return o?{[ze]:He("channels",a.at)}:{}}function ee(a){if(a.href)return a.href;const o=(a.value??"").trim();if(o.includes("@"))return`mailto:${o}`;if(/^\+?[\d\s().-]{6,}$/.test(o))return Ae(o)}function De(a){const o=[],t=new Map;for(const r of a){if(!r.groupId){o.push(r);continue}const c=r.value.trim().toLowerCase(),x=t.get(c);if(x)x.label=`${x.label} · ${r.label}`;else{const g={...r};t.set(c,g),o.push(g)}}return o}function We(a,o,t){const r=c=>String(c??"").trim().toLowerCase();for(const c of a?.fields??[]){if(c.type!=="select"||!Array.isArray(c.options))continue;const x=c.options.map(String);if(!o.some(l=>x.some(p=>r(p)===r(l.title))))continue;const g=l=>r(l===k?t:o.find(p=>p.id===l)?.title);return{key:c.key,optionFor:l=>x.find(p=>r(p)===g(l)&&g(l)!==""),idFor:l=>{const p=o.find(T=>r(T.title)===r(l));return p?p.id:t&&r(l)===r(t)?k:void 0}}}return null}const ne=`border-b border-line bg-transparent py-4 font-display ${b.bodyLarge} tracking-[0.01em] text-fg outline-none transition-colors focus:border-accent`;function Ge({routingNumber:a,routingTagline:o,groups:t,formNumber:r,formHeading:c,metaLines:x,showOther:g=!0,otherLabel:l="Other",otherNoteTitle:p,otherNoteBody:T,buttonText:M,consent:P,channels:te,formSlug:V,form:re,editing:u,showSent:oe,initialActiveId:w,onActiveChange:q,reasonExtras:se,omitHead:I=!1,templates:i}){const ae=Be(),C=[...t.map(e=>e.id),...g?[k]:[]],le=w&&C.includes(w)?w:C[0]??k,[v,$]=K(le);L(()=>{C.includes(v)||$(C[0]??k)},[C.join("|")]),L(()=>{w&&C.includes(w)&&$(w)},[w]);const y=Ce(V,re),d=Te({form:y,formSlug:V,editing:u}),B=y?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${b.body} leading-[1.6] text-fg-dim`,children:ke(y,"Thanks — we've received your message.")}):null,f=We(y,t,g?l:void 0),X=e=>{$(e),E(null);const s=f?.optionFor(e);f&&s!==void 0&&d.set(f.key,s),q?.(e)};L(()=>{if(!f||d.valueOf(f.key))return;const e=f.optionFor(v);e!==void 0&&d.set(f.key,e)},[f?.key]);const[D,E]=K(null),h=Xe(te??[],!!u),ie=e=>D!==null?!e.groupId&&e.value===D:e.groupId===v,de=y===void 0,A=!!y||!!u,ce=!ye({whenUnset:!0}),W=Se(),O=I&&W?Ie(W):null,G=O?`${O.className} `:"",U=t.length>0||!!u,pe=e=>{X(e),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:Re(),block:"start"})},Z=n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1",children:n(R,{children:n(F,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:je,Template:i?.topic,rows:t.map(_),items:t,states:t.map(e=>({selected:v===e.id})),actions:u?void 0:t.map(e=>({press:()=>pe(e.id)})),pressTitles:i?.pressTitles?.topic,fallback:null,wrapCopy:Ve,children:e=>e})})}),z=[...t.map(e=>({id:e.id,title:e.title})),...g?[{id:k,title:l}]:[]],me=xe(),J=he();return m(ue,{children:[U&&(I?n(be,{as:"section",className:`${G}border-b border-line bg-surface pt-6 pb-[60px]`,style:O?.style,children:Z}):m(fe,{className:"border-b border-line py-[60px]",style:ce?void 0:{background:"var(--section-bg)"},children:[(a||o)&&m("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[a&&n(Ne,{text:a}),o&&n("span",{className:`font-display ${b.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:N(o)})]}),Z]})),(A||h.length>0)&&J.scope(n("section",{id:"contact-form",className:ge(`${G}${I?"bg-bg ":""}scroll-mt-[80px] border-b border-line py-20 max-view-desktop:py-[60px]`,me),style:O?.style,...U?{}:J.attrs,children:m("div",{className:[I?"grid gap-20 max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px]":qe("mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",ae),A&&h.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[A&&m("div",{children:[m("div",{className:"mb-8 flex items-end justify-between gap-6 border-b border-line pb-6",children:[m("div",{children:[r&&n("div",{className:`pb-2 font-mono ${b.labelLarge} uppercase tracking-[0.3em] text-accent`,children:N(r)}),c&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,4vw,56px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:_e(c,!0)})]}),!!(x&&x.length)&&n("div",{className:`text-right font-mono ${b.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-fg-dim max-[700px]:text-left`,children:x.map((e,s)=>n("div",{children:e},s))})]}),y?d.done||Me(oe,u)?n(Pe,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",Template:i?.thanks,message:B,children:e=>m("div",{className:"flex flex-col gap-6",children:[B,e]})}):m("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:d.handleSubmit,children:[y.fields.map(e=>n($e,{label:e.label,required:e.required,className:e.type==="textarea"||e.type==="checkbox"?"col-span-2 max-[700px]:col-span-1":void 0,children:n(we,{field:e,value:d.valueOf(e.key),onChange:s=>{d.set(e.key,s);const H=f&&e.key===f.key?f.idFor(s):void 0;H!==void 0&&($(H),E(null),q?.(H))},className:e.type==="textarea"?`${ne} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":ne})},e.key)),m("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(Oe,{required:!0,children:"Reason"}),n("div",{className:"mt-1 flex flex-wrap gap-2",children:n(R,{children:n(F,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:Le,Template:i?.reason,rows:z.map(e=>_({title:e.title})),states:z.map(e=>({selected:v===e.id})),actions:u?void 0:z.map(e=>({press:()=>X(e.id)})),pressTitles:i?.pressTitles?.reason,fallback:null,children:e=>e})})})]}),se?.(v),v===k&&(p||T)&&m("div",{className:"sf-card col-span-2 flex flex-col gap-2 border border-line bg-bg/40 p-5 max-[700px]:col-span-1",children:[p&&n("span",{className:`font-mono ${b.labelSmall} uppercase tracking-[0.24em] text-accent`,children:N(p)}),T&&Ee(T).map((e,s)=>n("p",{className:`font-display ${b.body} leading-[1.55] text-fg-dim`,children:N(e)},s))]}),n(ve,{value:d.honeypot,onChange:d.setHoneypot}),d.error&&n("p",{role:"alert",className:`col-span-2 font-mono ${b.labelSmall} uppercase tracking-[0.18em] text-alert max-[700px]:col-span-1`,children:d.error}),m("div",{className:"col-span-2 mt-5 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-6 max-[700px]:col-span-1 max-[700px]:flex-col max-[700px]:items-stretch",children:[P&&n("span",{className:`max-w-[380px] font-mono ${b.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:N(P)}),n("button",{type:u?"button":"submit",disabled:d.submitting,className:`cursor-pointer bg-btn px-8 py-5 font-mono ${b.labelXl} uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-wait disabled:opacity-60 max-[700px]:w-full`,children:d.submitting?"Sending…":M?Fe(M):"Send Message →"})]})]}):n("p",{className:`font-mono ${b.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:de?S("Loading form…"):S("Choose a form in the inspector, under Message form — until then this column is hidden on the live page and no message can be sent.")})]}),h.length>0&&n("aside",{className:"flex flex-col gap-0 max-view-desktop:hidden",children:n(R,{children:n(F,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:Q,Template:i?.channel,rows:h.map(e=>_({label:e.label,value:e.value,sub:e.sub??"",href:ee(e)??""})),items:h,states:h.map(e=>({selected:ie(e)})),copyAttrs:({index:e})=>Y(h[e],u),actions:u?void 0:h.map(e=>e.groupId?{press:()=>{},disabled:!0}:{press:()=>E(e.value)}),pressTitles:i?.pressTitles?.channel,fallback:null,children:e=>e})})}),h.length>0&&(()=>{const e=De(h);return n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-view-desktop:flex",children:n(R,{children:n(F,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:Q,Template:i?.channel,rows:e.map(s=>_({label:s.label,value:s.value,sub:s.sub??"",href:ee(s)??""})),items:e,copyAttrs:({index:s})=>Y(e[s],u),fallback:null,children:s=>s})})})})()]})}))]})}export{j as CHANNEL_HINTS,ee as channelHref,Ge as default,Xe as drawnChannels,ne as fieldClass,De as mergeChannelsForPhone,We as topicFieldOf};
1
+ "use client";import{jsx as n,jsxs as m,Fragment as we}from"react/jsx-runtime";import ye from"./SectionBand.js";import{HideTaker as ve,usePeekViewHide as ke,useTakeViewHide as Te,withViewHide as Ce}from"efficient-web-builder/render/components/ViewHideRoot";import{useEffect as j,useState as ne}from"react";import{useRootIsDark as Se}from"efficient-shell/theme";import{OTHER_REASON_ID as k}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as Ne,FormHoneypot as Ie,successMessageFor as Oe,useBoundForm as Re,useFormSubmission as $e}from"./formSubmission.js";import Fe from"efficient-web-builder/render/components/SectionEyebrow";import{InsideSiteColumn as F,useSectionEdge as _e}from"efficient-web-builder/render/components/SiteGutterFrame";import{sectionEdgeBandAttrs as Ee}from"efficient-web-builder/render/lib/content/section-edge";import Ae,{FieldCaption as Pe}from"./WebFormField.js";import{scrollBehavior as ze}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as He,renderGold as N,renderHeadline as Le,splitParagraphs as Me}from"efficient-web-builder/render/components/goldPhrases";import{say as I}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as je}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as Ve,encodePartRow as Be}from"efficient-web-builder/render/lib/document/text-parts";import{CardTemplateRows as _}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as E}from"efficient-web-builder/format/lib/content/card-template";import{CONTACT_CHANNEL_SLOT as te,CONTACT_REASON_SLOT as qe,CONTACT_TOPIC_SLOT as Xe}from"../lib/content/contact-card-seed.js";import{showsSentOnCanvas as De}from"../lib/content/thanks-slot.js";import{ThanksCard as We}from"./ThanksCard.js";import{groundCell as Ge}from"./card-ground-cell.js";import{withSideOnce as Ue}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as Ze}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as oe}from"efficient-web-builder/render/lib/content/section-own-pads";import{SectionPadScope as Je}from"./SectionPadScope.js";const b={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,18px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},V={label:"Label",value:"Value",sub:"Sub line"};function Ke(a,r){return a.map((t,o)=>r?{...t,at:o,label:t.label||I(V.label),value:t.value||I(V.value),sub:t.sub||I(V.sub)}:{...t,at:o}).filter(t=>!t.hidden)}function re(a,r){return r?{[Ve]:Be("channels",a.at)}:{}}function se(a){if(a.href)return a.href;const r=(a.value??"").trim();if(r.includes("@"))return`mailto:${r}`;if(/^\+?[\d\s().-]{6,}$/.test(r))return je(r)}function Qe(a){const r=[],t=new Map;for(const o of a){if(!o.groupId){r.push(o);continue}const c=o.value.trim().toLowerCase(),x=t.get(c);if(x)x.label=`${x.label} · ${o.label}`;else{const g={...o};t.set(c,g),r.push(g)}}return r}function Ye(a,r,t){const o=c=>String(c??"").trim().toLowerCase();for(const c of a?.fields??[]){if(c.type!=="select"||!Array.isArray(c.options))continue;const x=c.options.map(String);if(!r.some(l=>x.some(p=>o(p)===o(l.title))))continue;const g=l=>o(l===k?t:r.find(p=>p.id===l)?.title);return{key:c.key,optionFor:l=>x.find(p=>o(p)===g(l)&&g(l)!==""),idFor:l=>{const p=r.find(S=>o(S.title)===o(l));return p?p.id:t&&o(l)===o(t)?k:void 0}}}return null}const ae=`border-b border-line bg-transparent py-4 font-display ${b.bodyLarge} tracking-[0.01em] text-fg outline-none transition-colors focus:border-accent`;function en({routingNumber:a,routingTagline:r,groups:t,formNumber:o,formHeading:c,metaLines:x,showOther:g=!0,otherLabel:l="Other",otherNoteTitle:p,otherNoteBody:S,buttonText:B,consent:q,channels:le,formSlug:X,form:ie,editing:u,showSent:de,initialActiveId:y,onActiveChange:D,reasonExtras:ce,omitHead:O=!1,templates:i,pads:T}){const pe=Ze(),C=[...t.map(e=>e.id),...g?[k]:[]],me=y&&C.includes(y)?y:C[0]??k,[v,R]=ne(me);j(()=>{C.includes(v)||R(C[0]??k)},[C.join("|")]),j(()=>{y&&C.includes(y)&&R(y)},[y]);const w=Re(X,ie),d=$e({form:w,formSlug:X,editing:u}),W=w?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${b.body} leading-[1.6] text-fg-dim`,children:Oe(w,"Thanks — we've received your message.")}):null,f=Ye(w,t,g?l:void 0),G=e=>{R(e),A(null);const s=f?.optionFor(e);f&&s!==void 0&&d.set(f.key,s),D?.(e)};j(()=>{if(!f||d.valueOf(f.key))return;const e=f.optionFor(v);e!==void 0&&d.set(f.key,e)},[f?.key]);const[U,A]=ne(null),h=Ke(le??[],!!u),ue=e=>U!==null?!e.groupId&&e.value===U:e.groupId===v,fe=w===void 0,P=!!w||!!u,be=!Se({whenUnset:!0}),Z=_e(),$=O&&Z?Ee(Z):null,J=$?`${$.className} `:"",z=t.length>0||!!u,xe=e=>{G(e),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:ze(),block:"start"})},K=n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1",children:n(F,{children:n(_,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:Xe,Template:i?.topic,rows:t.map(E),items:t,states:t.map(e=>({selected:v===e.id})),actions:u?void 0:t.map(e=>({press:()=>xe(e.id)})),pressTitles:i?.pressTitles?.topic,fallback:null,wrapCopy:Ge,children:e=>e})})}),H=[...t.map(e=>({id:e.id,title:e.title})),...g?[{id:k,title:l}]:[]],he=ke(),Q=Te(),Y=P||h.length>0,L=T?Y?T.first:T.firstOnly:null,ge=T?z?T.second:T.secondOnly:null,ee=m(ye,{className:"border-b border-line py-[60px]",style:be?void 0:{background:"var(--section-bg)"},children:[(a||r)&&m("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[a&&n(Fe,{text:a}),r&&n("span",{className:`font-display ${b.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:N(r)})]}),K]});return m(we,{children:[z&&(O?n(ve,{as:"section",...oe(`${J}border-b border-line bg-surface pt-6 pb-[60px]`,L?.atTop,$?.style),children:K}):L?n(Je,{pad:L,children:ee}):ee),Y&&Q.scope(n("section",{id:"contact-form",...oe(Ce(`${J}${O?"bg-bg ":""}scroll-mt-[80px] border-b border-line py-20 max-view-desktop:py-[60px]`,he)??"",ge?.atTop,$?.style),...z?{}:Q.attrs,children:m("div",{className:[O?"grid gap-20 max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px]":Ue("mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",pe),P&&h.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[P&&m("div",{children:[m("div",{className:"mb-8 flex items-end justify-between gap-6 border-b border-line pb-6",children:[m("div",{children:[o&&n("div",{className:`pb-2 font-mono ${b.labelLarge} uppercase tracking-[0.3em] text-accent`,children:N(o)}),c&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,4vw,56px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:Le(c,!0)})]}),!!(x&&x.length)&&n("div",{className:`text-right font-mono ${b.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-fg-dim max-[700px]:text-left`,children:x.map((e,s)=>n("div",{children:e},s))})]}),w?d.done||De(de,u)?n(We,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",Template:i?.thanks,message:W,children:e=>m("div",{className:"flex flex-col gap-6",children:[W,e]})}):m("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:d.handleSubmit,children:[w.fields.map(e=>n(Ae,{label:e.label,required:e.required,className:e.type==="textarea"||e.type==="checkbox"?"col-span-2 max-[700px]:col-span-1":void 0,children:n(Ne,{field:e,value:d.valueOf(e.key),onChange:s=>{d.set(e.key,s);const M=f&&e.key===f.key?f.idFor(s):void 0;M!==void 0&&(R(M),A(null),D?.(M))},className:e.type==="textarea"?`${ae} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":ae})},e.key)),m("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(Pe,{required:!0,children:"Reason"}),n("div",{className:"mt-1 flex flex-wrap gap-2",children:n(F,{children:n(_,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:qe,Template:i?.reason,rows:H.map(e=>E({title:e.title})),states:H.map(e=>({selected:v===e.id})),actions:u?void 0:H.map(e=>({press:()=>G(e.id)})),pressTitles:i?.pressTitles?.reason,fallback:null,children:e=>e})})})]}),ce?.(v),v===k&&(p||S)&&m("div",{className:"sf-card col-span-2 flex flex-col gap-2 border border-line bg-bg/40 p-5 max-[700px]:col-span-1",children:[p&&n("span",{className:`font-mono ${b.labelSmall} uppercase tracking-[0.24em] text-accent`,children:N(p)}),S&&Me(S).map((e,s)=>n("p",{className:`font-display ${b.body} leading-[1.55] text-fg-dim`,children:N(e)},s))]}),n(Ie,{value:d.honeypot,onChange:d.setHoneypot}),d.error&&n("p",{role:"alert",className:`col-span-2 font-mono ${b.labelSmall} uppercase tracking-[0.18em] text-alert max-[700px]:col-span-1`,children:d.error}),m("div",{className:"col-span-2 mt-5 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-6 max-[700px]:col-span-1 max-[700px]:flex-col max-[700px]:items-stretch",children:[q&&n("span",{className:`max-w-[380px] font-mono ${b.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:N(q)}),n("button",{type:u?"button":"submit",disabled:d.submitting,className:`cursor-pointer bg-btn px-8 py-5 font-mono ${b.labelXl} uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-wait disabled:opacity-60 max-[700px]:w-full`,children:d.submitting?"Sending…":B?He(B):"Send Message →"})]})]}):n("p",{className:`font-mono ${b.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:fe?I("Loading form…"):I("Choose a form in the inspector, under Message form — until then this column is hidden on the live page and no message can be sent.")})]}),h.length>0&&n("aside",{className:"flex flex-col gap-0 max-view-desktop:hidden",children:n(F,{children:n(_,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:te,Template:i?.channel,rows:h.map(e=>E({label:e.label,value:e.value,sub:e.sub??"",href:se(e)??""})),items:h,states:h.map(e=>({selected:ue(e)})),copyAttrs:({index:e})=>re(h[e],u),actions:u?void 0:h.map(e=>e.groupId?{press:()=>{},disabled:!0}:{press:()=>A(e.value)}),pressTitles:i?.pressTitles?.channel,fallback:null,children:e=>e})})}),h.length>0&&(()=>{const e=Qe(h);return n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-view-desktop:flex",children:n(F,{children:n(_,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:te,Template:i?.channel,rows:e.map(s=>E({label:s.label,value:s.value,sub:s.sub??"",href:se(s)??""})),items:e,copyAttrs:({index:s})=>re(e[s],u),fallback:null,children:s=>s})})})})()]})}))]})}export{V as CHANNEL_HINTS,se as channelHref,en as default,Ke as drawnChannels,ae as fieldClass,Qe as mergeChannelsForPhone,Ye as topicFieldOf};
@@ -1 +1 @@
1
- import{jsx as a,jsxs as r}from"react/jsx-runtime";import x from"efficient-web-builder/render/components/BlockFrame";import f from"efficient-web-builder/render/components/SectionEyebrow";import{renderGold as l,renderHeadline as o,splitParagraphs as g}from"efficient-web-builder/render/components/goldPhrases";const h="py-6",u="pt-0 pb-6";function N({eyebrow:n,title:t,body:i,options:c=[],highlightBadge:p,contained:d,omitHead:m=!1}){return a(x,{contained:d,className:m?u:h,children:r("div",{className:"flex flex-col gap-6",children:[m?null:n||t||i?r("div",{className:"flex max-w-[680px] flex-col gap-3",children:[n&&a(f,{text:n,scaled:!1}),t&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:o(t,!1)}),i&&g(i).map((e,s)=>a("p",{className:"text-[15px] leading-[1.6] opacity-85",children:l(e)},s))]}):null,c.length>0&&a("ul",{className:"grid grid-cols-3 gap-4 max-view-wide:grid-cols-1",children:c.map((e,s)=>r("li",{className:`sf-card relative flex flex-col gap-2 border bg-surface px-6 py-6 ${e.highlighted?"border-accent":"border-line"}`,children:[e.highlighted&&p&&a("span",{className:"absolute -top-2.5 left-5 bg-bg px-2 font-mono text-[10px] uppercase tracking-[0.25em] text-accent",children:l(p)}),e.name&&a("span",{className:"text-[17px] font-medium",children:l(e.name)}),e.eta&&a("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] opacity-60",children:l(e.eta)}),e.blurb&&a("p",{className:"text-[13.5px] leading-[1.6] opacity-75",children:l(e.blurb)}),e.price&&a("span",{className:"mt-auto pt-2 font-display text-[20px] font-medium text-accent",children:l(e.price)})]},s))})]})})}export{N as default};
1
+ import{jsx as a,jsxs as s}from"react/jsx-runtime";import o from"efficient-web-builder/render/components/BlockFrame";import f from"efficient-web-builder/render/components/SectionEyebrow";import{renderGold as t,renderHeadline as g,splitParagraphs as h}from"efficient-web-builder/render/components/goldPhrases";import{withRootPad as u}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as N}from"./SectionPadScope.js";const v="py-6",b="pt-0 pb-6";function w({eyebrow:i,title:l,body:n,options:c=[],highlightBadge:p,contained:d,omitHead:m=!1}){const x=N();return a(o,{contained:d,...u(m?b:v,x),children:s("div",{className:"flex flex-col gap-6",children:[m?null:i||l||n?s("div",{className:"flex max-w-[680px] flex-col gap-3",children:[i&&a(f,{text:i,scaled:!1}),l&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:g(l,!1)}),n&&h(n).map((e,r)=>a("p",{className:"text-[15px] leading-[1.6] opacity-85",children:t(e)},r))]}):null,c.length>0&&a("ul",{className:"grid grid-cols-3 gap-4 max-view-wide:grid-cols-1",children:c.map((e,r)=>s("li",{className:`sf-card relative flex flex-col gap-2 border bg-surface px-6 py-6 ${e.highlighted?"border-accent":"border-line"}`,children:[e.highlighted&&p&&a("span",{className:"absolute -top-2.5 left-5 bg-bg px-2 font-mono text-[10px] uppercase tracking-[0.25em] text-accent",children:t(p)}),e.name&&a("span",{className:"text-[17px] font-medium",children:t(e.name)}),e.eta&&a("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] opacity-60",children:t(e.eta)}),e.blurb&&a("p",{className:"text-[13.5px] leading-[1.6] opacity-75",children:t(e.blurb)}),e.price&&a("span",{className:"mt-auto pt-2 font-display text-[20px] font-medium text-accent",children:t(e.price)})]},r))})]})})}export{w as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as m}from"react/jsx-runtime";import O from"next/link";import{useEffect as L}from"react";import{FormFieldInput as S,FormHoneypot as j,successMessageFor as I,useBoundForm as B,useFormSubmission as M}from"./formSubmission.js";import k from"./SectionNotice.js";import{ThanksCard as _}from"./ThanksCard.js";import{showsSentOnCanvas as q}from"../lib/content/thanks-slot.js";import{say as w}from"efficient-web-builder/format/lib/editor-words";import P from"./WebFormField.js";import{usePopupScope as W}from"./PopupHost.js";import{FIELD_INPUT_CLASS as F}from"../lib/field-input.js";import{cornerSidesShorthand as A,normalizeCornerSides as E}from"efficient-web-builder/format/lib/content/section-corners";import{cssLengthOf as H}from"efficient-web-builder/format/lib/content/css-length";import{withSideOnce as D}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as U}from"efficient-web-builder/render/components/SideSpaceOnce";function Y({field:e,value:n,onChange:a,cornersClass:o=""}){const r={field:e,value:n,onChange:a};return e.type==="checkbox"?m("label",{className:"flex items-start gap-3",children:[t(S,{...r,className:"mt-1 size-4 accent-accent"}),m("span",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-fg",children:[e.label,e.required?t("span",{className:"text-accent",children:" *"}):null]})]}):t(P,{label:e.label,required:e.required,children:t(S,{...r,className:(e.type==="textarea"?F+" resize-y":F)+o})})}function $(e,n,a){if(typeof e!="number"||!Number.isFinite(e))return null;const o=H(Math.max(0,e),a),r=E(n);return{style:{"--form-control-radius":r===null?o:A(o,r)},className:" [border-radius:var(--form-control-radius)]"}}function G({formSlug:e,heading:n,intro:a,submitText:o,finePrint:r,form:u,editing:i=!1,nodeId:d="",thanks:x,showSent:f,buttonCorners:h,buttonCornerSides:g,buttonCornersUnit:b}={}){const N=U(),s=B(e,u),l=W();if(s===void 0)return t(k,{size:"short",children:w("Loading form…")});if(s===null)return t(k,{size:"short",children:i?w("Choose a form in the inspector, under Form."):"This form is unavailable."});const p=(n??"").trim()||s.title;return t("section",{className:"relative z-[2] border-t border-line bg-surface",children:m("div",{className:D("mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",N),children:[p&&t("h2",{className:"mb-4 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:p}),(a??"").trim()&&t("p",{className:"mb-12 max-w-[640px] font-display text-[16px] leading-[1.6] text-fg-dim",children:a}),t(K,{form:s,formSlug:e,submitText:o,finePrint:r,editing:i,onSent:l?.markSent,nodeId:d,thanks:x,showSent:f,corners:$(h,g,b)})]})})}function J({account:e}){const n="font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim";switch(e?.status){case"approved":return m("p",{className:n,children:["Your account is ready."," ",t(O,{href:"/account",className:"underline",children:"Sign in"})]});case"pending":return t("p",{className:n,children:"We're reviewing your application and will email you once it's approved."});case"rejected":return t("p",{className:n,children:"We couldn't open an account from this application. Please contact the shop."});default:return null}}function K({form:e,formSlug:n,submitText:a,finePrint:o,editing:r=!1,onSent:u,corners:i=null,nodeId:d="",thanks:x,showSent:f}){const{valueOf:h,set:g,honeypot:b,setHoneypot:N,submitting:s,done:l,account:p,error:y,handleSubmit:C}=M({form:e,formSlug:n,editing:r});L(()=>{l&&u?.()},[l]);const T=(a??"").trim()||e.submitButtonText?.trim()||"Submit",v=c=>m("div",{role:"status",className:"flex max-w-[560px] flex-col gap-3",children:[t("p",{className:"font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:I(e)}),c,t(J,{account:p})]});return l||q(f,r)?t(_,{ownerId:d,ownerType:"Form",Template:x,message:v(null),children:v}):m("form",{className:"flex max-w-[720px] flex-col gap-5",style:i?.style,onSubmit:C,children:[e.fields.map(c=>t(Y,{field:c,value:h(c.key),onChange:z=>g(c.key,z),cornersClass:i?.className},c.key)),t(j,{value:b,onChange:N}),y&&t("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:y}),t("button",{type:r?"button":"submit",disabled:s,className:`cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60${i?.className??""}`,children:s?"Sending…":T}),e.consentText?.trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:e.consentText}),(o??"").trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:o})]})}export{J as AccountOutcome,K as FormBody,G as default};
1
+ "use client";import{jsx as t,jsxs as m}from"react/jsx-runtime";import O from"next/link";import{useEffect as L}from"react";import{FormFieldInput as S,FormHoneypot as j,successMessageFor as I,useBoundForm as P,useFormSubmission as B}from"./formSubmission.js";import k from"./SectionNotice.js";import{ThanksCard as M}from"./ThanksCard.js";import{showsSentOnCanvas as _}from"../lib/content/thanks-slot.js";import{say as w}from"efficient-web-builder/format/lib/editor-words";import q from"./WebFormField.js";import{usePopupScope as W}from"./PopupHost.js";import{FIELD_INPUT_CLASS as F}from"../lib/field-input.js";import{cornerSidesShorthand as A,normalizeCornerSides as E}from"efficient-web-builder/format/lib/content/section-corners";import{cssLengthOf as H}from"efficient-web-builder/format/lib/content/css-length";import{withSideOnce as D}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as R}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as U}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as Y}from"./SectionPadScope.js";function $({field:e,value:n,onChange:a,cornersClass:o=""}){const r={field:e,value:n,onChange:a};return e.type==="checkbox"?m("label",{className:"flex items-start gap-3",children:[t(S,{...r,className:"mt-1 size-4 accent-accent"}),m("span",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-fg",children:[e.label,e.required?t("span",{className:"text-accent",children:" *"}):null]})]}):t(q,{label:e.label,required:e.required,children:t(S,{...r,className:(e.type==="textarea"?F+" resize-y":F)+o})})}function G(e,n,a){if(typeof e!="number"||!Number.isFinite(e))return null;const o=H(Math.max(0,e),a),r=E(n);return{style:{"--form-control-radius":r===null?o:A(o,r)},className:" [border-radius:var(--form-control-radius)]"}}function J({formSlug:e,heading:n,intro:a,submitText:o,finePrint:r,form:u,editing:i=!1,nodeId:d="",thanks:x,showSent:f,buttonCorners:h,buttonCornerSides:g,buttonCornersUnit:b}={}){const N=R(),p=Y(),s=P(e,u),y=W();if(s===void 0)return t(k,{size:"short",children:w("Loading form…")});if(s===null)return t(k,{size:"short",children:i?w("Choose a form in the inspector, under Form."):"This form is unavailable."});const l=(n??"").trim()||s.title;return t("section",{className:"relative z-[2] border-t border-line bg-surface",children:m("div",{...U(D("mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",N),p),children:[l&&t("h2",{className:"mb-4 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:l}),(a??"").trim()&&t("p",{className:"mb-12 max-w-[640px] font-display text-[16px] leading-[1.6] text-fg-dim",children:a}),t(Q,{form:s,formSlug:e,submitText:o,finePrint:r,editing:i,onSent:y?.markSent,nodeId:d,thanks:x,showSent:f,corners:G(h,g,b)})]})})}function K({account:e}){const n="font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim";switch(e?.status){case"approved":return m("p",{className:n,children:["Your account is ready."," ",t(O,{href:"/account",className:"underline",children:"Sign in"})]});case"pending":return t("p",{className:n,children:"We're reviewing your application and will email you once it's approved."});case"rejected":return t("p",{className:n,children:"We couldn't open an account from this application. Please contact the shop."});default:return null}}function Q({form:e,formSlug:n,submitText:a,finePrint:o,editing:r=!1,onSent:u,corners:i=null,nodeId:d="",thanks:x,showSent:f}){const{valueOf:h,set:g,honeypot:b,setHoneypot:N,submitting:p,done:s,account:y,error:l,handleSubmit:C}=B({form:e,formSlug:n,editing:r});L(()=>{s&&u?.()},[s]);const T=(a??"").trim()||e.submitButtonText?.trim()||"Submit",v=c=>m("div",{role:"status",className:"flex max-w-[560px] flex-col gap-3",children:[t("p",{className:"font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:I(e)}),c,t(K,{account:y})]});return s||_(f,r)?t(M,{ownerId:d,ownerType:"Form",Template:x,message:v(null),children:v}):m("form",{className:"flex max-w-[720px] flex-col gap-5",style:i?.style,onSubmit:C,children:[e.fields.map(c=>t($,{field:c,value:h(c.key),onChange:z=>g(c.key,z),cornersClass:i?.className},c.key)),t(j,{value:b,onChange:N}),l&&t("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:l}),t("button",{type:r?"button":"submit",disabled:p,className:`cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60${i?.className??""}`,children:p?"Sending…":T}),e.consentText?.trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:e.consentText}),(o??"").trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:o})]})}export{K as AccountOutcome,Q as FormBody,J as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as r,Fragment as k}from"react/jsx-runtime";import Se from"next/link";import{useMemo as Y,useState as $}from"react";import{slugify as T,parseOption as je}from"efficient-shell/format";import{stripMarkup as G}from"efficient-web-builder/format/lib/markup";import{renderChrome as C,renderGold as i,renderHeadline as ze}from"efficient-web-builder/render/components/goldPhrases";import X from"efficient-web-builder/render/components/Placeholder";import Le,{LightboxClose as _e}from"./Lightbox.js";import Oe from"./ThemedSelect.js";import{say as S}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as Ae}from"efficient-web-builder/render/components/ViewHideRoot";import{withSideOnce as h}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as Pe}from"efficient-web-builder/render/components/SideSpaceOnce";const l={bodyUpTo720:"max-view-tablet:text-[length:var(--size-body,15px)]",labelUpTo720:"max-view-tablet:text-[length:var(--size-label,11px)]",body:"text-[length:var(--size-body,17px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"};function ee(x){const g=[x.image,...(x.photos??[]).map(f=>f?.src)].filter(f=>!!f);return g.length?g:[""]}const B=6,Fe=()=>Array.from({length:B},(x,g)=>({image:"",process:S("Tag"),eyebrow:S("Category"),name:S("Item name"),meta:S("{n} photos",{n:`0${g+1}`})}));function Te({mode:x="both",kicker:g,breadcrumbLabel:f,vehicleTabLabel:U="Gallery A",vehicleTitle:te,vehicleBody1:ae,vehicleBody2:re,vehicleStats:le,vehicleCards:H,wheelTabLabel:E="Gallery B",wheelTitle:ne,wheelBody1:se,wheelBody2:oe,wheelStats:ie,wheelCards:M,othersTitle:ce,othersBody1:me,othersBody2:pe,othersStats:de,othersCards:xe,showBreadcrumb:ge=!0,showStats:fe=!0,showIntro:ue=!0,showTabs:be=!0,showFilters:I=!0,showCount:Z=!0,showSort:D=!0,previewTab:j,previewHover:he=!1,editing:w=!1}){const u=Pe(),z=x==="both",y=z?["vehicles","wheels"]:x==="wheels"?["wheels"]:x==="others"?["others"]:["vehicles"],[ve,we]=$(y[0]),N=(w&&z&&j&&y.includes(j)?j:null)??je(y,y[0],ve),ye=w&&he,[L,V]=$("all"),[_,Ne]=$("newest"),[O,v]=$(null),n=N==="vehicles"?{title:te,body1:ae,body2:re,stats:le??[],cards:H??[],unit:"items",word:U}:N==="others"?{title:ce,body1:me,body2:pe,stats:de??[],cards:xe??[],unit:"items",word:"Others"}:{title:ne,body1:se,body2:oe,stats:ie??[],cards:M??[],unit:"items",word:E},q=Y(()=>{const e=[];for(const a of n.cards)a.process&&!e.includes(a.process)&&e.push(a.process);return e},[n.cards]),A=L!=="all"&&q.includes(L)?L:"all",J=A==="all"?n.cards:n.cards.filter(e=>e.process===A),K=Y(()=>{const e=[...J];return _==="name"&&e.sort((a,o)=>(a.name??"").localeCompare(o.name??"")),e},[J,_]),Q=n.cards.length===0,P=w&&Q,F=P?Fe():K,ke=P?B:n.cards.length,$e=P?B:K.length,R=g?`${g} · ${G(n.word)}`:void 0;function Ce(e){e!==N&&(we(e),V("all"))}return r(Ae,{as:"section",className:"relative z-[2] bg-bg",children:[ge&&r("nav",{className:h(`mx-auto flex max-w-[var(--sf-site-width,1600px)] items-center gap-4 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono ${l.labelLarge} uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-4`,u),children:[t("span",{className:"hover:text-fg",children:"Home"}),t("span",{className:"opacity-40",children:"/"}),t("span",{className:"text-fg",children:f?C(f):"Gallery"})]}),r("div",{className:h("mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-end gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] pt-[100px] pb-[60px] max-view-desktop:grid-cols-1 max-view-desktop:gap-5 max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))] max-view-desktop:pt-[60px]",u),children:[t("span",{className:`pb-4 font-mono ${l.labelXl} uppercase tracking-[0.3em] text-accent`,children:R?i(R):null}),t("h2",{className:"font-display text-[length:min(var(--size-headingLarge,clamp(64px,9vw,140px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.9] tracking-[-0.04em]",children:n.title?ze(n.title,!0):null}),t("div",{className:`pb-4 text-right font-mono ${l.labelLarge} uppercase leading-[1.8] tracking-[0.18em] text-fg-dim max-view-desktop:text-left`,children:fe&&n.stats.map((e,a)=>r("div",{children:[e.value?t("strong",{className:"font-normal text-fg",children:i(e.value)}):null," ",e.label?i(e.label):null]},a))})]}),ue&&(n.body1||n.body2)&&r("div",{className:h("mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-2 gap-[60px] px-[var(--sf-site-gutter,40px)] pt-8 max-view-desktop:grid-cols-1 max-view-desktop:gap-4 max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",u),children:[n.body1&&t("p",{className:`max-w-[540px] font-display ${l.body} leading-[1.6] text-fg-dim`,children:i(n.body1)}),n.body2&&t("p",{className:`max-w-[540px] font-display ${l.body} leading-[1.6] text-fg-dim`,children:i(n.body2)})]}),z&&be&&t("div",{className:h("mx-auto mt-10 flex max-w-[var(--sf-site-width,1600px)] items-stretch border-y border-line px-[var(--sf-site-gutter,40px)] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))] max-view-tablet:px-3",u),children:["vehicles","wheels"].map((e,a)=>{const o=N===e,c=e==="vehicles"?U:E,b=e==="vehicles"?(H??[]).length:(M??[]).length,m=(c||"").trim().split(/\s+/),p=m.slice(0,-1).join(" "),s=m.slice(-1)[0]??"";return r("button",{type:"button",onClick:()=>Ce(e),className:["group relative grid flex-1 cursor-pointer grid-cols-[auto_1fr_auto] items-end gap-5 px-6 py-8 text-left transition-colors",a===0?"border-r border-line":"","max-view-tablet:grid-cols-[auto_1fr] max-view-tablet:items-center max-view-tablet:gap-2 max-view-tablet:px-3 max-view-tablet:py-3",o?"bg-surface":"hover:bg-fg/[0.04]"].join(" "),children:[t("span",{className:[`pb-2 font-mono ${l.labelLarge} tracking-[0.3em] max-view-tablet:pb-0 ${l.labelUpTo720} max-view-tablet:tracking-[0.24em]`,o?"text-accent":"text-fg-dim group-hover:text-accent"].join(" "),children:a===0?"A":"B"}),r("span",{className:`font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3.6vw,48px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] ${l.bodyUpTo720}`,children:[p?r(k,{children:[C(p)," "]}):null,t("em",{className:"font-normal italic text-accent",children:C(s)})]}),r("span",{className:`pb-2 text-right font-mono ${l.labelSmall} uppercase leading-[1.7] tracking-[0.24em] text-fg-dim max-view-tablet:hidden`,children:[t("strong",{className:"font-normal text-fg",children:b})," ","items",t("br",{}),e==="vehicles"?"Community photos":"Featured photos"]}),o&&t("span",{className:"pointer-events-none absolute inset-x-0 -bottom-px h-0.5 bg-accent"})]},e)})}),(I||Z||D)&&r("div",{className:h("mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-5 max-view-tablet:grid-cols-1 max-view-tablet:gap-4 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-3",u),style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[t("div",{className:"flex flex-wrap gap-1",children:I&&["all",...q].map(e=>{const a=A===e,o=e==="all"?"All":e;return t("button",{type:"button",onClick:()=>V(e),className:[`cursor-pointer border px-4 py-3 font-mono ${l.labelLarge} uppercase tracking-[0.2em] transition-colors`,a?"border-fg bg-fg text-bg":"border-transparent text-fg-dim hover:text-fg"].join(" "),children:C(o)},e)})}),Z?r("div",{className:`text-center font-mono ${l.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[t("strong",{className:"font-normal text-accent",children:$e})," / ",ke," ",n.unit]}):t("div",{}),D?r("div",{className:`flex items-center gap-3 font-mono ${l.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:[t("span",{children:"Sort"}),r(Oe,{value:_,onChange:e=>Ne(e.target.value),className:`cursor-pointer border border-line bg-bg px-3 py-2 font-mono ${l.labelLarge} uppercase tracking-[0.18em] text-fg`,children:[t("option",{value:"newest",children:"Newest"}),t("option",{value:"featured",children:"Featured"}),t("option",{value:"name",children:"Name A–Z"})]})]}):t("div",{})]}),t("div",{className:h("mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-5 pb-20 max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",u),children:F.length>0?t("div",{className:"grid grid-cols-6 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1",children:F.map((e,a)=>{const o=ee(e)[0],b=`group relative block aspect-[4/3] w-full overflow-hidden bg-surface-2 text-left ${a<2?"col-span-3 max-view-desktop:col-span-1":"col-span-2 max-view-desktop:col-span-1"}`,m=`${e.name??"card"}-${a}`,p=r(k,{children:[t(X,{label:T(e.name)||`gallery-card-${a+1}`,src:o||void 0,alt:G(e.name??""),sizes:"(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw",className:`transition-transform duration-700 ${ye?"scale-[1.04]":"group-hover:scale-[1.04]"}`}),r("div",{className:"pointer-events-none absolute inset-0 z-10 flex flex-col justify-between p-6 max-view-tablet:p-3",style:{background:"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)"},children:[r("div",{className:`flex items-start justify-between font-mono ${l.labelSmall} uppercase tracking-[0.24em]`,children:[e.process?t("span",{className:"text-accent",children:i(e.process)}):t("span",{}),r("span",{className:"text-overlay-fg/70",children:[String(a+1).padStart(2,"0")," / ",String(F.length).padStart(2,"0")]})]}),r("div",{className:"flex flex-col gap-2",children:[e.eyebrow&&t("div",{className:`font-mono ${l.labelSmall} uppercase tracking-[0.24em] text-accent`,children:i(e.eyebrow)}),e.name&&t("div",{className:"font-heading3 text-[length:var(--size-headingSmall,clamp(22px,2.4vw,32px))] font-medium uppercase leading-none tracking-[-0.02em] text-overlay-fg",children:i(e.name)}),e.meta&&t("div",{className:`flex flex-wrap gap-3 pt-1 font-mono ${l.labelXs} uppercase tracking-[0.2em] text-overlay-fg/70`,children:t("span",{children:i(e.meta)})})]})]})]});return w?t("div",{className:b,children:p},m):t("button",{type:"button",onClick:()=>v({card:e,index:0}),"aria-label":`Open ${e.name??"gallery item"}`,className:`${b} cursor-pointer focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2`,children:p},m)})}):t("div",{className:`py-20 text-center font-mono ${l.labelXl} uppercase tracking-[0.2em] text-fg-dim`,children:Q?"No items in this gallery yet.":"No items match this filter."})}),O&&(()=>{const e=ee(O.card),{card:a,index:o}=O,c=e.length,b=e[o]??e[0]??"",m=s=>v(d=>d&&{...d,index:(d.index+s+c)%c}),p=[a.process,a.meta].filter(Boolean).join(" · ");return r(Le,{open:!0,onClose:()=>v(null),label:a.name??"Gallery item",onPrev:c>1?()=>m(-1):void 0,onNext:c>1?()=>m(1):void 0,className:"flex cursor-zoom-out flex-col items-center justify-center p-6 max-view-tablet:p-3",children:[r("div",{className:"relative flex w-full flex-1 items-center justify-center",children:[t("div",{className:"relative h-full max-h-[72vh] w-full max-w-[92vw]",children:t(X,{label:T(a.name)||"gallery-photo",src:b||void 0,alt:G(a.name??""),objectFit:"contain",sizes:"92vw"})}),c>1&&r(k,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:s=>{s.stopPropagation(),m(-1)},className:"absolute left-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:s=>{s.stopPropagation(),m(1)},className:"absolute right-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"})]})]}),r("div",{className:`mt-5 flex flex-col items-center gap-3 text-center font-mono ${l.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,onClick:s=>s.stopPropagation(),children:[r("div",{className:"flex flex-col items-center gap-1",children:[a.name&&t("span",{className:"text-accent",children:i(a.name)}),a.eyebrow&&t("span",{children:i(a.eyebrow)}),r("span",{className:"text-fg-dim/70",children:[p?r(k,{children:[i(p)," · "]}):null,o+1," / ",c]})]}),a.href&&t(Se,{href:a.href,onClick:()=>v(null),className:`cursor-pointer border border-btn bg-btn/[0.08] px-5 py-3 font-mono ${l.labelLarge} uppercase tracking-[0.28em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,children:"View Product →"})]}),c>1&&t("div",{onClick:s=>s.stopPropagation(),className:"mt-5 flex max-w-[92vw] gap-2 overflow-x-auto pb-1",children:e.map((s,d)=>t("button",{type:"button","aria-label":`Photo ${d+1}`,onClick:()=>v(W=>W&&{...W,index:d}),className:["relative h-16 w-24 shrink-0 cursor-pointer overflow-hidden border transition-colors max-view-tablet:h-12 max-view-tablet:w-16",d===o?"border-accent":"border-line opacity-60 hover:border-fg-dim hover:opacity-100"].join(" "),children:t(X,{label:T(a.name)||"gallery-photo",src:s||void 0,alt:"",sizes:"120px"})},`${s}-${d}`))}),t(_e,{})]})})()]})}export{Te as default};
1
+ "use client";import{jsx as t,jsxs as r,Fragment as $}from"react/jsx-runtime";import ze from"next/link";import{useMemo as ae,useState as S}from"react";import{slugify as G,parseOption as Le}from"efficient-shell/format";import{stripMarkup as X}from"efficient-web-builder/format/lib/markup";import{renderChrome as C,renderGold as i,renderHeadline as _e}from"efficient-web-builder/render/components/goldPhrases";import U from"efficient-web-builder/render/components/Placeholder";import Oe,{LightboxClose as Pe}from"./Lightbox.js";import Ae from"./ThemedSelect.js";import{say as j}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as Te}from"efficient-web-builder/render/components/ViewHideRoot";import{withSideOnce as h}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as Fe}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as Ge}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as Xe}from"./SectionPadScope.js";const n={bodyUpTo720:"max-view-tablet:text-[length:var(--size-body,15px)]",labelUpTo720:"max-view-tablet:text-[length:var(--size-label,11px)]",body:"text-[length:var(--size-body,17px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"};function re(x){const g=[x.image,...(x.photos??[]).map(f=>f?.src)].filter(f=>!!f);return g.length?g:[""]}const B=6,Ue=()=>Array.from({length:B},(x,g)=>({image:"",process:j("Tag"),eyebrow:j("Category"),name:j("Item name"),meta:j("{n} photos",{n:`0${g+1}`})}));function Be({mode:x="both",kicker:g,breadcrumbLabel:f,vehicleTabLabel:H="Gallery A",vehicleTitle:ne,vehicleBody1:le,vehicleBody2:oe,vehicleStats:se,vehicleCards:E,wheelTabLabel:M="Gallery B",wheelTitle:ie,wheelBody1:ce,wheelBody2:pe,wheelStats:me,wheelCards:I,othersTitle:de,othersBody1:xe,othersBody2:ge,othersStats:fe,othersCards:ue,showBreadcrumb:Z=!0,showStats:be=!0,showIntro:he=!0,showTabs:ve=!0,showFilters:D=!0,showCount:R=!0,showSort:V=!0,previewTab:z,previewHover:we=!1,editing:y=!1}){const u=Fe(),v=Xe(),q=!!v&&!Z,L=x==="both",N=L?["vehicles","wheels"]:x==="wheels"?["wheels"]:x==="others"?["others"]:["vehicles"],[ye,Ne]=S(N[0]),k=(y&&L&&z&&N.includes(z)?z:null)??Le(N,N[0],ye),ke=y&&we,[_,J]=S("all"),[O,$e]=S("newest"),[P,w]=S(null),l=k==="vehicles"?{title:ne,body1:le,body2:oe,stats:se??[],cards:E??[],unit:"items",word:H}:k==="others"?{title:de,body1:xe,body2:ge,stats:fe??[],cards:ue??[],unit:"items",word:"Others"}:{title:ie,body1:ce,body2:pe,stats:me??[],cards:I??[],unit:"items",word:M},K=ae(()=>{const e=[];for(const a of l.cards)a.process&&!e.includes(a.process)&&e.push(a.process);return e},[l.cards]),A=_!=="all"&&K.includes(_)?_:"all",Q=A==="all"?l.cards:l.cards.filter(e=>e.process===A),W=ae(()=>{const e=[...Q];return O==="name"&&e.sort((a,s)=>(a.name??"").localeCompare(s.name??"")),e},[Q,O]),Y=l.cards.length===0,T=y&&Y,F=T?Ue():W,Se=T?B:l.cards.length,Ce=T?B:W.length,ee=g?`${g} · ${X(l.word)}`:void 0;function je(e){e!==k&&(Ne(e),J("all"))}return r(Te,{as:"section",...Ge("relative z-[2] bg-bg",v),children:[Z&&r("nav",{className:h(`mx-auto flex max-w-[var(--sf-site-width,1600px)] items-center gap-4 border-b border-line px-[var(--sf-site-gutter,40px)] ${v?"pb-6":"py-6"} font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] ${v?"max-view-tablet:pb-4":"max-view-tablet:py-4"}`,u),children:[t("span",{className:"hover:text-fg",children:"Home"}),t("span",{className:"opacity-40",children:"/"}),t("span",{className:"text-fg",children:f?C(f):"Gallery"})]}),r("div",{className:h(`mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-end gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)]${q?"":" pt-[100px]"} pb-[60px] max-view-desktop:grid-cols-1 max-view-desktop:gap-5 max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]${q?"":" max-view-desktop:pt-[60px]"}`,u),children:[t("span",{className:`pb-4 font-mono ${n.labelXl} uppercase tracking-[0.3em] text-accent`,children:ee?i(ee):null}),t("h2",{className:"font-display text-[length:min(var(--size-headingLarge,clamp(64px,9vw,140px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.9] tracking-[-0.04em]",children:l.title?_e(l.title,!0):null}),t("div",{className:`pb-4 text-right font-mono ${n.labelLarge} uppercase leading-[1.8] tracking-[0.18em] text-fg-dim max-view-desktop:text-left`,children:be&&l.stats.map((e,a)=>r("div",{children:[e.value?t("strong",{className:"font-normal text-fg",children:i(e.value)}):null," ",e.label?i(e.label):null]},a))})]}),he&&(l.body1||l.body2)&&r("div",{className:h("mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-2 gap-[60px] px-[var(--sf-site-gutter,40px)] pt-8 max-view-desktop:grid-cols-1 max-view-desktop:gap-4 max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",u),children:[l.body1&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body1)}),l.body2&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body2)})]}),L&&ve&&t("div",{className:h("mx-auto mt-10 flex max-w-[var(--sf-site-width,1600px)] items-stretch border-y border-line px-[var(--sf-site-gutter,40px)] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))] max-view-tablet:px-3",u),children:["vehicles","wheels"].map((e,a)=>{const s=k===e,c=e==="vehicles"?H:M,b=e==="vehicles"?(E??[]).length:(I??[]).length,p=(c||"").trim().split(/\s+/),m=p.slice(0,-1).join(" "),o=p.slice(-1)[0]??"";return r("button",{type:"button",onClick:()=>je(e),className:["group relative grid flex-1 cursor-pointer grid-cols-[auto_1fr_auto] items-end gap-5 px-6 py-8 text-left transition-colors",a===0?"border-r border-line":"","max-view-tablet:grid-cols-[auto_1fr] max-view-tablet:items-center max-view-tablet:gap-2 max-view-tablet:px-3 max-view-tablet:py-3",s?"bg-surface":"hover:bg-fg/[0.04]"].join(" "),children:[t("span",{className:[`pb-2 font-mono ${n.labelLarge} tracking-[0.3em] max-view-tablet:pb-0 ${n.labelUpTo720} max-view-tablet:tracking-[0.24em]`,s?"text-accent":"text-fg-dim group-hover:text-accent"].join(" "),children:a===0?"A":"B"}),r("span",{className:`font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3.6vw,48px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] ${n.bodyUpTo720}`,children:[m?r($,{children:[C(m)," "]}):null,t("em",{className:"font-normal italic text-accent",children:C(o)})]}),r("span",{className:`pb-2 text-right font-mono ${n.labelSmall} uppercase leading-[1.7] tracking-[0.24em] text-fg-dim max-view-tablet:hidden`,children:[t("strong",{className:"font-normal text-fg",children:b})," ","items",t("br",{}),e==="vehicles"?"Community photos":"Featured photos"]}),s&&t("span",{className:"pointer-events-none absolute inset-x-0 -bottom-px h-0.5 bg-accent"})]},e)})}),(D||R||V)&&r("div",{className:h("mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-5 max-view-tablet:grid-cols-1 max-view-tablet:gap-4 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-3",u),style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[t("div",{className:"flex flex-wrap gap-1",children:D&&["all",...K].map(e=>{const a=A===e,s=e==="all"?"All":e;return t("button",{type:"button",onClick:()=>J(e),className:[`cursor-pointer border px-4 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.2em] transition-colors`,a?"border-fg bg-fg text-bg":"border-transparent text-fg-dim hover:text-fg"].join(" "),children:C(s)},e)})}),R?r("div",{className:`text-center font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[t("strong",{className:"font-normal text-accent",children:Ce})," / ",Se," ",l.unit]}):t("div",{}),V?r("div",{className:`flex items-center gap-3 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:[t("span",{children:"Sort"}),r(Ae,{value:O,onChange:e=>$e(e.target.value),className:`cursor-pointer border border-line bg-bg px-3 py-2 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg`,children:[t("option",{value:"newest",children:"Newest"}),t("option",{value:"featured",children:"Featured"}),t("option",{value:"name",children:"Name A–Z"})]})]}):t("div",{})]}),t("div",{className:h(`mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-5${v?"":" pb-20"} max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,u),children:F.length>0?t("div",{className:"grid grid-cols-6 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1",children:F.map((e,a)=>{const s=re(e)[0],b=`group relative block aspect-[4/3] w-full overflow-hidden bg-surface-2 text-left ${a<2?"col-span-3 max-view-desktop:col-span-1":"col-span-2 max-view-desktop:col-span-1"}`,p=`${e.name??"card"}-${a}`,m=r($,{children:[t(U,{label:G(e.name)||`gallery-card-${a+1}`,src:s||void 0,alt:X(e.name??""),sizes:"(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw",className:`transition-transform duration-700 ${ke?"scale-[1.04]":"group-hover:scale-[1.04]"}`}),r("div",{className:"pointer-events-none absolute inset-0 z-10 flex flex-col justify-between p-6 max-view-tablet:p-3",style:{background:"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)"},children:[r("div",{className:`flex items-start justify-between font-mono ${n.labelSmall} uppercase tracking-[0.24em]`,children:[e.process?t("span",{className:"text-accent",children:i(e.process)}):t("span",{}),r("span",{className:"text-overlay-fg/70",children:[String(a+1).padStart(2,"0")," / ",String(F.length).padStart(2,"0")]})]}),r("div",{className:"flex flex-col gap-2",children:[e.eyebrow&&t("div",{className:`font-mono ${n.labelSmall} uppercase tracking-[0.24em] text-accent`,children:i(e.eyebrow)}),e.name&&t("div",{className:"font-heading3 text-[length:var(--size-headingSmall,clamp(22px,2.4vw,32px))] font-medium uppercase leading-none tracking-[-0.02em] text-overlay-fg",children:i(e.name)}),e.meta&&t("div",{className:`flex flex-wrap gap-3 pt-1 font-mono ${n.labelXs} uppercase tracking-[0.2em] text-overlay-fg/70`,children:t("span",{children:i(e.meta)})})]})]})]});return y?t("div",{className:b,children:m},p):t("button",{type:"button",onClick:()=>w({card:e,index:0}),"aria-label":`Open ${e.name??"gallery item"}`,className:`${b} cursor-pointer focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2`,children:m},p)})}):t("div",{className:`py-20 text-center font-mono ${n.labelXl} uppercase tracking-[0.2em] text-fg-dim`,children:Y?"No items in this gallery yet.":"No items match this filter."})}),P&&(()=>{const e=re(P.card),{card:a,index:s}=P,c=e.length,b=e[s]??e[0]??"",p=o=>w(d=>d&&{...d,index:(d.index+o+c)%c}),m=[a.process,a.meta].filter(Boolean).join(" · ");return r(Oe,{open:!0,onClose:()=>w(null),label:a.name??"Gallery item",onPrev:c>1?()=>p(-1):void 0,onNext:c>1?()=>p(1):void 0,className:"flex cursor-zoom-out flex-col items-center justify-center p-6 max-view-tablet:p-3",children:[r("div",{className:"relative flex w-full flex-1 items-center justify-center",children:[t("div",{className:"relative h-full max-h-[72vh] w-full max-w-[92vw]",children:t(U,{label:G(a.name)||"gallery-photo",src:b||void 0,alt:X(a.name??""),objectFit:"contain",sizes:"92vw"})}),c>1&&r($,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:o=>{o.stopPropagation(),p(-1)},className:"absolute left-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:o=>{o.stopPropagation(),p(1)},className:"absolute right-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"})]})]}),r("div",{className:`mt-5 flex flex-col items-center gap-3 text-center font-mono ${n.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,onClick:o=>o.stopPropagation(),children:[r("div",{className:"flex flex-col items-center gap-1",children:[a.name&&t("span",{className:"text-accent",children:i(a.name)}),a.eyebrow&&t("span",{children:i(a.eyebrow)}),r("span",{className:"text-fg-dim/70",children:[m?r($,{children:[i(m)," · "]}):null,s+1," / ",c]})]}),a.href&&t(ze,{href:a.href,onClick:()=>w(null),className:`cursor-pointer border border-btn bg-btn/[0.08] px-5 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.28em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,children:"View Product →"})]}),c>1&&t("div",{onClick:o=>o.stopPropagation(),className:"mt-5 flex max-w-[92vw] gap-2 overflow-x-auto pb-1",children:e.map((o,d)=>t("button",{type:"button","aria-label":`Photo ${d+1}`,onClick:()=>w(te=>te&&{...te,index:d}),className:["relative h-16 w-24 shrink-0 cursor-pointer overflow-hidden border transition-colors max-view-tablet:h-12 max-view-tablet:w-16",d===s?"border-accent":"border-line opacity-60 hover:border-fg-dim hover:opacity-100"].join(" "),children:t(U,{label:G(a.name)||"gallery-photo",src:o||void 0,alt:"",sizes:"120px"})},`${o}-${d}`))}),t(Pe,{})]})})()]})}export{Be as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,Fragment as g,jsxs as c}from"react/jsx-runtime";import{partSkus as Pe}from"../lib/catalog/part-skus.js";import te from"next/link";import{useEffect as ae,useRef as le,useState as $e}from"react";import{useCart as He}from"./CartContext.js";import{useSiteTakesOrders as Me}from"./SiteRecordContext.js";import Ue from"./EmailCaptureForm.js";import{useEnglish as ne}from"./EnglishVariant.js";import{MarkedLabel as re,heroView as je}from"./product-hero/hero-view.js";import{useRootIsDark as ze}from"efficient-shell/theme";import{useStockAlertSignup as De}from"./useStockAlertSignup.js";import{SPARE_WORDS as Be,productCartLine as Ve}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as Fe}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as Ye}from"../lib/catalog/product-options.js";import{trackViewItem as Ke}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as Qe,DEFAULT_HERO_RATIO as We,DEFAULT_HERO_TEXT_ALIGN as Xe,parseHeroLayout as Ge,parseHeroRatio as qe,parseHeroTextAlign as Je}from"../lib/sections/hero-arrangement.js";import{MAX_SPARES as Ze,UNITS_PER_SET as se,formatPrice as ie}from"../lib/commerce.js";import{formatSelectionPrice as et,setPriceLabel as tt}from"../lib/wheels/price-display.js";import{productIsDually as at,productIsTwoObjects as lt,setSuppressesRow as nt}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as oe}from"../lib/sections/content-cap-gutter.js";import{STICKY_COLUMNS_CLASS as rt,STICKY_SECTION_ATTR as st}from"../lib/sections/hero-sticky.js";import{useStickyColumns as it}from"./useStickyColumns.js";import{BLOCK_ALIGN_TEXT as ot}from"efficient-web-builder/format/lib/content/block-align";import{CardTemplateRows as I}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as P}from"efficient-web-builder/render/components/SiteGutterFrame";import{cardRow as ct}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as mt}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as pt}from"../lib/content/hero-option-seed.js";import{HERO_BUY_SLOT as dt,HERO_QUANTITY_PART as ut,HERO_SAVE_PART as ft}from"../lib/content/hero-buy-seed.js";import{HERO_PART as f}from"../lib/content/hero-seed.js";import ht from"./card-pieces/CardQuantity.js";import bt from"./card-pieces/CardSave.js";import gt from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as xt}from"./card-pieces/ProductCardState.js";import{PRODUCT_HERO_TYPE as $}from"../lib/document/document-nodes.js";import{withSideOnce as ce}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as vt}from"efficient-web-builder/render/components/SideSpaceOnce";const kt=4e3;function Tt(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const me=[{}],St=(e,r)=>r===ut?t(ht,{}):r===ft?t(bt,{}):null,yt="[&>[data-sf-repeat]]:contents [&>[data-sf-repeat]>div]:contents";function wt({product:e,selection:r,onLightbox:o,editing:s=!1,showVehicleFitment:i=!0,heroLayout:l=Qe,imageRatio:n=We,textAlign:S=Xe,showSpecTable:de=!0,stickyColumns:ue=!1,nodeId:y,template:fe,optionTemplate:he,optionPressTitles:be,buyTemplate:ge}){const H=vt(),xe=ne(),x=Ge(l),M=Je(S),k=qe(n),w=ue===!0&&x!=="stacked",U=le(null);it(U,w);const ve=x==="imageRight"?`${100-k}fr ${k}fr`:`${k}fr ${100-k}fr`,{picked:ke,pick:j,qty:z,setQty:Te,choice:D,setChoice:Se,angleIdx:Ot,setAngleIdx:Rt,showValidation:ye,setShowValidation:N,manualMode:B,vehicle:_,rows:V,facts:we,part:d,outOfStock:F,offer:Y,preOrder:O,canAddToCart:K,currency:h,price:p,set:Q,msrpLabel:Ne}=r,m=je(e,r,s),R=at(e),_e=lt(e),C=i?m.vehicle:null,Oe=i?m.vehicleMemory:null,W=!ze({whenUnset:!0}),{warmCatalog:X}=He(),T=Me();ae(()=>{!s&&T&&X(e.kind,e.slug)},[s,T,e.kind,e.slug,X]);const G=V.filter(a=>!O||a.values.length>0),q=G.filter(a=>a.role==="resolves"),A=G.filter(a=>a.role==="describes"&&!nt(_e,a.key)),J=A.findIndex(a=>a.chosen===null),Z=(!C||!m.vehicleAnswersSpecs||r.fitmentSet)&&Ye(V,O)?J===-1?A:A.slice(0,J+1):[],Re=[...q,...Z];function Ce(){return K?(N(!1),s?null:Ve(e,d,ke,{choice:D,qty:z},{fitmentLabel:B?m.specCaption:_.appliedName?`For ${_.appliedName}`:"",fitmentKey:B?`manual|${m.specCaption}`:`vehicle|${Tt(_.applied?.vehicle)}`})):(N(!0),window.setTimeout(()=>N(!1),kt),null)}const Ae={kind:"hero",msrpLabel:Ne||null,amount:R?tt(p,h):et(p,h),unitLabel:p.priced?m.unitLabel:null,packBadge:p.setTotal!=null?`${Y.quantityLabel}: ${ie(Q,h)}`:null,buy:{isSet:R,priced:p.priced,outOfStock:F,canAdd:K,totalLabel:p.setTotal!=null?ie(Q,h):null,lineToAdd:Ce},qty:z,setQty:Te,takesQty:T&&!(R&&!p.priced),save:{slug:e.slug,name:e.name},facts:de?we:null,title:{eyebrow:e.eyebrow,name:m.heading,badge:e.badge||null},product:e,selection:r,openLightbox:o,sku:Pe(d)},E={nodeId:y??"",template:he,pressTitles:be,editing:s},u=!!(O&&m.preOrder),Ee={[f.fitmentLine]:Oe,[f.options]:c(g,{children:[q.map(a=>t(pe,{row:a,onPick:j,options:E},a.key)),!u&&C,!u&&Z.map(a=>t(pe,{row:a,onPick:j,options:E},a.key))]}),[f.facts]:u?null:t(gt,{}),[f.howMany]:u?null:t(Nt,{offer:Y,takesOrders:T,choice:D,setChoice:Se,options:E}),[f.buy]:u?m.preOrder:t(P,{children:t(I,{ownerId:y??"",ownerType:$,slot:dt,Template:ge,rows:me,fallback:null,hostParts:St,children:a=>a})}),[f.notify]:!u&&F&&d?t(_t,{partNumbers:d.components.map(a=>a.partNumber),productSlug:e.slug},d.id):null,[f.reminder]:!u&&ye?Ie():null},Le=(a,b)=>Ee[b]??null;function Ie(){const a=Re.filter(L=>L.chosen===null).map(L=>xe(L.prompt).replace(/^Select\s+/i,""));if(C&&m.vehicleAnswersSpecs&&!r.fitmentSet&&a.push("vehicle fitment"),a.length===0)return null;const b=a.length===1?a[0]:a.length===2?`${a[0]} and ${a[1]}`:`${a.slice(0,-1).join(", ")}, and ${a.at(-1)}`;return c("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",b," first."]})}const ee=le(null);return ae(()=>{s||ee.current===e.slug||(ee.current=e.slug,Ke({itemId:d?`${e.slug}|${d.id}`:e.slug,itemName:e.name,variant:m.metaValue,pricePerSet:p.setTotal??p.fromSetTotal??0,currency:h}))},[s,e.slug,e.name,m.metaValue,d,p,h]),c(g,{children:[t("nav",{className:ce(`border-b border-line ${oe} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,H),style:W?void 0:{background:"var(--section-bg)"},children:e.crumbs.map((a,b)=>c("span",{children:[b>0&&c(g,{children:[t("span",{className:"mx-3 text-accent",children:"/"}),t("wbr",{})]}),a.href?t(te,{href:a.href,className:"hover:text-fg",children:t(re,{text:a.label})}):t("span",{className:"text-fg",children:t(re,{text:a.label})})]},`${a.label}-${b}`))}),t("section",{ref:U,"data-hero-layout":x,"data-hero-align":M,...w?{[st]:""}:{},className:[ce(`grid gap-10 ${oe} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8 ${yt}`,H),M==="center"?ot.center:"",x==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]",w?rt:""].filter(Boolean).join(" "),style:{...W?{}:{background:"var(--section-bg)"},...x==="stacked"?{}:{"--hero-cols":ve}},children:t(xt,{value:Ae,children:t(P,{children:t(I,{ownerId:y??"",ownerType:$,Template:fe,rows:me,fallback:null,hostParts:Le,children:a=>a})})})})]})}function Nt({offer:e,takesOrders:r,choice:o,setChoice:s,options:i}){return e.packs.length>0||r&&(e.extra||e.spareCounts.length>0)?c("div",{className:"border-b border-line pb-[26px]",children:[e.packs.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),t("div",{className:"flex flex-wrap gap-1.5",children:t(v,{hero:i,values:e.packs,item:l=>({label:l.label}),picked:l=>o.unit===l.value,press:l=>()=>s(n=>({...n,unit:l.value}))})})]}),r&&e.extra&&c("label",{className:`${e.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[t("input",{type:"checkbox",checked:o.spares>0,onChange:l=>s(n=>({...n,spares:l.target.checked?Ze:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),e.extra.label]}),r&&e.spareCounts.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:Be.howMany}),t("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:t(v,{hero:i,values:e.spareCounts,item:l=>({label:`${l.value} · ${l.label}`}),picked:l=>o.spares===l.value-se,press:l=>()=>s(n=>({...n,spares:l.value-se}))})})]}),r&&e.spareSide&&c(g,{children:[t("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.spareSide.label}),t("div",{className:"flex flex-wrap gap-1.5",children:t(v,{hero:i,values:e.spareSide.options,item:l=>({label:l.label}),picked:l=>o.spareSide===l.value,press:l=>()=>s(n=>({...n,spareSide:l.value}))})})]})]}):null}function pe({row:e,onPick:r,options:o}){const s=ne();if(e.values.length===0&&!e.empty)return null;const i=e.values.find(n=>n.value===e.chosen),l=i&&[i.label,i.note].filter(Boolean).join(" · ");return c("div",{className:"border-b border-line pb-[26px]",[Fe]:e.key,children:[c("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[s(e.label)," · ",t("span",{className:"text-accent",children:l??s(e.prompt)})]}),e.values.length===0?c("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[e.empty.text," ",t(te,{href:e.empty.href,className:"text-accent hover:underline",children:e.empty.linkText})]}):e.display==="swatch"?t("div",{className:"flex flex-wrap gap-2 [&>*]:max-w-full",children:t(v,{hero:o,values:e.values,item:n=>({swatch:n.swatch??"",name:n.label}),picked:n=>n.value===e.chosen,press:n=>()=>r(e.key,n.value)})}):t("div",{className:"flex flex-wrap gap-1.5",children:t(v,{hero:o,values:e.values,item:n=>({label:n.label,note:n.note??""}),picked:n=>n.value===e.chosen,press:n=>()=>r(e.key,n.value)})})]})}function v({hero:e,values:r,item:o,picked:s,press:i}){const l=mt(r,{item:o,selected:s,press:i});return t(P,{children:t(I,{ownerId:e.nodeId,ownerType:$,slot:pt,Template:e.template,rows:l.items.map(ct),items:l.items,states:l.states,actions:e.editing?void 0:l.actions,pressTitles:e.pressTitles,fallback:null,children:n=>n})})}function _t({partNumbers:e,productSlug:r}){const[o,s]=$e(""),{status:i,submit:l,reset:n}=De();function S(){l({partNumbers:e,email:o,productSlug:r})}return i==="sent"?t("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):t(Ue,{className:"-mt-1",email:o,onEmailChange:s,status:i,onResetVerdict:n,onSubmit:S,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{wt as default};
1
+ "use client";import{jsx as t,Fragment as g,jsxs as c}from"react/jsx-runtime";import{partSkus as He}from"../lib/catalog/part-skus.js";import ae from"next/link";import{useEffect as le,useRef as re,useState as Me}from"react";import{useCart as Ue}from"./CartContext.js";import{useSiteTakesOrders as je}from"./SiteRecordContext.js";import ze from"./EmailCaptureForm.js";import{useEnglish as ne}from"./EnglishVariant.js";import{MarkedLabel as se,heroView as De}from"./product-hero/hero-view.js";import{useRootIsDark as Be}from"efficient-shell/theme";import{useStockAlertSignup as Ve}from"./useStockAlertSignup.js";import{SPARE_WORDS as Fe,productCartLine as Ye}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as Ke}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as Qe}from"../lib/catalog/product-options.js";import{trackViewItem as We}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as Xe,DEFAULT_HERO_RATIO as Ge,DEFAULT_HERO_TEXT_ALIGN as qe,parseHeroLayout as Je,parseHeroRatio as Ze,parseHeroTextAlign as et}from"../lib/sections/hero-arrangement.js";import{MAX_SPARES as tt,UNITS_PER_SET as oe,formatPrice as ie}from"../lib/commerce.js";import{formatSelectionPrice as at,setPriceLabel as lt}from"../lib/wheels/price-display.js";import{productIsDually as rt,productIsTwoObjects as nt,setSuppressesRow as st}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ce}from"../lib/sections/content-cap-gutter.js";import{STICKY_COLUMNS_CLASS as ot,STICKY_SECTION_ATTR as it}from"../lib/sections/hero-sticky.js";import{useStickyColumns as ct}from"./useStickyColumns.js";import{BLOCK_ALIGN_TEXT as mt}from"efficient-web-builder/format/lib/content/block-align";import{CardTemplateRows as I}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as P}from"efficient-web-builder/render/components/SiteGutterFrame";import{cardRow as pt}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as dt}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as ut}from"../lib/content/hero-option-seed.js";import{HERO_BUY_SLOT as ft,HERO_QUANTITY_PART as ht,HERO_SAVE_PART as bt}from"../lib/content/hero-buy-seed.js";import{HERO_PART as f}from"../lib/content/hero-seed.js";import gt from"./card-pieces/CardQuantity.js";import xt from"./card-pieces/CardSave.js";import vt from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as kt}from"./card-pieces/ProductCardState.js";import{PRODUCT_HERO_TYPE as $}from"../lib/document/document-nodes.js";import{withSideOnce as me}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as Tt}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as pe}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSplitPads as St}from"./SectionPadScope.js";const yt=4e3;function wt(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const de=[{}],_t=(e,n)=>n===ht?t(gt,{}):n===bt?t(xt,{}):null,Nt="[&>[data-sf-repeat]]:contents [&>[data-sf-repeat]>div]:contents";function Ot({product:e,selection:n,onLightbox:i,editing:s=!1,showVehicleFitment:o=!0,heroLayout:l=Xe,imageRatio:r=Ge,textAlign:S=qe,showSpecTable:fe=!0,stickyColumns:he=!1,nodeId:y,template:be,optionTemplate:ge,optionPressTitles:xe,buyTemplate:ve}){const H=Tt(),ke=ne(),x=Je(l),M=et(S),k=Ze(r),w=he===!0&&x!=="stacked",U=re(null);ct(U,w);const Te=x==="imageRight"?`${100-k}fr ${k}fr`:`${k}fr ${100-k}fr`,{picked:Se,pick:j,qty:z,setQty:ye,choice:D,setChoice:we,angleIdx:At,setAngleIdx:Et,showValidation:_e,setShowValidation:_,manualMode:B,vehicle:N,rows:V,facts:Ne,part:d,outOfStock:F,offer:Y,preOrder:O,canAddToCart:K,currency:h,price:p,set:Q,msrpLabel:Oe}=n,m=De(e,n,s),R=rt(e),Re=nt(e),C=o?m.vehicle:null,Ce=o?m.vehicleMemory:null,W=!Be({whenUnset:!0}),{warmCatalog:X}=Ue(),T=je();le(()=>{!s&&T&&X(e.kind,e.slug)},[s,T,e.kind,e.slug,X]);const G=V.filter(a=>!O||a.values.length>0),q=G.filter(a=>a.role==="resolves"),A=G.filter(a=>a.role==="describes"&&!st(Re,a.key)),J=A.findIndex(a=>a.chosen===null),Z=(!C||!m.vehicleAnswersSpecs||n.fitmentSet)&&Qe(V,O)?J===-1?A:A.slice(0,J+1):[],Ae=[...q,...Z];function Ee(){return K?(_(!1),s?null:Ye(e,d,Se,{choice:D,qty:z},{fitmentLabel:B?m.specCaption:N.appliedName?`For ${N.appliedName}`:"",fitmentKey:B?`manual|${m.specCaption}`:`vehicle|${wt(N.applied?.vehicle)}`})):(_(!0),window.setTimeout(()=>_(!1),yt),null)}const Le={kind:"hero",msrpLabel:Oe||null,amount:R?lt(p,h):at(p,h),unitLabel:p.priced?m.unitLabel:null,packBadge:p.setTotal!=null?`${Y.quantityLabel}: ${ie(Q,h)}`:null,buy:{isSet:R,priced:p.priced,outOfStock:F,canAdd:K,totalLabel:p.setTotal!=null?ie(Q,h):null,lineToAdd:Ee},qty:z,setQty:ye,takesQty:T&&!(R&&!p.priced),save:{slug:e.slug,name:e.name},facts:fe?Ne:null,title:{eyebrow:e.eyebrow,name:m.heading,badge:e.badge||null},product:e,selection:n,openLightbox:i,sku:He(d)},E={nodeId:y??"",template:ge,pressTitles:xe,editing:s},u=!!(O&&m.preOrder),Ie={[f.fitmentLine]:Ce,[f.options]:c(g,{children:[q.map(a=>t(ue,{row:a,onPick:j,options:E},a.key)),!u&&C,!u&&Z.map(a=>t(ue,{row:a,onPick:j,options:E},a.key))]}),[f.facts]:u?null:t(vt,{}),[f.howMany]:u?null:t(Rt,{offer:Y,takesOrders:T,choice:D,setChoice:we,options:E}),[f.buy]:u?m.preOrder:t(P,{children:t(I,{ownerId:y??"",ownerType:$,slot:ft,Template:ve,rows:de,fallback:null,hostParts:_t,children:a=>a})}),[f.notify]:!u&&F&&d?t(Ct,{partNumbers:d.components.map(a=>a.partNumber),productSlug:e.slug},d.id):null,[f.reminder]:!u&&_e?$e():null},Pe=(a,b)=>Ie[b]??null;function $e(){const a=Ae.filter(L=>L.chosen===null).map(L=>ke(L.prompt).replace(/^Select\s+/i,""));if(C&&m.vehicleAnswersSpecs&&!n.fitmentSet&&a.push("vehicle fitment"),a.length===0)return null;const b=a.length===1?a[0]:a.length===2?`${a[0]} and ${a[1]}`:`${a.slice(0,-1).join(", ")}, and ${a.at(-1)}`;return c("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",b," first."]})}const ee=re(null);le(()=>{s||ee.current===e.slug||(ee.current=e.slug,We({itemId:d?`${e.slug}|${d.id}`:e.slug,itemName:e.name,variant:m.metaValue,pricePerSet:p.setTotal??p.fromSetTotal??0,currency:h}))},[s,e.slug,e.name,m.metaValue,d,p,h]);const te=St();return c(g,{children:[t("nav",{...pe(me(`border-b border-line ${ce} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,H),te?.first?.atTop,W?void 0:{background:"var(--section-bg)"}),children:e.crumbs.map((a,b)=>c("span",{children:[b>0&&c(g,{children:[t("span",{className:"mx-3 text-accent",children:"/"}),t("wbr",{})]}),a.href?t(ae,{href:a.href,className:"hover:text-fg",children:t(se,{text:a.label})}):t("span",{className:"text-fg",children:t(se,{text:a.label})})]},`${a.label}-${b}`))}),t("section",{ref:U,"data-hero-layout":x,"data-hero-align":M,...w?{[it]:""}:{},...pe([me(`grid gap-10 ${ce} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8 ${Nt}`,H),M==="center"?mt.center:"",x==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]",w?ot:""].filter(Boolean).join(" "),te?.second?.atTop,{...W?{}:{background:"var(--section-bg)"},...x==="stacked"?{}:{"--hero-cols":Te}}),children:t(kt,{value:Le,children:t(P,{children:t(I,{ownerId:y??"",ownerType:$,Template:be,rows:de,fallback:null,hostParts:Pe,children:a=>a})})})})]})}function Rt({offer:e,takesOrders:n,choice:i,setChoice:s,options:o}){return e.packs.length>0||n&&(e.extra||e.spareCounts.length>0)?c("div",{className:"border-b border-line pb-[26px]",children:[e.packs.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),t("div",{className:"flex flex-wrap gap-1.5",children:t(v,{hero:o,values:e.packs,item:l=>({label:l.label}),picked:l=>i.unit===l.value,press:l=>()=>s(r=>({...r,unit:l.value}))})})]}),n&&e.extra&&c("label",{className:`${e.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[t("input",{type:"checkbox",checked:i.spares>0,onChange:l=>s(r=>({...r,spares:l.target.checked?tt:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),e.extra.label]}),n&&e.spareCounts.length>0&&c(g,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:Fe.howMany}),t("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:t(v,{hero:o,values:e.spareCounts,item:l=>({label:`${l.value} · ${l.label}`}),picked:l=>i.spares===l.value-oe,press:l=>()=>s(r=>({...r,spares:l.value-oe}))})})]}),n&&e.spareSide&&c(g,{children:[t("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.spareSide.label}),t("div",{className:"flex flex-wrap gap-1.5",children:t(v,{hero:o,values:e.spareSide.options,item:l=>({label:l.label}),picked:l=>i.spareSide===l.value,press:l=>()=>s(r=>({...r,spareSide:l.value}))})})]})]}):null}function ue({row:e,onPick:n,options:i}){const s=ne();if(e.values.length===0&&!e.empty)return null;const o=e.values.find(r=>r.value===e.chosen),l=o&&[o.label,o.note].filter(Boolean).join(" · ");return c("div",{className:"border-b border-line pb-[26px]",[Ke]:e.key,children:[c("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[s(e.label)," · ",t("span",{className:"text-accent",children:l??s(e.prompt)})]}),e.values.length===0?c("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[e.empty.text," ",t(ae,{href:e.empty.href,className:"text-accent hover:underline",children:e.empty.linkText})]}):e.display==="swatch"?t("div",{className:"flex flex-wrap gap-2 [&>*]:max-w-full",children:t(v,{hero:i,values:e.values,item:r=>({swatch:r.swatch??"",name:r.label}),picked:r=>r.value===e.chosen,press:r=>()=>n(e.key,r.value)})}):t("div",{className:"flex flex-wrap gap-1.5",children:t(v,{hero:i,values:e.values,item:r=>({label:r.label,note:r.note??""}),picked:r=>r.value===e.chosen,press:r=>()=>n(e.key,r.value)})})]})}function v({hero:e,values:n,item:i,picked:s,press:o}){const l=dt(n,{item:i,selected:s,press:o});return t(P,{children:t(I,{ownerId:e.nodeId,ownerType:$,slot:ut,Template:e.template,rows:l.items.map(pt),items:l.items,states:l.states,actions:e.editing?void 0:l.actions,pressTitles:e.pressTitles,fallback:null,children:r=>r})})}function Ct({partNumbers:e,productSlug:n}){const[i,s]=Me(""),{status:o,submit:l,reset:r}=Ve();function S(){l({partNumbers:e,email:i,productSlug:n})}return o==="sent"?t("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):t(ze,{className:"-mt-1",email:i,onEmailChange:s,status:o,onResetVerdict:r,onSubmit:S,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{Ot as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{useState as r}from"react";import{products as j}from"../lib/api/index.js";import q from"efficient-web-builder/render/components/SectionEyebrow";import n,{FieldCaption as z}from"./WebFormField.js";import{renderHeadline as O}from"efficient-web-builder/render/components/goldPhrases";import{FIELD_INPUT_CLASS as l}from"../lib/field-input.js";import{HideTaker as T}from"efficient-web-builder/render/components/ViewHideRoot";import A from"./SectionBand.js";import{withSideOnce as I}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as M}from"efficient-web-builder/render/components/SideSpaceOnce";const B="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",D="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function L({eyebrow:p,title:u,designCode:d,omitHead:w=!1,editing:x=!1}={}){const N=M(),[f,y]=r(""),[o,S]=r(""),[a,R]=r(0),[m,k]=r(""),[g,C]=r(""),[c,h]=r(!1),[E,F]=r(!1),[v,i]=r(null);async function _(t){if(t.preventDefault(),!(x||c)){if(a<1){i("Choose a star rating.");return}h(!0),i(null);try{await j.submitReview({authorName:f.trim(),...o.trim()?{email:o.trim()}:{},rating:a,...m.trim()?{title:m.trim()}:{},body:g.trim(),...d?.trim()?{designCode:d.trim()}:{}}),F(!0)}catch{i("Something went wrong — your review wasn't sent. Please try again.")}finally{h(!1)}}}const b=E?e("p",{role:"status",className:"max-w-[560px] font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:"Thanks — your review will appear once approved."}):s("form",{className:"flex max-w-[720px] flex-col gap-5",onSubmit:_,children:[s("div",{className:"grid grid-cols-2 gap-3 max-[640px]:grid-cols-1",children:[e(n,{label:"Name",required:!0,children:e("input",{type:"text",required:!0,value:f,onChange:t=>y(t.target.value),className:l})}),e(n,{label:"Email — never shown publicly",children:e("input",{type:"email",value:o,onChange:t=>S(t.target.value),className:l})})]}),s("div",{className:"flex flex-col gap-2",children:[e(z,{required:!0,children:"Rating"}),e("div",{role:"group","aria-label":"Rating",className:"flex gap-1",children:[1,2,3,4,5].map(t=>e("button",{type:"button","aria-pressed":a>=t,"aria-label":`${t} star${t===1?"":"s"}`,onClick:()=>{R(t),i(null)},className:["cursor-pointer text-[30px] leading-none transition-colors",a>=t?"text-accent":"text-fg-dim/30 hover:text-fg-dim"].join(" "),children:"★"},t))})]}),e(n,{label:"Review title (optional)",children:e("input",{type:"text",value:m,onChange:t=>k(t.target.value),className:l})}),e(n,{label:"Your review",required:!0,children:e("textarea",{required:!0,rows:5,value:g,onChange:t=>C(t.target.value),className:l+" resize-y"})}),v&&e("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:v}),e("button",{type:x?"button":"submit",disabled:c,className:"cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60",children:c?"Sending…":"Submit review →"})]});return w?e(A,{className:"relative z-[2] border-t border-line bg-surface",column:D,children:b}):e(T,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:s("div",{className:I(B,N),children:[(p??"").trim()&&e(q,{text:p??"",scaled:!1,className:"mb-4 block"}),(u??"").trim()&&e("h2",{className:"mb-12 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:O(u??"",!1)}),b]})})}export{L as default};
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useState as r}from"react";import{products as j}from"../lib/api/index.js";import q from"efficient-web-builder/render/components/SectionEyebrow";import s,{FieldCaption as z}from"./WebFormField.js";import{renderHeadline as T}from"efficient-web-builder/render/components/goldPhrases";import{FIELD_INPUT_CLASS as o}from"../lib/field-input.js";import{HideTaker as A}from"efficient-web-builder/render/components/ViewHideRoot";import I from"./SectionBand.js";import{withSideOnce as M}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as P}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as B}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as D}from"./SectionPadScope.js";const L="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",H="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function W({eyebrow:p,title:u,designCode:d,omitHead:w=!1,editing:x=!1}={}){const N=P(),y=D(),[f,S]=r(""),[l,R]=r(""),[a,C]=r(0),[m,k]=r(""),[g,E]=r(""),[c,h]=r(!1),[F,_]=r(!1),[v,i]=r(null);async function O(t){if(t.preventDefault(),!(x||c)){if(a<1){i("Choose a star rating.");return}h(!0),i(null);try{await j.submitReview({authorName:f.trim(),...l.trim()?{email:l.trim()}:{},rating:a,...m.trim()?{title:m.trim()}:{},body:g.trim(),...d?.trim()?{designCode:d.trim()}:{}}),_(!0)}catch{i("Something went wrong — your review wasn't sent. Please try again.")}finally{h(!1)}}}const b=F?e("p",{role:"status",className:"max-w-[560px] font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:"Thanks — your review will appear once approved."}):n("form",{className:"flex max-w-[720px] flex-col gap-5",onSubmit:O,children:[n("div",{className:"grid grid-cols-2 gap-3 max-[640px]:grid-cols-1",children:[e(s,{label:"Name",required:!0,children:e("input",{type:"text",required:!0,value:f,onChange:t=>S(t.target.value),className:o})}),e(s,{label:"Email — never shown publicly",children:e("input",{type:"email",value:l,onChange:t=>R(t.target.value),className:o})})]}),n("div",{className:"flex flex-col gap-2",children:[e(z,{required:!0,children:"Rating"}),e("div",{role:"group","aria-label":"Rating",className:"flex gap-1",children:[1,2,3,4,5].map(t=>e("button",{type:"button","aria-pressed":a>=t,"aria-label":`${t} star${t===1?"":"s"}`,onClick:()=>{C(t),i(null)},className:["cursor-pointer text-[30px] leading-none transition-colors",a>=t?"text-accent":"text-fg-dim/30 hover:text-fg-dim"].join(" "),children:"★"},t))})]}),e(s,{label:"Review title (optional)",children:e("input",{type:"text",value:m,onChange:t=>k(t.target.value),className:o})}),e(s,{label:"Your review",required:!0,children:e("textarea",{required:!0,rows:5,value:g,onChange:t=>E(t.target.value),className:o+" resize-y"})}),v&&e("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:v}),e("button",{type:x?"button":"submit",disabled:c,className:"cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60",children:c?"Sending…":"Submit review →"})]});return w?e(I,{className:"relative z-[2] border-t border-line bg-surface",column:H,padOnColumn:!0,children:b}):e(A,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:n("div",{...B(M(L,N),y),children:[(p??"").trim()&&e(q,{text:p??"",scaled:!1,className:"mb-4 block"}),(u??"").trim()&&e("h2",{className:"mb-12 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:T(u??"",!1)}),b]})})}export{W as default};
@@ -1 +1 @@
1
- import{jsx as e,Fragment as h,jsxs as i}from"react/jsx-runtime";import u from"efficient-web-builder/render/components/SectionEyebrow";import{renderHeadline as b,splitParagraphs as v}from"efficient-web-builder/render/components/goldPhrases";import N from"./RatingStars.js";import y from"./SectionBand.js";const t={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,19px)]",label:"text-[length:var(--size-label,12px)]"},w="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function k({look:d,eyebrow:n,title:r,columns:p,rows:s=[],editing:o=!1,sample:x=!1,cards:g,omitHead:l=!1}){const c=Math.min(3,Math.max(1,p??3));return!o&&s.length===0?null:i(y,{className:"relative z-[2] border-t border-line bg-surface",column:l?M:w,children:[l?null:i(h,{children:[(n??"").trim()&&e(u,{text:n??"",look:d,className:"mb-4 block"}),(r??"").trim()&&e("h2",{className:`mb-12 font-heading2 ${t.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 ${t.headingMediumUpTo800}`,children:b(r??"",!1)})]}),e("div",{className:"sf-card grid grid-cols-1 gap-px border border-line bg-line min-[700px]:[grid-template-columns:repeat(var(--rv-cols),minmax(0,1fr))]",style:{"--rv-cols":String(c)},children:g??s.map(a=>i("article",{className:["flex flex-col gap-4 bg-bg p-10 max-view-wide:p-8",x?"opacity-60":""].join(" "),children:[a.rating!==void 0&&e(N,{rating:a.rating}),(a.title??"").trim()&&e("h3",{className:`font-display ${t.bodyLarge} font-medium uppercase leading-[1.2] tracking-[-0.01em] text-fg`,children:a.title}),e("div",{className:`flex-1 font-serif ${t.bodySmall} leading-[1.65] text-fg-dim`,children:v(a.quote).map((f,m)=>e("p",{className:m?"mt-3":"",children:f},m))}),i("footer",{className:"flex items-baseline justify-between gap-4 border-t border-line pt-5",children:[e("span",{className:`font-mono ${t.label} uppercase tracking-[0.22em] text-fg`,children:a.name}),e("span",{className:`font-mono ${t.label} uppercase tracking-[0.18em] text-fg-dim`,children:a.meta??""})]})]},a.key))})]})}export{M as FRAME_OWN_BOX,k as default};
1
+ import{jsx as e,Fragment as h,jsxs as i}from"react/jsx-runtime";import u from"efficient-web-builder/render/components/SectionEyebrow";import{renderHeadline as b,splitParagraphs as v}from"efficient-web-builder/render/components/goldPhrases";import N from"./RatingStars.js";import y from"./SectionBand.js";const t={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,19px)]",label:"text-[length:var(--size-label,12px)]"},w="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function k({look:d,eyebrow:n,title:r,columns:p,rows:s=[],editing:o=!1,sample:x=!1,cards:g,omitHead:l=!1}){const c=Math.min(3,Math.max(1,p??3));return!o&&s.length===0?null:i(y,{className:"relative z-[2] border-t border-line bg-surface",column:l?M:w,padOnColumn:!0,children:[l?null:i(h,{children:[(n??"").trim()&&e(u,{text:n??"",look:d,className:"mb-4 block"}),(r??"").trim()&&e("h2",{className:`mb-12 font-heading2 ${t.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 ${t.headingMediumUpTo800}`,children:b(r??"",!1)})]}),e("div",{className:"sf-card grid grid-cols-1 gap-px border border-line bg-line min-[700px]:[grid-template-columns:repeat(var(--rv-cols),minmax(0,1fr))]",style:{"--rv-cols":String(c)},children:g??s.map(a=>i("article",{className:["flex flex-col gap-4 bg-bg p-10 max-view-wide:p-8",x?"opacity-60":""].join(" "),children:[a.rating!==void 0&&e(N,{rating:a.rating}),(a.title??"").trim()&&e("h3",{className:`font-display ${t.bodyLarge} font-medium uppercase leading-[1.2] tracking-[-0.01em] text-fg`,children:a.title}),e("div",{className:`flex-1 font-serif ${t.bodySmall} leading-[1.65] text-fg-dim`,children:v(a.quote).map((f,m)=>e("p",{className:m?"mt-3":"",children:f},m))}),i("footer",{className:"flex items-baseline justify-between gap-4 border-t border-line pt-5",children:[e("span",{className:`font-mono ${t.label} uppercase tracking-[0.22em] text-fg`,children:a.name}),e("span",{className:`font-mono ${t.label} uppercase tracking-[0.18em] text-fg-dim`,children:a.meta??""})]})]},a.key))})]})}export{M as FRAME_OWN_BOX,k as default};
@@ -1,6 +1,6 @@
1
1
  import type { CSSProperties, ReactNode, Ref } from "react";
2
2
  export { BAND_CAP } from "../lib/sections/section-band.js";
3
- export default function SectionBand({ className, capped, column, style, defaults, id, attrs, rootRef, inAnyBox, children, }: {
3
+ export default function SectionBand({ className, capped, column, style, defaults, id, attrs, rootRef, inAnyBox, padOnColumn, children, }: {
4
4
  className: string;
5
5
  capped?: boolean;
6
6
  column?: string | null;
@@ -10,5 +10,6 @@ export default function SectionBand({ className, capped, column, style, defaults
10
10
  attrs?: Record<string, string>;
11
11
  rootRef?: Ref<HTMLElement>;
12
12
  inAnyBox?: boolean;
13
+ padOnColumn?: boolean;
13
14
  children?: ReactNode;
14
15
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{EDITORIAL_COLUMN as O,withSideOnce as S}from"efficient-web-builder/format/lib/content/page-width";import{BAND_CAP as u,bandClassesInBox as f}from"../lib/sections/section-band.js";import T from"./SectionBandChoice.js";import{HideTaker as m}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as _}from"efficient-web-builder/render/components/SideSpaceOnce";import{BAND_CAP as P}from"../lib/sections/section-band.js";function h({className:i,capped:p=!1,column:e=O,style:s,defaults:t,id:r,attrs:a,rootRef:c,inAnyBox:l=!1,children:n}){const x=_(),B=f(i),d=e===null?"":f(e),A=o(m,{as:"section",ref:c,...a,className:B||void 0,style:s,id:r,children:d?o("div",{className:d,children:n}):n}),C=t?{...t,...s}:s,N=o(m,{as:"section",ref:c,...a,className:p?`${u} ${i}`:i,style:C,id:r,children:e===null?n:o("div",{className:S(e,x),children:n})});return o(T,{inBox:A,atTop:N,anyBox:l})}export{P as BAND_CAP,h as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{EDITORIAL_COLUMN as I,withSideOnce as j}from"efficient-web-builder/format/lib/content/page-width";import{BAND_CAP as k,bandClassesInBox as f}from"../lib/sections/section-band.js";import v from"./SectionBandChoice.js";import{HideTaker as x}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as L}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as i}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPads as $}from"./SectionPadScope.js";import{BAND_CAP as K}from"../lib/sections/section-band.js";function E({className:s,capped:B=!1,column:t=I,style:e,defaults:r,id:c,attrs:d,rootRef:l,inAnyBox:S=!1,padOnColumn:m=!1,children:n}){const u=L(),a=$(),A=f(s),p=t===null?"":f(t),{className:y,style:C,...N}=i(A,a.inBox,e),P=o(x,{as:"section",ref:l,...d,...N,className:y||void 0,style:C,id:c,children:p?o("div",{className:p,children:n}):n}),T=r?{...r,...e}:e,b=m?null:a.atTop,h=m?a.atTop:null,{className:O,style:_,...w}=i(B?`${k} ${s}`:s,b,T),D=o(x,{as:"section",ref:l,...d,...w,className:O,style:_,id:c,children:t===null?n:o("div",{...i(j(t,u),h),children:n})});return o(v,{inBox:P,atTop:D,anyBox:S})}export{K as BAND_CAP,E as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{HideTaker as r}from"efficient-web-builder/render/components/ViewHideRoot";import{withSideOnce as c}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as n}from"efficient-web-builder/render/components/SideSpaceOnce";const i="font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim";function o({size:s,children:t}){const a=n();return s==="tall"?e(r,{as:"section",className:"grid min-h-[70vh] place-items-center border-b border-line px-[var(--sf-site-gutter,40px)] pt-[104px] pb-14 text-center",style:{background:"var(--section-bg)"},children:e("p",{className:i,children:t})}):e(r,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:e("div",{className:c("mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",a),children:e("p",{className:i,children:t})})})}export{i as SECTION_NOTICE_TEXT_CLASS,o as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{HideTaker as r}from"efficient-web-builder/render/components/ViewHideRoot";import{withSideOnce as n}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as p}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as c}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as m}from"./SectionPadScope.js";const i="font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim";function x({size:o,children:t}){const s=p(),a=m();return o==="tall"?e(r,{as:"section",className:"grid min-h-[70vh] place-items-center border-b border-line px-[var(--sf-site-gutter,40px)] pt-[104px] pb-14 text-center",style:{background:"var(--section-bg)"},children:e("p",{className:i,children:t})}):e(r,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:e("div",{...c(n("mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",s),a),children:e("p",{className:i,children:t})})})}export{i as SECTION_NOTICE_TEXT_CLASS,x as default};
@@ -0,0 +1,23 @@
1
+ import { type ReactNode } from "react";
2
+ import type { RootPadAttrs } from "efficient-web-builder/render/lib/content/section-padding";
3
+ export type SectionPad = {
4
+ atTop: RootPadAttrs | null;
5
+ inBox: RootPadAttrs | null;
6
+ };
7
+ export declare function SectionPadScope({ pad, children }: {
8
+ pad: SectionPad;
9
+ children: ReactNode;
10
+ }): import("react").JSX.Element;
11
+ export declare const useSectionPad: () => RootPadAttrs | null;
12
+ export declare const useSectionPads: () => SectionPad;
13
+ export type SplitPads = {
14
+ first: SectionPad | null;
15
+ second: SectionPad | null;
16
+ firstOnly: SectionPad | null;
17
+ secondOnly: SectionPad | null;
18
+ };
19
+ export declare function SplitPadScope({ pads, children }: {
20
+ pads: SplitPads | undefined;
21
+ children: ReactNode;
22
+ }): import("react").JSX.Element;
23
+ export declare const useSplitPads: () => SplitPads | undefined;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as o,Fragment as s}from"react/jsx-runtime";import{createContext as c,useContext as n}from"react";const p={atTop:null,inBox:null},r=c(p);function l({pad:e,children:t}){return o(r.Provider,{value:e,children:t})}const d=()=>n(r).atTop,x=()=>n(r),i=c(void 0);function S({pads:e,children:t}){return e?o(i.Provider,{value:e,children:t}):o(s,{children:t})}const P=()=>n(i);export{l as SectionPadScope,S as SplitPadScope,d as useSectionPad,x as useSectionPads,P as useSplitPads};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n,Fragment as he}from"react/jsx-runtime";import{useState as ee}from"react";import{withRMark as X}from"efficient-web-builder/render/components/RMark";import{FilterPill as R,OptButton as G,PanelTitle as L,PillButton as fe}from"./FilterPill.js";import{useCatalogFilterLabels as ge}from"./CatalogFilterLabels.js";import{CatalogVehicleNextRow as xe,CatalogVehicleFieldRow as be,CatalogVehicleRow as le,CatalogVehicleSheet as ve}from"./CatalogVehiclePicker.js";import{facetFieldKey as ie,keepForFilter as Ce,orderByAnswers as Ne}from"../../lib/content/field-usage.js";import{PLP_ONE_VALUE_MAX as re}from"../../lib/wheels/plp-filters.js";import{DEFAULT_FILTER_BAR_LAYOUT as ke}from"../../lib/sections/catalog-filter-layout.js";import{SORT_LABELS as H}from"../../lib/wheels/catalog-filters.js";import{FINISH_FAMILY_SWATCHES as ne}from"../../lib/wheels/finish-defaults.js";import{VEHICLE_FIELD_ORDER as ye}from"../../lib/wheels/vehicle-field-focus.js";import{CONTENT_CAP_GUTTER as ae}from"../../lib/sections/content-cap-gutter.js";import{CATALOG_TEXT_SIZE as _e}from"../../lib/sections/catalog-text-size.js";import{lugFilterLabel as oe}from"../../lib/wheels/lug-count.js";import se from"./PriceRange.js";import ce from"./SortSelect.js";const h=_e,te=Object.keys(H),z={size:ie("diameters","alloy-wheel"),finish:ie("finishes","alloy-wheel")};function pe(s,o){return Ne(s,d=>Object.hasOwn(z,String(d.key))?z[String(d.key)]:void 0,o??[],"filterOrder")}function Fe({processCount:s,sizeCount:o,lugCount:d,finishCount:f,optionsReported:g,fieldUsage:O}){const x=B=>!g||B>re,y=Ce(O??[]);return{process:s>re,size:y(z.size)&&x(o),lugs:x(d),finish:y(z.finish)&&x(f)}}function N(s,o){return s===o?null:o}function de({href:s,label:o}){return e("a",{href:s,"data-results-link":!0,className:`inline-block self-start border-0 border-b border-line bg-transparent pb-2 font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg transition-colors hover:text-fg-dim`,children:o})}function Te({filters:s,setProcess:o,setSize:d,setLugs:f,setFinish:g,setPriceMin:O,setPriceMax:x,setSort:y,clearAll:B,total:b,scrollProcess:Y,show:m,picker:c,lugOptions:I=[],sizeOptions:j=[],finishOptions:q,priceBounds:K=null,layout:me=ke,processOptions:M=[],resultsLink:v,optionsReported:ue=!1,fieldUsage:P}){const[t,u]=ee(null),[Z,V]=ee(null),p=ge(),{process:_,size:F,lugs:T,finish:w,priceMin:D,priceMax:U,sort:J}=s,W=q?ne.filter(i=>q.includes(i.f)):ne,S=Fe({processCount:M.length,sizeCount:j.length,lugCount:I.length,finishCount:W.length,optionsReported:ue,fieldUsage:P}),r={process:(m?.process??!0)&&S.process,size:(m?.size??!0)&&S.size,lugs:(m?.lugs??!0)&&S.lugs,finish:(m?.finish??!0)&&S.finish,price:m?.price??!0,vehicle:(m?.vehicle??!0)&&!!c,count:m?.count??!0,sort:m?.sort??!0},C={process:_?1:0,size:F?1:0,lugs:T?1:0,finish:w?1:0,price:D!=null||U!=null?1:0,vehicle:c?.appliedName?1:0},Q=()=>{B(),c?.clear(),u(null),V(null)};if(me==="columns"){const i=l=>V(Z===l?null:l),a=[];r.vehicle&&c&&a.push(n(k,{name:"vehicle",label:p.vehicle,children:[ye.map(l=>e(be,{field:l,picker:c,open:Z===l,onOpenRequest:i,onClose:()=>V(null)},l)),e(xe,{picker:c,onOpenRequest:i})]},"vehicle"));const E=[];return r.process&&E.push(e(k,{name:"process",label:p.process,rowsAreOptions:!0,children:M.map(l=>e($,{active:_===l,onClick:()=>o(N(_,l)),children:X(l)},l))},"process")),r.size&&E.push(e(k,{name:"size",label:p.size,rowsAreOptions:!0,children:j.map(l=>n($,{active:F===l,onClick:()=>d(N(F,l)),children:[l,'"']},l))},"size")),r.lugs&&E.push(e(k,{name:"lugs",label:p.lugs,rowsAreOptions:!0,children:I.map(l=>e($,{active:T===l,onClick:()=>f(N(T,l)),children:oe(l)},l))},"lugs")),r.finish&&E.push(e(k,{name:"finish",label:p.finish,rowsAreOptions:!0,children:W.map(l=>e($,{active:w===l.f,onClick:()=>g(w===l.f?null:l.f),children:l.label},l.f))},"finish")),a.push(...pe(E,P)),r.price&&a.push(e(k,{name:"price",label:p.price,tight:!0,children:e(se,{bounds:K,boxes:"line",min:D,max:U,onMin:O,onMax:x})},"price")),n("div",{className:"@container",children:[n("div",{className:`border-t border-line ${ae} pb-12 pt-10 @max-[720px]:px-4 @max-[720px]:pb-10 @max-[720px]:pt-8`,children:[(r.count||r.sort)&&n("div",{className:"mb-10 flex flex-wrap items-center gap-x-6 gap-y-3 @max-[720px]:mb-8",children:[r.count&&n("span",{className:`font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[b," ",b===1?"result":"results"]}),r.sort&&n("div",{className:"ml-auto flex items-center gap-5",children:[e("button",{type:"button",onClick:Q,className:`font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:"Clear All"}),e(ce,{look:"line",value:J,keys:te,labels:H,onChange:y})]})]}),e("div",{"data-filter-columns":!0,className:`grid grid-cols-1 gap-x-[72px] gap-y-10 ${Ae[a.length]??""}`,children:a}),v&&e("div",{className:"mt-10 flex",children:e(de,{href:v.href,label:v.label})})]}),r.vehicle&&c&&e(le,{picker:c,total:b})]})}const A=[];return r.process&&A.push(n(R,{name:"process",label:Y?n(he,{children:[e("span",{className:"text-accent @min-[720px]:hidden",children:X(Y)}),e("span",{className:"hidden @min-[720px]:inline",children:p.process})]}):p.process,badge:C.process,open:t==="process",onToggle:()=>u(t==="process"?null:"process"),children:[e(L,{children:"Series · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Process series",children:M.map(i=>{const a=_===i;return e(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>o(N(_,i)),children:X(i)},i)})})]},"process")),r.size&&A.push(n(R,{name:"size",label:p.size,badge:C.size,open:t==="size",onToggle:()=>u(t==="size"?null:"size"),children:[e(L,{children:"Diameter · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Wheel diameter",children:j.map(i=>{const a=F===i;return n(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>d(N(F,i)),children:[i,'"']},i)})})]},"size")),r.lugs&&A.push(n(R,{name:"lugs",label:p.lugs,badge:C.lugs,open:t==="lugs",onToggle:()=>u(t==="lugs"?null:"lugs"),children:[e(L,{children:"Lug count · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Lug count",children:I.map(i=>{const a=T===i;return e(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>f(N(T,i)),children:oe(i)},i)})})]},"lugs")),r.finish&&A.push(n(R,{name:"finish",label:p.finish,badge:C.finish,open:t==="finish",onToggle:()=>u(t==="finish"?null:"finish"),children:[e(L,{children:"Color family · single-select"}),e("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Finish color family",children:W.map(i=>{const a=w===i.f;return n("button",{type:"button",role:"radio","aria-checked":a,onClick:()=>g(a?null:i.f),className:["flex items-center gap-3 border px-3 py-2 text-left transition-colors",a?"border-accent text-fg":"border-line hover:border-fg-dim"].join(" "),children:[e("span",{className:"block h-3.5 w-3.5 shrink-0 rounded-full border border-line",style:{background:i.hex}}),e("span",{className:`font-mono ${h.labelSmall} uppercase tracking-[0.18em]`,style:a?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:i.label}),a&&e("span",{"aria-hidden":!0,className:"ml-auto text-accent",children:"●"})]},i.f)})})]},"finish")),n("div",{className:"@container sticky top-[67px] z-40 border-b border-line backdrop-blur",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[n("div",{className:`flex items-center gap-6 ${ae} py-4 @max-[720px]:flex-wrap @max-[720px]:items-stretch @max-[720px]:gap-2 @max-[720px]:px-4 @max-[720px]:py-3`,children:[n("div",{className:"relative flex flex-wrap items-center gap-1 @max-[720px]:basis-full @max-[720px]:gap-2",children:[r.count&&n("span",{className:`mr-3 border-r border-line pr-4 font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim @max-[720px]:hidden`,children:[b," ",b===1?"result":"results"]}),pe(A,P),r.price&&n(R,{name:"price",label:p.price,badge:C.price,open:t==="price",onToggle:()=>u(t==="price"?null:"price"),children:[e(L,{children:"Price range (per wheel)"}),e(se,{bounds:K,min:D,max:U,onMin:O,onMax:x})]}),r.vehicle&&c&&e(fe,{label:p.vehicle,badge:C.vehicle,open:t==="vehicle",onToggle:()=>u(t==="vehicle"?null:"vehicle")})]}),v&&e("div",{className:`flex items-center ${r.sort?"":"ml-auto"}`,children:e(de,{href:v.href,label:v.label})}),r.sort&&n("div",{className:"ml-auto flex items-center gap-3",children:[e("button",{type:"button",onClick:Q,className:`font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-accent`,children:"Clear All"}),e(ce,{look:"box",value:J,keys:te,labels:H,onChange:y})]})]}),r.vehicle&&c&&t==="vehicle"&&e(ve,{picker:c,onClose:()=>u(null)}),r.vehicle&&c&&e(le,{picker:c,total:b})]})}const Ae={1:"@min-[720px]:grid-cols-1",2:"@min-[720px]:grid-cols-2",3:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3",4:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-4",5:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-5",6:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-6"},Ee=`flex w-full items-center justify-between gap-4 border-b py-3 text-left ${h.body}`;function k({name:s,label:o,rowsAreOptions:d,tight:f,children:g}){return n("div",{"data-filter-column":s,className:`flex flex-col ${f?"gap-3":"gap-6"}`,children:[e("div",{className:`font-mono ${h.labelXs} uppercase tracking-[0.34em] text-fg-dim`,children:o}),e("div",{role:d?"radiogroup":void 0,"aria-label":d?o:void 0,children:g})]})}function $({active:s,onClick:o,children:d}){return e("button",{type:"button",role:"radio","aria-checked":s,onClick:o,className:[Ee,"transition-colors",s?"border-fg text-fg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e("span",{children:d})})}export{Te as default,Fe as filterBarFacetsWithChoice};
1
+ "use client";import{jsx as e,jsxs as n,Fragment as fe}from"react/jsx-runtime";import{useState as ee}from"react";import{withRMark as X}from"efficient-web-builder/render/components/RMark";import{FilterPill as R,OptButton as G,PanelTitle as L,PillButton as ge}from"./FilterPill.js";import{useCatalogFilterLabels as xe}from"./CatalogFilterLabels.js";import{CatalogVehicleNextRow as be,CatalogVehicleFieldRow as ve,CatalogVehicleRow as le,CatalogVehicleSheet as Ce}from"./CatalogVehiclePicker.js";import{facetFieldKey as ie,keepForFilter as Ne,orderByAnswers as ke}from"../../lib/content/field-usage.js";import{PLP_ONE_VALUE_MAX as re}from"../../lib/wheels/plp-filters.js";import{DEFAULT_FILTER_BAR_LAYOUT as ye}from"../../lib/sections/catalog-filter-layout.js";import{SORT_LABELS as H}from"../../lib/wheels/catalog-filters.js";import{FINISH_FAMILY_SWATCHES as ne}from"../../lib/wheels/finish-defaults.js";import{VEHICLE_FIELD_ORDER as _e}from"../../lib/wheels/vehicle-field-focus.js";import{CONTENT_CAP_GUTTER as ae}from"../../lib/sections/content-cap-gutter.js";import{CATALOG_TEXT_SIZE as Fe}from"../../lib/sections/catalog-text-size.js";import{lugFilterLabel as oe}from"../../lib/wheels/lug-count.js";import se from"./PriceRange.js";import te from"./SortSelect.js";import{withRootPad as Te}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as Ae}from"../SectionPadScope.js";const h=Fe,ce=Object.keys(H),z={size:ie("diameters","alloy-wheel"),finish:ie("finishes","alloy-wheel")};function pe(s,o){return ke(s,d=>Object.hasOwn(z,String(d.key))?z[String(d.key)]:void 0,o??[],"filterOrder")}function Ee({processCount:s,sizeCount:o,lugCount:d,finishCount:f,optionsReported:g,fieldUsage:O}){const x=B=>!g||B>re,y=Ne(O??[]);return{process:s>re,size:y(z.size)&&x(o),lugs:x(d),finish:y(z.finish)&&x(f)}}function N(s,o){return s===o?null:o}function de({href:s,label:o}){return e("a",{href:s,"data-results-link":!0,className:`inline-block self-start border-0 border-b border-line bg-transparent pb-2 font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg transition-colors hover:text-fg-dim`,children:o})}function Re({filters:s,setProcess:o,setSize:d,setLugs:f,setFinish:g,setPriceMin:O,setPriceMax:x,setSort:y,clearAll:B,total:b,scrollProcess:Y,show:m,picker:t,lugOptions:I=[],sizeOptions:P=[],finishOptions:q,priceBounds:K=null,layout:me=ye,processOptions:j=[],resultsLink:v,optionsReported:ue=!1,fieldUsage:M}){const he=Ae(),[c,u]=ee(null),[Z,V]=ee(null),p=xe(),{process:_,size:F,lugs:T,finish:w,priceMin:D,priceMax:U,sort:J}=s,W=q?ne.filter(i=>q.includes(i.f)):ne,S=Ee({processCount:j.length,sizeCount:P.length,lugCount:I.length,finishCount:W.length,optionsReported:ue,fieldUsage:M}),r={process:(m?.process??!0)&&S.process,size:(m?.size??!0)&&S.size,lugs:(m?.lugs??!0)&&S.lugs,finish:(m?.finish??!0)&&S.finish,price:m?.price??!0,vehicle:(m?.vehicle??!0)&&!!t,count:m?.count??!0,sort:m?.sort??!0},C={process:_?1:0,size:F?1:0,lugs:T?1:0,finish:w?1:0,price:D!=null||U!=null?1:0,vehicle:t?.appliedName?1:0},Q=()=>{B(),t?.clear(),u(null),V(null)};if(me==="columns"){const i=l=>V(Z===l?null:l),a=[];r.vehicle&&t&&a.push(n(k,{name:"vehicle",label:p.vehicle,children:[_e.map(l=>e(ve,{field:l,picker:t,open:Z===l,onOpenRequest:i,onClose:()=>V(null)},l)),e(be,{picker:t,onOpenRequest:i})]},"vehicle"));const E=[];return r.process&&E.push(e(k,{name:"process",label:p.process,rowsAreOptions:!0,children:j.map(l=>e($,{active:_===l,onClick:()=>o(N(_,l)),children:X(l)},l))},"process")),r.size&&E.push(e(k,{name:"size",label:p.size,rowsAreOptions:!0,children:P.map(l=>n($,{active:F===l,onClick:()=>d(N(F,l)),children:[l,'"']},l))},"size")),r.lugs&&E.push(e(k,{name:"lugs",label:p.lugs,rowsAreOptions:!0,children:I.map(l=>e($,{active:T===l,onClick:()=>f(N(T,l)),children:oe(l)},l))},"lugs")),r.finish&&E.push(e(k,{name:"finish",label:p.finish,rowsAreOptions:!0,children:W.map(l=>e($,{active:w===l.f,onClick:()=>g(w===l.f?null:l.f),children:l.label},l.f))},"finish")),a.push(...pe(E,M)),r.price&&a.push(e(k,{name:"price",label:p.price,tight:!0,children:e(se,{bounds:K,boxes:"line",min:D,max:U,onMin:O,onMax:x})},"price")),n("div",{className:"@container",children:[n("div",{className:`border-t border-line ${ae} pb-12 pt-10 @max-[720px]:px-4 @max-[720px]:pb-10 @max-[720px]:pt-8`,children:[(r.count||r.sort)&&n("div",{className:"mb-10 flex flex-wrap items-center gap-x-6 gap-y-3 @max-[720px]:mb-8",children:[r.count&&n("span",{className:`font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[b," ",b===1?"result":"results"]}),r.sort&&n("div",{className:"ml-auto flex items-center gap-5",children:[e("button",{type:"button",onClick:Q,className:`font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:"Clear All"}),e(te,{look:"line",value:J,keys:ce,labels:H,onChange:y})]})]}),e("div",{"data-filter-columns":!0,className:`grid grid-cols-1 gap-x-[72px] gap-y-10 ${Le[a.length]??""}`,children:a}),v&&e("div",{className:"mt-10 flex",children:e(de,{href:v.href,label:v.label})})]}),r.vehicle&&t&&e(le,{picker:t,total:b})]})}const A=[];return r.process&&A.push(n(R,{name:"process",label:Y?n(fe,{children:[e("span",{className:"text-accent @min-[720px]:hidden",children:X(Y)}),e("span",{className:"hidden @min-[720px]:inline",children:p.process})]}):p.process,badge:C.process,open:c==="process",onToggle:()=>u(c==="process"?null:"process"),children:[e(L,{children:"Series · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Process series",children:j.map(i=>{const a=_===i;return e(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>o(N(_,i)),children:X(i)},i)})})]},"process")),r.size&&A.push(n(R,{name:"size",label:p.size,badge:C.size,open:c==="size",onToggle:()=>u(c==="size"?null:"size"),children:[e(L,{children:"Diameter · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Wheel diameter",children:P.map(i=>{const a=F===i;return n(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>d(N(F,i)),children:[i,'"']},i)})})]},"size")),r.lugs&&A.push(n(R,{name:"lugs",label:p.lugs,badge:C.lugs,open:c==="lugs",onToggle:()=>u(c==="lugs"?null:"lugs"),children:[e(L,{children:"Lug count · single-select"}),e("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Lug count",children:I.map(i=>{const a=T===i;return e(G,{active:a,role:"radio",ariaChecked:a,onClick:()=>f(N(T,i)),children:oe(i)},i)})})]},"lugs")),r.finish&&A.push(n(R,{name:"finish",label:p.finish,badge:C.finish,open:c==="finish",onToggle:()=>u(c==="finish"?null:"finish"),children:[e(L,{children:"Color family · single-select"}),e("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Finish color family",children:W.map(i=>{const a=w===i.f;return n("button",{type:"button",role:"radio","aria-checked":a,onClick:()=>g(a?null:i.f),className:["flex items-center gap-3 border px-3 py-2 text-left transition-colors",a?"border-accent text-fg":"border-line hover:border-fg-dim"].join(" "),children:[e("span",{className:"block h-3.5 w-3.5 shrink-0 rounded-full border border-line",style:{background:i.hex}}),e("span",{className:`font-mono ${h.labelSmall} uppercase tracking-[0.18em]`,style:a?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:i.label}),a&&e("span",{"aria-hidden":!0,className:"ml-auto text-accent",children:"●"})]},i.f)})})]},"finish")),n("div",{className:"@container sticky top-[67px] z-40 border-b border-line backdrop-blur",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[n("div",{...Te(`flex items-center gap-6 ${ae} py-4 @max-[720px]:flex-wrap @max-[720px]:items-stretch @max-[720px]:gap-2 @max-[720px]:px-4 @max-[720px]:py-3`,he),children:[n("div",{className:"relative flex flex-wrap items-center gap-1 @max-[720px]:basis-full @max-[720px]:gap-2",children:[r.count&&n("span",{className:`mr-3 border-r border-line pr-4 font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim @max-[720px]:hidden`,children:[b," ",b===1?"result":"results"]}),pe(A,M),r.price&&n(R,{name:"price",label:p.price,badge:C.price,open:c==="price",onToggle:()=>u(c==="price"?null:"price"),children:[e(L,{children:"Price range (per wheel)"}),e(se,{bounds:K,min:D,max:U,onMin:O,onMax:x})]}),r.vehicle&&t&&e(ge,{label:p.vehicle,badge:C.vehicle,open:c==="vehicle",onToggle:()=>u(c==="vehicle"?null:"vehicle")})]}),v&&e("div",{className:`flex items-center ${r.sort?"":"ml-auto"}`,children:e(de,{href:v.href,label:v.label})}),r.sort&&n("div",{className:"ml-auto flex items-center gap-3",children:[e("button",{type:"button",onClick:Q,className:`font-mono ${h.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-accent`,children:"Clear All"}),e(te,{look:"box",value:J,keys:ce,labels:H,onChange:y})]})]}),r.vehicle&&t&&c==="vehicle"&&e(Ce,{picker:t,onClose:()=>u(null)}),r.vehicle&&t&&e(le,{picker:t,total:b})]})}const Le={1:"@min-[720px]:grid-cols-1",2:"@min-[720px]:grid-cols-2",3:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3",4:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-4",5:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-5",6:"@min-[720px]:grid-cols-2 @min-[1100px]:grid-cols-3 @min-[1400px]:grid-cols-6"},Oe=`flex w-full items-center justify-between gap-4 border-b py-3 text-left ${h.body}`;function k({name:s,label:o,rowsAreOptions:d,tight:f,children:g}){return n("div",{"data-filter-column":s,className:`flex flex-col ${f?"gap-3":"gap-6"}`,children:[e("div",{className:`font-mono ${h.labelXs} uppercase tracking-[0.34em] text-fg-dim`,children:o}),e("div",{role:d?"radiogroup":void 0,"aria-label":d?o:void 0,children:g})]})}function $({active:s,onClick:o,children:d}){return e("button",{type:"button",role:"radio","aria-checked":s,onClick:o,className:[Oe,"transition-colors",s?"border-fg text-fg":"border-line text-fg-dim hover:text-fg"].join(" "),children:e("span",{children:d})})}export{Re as default,Ee as filterBarFacetsWithChoice};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as l,Fragment as ue}from"react/jsx-runtime";import{useScopeClass as st}from"../../lib/use-scope-class.js";import{useCallback as m,useEffect as lt,useMemo as s,useRef as ct,useState as at}from"react";import{cardHoverOf as pt}from"efficient-web-builder/format/lib/animation/hover";import{pageTitleTag as mt}from"efficient-web-builder/format/lib/document/one-h1";import{SHARED_ROWS_LIST_CLASS as dt}from"efficient-web-builder/render/lib/content/box-shared-columns";import{NO_FIELD_ANSWERS as ut,answersForKind as fe}from"../../lib/content/field-usage.js";import{useCurrency as ft}from"../CurrencyContext.js";import ht from"../NoCurrencyNote.js";import{usePreviewDevice as gt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as yt,renderHeadline as St}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as xt}from"../useProductCatalog.js";import{scrollBehavior as bt}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as wt,PLP_GRID_GAP_VAR as he,plpGridVars as kt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as vt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as Pt,cardRowsGridStyle as Nt}from"../WheelCardFrame.js";import{applyPlpFilters as Ct,buildPlpFacets as Tt,buildPlpTypeOptions as _t,buildTyreSizeBoxes as At,EMPTY_PLP_FILTERS as ge,hasActivePlpFilters as Lt,paginatePlp as zt,pickTyreSize as Ft,plpTyreSizeBoxesShown as Ot,plpInStockCount as Vt,plpOpeningSort as Gt,plpPriceBounds as It,plpShownKinds as Mt,plpSortKeysFor as Rt,PLP_SORT_LABELS as Et}from"../../lib/wheels/plp-filters.js";import{itemKind as O,itemSlug as Kt,itemTyreSizes as jt,plpBrandVaries as Bt,plpProcessVaries as Dt,plpItemsOfKinds as Wt,plpKindNoun as ye,resolvePlpKinds as $t}from"../../lib/catalog/plp-item.js";import{plpGateWords as Ht,plpVehicleCopy as Yt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as qt,oemTyreSizes as Jt}from"../../lib/tyres/tyre-vehicle-fitment.js";import{wheelsFittingVehicle as Qt}from"../../lib/wheels/plp-fitment-match.js";import Ut from"./PlpActiveChips.js";import{GridCardProvider as Xt,GridMixedCards as Zt,gridIndexCss as eo,LISTING_CARD_RULES as to}from"../GridCardTemplate.js";import{wheelCardEyebrowShows as oo}from"../ProductCardEyebrow.js";import ro from"./PlpPagination.js";import no from"./PlpSidebar.js";import io from"./PlpFilterButton.js";import{plpFilterViews as so}from"../../lib/sections/shopper-filters.js";import{PlpResultRange as lo,PlpToolbar as co}from"./PlpToolbar.js";import ao from"../catalog/SortSelect.js";import po from"./PlpVehicleBar.js";import mo from"./PlpVehicleGate.js";import{useVehicleCatalog as uo}from"./useVehicleCatalog.js";import{useVehicleFit as fo}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as ho}from"./usePlpFiltersInUrl.js";import{productContentOf as go,rowsForGridSource as yo}from"../../lib/wheels/grid-source.js";import{say as B}from"efficient-web-builder/format/lib/editor-words";import{ALLOY_WHEELS_LISTING_TYPE as Se}from"../../lib/document/document-nodes.js";const ir={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:v,className:P,children:N}){const V=mt(v);return o(V,{className:P,children:N})}const xo=pt({},Se);function bo({heading:v="",intro:P="",askForCar:N=!0,gateHeading:V="",gateIntro:xe="",perPage:D=24,columns:be,defaultSort:we="recommended",hiddenFacets:W=[],fieldUsage:h=ut,showPrice:$=!0,showInStock:ke=!0,kinds:ve,source:H,products:Pe,wheels:Ne,addressQuery:Ce,editing:d=!1,ownerId:Y="",template:Te,facetTemplate:_e,railTemplate:Ae,railHeadTemplate:Le,hover:ze=xo,titleLevel:Fe,omitHead:q=!1,cellLook:J,filterLook:Oe,filterLookPhone:Ve}){const{currency:a}=ft(),u=$t(ve),Q=gt(),U=wt(be),Ge=kt(U,d?Q:null),Ie=vt(U,d?Q:null),X=st("plp"),Me=eo(X),Re=xt(),Z=Pe??Ne??Re??[],x=go(H)==="category"?H?.name??"":null,ee=s(()=>{const t=Wt(Z,u);return x===null?t:yo({name:x},t)},[Z,u.join(","),x]),r=fo({editing:d,enabled:N,autoApply:!0}),[Ee,G]=at(!1),Ke=Gt(we,u),g=r.applied?.vehicle??null,[_,b]=ho({editing:d,openingSort:Ke,appliedVehicle:g,vehicleRestored:r.restored,addressQuery:Ce}),e=s(()=>x===null||_.collections.length===0?_:{..._,collections:[]},[_,x]),p=Mt(u,e.kind),n=m(t=>b(t),[b]),te=m((t,f)=>{const c=e[t],nt=c.map(String).includes(f)?c.filter(it=>String(it)!==f):[...c,t==="diameters"?Number(f):f];n({...e,[t]:nt,page:1})},[e,n]),oe=m(t=>n({...e,priceMin:t,page:1}),[e,n]),re=m(t=>n({...e,priceMax:t,page:1}),[e,n]),ne=m(t=>n({...e,inStockOnly:t,page:1}),[e,n]),ie=m(t=>n({...ge,kind:t,inStockOnly:e.inStockOnly,priceMin:e.priceMin,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMin,e.priceMax,e.sort,n]),je=m(t=>n({...e,sort:t,page:1}),[e,n]),Be=m(t=>{n({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:bt()})},[e,n]),se=m(()=>n({...ge,sort:e.sort}),[e.sort,n]),{clear:A}=r,le=m(()=>{A(),G(!0),b(t=>({...t,page:1}))},[A]),De=m(()=>{A(),G(!1),b(t=>({...t,page:1}))},[A]),L=g?[g.make,g.model,g.year,g.modification].join("|"):"",z=ct(null);lt(()=>{if(r.restored){if(z.current===null){z.current=L;return}z.current!==L&&(z.current=L,b(t=>t.page===1?t:{...t,page:1}))}},[r.restored,L,b]);const{items:F,failed:ce,retry:We}=uo({catalog:ee,shownKinds:u,vehicle:g,editing:d}),i=s(()=>{if(!r.fit)return F;const t=F.filter(c=>O(c)==="alloy-wheel"),f=new Set(Qt(t,r.fit).map(c=>c.slug));return F.filter(c=>O(c)!=="alloy-wheel"||f.has(Kt(c)))},[F,r.fit]),w=(x===null?W:[...W,"collections"]).join(","),$e=s(()=>{const t=new Set(w?w.split(","):[]);return Tt(i,e,a,p,h).filter(f=>!t.has(f.key))},[i,e,a,w,p.join(","),h]),y=s(()=>Ct(i,e,a),[i,e,a]),He=p.length>1,ae=s(()=>fe(h,"alloy-wheel"),[h]),Ye=s(()=>fe(h,"tyre"),[h]),I=s(()=>Bt(y),[y]),M=s(()=>Dt(y),[y]),R=He?ye(["alloy-wheel"]).one:null,qe=s(()=>({kindLabel:R,brand:I,process:M}),[R,I,M]),Je=oo({kind:!!R,brand:I,process:M},ae),Qe=s(()=>$?It(i,a):null,[i,a,$]),Ue=s(()=>Vt(i,e,a),[i,e,a]),Xe=s(()=>_t(i,u,e,a),[i,u.join(","),e,a]),Ze=m((t,f)=>{const c=Ft(i.flatMap(jt),e.tyreSizes[0]??"",t,f);n({...e,tyreSizes:c?[c]:[],page:1})},[i,e,n]),et=s(()=>{const t=new Set(w?w.split(","):[]);return!Ot(i,p)||t.has("tyreSizes")?null:At(i,e,a)},[i,e,a,w,p.join(","),h]),S=s(()=>zt(y,e.page,D),[y,e.page,D]),k=ye(p),E=Yt(p),pe=Ht(V,xe,p,u),me=p.length===1&&p[0]==="tyre",de=r.applied?.stock??null,C=s(()=>Jt(de),[de]),tt=s(()=>i.filter(t=>p.includes(O(t))).length,[i,p.join(",")]),K=ee.length===0,ot=!K&&i.length===0,rt=N&&!d&&!r.applied&&!Ee;if(u.length===0)return null;const j=o(no,{facets:$e,filters:e,typeOptions:Xe,sizeBoxes:et,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:k,priceBounds:Qe,inStockCount:ke?Ue:null,onToggle:te,onPickType:ie,onPickSize:Ze,onPriceMin:oe,onPriceMax:re,onInStockOnly:ne,onClearAll:se,owner:{id:Y,facetTemplate:_e,railTemplate:Ae,railHeadTemplate:Le},editing:d}),T=so(Oe,Ve);return l("section",{children:[N&&o(po,{cascade:r.cascade,appliedName:r.appliedName,fit:r.fit,fitSummary:me&&C.length>0?`Takes ${C.join(" · ")}`:null,resolving:r.resolving,unresolved:me?!!r.applied&&!r.resolving&&C.length===0:r.unresolved,matchCount:tt,copy:E,onAmend:De,onClear:le,cellLook:J}),rt&&o(mo,{cascade:r.cascade,heading:pe.heading,intro:pe.intro,ready:r.restored,copy:E,onSkip:()=>G(!0),cellLook:J}),l("div",{className:q?void 0:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[!q&&(v||P)&&l("header",{className:"mb-6",children:[v&&o(So,{level:Fe,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:St(v,!1)}),P&&o("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:yt(P)})]}),l("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[T.rail===""?j:T.rail!==null&&o("div",{className:T.rail,children:j}),l("div",{className:"min-w-0 flex-1",children:[o(co,{className:"mb-4",start:l(ue,{children:[o(lo,{total:S.total,range:{from:S.from,to:S.to},noun:k}),o(Ut,{filters:e,onToggle:te,onPriceMin:oe,onPriceMax:re,onInStockOnly:ne,onPickType:ie})]}),end:l(ue,{children:[T.button!==null&&o("div",{className:T.button||void 0,children:o(io,{filters:e,editing:d,children:j})}),o(ao,{value:e.sort,keys:Rt(u),labels:Et,onChange:je})]})}),ce&&!K&&l("div",{role:"status",className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 border border-line px-4 py-3",children:[o("p",{className:"text-[14px] text-fg-dim",children:"We couldn't check your car just now — try again."}),o("button",{type:"button",onClick:We,className:"cursor-pointer bg-btn px-4 py-2 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Try again"})]}),K?o("div",{className:"border border-dashed border-line p-10",children:o("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:d?k.many==="wheels"?B("No wheels in this website's catalog yet — curate products to see them here."):k.many==="tyres"?B("No tyres in this website's catalog yet — curate products to see them here."):B("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):ot?ce?null:l("div",{className:"border border-line p-10",children:[l("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",r.appliedName]}),o("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:E.nothingFits}),l("button",{type:"button",onClick:le,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 ",k.many]})]}):S.total===0?l("div",{className:"border border-line p-10",children:[l("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",k.many," match those filters"]}),o("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),Lt(e)&&o("button",{type:"button",onClick:se,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"})]}):l(Xt,{value:{ownerId:Y,ownerType:Se,Template:Te,hover:ze,imageSizes:Ie,fieldUsage:ae,tyreFieldUsage:Ye,reserveEyebrow:Je,editing:d,eyebrow:qe,fit:r.fit,colours:e.finishes,setGridGap:`var(${he})`,rules:to},children:[o("style",{children:Me}),o("div",{className:`plp-card-grid ${X} ${Pt} ${dt}`,style:{...Ge,...Nt(`var(${he})`)},children:o(Zt,{items:S.items,tyreOf:t=>O(t)==="tyre"?t:null,tyreFit:t=>C.length>0?qt(t.sizes,C):null})})]}),o(ro,{page:S.page,pageCount:S.pageCount,onPage:Be}),o(ht,{editing:d})]})]})]})]})}export{ir as PLP_GATE_DEFAULTS,bo as default};
1
+ "use client";import{jsx as o,jsxs as l,Fragment as fe}from"react/jsx-runtime";import{useScopeClass as ct}from"../../lib/use-scope-class.js";import{useCallback as m,useEffect as at,useMemo as s,useRef as pt,useState as mt}from"react";import{cardHoverOf as dt}from"efficient-web-builder/format/lib/animation/hover";import{pageTitleTag as ut}from"efficient-web-builder/format/lib/document/one-h1";import{SHARED_ROWS_LIST_CLASS as ft}from"efficient-web-builder/render/lib/content/box-shared-columns";import{NO_FIELD_ANSWERS as ht,answersForKind as he}from"../../lib/content/field-usage.js";import{useCurrency as gt}from"../CurrencyContext.js";import yt from"../NoCurrencyNote.js";import{usePreviewDevice as St}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as xt,renderHeadline as bt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as wt}from"../useProductCatalog.js";import{scrollBehavior as Pt}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as kt,PLP_GRID_GAP_VAR as ge,plpGridVars as vt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as Nt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as Ct,cardRowsGridStyle as Tt}from"../WheelCardFrame.js";import{applyPlpFilters as _t,buildPlpFacets as At,buildPlpTypeOptions as Lt,buildTyreSizeBoxes as Ft,EMPTY_PLP_FILTERS as ye,hasActivePlpFilters as zt,paginatePlp as It,pickTyreSize as Ot,plpTyreSizeBoxesShown as Gt,plpInStockCount as Mt,plpOpeningSort as Rt,plpPriceBounds as Vt,plpShownKinds as Et,plpSortKeysFor as Kt,PLP_SORT_LABELS as jt}from"../../lib/wheels/plp-filters.js";import{itemKind as I,itemSlug as Bt,itemTyreSizes as Dt,plpBrandVaries as Wt,plpProcessVaries as $t,plpItemsOfKinds as Yt,plpKindNoun as Se,resolvePlpKinds as Ht}from"../../lib/catalog/plp-item.js";import{plpGateWords as qt,plpVehicleCopy as Jt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Qt,oemTyreSizes as Ut}from"../../lib/tyres/tyre-vehicle-fitment.js";import{wheelsFittingVehicle as Xt}from"../../lib/wheels/plp-fitment-match.js";import Zt from"./PlpActiveChips.js";import{GridCardProvider as eo,GridMixedCards as to,gridIndexCss as oo,LISTING_CARD_RULES as ro}from"../GridCardTemplate.js";import{wheelCardEyebrowShows as no}from"../ProductCardEyebrow.js";import io from"./PlpPagination.js";import so from"./PlpSidebar.js";import lo from"./PlpFilterButton.js";import{plpFilterViews as co}from"../../lib/sections/shopper-filters.js";import{PlpResultRange as ao,PlpToolbar as po}from"./PlpToolbar.js";import mo from"../catalog/SortSelect.js";import uo from"./PlpVehicleBar.js";import fo from"./PlpVehicleGate.js";import{useVehicleCatalog as ho}from"./useVehicleCatalog.js";import{useVehicleFit as go}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as yo}from"./usePlpFiltersInUrl.js";import{productContentOf as So,rowsForGridSource as xo}from"../../lib/wheels/grid-source.js";import{say as D}from"efficient-web-builder/format/lib/editor-words";import{ALLOY_WHEELS_LISTING_TYPE as xe}from"../../lib/document/document-nodes.js";import{withRootPad as bo}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as wo}from"../SectionPadScope.js";const mr={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 Po({level:k,className:v,children:N}){const O=ut(k);return o(O,{className:v,children:N})}const ko=dt({},xe),be="px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]";function vo({heading:k="",intro:v="",askForCar:N=!0,gateHeading:O="",gateIntro:we="",perPage:W=24,columns:Pe,defaultSort:ke="recommended",hiddenFacets:$=[],fieldUsage:h=ht,showPrice:Y=!0,showInStock:ve=!0,kinds:Ne,source:H,products:Ce,wheels:Te,addressQuery:_e,editing:d=!1,ownerId:q="",template:Ae,facetTemplate:Le,railTemplate:Fe,railHeadTemplate:ze,hover:Ie=ko,titleLevel:Oe,omitHead:G=!1,cellLook:J,filterLook:Ge,filterLookPhone:Me}){const{currency:a}=gt(),Q=wo(),u=Ht(Ne),U=St(),X=kt(Pe),Re=vt(X,d?U:null),Ve=Nt(X,d?U:null),Z=ct("plp"),Ee=oo(Z),Ke=wt(),ee=Ce??Te??Ke??[],x=So(H)==="category"?H?.name??"":null,te=s(()=>{const t=Yt(ee,u);return x===null?t:xo({name:x},t)},[ee,u.join(","),x]),r=go({editing:d,enabled:N,autoApply:!0}),[je,M]=mt(!1),Be=Rt(ke,u),g=r.applied?.vehicle??null,[_,b]=yo({editing:d,openingSort:Be,appliedVehicle:g,vehicleRestored:r.restored,addressQuery:_e}),e=s(()=>x===null||_.collections.length===0?_:{..._,collections:[]},[_,x]),p=Et(u,e.kind),n=m(t=>b(t),[b]),oe=m((t,f)=>{const c=e[t],st=c.map(String).includes(f)?c.filter(lt=>String(lt)!==f):[...c,t==="diameters"?Number(f):f];n({...e,[t]:st,page:1})},[e,n]),re=m(t=>n({...e,priceMin:t,page:1}),[e,n]),ne=m(t=>n({...e,priceMax:t,page:1}),[e,n]),ie=m(t=>n({...e,inStockOnly:t,page:1}),[e,n]),se=m(t=>n({...ye,kind:t,inStockOnly:e.inStockOnly,priceMin:e.priceMin,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMin,e.priceMax,e.sort,n]),De=m(t=>n({...e,sort:t,page:1}),[e,n]),We=m(t=>{n({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:Pt()})},[e,n]),le=m(()=>n({...ye,sort:e.sort}),[e.sort,n]),{clear:A}=r,ce=m(()=>{A(),M(!0),b(t=>({...t,page:1}))},[A]),$e=m(()=>{A(),M(!1),b(t=>({...t,page:1}))},[A]),L=g?[g.make,g.model,g.year,g.modification].join("|"):"",F=pt(null);at(()=>{if(r.restored){if(F.current===null){F.current=L;return}F.current!==L&&(F.current=L,b(t=>t.page===1?t:{...t,page:1}))}},[r.restored,L,b]);const{items:z,failed:ae,retry:Ye}=ho({catalog:te,shownKinds:u,vehicle:g,editing:d}),i=s(()=>{if(!r.fit)return z;const t=z.filter(c=>I(c)==="alloy-wheel"),f=new Set(Xt(t,r.fit).map(c=>c.slug));return z.filter(c=>I(c)!=="alloy-wheel"||f.has(Bt(c)))},[z,r.fit]),w=(x===null?$:[...$,"collections"]).join(","),He=s(()=>{const t=new Set(w?w.split(","):[]);return At(i,e,a,p,h).filter(f=>!t.has(f.key))},[i,e,a,w,p.join(","),h]),y=s(()=>_t(i,e,a),[i,e,a]),qe=p.length>1,pe=s(()=>he(h,"alloy-wheel"),[h]),Je=s(()=>he(h,"tyre"),[h]),R=s(()=>Wt(y),[y]),V=s(()=>$t(y),[y]),E=qe?Se(["alloy-wheel"]).one:null,Qe=s(()=>({kindLabel:E,brand:R,process:V}),[E,R,V]),Ue=no({kind:!!E,brand:R,process:V},pe),Xe=s(()=>Y?Vt(i,a):null,[i,a,Y]),Ze=s(()=>Mt(i,e,a),[i,e,a]),et=s(()=>Lt(i,u,e,a),[i,u.join(","),e,a]),tt=m((t,f)=>{const c=Ot(i.flatMap(Dt),e.tyreSizes[0]??"",t,f);n({...e,tyreSizes:c?[c]:[],page:1})},[i,e,n]),ot=s(()=>{const t=new Set(w?w.split(","):[]);return!Gt(i,p)||t.has("tyreSizes")?null:Ft(i,e,a)},[i,e,a,w,p.join(","),h]),S=s(()=>It(y,e.page,W),[y,e.page,W]),P=Se(p),K=Jt(p),me=qt(O,we,p,u),de=p.length===1&&p[0]==="tyre",ue=r.applied?.stock??null,C=s(()=>Ut(ue),[ue]),rt=s(()=>i.filter(t=>p.includes(I(t))).length,[i,p.join(",")]),j=te.length===0,nt=!j&&i.length===0,it=N&&!d&&!r.applied&&!je;if(u.length===0)return null;const B=o(so,{facets:He,filters:e,typeOptions:et,sizeBoxes:ot,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:P,priceBounds:Xe,inStockCount:ve?Ze:null,onToggle:oe,onPickType:se,onPickSize:tt,onPriceMin:re,onPriceMax:ne,onInStockOnly:ie,onClearAll:le,owner:{id:q,facetTemplate:Le,railTemplate:Fe,railHeadTemplate:ze},editing:d}),T=co(Ge,Me);return l("section",{children:[N&&o(uo,{cascade:r.cascade,appliedName:r.appliedName,fit:r.fit,fitSummary:de&&C.length>0?`Takes ${C.join(" · ")}`:null,resolving:r.resolving,unresolved:de?!!r.applied&&!r.resolving&&C.length===0:r.unresolved,matchCount:rt,copy:K,onAmend:$e,onClear:ce,cellLook:J}),it&&o(fo,{cascade:r.cascade,heading:me.heading,intro:me.intro,ready:r.restored,copy:K,onSkip:()=>M(!0),cellLook:J}),l("div",{...Q?bo(G?"":be,Q):{className:G?void 0:be},children:[!G&&(k||v)&&l("header",{className:"mb-6",children:[k&&o(Po,{level:Oe,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:bt(k,!1)}),v&&o("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:xt(v)})]}),l("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[T.rail===""?B:T.rail!==null&&o("div",{className:T.rail,children:B}),l("div",{className:"min-w-0 flex-1",children:[o(po,{className:"mb-4",start:l(fe,{children:[o(ao,{total:S.total,range:{from:S.from,to:S.to},noun:P}),o(Zt,{filters:e,onToggle:oe,onPriceMin:re,onPriceMax:ne,onInStockOnly:ie,onPickType:se})]}),end:l(fe,{children:[T.button!==null&&o("div",{className:T.button||void 0,children:o(lo,{filters:e,editing:d,children:B})}),o(mo,{value:e.sort,keys:Kt(u),labels:jt,onChange:De})]})}),ae&&!j&&l("div",{role:"status",className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 border border-line px-4 py-3",children:[o("p",{className:"text-[14px] text-fg-dim",children:"We couldn't check your car just now — try again."}),o("button",{type:"button",onClick:Ye,className:"cursor-pointer bg-btn px-4 py-2 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Try again"})]}),j?o("div",{className:"border border-dashed border-line p-10",children:o("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:d?P.many==="wheels"?D("No wheels in this website's catalog yet — curate products to see them here."):P.many==="tyres"?D("No tyres in this website's catalog yet — curate products to see them here."):D("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):nt?ae?null:l("div",{className:"border border-line p-10",children:[l("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",r.appliedName]}),o("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:K.nothingFits}),l("button",{type:"button",onClick:ce,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 ",P.many]})]}):S.total===0?l("div",{className:"border border-line p-10",children:[l("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",P.many," match those filters"]}),o("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),zt(e)&&o("button",{type:"button",onClick:le,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"})]}):l(eo,{value:{ownerId:q,ownerType:xe,Template:Ae,hover:Ie,imageSizes:Ve,fieldUsage:pe,tyreFieldUsage:Je,reserveEyebrow:Ue,editing:d,eyebrow:Qe,fit:r.fit,colours:e.finishes,setGridGap:`var(${ge})`,rules:ro},children:[o("style",{children:Ee}),o("div",{className:`plp-card-grid ${Z} ${Ct} ${ft}`,style:{...Re,...Tt(`var(${ge})`)},children:o(to,{items:S.items,tyreOf:t=>I(t)==="tyre"?t:null,tyreFit:t=>C.length>0?Qt(t.sizes,C):null})})]}),o(io,{page:S.page,pageCount:S.pageCount,onPage:We}),o(yt,{editing:d})]})]})]})]})}export{mr as PLP_GATE_DEFAULTS,vo as default};