efficient-storefront-blocks 0.134.5 → 0.135.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/chunks/{CustomHtmlCodeWindow-PCCIJDTP.js → CustomHtmlCodeWindow-FKPYCXCD.js} +1 -1
  3. package/dist/chunks/{EditorPreviewCheckout-PUHW43VL.js → EditorPreviewCheckout-FVJV7XRD.js} +1 -1
  4. package/dist/chunks/SiteEditorProvider-QDGGCHUC.js +1 -0
  5. package/dist/chunks/{chunk-UYU65XIT.js → chunk-75GXE5JB.js} +1 -1
  6. package/dist/chunks/chunk-ESXERZQ3.js +9 -0
  7. package/dist/chunks/chunk-RDWFRHEV.js +337 -0
  8. package/dist/chunks/{chunk-ITZRFN64.js → chunk-S63MCVEE.js} +1 -1
  9. package/dist/chunks/{chunk-JHEIFPET.js → chunk-VBCLGIPA.js} +1 -1
  10. package/dist/chunks/{chunk-VJSXEYRL.js → chunk-VLFGNHX5.js} +1 -1
  11. package/dist/chunks/{chunk-4HZQEMGD.js → chunk-XMX3KEE4.js} +1 -1
  12. package/dist/chunks/{chunk-GZKBN53C.js → chunk-Y3CRPIPD.js} +1 -1
  13. package/dist/chunks/{fitment-data-OO37TN7S.js → fitment-data-UPS55DR5.js} +1 -1
  14. package/dist/chunks/{section-css-style-K25L45AT.js → section-css-style-VSIE7KKW.js} +1 -1
  15. package/dist/index.js +24 -24
  16. package/dist/links.js +1 -1
  17. package/dist/render/built-with.json +1 -1
  18. package/dist/render/components/GalleryCard.d.ts +3 -1
  19. package/dist/render/components/GalleryCard.js +1 -1
  20. package/dist/render/components/GalleryGrid.js +3 -3
  21. package/dist/render/components/GalleryItem.d.ts +1 -0
  22. package/dist/render/components/GalleryItem.js +1 -1
  23. package/dist/render/lib/sections/gallery-toolbar.d.ts +1 -0
  24. package/dist/render/lib/sections/gallery-toolbar.js +1 -1
  25. package/dist/routine-index.json +1 -1
  26. package/dist/value-index.json +1 -1
  27. package/dist/words.d.ts +2 -0
  28. package/dist/words.js +2 -2
  29. package/package.json +3 -3
  30. package/dist/chunks/SiteEditorProvider-5GQBSTAR.js +0 -1
  31. package/dist/chunks/chunk-AKNNDIRL.js +0 -9
  32. package/dist/chunks/chunk-MM7TBACQ.js +0 -337
  33. /package/dist/chunks/{chunk-YMJRKOEC.js → chunk-62AOYUOH.js} +0 -0
  34. /package/dist/chunks/{chunk-XPDSLIZ3.js → chunk-GAND7LXQ.js} +0 -0
  35. /package/dist/chunks/{chunk-MM7TBACQ.js.LEGAL.txt → chunk-RDWFRHEV.js.LEGAL.txt} +0 -0
  36. /package/dist/chunks/{chunk-DSTQVJ5G.js → chunk-RNSKQVLG.js} +0 -0
  37. /package/dist/chunks/{chunk-ITZRFN64.js.LEGAL.txt → chunk-S63MCVEE.js.LEGAL.txt} +0 -0
package/dist/links.js CHANGED
@@ -1 +1 @@
1
- var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var ue=["main","text","background","muted"],pt=[...ue,"surface"];var ft={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text",style:"styled text"};var pe=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var O=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],fe=["highlight","quiet"],dt=pe.map(e=>e.style).filter(e=>O.some(t=>t.kind===e)).filter(e=>!fe.includes(e)),mt=[...O,{open:"*",close:"*",kind:"accent"}],ht=[...O,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var gt=["http","https","mailto","tel"];function j(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||gt.includes(t[1].toLowerCase())}var de=["width","profile","rim"];var yt=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,bt={width:[100,500],profile:[20,100],rim:[10,30]};function W(e){let t=yt.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return de.every(o=>{let[s,i]=bt[o];return n[o]>=s&&n[o]<=i})?n:null}function _(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let t=`${e.width}/${e.profile}`;return e.rim==null?t:`${t} R${e.rim}`}function me(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var x=["alloy-wheel","tyre"],he=["alloy-wheel"],E={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Mn=x.map(e=>({value:e,label:E[e]}));function ge(e){return e==null?[...he]:Array.isArray(e)?x.filter(t=>e.includes(t)):[...he]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function Y(e){return m(e).brand??""}function ye(e){return m(e).prices??void 0}function be(e){return m(e).inStock!==!1}function Se(e){let t=m(e),n=d(e)==="tyre"?t.rimDiameters:t.sizes;return Array.isArray(n)?n.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function H(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(t=>typeof t?.family=="string").map(t=>({family:t.family,color:t.color??null}))}function Pe(e){return H(e).map(t=>t.family)}function ke(e){if(d(e)==="tyre")return[];let t=m(e);return Array.isArray(t.categories)?t.categories:t.process?[t.process]:[]}function xe(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function we(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function Te(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function Le(e){if(d(e)!=="tyre")return[];let t=m(e).sizes;return Array.isArray(t)?t.map(n=>W(typeof n=="string"?n:null)).filter(n=>n!==null):[]}var V=e=>typeof e=="string"&&e?e:void 0;function G(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Ae(e,t){return Object.hasOwn(e,t)}var Oe=null;function _e(e,t){return t?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(n,r)=>Ae(t,r)?String(G(t,r)):n):e}function y(e,t){let n=Oe?G(Oe,e):void 0;if(typeof n=="function"){try{let r=V(n(t??{}));if(r)return r}catch{}return _e(e,t)}return _e(V(n)??e,t)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var F=(e,t,n,r)=>({default:e,min:t,max:n,step:r}),Wn=F(30,0,100,10),Yn=F(0,0,100,5),Hn=F(100,0,100,5);var Vn=F(2,0,4,.5);var Gn=["button","summary",'[role="button"]','[role="checkbox"]','[role="switch"]',"video[controls]","audio[controls]",...["checkbox","button","submit","reset","image","color","file"].map(e=>`input[type="${e}"]`)].join(", "),qn=["menuitem","option","listbox","slider","tab","tablist","combobox","radio","radiogroup","spinbutton","menu","menubar","tree","treeitem","grid","gridcell"].map(e=>`[role="${e}"]`).concat('input[type="radio"]','input[type="range"]').join(", "),St="data-motion-pin-free",Zn=`.maplibregl-map, .mapboxgl-map, .leaflet-container, .gm-style, [${St}]`;function Ee(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var Fe="homepage";var I=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function v(e){return e.offersCommerce&&e.offersService?I:I.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}var Z="#popup:";function Ie(e){return`${Z}${e}`}function ve(e){return e.startsWith(Z)&&e.slice(Z.length).trim()||null}function b(e){return e===Fe?"/":`/${e}`}function R(e){return`/journal/${e}`}function N(e){return`/wheels/${e}`}function C(e,t){return`${b(e)}#${t}`}function M(...e){let t=new Set,n=[];for(let r of e)for(let o of r?.content??[]){let s=Ee(o?.props?.anchor);if(!s)continue;let i=q(s);!i||t.has(i)||(t.add(i),n.push({slug:i,name:s}))}return n}function Re(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var Pt=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function K(e,t,n){if(!e)return"page";if(ve(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Re(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||t.includes(r))return"anchor"}return e==="/"||t.includes(e)||n&&n.listingPaths.includes(n.targetOf(e))?"page":"custom"}function Ne(e,t){let n=Pt(),r=e.pages.map(c=>({value:b(c.slug),label:c.title})),o=t?.pageOptions?t.pageOptions(r):r,s=o.map(c=>c.value),i=e.pages.map(c=>({label:c.title,options:M(...c.docs).map(u=>({value:C(c.slug,u.slug),label:u.name}))})).filter(c=>c.options.length>0),l=c=>{switch(c){case"page":return{type:"select",options:o,placeholder:n.choosePage};case"anchor":return{type:"groups",groups:i,placeholder:i.length?n.chooseSection:n.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:R(u.slug),label:u.title||u.slug})),placeholder:n.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:n.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:Ie(u.slug),label:u.title||u.slug})),placeholder:n.choosePopup};case"custom":return{type:"text"}}},a=v(e.offers).map(c=>({value:c.value,label:y(c.label),target:l(c.value),...c.value==="anchor"?{hint:n.sectionHint}:{},...c.value==="blog"||c.value==="product"||c.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!t)return{kinds:a,rules:{kindOf:c=>K(c,s),targetOf:c=>c,readFilter:()=>null,withFilter:c=>c}};let p=c=>{let u=t.withFilter(c,null);return t.listingPaths.includes(u)?u:c};return{kinds:a,rules:{kindOf:c=>K(c,s,{listingPaths:t.listingPaths,targetOf:p}),targetOf:p,readFilter:t.readFilter,withFilter:t.withFilter},filtersFor:c=>t.listingPaths.includes(c)?t.filtersFor(c):null}}var Ce=Object.freeze([]);function X(e,t){return e.length===0?e:e.filter(n=>n.kind===void 0||n.kind===t)}function Me(e,t){let n=t==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let s=o[n];if(typeof s!="number"||!Number.isFinite(s))continue;let i=r.get(o.fieldKey);(i===void 0||s<i)&&r.set(o.fieldKey,s)}return o=>o?r.get(o):void 0}function Ke(e,t,n,r){let o=new Map;for(let a of n){let p=a[r];typeof p=="number"&&o.set(a.fieldKey,p)}if(o.size===0)return e;let s=[],i=[];e.forEach((a,p)=>{let c=t(a);c&&(s.push(p),i.push({item:a,index:p,order:o.get(c)}))}),i.sort((a,p)=>a.order!==void 0&&p.order!==void 0?a.order-p.order||a.index-p.index:a.order!==void 0?-1:p.order!==void 0?1:a.index-p.index);let l=[...e];return s.forEach((a,p)=>{l[a]=i[p].item}),l.every((a,p)=>a===e[p])?e:l}function $e(e){return xt(e,"filter")}var kt="collection";function Q(e,t){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":kt},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[t]}function xt(e,t){let n=new Set(e.filter(r=>r[t]===!1).map(r=>r.fieldKey));return r=>!r||!n.has(r)}function wt(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ze(e,t){let n=e?.[t];return wt(n)?n:null}function De(e,t,n,r){if(n==null&&r==null)return!0;let o=ze(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}function Ue(e){let t=e.spec?.lugs;return typeof t=="number"?t:null}var Tt={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},Cr=Object.keys(Tt);var J=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],ee={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Lt={diameters:"tyreSizes"};function At(e){if(e.length===0)return[];let t=J.filter(n=>e.every(r=>ee[n].includes(r)));return t.filter(n=>{let r=Lt[n];return!r||!t.includes(r)})}function Ot(e){let t=new Set;for(let n of e)t.add(d(n));return[...t]}var Be={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,priceMin:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function _t(e,t,n,r=null,o="fail"){let s=d(e),i=l=>o==="fail"||(l==="lugs"?s==="alloy-wheel":ee[l].includes(s));if(r!=="kind"&&t.kind&&s!==t.kind)return!1;for(let l of J){if(r===l)continue;let a=t[l];if(a.length===0||!i(l))continue;let p=a.map(String);if(!je(e,l).some(c=>p.includes(c)))return!1}if(r!=="lugs"&&t.lugs&&t.lugs.length>0&&i("lugs")){let l=Ue(e);if(l===null||!t.lugs.includes(l))return!1}return!(r!=="price"&&!De(ye(e),n,t.priceMin??null,t.priceMax)||r!=="inStock"&&t.inStockOnly&&!be(e))}var Et={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function je(e,t){switch(t){case"tyreSizes":return[...new Set(Le(e).flatMap(me))];case"brands":return Y(e)?[Y(e)]:[];case"finishes":return Pe(e);case"diameters":return Se(e).map(String);case"collections":return ke(e);case"pcds":return xe(e);case"tyreTypes":return we(e);case"speedRatings":return Te(e)}}function Ft(e){let t=new Map;for(let n of e)for(let r of H(n))r.color&&!t.has(r.family)&&t.set(r.family,r.color);return t}function We(e,t,n,r=Ot(e),o=Ce,s="fail"){let i=u=>vt(u,r,o),l=Ft(e),p=(s==="pass"?J.filter(u=>r.some(P=>ee[u].includes(P))):At(r)).filter(u=>u!=="tyreSizes").filter(i).map(u=>{let P=t[u].map(String),ce=new Set,B=new Map,A=new Map;for(let f of e){let S=je(f,u);for(let h of S)ce.add(h);for(let h of new Set(S))A.set(h,(A.get(h)??0)+1);if(_t(f,t,n,u,s))for(let h of new Set(S))B.set(h,(B.get(h)??0)+1)}let ut=[...ce].map(f=>({value:f,label:u==="diameters"?`${f}\u2033`:f,count:B.get(f)??0,checked:P.includes(f),swatch:u==="finishes"?l.get(f)??null:null})).sort((f,S)=>{if(u==="diameters")return Number(f.value)-Number(S.value);let h=(A.get(S.value)??0)-(A.get(f.value)??0);return h!==0?h:f.value.localeCompare(S.value)});return{key:u,label:Et[u],options:ut}}).filter(u=>u.options.length>It),c=[];for(let u of p){let P=Rt(u.key,r,o);P!==void 0&&c.push({fieldKey:u.key,filterOrder:P})}return[...Ke(p,u=>u.key,c,"filterOrder")]}var It=1;function Ye(e){return e.showCollection===!1?["collections"]:[]}function vt(e,t,n){return t.length===0||n.length===0?!0:t.some(r=>$e(X(n,r))(Q(e,r)))}function Rt(e,t,n){if(n.length===0)return;let r;for(let o of t){let s=Me(X(n,o),"filter")(Q(e,o));s!==void 0&&(r===void 0||s<r)&&(r=s)}return r}var te={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},ne="type";var w=e=>!!e&&typeof e=="object"&&!Array.isArray(e),T=e=>w(e)&&typeof e.type=="string"&&w(e.props);var $=e=>Array.isArray(e)&&e.length>0&&e.every(T);function Nt(e){let t="";for(let n of e)t+=typeof n=="number"?`[${n}]`:t===""?n:`.${n}`;return t}function He(e,t){return t==="root"?e.root:e.components[t]}function Ve(e){return e?.fields??{}}function Ge(e,t){return Ve(He(e,t))}function qe(e,t){let n=[];return re(e,t,[],n),n}function re(e,t,n,r){for(let o of Object.keys(t)){let s=t[o];if(!s)continue;let i=[...n,o],l=e[o];if(s.type==="slot"){let a=Array.isArray(l);r.push({slot:Nt(i),segments:i,content:a?l:[],present:a})}else if(s.type==="object"&&s.objectFields&&w(l))re(l,s.objectFields,i,r);else if(s.type==="array"&&s.arrayFields&&Array.isArray(l)){let a=s.arrayFields;l.forEach((p,c)=>{w(p)&&re(p,a,[...i,c],r)})}}}function oe(e,t,n){return Mt(e,t,n).map(({slot:r,content:o})=>({slot:r,content:o}))}function z(e){let t=new TextEncoder,n=new Map(e.map(r=>[r,t.encode(r)]));return[...e].sort((r,o)=>{let s=n.get(r),i=n.get(o);if(s.length!==i.length)return s.length-i.length;for(let l=0;l<s.length;l++)if(s[l]!==i[l])return s[l]-i[l];return 0})}function Mt(e,t,n){let r=qe(e.props,Ge(t,e.type));if(n?.order!=="stored")return r;let o=z(Object.keys(e.props)),s=i=>{let l=i.present?o.indexOf(String(i.segments[0])):-1;return l<0?Number.POSITIVE_INFINITY:l};return r.map((i,l)=>({loc:i,i:l,r:s(i)})).sort((i,l)=>i.r-l.r||i.i-l.i).map(({loc:i})=>i)}var Ze=["Text","ImageBlock","ButtonBlock","Flex"];function k(){return{type:"slot",allow:[...Ze]}}var Kt=Ze.filter(e=>e!=="ButtonBlock");function Xe(){return{type:"slot",allow:[...Kt]}}var $t="boxes",Qe={CardList:{template:Xe()},Cards:{template:k()},FAQ:{template:k()},Flex:{rowTitle:{type:"slot",allow:["Text"]},content:{type:"slot"}},Footprint:{template:k()},Grid:{content:{type:"slot"}},Hero:{slides:{type:"slot",ownPictures:!0},strip:{type:"slot",allow:["Flex"]}},HeroGroup:{content:{type:"slot"}},HeroSingle:{boxes:{type:"slot",allow:["HeroGroup"]}},HeroSlide:{groups:{type:"slot",allow:["HeroGroup"]}},Logos:{logos:{type:"slot",allow:["LogoBlock"]},template:{type:"slot",allow:["LogoBlock"]}},OrderSummary:{template:k()},ProcessSteps:{[$t]:{type:"slot"},template:k()}};var zt={},Dt=null;function Ut(){let e=Object.fromEntries(Object.entries(Qe).map(([t,n])=>[t,{fields:n}]));return Dt??={components:{...e,...zt}}}function Bt(e){let t=e.props??{},n=typeof e.type=="string"?e.type:"",r=Ut(),o=n!==""&&Object.prototype.hasOwnProperty.call(r.components,n)?oe({type:n,props:t},r).map(l=>l.slot).filter(l=>!l.includes(".")):[],s=o.filter(l=>$(t[l])),i=z(Object.keys(t).filter(l=>!o.includes(l)&&$(t[l])));return[...s,...i]}function Je(e,t){let n=null;for(let r of Bt(e)){let o=e.props[r],s=t(o,r);s!==o&&((n??={...e.props})[r]=s)}return n?{...e,props:n}:e}var et="FilterBlock";var tt="AlloyWheelsListing";function jt(e){let t=e??{},n=[];Array.isArray(t.content)&&n.push(t.content);for(let r of Object.values(t.zones??{}))Array.isArray(r)&&n.push(r);return n}function Wt(e){let t=[],n=(r,o)=>{let s=[r,...o];for(let i of r)T(i)&&(t.push({node:i,order:t.length,lists:s}),Je(i,l=>(n(l,s),l)))};for(let r of jt(e))n(r,[]);return t}function nt(e){return Wt(e).map(t=>t.node)}function rt(e){return j(e.trim())}var L="/wheels",D="Products";function ot(e,t){return t>1?`${D} \xB7 ${e}`:D}function se(...e){for(let t of[tt,et])for(let n of e){let r=nt({content:n?.content}).find(o=>o.type===t);if(r)return r.props??{}}return null}function U(...e){return se(...e)!==null}function st(e,t){let n=e.filter(r=>U(...r.docs)).map(r=>b(r.slug));return t.fallback&&!n.includes(L)?[...n,L]:n}var ie=[ne,...Object.entries(te).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function it(e){let t=e.indexOf("#"),n=t===-1?"":e.slice(t),r=t===-1?e:e.slice(0,t),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:n}}function Yt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function lt(e){let t=new URLSearchParams(it(e).query);for(let n of ie){let r=t.get(n);if(r)return{param:n,value:r}}return null}function le(e,t){let{path:n,query:r,hash:o}=it(e),s=r.split("&").filter(i=>i&&!ie.includes(Yt(i.split("=")[0])));return t?.value&&s.push(`${encodeURIComponent(t.param)}=${encodeURIComponent(t.value)}`),`${n}${s.length?`?${s.join("&")}`:""}${o}`}function at(e,t){let n=le(e,null);return t.includes(n)?n:e}function Ht(e,t,n=[]){return K(e,t,{listingPaths:n,targetOf:r=>at(r,n)})}function Vt(e){return Array.isArray(e)?e.filter(t=>typeof t?.kind=="string"&&typeof t.field_key=="string").map(t=>({kind:t.kind,fieldKey:t.field_key,...typeof t.filter=="boolean"?{filter:t.filter}:{},filterOrder:t.filter_order??null})):[]}var ct="Product type",Gt="AUD";function ae(e,t){let n=t.listing??{},r=ge(n.kinds),o=e.filter(a=>r.includes(d(a))),s=Ye(n),i=We(o,Be,Gt,r,t.fieldUsage).filter(a=>!s.includes(a.key)).map(a=>({param:te[a.key],label:a.label,values:a.options.filter(p=>!p.value.includes(",")).map(p=>({value:p.value,label:p.label}))})).filter(a=>a.values.length>0),l=x.filter(a=>r.includes(a)&&o.some(p=>d(p)===a));return l.length>1&&i.unshift({param:ne,label:ct,values:l.map(a=>({value:a,label:E[a]}))}),i}function qt(e){return t=>{let n=st(t,{fallback:e.offersCommerce}),r=t.filter(o=>U(...o.docs)).length;return{listingPaths:n,pageOptions:o=>{let s=o.map(i=>{let l=t.find(a=>b(a.slug)===i.value);return l&&U(...l.docs)?{...i,label:ot(l.title,r)}:i});return r===0&&e.offersCommerce&&!s.some(i=>i.value===L)&&s.push({value:L,label:D}),s},filtersFor:o=>{if(!n.includes(o))return null;let s=t.find(i=>b(i.slug)===o);return ae(e.catalogue,{listing:s?se(...s.docs):null,fieldUsage:e.fieldUsage})},readFilter:lt,withFilter:le}}}function Zt(e){let t=qt({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),n=Ne({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:N(r.slug),name:r.name||r.slug})),offers:e.offers},t);return{...n,rules:{...n.rules,isSafe:rt},filtersFor:n.filtersFor??(()=>null)}}function ns(e,t){return ae(e,t)}export{L as BUILT_IN_LISTING_PATH,I as LINK_KINDS,ie as LISTING_FILTER_PARAMS,D as LISTING_PAGE_LABEL,ct as PRODUCT_TYPE_FILTER_LABEL,C as anchorPath,Vt as fieldUsageFromAdminRows,Ht as inferLinkKind,U as isProductListingPage,rt as isSafeLink,v as linkKindsFor,Zt as linkPickerSetup,ns as listingFilterFields,se as listingNode,ot as listingPageLabel,at as listingTarget,M as pageAnchors,b as pagePath,R as postPath,st as productListingPaths,lt as readListingFilter,N as wheelPath,le as withListingFilter};
1
+ var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var ue=["main","text","background","muted"],pt=[...ue,"surface"];var ft={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text",style:"styled text"};var pe=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var O=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],fe=["highlight","quiet"],dt=pe.map(e=>e.style).filter(e=>O.some(t=>t.kind===e)).filter(e=>!fe.includes(e)),mt=[...O,{open:"*",close:"*",kind:"accent"}],ht=[...O,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var gt=["http","https","mailto","tel"];function j(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||gt.includes(t[1].toLowerCase())}var de=["width","profile","rim"];var yt=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,bt={width:[100,500],profile:[20,100],rim:[10,30]};function H(e){let t=yt.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return de.every(o=>{let[s,i]=bt[o];return n[o]>=s&&n[o]<=i})?n:null}function _(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let t=`${e.width}/${e.profile}`;return e.rim==null?t:`${t} R${e.rim}`}function me(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var x=["alloy-wheel","tyre"],he=["alloy-wheel"],E={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Mn=x.map(e=>({value:e,label:E[e]}));function ge(e){return e==null?[...he]:Array.isArray(e)?x.filter(t=>e.includes(t)):[...he]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function Y(e){return m(e).brand??""}function ye(e){return m(e).prices??void 0}function be(e){return m(e).inStock!==!1}function Se(e){let t=m(e),n=d(e)==="tyre"?t.rimDiameters:t.sizes;return Array.isArray(n)?n.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function W(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(t=>typeof t?.family=="string").map(t=>({family:t.family,color:t.color??null}))}function Pe(e){return W(e).map(t=>t.family)}function ke(e){if(d(e)==="tyre")return[];let t=m(e);return Array.isArray(t.categories)?t.categories:t.process?[t.process]:[]}function xe(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function we(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function Te(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function Ae(e){if(d(e)!=="tyre")return[];let t=m(e).sizes;return Array.isArray(t)?t.map(n=>H(typeof n=="string"?n:null)).filter(n=>n!==null):[]}var V=e=>typeof e=="string"&&e?e:void 0;function G(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Le(e,t){return Object.hasOwn(e,t)}var Oe=null;function _e(e,t){return t?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(n,r)=>Le(t,r)?String(G(t,r)):n):e}function y(e,t){let n=Oe?G(Oe,e):void 0;if(typeof n=="function"){try{let r=V(n(t??{}));if(r)return r}catch{}return _e(e,t)}return _e(V(n)??e,t)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var I=(e,t,n,r)=>({default:e,min:t,max:n,step:r}),Hn=I(30,0,100,10),Yn=I(0,0,100,5),Wn=I(100,0,100,5);var Vn=I(2,0,4,.5);var Gn=["button","summary",'[role="button"]','[role="checkbox"]','[role="switch"]',"video[controls]","audio[controls]",...["checkbox","button","submit","reset","image","color","file"].map(e=>`input[type="${e}"]`)].join(", "),qn=["menuitem","option","listbox","slider","tab","tablist","combobox","radio","radiogroup","spinbutton","menu","menubar","tree","treeitem","grid","gridcell"].map(e=>`[role="${e}"]`).concat('input[type="radio"]','input[type="range"]').join(", "),St="data-motion-pin-free",Zn=`.maplibregl-map, .mapboxgl-map, .leaflet-container, .gm-style, [${St}]`;function Ee(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var Ie="homepage";var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function v(e){return e.offersCommerce&&e.offersService?F:F.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}var Z="#popup:";function Fe(e){return`${Z}${e}`}function ve(e){return e.startsWith(Z)&&e.slice(Z.length).trim()||null}function b(e){return e===Ie?"/":`/${e}`}function R(e){return`/journal/${e}`}function N(e){return`/wheels/${e}`}function C(e,t){return`${b(e)}#${t}`}function M(...e){let t=new Set,n=[];for(let r of e)for(let o of r?.content??[]){let s=Ee(o?.props?.anchor);if(!s)continue;let i=q(s);!i||t.has(i)||(t.add(i),n.push({slug:i,name:s}))}return n}function Re(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var Pt=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function K(e,t,n){if(!e)return"page";if(ve(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Re(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||t.includes(r))return"anchor"}return e==="/"||t.includes(e)||n&&n.listingPaths.includes(n.targetOf(e))?"page":"custom"}function Ne(e,t){let n=Pt(),r=e.pages.map(c=>({value:b(c.slug),label:c.title})),o=t?.pageOptions?t.pageOptions(r):r,s=o.map(c=>c.value),i=e.pages.map(c=>({label:c.title,options:M(...c.docs).map(u=>({value:C(c.slug,u.slug),label:u.name}))})).filter(c=>c.options.length>0),l=c=>{switch(c){case"page":return{type:"select",options:o,placeholder:n.choosePage};case"anchor":return{type:"groups",groups:i,placeholder:i.length?n.chooseSection:n.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:R(u.slug),label:u.title||u.slug})),placeholder:n.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:n.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:Fe(u.slug),label:u.title||u.slug})),placeholder:n.choosePopup};case"custom":return{type:"text"}}},a=v(e.offers).map(c=>({value:c.value,label:y(c.label),target:l(c.value),...c.value==="anchor"?{hint:n.sectionHint}:{},...c.value==="blog"||c.value==="product"||c.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!t)return{kinds:a,rules:{kindOf:c=>K(c,s),targetOf:c=>c,readFilter:()=>null,withFilter:c=>c}};let p=c=>{let u=t.withFilter(c,null);return t.listingPaths.includes(u)?u:c};return{kinds:a,rules:{kindOf:c=>K(c,s,{listingPaths:t.listingPaths,targetOf:p}),targetOf:p,readFilter:t.readFilter,withFilter:t.withFilter},filtersFor:c=>t.listingPaths.includes(c)?t.filtersFor(c):null}}var Ce=Object.freeze([]);function X(e,t){return e.length===0?e:e.filter(n=>n.kind===void 0||n.kind===t)}function Me(e,t){let n=t==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let s=o[n];if(typeof s!="number"||!Number.isFinite(s))continue;let i=r.get(o.fieldKey);(i===void 0||s<i)&&r.set(o.fieldKey,s)}return o=>o?r.get(o):void 0}function Ke(e,t,n,r){let o=new Map;for(let a of n){let p=a[r];typeof p=="number"&&o.set(a.fieldKey,p)}if(o.size===0)return e;let s=[],i=[];e.forEach((a,p)=>{let c=t(a);c&&(s.push(p),i.push({item:a,index:p,order:o.get(c)}))}),i.sort((a,p)=>a.order!==void 0&&p.order!==void 0?a.order-p.order||a.index-p.index:a.order!==void 0?-1:p.order!==void 0?1:a.index-p.index);let l=[...e];return s.forEach((a,p)=>{l[a]=i[p].item}),l.every((a,p)=>a===e[p])?e:l}function $e(e){return xt(e,"filter")}var kt="collection";function Q(e,t){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":kt},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[t]}function xt(e,t){let n=new Set(e.filter(r=>r[t]===!1).map(r=>r.fieldKey));return r=>!r||!n.has(r)}function wt(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ze(e,t){let n=e?.[t];return wt(n)?n:null}function De(e,t,n,r){if(n==null&&r==null)return!0;let o=ze(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}function Ue(e){let t=e.spec?.lugs;return typeof t=="number"?t:null}var Tt={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},Cr=Object.keys(Tt);var J=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],ee={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},At={diameters:"tyreSizes"};function Lt(e){if(e.length===0)return[];let t=J.filter(n=>e.every(r=>ee[n].includes(r)));return t.filter(n=>{let r=At[n];return!r||!t.includes(r)})}function Ot(e){let t=new Set;for(let n of e)t.add(d(n));return[...t]}var Be={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,priceMin:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function _t(e,t,n,r=null,o="fail"){let s=d(e),i=l=>o==="fail"||(l==="lugs"?s==="alloy-wheel":ee[l].includes(s));if(r!=="kind"&&t.kind&&s!==t.kind)return!1;for(let l of J){if(r===l)continue;let a=t[l];if(a.length===0||!i(l))continue;let p=a.map(String);if(!je(e,l).some(c=>p.includes(c)))return!1}if(r!=="lugs"&&t.lugs&&t.lugs.length>0&&i("lugs")){let l=Ue(e);if(l===null||!t.lugs.includes(l))return!1}return!(r!=="price"&&!De(ye(e),n,t.priceMin??null,t.priceMax)||r!=="inStock"&&t.inStockOnly&&!be(e))}var Et={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function je(e,t){switch(t){case"tyreSizes":return[...new Set(Ae(e).flatMap(me))];case"brands":return Y(e)?[Y(e)]:[];case"finishes":return Pe(e);case"diameters":return Se(e).map(String);case"collections":return ke(e);case"pcds":return xe(e);case"tyreTypes":return we(e);case"speedRatings":return Te(e)}}function It(e){let t=new Map;for(let n of e)for(let r of W(n))r.color&&!t.has(r.family)&&t.set(r.family,r.color);return t}function He(e,t,n,r=Ot(e),o=Ce,s="fail"){let i=u=>vt(u,r,o),l=It(e),p=(s==="pass"?J.filter(u=>r.some(P=>ee[u].includes(P))):Lt(r)).filter(u=>u!=="tyreSizes").filter(i).map(u=>{let P=t[u].map(String),ce=new Set,B=new Map,L=new Map;for(let f of e){let S=je(f,u);for(let h of S)ce.add(h);for(let h of new Set(S))L.set(h,(L.get(h)??0)+1);if(_t(f,t,n,u,s))for(let h of new Set(S))B.set(h,(B.get(h)??0)+1)}let ut=[...ce].map(f=>({value:f,label:u==="diameters"?`${f}\u2033`:f,count:B.get(f)??0,checked:P.includes(f),swatch:u==="finishes"?l.get(f)??null:null})).sort((f,S)=>{if(u==="diameters")return Number(f.value)-Number(S.value);let h=(L.get(S.value)??0)-(L.get(f.value)??0);return h!==0?h:f.value.localeCompare(S.value)});return{key:u,label:Et[u],options:ut}}).filter(u=>u.options.length>Ft),c=[];for(let u of p){let P=Rt(u.key,r,o);P!==void 0&&c.push({fieldKey:u.key,filterOrder:P})}return[...Ke(p,u=>u.key,c,"filterOrder")]}var Ft=1;function Ye(e){return e.showCollection===!1?["collections"]:[]}function vt(e,t,n){return t.length===0||n.length===0?!0:t.some(r=>$e(X(n,r))(Q(e,r)))}function Rt(e,t,n){if(n.length===0)return;let r;for(let o of t){let s=Me(X(n,o),"filter")(Q(e,o));s!==void 0&&(r===void 0||s<r)&&(r=s)}return r}var te={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},ne="type";var w=e=>!!e&&typeof e=="object"&&!Array.isArray(e),T=e=>w(e)&&typeof e.type=="string"&&w(e.props);var $=e=>Array.isArray(e)&&e.length>0&&e.every(T);function Nt(e){let t="";for(let n of e)t+=typeof n=="number"?`[${n}]`:t===""?n:`.${n}`;return t}function We(e,t){return t==="root"?e.root:e.components[t]}function Ve(e){return e?.fields??{}}function Ge(e,t){return Ve(We(e,t))}function qe(e,t){let n=[];return re(e,t,[],n),n}function re(e,t,n,r){for(let o of Object.keys(t)){let s=t[o];if(!s)continue;let i=[...n,o],l=e[o];if(s.type==="slot"){let a=Array.isArray(l);r.push({slot:Nt(i),segments:i,content:a?l:[],present:a})}else if(s.type==="object"&&s.objectFields&&w(l))re(l,s.objectFields,i,r);else if(s.type==="array"&&s.arrayFields&&Array.isArray(l)){let a=s.arrayFields;l.forEach((p,c)=>{w(p)&&re(p,a,[...i,c],r)})}}}function oe(e,t,n){return Mt(e,t,n).map(({slot:r,content:o})=>({slot:r,content:o}))}function z(e){let t=new TextEncoder,n=new Map(e.map(r=>[r,t.encode(r)]));return[...e].sort((r,o)=>{let s=n.get(r),i=n.get(o);if(s.length!==i.length)return s.length-i.length;for(let l=0;l<s.length;l++)if(s[l]!==i[l])return s[l]-i[l];return 0})}function Mt(e,t,n){let r=qe(e.props,Ge(t,e.type));if(n?.order!=="stored")return r;let o=z(Object.keys(e.props)),s=i=>{let l=i.present?o.indexOf(String(i.segments[0])):-1;return l<0?Number.POSITIVE_INFINITY:l};return r.map((i,l)=>({loc:i,i:l,r:s(i)})).sort((i,l)=>i.r-l.r||i.i-l.i).map(({loc:i})=>i)}var Ze=["Text","ImageBlock","ButtonBlock","Flex"];function k(){return{type:"slot",allow:[...Ze]}}var Kt=Ze.filter(e=>e!=="ButtonBlock");function Xe(){return{type:"slot",allow:[...Kt]}}var $t="boxes",Qe={CardList:{template:Xe()},Cards:{template:k()},FAQ:{template:k()},Flex:{rowTitle:{type:"slot",allow:["Text"]},content:{type:"slot"}},Footprint:{template:k()},Grid:{content:{type:"slot"}},Hero:{slides:{type:"slot",ownPictures:!0},strip:{type:"slot",allow:["Flex"]}},HeroGroup:{content:{type:"slot"}},HeroSingle:{boxes:{type:"slot",allow:["HeroGroup"]}},HeroSlide:{groups:{type:"slot",allow:["HeroGroup"]}},Logos:{logos:{type:"slot",allow:["LogoBlock"]},template:{type:"slot",allow:["LogoBlock"]}},OrderSummary:{template:k()},ProcessSteps:{[$t]:{type:"slot"},template:k()}};var zt={},Dt=null;function Ut(){let e=Object.fromEntries(Object.entries(Qe).map(([t,n])=>[t,{fields:n}]));return Dt??={components:{...e,...zt}}}function Bt(e){let t=e.props??{},n=typeof e.type=="string"?e.type:"",r=Ut(),o=n!==""&&Object.prototype.hasOwnProperty.call(r.components,n)?oe({type:n,props:t},r).map(l=>l.slot).filter(l=>!l.includes(".")):[],s=o.filter(l=>$(t[l])),i=z(Object.keys(t).filter(l=>!o.includes(l)&&$(t[l])));return[...s,...i]}function Je(e,t){let n=null;for(let r of Bt(e)){let o=e.props[r],s=t(o,r);s!==o&&((n??={...e.props})[r]=s)}return n?{...e,props:n}:e}var et="FilterBlock";var tt="AlloyWheelsListing";function jt(e){let t=e??{},n=[];Array.isArray(t.content)&&n.push(t.content);for(let r of Object.values(t.zones??{}))Array.isArray(r)&&n.push(r);return n}function Ht(e){let t=[],n=(r,o)=>{let s=[r,...o];for(let i of r)T(i)&&(t.push({node:i,order:t.length,lists:s}),Je(i,l=>(n(l,s),l)))};for(let r of jt(e))n(r,[]);return t}function nt(e){return Ht(e).map(t=>t.node)}function rt(e){return j(e.trim())}var A="/wheels",D="Products";function ot(e,t){return t>1?`${D} \xB7 ${e}`:D}function se(...e){for(let t of[tt,et])for(let n of e){let r=nt({content:n?.content}).find(o=>o.type===t);if(r)return r.props??{}}return null}function U(...e){return se(...e)!==null}function st(e,t){let n=e.filter(r=>U(...r.docs)).map(r=>b(r.slug));return t.fallback&&!n.includes(A)?[...n,A]:n}var ie=[ne,...Object.entries(te).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function it(e){let t=e.indexOf("#"),n=t===-1?"":e.slice(t),r=t===-1?e:e.slice(0,t),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:n}}function Yt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function lt(e){let t=new URLSearchParams(it(e).query);for(let n of ie){let r=t.get(n);if(r)return{param:n,value:r}}return null}function le(e,t){let{path:n,query:r,hash:o}=it(e),s=r.split("&").filter(i=>i&&!ie.includes(Yt(i.split("=")[0])));return t?.value&&s.push(`${encodeURIComponent(t.param)}=${encodeURIComponent(t.value)}`),`${n}${s.length?`?${s.join("&")}`:""}${o}`}function at(e,t){let n=le(e,null);return t.includes(n)?n:e}function Wt(e,t,n=[]){return K(e,t,{listingPaths:n,targetOf:r=>at(r,n)})}function Vt(e){return Array.isArray(e)?e.filter(t=>typeof t?.kind=="string"&&typeof t.field_key=="string").map(t=>({kind:t.kind,fieldKey:t.field_key,...typeof t.filter=="boolean"?{filter:t.filter}:{},filterOrder:t.filter_order??null})):[]}var ct="Product type",Gt="AUD";function ae(e,t){let n=t.listing??{},r=ge(n.kinds),o=e.filter(a=>r.includes(d(a))),s=Ye(n),i=He(o,Be,Gt,r,t.fieldUsage).filter(a=>!s.includes(a.key)).map(a=>({param:te[a.key],label:a.label,values:a.options.filter(p=>!p.value.includes(",")).map(p=>({value:p.value,label:p.label}))})).filter(a=>a.values.length>0),l=x.filter(a=>r.includes(a)&&o.some(p=>d(p)===a));return l.length>1&&i.unshift({param:ne,label:ct,values:l.map(a=>({value:a,label:E[a]}))}),i}function qt(e){return t=>{let n=st(t,{fallback:e.offersCommerce}),r=t.filter(o=>U(...o.docs)).length;return{listingPaths:n,pageOptions:o=>{let s=o.map(i=>{let l=t.find(a=>b(a.slug)===i.value);return l&&U(...l.docs)?{...i,label:ot(l.title,r)}:i});return r===0&&e.offersCommerce&&!s.some(i=>i.value===A)&&s.push({value:A,label:D}),s},filtersFor:o=>{if(!n.includes(o))return null;let s=t.find(i=>b(i.slug)===o);return ae(e.catalogue,{listing:s?se(...s.docs):null,fieldUsage:e.fieldUsage})},readFilter:lt,withFilter:le}}}function Zt(e){let t=qt({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),n=Ne({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:N(r.slug),name:r.name||r.slug})),offers:e.offers},t);return{...n,rules:{...n.rules,isSafe:rt},filtersFor:n.filtersFor??(()=>null)}}function ns(e,t){return ae(e,t)}export{A as BUILT_IN_LISTING_PATH,F as LINK_KINDS,ie as LISTING_FILTER_PARAMS,D as LISTING_PAGE_LABEL,ct as PRODUCT_TYPE_FILTER_LABEL,C as anchorPath,Vt as fieldUsageFromAdminRows,Wt as inferLinkKind,U as isProductListingPage,rt as isSafeLink,v as linkKindsFor,Zt as linkPickerSetup,ns as listingFilterFields,se as listingNode,ot as listingPageLabel,at as listingTarget,M as pageAnchors,b as pagePath,R as postPath,st as productListingPaths,lt as readListingFilter,N as wheelPath,le as withListingFilter};
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "78.0.0"
2
+ "efficient-web-builder": "79.0.0"
3
3
  }
@@ -1,3 +1,4 @@
1
+ export declare const GALLERY_DETAIL_SIZES = "(max-width: 800px) 100vw, (max-width: 1500px) 33vw, 25vw";
1
2
  export declare const galleryTileNumber: (index: number, total: number) => string;
2
3
  export interface Build {
3
4
  car: string;
@@ -25,6 +26,7 @@ interface Props {
25
26
  styleOwner?: string;
26
27
  editing?: boolean;
27
28
  setCount?: number;
29
+ sizes?: string;
28
30
  }
29
- export default function GalleryCard({ build, hiddenMobile, alwaysShowOverlay, forceHover, index, total, ratio, captionPlace, display, displayPhone, styleOwner, editing, setCount }: Props): import("react").JSX.Element;
31
+ export default function GalleryCard({ build, hiddenMobile, alwaysShowOverlay, forceHover, index, total, ratio, captionPlace, display, displayPhone, styleOwner, editing, setCount, sizes }: Props): import("react").JSX.Element;
30
32
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{useState as S}from"react";import T from"next/image";import u from"efficient-web-builder/render/components/Placeholder";import{withRMark as d}from"efficient-web-builder/render/components/RMark";import{galleryCaptionIsBelow as _,galleryCardRatioClass as w}from"efficient-web-builder/format/lib/content/gallery-card-layout";import{partDisplayClass as R}from"efficient-web-builder/format/lib/content/part-display";import{PART_STYLE_KIND_ATTR as A,PART_STYLE_OWNER_ATTR as C}from"efficient-web-builder/render/lib/document/text-parts";import E from"efficient-web-builder/render/components/PartStyledKind";import{gallerySetChip as L}from"../lib/sections/gallery-mosaic.js";const P=(e,o)=>`${String(e).padStart(2,"0")} / ${String(o).padStart(2,"0")}`;function D({build:e,hiddenMobile:o,alwaysShowOverlay:n,forceHover:l,index:c,total:m,ratio:p,captionPlace:b,display:N,displayPhone:z,styleOwner:h,editing:f=!1,setCount:v}){const a=g=>R(N,z,g),r=g=>f&&h?{[C]:h,[A]:`@${g}`}:{},i=(g,y)=>!f&&h?t(E,{kind:`@${g}`,shared:!0,children:y}):y,[k,j]=S(!1);if(v!=null)return t(I,{build:e,count:v,ratio:p,shown:a,keptAttrs:r,kept:i});const $=_(b),x=s("div",{className:["sf-card group relative overflow-hidden bg-surface-2",w(p),o?"max-view-wide:hidden":""].join(" "),children:[s("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"scale-[1.06] opacity-0 [filter:brightness(0.5)]":"group-hover:scale-[1.06] group-hover:opacity-0 group-hover:[filter:brightness(0.5)]"].join(" "),children:[t(u,{label:e.imageLabel,src:e.imageSrc}),!n&&t("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.35)"}})]}),t("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"opacity-100 scale-[1.06] [filter:brightness(0.5)]":"opacity-0 group-hover:scale-[1.06] group-hover:opacity-100 group-hover:[filter:brightness(0.5)]"].join(" "),style:{background:"var(--site-surface)"},children:e.detailSrc&&t(T,{src:e.detailSrc,alt:"",fill:!0,sizes:"(max-width: 800px) 100vw, (max-width: 1500px) 33vw, 25vw",loading:"lazy",className:"absolute inset-0 z-[3] object-cover",style:{display:k?"none":"block"},onError:()=>j(!0)})}),(e.process||c!=null&&m!=null)&&s("div",{className:"pointer-events-none absolute top-3 left-3 right-3 z-[3] flex items-baseline gap-2 max-view-wide:top-2.5 max-view-wide:left-2.5 max-view-wide:right-2.5",children:[e.process&&t("span",{...r("tag"),className:["min-w-0 truncate font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-accent",a("tag"),"transition-opacity duration-300 ease-out",n||l?"opacity-100":"opacity-0 group-hover:opacity-100 max-view-wide:opacity-100"].join(" "),children:i("tag",d(e.process))}),c!=null&&m!=null&&t("span",{...r("number"),className:`ml-auto shrink-0 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] ${a("number")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:i("number",P(c,m))})]}),t("div",{className:["absolute inset-0 z-[2]","transition-[opacity,transform] duration-300 ease-out",n||l?"opacity-100 translate-y-0":"opacity-0 translate-y-2 group-hover:opacity-100 group-hover:translate-y-0 max-view-wide:opacity-100 max-view-wide:translate-y-0"].join(" "),style:{color:"var(--overlay-fg)",background:n?"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)":"linear-gradient(180deg, transparent 40%, rgba(10,10,10,.85) 100%)"},children:s("div",{className:"absolute inset-x-0 bottom-0 top-9 flex flex-col justify-end gap-1 overflow-hidden p-6 max-view-wide:top-8 max-view-wide:p-3.5",children:[e.car&&t("div",{...r("eyebrow"),className:`truncate font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-accent max-view-wide:text-[length:var(--size-label,11px)] max-view-wide:tracking-[0.15em] ${a("eyebrow")}`.trim(),children:i("eyebrow",e.car)}),e.wheel&&t("div",{...r("title"),className:`font-heading3 text-[length:var(--size-headingSmall,22px)] font-medium leading-[1.05] tracking-[-0.02em] max-view-wide:text-[length:var(--size-body,16px)] ${n?"uppercase ":""}${a("title")}`.trim(),children:i("title",e.wheel)}),e.finish&&t("div",{...r("meta"),className:`mt-1.5 flex gap-3.5 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.12em] ${a("meta")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:t("span",{children:i("meta",d(e.finish))})})]})})]});return $?s("div",{className:o?"max-view-wide:hidden":"",children:[x,s("div",{className:"bg-surface px-3.5 pt-3 pb-3.5",children:[e.wheel&&t("div",{...r("title"),className:`font-display text-[length:var(--size-body,15px)] font-medium leading-[1.25] tracking-[-0.01em] text-fg ${a("title")}`.trim(),children:i("title",e.wheel)}),(e.finish||e.car)&&t("div",{...r(e.finish?"meta":"eyebrow"),className:`mt-0.5 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] text-fg-dim ${a(e.finish?"meta":"eyebrow")}`.trim(),children:i(e.finish?"meta":"eyebrow",d(e.finish||e.car))})]})]}):x}function I({build:e,count:o,ratio:n,shown:l,keptAttrs:c,kept:m}){const p=L(o);return s("div",{className:`sf-card relative overflow-hidden bg-surface-2 ${w(n)}`,style:{color:"var(--overlay-fg)"},children:[t("div",{className:"absolute inset-0 flex items-center justify-center",children:t(u,{label:e.imageLabel,src:e.imageSrc})}),t("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--overlay-scrim) 0%, transparent) 45%, color-mix(in srgb, var(--overlay-scrim) 70%, transparent))"}}),p&&t("span",{"data-gallery-set-chip":"",className:"absolute right-3 top-3 z-1 bg-overlay-scrim/45 px-2 py-1 text-[length:var(--size-label,11px)] tracking-[0.12em]",children:p}),s("div",{className:"absolute bottom-[18px] left-5 right-5 z-1 max-view-wide:bottom-2.5 max-view-wide:left-3",children:[e.wheel&&t("div",{...c("title"),className:`text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] opacity-85 ${l("title")}`.trim(),children:m("title",d(e.wheel))}),e.car&&t("div",{...c("eyebrow"),className:`mt-1 text-lg leading-normal max-view-wide:text-sm ${l("eyebrow")}`.trim(),children:m("eyebrow",e.car)})]})]})}export{D as default,P as galleryTileNumber};
1
+ "use client";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useState as T}from"react";import _ from"next/image";import b from"efficient-web-builder/render/components/Placeholder";import{withRMark as f}from"efficient-web-builder/render/components/RMark";import{galleryCaptionIsBelow as R,galleryCardRatioClass as N}from"efficient-web-builder/format/lib/content/gallery-card-layout";import{partDisplayClass as A}from"efficient-web-builder/format/lib/content/part-display";import{PART_STYLE_KIND_ATTR as E,PART_STYLE_OWNER_ATTR as L}from"efficient-web-builder/render/lib/document/text-parts";import C from"efficient-web-builder/render/components/PartStyledKind";import{gallerySetChip as I}from"../lib/sections/gallery-mosaic.js";const D="(max-width: 800px) 100vw, (max-width: 1500px) 33vw, 25vw",P=(e,o)=>`${String(e).padStart(2,"0")} / ${String(o).padStart(2,"0")}`;function G({build:e,hiddenMobile:o,alwaysShowOverlay:s,forceHover:l,index:c,total:m,ratio:p,captionPlace:d,display:k,displayPhone:z,styleOwner:v,editing:x=!1,setCount:y,sizes:h}){const a=g=>A(k,z,g),r=g=>x&&v?{[L]:v,[E]:`@${g}`}:{},i=(g,w)=>!x&&v?t(C,{kind:`@${g}`,shared:!0,children:w}):w,[j,$]=T(!1);if(y!=null)return t(Y,{build:e,count:y,ratio:p,sizes:h,shown:a,keptAttrs:r,kept:i});const S=R(d),u=n("div",{className:["sf-card group relative overflow-hidden bg-surface-2",N(p),o?"max-view-wide:hidden":""].join(" "),children:[n("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"scale-[1.06] opacity-0 [filter:brightness(0.5)]":"group-hover:scale-[1.06] group-hover:opacity-0 group-hover:[filter:brightness(0.5)]"].join(" "),children:[t(b,{label:e.imageLabel,src:e.imageSrc,...h?{sizes:h}:{}}),!s&&t("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.35)"}})]}),t("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"opacity-100 scale-[1.06] [filter:brightness(0.5)]":"opacity-0 group-hover:scale-[1.06] group-hover:opacity-100 group-hover:[filter:brightness(0.5)]"].join(" "),style:{background:"var(--site-surface)"},children:e.detailSrc&&t(_,{src:e.detailSrc,alt:"",fill:!0,sizes:h??D,loading:"lazy",className:"absolute inset-0 z-[3] object-cover",style:{display:j?"none":"block"},onError:()=>$(!0)})}),(e.process||c!=null&&m!=null)&&n("div",{className:"pointer-events-none absolute top-3 left-3 right-3 z-[3] flex items-baseline gap-2 max-view-wide:top-2.5 max-view-wide:left-2.5 max-view-wide:right-2.5",children:[e.process&&t("span",{...r("tag"),className:["min-w-0 truncate font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-accent",a("tag"),"transition-opacity duration-300 ease-out",s||l?"opacity-100":"opacity-0 group-hover:opacity-100 max-view-wide:opacity-100"].join(" "),children:i("tag",f(e.process))}),c!=null&&m!=null&&t("span",{...r("number"),className:`ml-auto shrink-0 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] ${a("number")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:i("number",P(c,m))})]}),t("div",{className:["absolute inset-0 z-[2]","transition-[opacity,transform] duration-300 ease-out",s||l?"opacity-100 translate-y-0":"opacity-0 translate-y-2 group-hover:opacity-100 group-hover:translate-y-0 max-view-wide:opacity-100 max-view-wide:translate-y-0"].join(" "),style:{color:"var(--overlay-fg)",background:s?"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)":"linear-gradient(180deg, transparent 40%, rgba(10,10,10,.85) 100%)"},children:n("div",{className:"absolute inset-x-0 bottom-0 top-9 flex flex-col justify-end gap-1 overflow-hidden p-6 max-view-wide:top-8 max-view-wide:p-3.5",children:[e.car&&t("div",{...r("eyebrow"),className:`truncate font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-accent max-view-wide:text-[length:var(--size-label,11px)] max-view-wide:tracking-[0.15em] ${a("eyebrow")}`.trim(),children:i("eyebrow",e.car)}),e.wheel&&t("div",{...r("title"),className:`font-heading3 text-[length:var(--size-headingSmall,22px)] font-medium leading-[1.05] tracking-[-0.02em] max-view-wide:text-[length:var(--size-body,16px)] ${s?"uppercase ":""}${a("title")}`.trim(),children:i("title",e.wheel)}),e.finish&&t("div",{...r("meta"),className:`mt-1.5 flex gap-3.5 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.12em] ${a("meta")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:t("span",{children:i("meta",f(e.finish))})})]})})]});return S?n("div",{className:o?"max-view-wide:hidden":"",children:[u,n("div",{className:"bg-surface px-3.5 pt-3 pb-3.5",children:[e.wheel&&t("div",{...r("title"),className:`font-display text-[length:var(--size-body,15px)] font-medium leading-[1.25] tracking-[-0.01em] text-fg ${a("title")}`.trim(),children:i("title",e.wheel)}),(e.finish||e.car)&&t("div",{...r(e.finish?"meta":"eyebrow"),className:`mt-0.5 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] text-fg-dim ${a(e.finish?"meta":"eyebrow")}`.trim(),children:i(e.finish?"meta":"eyebrow",f(e.finish||e.car))})]})]}):u}function Y({build:e,count:o,ratio:s,sizes:l,shown:c,keptAttrs:m,kept:p}){const d=I(o);return n("div",{className:`sf-card relative overflow-hidden bg-surface-2 ${N(s)}`,style:{color:"var(--overlay-fg)"},children:[t("div",{className:"absolute inset-0 flex items-center justify-center",children:t(b,{label:e.imageLabel,src:e.imageSrc,...l?{sizes:l}:{}})}),t("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--overlay-scrim) 0%, transparent) 45%, color-mix(in srgb, var(--overlay-scrim) 70%, transparent))"}}),d&&t("span",{"data-gallery-set-chip":"",className:"absolute right-3 top-3 z-1 bg-overlay-scrim/45 px-2 py-1 text-[length:var(--size-label,11px)] tracking-[0.12em]",children:d}),n("div",{className:"absolute bottom-[18px] left-5 right-5 z-1 max-view-wide:bottom-2.5 max-view-wide:left-3",children:[e.wheel&&t("div",{...m("title"),className:`text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] opacity-85 ${c("title")}`.trim(),children:p("title",f(e.wheel))}),e.car&&t("div",{...m("eyebrow"),className:`mt-1 text-lg leading-normal max-view-wide:text-sm ${c("eyebrow")}`.trim(),children:p("eyebrow",e.car)})]})]})}export{D as GALLERY_DETAIL_SIZES,G as default,P as galleryTileNumber};
@@ -1,3 +1,3 @@
1
- "use client";import{jsx as r,jsxs as me}from"react/jsx-runtime";import{useCallback as j,useMemo as f,useState as B}from"react";import{usePathname as pe}from"next/navigation";import{containerGapProps as fe}from"efficient-web-builder/format/lib/content/container-gap";import ge from"efficient-web-builder/render/components/Btn";import ue,{GALLERY_GRID_ATTR as ye,GalleryLinksContext as he,GalleryTilesContext as we}from"./GalleryItem.js";import{useShopperGallery as Le}from"./catalog/ShopperScope.js";import{galleryShownIds as Se,galleryToolbarIdle as Ce,WALL_PLACED_CELL as xe,WALL_PLACED_CSS as ve,wallSpanAt as Ge}from"../lib/sections/gallery-toolbar.js";import{GALLERY_MOSAIC_LAYOUT as Ne,galleryMosaicRowsCss as _e}from"../lib/sections/gallery-mosaic.js";import{useSiteSells as Ae}from"./SiteRecordContext.js";import{SharedPartKinds as Pe}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as ke}from"efficient-web-builder/render/components/goldPhrases";import Oe from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as be,framedBandPad as Ie,headIsEmpty as Te,withBandClasses as Ee}from"../lib/sections/band-padding.js";import{galleryFrame as Re,galleryTemplate as Me}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as je,withSideOnce as Be}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as $e,resolveGridMobileColumns as De}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as $,galleryLayoutCss as Ye,resolveGalleryLayout as ze}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as Fe}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as Ue}from"efficient-web-builder/render/components/SideSpaceOnce";function We({items:c,template:D,nodeId:Y,sourced:a,galleryLink:z=!0,num:x,title:w,linkText:v,linkHref:F,galleryHref:g="/gallery",submitHref:U="/contact",previewHover:W,display:K,displayPhone:V,styleOwner:q,layout:G,layoutPhone:H,columns:u,columnsMobile:J,gap:Q,gapPhone:X,sets:N=!1,omitHead:L=!1,pads:Z,editing:_=!1}){const ee=Ue(),le=pe(),se=Ae(),re=z&&g!==le&&(se||g!=="/gallery"),y={layout:G,layoutPhone:H},m=ze(y),te=!m&&u!=null&&u!=="",i=fe("GalleryB",Q,"both",X),A=m?{className:`sf-card-grid sf-gallery-zone ${$(y)} grid${i.className}`,style:i.style}:te?{className:`sf-card-grid sf-grid-zone grid${i.className}`,style:{...i.style,"--sf-grid-cols":String($e(u)),"--sf-grid-cols-phone":String(De(J,u))}}:{className:`sf-card-grid grid grid-cols-4${i.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:i.style},P=v?{text:v,href:F||"#"}:void 0,ne=w?ke(w,!1):void 0,[k,oe]=B({}),O=j((e,s)=>{oe(l=>{const o=l[e.id];if(s){if(!o)return l;const{[e.id]:Ke,...ce}=l;return ce}return o&&o.tag===e.tag&&o.name===e.name?l:{...l,[e.id]:e}})},[]),h=a?.map(e=>e.tile.id).join(`
2
- `),b=f(()=>h!==void 0?h?h.split(`
3
- `):[]:c?.blockIds,[h,c?.blockIds]),d=f(()=>(b??[]).map(e=>k[e]).filter(e=>!!e),[b,k]),{ref:ae,toolbar:p}=Le(d),I=p!==null&&!Ce(p,d),t=f(()=>I&&p?Se(d,p):null,[I,p,d]),n=f(()=>t??d.map(e=>e.id),[t,d]),[T,ie]=B(null),E=j((e,s)=>{const l=n.indexOf(e);l<0||n.length<2||ie({id:n[(l+s+n.length)%n.length],at:s>0?"first":"last"})},[n]),de=f(()=>{const e=new Map((t??[]).map((s,l)=>[s,l]));return{report:O,positionOf:s=>{const l=t?e.get(s):void 0;return l===void 0?null:{index:l+1,total:t.length}},walkCount:n.length,walk:E,opening:T}},[O,t,n.length,E,T]),S=t?e=>{const s=t.indexOf(e);if(s<0)return{style:{display:"none"}};if(!m)return{style:{order:s}};const l=Ge(m,s,t.length);return{className:xe,style:{order:s,"--sf-wall-c":l.col,"--sf-wall-r":l.row,"--sf-wall-cp":l.colPhone,"--sf-wall-rp":l.rowPhone}}}:void 0,R=m?Ye(y)+(G===Ne?_e($(y)):""):"",C=Ie(Z,be,{noTop:L,nonNegative:!0}),M=Me(D,!a);return r(Fe,{as:"section",ref:ae,...C.attrs,className:Ee(Re(L,!!M),C),style:C.style,children:me("div",{className:Be(je,ee),children:[L||!_&&Te(x,w,P?.text)?null:r(Oe,{num:x,title:ne,link:P}),R?r("style",{dangerouslySetInnerHTML:{__html:R+(t?ve:"")}}):null,(c||a)&&r(he.Provider,{value:{galleryHref:g,submitHref:U,previewHover:W,display:K,displayPhone:V,styleOwner:q,wordsAtRest:!!a,ownerId:Y,Template:M,...N?{sets:N}:{}},children:r(we.Provider,{value:de,children:r(Pe,{children:r("div",{[ye]:"",style:{display:"contents"},children:a?r("div",{...A,children:a.map(({tile:e,...s})=>{const l=r(ue,{...s,tile:e,editing:_},e.id),o=S?.(e.id);return o?r("div",{className:o.className,style:o.style,children:l},e.id):l})}):c?r(c,{...A,minEmptyHeight:320,...S?{cell:S}:{}}):null})})})}),re&&r("div",{className:"mt-12 flex flex-col items-center gap-3",children:r(ge,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{We as default};
1
+ "use client";import{jsx as r,jsxs as me}from"react/jsx-runtime";import{useCallback as z,useMemo as m,useState as B}from"react";import{usePathname as fe}from"next/navigation";import{containerGapProps as pe}from"efficient-web-builder/format/lib/content/container-gap";import ge from"efficient-web-builder/render/components/Btn";import ue,{GALLERY_GRID_ATTR as he,GalleryLinksContext as ye,GalleryTilesContext as we}from"./GalleryItem.js";import{useShopperGallery as Se}from"./catalog/ShopperScope.js";import{galleryShownIds as Le,galleryToolbarIdle as xe,WALL_PLACED_CELL as Ce,WALL_PLACED_CSS as ve,wallSpanAt as Ge,wallTileSizes as Ne}from"../lib/sections/gallery-toolbar.js";import{GALLERY_MOSAIC_LAYOUT as _e,galleryMosaicRowsCss as Oe}from"../lib/sections/gallery-mosaic.js";import{useSiteSells as Ae}from"./SiteRecordContext.js";import{SharedPartKinds as ke}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as Te}from"efficient-web-builder/render/components/goldPhrases";import be from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as Ie,framedBandPad as Pe,headIsEmpty as Ee,withBandClasses as Re}from"../lib/sections/band-padding.js";import{galleryFrame as Me,galleryTemplate as je}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as ze,withSideOnce as Be}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as $e,resolveGridMobileColumns as De}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as $,galleryLayoutCss as Ye,resolveGalleryLayout as Fe}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as Ue}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as We}from"efficient-web-builder/render/components/SideSpaceOnce";function Ke({items:f,template:D,nodeId:Y,sourced:a,galleryLink:F=!0,num:N,title:S,linkText:_,linkHref:U,galleryHref:g="/gallery",submitHref:W="/contact",previewHover:K,display:V,displayPhone:q,styleOwner:H,layout:u,layoutPhone:L,columns:h,columnsMobile:J,gap:Q,gapPhone:X,sets:O=!1,omitHead:x=!1,pads:Z,editing:A=!1}){const ee=We(),se=fe(),ne=Ae(),re=F&&g!==se&&(ne||g!=="/gallery"),C={layout:u,layoutPhone:L},o=m(()=>Fe({layout:u,layoutPhone:L}),[u,L]),le=!o&&h!=null&&h!=="",d=pe("GalleryB",Q,"both",X),k=o?{className:`sf-card-grid sf-gallery-zone ${$(C)} grid${d.className}`,style:d.style}:le?{className:`sf-card-grid sf-grid-zone grid${d.className}`,style:{...d.style,"--sf-grid-cols":String($e(h)),"--sf-grid-cols-phone":String(De(J,h))}}:{className:`sf-card-grid grid grid-cols-4${d.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:d.style},T=_?{text:_,href:U||"#"}:void 0,te=S?Te(S,!1):void 0,[b,oe]=B({}),I=z((e,n)=>{oe(s=>{const t=s[e.id];if(n){if(!t)return s;const{[e.id]:Ve,...ce}=s;return ce}return t&&t.tag===e.tag&&t.name===e.name?s:{...s,[e.id]:e}})},[]),y=a?.map(e=>e.tile.id).join(`
2
+ `),w=m(()=>y!==void 0?y?y.split(`
3
+ `):[]:f?.blockIds,[y,f?.blockIds]),c=m(()=>(w??[]).map(e=>b[e]).filter(e=>!!e),[w,b]),{ref:ie,toolbar:p}=Se(c),P=p!==null&&!xe(p,c),l=m(()=>P&&p?Le(c,p):null,[P,p,c]),i=m(()=>l??c.map(e=>e.id),[l,c]),[E,ae]=B(null),R=z((e,n)=>{const s=i.indexOf(e);s<0||i.length<2||ae({id:i[(s+n+i.length)%i.length],at:n>0?"first":"last"})},[i]),de=m(()=>{const e=new Map((l??[]).map((n,s)=>[n,s]));return{report:I,positionOf:n=>{const s=l?e.get(n):void 0;return s===void 0?null:{index:s+1,total:l.length}},sizesOf:n=>{if(!o)return;const s=l??w??[],t=s.indexOf(n);return t<0?void 0:Ne(o,t,s.length)},walkCount:i.length,walk:R,opening:E}},[I,l,w,o,i.length,R,E]),v=l?e=>{const n=l.indexOf(e);if(n<0)return{style:{display:"none"}};if(!o)return{style:{order:n}};const s=Ge(o,n,l.length);return{className:Ce,style:{order:n,"--sf-wall-c":s.col,"--sf-wall-r":s.row,"--sf-wall-cp":s.colPhone,"--sf-wall-rp":s.rowPhone}}}:void 0,M=o?Ye(C)+(u===_e?Oe($(C)):""):"",G=Pe(Z,Ie,{noTop:x,nonNegative:!0}),j=je(D,!a);return r(Ue,{as:"section",ref:ie,...G.attrs,className:Re(Me(x,!!j),G),style:G.style,children:me("div",{className:Be(ze,ee),children:[x||!A&&Ee(N,S,T?.text)?null:r(be,{num:N,title:te,link:T}),M?r("style",{dangerouslySetInnerHTML:{__html:M+(l?ve:"")}}):null,(f||a)&&r(ye.Provider,{value:{galleryHref:g,submitHref:W,previewHover:K,display:V,displayPhone:q,styleOwner:H,wordsAtRest:!!a,ownerId:Y,Template:j,...O?{sets:O}:{}},children:r(we.Provider,{value:de,children:r(ke,{children:r("div",{[he]:"",style:{display:"contents"},children:a?r("div",{...k,children:a.map(({tile:e,...n})=>{const s=r(ue,{...n,tile:e,editing:A},e.id),t=v?.(e.id);return t?r("div",{className:t.className,style:t.style,children:s},e.id):s})}):f?r(f,{...k,minEmptyHeight:320,...v?{cell:v}:{}}):null})})})}),re&&r("div",{className:"mt-12 flex flex-col items-center gap-3",children:r(ge,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{Ke as default};
@@ -33,6 +33,7 @@ export declare const GALLERY_TILE_PARTS: readonly [{
33
33
  export declare const GalleryTilesContext: import("react").Context<{
34
34
  report: (tile: GalleryTile, gone?: boolean) => void;
35
35
  positionOf: (id: string) => TilePosition | null;
36
+ sizesOf?: (id: string) => string | undefined;
36
37
  walkCount: number;
37
38
  walk: (fromId: string, dir: 1 | -1) => void;
38
39
  opening: {
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as l,Fragment as y}from"react/jsx-runtime";import{createContext as K,useCallback as de,useContext as J,useEffect as Q,useRef as me,useState as z}from"react";import I from"next/link";import{SiteLink as pe}from"efficient-web-builder/render/lib/site-runtime";import{GALLERY_PHONE_BREAKPOINT as fe}from"efficient-web-builder/format/lib/content/gallery-layout";import{slugify as he}from"efficient-shell/format";import{CardTemplateRows as xe}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as ge,SIDE_ONCE_HOLDS_CLASS as ue}from"efficient-web-builder/format/lib/content/page-width";import be,{galleryTileNumber as we}from"./GalleryCard.js";import ee,{LightboxClose as te,LIGHTBOX_CLOSE_TINT as ve}from"./Lightbox.js";import{useSiteSells as ye}from"./SiteRecordContext.js";import{renderGold as b,renderHeadline as re}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as A}from"efficient-web-builder/format/lib/sized-image";import{useBrowserLayoutEffect as Ne}from"efficient-shell/hooks";import{HideTaker as oe}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as ke}from"efficient-web-builder/render/components/SideSpaceOnce";const Se="(max-width: 1100px) 100vw, min(59vw, 1050px)",_e=K({}),et=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],Ce=K(null),Le="data-gallery-grid",j="data-gallery-tile";function Te(t,o){const[a,c]=z(null);return Q(()=>{const i=t.current,n=i?.closest(`[${Le}]`);if(!i||!n)return;const w=()=>{const g=Array.from(n.querySelectorAll(`[${j}]`)),f=g.indexOf(i),m=f>=0?{index:f+1,total:g.length}:null;c(N=>N?.index===m?.index&&N?.total===m?.total?N:m)};if(w(),!o)return;const x=new MutationObserver(w);return x.observe(n,{childList:!0,subtree:!0}),()=>x.disconnect()},[t,o]),a}const tt={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},$e=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),rt=Array.from({length:6},$e);function Ee(t){const o=(t.photos??[]).map(n=>n?.src).filter(n=>!!n),a=t.image||o[0]||"",c=[a,...o].filter(n=>!!n),i=he(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${i}.jpg`,detailLabel:`${i}-detail.jpg`,imageSrc:a||void 0,detailSrc:o[0]||a||void 0,photos:c,href:t.href}}function Oe({editing:t=!1,previewHover:o,ratio:a,captionPlace:c,tile:i,...n}){const w=ke(),{galleryHref:x="/gallery",submitHref:g="/contact",previewHover:f,display:m,displayPhone:N,styleOwner:ae,photosOnly:ne=!1,wordsAtRest:ie=!1,Template:G,ownerId:se,sets:R=!1}=J(_e),e=Ee(n),k=ye()&&!ne,B=!k&&!Pe(e),d=e.photos??(e.imageSrc?[e.imageSrc]:[]),M=me(null),D=de(s=>{M.current=s},[]),ce=Te(M,t),v=J(Ce),C=v?.report,p=i?.id,W=i?.tag??"",Y=i?.name??"";Ne(()=>{if(!C||!p)return;const s={id:p,tag:W,name:Y};return C(s),()=>C(s,!0)},[C,p,W,Y]);const S=(p?v?.positionOf(p):null)??ce,F=t&&(!!o||!!f),[U,h]=z(!1),[_,L]=z(0),X=!!p&&!!v&&v.walkCount>1,V=s=>{const P=_+s;if(X&&(P<0||P>=d.length)){h(!1),v.walk(p,s);return}L((P+d.length)%d.length)},T=()=>V(-1),$=()=>V(1),u=d.length>1||X,E=v?.opening;Q(()=>{!E||E.id!==p||(L(E.at==="last"?Math.max(0,d.length-1):0),h(!0))},[E,p]);const O=d[_]??e.imageSrc??"",Z=d.slice(1),q=G?r("div",{className:`block w-full min-w-0 ${ge}${w?` ${ue}`:""}`,children:r(xe,{ownerId:se??"GalleryB",ownerType:"GalleryB",Template:G,rows:[{key:p??e.imageSrc??"tile",image:e.imageSrc??"",tag:e.process,number:S?we(S.index,S.total):"",eyebrow:e.car,name:e.wheel,meta:e.finish,href:e.href??""}],items:[{hoverMedia:Z.length?{photos:[{finish:"",items:Z.map(s=>({url:s,kind:"image"}))}]}:null}],previewHover:F,fallback:null,children:s=>s})}):r(be,{build:e,forceHover:F,alwaysShowOverlay:ie,index:S?.index,total:S?.total,ratio:a,captionPlace:c,display:m,displayPhone:N,styleOwner:ae,editing:t,...R?{setCount:d.length}:{}});return l(y,{children:[t?r(oe,{as:"div",ref:D,[j]:"",className:"block w-full text-left",children:q}):r(oe,{as:"button",ref:D,[j]:"",type:"button","aria-label":k?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:H(e),onClick:()=>{L(0),h(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:q}),R?r(ee,{open:U,onClose:()=>h(!1),label:e.car&&e.wheel?`${e.car} on ${e.wheel}`:H(e),onPrev:u?T:void 0,onNext:u?$:void 0,className:"bg-bg",children:r(je,{build:e,set:d,index:_,onPick:L,onPrev:u?T:void 0,onNext:u?$:void 0,onLeave:()=>h(!1)})}):r(ee,{open:U,onClose:()=>h(!1),label:k?`${e.car} on ${e.wheel}`:H(e),onPrev:u?T:void 0,onNext:u?$:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:l("div",{onClick:s=>s.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${B?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-view-desktop:grid-cols-1 max-view-desktop:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(te,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:ve},children:"✕"}),l("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-view-desktop:min-h-[450px]",children:[O&&r("img",{...A(O,{fallbackWidth:1280}),sizes:Se,alt:`${(k?e.car:e.wheel||e.car)||"Photo"} — ${_+1} of ${d.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},O),u&&l(y,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:T,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:$,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),d.length>1&&l("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[_+1," / ",d.length]})]})]}),k?l("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:b(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:re(e.wheel,!1)}),e.car&&l("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:b(e.car,!0)})]}),l("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:b(e.wheel)})]}),e.process&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:b(e.process)})]}),e.finish&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:b(e.finish)})]}),e.car&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:b(e.car)})]})]}),l("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[l(I,{href:e.href||"/wheels",onClick:()=>h(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),l(I,{href:x,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),l(I,{href:g,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!B&&r(ze,{build:e})]})})]})}function le(t){return[t.process,t.car,t.finish].filter((o,a,c)=>!!o&&o!==t.wheel&&c.indexOf(o)===a)}function Pe(t){return!!t.wheel||le(t).length>0}function H(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function ze({build:t}){const o=t.wheel,a=le(t);return l("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:re(o,!1)}),a.map(c=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:b(c)},c))]})}const Ie=360,Ae="120px";function je({build:t,set:o,index:a,onPick:c,onPrev:i,onNext:n,onLeave:w}){const x=o[a]??t.imageSrc??"",g="absolute top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg bg-bg text-lg text-fg max-view-wide:hidden";return l("div",{onClick:f=>f.stopPropagation(),className:"grid h-full w-full grid-cols-[1fr_360px] bg-bg text-fg max-view-wide:grid-cols-1 max-view-wide:grid-rows-[auto_1fr] max-view-wide:overflow-auto",children:[l("div",{className:"relative grid min-h-0 place-items-center bg-surface-2 py-12 max-view-wide:p-0",children:[x&&r("img",{...A(x,{fallbackWidth:1280}),sizes:`(max-width: ${fe}px) 100vw, calc(100vw - ${Ie}px)`,alt:`${t.car||t.wheel||"Photo"} — ${a+1} of ${o.length}`,className:"block max-h-[calc(100vh-96px)] max-w-[calc(100%-192px)] max-view-wide:max-h-[60vh] max-view-wide:max-w-full"},x),i&&r("button",{type:"button","aria-label":"Previous photo",onClick:i,className:`${g} left-6`,children:"‹"}),n&&r("button",{type:"button","aria-label":"Next photo",onClick:n,className:`${g} right-6`,children:"›"})]}),l("div",{"data-gallery-set-side":"",className:"flex min-h-0 flex-col overflow-auto p-8 max-view-wide:px-4 max-view-wide:py-5",children:[r(te,{label:"Close popup",className:"flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center self-end border border-fg bg-bg text-lg text-fg max-view-wide:fixed max-view-wide:right-3 max-view-wide:top-3 max-view-wide:z-5",children:"✕"}),t.wheel&&r("div",{className:"mt-10 text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-fg-dim max-view-wide:mt-0",children:t.wheel}),t.car&&r("div",{className:"mt-2 mb-2 text-2xl leading-normal",children:t.car}),l("div",{className:"text-xs leading-normal text-fg-dim",children:[a+1," / ",o.length]}),o.length>1&&r("div",{className:"mt-8 grid grid-cols-3 gap-2 max-view-wide:grid-cols-5",children:o.map((f,m)=>r("button",{type:"button","data-gallery-set-thumb":"","aria-label":`Show photo ${m+1}`,"aria-current":m===a?"true":void 0,onClick:()=>c(m),className:`block cursor-pointer p-0 ${m===a?"opacity-100 outline outline-1 outline-offset-2 outline-fg":"opacity-50"}`,children:r("img",{...A(f,{fallbackWidth:320,maxWidth:640}),sizes:Ae,alt:"",loading:"lazy",className:"block aspect-[4/3] w-full object-cover"})},`${f}-${m}`))}),t.wheel&&t.href&&l(pe,{href:t.href,onClick:w,className:"mt-auto inline-block self-start border border-fg px-8 py-3 text-xs text-fg max-view-wide:mt-6",children:["See ",t.wheel]})]})]})}export{Le as GALLERY_GRID_ATTR,tt as GALLERY_ITEM_HINTS,rt as GALLERY_ITEM_SEEDS,j as GALLERY_TILE_ATTR,et as GALLERY_TILE_PARTS,_e as GalleryLinksContext,Ce as GalleryTilesContext,Oe as default};
1
+ "use client";import{jsx as r,jsxs as l,Fragment as y}from"react/jsx-runtime";import{createContext as J,useCallback as me,useContext as Q,useEffect as ee,useRef as pe,useState as z}from"react";import I from"next/link";import{SiteLink as fe}from"efficient-web-builder/render/lib/site-runtime";import{GALLERY_PHONE_BREAKPOINT as he}from"efficient-web-builder/format/lib/content/gallery-layout";import{slugify as xe}from"efficient-shell/format";import{CardTemplateRows as ge}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as ue,SIDE_ONCE_HOLDS_CLASS as be}from"efficient-web-builder/format/lib/content/page-width";import we,{galleryTileNumber as ve}from"./GalleryCard.js";import te,{LightboxClose as re,LIGHTBOX_CLOSE_TINT as ye}from"./Lightbox.js";import{useSiteSells as Ne}from"./SiteRecordContext.js";import{renderGold as w,renderHeadline as oe}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as A}from"efficient-web-builder/format/lib/sized-image";import{useBrowserLayoutEffect as ke}from"efficient-shell/hooks";import{HideTaker as le}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as Se}from"efficient-web-builder/render/components/SideSpaceOnce";const _e="(max-width: 1100px) 100vw, min(59vw, 1050px)",Ce=J({}),tt=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],Le=J(null),Te="data-gallery-grid",j="data-gallery-tile";function $e(t,o){const[n,c]=z(null);return ee(()=>{const i=t.current,a=i?.closest(`[${Te}]`);if(!i||!a)return;const v=()=>{const g=Array.from(a.querySelectorAll(`[${j}]`)),f=g.indexOf(i),p=f>=0?{index:f+1,total:g.length}:null;c(N=>N?.index===p?.index&&N?.total===p?.total?N:p)};if(v(),!o)return;const x=new MutationObserver(v);return x.observe(a,{childList:!0,subtree:!0}),()=>x.disconnect()},[t,o]),n}const rt={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},Oe=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),ot=Array.from({length:6},Oe);function Ee(t){const o=(t.photos??[]).map(a=>a?.src).filter(a=>!!a),n=t.image||o[0]||"",c=[n,...o].filter(a=>!!a),i=xe(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${i}.jpg`,detailLabel:`${i}-detail.jpg`,imageSrc:n||void 0,detailSrc:o[0]||n||void 0,photos:c,href:t.href}}function Pe({editing:t=!1,previewHover:o,ratio:n,captionPlace:c,tile:i,...a}){const v=Se(),{galleryHref:x="/gallery",submitHref:g="/contact",previewHover:f,display:p,displayPhone:N,styleOwner:ae,photosOnly:ie=!1,wordsAtRest:se=!1,Template:G,ownerId:ce,sets:R=!1}=Q(Ce),e=Ee(a),k=Ne()&&!ie,B=!k&&!ze(e),d=e.photos??(e.imageSrc?[e.imageSrc]:[]),M=pe(null),D=me(s=>{M.current=s},[]),de=$e(M,t),u=Q(Le),C=u?.report,m=i?.id,W=i?.tag??"",Y=i?.name??"";ke(()=>{if(!C||!m)return;const s={id:m,tag:W,name:Y};return C(s),()=>C(s,!0)},[C,m,W,Y]);const S=(m?u?.positionOf(m):null)??de,F=m?u?.sizesOf?.(m):void 0,U=t&&(!!o||!!f),[X,h]=z(!1),[_,L]=z(0),V=!!m&&!!u&&u.walkCount>1,Z=s=>{const P=_+s;if(V&&(P<0||P>=d.length)){h(!1),u.walk(m,s);return}L((P+d.length)%d.length)},T=()=>Z(-1),$=()=>Z(1),b=d.length>1||V,O=u?.opening;ee(()=>{!O||O.id!==m||(L(O.at==="last"?Math.max(0,d.length-1):0),h(!0))},[O,m]);const E=d[_]??e.imageSrc??"",q=d.slice(1),K=G?r("div",{className:`block w-full min-w-0 ${ue}${v?` ${be}`:""}`,children:r(ge,{ownerId:ce??"GalleryB",ownerType:"GalleryB",Template:G,rows:[{key:m??e.imageSrc??"tile",image:e.imageSrc??"",tag:e.process,number:S?ve(S.index,S.total):"",eyebrow:e.car,name:e.wheel,meta:e.finish,href:e.href??""}],items:[{hoverMedia:q.length?{photos:[{finish:"",items:q.map(s=>({url:s,kind:"image"}))}]}:null}],previewHover:U,fallback:null,children:s=>s})}):r(we,{build:e,forceHover:U,alwaysShowOverlay:se,index:S?.index,total:S?.total,ratio:n,captionPlace:c,display:p,displayPhone:N,styleOwner:ae,editing:t,...R?{setCount:d.length}:{},...F?{sizes:F}:{}});return l(y,{children:[t?r(le,{as:"div",ref:D,[j]:"",className:"block w-full text-left",children:K}):r(le,{as:"button",ref:D,[j]:"",type:"button","aria-label":k?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:H(e),onClick:()=>{L(0),h(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:K}),R?r(te,{open:X,onClose:()=>h(!1),label:e.car&&e.wheel?`${e.car} on ${e.wheel}`:H(e),onPrev:b?T:void 0,onNext:b?$:void 0,className:"bg-bg",children:r(He,{build:e,set:d,index:_,onPick:L,onPrev:b?T:void 0,onNext:b?$:void 0,onLeave:()=>h(!1)})}):r(te,{open:X,onClose:()=>h(!1),label:k?`${e.car} on ${e.wheel}`:H(e),onPrev:b?T:void 0,onNext:b?$:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:l("div",{onClick:s=>s.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${B?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-view-desktop:grid-cols-1 max-view-desktop:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(re,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:ye},children:"✕"}),l("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-view-desktop:min-h-[450px]",children:[E&&r("img",{...A(E,{fallbackWidth:1280}),sizes:_e,alt:`${(k?e.car:e.wheel||e.car)||"Photo"} — ${_+1} of ${d.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},E),b&&l(y,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:T,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:$,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),d.length>1&&l("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[_+1," / ",d.length]})]})]}),k?l("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:w(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:oe(e.wheel,!1)}),e.car&&l("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:w(e.car,!0)})]}),l("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:w(e.wheel)})]}),e.process&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:w(e.process)})]}),e.finish&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:w(e.finish)})]}),e.car&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:w(e.car)})]})]}),l("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[l(I,{href:e.href||"/wheels",onClick:()=>h(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),l(I,{href:x,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),l(I,{href:g,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!B&&r(Ie,{build:e})]})})]})}function ne(t){return[t.process,t.car,t.finish].filter((o,n,c)=>!!o&&o!==t.wheel&&c.indexOf(o)===n)}function ze(t){return!!t.wheel||ne(t).length>0}function H(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function Ie({build:t}){const o=t.wheel,n=ne(t);return l("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:oe(o,!1)}),n.map(c=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:w(c)},c))]})}const Ae=360,je="120px";function He({build:t,set:o,index:n,onPick:c,onPrev:i,onNext:a,onLeave:v}){const x=o[n]??t.imageSrc??"",g="absolute top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg bg-bg text-lg text-fg max-view-wide:hidden";return l("div",{onClick:f=>f.stopPropagation(),className:"grid h-full w-full grid-cols-[1fr_360px] bg-bg text-fg max-view-wide:grid-cols-1 max-view-wide:grid-rows-[auto_1fr] max-view-wide:overflow-auto",children:[l("div",{className:"relative grid min-h-0 place-items-center bg-surface-2 py-12 max-view-wide:p-0",children:[x&&r("img",{...A(x,{fallbackWidth:1280}),sizes:`(max-width: ${he}px) 100vw, calc(100vw - ${Ae}px)`,alt:`${t.car||t.wheel||"Photo"} — ${n+1} of ${o.length}`,className:"block max-h-[calc(100vh-96px)] max-w-[calc(100%-192px)] max-view-wide:max-h-[60vh] max-view-wide:max-w-full"},x),i&&r("button",{type:"button","aria-label":"Previous photo",onClick:i,className:`${g} left-6`,children:"‹"}),a&&r("button",{type:"button","aria-label":"Next photo",onClick:a,className:`${g} right-6`,children:"›"})]}),l("div",{"data-gallery-set-side":"",className:"flex min-h-0 flex-col overflow-auto p-8 max-view-wide:px-4 max-view-wide:py-5",children:[r(re,{label:"Close popup",className:"flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center self-end border border-fg bg-bg text-lg text-fg max-view-wide:fixed max-view-wide:right-3 max-view-wide:top-3 max-view-wide:z-5",children:"✕"}),t.wheel&&r("div",{className:"mt-10 text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-fg-dim max-view-wide:mt-0",children:t.wheel}),t.car&&r("div",{className:"mt-2 mb-2 text-2xl leading-normal",children:t.car}),l("div",{className:"text-xs leading-normal text-fg-dim",children:[n+1," / ",o.length]}),o.length>1&&r("div",{className:"mt-8 grid grid-cols-3 gap-2 max-view-wide:grid-cols-5",children:o.map((f,p)=>r("button",{type:"button","data-gallery-set-thumb":"","aria-label":`Show photo ${p+1}`,"aria-current":p===n?"true":void 0,onClick:()=>c(p),className:`block cursor-pointer p-0 ${p===n?"opacity-100 outline outline-1 outline-offset-2 outline-fg":"opacity-50"}`,children:r("img",{...A(f,{fallbackWidth:320,maxWidth:640}),sizes:je,alt:"",loading:"lazy",className:"block aspect-[4/3] w-full object-cover"})},`${f}-${p}`))}),t.wheel&&t.href&&l(fe,{href:t.href,onClick:v,className:"mt-auto inline-block self-start border border-fg px-8 py-3 text-xs text-fg max-view-wide:mt-6",children:["See ",t.wheel]})]})]})}export{Te as GALLERY_GRID_ATTR,rt as GALLERY_ITEM_HINTS,ot as GALLERY_ITEM_SEEDS,j as GALLERY_TILE_ATTR,tt as GALLERY_TILE_PARTS,Ce as GalleryLinksContext,Le as GalleryTilesContext,Pe as default};
@@ -23,5 +23,6 @@ export interface WallSpan {
23
23
  rowPhone: number;
24
24
  }
25
25
  export declare function wallSpanAt(layout: GalleryLayout, at: number, count: number): WallSpan;
26
+ export declare function wallTileSizes(layout: GalleryLayout, at: number, count: number): string;
26
27
  export declare const WALL_PLACED_CELL = "sf-wall-placed";
27
28
  export declare const WALL_PLACED_CSS: string;
@@ -1 +1 @@
1
- import{galleryCellAt as a}from"efficient-web-builder/format/lib/content/gallery-layout";const u=["newest","name"],f={newest:"Newest",name:"Name A–Z"},w={tag:null,sort:"newest"};function i(n){const r=[];for(const o of n){const t=o.tag.trim();t&&!r.includes(t)&&r.push(t)}return r}function s(n,r){return n!==null&&i(r).includes(n)?n:null}function L(n,r){return s(n.tag,r)===null&&n.sort==="newest"}function g(n,r){const o=s(r.tag,n),t=o===null?[...n]:n.filter(e=>e.tag.trim()===o);return r.sort==="name"&&t.sort((e,l)=>e.name.localeCompare(l.name)),t.map(e=>e.id)}function d(n,r,o){const[t,e]=a(n,!1,r,o),[l,c]=a(n,!0,r,o);return{col:t,row:e,colPhone:l,rowPhone:c}}const p="sf-wall-placed",x=`.${p}{grid-column:span var(--sf-wall-c) !important;grid-row:span var(--sf-wall-r) !important}@media (max-width:800px){.${p}{grid-column:span var(--sf-wall-cp) !important;grid-row:span var(--sf-wall-rp) !important}}`;export{w as EMPTY_GALLERY_TOOLBAR,u as GALLERY_SORT_KEYS,f as GALLERY_SORT_LABELS,p as WALL_PLACED_CELL,x as WALL_PLACED_CSS,s as clampGalleryTag,g as galleryShownIds,i as galleryTags,L as galleryToolbarIdle,d as wallSpanAt};
1
+ import{GALLERY_COLUMNS as L,GALLERY_COLUMNS_PHONE as m,GALLERY_PHONE_BREAKPOINT as u,galleryCellAt as a}from"efficient-web-builder/format/lib/content/gallery-layout";const g=["newest","name"],x={newest:"Newest",name:"Name A–Z"},E={tag:null,sort:"newest"};function w(n){const t=[];for(const o of n){const r=o.tag.trim();r&&!t.includes(r)&&t.push(r)}return t}function s(n,t){return n!==null&&w(t).includes(n)?n:null}function _(n,t){return s(n.tag,t)===null&&n.sort==="newest"}function d(n,t){const o=s(t.tag,n),r=o===null?[...n]:n.filter(e=>e.tag.trim()===o);return t.sort==="name"&&r.sort((e,l)=>e.name.localeCompare(l.name)),r.map(e=>e.id)}function f(n,t,o){const[r,e]=a(n,!1,t,o),[l,i]=a(n,!0,t,o);return{col:r,row:e,colPhone:l,rowPhone:i}}const c=(n,t)=>`${Math.ceil(n*100/t)}vw`;function S(n,t,o){const r=f(n,t,o);return`(max-width: ${u}px) ${c(r.colPhone,m)}, ${c(r.col,L)}`}const p="sf-wall-placed",R=`.${p}{grid-column:span var(--sf-wall-c) !important;grid-row:span var(--sf-wall-r) !important}@media (max-width:800px){.${p}{grid-column:span var(--sf-wall-cp) !important;grid-row:span var(--sf-wall-rp) !important}}`;export{E as EMPTY_GALLERY_TOOLBAR,g as GALLERY_SORT_KEYS,x as GALLERY_SORT_LABELS,p as WALL_PLACED_CELL,R as WALL_PLACED_CSS,s as clampGalleryTag,d as galleryShownIds,w as galleryTags,_ as galleryToolbarIdle,f as wallSpanAt,S as wallTileSizes};