efficient-storefront-blocks 0.125.4 → 0.125.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/chunks/{CustomHtmlCodeWindow-KB7QEJAG.js → CustomHtmlCodeWindow-HSZVKXL4.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-TYNFV3WZ.js → SiteEditorProvider-6X2YHTVA.js} +1 -1
- package/dist/chunks/{chunk-DHKJAYUG.js → chunk-B3U6XXDZ.js} +1 -1
- package/dist/chunks/{chunk-4M7WJPOZ.js → chunk-GATK7RJE.js} +6 -6
- package/dist/editor/lib/document/blocks/commerce/AccountBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CartBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CountrySwitchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SearchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ThemeSwitchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Form/fields.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +1 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +26 -26
- package/dist/render/components/AppointmentBooking.js +1 -1
- package/dist/render/components/CollectionCard.js +1 -1
- package/dist/render/components/Collections.js +1 -1
- package/dist/render/components/ContactRouting.d.ts +3 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/FitmentTable.js +1 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FooterSection.js +1 -1
- package/dist/render/components/FormBlock.d.ts +9 -2
- package/dist/render/components/FormBlock.js +1 -1
- package/dist/render/components/GalleryGrid.js +3 -3
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/GalleryShowcase.js +1 -1
- package/dist/render/components/HeaderToolBlocks.d.ts +11 -5
- package/dist/render/components/HeaderToolBlocks.js +1 -1
- package/dist/render/components/HeaderTools.d.ts +1 -0
- package/dist/render/components/HeaderTools.js +1 -1
- package/dist/render/components/PhoneMenuAccount.d.ts +6 -0
- package/dist/render/components/PhoneMenuAccount.js +1 -0
- package/dist/render/components/PhoneSheet.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/ReviewForm.js +1 -1
- package/dist/render/components/SectionBand.js +1 -1
- package/dist/render/components/SectionGroupBody.js +1 -1
- package/dist/render/components/SectionNotice.js +1 -1
- package/dist/render/components/ThanksCard.d.ts +9 -0
- package/dist/render/components/ThanksCard.js +1 -0
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/lib/content/thanks-slot.d.ts +12 -0
- package/dist/render/lib/content/thanks-slot.js +1 -0
- package/dist/render/lib/document/blocks/commerce/AccountBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/CartBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/CountrySwitchBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/SearchBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ThemeSwitchBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
- package/dist/render/lib/document/blocks/service/Form/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/service/Form/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/Form/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +1 -0
- package/dist/words.js +1 -1
- package/package.json +1 -1
- /package/dist/chunks/{chunk-DHKJAYUG.js.LEGAL.txt → chunk-B3U6XXDZ.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as r,Fragment as y}from"react/jsx-runtime";import $e from"next/link";import{useMemo as R,useState as N}from"react";import{slugify as F,parseOption as Ce}from"efficient-shell/format";import{stripMarkup as T}from"efficient-web-builder/format/lib/markup";import{renderChrome as k,renderGold as i,renderHeadline as je}from"efficient-web-builder/render/components/goldPhrases";import O from"efficient-web-builder/render/components/Placeholder";import Se,{LightboxClose as ze}from"./Lightbox.js";import Le from"./ThemedSelect.js";import{say as $}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as _e}from"efficient-web-builder/render/components/ViewHideRoot";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 W(x){const g=[x.image,...(x.photos??[]).map(f=>f?.src)].filter(f=>!!f);return g.length?g:[""]}const G=6,Ae=()=>Array.from({length:G},(x,g)=>({image:"",process:$("Tag"),eyebrow:$("Category"),name:$("Item name"),meta:$("{n} photos",{n:`0${g+1}`})}));function Pe({mode:x="both",kicker:g,breadcrumbLabel:f,vehicleTabLabel:X="Gallery A",vehicleTitle:Y,vehicleBody1:ee,vehicleBody2:te,vehicleStats:ae,vehicleCards:B,wheelTabLabel:U="Gallery B",wheelTitle:re,wheelBody1:le,wheelBody2:ne,wheelStats:se,wheelCards:H,othersTitle:oe,othersBody1:ie,othersBody2:ce,othersStats:pe,othersCards:me,showBreadcrumb:de=!0,showStats:xe=!0,showIntro:ge=!0,showTabs:fe=!0,showFilters:E=!0,showCount:M=!0,showSort:I=!0,previewTab:C,previewHover:ue=!1,editing:h=!1}){const j=x==="both",v=j?["vehicles","wheels"]:x==="wheels"?["wheels"]:x==="others"?["others"]:["vehicles"],[be,he]=N(v[0]),w=(h&&j&&C&&v.includes(C)?C:null)??Ce(v,v[0],be),ve=h&&ue,[S,Z]=N("all"),[z,we]=N("newest"),[L,b]=N(null),n=w==="vehicles"?{title:Y,body1:ee,body2:te,stats:ae??[],cards:B??[],unit:"items",word:X}:w==="others"?{title:oe,body1:ie,body2:ce,stats:pe??[],cards:me??[],unit:"items",word:"Others"}:{title:re,body1:le,body2:ne,stats:se??[],cards:H??[],unit:"items",word:U},D=R(()=>{const e=[];for(const a of n.cards)a.process&&!e.includes(a.process)&&e.push(a.process);return e},[n.cards]),_=S!=="all"&&D.includes(S)?S:"all",V=_==="all"?n.cards:n.cards.filter(e=>e.process===_),q=R(()=>{const e=[...V];return z==="name"&&e.sort((a,o)=>(a.name??"").localeCompare(o.name??"")),e},[V,z]),J=n.cards.length===0,A=h&&J,P=A?Ae():q,ye=A?G:n.cards.length,Ne=A?G:q.length,K=g?`${g} · ${T(n.word)}`:void 0;function ke(e){e!==w&&(he(e),Z("all"))}return r(_e,{as:"section",className:"relative z-[2] bg-bg",children:[de&&r("nav",{className:`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`,children:[t("span",{className:"hover:text-fg",children:"Home"}),t("span",{className:"opacity-40",children:"/"}),t("span",{className:"text-fg",children:f?k(f):"Gallery"})]}),r("div",{className:"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]",children:[t("span",{className:`pb-4 font-mono ${l.labelXl} uppercase tracking-[0.3em] text-accent`,children:K?i(K):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?je(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:xe&&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))})]}),ge&&(n.body1||n.body2)&&r("div",{className:"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))]",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)})]}),j&&fe&&t("div",{className:"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",children:["vehicles","wheels"].map((e,a)=>{const o=w===e,c=e==="vehicles"?X:U,u=e==="vehicles"?(B??[]).length:(H??[]).length,p=(c||"").trim().split(/\s+/),m=p.slice(0,-1).join(" "),s=p.slice(-1)[0]??"";return r("button",{type:"button",onClick:()=>ke(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:[m?r(y,{children:[k(m)," "]}):null,t("em",{className:"font-normal italic text-accent",children:k(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:u})," ","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)})}),(E||M||I)&&r("div",{className:"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",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[t("div",{className:"flex flex-wrap gap-1",children:E&&["all",...D].map(e=>{const a=_===e,o=e==="all"?"All":e;return t("button",{type:"button",onClick:()=>Z(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:k(o)},e)})}),M?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:Ne})," / ",ye," ",n.unit]}):t("div",{}),I?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(Le,{value:z,onChange:e=>we(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:"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))]",children:P.length>0?t("div",{className:"grid grid-cols-6 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1",children:P.map((e,a)=>{const o=W(e)[0],u=`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(y,{children:[t(O,{label:F(e.name)||`gallery-card-${a+1}`,src:o||void 0,alt:T(e.name??""),sizes:"(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw",className:`transition-transform duration-700 ${ve?"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(P.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 h?t("div",{className:u,children:m},p):t("button",{type:"button",onClick:()=>b({card:e,index:0}),"aria-label":`Open ${e.name??"gallery item"}`,className:`${u} 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 ${l.labelXl} uppercase tracking-[0.2em] text-fg-dim`,children:J?"No items in this gallery yet.":"No items match this filter."})}),L&&(()=>{const e=W(L.card),{card:a,index:o}=L,c=e.length,u=e[o]??e[0]??"",p=s=>b(d=>d&&{...d,index:(d.index+s+c)%c}),m=[a.process,a.meta].filter(Boolean).join(" · ");return r(Se,{open:!0,onClose:()=>b(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(O,{label:F(a.name)||"gallery-photo",src:u||void 0,alt:T(a.name??""),objectFit:"contain",sizes:"92vw"})}),c>1&&r(y,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:s=>{s.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:s=>{s.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 ${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:[m?r(y,{children:[i(m)," · "]}):null,o+1," / ",c]})]}),a.href&&t($e,{href:a.href,onClick:()=>b(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:()=>b(Q=>Q&&{...Q,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(O,{label:F(a.name)||"gallery-photo",src:s||void 0,alt:"",sizes:"120px"})},`${s}-${d}`))}),t(ze,{})]})})()]})}export{Pe as default};
|
|
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};
|
|
@@ -3,19 +3,25 @@ import type { HeaderUtilStyle } from "../lib/content/header-bar.js";
|
|
|
3
3
|
export type ToolStyle = HeaderUtilStyle;
|
|
4
4
|
export declare const SEARCH_STYLES: readonly ["icon", "text", "icon_text"];
|
|
5
5
|
export type SearchStyle = (typeof SEARCH_STYLES)[number];
|
|
6
|
-
export declare function SearchTool({ style, stylePhone, editing }: {
|
|
6
|
+
export declare function SearchTool({ style, stylePhone, phonePlace, editing }: {
|
|
7
7
|
style?: SearchStyle;
|
|
8
8
|
stylePhone?: SearchStyle;
|
|
9
|
+
phonePlace?: unknown;
|
|
9
10
|
editing?: boolean;
|
|
10
11
|
}): import("react").JSX.Element | null;
|
|
11
|
-
export declare function CartTool({ style, editing }: {
|
|
12
|
+
export declare function CartTool({ style, phonePlace, editing }: {
|
|
12
13
|
style?: ToolStyle;
|
|
14
|
+
phonePlace?: unknown;
|
|
13
15
|
editing?: boolean;
|
|
14
16
|
}): import("react").JSX.Element | null;
|
|
15
|
-
export declare function AccountTool({ style }: {
|
|
17
|
+
export declare function AccountTool({ style, phonePlace }: {
|
|
16
18
|
style?: ToolStyle;
|
|
19
|
+
phonePlace?: unknown;
|
|
17
20
|
}): import("react").JSX.Element | null;
|
|
18
|
-
export declare function ThemeSwitchTool(
|
|
19
|
-
|
|
21
|
+
export declare function ThemeSwitchTool({ phonePlace }: {
|
|
22
|
+
phonePlace?: unknown;
|
|
23
|
+
}): import("react").JSX.Element | null;
|
|
24
|
+
export declare function CountrySwitchTool({ showAs, phonePlace, }: {
|
|
20
25
|
showAs?: CountryShowAs;
|
|
26
|
+
phonePlace?: unknown;
|
|
21
27
|
}): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t}from"react/jsx-runtime";import{useCart as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{useCart as T}from"./CartContext.js";import S,{useCountrySelectShows as w}from"./CountrySelect.js";import{AccountButton as p,CartButton as f,SearchButton as d}from"./HeaderTools.js";import C from"./ThemeToggle.js";import{useOfferToPhoneMenu as i}from"efficient-web-builder/render/components/PhoneMenuTools";import{useMoveAccountToPhoneMenu as k}from"./PhoneMenuAccount.js";import{useSearch as N}from"./SearchContext.js";import{useSiteSells as m,useSiteThemeSwitchShown as A}from"./SiteRecordContext.js";import{HideTaker as s}from"efficient-web-builder/render/components/ViewHideRoot";import{parseOption as x}from"efficient-shell/format";const B=["header","menu"];function l(e){return x(B,"",e)||void 0}const _=["icon","text","icon_text"];function R({style:e="icon",stylePhone:r,phonePlace:n,editing:o=!1}){const{open:c}=N(),u=m(),a=x(_,"",r)||void 0,h=!!a||l(n)==="header";return i(u&&!h?"search":null),u?h?t(s,{as:"span",className:"contents",children:t(d,{onClick:o?void 0:c,asText:e==="text",withWord:e==="icon_text",phoneLook:a})}):t(s,{as:"span","data-phone-menu-tool":"search",className:"contents",children:t(d,{onClick:o?void 0:c,asText:e==="text",withWord:e==="icon_text"})}):null}function Y({style:e="icon",phonePlace:r,editing:n=!1}){const{open:o,totals:c}=T(),u=m(),a=l(r)==="menu";return i(u&&a?"cart":null),u?a?t(s,{as:"span","data-phone-menu-tool":"cart",className:"contents",children:t(f,{onClick:n?()=>{}:o,count:c.sets,asText:e==="text"})}):t(f,{onClick:n?()=>{}:o,count:c.sets,asText:e==="text",takesViewHide:!0}):null}function b({style:e="icon",phonePlace:r}){const n=m(),o=l(r)==="menu";return i(n?"account":null),k(n&&o),n?o?t(s,{as:"span","data-phone-menu-tool":"account",className:"contents",children:t(p,{asText:e==="text"})}):t(p,{asText:e==="text",takesViewHide:!0}):null}function q({phonePlace:e}){const r=A(),n=l(e)==="header";return i(r&&!n?"theme":null),r?t(s,{as:"span",...n?null:{"data-phone-menu-tool":"theme"},className:"contents",children:t(C,{})}):null}function z({showAs:e,phonePlace:r}){const n=w(),o=l(r)==="header";return i(n&&!o?"region":null),n?t(s,{as:"span",...o?null:{"data-phone-menu-tool":"region"},className:"contents",children:t(S,{showAs:e})}):null}export{b as AccountTool,Y as CartTool,z as CountrySwitchTool,_ as SEARCH_STYLES,R as SearchTool,q as ThemeSwitchTool};
|
|
@@ -8,6 +8,7 @@ export declare const UTIL_WORDS: {
|
|
|
8
8
|
readonly close: "Close";
|
|
9
9
|
};
|
|
10
10
|
export declare const UTIL_WORD_CLASS = "whitespace-nowrap";
|
|
11
|
+
export declare function cartLabel(count: number): string;
|
|
11
12
|
export declare function CartButton({ onClick, count, asText, className, takesViewHide, }: {
|
|
12
13
|
onClick: () => void;
|
|
13
14
|
count: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e,jsxs as o,Fragment as y}from"react/jsx-runtime";import N from"next/link";import{useEffect as k,useRef as w}from"react";import{CartAltIcon as v}from"efficient-shell/icons/efficient-looks";import h from"efficient-easel/screen/components/UiIcon";import{prefersReducedMotion as $}from"efficient-web-builder/render/components/useReducedMotion";import{HideTaker as _,NO_HIDE as S,useTakeViewHide as C,withViewHide as j}from"efficient-web-builder/render/components/ViewHideRoot";const l={search:"Search",account:"Account",cart:"Bag",menu:"Menu",close:"Close"},d="whitespace-nowrap";function B(n){return n>99?"99+":String(n)}function W({count:n,ref:t}){return e("span",{ref:t,"data-cart-badge":"","aria-hidden":"true",className:"pointer-events-none absolute -top-[7px] -right-[9px] inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-current px-1 text-[10px] leading-none font-semibold tabular-nums",style:{letterSpacing:0},children:e("span",{style:{color:"var(--sf-header-ground, var(--bg))"},children:B(n)})})}function A(n){return`Open cart, ${n} item${n===1?"":"s"}`}function T({onClick:n,count:t,asText:s,className:r,takesViewHide:a=!1}){const c=w(null),i=w(t);return k(()=>{i.current!==t&&(i.current=t,!$()&&c.current?.animate([{transform:"scale(0.6)"},{transform:"scale(1)"}],{duration:180,easing:"ease-out"}))},[t]),e(_,{as:"button",takes:a,type:"button",onClick:n,"aria-label":A(t),className:`mono-eyebrow-ctl inline-flex items-center gap-2 opacity-80 transition-opacity hover:opacity-100 ${r??""}`,children:s?o("span",{className:d,children:[l.cart,t>0?` ${t}`:""]}):o("span",{className:"relative inline-flex",children:[e(v,{size:18,strokeWidth:"1.6","aria-hidden":"true"}),t>0?e(W,{count:t,ref:c}):null]})})}function U({asText:n,className:t,takesViewHide:s=!1}){const r=C(),a=s?r:S;return a.scope(e(N,{href:"/account","aria-label":"Account",className:j(`mono-eyebrow-ctl inline-flex items-center opacity-80 transition-opacity hover:opacity-100 ${t??""}`,a.className),...a.attrs,children:n?e("span",{className:d,children:l.account}):o("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e("circle",{cx:"12",cy:"8",r:"3.4"}),e("path",{d:"M5 20a7 7 0 0 1 14 0"})]})}))}function D({onClick:n,asText:t,withWord:s,phoneLook:r,className:a}){let c=!1,i;if(r){const u=t?"text":s?"icon_text":"icon",m=(b,g)=>b&&g?"":b?"max-view-tablet:hidden":g?"view-tablet:hidden":null,p=m(u!=="text",r!=="text"),f=m(u!=="icon",r!=="icon"),x=u==="icon_text"||r==="icon_text";c=!0,i=o(y,{children:[p===null?null:e("span",{className:`inline-flex ${p}`,children:e(h,{name:"search",size:x?20:18,strokeWidth:x?1.5:1.6,rounded:!0})}),f===null?null:e("span",{className:`${d} ${f}`,children:l.search})]})}else s?(c=!0,i=o(y,{children:[e(h,{name:"search",size:20,strokeWidth:1.5,rounded:!0}),e("span",{className:`${d} max-view-tablet:hidden`,children:l.search})]})):i=t?e("span",{className:d,children:l.search}):e(h,{name:"search",size:18,strokeWidth:1.6,rounded:!0});return e("button",{type:"button",onClick:n,"aria-label":"Search",title:"Search (⌘K)",className:`mono-eyebrow-ctl inline-flex items-center ${c?"gap-2 ":""}opacity-80 transition-opacity hover:opacity-100 ${a??""}`,children:i})}export{U as AccountButton,T as CartButton,D as SearchButton,l as UTIL_WORDS,d as UTIL_WORD_CLASS,A as cartLabel};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare function AccountInPhoneMenuProvider({ children }: {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function useMoveAccountToPhoneMenu(moved: boolean): void;
|
|
6
|
+
export declare function useAccountInPhoneMenu(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as s}from"react/jsx-runtime";import{createContext as c,useContext as o,useEffect as f,useMemo as i,useState as l}from"react";const t=c(null);function a({children:n}){const[e,u]=l(!1),r=i(()=>({moved:e,setMoved:u}),[e]);return s(t.Provider,{value:r,children:n})}function x(n){const e=o(t)?.setMoved;f(()=>{if(!(!e||!n))return e(!0),()=>e(!1)},[e,n])}function d(){return o(t)?.moved??!1}export{a as AccountInPhoneMenuProvider,d as useAccountInPhoneMenu,x as useMoveAccountToPhoneMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as n}from"react/jsx-runtime";import b from"next/link";import g from"efficient-easel/screen/components/UiIcon";import N from"./CountrySelect.js";import y from"./ThemeToggle.js";import{CartAltIcon as w}from"efficient-shell/icons/efficient-looks";import{useCart as j}from"./CartContext.js";import{cartLabel as v,UTIL_WORDS as u}from"./HeaderTools.js";import{UNDER_HEADER_SHEET_CLASS as C}from"../lib/content/header-bar.js";const f="flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]";function z({role:l,panelRef:a,name:o,entries:c,tools:e,withAccount:s,editing:m,onClose:i,onSearch:h,phoneOnly:p=!1,marker:d,listStyle:x}){const r=e&&(e.search||e.cart||e.region||s&&e.account||e.theme)?e:null;return n("div",{ref:a,role:l,"aria-modal":"true","aria-label":o,tabIndex:-1,...d?{"data-menu-panel":d}:null,className:`${C} z-[60] flex flex-col overflow-y-auto bg-bg text-fg${p?" view-tablet:hidden":""}`,children:[t("ul",{className:"m-0 flex list-none flex-col px-5 py-3 font-mono text-[16px] uppercase tracking-[0.18em]",style:x,children:c}),r?n("div",{className:"mt-auto flex flex-col gap-4 border-t border-line bg-surface p-5",children:[r.search?n("button",{type:"button",className:f,onClick:m?void 0:()=>{i(),h()},children:[t(g,{name:"search",size:18,strokeWidth:1.6,rounded:!0}),u.search]}):null,r.cart?t(T,{editing:m,onClose:i}):null,s&&r.account?n("div",{className:"flex items-center justify-between",children:[t("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),t(b,{href:"/account",onClick:i,className:"mono-eyebrow underline",children:"Your account"})]}):null,r.region?n("div",{className:"flex items-center justify-between",children:[t("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),t(N,{})]}):null,r.theme?n("div",{className:"flex items-center justify-between",children:[t("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),t(y,{})]}):null]}):null]})}function T({editing:l,onClose:a}){const{open:o,totals:c}=j(),e=c.sets;return n("button",{type:"button",className:f,"aria-label":v(e),onClick:l?void 0:()=>{a(),o()},children:[t(w,{size:18,strokeWidth:"1.6","aria-hidden":"true"}),u.cart,e>0?` ${e}`:""]})}export{z as PhoneSheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as w,Fragment as dt}from"react/jsx-runtime";import{useScopeClass as ct}from"../lib/use-scope-class.js";import{useEffect as B,useMemo as g,useState as ge}from"react";import{cardHoverOf as pt}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as gt}from"efficient-web-builder/format/lib/content/container-gap";import ut from"next/link";import{cardRowsGrid as ft,GridCardProvider as ht,GridMixedCards as xt,gridIndexCss as wt}from"./GridCardTemplate.js";import{gridClassImageSizes as vt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as ue}from"../lib/sections/fill-row.js";import{hiddenCardsRule as fe,noHoleBands as he,noHoleCss as xe,ONE_WHEEL_MARK as yt,oneWheelScope as we,pairScope as bt,showsASetCard as ve}from"../lib/sections/grid-no-hole.js";import{setIsWide as Ct,summarySetBuild as St}from"../lib/wheels/set-mode.js";import{answersForKind as ye,NO_FIELD_ANSWERS as be}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as Mt}from"./ProductCardEyebrow.js";import Pt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as Tt,centredCap as _t}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as Et,SectionWheelsProvider as Nt}from"./ProductRef.js";import{useCurrency as Ot}from"./CurrencyContext.js";import{FRAME_ROOM_PRODUCT_GRID as Rt,FRAME_ROOM_PRODUCT_GRID_PHONE as $t,framedBandPad as It,PRODUCT_GRID_ROOM as zt,withBandClasses as Lt}from"../lib/sections/band-padding.js";import{COLLECTION_ATTR as At,useCatalogFilter as Bt}from"./catalog/CatalogFilterContext.js";import{useShopperMember as Gt}from"./catalog/ShopperScope.js";import{useBrowserLayoutEffect as Ht}from"efficient-shell/hooks";import Dt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as Ft}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as kt,hasActivePlpFilters as Ut,plpPricedAmounts as Wt}from"../lib/wheels/plp-filters.js";import jt from"./catalog/ClearAllButton.js";import{GRID_TOP_UP_SPARE as Kt,gridPagingOf as Xt,gridShownOf as Zt}from"../lib/sections/product-grid-pages.js";import qt from"./SectionBand.js";import{useInsideBox as Yt,useInsideSiteGutter as Vt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Jt}from"../lib/sections/product-grid-columns.js";import{renderGold as re,renderHeadline as Qt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as er}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as tr}from"../lib/wheels/wheel-summary-casing.js";import{itemKind as G,plpKindNoun as Ce}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as rr,gridKindsOf as Se,gridRowsOf as nr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as ir}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as sr}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as or}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as ar}from"../lib/wheels/lug-count.js";import{diametersOf as lr}from"../lib/wheels/size-range.js";import{say as mr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as dr}from"../lib/sections/product-grid-title.js";import{blockParts as cr}from"../lib/block-parts.js";import{PRODUCT_GRID_TYPE as pr}from"../lib/document/document-nodes.js";const m=cr(pr),gr=pt({},"ProductGrid"),i={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},Me=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${i.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium1} ${i.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium2} ${i.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium3} ${i.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium4} ${i.headingMediumUpTo800Xl}`}];function ur(P){return(Me.find(v=>v.value===P)??Me.find(v=>v.value===dr)).cls}function fr({num:P,catalog:v,catalogTotal:Pe,firstCountInChips:Te=!1,kinds:N,title:H,titleSize:_e,pads:Ee,noTop:ne=!1,description:O,link:T,products:Ne,wheels:Oe,source:p,columns:Re,columnsPhone:$e,columnsTablet:Ie,limit:ze,moreProducts:Le,perPage:Ae,editing:_,contentCapped:Be=!1,hover:Ge,fieldUsage:y,ownerId:He="",template:De,gap:Fe,gapPhone:ke}){const D=g(()=>y?ye(y,"alloy-wheel"):void 0,[y]),Ue=g(()=>y?ye(y,"tyre"):void 0,[y]),e=ct("pg"),{paged:b,per:C,limit:a,cap:u}=Xt({moreProducts:Le,perPage:Ae,limit:ze}),d=Jt(Re,$e,Ie),ie=Be,We=Vt(),je=Yt(),Ke=We||je,F=ir(_===!0&&!!p),s=g(()=>p?tr(nr(p,N,F??v??[])):null,[v,F,p,N]),k=Gt("grid",s),l=s?k.scope:null,f=rr(p),S=f!==null&&!l,{filters:R,reportCount:U,reportLugs:W,reportSizes:j,reportFinishes:K,reportCategories:X,reportPrices:Z,vehicle:se}=Bt(),{currency:h}=Ot(),q=S&&!!R.process&&R.process!==f,Y=l?.state,r=g(()=>s?Y?kt(s,Y,h):S?er(s,R,h,se.fit):s:null,[s,Y,S,R,h,se.fit]),[Xe,Ze]=ge(1),V=b&&r?Math.max(1,Math.ceil(r.length/C)):1,M=Math.min(V,Math.max(1,l?l.state.page:Xe)),{reportShown:J}=k,oe=l!==null;Ht(()=>{if(!oe||!r)return J(null);J(Zt(r.length,{paged:b,per:C,cap:u},M))},[oe,r,J,b,M,C,u]);const qe=n=>l?l.update({page:n}):Ze(n),o=g(()=>r&&(b?r.slice((M-1)*C,M*C):u?r.slice(0,Math.ceil(a)+Kt):r),[b,u,a,r,M,C]);B(()=>(X(e,f===null?[]:[f]),()=>X(e,[])),[f,X,e]),B(()=>{if(S)return U(e,q?0:r?.length??0),()=>U(e,0)},[S,q,r,U,e]);const E=g(()=>({lugs:ar(s??[]),sizes:lr(s??[]),finishes:or(s??[]),prices:Wt((s??[]).filter(n=>G(n)!=="tyre"),h)}),[s,h]);B(()=>(W(e,E.lugs),j(e,E.sizes),K(e,E.finishes),Z(e,E.prices),()=>{W(e,[]),j(e,[]),K(e,[]),Z(e,[])}),[E,W,j,K,Z,e]);const Q=gt("ProductGrid",Fe,"both",ke),Ye=`${e} grid${Q.className} bg-[var(--catalog-grid-bg)] ${d}`,ae=ft(Q),Ve=`${e} grid${ae.className} bg-[var(--catalog-grid-bg)] ${d}`,Je=ae.style,Qe=g(()=>{const n=(r??[]).filter(c=>G(c)!=="tyre");if(n.length===0)return!1;const x=n.some(c=>!!c.process);return n.some(c=>!!c.setWords)||Mt({kind:!1,brand:!1,process:x},D??[])},[r,D]),et=o?o.length>0?t("div",{className:Ve,style:Je,...m("grid"),children:t(xt,{items:o,tyreOf:n=>G(n)==="tyre"?n:null})}):l&&Ut(l.state)?w("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",...m("grid-empty"),children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${Ce(Se(p,N)).many} match those filters`}),t(jt,{onClick:l.clear})]}):_?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",...m("grid-empty"),children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:mr("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Ne,{className:Ye,style:Q.style,minEmptyHeight:320}),tt=l?l.countInChips:Te,$=r&&!tt?r===s&&!F?Pe??r.length:r.length:null,le=Ce(Se(p,N)),rt=P||H||O||T?w("div",{className:`${sr} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${ie||Ke?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,...m("grid-head"),children:[w("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[P&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,...m("grid-number"),children:re(P)}),H&&t("h2",{className:`${ur(_e)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,...m("heading"),children:Qt(H,!1)})]}),(O||T||$!==null)&&w("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[O&&t("span",{className:`max-w-[340px] truncate font-display ${i.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,...m("description"),children:re(O)}),T&&w(ut,{href:T.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${i.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,...m("view-all"),children:[re(T.text),t("span",{"aria-hidden":!0,children:"→"})]}),$!==null&&w("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,...m("count"),children:[$," ",$===1?le.one:le.many]})]})]}):null,I=It(Ee,zt,{noTop:ne}),{paddingTop:nt,...it}=I.style,z=ne?0:nt,st={...z===void 0?{}:{"--pg-pt":typeof z=="number"?`${z}px`:z},...it},L=g(()=>{if(!o)return null;const n=o.map(x=>G(x)!=="tyre"&&Ct(St(x))?2:1);return ve(n,a)?he(d,n,a):null},[o,d,a]),[ot,at]=ge("");B(()=>{if(o)return;const n=document.querySelector(`.${e}`);if(!n)return;const x=()=>{const c=[...n.children].map(pe=>pe.classList.contains("col-span-2")&&!pe.querySelector(yt)?2:1);at(ve(c,a)?xe(e,he(d,c,a,!1),c.length):"")};x();const te=new MutationObserver(x);return te.observe(n,{childList:!0}),()=>te.disconnect()},[o,e,d,a]);const lt=L?L[0].tracks:o?u?Math.min(o.length,a):o.length:void 0,A=L?xe(bt(e),L,o.length)+(u?fe(we(e),a+1):"")+ue(we(e),d,{limit:a,cards:o.length}):ot,me=A?"":ue(e,d,{limit:a,cards:o?.length}),de=wt(e),ce=w(dt,{children:[u&&!A&&t("style",{children:fe(e,a+1)}),A&&t("style",{children:A}),me&&t("style",{children:me}),de&&t("style",{children:de}),rt,et,b&&V>1&&t(Dt,{textSize:Ft.labelSmall,page:M,pageCount:V,onPage:qe}),t(Pt,{editing:_})]});if(q)return null;const ee=t(qt,{rootRef:k.ref,attrs:{...S&&f!==null?{...I.attrs,[At]:f}:I.attrs,...m("product-grid-block")},className:Lt(`relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] ${Rt} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${$t}`,I),column:null,inAnyBox:!0,style:st,defaults:{"--pg-pt":"120px"},children:ie?t("div",{style:_t(Tt),children:ce}):ce}),mt=s?ee:_?t(Et,{currency:h,children:ee}):t(Nt,{wheels:Oe,currency:h,children:ee});return t(ht,{value:{ownerId:He,Template:De,hover:Ge??gr,imageSizes:vt(d,lt),fieldUsage:D??be,tyreFieldUsage:Ue??be,reserveEyebrow:Qe,editing:_===!0},children:mt})}export{Me as TITLE_SIZES,fr as default};
|
|
1
|
+
"use client";import{jsx as t,jsxs as w,Fragment as pt}from"react/jsx-runtime";import{useScopeClass as gt}from"../lib/use-scope-class.js";import{useEffect as B,useMemo as g,useState as ue}from"react";import{cardHoverOf as ut}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as ft}from"efficient-web-builder/format/lib/content/container-gap";import ht from"next/link";import{cardRowsGrid as xt,GridCardProvider as wt,GridMixedCards as vt,gridIndexCss as yt}from"./GridCardTemplate.js";import{gridClassImageSizes as bt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as fe}from"../lib/sections/fill-row.js";import{hiddenCardsRule as he,noHoleBands as xe,noHoleCss as we,ONE_WHEEL_MARK as Ct,oneWheelScope as ve,pairScope as St,showsASetCard as ye}from"../lib/sections/grid-no-hole.js";import{setIsWide as Mt,summarySetBuild as Pt}from"../lib/wheels/set-mode.js";import{answersForKind as be,NO_FIELD_ANSWERS as Ce}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as Ot}from"./ProductCardEyebrow.js";import Tt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as _t,centredCap as Et,withSideOnce as Se}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as Nt,SectionWheelsProvider as Rt}from"./ProductRef.js";import{useCurrency as $t}from"./CurrencyContext.js";import{FRAME_ROOM_PRODUCT_GRID as It,FRAME_ROOM_PRODUCT_GRID_PHONE as zt,framedBandPad as Lt,PRODUCT_GRID_ROOM as At,withBandClasses as Bt}from"../lib/sections/band-padding.js";import{COLLECTION_ATTR as Gt,useCatalogFilter as Ht}from"./catalog/CatalogFilterContext.js";import{useShopperMember as Dt}from"./catalog/ShopperScope.js";import{useBrowserLayoutEffect as Ft}from"efficient-shell/hooks";import kt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as Ut}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Wt,hasActivePlpFilters as jt,plpPricedAmounts as Kt}from"../lib/wheels/plp-filters.js";import Xt from"./catalog/ClearAllButton.js";import{GRID_TOP_UP_SPARE as Zt,gridPagingOf as qt,gridShownOf as Yt}from"../lib/sections/product-grid-pages.js";import Vt from"./SectionBand.js";import{useInsideBox as Jt,useInsideSiteGutter as Qt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as er}from"../lib/sections/product-grid-columns.js";import{renderGold as re,renderHeadline as tr}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as rr}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as nr}from"../lib/wheels/wheel-summary-casing.js";import{itemKind as G,plpKindNoun as Me}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as ir,gridKindsOf as Pe,gridRowsOf as sr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as or}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as ar}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as lr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as dr}from"../lib/wheels/lug-count.js";import{diametersOf as mr}from"../lib/wheels/size-range.js";import{say as cr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as pr}from"../lib/sections/product-grid-title.js";import{blockParts as gr}from"../lib/block-parts.js";import{PRODUCT_GRID_TYPE as ur}from"../lib/document/document-nodes.js";import{useSideSpaceOnce as fr}from"efficient-web-builder/render/components/SideSpaceOnce";const d=gr(ur),hr=ut({},"ProductGrid"),i={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},Oe=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${i.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium1} ${i.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium2} ${i.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium3} ${i.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium4} ${i.headingMediumUpTo800Xl}`}];function xr(P){return(Oe.find(v=>v.value===P)??Oe.find(v=>v.value===pr)).cls}function wr({num:P,catalog:v,catalogTotal:Te,firstCountInChips:_e=!1,kinds:E,title:H,titleSize:Ee,pads:Ne,noTop:ne=!1,description:N,link:O,products:Re,wheels:$e,source:p,columns:Ie,columnsPhone:ze,columnsTablet:Le,limit:Ae,moreProducts:Be,perPage:Ge,editing:T,contentCapped:He=!1,hover:De,fieldUsage:y,ownerId:Fe="",template:ke,gap:Ue,gapPhone:We}){const ie=fr(),D=g(()=>y?be(y,"alloy-wheel"):void 0,[y]),je=g(()=>y?be(y,"tyre"):void 0,[y]),e=gt("pg"),{paged:b,per:C,limit:a,cap:u}=qt({moreProducts:Be,perPage:Ge,limit:Ae}),m=er(Ie,ze,Le),se=He,Ke=Qt(),Xe=Jt(),Ze=Ke||Xe,F=or(T===!0&&!!p),s=g(()=>p?nr(sr(p,E,F??v??[])):null,[v,F,p,E]),k=Dt("grid",s),l=s?k.scope:null,f=ir(p),S=f!==null&&!l,{filters:R,reportCount:U,reportLugs:W,reportSizes:j,reportFinishes:K,reportCategories:X,reportPrices:Z,vehicle:oe}=Ht(),{currency:h}=$t(),q=S&&!!R.process&&R.process!==f,Y=l?.state,r=g(()=>s?Y?Wt(s,Y,h):S?rr(s,R,h,oe.fit):s:null,[s,Y,S,R,h,oe.fit]),[qe,Ye]=ue(1),V=b&&r?Math.max(1,Math.ceil(r.length/C)):1,M=Math.min(V,Math.max(1,l?l.state.page:qe)),{reportShown:J}=k,ae=l!==null;Ft(()=>{if(!ae||!r)return J(null);J(Yt(r.length,{paged:b,per:C,cap:u},M))},[ae,r,J,b,M,C,u]);const Ve=n=>l?l.update({page:n}):Ye(n),o=g(()=>r&&(b?r.slice((M-1)*C,M*C):u?r.slice(0,Math.ceil(a)+Zt):r),[b,u,a,r,M,C]);B(()=>(X(e,f===null?[]:[f]),()=>X(e,[])),[f,X,e]),B(()=>{if(S)return U(e,q?0:r?.length??0),()=>U(e,0)},[S,q,r,U,e]);const _=g(()=>({lugs:dr(s??[]),sizes:mr(s??[]),finishes:lr(s??[]),prices:Kt((s??[]).filter(n=>G(n)!=="tyre"),h)}),[s,h]);B(()=>(W(e,_.lugs),j(e,_.sizes),K(e,_.finishes),Z(e,_.prices),()=>{W(e,[]),j(e,[]),K(e,[]),Z(e,[])}),[_,W,j,K,Z,e]);const Q=ft("ProductGrid",Ue,"both",We),Je=`${e} grid${Q.className} bg-[var(--catalog-grid-bg)] ${m}`,le=xt(Q),Qe=`${e} grid${le.className} bg-[var(--catalog-grid-bg)] ${m}`,et=le.style,tt=g(()=>{const n=(r??[]).filter(c=>G(c)!=="tyre");if(n.length===0)return!1;const x=n.some(c=>!!c.process);return n.some(c=>!!c.setWords)||Ot({kind:!1,brand:!1,process:x},D??[])},[r,D]),rt=o?o.length>0?t("div",{className:Qe,style:et,...d("grid"),children:t(vt,{items:o,tyreOf:n=>G(n)==="tyre"?n:null})}):l&&jt(l.state)?w("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",...d("grid-empty"),children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${Me(Pe(p,E)).many} match those filters`}),t(Xt,{onClick:l.clear})]}):T?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",...d("grid-empty"),children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:cr("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Re,{className:Je,style:Q.style,minEmptyHeight:320}),nt=l?l.countInChips:_e,$=r&&!nt?r===s&&!F?Te??r.length:r.length:null,de=Me(Pe(p,E)),it=P||H||N||O?w("div",{className:Se(`${ar} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${se||Ze?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,ie),...d("grid-head"),children:[w("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[P&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,...d("grid-number"),children:re(P)}),H&&t("h2",{className:`${xr(Ee)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,...d("heading"),children:tr(H,!1)})]}),(N||O||$!==null)&&w("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[N&&t("span",{className:`max-w-[340px] truncate font-display ${i.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,...d("description"),children:re(N)}),O&&w(ht,{href:O.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${i.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,...d("view-all"),children:[re(O.text),t("span",{"aria-hidden":!0,children:"→"})]}),$!==null&&w("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,...d("count"),children:[$," ",$===1?de.one:de.many]})]})]}):null,I=Lt(Ne,At,{noTop:ne}),{paddingTop:st,...ot}=I.style,z=ne?0:st,at={...z===void 0?{}:{"--pg-pt":typeof z=="number"?`${z}px`:z},...ot},L=g(()=>{if(!o)return null;const n=o.map(x=>G(x)!=="tyre"&&Mt(Pt(x))?2:1);return ye(n,a)?xe(m,n,a):null},[o,m,a]),[lt,dt]=ue("");B(()=>{if(o)return;const n=document.querySelector(`.${e}`);if(!n)return;const x=()=>{const c=[...n.children].map(ge=>ge.classList.contains("col-span-2")&&!ge.querySelector(Ct)?2:1);dt(ye(c,a)?we(e,xe(m,c,a,!1),c.length):"")};x();const te=new MutationObserver(x);return te.observe(n,{childList:!0}),()=>te.disconnect()},[o,e,m,a]);const mt=L?L[0].tracks:o?u?Math.min(o.length,a):o.length:void 0,A=L?we(St(e),L,o.length)+(u?he(ve(e),a+1):"")+fe(ve(e),m,{limit:a,cards:o.length}):lt,me=A?"":fe(e,m,{limit:a,cards:o?.length}),ce=yt(e),pe=w(pt,{children:[u&&!A&&t("style",{children:he(e,a+1)}),A&&t("style",{children:A}),me&&t("style",{children:me}),ce&&t("style",{children:ce}),it,rt,b&&V>1&&t(kt,{textSize:Ut.labelSmall,page:M,pageCount:V,onPage:Ve}),t(Tt,{editing:T})]});if(q)return null;const ee=t(Vt,{rootRef:k.ref,attrs:{...S&&f!==null?{...I.attrs,[Gt]:f}:I.attrs,...d("product-grid-block")},className:Bt(Se(`relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] ${It} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${zt}`,ie),I),column:null,inAnyBox:!0,style:at,defaults:{"--pg-pt":"120px"},children:se?t("div",{style:Et(_t),children:pe}):pe}),ct=s?ee:T?t(Nt,{currency:h,children:ee}):t(Rt,{wheels:$e,currency:h,children:ee});return t(wt,{value:{ownerId:Fe,Template:ke,hover:De??hr,imageSizes:bt(m,mt),fieldUsage:D??Ce,tyreFieldUsage:je??Ce,reserveEyebrow:tt,editing:T===!0},children:ct})}export{Oe as TITLE_SIZES,wr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as g,jsxs as c}from"react/jsx-runtime";import{partSkus as Le}from"../lib/catalog/part-skus.js";import ee from"next/link";import{useEffect as te,useRef as ae,useState as Ie}from"react";import{useCart as Pe}from"./CartContext.js";import{useSiteTakesOrders as $e}from"./SiteRecordContext.js";import He from"./EmailCaptureForm.js";import{useEnglish as le}from"./EnglishVariant.js";import{MarkedLabel as ne,heroView as Me}from"./product-hero/hero-view.js";import{useRootIsDark as Ue}from"efficient-shell/theme";import{useStockAlertSignup as je}from"./useStockAlertSignup.js";import{SPARE_WORDS as ze,productCartLine as De}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as Be}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as Ve}from"../lib/catalog/product-options.js";import{trackViewItem as Fe}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as Ye,DEFAULT_HERO_RATIO as Ke,DEFAULT_HERO_TEXT_ALIGN as Qe,parseHeroLayout as We,parseHeroRatio as Xe,parseHeroTextAlign as Ge}from"../lib/sections/hero-arrangement.js";import{MAX_SPARES as qe,UNITS_PER_SET as re,formatPrice as se}from"../lib/commerce.js";import{formatSelectionPrice as Je,setPriceLabel as Ze}from"../lib/wheels/price-display.js";import{productIsDually as et,productIsTwoObjects as tt,setSuppressesRow as at}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ie}from"../lib/sections/content-cap-gutter.js";import{STICKY_COLUMNS_CLASS as lt,STICKY_SECTION_ATTR as nt}from"../lib/sections/hero-sticky.js";import{useStickyColumns as rt}from"./useStickyColumns.js";import{BLOCK_ALIGN_TEXT as st}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 it}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as ot}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as ct}from"../lib/content/hero-option-seed.js";import{HERO_BUY_SLOT as mt,HERO_QUANTITY_PART as pt,HERO_SAVE_PART as dt}from"../lib/content/hero-buy-seed.js";import{HERO_PART as f}from"../lib/content/hero-seed.js";import ut from"./card-pieces/CardQuantity.js";import ft from"./card-pieces/CardSave.js";import ht from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as bt}from"./card-pieces/ProductCardState.js";import{PRODUCT_HERO_TYPE as $}from"../lib/document/document-nodes.js";const gt=4e3;function xt(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const oe=[{}],vt=(e,r)=>r===pt?t(ut,{}):r===dt?t(ft,{}):null,kt="[&>[data-sf-repeat]]:contents [&>[data-sf-repeat]>div]:contents";function Tt({product:e,selection:r,onLightbox:o,editing:s=!1,showVehicleFitment:i=!0,heroLayout:l=Ye,imageRatio:n=Ke,textAlign:y=Qe,showSpecTable:me=!0,stickyColumns:pe=!1,nodeId:S,template:de,optionTemplate:ue,optionPressTitles:fe,buyTemplate:he}){const be=le(),x=We(l),H=Ge(y),k=Xe(n),N=pe===!0&&x!=="stacked",M=ae(null);rt(M,N);const ge=x==="imageRight"?`${100-k}fr ${k}fr`:`${k}fr ${100-k}fr`,{picked:xe,pick:U,qty:j,setQty:ve,choice:z,setChoice:ke,angleIdx:Nt,setAngleIdx:wt,showValidation:Te,setShowValidation:w,manualMode:D,vehicle:_,rows:B,facts:ye,part:d,outOfStock:V,offer:F,preOrder:O,canAddToCart:Y,currency:h,price:p,set:K,msrpLabel:Se}=r,m=Me(e,r,s),R=et(e),Ne=tt(e),C=i?m.vehicle:null,we=i?m.vehicleMemory:null,Q=!Ue({whenUnset:!0}),{warmCatalog:W}=Pe(),T=$e();te(()=>{!s&&T&&W(e.kind,e.slug)},[s,T,e.kind,e.slug,W]);const X=B.filter(a=>!O||a.values.length>0),G=X.filter(a=>a.role==="resolves"),A=X.filter(a=>a.role==="describes"&&!at(Ne,a.key)),q=A.findIndex(a=>a.chosen===null),J=(!C||!m.vehicleAnswersSpecs||r.fitmentSet)&&Ve(B,O)?q===-1?A:A.slice(0,q+1):[],_e=[...G,...J];function Oe(){return Y?(w(!1),s?null:De(e,d,xe,{choice:z,qty:j},{fitmentLabel:D?m.specCaption:_.appliedName?`For ${_.appliedName}`:"",fitmentKey:D?`manual|${m.specCaption}`:`vehicle|${xt(_.applied?.vehicle)}`})):(w(!0),window.setTimeout(()=>w(!1),gt),null)}const Re={kind:"hero",msrpLabel:Se||null,amount:R?Ze(p,h):Je(p,h),unitLabel:p.priced?m.unitLabel:null,packBadge:p.setTotal!=null?`${F.quantityLabel}: ${se(K,h)}`:null,buy:{isSet:R,priced:p.priced,outOfStock:V,canAdd:Y,totalLabel:p.setTotal!=null?se(K,h):null,lineToAdd:Oe},qty:j,setQty:ve,takesQty:T&&!(R&&!p.priced),save:{slug:e.slug,name:e.name},facts:me?ye:null,title:{eyebrow:e.eyebrow,name:m.heading,badge:e.badge||null},product:e,selection:r,openLightbox:o,sku:Le(d)},E={nodeId:S??"",template:ue,pressTitles:fe,editing:s},u=!!(O&&m.preOrder),Ce={[f.fitmentLine]:we,[f.options]:c(g,{children:[G.map(a=>t(ce,{row:a,onPick:U,options:E},a.key)),!u&&C,!u&&J.map(a=>t(ce,{row:a,onPick:U,options:E},a.key))]}),[f.facts]:u?null:t(ht,{}),[f.howMany]:u?null:t(yt,{offer:F,takesOrders:T,choice:z,setChoice:ke,options:E}),[f.buy]:u?m.preOrder:t(P,{children:t(I,{ownerId:S??"",ownerType:$,slot:mt,Template:he,rows:oe,fallback:null,hostParts:vt,children:a=>a})}),[f.notify]:!u&&V&&d?t(St,{partNumbers:d.components.map(a=>a.partNumber),productSlug:e.slug},d.id):null,[f.reminder]:!u&&Te?Ee():null},Ae=(a,b)=>Ce[b]??null;function Ee(){const a=_e.filter(L=>L.chosen===null).map(L=>be(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 Z=ae(null);return te(()=>{s||Z.current===e.slug||(Z.current=e.slug,Fe({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:`border-b border-line ${ie} 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))]`,style:Q?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(ee,{href:a.href,className:"hover:text-fg",children:t(ne,{text:a.label})}):t("span",{className:"text-fg",children:t(ne,{text:a.label})})]},`${a.label}-${b}`))}),t("section",{ref:M,"data-hero-layout":x,"data-hero-align":H,...N?{[nt]:""}:{},className:[`grid gap-10 ${ie} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8 ${kt}`,H==="center"?st.center:"",x==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]",N?lt:""].filter(Boolean).join(" "),style:{...Q?{}:{background:"var(--section-bg)"},...x==="stacked"?{}:{"--hero-cols":ge}},children:t(bt,{value:Re,children:t(P,{children:t(I,{ownerId:S??"",ownerType:$,Template:de,rows:oe,fallback:null,hostParts:Ae,children:a=>a})})})})]})}function yt({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?qe: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:ze.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-re,press:l=>()=>s(n=>({...n,spares:l.value-re}))})})]}),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 ce({row:e,onPick:r,options:o}){const s=le();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]",[Be]: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(ee,{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=ot(r,{item:o,selected:s,press:i});return t(P,{children:t(I,{ownerId:e.nodeId,ownerType:$,slot:ct,Template:e.template,rows:l.items.map(it),items:l.items,states:l.states,actions:e.editing?void 0:l.actions,pressTitles:e.pressTitles,fallback:null,children:n=>n})})}function St({partNumbers:e,productSlug:r}){const[o,s]=Ie(""),{status:i,submit:l,reset:n}=je();function y(){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(He,{className:"-mt-1",email:o,onEmailChange:s,status:i,onResetVerdict:n,onSubmit:y,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{Tt as default};
|
|
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 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{useState as
|
|
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 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{EDITORIAL_COLUMN as
|
|
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 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{PhoneMenuToolsProvider as g}from"efficient-web-builder/render/components/PhoneMenuTools";import{AccountInPhoneMenuProvider as v}from"./PhoneMenuAccount.js";import{SectionGroupWidthsProvider as T}from"efficient-web-builder/render/components/SiteGutterFrame";import{chromeOwnWidth as b}from"efficient-web-builder/format/lib/content/section-width";import{centredCap as P,SITE_WIDTH_CAP as x}from"efficient-web-builder/format/lib/content/page-width";import{resolveMenuRow as S,resolveNavTextCase as y}from"../lib/content/header-bar.js";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{textKindVars as k}from"../lib/content/text-kind-vars.js";import{blockParts as a}from"../lib/block-parts.js";const w=a("SiteHeader")("header-content"),A=a("SiteFooter")("footer"),E={font:"--sf-header-tool-font",size:"--sf-header-tool-size"};function O(o){const n=k(o,E);return Object.keys(n).length?n:null}function R({place:o,sections:n,editing:c=!1,widths:u,navTextCase:f,menuRow:m,toolTextStyle:l}){const h=o==="footer"?"footer":"div",t=b(u),r=t.content==="full"?"100vw":t.contentMax===null?null:`${t.contentMax}px`,d=o==="footer"&&t.background==="content"?P(x):null,s=o==="header"?O(l):null,p=r===null&&d===null&&s===null?void 0:{...d,...r===null?null:{"--sf-site-width":r},...s},i=e(_,{as:h,"data-section-group":o,...o==="header"?{"data-header-nav-case":y(f),"data-header-menu-row":S(m)??"top",...s?{"data-header-tool-style":String(l)}:null}:null,className:c&&o==="footer"?"sf-theme-surfaces bg-bg text-fg":void 0,style:p,...o==="header"?w:A,children:e(T,{value:{background:t.background,content:t.content==="content"?"content":null},children:e(n,{minEmptyHeight:120})})});return o==="header"?e(g,{children:e(v,{children:i})}):i}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{HideTaker as r}from"efficient-web-builder/render/components/ViewHideRoot";const
|
|
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};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { SlotComponent } from "efficient-easel/blocks";
|
|
3
|
+
export declare function ThanksCard({ ownerId, ownerType, Template, message, children, }: {
|
|
4
|
+
ownerId: string;
|
|
5
|
+
ownerType: string;
|
|
6
|
+
Template: SlotComponent | undefined;
|
|
7
|
+
message: ReactNode;
|
|
8
|
+
children: (parts: ReactNode) => ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import{CardTemplateRows as m}from"efficient-web-builder/render/components/CardRowContext";import{THANKS_SLOT as l}from"../lib/content/thanks-slot.js";const p=[{}];function f({ownerId:r,ownerType:o,Template:e,message:t,children:n}){return a(m,{ownerId:r,ownerType:o,slot:l,Template:e,rows:p,fallback:t,children:s=>n(s)})}export{f as ThanksCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as L}from"react/jsx-runtime";import F from"efficient-web-builder/render/components/Btn";import K,{GALLERY_GRID_ATTR as U,GalleryLinksContext as Z}from"../GalleryItem.js";import{SharedPartKinds as $}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as V}from"efficient-web-builder/render/components/goldPhrases";import Y from"efficient-web-builder/render/components/SectionHeader";import q from"./KindGate.js";import J from"./RecordPhotoGallery.js";import{FRAME_120 as Q,framedBandPad as W,headIsEmpty as X,withBandClasses as z}from"../../lib/sections/band-padding.js";import{galleryFrame as ee,galleryTemplate as re}from"../../lib/sections/gallery-frame.js";import{SITE_COLUMN as M,withSideOnce as C}from"efficient-web-builder/format/lib/content/page-width";import{PLP_KINDS as te}from"../../lib/catalog/plp-item.js";import{useCurrentProduct as ie}from"../../lib/document/current-product.js";import{SAMPLE_PICTURE_COUNT as H,SAMPLE_RECORD as oe,recordPictures as ae,useCurrentRecord as ne,useDrawsOtherRecord as se}from"../../lib/document/current-record.js";import{mediaGroupVehicle as le}from"../../lib/content/source-values.js";import{IMAGE_ZONES as O}from"../../lib/sections/product-pictures.js";import{useSampleProduct as me}from"./useSampleProduct.js";import{say as A}from"efficient-web-builder/format/lib/editor-words";import{galleryLayoutRatio as de,resolveGalleryLayout as ce}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as B}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as fe}from"efficient-web-builder/render/components/SideSpaceOnce";const pe=te;function ue(e,o){if(!e)return[];if(o==="all")return O.flatMap(n=>e[n]??[]);const r=O.includes(o)?o:null;return r?e[r]??[]:[]}function he(e){return se(!!e.editing)?t(ge,{...e}):t(q,{kinds:pe,type:"GalleryB",editing:e.editing,children:t(ye,{...e})})}function ge(e){const{editing:o=!1}=e,r=ne(),n=r?ae(r,{firstField:!0}).map(a=>({images:[a.url],eyebrow:a.alt&&a.alt!==r.title?a.alt:void 0,...a.video?{video:a.video}:{}})):o?Array.from({length:H},()=>({images:[""]})):[];return t(_,{...e,tiles:n,owner:{name:(r??oe).title},photosOnly:!0,emptyHint:A("This record’s pictures appear here on its page. A record with no pictures draws nothing.")})}function je(e){const{rows:o,limit:r,layout:n,editing:a=!1,title:h}=e,m=ce({layout:n}),d=typeof r=="number"&&r>0?Math.floor(r):void 0,c=o.filter(s=>typeof s.cover=="string"&&s.cover).map(s=>({images:[s.cover],...s.video?{video:s.video}:{}})),g=a&&c.length===0?Array.from({length:d??H},()=>({images:[""]})):c;return t(_,{...e,tiles:d?g.slice(0,d):g,owner:{name:(h??"").replace(/==/g,"").trim()},photosOnly:!0,tilesAcross:m?.across===3?3:4,tileRatio:m?de(m):null,emptyHint:A("The website’s pictures appear here, in the order they are put in. A website with no pictures draws nothing.")})}function ye({omitHead:e=!1,num:o,title:r,linkText:n,linkHref:a,galleryHref:h="/gallery",submitHref:m="/contact",zone:d="all",photoDisplay:c="covers",previewHover:g,display:s,displayPhone:y,styleOwner:w,editing:f=!1,pads:P,template:v,nodeId:b}){const S=ie(),R=me(f&&!S),p=S?.product??R,x=ue(p?.mediaGroups,d).map(i=>({images:(i.items??[]).filter(u=>u.kind==="image").map(u=>u.url),vehicle:le(i),finish:i.finish})).filter(i=>i.images.length>0),N=(c==="auto"?x.length>=4?"covers":"all":c)==="all"?x.flatMap(i=>i.images.map(u=>({images:[u],vehicle:i.vehicle,finish:i.finish}))):x;return t(_,{omitHead:e,num:o,title:r,linkText:n,linkHref:a,galleryHref:h,submitHref:m,previewHover:g,display:s,displayPhone:y,styleOwner:w,editing:f,pads:P,template:v,nodeId:b,tiles:p?N.map(i=>({images:i.images,eyebrow:i.vehicle||void 0,meta:i.finish})):[],owner:{name:p?.name??"",href:p?.href,process:p?.eyebrow},emptyHint:A("This product’s photos appear here on a product page. Add media groups in the product’s Media tab.")})}function _({omitHead:e=!1,num:o,title:r,linkText:n,linkHref:a,galleryHref:h="/gallery",submitHref:m="/contact",previewHover:d,display:c,displayPhone:g,styleOwner:s,editing:y=!1,tiles:w,owner:f,emptyHint:P,photosOnly:v=!1,tilesAcross:b,tileRatio:S=null,pads:R,template:p,nodeId:x}){const T=fe(),N=n?{text:n,href:a||"#"}:void 0,i=r?V(r,!1):void 0,u=e?null:t(Y,{num:o,title:i,link:N}),E=!y&&X(o,r,N?.text)?null:u,G=W(R,Q,{noTop:e,nonNegative:!0}),k=re(p,!v),I=z(ee(e,!!k),G);return w.length===0?y?t(B,{as:"section",...G.attrs,className:I,style:G.style,children:L("div",{className:C(M,T),children:[E,t("p",{className:"mt-8 border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:P})]})}):null:t(B,{as:"section",...G.attrs,className:I,style:G.style,children:L("div",{className:C(M,T),children:[E,v?t(J,{pictures:w.map(l=>({url:l.images[0]??"",alt:l.eyebrow,video:l.video})),name:f.name,editing:y,...b?{fit:"tiles",across:b,ratio:S}:{}}):t(Z.Provider,{value:{galleryHref:h,submitHref:m,previewHover:d,display:c,displayPhone:g,styleOwner:s,photosOnly:v,ownerId:x,Template:k},children:t($,{children:t("div",{[U]:"",className:"grid grid-cols-4 gap-2 max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1 max-view-wide:gap-1",children:w.map((l,j)=>t(K,{image:l.images[0],photos:l.images.slice(1).map(D=>({src:D})),href:f.href,process:f.process,eyebrow:l.eyebrow,name:f.name,meta:l.meta,editing:y},`${l.eyebrow}-${j}`))})})}),!v&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(F,{href:h,variant:"ghost",children:"See Gallery"})})]})})}export{je as SourcedGalleryGrid,he as default,pe as supportedKinds};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const THANKS_SLOT = "thanksTemplate";
|
|
2
|
+
export declare const THANKS_SLOT_LABEL = "After sending";
|
|
3
|
+
export declare const THANKS_ALLOW: readonly ["Text", "ImageBlock", "Flex", "ButtonBlock"];
|
|
4
|
+
export declare const SHOW_SENT_KEY = "showSent";
|
|
5
|
+
export declare const SHOW_SENT_OPTIONS: readonly [{
|
|
6
|
+
readonly label: "Form";
|
|
7
|
+
readonly value: "form";
|
|
8
|
+
}, {
|
|
9
|
+
readonly label: "After sending";
|
|
10
|
+
readonly value: "sent";
|
|
11
|
+
}];
|
|
12
|
+
export declare function showsSentOnCanvas(value: unknown, editing: boolean | undefined): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BOX_TYPE as o}from"efficient-web-builder/format/lib/document/container-blocks";const r="thanksTemplate",s="After sending",S=["Text","ImageBlock",o,"ButtonBlock"],T="showSent",a=[{label:"Form",value:"form"},{label:"After sending",value:"sent"}];function l(t,e){return!!e&&t==="sent"}export{T as SHOW_SENT_KEY,a as SHOW_SENT_OPTIONS,S as THANKS_ALLOW,r as THANKS_SLOT,s as THANKS_SLOT_LABEL,l as showsSentOnCanvas};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{AccountTool as t}from"../../../../../components/HeaderToolBlocks.js";import{AccountBlockMeta as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{AccountTool as t}from"../../../../../components/HeaderToolBlocks.js";import{AccountBlockMeta as e}from"./meta.js";const p={...e,render:({style:o,phonePlace:c})=>r(t,{style:o,phonePlace:c})};export{p as AccountBlockRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{CartTool as i}from"../../../../../components/HeaderToolBlocks.js";import{CartBlockMeta as a}from"./meta.js";const l={...a,render:({style:o,phonePlace:r,editor:t})=>e(i,{style:o,phonePlace:r,editing:t?.isEditing})};export{l as CartBlockRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{CountrySwitchTool as e}from"../../../../../components/HeaderToolBlocks.js";import{resolveCountryShowAs as m}from"../../../../content/country-show-as.js";import{CountrySwitchBlockMeta as n}from"./meta.js";const p={...n,render:({showAs:o,phonePlace:r})=>t(e,{showAs:m(o),phonePlace:r})};export{p as CountrySwitchBlockRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{SearchTool as c}from"../../../../../components/HeaderToolBlocks.js";import{SearchBlockMeta as n}from"./meta.js";const m={...n,render:({style:e,stylePhone:o,phonePlace:r,editor:t})=>i(c,{style:e,stylePhone:o,phonePlace:r,editing:t?.isEditing})};export{m as SearchBlockRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{ThemeSwitchTool as r}from"../../../../../components/HeaderToolBlocks.js";import{ThemeSwitchBlockMeta as m}from"./meta.js";const i={...m,render:({phonePlace:e})=>o(r,{phonePlace:e})};export{i as ThemeSwitchBlockRender};
|
|
@@ -12,5 +12,9 @@ export declare const ContactRoutingSlots: {
|
|
|
12
12
|
type: "slot";
|
|
13
13
|
allow: ("Flex" | "ImageBlock" | "Text")[];
|
|
14
14
|
};
|
|
15
|
+
thanksTemplate: {
|
|
16
|
+
type: "slot";
|
|
17
|
+
allow: ("Flex" | "ImageBlock" | "ButtonBlock" | "Text")[];
|
|
18
|
+
};
|
|
15
19
|
};
|
|
16
20
|
export declare const ContactRoutingMeta: Omit<BlockRender, "render">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONTACT_ROUTING_DEFAULTS as t}from"efficient-web-builder/format/lib/content/contact";import{CONTACT_CHANNEL_SLOT as r,CONTACT_REASON_SLOT as
|
|
1
|
+
import{CONTACT_ROUTING_DEFAULTS as t}from"efficient-web-builder/format/lib/content/contact";import{CONTACT_CHANNEL_SLOT as r,CONTACT_REASON_SLOT as T,CONTACT_TEMPLATE_ALLOW as o,CONTACT_TOPIC_SLOT as l}from"../../../../content/contact-card-seed.js";import{THANKS_ALLOW as n,THANKS_SLOT as a}from"../../../../content/thanks-slot.js";const m={[l]:{type:"slot",allow:[...o]},[T]:{type:"slot",allow:[...o]},[r]:{type:"slot",allow:[...o]},[a]:{type:"slot",allow:[...n]}},u={label:"Contact Form",fields:m,defaultProps:{routingNumber:t.routingNumber,routingTagline:t.routingTagline,groups:t.groups,formSlug:"",formNumber:t.formNumber,formHeading:t.formHeading,metaItems:t.metaLines.map(e=>({text:e})),showOther:t.showOther,otherLabel:t.otherLabel,otherNoteTitle:t.otherNoteTitle,otherNoteBody:t.otherNoteBody,buttonText:t.buttonText,consent:t.consent,channels:t.channels}};export{u as ContactRoutingMeta,m as ContactRoutingSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as f}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as f}from"react/jsx-runtime";import h from"../../../../../components/ContactRouting.js";import{CONTACT_ROUTING_DEFAULTS as t}from"efficient-web-builder/format/lib/content/contact";import{hidableText as i}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as l}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as o}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{cardPressTitlesOf as r}from"efficient-web-builder/render/lib/document/card-press-titles";import{CONTACT_CHANNEL_SLOT as d,CONTACT_REASON_SLOT as T,CONTACT_TOPIC_SLOT as u}from"../../../../content/contact-card-seed.js";import{SHOW_SENT_KEY as g,THANKS_SLOT as N}from"../../../../content/thanks-slot.js";import{ContactRoutingMeta as c}from"./meta.js";const E={...c,render:e=>{const m=l(e.headPlacement)==="own-box",a=n=>m?void 0:n;return f(h,{routingNumber:a(o(e.routingNumber,t.routingNumber,e.editor)),routingTagline:a(o(e.routingTagline,t.routingTagline,e.editor)),omitHead:m,templates:{ownerId:String(e.id??""),topic:e[u],reason:e[T],channel:e[d],thanks:e[N],pressTitles:{topic:r(e,u),reason:r(e,T),channel:r(e,d)}},groups:e.groups??[],formNumber:o(e.formNumber,t.formNumber,e.editor),formHeading:o(e.formHeading,t.formHeading,e.editor),metaLines:(e.metaItems??[]).map(n=>n?.text??"").filter(Boolean),showOther:e.showOther,otherLabel:i(e.otherLabel)||t.otherLabel,otherNoteTitle:o(e.otherNoteTitle,t.otherNoteTitle,e.editor),otherNoteBody:o(e.otherNoteBody,t.otherNoteBody,e.editor),buttonText:i(e.buttonText)||t.buttonText,consent:o(e.consent,t.consent,e.editor),channels:e.channels??[],formSlug:i(e.formSlug)||void 0,form:e.form,editing:e.editor?.isEditing,showSent:e[g]})}};export{E as ContactRoutingRender};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
2
|
+
export declare const FormSlots: {
|
|
3
|
+
thanksTemplate: {
|
|
4
|
+
type: "slot";
|
|
5
|
+
allow: ("Flex" | "ImageBlock" | "ButtonBlock" | "Text")[];
|
|
6
|
+
};
|
|
7
|
+
};
|
|
2
8
|
export declare const FormMeta: Omit<BlockRender, "render">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={label:"Form",defaultProps:{formSlug:"",heading:"",intro:"",submitText:"",finePrint:""}};export{
|
|
1
|
+
import{THANKS_ALLOW as o,THANKS_SLOT as t}from"../../../../content/thanks-slot.js";const r={[t]:{type:"slot",allow:[...o]}},l={label:"Form",fields:r,defaultProps:{formSlug:"",heading:"",intro:"",submitText:"",finePrint:""}};export{l as FormMeta,r as FormSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import r from"../../../../../components/FormBlock.js";import{hidableText as n}from"efficient-easel/screen/lib/document/hidable";import{BUTTON_STYLE_KEYS as i}from"efficient-easel/screen/lib/content/style-keys";import{BUTTON_CORNERS_UNIT_KEY as o}from"efficient-easel/screen/lib/content/length-units";import{SHOW_SENT_KEY as d,THANKS_SLOT as m}from"../../../../content/thanks-slot.js";import{FormMeta as f}from"./meta.js";const b={...f,render:e=>t(r,{formSlug:n(e.formSlug)||void 0,heading:n(e.heading)||void 0,intro:n(e.intro)||void 0,submitText:n(e.submitText)||void 0,finePrint:n(e.finePrint)||void 0,form:e.form,editing:e.editor?.isEditing,nodeId:typeof e.id=="string"?e.id:"",thanks:e[m],showSent:e[d],buttonCorners:e[i.corners],buttonCornerSides:e[i.cornerSides],buttonCornersUnit:e[o]})};export{b as FormRender};
|