efficient-storefront-blocks 0.70.0 → 0.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/chunks/EditorPreviewCheckout-27GNLSNR.js +4 -0
  3. package/dist/chunks/{SiteEditorProvider-3GKJZDL5.js → SiteEditorProvider-N4T55FAV.js} +1 -1
  4. package/dist/chunks/chunk-3TBLX25X.js +1 -0
  5. package/dist/chunks/chunk-4V6BLJSG.js +1 -0
  6. package/dist/chunks/{chunk-QWHNN7GF.js → chunk-K26JUDGZ.js} +1 -1
  7. package/dist/chunks/chunk-SJODSVWU.js +1 -0
  8. package/dist/chunks/chunk-WPHE7RI4.js +246 -0
  9. package/dist/chunks/{fitment-data-6GK7QQQI.js → fitment-data-5ZSHENM3.js} +1 -1
  10. package/dist/contract.js +2 -2
  11. package/dist/editor/components/CategorySource.js +1 -1
  12. package/dist/editor/components/HeaderSettingsPanel.js +1 -1
  13. package/dist/editor/components/PreviewHeader.d.ts +0 -1
  14. package/dist/editor/components/PreviewHeader.js +1 -11
  15. package/dist/editor/lib/document/blocks/service/ContactCards/fields.d.ts +2 -0
  16. package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -0
  17. package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
  18. package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.d.ts +2 -0
  19. package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.js +1 -0
  20. package/dist/editor/lib/document/blocks/service/FooterPayment/fields.d.ts +2 -0
  21. package/dist/editor/lib/document/blocks/service/FooterPayment/fields.js +1 -0
  22. package/dist/editor/lib/document/blocks/service/MessagingCards/fields.d.ts +2 -0
  23. package/dist/editor/lib/document/blocks/service/MessagingCards/fields.js +1 -0
  24. package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
  25. package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
  26. package/dist/editor/lib/document/blocks/service/index.js +1 -1
  27. package/dist/editor/lib/document/config.d.ts +2 -0
  28. package/dist/editor/lib/document/config.js +1 -1
  29. package/dist/editor/lib/efficient-backend.js +1 -1
  30. package/dist/editor/lib/efficient-block-sources.js +1 -1
  31. package/dist/editor/lib/header-settings-source.d.ts +2 -1
  32. package/dist/editor/lib/header-settings-source.js +1 -1
  33. package/dist/editor/lib/storefront-editor-words.d.ts +19 -5
  34. package/dist/editor/lib/storefront-editor-words.js +1 -1
  35. package/dist/editor.css +1 -1
  36. package/dist/index.d.ts +0 -2
  37. package/dist/index.js +296 -200
  38. package/dist/links.d.ts +0 -2
  39. package/dist/links.js +1 -1
  40. package/dist/render/built-with.json +1 -1
  41. package/dist/render/components/CartContext.d.ts +3 -0
  42. package/dist/render/components/CartContext.js +1 -1
  43. package/dist/render/components/ChatLauncher.js +1 -1
  44. package/dist/render/components/ContactCards.d.ts +13 -0
  45. package/dist/render/components/ContactCards.js +1 -0
  46. package/dist/render/components/CopyText.d.ts +4 -0
  47. package/dist/render/components/CopyText.js +1 -0
  48. package/dist/render/components/Events.d.ts +3 -0
  49. package/dist/render/components/Events.js +1 -1
  50. package/dist/render/components/FooterMessaging.d.ts +5 -0
  51. package/dist/render/components/FooterMessaging.js +1 -0
  52. package/dist/render/components/FooterPayment.d.ts +11 -0
  53. package/dist/render/components/FooterPayment.js +1 -0
  54. package/dist/render/components/GalleryItem.js +1 -1
  55. package/dist/render/components/GalleryShowcase.js +1 -1
  56. package/dist/render/components/Header.d.ts +2 -1
  57. package/dist/render/components/Header.js +1 -1
  58. package/dist/render/components/HeaderCallButton.d.ts +9 -0
  59. package/dist/render/components/HeaderCallButton.js +1 -0
  60. package/dist/render/components/HeaderToolBlocks.d.ts +1 -2
  61. package/dist/render/components/HeaderToolBlocks.js +1 -1
  62. package/dist/render/components/MessagingCards.d.ts +9 -0
  63. package/dist/render/components/MessagingCards.js +1 -0
  64. package/dist/render/components/QrCode.d.ts +5 -0
  65. package/dist/render/components/QrCode.js +1 -0
  66. package/dist/render/components/Reviews.d.ts +14 -4
  67. package/dist/render/components/Reviews.js +1 -1
  68. package/dist/render/components/SectionGroupBody.js +1 -1
  69. package/dist/render/components/checkout/CheckoutPageClient.d.ts +2 -25
  70. package/dist/render/components/checkout/CheckoutPageClient.js +1 -3
  71. package/dist/render/components/checkout/checkout-parts.d.ts +5 -0
  72. package/dist/render/components/checkout/checkout-parts.js +1 -0
  73. package/dist/render/components/checkout/checkout-state.d.ts +174 -0
  74. package/dist/render/components/checkout/checkout-state.js +3 -0
  75. package/dist/render/lib/api/index.d.ts +1 -8
  76. package/dist/render/lib/api/index.js +1 -1
  77. package/dist/render/lib/api/types.d.ts +10 -3
  78. package/dist/render/lib/content/site.d.ts +1 -1
  79. package/dist/render/lib/document/blocks/commerce/CountrySwitchBlock/render.js +1 -1
  80. package/dist/render/lib/document/blocks/service/ContactCards/meta.d.ts +7 -0
  81. package/dist/render/lib/document/blocks/service/ContactCards/meta.js +1 -0
  82. package/dist/render/lib/document/blocks/service/ContactCards/render.d.ts +4 -0
  83. package/dist/render/lib/document/blocks/service/ContactCards/render.js +1 -0
  84. package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
  85. package/dist/render/lib/document/blocks/service/Footer/meta.js +1 -1
  86. package/dist/render/lib/document/blocks/service/FooterGroup/meta.js +1 -1
  87. package/dist/render/lib/document/blocks/service/FooterMessaging/meta.d.ts +2 -0
  88. package/dist/render/lib/document/blocks/service/FooterMessaging/meta.js +1 -0
  89. package/dist/render/lib/document/blocks/service/FooterMessaging/render.d.ts +2 -0
  90. package/dist/render/lib/document/blocks/service/FooterMessaging/render.js +1 -0
  91. package/dist/render/lib/document/blocks/service/FooterPayment/meta.d.ts +3 -0
  92. package/dist/render/lib/document/blocks/service/FooterPayment/meta.js +1 -0
  93. package/dist/render/lib/document/blocks/service/FooterPayment/render.d.ts +2 -0
  94. package/dist/render/lib/document/blocks/service/FooterPayment/render.js +1 -0
  95. package/dist/render/lib/document/blocks/service/MessagingCards/meta.d.ts +2 -0
  96. package/dist/render/lib/document/blocks/service/MessagingCards/meta.js +1 -0
  97. package/dist/render/lib/document/blocks/service/MessagingCards/render.d.ts +4 -0
  98. package/dist/render/lib/document/blocks/service/MessagingCards/render.js +1 -0
  99. package/dist/render/lib/document/blocks/service/Reviews/meta.d.ts +6 -0
  100. package/dist/render/lib/document/blocks/service/Reviews/meta.js +1 -1
  101. package/dist/render/lib/document/blocks/service/Reviews/render.js +1 -1
  102. package/dist/render/lib/document/blocks/service/metas.d.ts +4 -0
  103. package/dist/render/lib/document/blocks/service/metas.js +1 -1
  104. package/dist/render/lib/document/blocks/service/renders.d.ts +4 -0
  105. package/dist/render/lib/document/blocks/service/renders.js +1 -1
  106. package/dist/render/lib/document/blocks/text-part-shapes.json +137 -6
  107. package/dist/render/lib/document/card-templates.d.ts +2 -0
  108. package/dist/render/lib/document/card-templates.js +1 -0
  109. package/dist/render/lib/document/footer-page-blocks.d.ts +1 -0
  110. package/dist/render/lib/document/footer-page-blocks.js +1 -1
  111. package/dist/render/lib/document/lazy-draws.js +1 -1
  112. package/dist/render/lib/document/render-config.d.ts +2 -0
  113. package/dist/render/lib/document/render-config.js +1 -1
  114. package/dist/render/lib/document/section-to-box-rows-reviews.d.ts +1 -0
  115. package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -0
  116. package/dist/render/lib/links/link-rules.d.ts +1 -1
  117. package/dist/render/lib/links/link-rules.js +1 -1
  118. package/dist/render/lib/qr.d.ts +5 -0
  119. package/dist/render/lib/qr.js +1 -0
  120. package/dist/render/lib/sections/messaging.d.ts +45 -0
  121. package/dist/render/lib/sections/messaging.js +1 -0
  122. package/dist/render/lib/sections/reviews.d.ts +1 -0
  123. package/dist/render/lib/sections/reviews.js +1 -0
  124. package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
  125. package/dist/render/lib/wheels/collections.js +1 -1
  126. package/dist/words.d.ts +42 -10
  127. package/dist/words.js +4 -4
  128. package/package.json +7 -4
  129. package/dist/chunks/EditorPreviewCheckout-XI4VULPL.js +0 -4
  130. package/dist/chunks/chunk-RPLNV3WM.js +0 -1
  131. package/dist/chunks/chunk-SQH6XBRG.js +0 -1
  132. package/dist/chunks/chunk-TXTTPEQA.js +0 -1
  133. package/dist/chunks/chunk-XF2ZAVNU.js +0 -262
  134. package/dist/render/components/useStorefrontReviews.d.ts +0 -2
  135. package/dist/render/components/useStorefrontReviews.js +0 -1
  136. /package/dist/chunks/{chunk-XF2ZAVNU.js.LEGAL.txt → chunk-WPHE7RI4.js.LEGAL.txt} +0 -0
package/dist/links.d.ts CHANGED
@@ -26,8 +26,6 @@ export function postPath(slug: string): string;
26
26
  export function wheelPath(slug: string): string;
27
27
  /** A section anchor on a page: the page's path and `#<hash>`. */
28
28
  export function anchorPath(pageSlug: string, hash: string): string;
29
- /** Anchor name → URL hash id, exactly as the page renders it. */
30
- export function slugifyAnchor(name: string): string;
31
29
  /** The section anchors across a page's documents (published, then draft), in
32
30
  * order, each slug once. */
33
31
  export function pageAnchors(...docs: unknown[]): { slug: string; name: string }[];
package/dist/links.js CHANGED
@@ -1 +1 @@
1
- var h={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 ze={bold:h.bold.placeholder,italic:h.italic.placeholder,strike:h.strike.placeholder,code:h.code.placeholder,highlight:h.highlight.placeholder,quiet:h.quiet.placeholder,link:"link text",underline:h.underline.placeholder,sup:h.sup.placeholder,sub:h.sub.placeholder,color:"colored text"};var Q=[{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 x=[{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}],X=["highlight","quiet"],Ue=Q.map(e=>e.style).filter(e=>x.some(n=>n.kind===e)).filter(e=>!X.includes(e)),De=[...x,{open:"*",close:"*",kind:"accent"}],$e=[...x,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var Be=["http","https","mailto","tel"];function v(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||Be.includes(n[1].toLowerCase())}var J=["width","profile","rim"];var We=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Ge={width:[100,500],profile:[20,100],rim:[10,30]};function M(e){let n=We.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return J.every(i=>{let[a,u]=Ge[i];return t[i]>=a&&t[i]<=u})?t:null}function L(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let n=`${e.width}/${e.profile}`;return e.rim==null?n:`${n} R${e.rim}`}function ee(e){return[L({width:e.width}),L({width:e.width,profile:e.profile}),L(e)]}var S=["alloy-wheel","tyre"],ne=["alloy-wheel"],w={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Hn=S.map(e=>({value:e,label:w[e]}));function z(e){return e==null?[...ne]:Array.isArray(e)?S.filter(n=>e.includes(n)):[...ne]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function U(e){return m(e).brand??""}function te(e){return m(e).prices??void 0}function re(e){return m(e).inStock!==!1}function ie(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function D(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function oe(e){return D(e).map(n=>n.family)}function le(e){if(f(e)==="tyre")return[];let n=m(e),t=n.categories;return t&&t.length>0?t:n.process?[n.process]:[]}function se(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function ae(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ue(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function ce(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>M(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var pe=null;function de(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(n,r)?String(n[r]):t):e}function y(e,n){let t=pe?pe[e]:void 0;if(typeof t=="function"){try{let r=t(n??{});if(typeof r=="string"&&r)return r}catch{}return de(e,n)}return de(typeof t=="string"&&t?t:e,n)}var fe="homepage";function me(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}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 T(e){return e.offersCommerce&&e.offersService?F:F.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var $="#popup:";function ge(e){return`${$}${e}`}function he(e){return e.startsWith($)&&e.slice($.length).trim()||null}function P(e){return e===fe?"/":`/${e}`}function _(e){return`/journal/${e}`}function A(e){return`/wheels/${e}`}function R(e,n){return`${P(e)}#${n}`}function B(e){return me(e)}function Ye(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function E(...e){let n=new Set,t=[];for(let r of e)for(let i of r?.content??[]){let a=Ye(i?.props?.anchor);if(!a)continue;let u=B(a);!u||n.has(u)||(n.add(u),t.push({slug:u,name:a}))}return t}function ye(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var qe=()=>({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 I(e,n,t){if(!e)return"page";if(he(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(ye(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||n.includes(r))return"anchor"}return e==="/"||n.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function Pe(e,n){let t=qe(),r=e.pages.map(l=>({value:P(l.slug),label:l.title})),i=n?.pageOptions?n.pageOptions(r):r,a=i.map(l=>l.value),u=e.pages.map(l=>({label:l.title,options:E(...l.docs).map(c=>({value:R(l.slug,c.slug),label:c.name}))})).filter(l=>l.options.length>0),p=l=>{switch(l){case"page":return{type:"select",options:i,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:u,placeholder:u.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(c=>({value:_(c.slug),label:c.title||c.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(c=>({value:c.href,label:c.name||c.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(c=>({value:ge(c.slug),label:c.title||c.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},s=T(e.offers).map(l=>({value:l.value,label:y(l.label),target:p(l.value),...l.value==="anchor"?{hint:t.sectionHint}:{},...l.value==="blog"||l.value==="product"||l.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:s,rules:{kindOf:l=>I(l,a),targetOf:l=>l,readFilter:()=>null,withFilter:l=>l}};let o=l=>{let c=n.withFilter(l,null);return n.listingPaths.includes(c)?c:l};return{kinds:s,rules:{kindOf:l=>I(l,a,{listingPaths:n.listingPaths,targetOf:o}),targetOf:o,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:l=>n.listingPaths.includes(l)?n.filtersFor(l):null}}function W(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function be(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let i of e){let a=i[t];if(typeof a!="number"||!Number.isFinite(a))continue;let u=r.get(i.fieldKey);(u===void 0||a<u)&&r.set(i.fieldKey,a)}return i=>i?r.get(i):void 0}function Se(e,n,t,r){let i=new Map;for(let s of t){let o=s[r];typeof o=="number"&&i.set(s.fieldKey,o)}if(i.size===0)return e;let a=[],u=[];e.forEach((s,o)=>{let l=n(s);l&&(a.push(o),u.push({item:s,index:o,order:i.get(l)}))}),u.sort((s,o)=>s.order!==void 0&&o.order!==void 0?s.order-o.order||s.index-o.index:s.order!==void 0?-1:o.order!==void 0?1:s.index-o.index);let p=[...e];return a.forEach((s,o)=>{p[s]=u[o].item}),p.every((s,o)=>s===e[o])?e:p}function ke(e){return je(e,"filter")}var He="collection";function G(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":He},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function je(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}function Ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xe(e,n){let t=e?.[n];return Ze(t)?t:null}function Le(e,n,t,r){if(t==null&&r==null)return!0;let i=xe(e,n);return!(i===null||t!=null&&i<t||r!=null&&i>r)}var Ve={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},_t=Object.keys(Ve);var we=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Qe={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Xe={diameters:"tyreSizes"};function Je(e){if(e.length===0)return[];let n=we.filter(t=>e.every(r=>Qe[t].includes(r)));return n.filter(t=>{let r=Xe[t];return!r||!n.includes(r)})}function en(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var Fe={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function nn(e,n,t,r=null){if(r!=="kind"&&n.kind&&f(e)!==n.kind)return!1;for(let i of we){if(r===i)continue;let a=n[i];if(a.length===0)continue;let u=a.map(String);if(!Te(e,i).some(p=>u.includes(p)))return!1}return!(r!=="price"&&!Le(te(e),t,null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!re(e))}var tn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Te(e,n){switch(n){case"tyreSizes":return[...new Set(ce(e).flatMap(ee))];case"brands":return U(e)?[U(e)]:[];case"finishes":return oe(e);case"diameters":return ie(e).map(String);case"collections":return le(e);case"pcds":return se(e);case"tyreTypes":return ae(e);case"speedRatings":return ue(e)}}function rn(e){let n=new Map;for(let t of e)for(let r of D(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function _e(e,n,t,r=en(e),i=[]){let a=o=>ln(o,r,i),u=rn(e),p=Je(r).filter(o=>o!=="tyreSizes").filter(a).map(o=>{let l=n[o].map(String),c=new Set,N=new Map,k=new Map;for(let d of e){let b=Te(d,o);for(let g of b)c.add(g);for(let g of new Set(b))k.set(g,(k.get(g)??0)+1);if(nn(d,n,t,o))for(let g of new Set(b))N.set(g,(N.get(g)??0)+1)}let Me=[...c].map(d=>({value:d,label:o==="diameters"?`${d}\u2033`:d,count:N.get(d)??0,checked:l.includes(d),swatch:o==="finishes"?u.get(d)??null:null})).sort((d,b)=>{if(o==="diameters")return Number(d.value)-Number(b.value);let g=(k.get(b.value)??0)-(k.get(d.value)??0);return g!==0?g:d.value.localeCompare(b.value)});return{key:o,label:tn[o],options:Me}}).filter(o=>o.options.length>on),s=[];for(let o of p){let l=sn(o.key,r,i);l!==void 0&&s.push({fieldKey:o.key,filterOrder:l})}return[...Se(p,o=>o.key,s,"filterOrder")]}var on=1;function Ae(e){return e.showCollection===!1?["collections"]:[]}function ln(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>ke(W(t,r))(G(e,r)))}function sn(e,n,t){if(t.length===0)return;let r;for(let i of n){let a=be(W(t,i),"filter")(G(e,i));a!==void 0&&(r===void 0||a<r)&&(r=a)}return r}var Y={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},q="type";var Re="AlloyWheelsListing";function Ee(e){return v(e.trim())}var C="/wheels",K="Products";function Ie(e,n){return n>1?`${K} \xB7 ${e}`:K}function H(...e){for(let n of e){let t=(n?.content??[]).find(r=>r?.type===Re);if(t)return t.props??{}}return null}function O(...e){return H(...e)!==null}function Ce(e,n){let t=e.filter(r=>O(...r.docs)).map(r=>P(r.slug));return t.length===0&&n.fallback?[C]:t}var j=[q,...Object.entries(Y).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Ke(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),i=r.indexOf("?");return{path:i===-1?r:r.slice(0,i),query:i===-1?"":r.slice(i+1),hash:t}}function an(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Oe(e){let n=new URLSearchParams(Ke(e).query);for(let t of j){let r=n.get(t);if(r)return{param:t,value:r}}return null}function Z(e,n){let{path:t,query:r,hash:i}=Ke(e),a=r.split("&").filter(u=>u&&!j.includes(an(u.split("=")[0])));return n?.value&&a.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${a.length?`?${a.join("&")}`:""}${i}`}function Ne(e,n){let t=Z(e,null);return n.includes(t)?t:e}function un(e,n,t=[]){return I(e,n,{listingPaths:t,targetOf:r=>Ne(r,t)})}function cn(e){return Array.isArray(e)?e.filter(n=>typeof n?.kind=="string"&&typeof n.field_key=="string").map(n=>({kind:n.kind,fieldKey:n.field_key,...typeof n.filter=="boolean"?{filter:n.filter}:{},filterOrder:n.filter_order??null})):[]}var ve="Product type",pn="AUD";function V(e,n){let t=n.listing??{},r=z(t.kinds),i=e.filter(s=>r.includes(f(s))),a=Ae(t),u=_e(i,Fe,pn,r,n.fieldUsage).filter(s=>!a.includes(s.key)).map(s=>({param:Y[s.key],label:s.label,values:s.options.filter(o=>!o.value.includes(",")).map(o=>({value:o.value,label:o.label}))})).filter(s=>s.values.length>0),p=S.filter(s=>r.includes(s)&&i.some(o=>f(o)===s));return p.length>1&&u.unshift({param:q,label:ve,values:p.map(s=>({value:s,label:w[s]}))}),u}function dn(e){return n=>{let t=Ce(n,{fallback:e.offersCommerce}),r=n.filter(i=>O(...i.docs)).length;return{listingPaths:t,pageOptions:i=>{let a=i.map(u=>{let p=n.find(s=>P(s.slug)===u.value);return p&&O(...p.docs)?{...u,label:Ie(p.title,r)}:u});return r===0&&e.offersCommerce&&!a.some(u=>u.value===C)&&a.push({value:C,label:K}),a},filtersFor:i=>{if(!t.includes(i))return null;let a=n.find(u=>P(u.slug)===i);return V(e.catalogue,{listing:a?H(...a.docs):null,fieldUsage:e.fieldUsage})},readFilter:Oe,withFilter:Z}}}function fn(e){let n=dn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Pe({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:A(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ee},filtersFor:t.filtersFor??(()=>null)}}function Yt(e,n){return V(e,n)}export{C as BUILT_IN_LISTING_PATH,F as LINK_KINDS,j as LISTING_FILTER_PARAMS,K as LISTING_PAGE_LABEL,ve as PRODUCT_TYPE_FILTER_LABEL,R as anchorPath,cn as fieldUsageFromAdminRows,un as inferLinkKind,O as isProductListingPage,Ee as isSafeLink,T as linkKindsFor,fn as linkPickerSetup,Yt as listingFilterFields,H as listingNode,Ie as listingPageLabel,Ne as listingTarget,E as pageAnchors,P as pagePath,_ as postPath,Ce as productListingPaths,Oe as readListingFilter,B as slugifyAnchor,A as wheelPath,Z 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 De={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"};var X=[{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 x=[{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}],J=["highlight","quiet"],Ue=X.map(e=>e.style).filter(e=>x.some(n=>n.kind===e)).filter(e=>!J.includes(e)),ze=[...x,{open:"*",close:"*",kind:"accent"}],$e=[...x,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var Be=["http","https","mailto","tel"];function M(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||Be.includes(n[1].toLowerCase())}var ee=["width","profile","rim"];var We=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Ge={width:[100,500],profile:[20,100],rim:[10,30]};function v(e){let n=We.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return ee.every(i=>{let[a,u]=Ge[i];return t[i]>=a&&t[i]<=u})?t:null}function w(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let n=`${e.width}/${e.profile}`;return e.rim==null?n:`${n} R${e.rim}`}function ne(e){return[w({width:e.width}),w({width:e.width,profile:e.profile}),w(e)]}var S=["alloy-wheel","tyre"],te=["alloy-wheel"],L={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Hn=S.map(e=>({value:e,label:L[e]}));function D(e){return e==null?[...te]:Array.isArray(e)?S.filter(n=>e.includes(n)):[...te]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function U(e){return m(e).brand??""}function re(e){return m(e).prices??void 0}function ie(e){return m(e).inStock!==!1}function oe(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function z(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function le(e){return z(e).map(n=>n.family)}function se(e){if(f(e)==="tyre")return[];let n=m(e),t=n.categories;return t&&t.length>0?t:n.process?[n.process]:[]}function ae(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function ue(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ce(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function pe(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>v(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var $=e=>typeof e=="string"&&e?e:void 0;var de=null;function fe(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(n,r)?String(n[r]):t):e}function y(e,n){let t=de?de[e]:void 0;if(typeof t=="function"){try{let r=$(t(n??{}));if(r)return r}catch{}return fe(e,n)}return fe($(t)??e,n)}var me="homepage";function B(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}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 T(e){return e.offersCommerce&&e.offersService?F:F.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var W="#popup:";function he(e){return`${W}${e}`}function ge(e){return e.startsWith(W)&&e.slice(W.length).trim()||null}function P(e){return e===me?"/":`/${e}`}function _(e){return`/journal/${e}`}function A(e){return`/wheels/${e}`}function R(e,n){return`${P(e)}#${n}`}function Ye(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function E(...e){let n=new Set,t=[];for(let r of e)for(let i of r?.content??[]){let a=Ye(i?.props?.anchor);if(!a)continue;let u=B(a);!u||n.has(u)||(n.add(u),t.push({slug:u,name:a}))}return t}function ye(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var qe=()=>({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 I(e,n,t){if(!e)return"page";if(ge(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(ye(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||n.includes(r))return"anchor"}return e==="/"||n.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function Pe(e,n){let t=qe(),r=e.pages.map(l=>({value:P(l.slug),label:l.title})),i=n?.pageOptions?n.pageOptions(r):r,a=i.map(l=>l.value),u=e.pages.map(l=>({label:l.title,options:E(...l.docs).map(c=>({value:R(l.slug,c.slug),label:c.name}))})).filter(l=>l.options.length>0),p=l=>{switch(l){case"page":return{type:"select",options:i,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:u,placeholder:u.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(c=>({value:_(c.slug),label:c.title||c.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(c=>({value:c.href,label:c.name||c.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(c=>({value:he(c.slug),label:c.title||c.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},s=T(e.offers).map(l=>({value:l.value,label:y(l.label),target:p(l.value),...l.value==="anchor"?{hint:t.sectionHint}:{},...l.value==="blog"||l.value==="product"||l.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:s,rules:{kindOf:l=>I(l,a),targetOf:l=>l,readFilter:()=>null,withFilter:l=>l}};let o=l=>{let c=n.withFilter(l,null);return n.listingPaths.includes(c)?c:l};return{kinds:s,rules:{kindOf:l=>I(l,a,{listingPaths:n.listingPaths,targetOf:o}),targetOf:o,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:l=>n.listingPaths.includes(l)?n.filtersFor(l):null}}function G(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function be(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let i of e){let a=i[t];if(typeof a!="number"||!Number.isFinite(a))continue;let u=r.get(i.fieldKey);(u===void 0||a<u)&&r.set(i.fieldKey,a)}return i=>i?r.get(i):void 0}function Se(e,n,t,r){let i=new Map;for(let s of t){let o=s[r];typeof o=="number"&&i.set(s.fieldKey,o)}if(i.size===0)return e;let a=[],u=[];e.forEach((s,o)=>{let l=n(s);l&&(a.push(o),u.push({item:s,index:o,order:i.get(l)}))}),u.sort((s,o)=>s.order!==void 0&&o.order!==void 0?s.order-o.order||s.index-o.index:s.order!==void 0?-1:o.order!==void 0?1:s.index-o.index);let p=[...e];return a.forEach((s,o)=>{p[s]=u[o].item}),p.every((s,o)=>s===e[o])?e:p}function ke(e){return je(e,"filter")}var He="collection";function Y(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":He},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function je(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}function Ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xe(e,n){let t=e?.[n];return Ze(t)?t:null}function we(e,n,t,r){if(t==null&&r==null)return!0;let i=xe(e,n);return!(i===null||t!=null&&i<t||r!=null&&i>r)}var Ve={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},It=Object.keys(Ve);var Le=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Qe={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Xe={diameters:"tyreSizes"};function Je(e){if(e.length===0)return[];let n=Le.filter(t=>e.every(r=>Qe[t].includes(r)));return n.filter(t=>{let r=Xe[t];return!r||!n.includes(r)})}function en(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var Fe={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function nn(e,n,t,r=null){if(r!=="kind"&&n.kind&&f(e)!==n.kind)return!1;for(let i of Le){if(r===i)continue;let a=n[i];if(a.length===0)continue;let u=a.map(String);if(!Te(e,i).some(p=>u.includes(p)))return!1}return!(r!=="price"&&!we(re(e),t,null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!ie(e))}var tn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Te(e,n){switch(n){case"tyreSizes":return[...new Set(pe(e).flatMap(ne))];case"brands":return U(e)?[U(e)]:[];case"finishes":return le(e);case"diameters":return oe(e).map(String);case"collections":return se(e);case"pcds":return ae(e);case"tyreTypes":return ue(e);case"speedRatings":return ce(e)}}function rn(e){let n=new Map;for(let t of e)for(let r of z(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function _e(e,n,t,r=en(e),i=[]){let a=o=>ln(o,r,i),u=rn(e),p=Je(r).filter(o=>o!=="tyreSizes").filter(a).map(o=>{let l=n[o].map(String),c=new Set,N=new Map,k=new Map;for(let d of e){let b=Te(d,o);for(let h of b)c.add(h);for(let h of new Set(b))k.set(h,(k.get(h)??0)+1);if(nn(d,n,t,o))for(let h of new Set(b))N.set(h,(N.get(h)??0)+1)}let ve=[...c].map(d=>({value:d,label:o==="diameters"?`${d}\u2033`:d,count:N.get(d)??0,checked:l.includes(d),swatch:o==="finishes"?u.get(d)??null:null})).sort((d,b)=>{if(o==="diameters")return Number(d.value)-Number(b.value);let h=(k.get(b.value)??0)-(k.get(d.value)??0);return h!==0?h:d.value.localeCompare(b.value)});return{key:o,label:tn[o],options:ve}}).filter(o=>o.options.length>on),s=[];for(let o of p){let l=sn(o.key,r,i);l!==void 0&&s.push({fieldKey:o.key,filterOrder:l})}return[...Se(p,o=>o.key,s,"filterOrder")]}var on=1;function Ae(e){return e.showCollection===!1?["collections"]:[]}function ln(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>ke(G(t,r))(Y(e,r)))}function sn(e,n,t){if(t.length===0)return;let r;for(let i of n){let a=be(G(t,i),"filter")(Y(e,i));a!==void 0&&(r===void 0||a<r)&&(r=a)}return r}var q={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},H="type";var Re="AlloyWheelsListing";function Ee(e){return M(e.trim())}var C="/wheels",O="Products";function Ie(e,n){return n>1?`${O} \xB7 ${e}`:O}function j(...e){for(let n of e){let t=(n?.content??[]).find(r=>r?.type===Re);if(t)return t.props??{}}return null}function K(...e){return j(...e)!==null}function Ce(e,n){let t=e.filter(r=>K(...r.docs)).map(r=>P(r.slug));return t.length===0&&n.fallback?[C]:t}var Z=[H,...Object.entries(q).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Oe(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),i=r.indexOf("?");return{path:i===-1?r:r.slice(0,i),query:i===-1?"":r.slice(i+1),hash:t}}function an(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ke(e){let n=new URLSearchParams(Oe(e).query);for(let t of Z){let r=n.get(t);if(r)return{param:t,value:r}}return null}function V(e,n){let{path:t,query:r,hash:i}=Oe(e),a=r.split("&").filter(u=>u&&!Z.includes(an(u.split("=")[0])));return n?.value&&a.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${a.length?`?${a.join("&")}`:""}${i}`}function Ne(e,n){let t=V(e,null);return n.includes(t)?t:e}function un(e,n,t=[]){return I(e,n,{listingPaths:t,targetOf:r=>Ne(r,t)})}function cn(e){return Array.isArray(e)?e.filter(n=>typeof n?.kind=="string"&&typeof n.field_key=="string").map(n=>({kind:n.kind,fieldKey:n.field_key,...typeof n.filter=="boolean"?{filter:n.filter}:{},filterOrder:n.filter_order??null})):[]}var Me="Product type",pn="AUD";function Q(e,n){let t=n.listing??{},r=D(t.kinds),i=e.filter(s=>r.includes(f(s))),a=Ae(t),u=_e(i,Fe,pn,r,n.fieldUsage).filter(s=>!a.includes(s.key)).map(s=>({param:q[s.key],label:s.label,values:s.options.filter(o=>!o.value.includes(",")).map(o=>({value:o.value,label:o.label}))})).filter(s=>s.values.length>0),p=S.filter(s=>r.includes(s)&&i.some(o=>f(o)===s));return p.length>1&&u.unshift({param:H,label:Me,values:p.map(s=>({value:s,label:L[s]}))}),u}function dn(e){return n=>{let t=Ce(n,{fallback:e.offersCommerce}),r=n.filter(i=>K(...i.docs)).length;return{listingPaths:t,pageOptions:i=>{let a=i.map(u=>{let p=n.find(s=>P(s.slug)===u.value);return p&&K(...p.docs)?{...u,label:Ie(p.title,r)}:u});return r===0&&e.offersCommerce&&!a.some(u=>u.value===C)&&a.push({value:C,label:O}),a},filtersFor:i=>{if(!t.includes(i))return null;let a=n.find(u=>P(u.slug)===i);return Q(e.catalogue,{listing:a?j(...a.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ke,withFilter:V}}}function fn(e){let n=dn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Pe({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:A(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ee},filtersFor:t.filtersFor??(()=>null)}}function Zt(e,n){return Q(e,n)}export{C as BUILT_IN_LISTING_PATH,F as LINK_KINDS,Z as LISTING_FILTER_PARAMS,O as LISTING_PAGE_LABEL,Me as PRODUCT_TYPE_FILTER_LABEL,R as anchorPath,cn as fieldUsageFromAdminRows,un as inferLinkKind,K as isProductListingPage,Ee as isSafeLink,T as linkKindsFor,fn as linkPickerSetup,Zt as listingFilterFields,j as listingNode,Ie as listingPageLabel,Ne as listingTarget,E as pageAnchors,P as pagePath,_ as postPath,Ce as productListingPaths,Ke as readListingFilter,A as wheelPath,V as withListingFilter};
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "42.0.0"
2
+ "efficient-web-builder": "44.0.1"
3
3
  }
@@ -39,6 +39,7 @@ export interface AppliedCoupon {
39
39
  export interface QuoteDestination {
40
40
  country: string;
41
41
  subdivision: string;
42
+ postcode: string;
42
43
  }
43
44
  interface CartCtx {
44
45
  isOpen: boolean;
@@ -64,6 +65,8 @@ interface CartCtx {
64
65
  couponBusy: boolean;
65
66
  deliveryOptions: DeliveryOption[];
66
67
  setQuoteDestination: (dest: QuoteDestination | null) => void;
68
+ courier: CartQuote["courier"] | null;
69
+ requote: () => void;
67
70
  shippingMethodId: string | null;
68
71
  setShippingMethodId: (id: string) => void;
69
72
  totals: {
@@ -1 +1 @@
1
- "use client";import{jsx as We}from"react/jsx-runtime";import{createContext as ke,useCallback as i,useContext as Qe,useEffect as g,useMemo as pe,useRef as A,useState as d}from"react";import{products as E}from"../lib/api/index.js";import{couponDeferredToCheckout as ve}from"../lib/cart/coupon-preview.js";import{snapshotCartLines as He}from"../lib/cart/snapshot-lines.js";import{MAX_QTY_PER_LINE as he,orderLinesForSets as Ve,setPrice as je}from"../lib/commerce.js";import{UNPRICED_LABEL as Fe}from"../lib/wheels/price-display.js";import{isValidEmail as ze}from"../lib/email-shape.js";import{trackAddToCart as Je}from"../lib/google-tag.js";import{shippingStatus as Xe}from"../lib/cart/shipping-status.js";import{useCurrency as Ye}from"./CurrencyContext.js";const Ge=400,Ke=400,Ze=1500;function ye(c){return(c.components?.length??0)>0}function Ce(c,s){return{code:c,valid:s.valid,deferred:ve(s,s.askedAsShopper),message:s.message||void 0,effects:s.effects??void 0}}function ge(c,s){return je(c.components,s)}function L(c,s){const r=ge(c,s);return r===null?null:r*c.qty}function Ee(c){return c!=="tyre"}const Ne=ke(null);function lt({children:c,preview:s=!1}){const{currency:r,country:W,formatMoney:be}=Ye(),[k,D]=d(s),[a,M]=d([]),[Q,Te]=d([]),[v,Be]=d([]),[H,Me]=d(!1),[V,Ie]=d(!1),[xe,Oe]=d(!1),[Se,_e]=d(!1),[m,j]=d(null),[F,z]=d(void 0),[I,qe]=d(null),[u,y]=d(null),[J,x]=d(!1),[p,X]=d(null),O=A(void 0),N=i(()=>D(!0),[]),Y=i(()=>D(!1),[]),G=i(()=>D(e=>!e),[]);g(()=>{s||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&N()},[N,s]);const K=i(e=>{qe(t=>t?.country===e?.country&&t?.subdivision===e?.subdivision?t:e)},[]),Z=i(e=>{_e(!0),Ee(e)&&Oe(!0)},[]),$=xe||a.some(e=>Ee(e.kind)),ee=Se||a.length>0;g(()=>{if(s||!$||H)return;let e=!0;return E.listWheels().then(t=>{e&&(Te(t),Me(!0))}),()=>{e=!1}},[s,$,H]),g(()=>{if(s||!ee||V)return;let e=!0;return E.listBundles().then(t=>{e&&(Be(t),Ie(!0))}),()=>{e=!1}},[s,ee,V]);const C=m?.deliveryOptions??[];g(()=>{m&&X(e=>e&&C.some(t=>t.id===e)?e:C[0]?.id??null)},[m]);const S=i(()=>a.filter(ye).flatMap(e=>Ve(e.components,e.qty)),[a]),te=i(async(e,t)=>{const o=e.trim().toUpperCase();if(!o)return;const n=S();if(n.length===0){y({code:o,valid:!1,message:"Add a wheel to the cart first."});return}x(!0),O.current=t;try{const l=await E.validateCoupon({code:o,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:t});y(Ce(o,l))}catch{y({code:o,valid:!1,message:"Could not check that code. Please try again."})}finally{x(!1)}},[S,r,p]),ne=i(()=>{y(null),O.current=void 0},[]),oe=i(e=>{if(!u)return;const{code:t}=u;y(o=>o&&o.code===t?{code:t,valid:!1,refused:!0,message:e}:o)},[u]);g(()=>{if(!u||u.refused)return;const e=u.code,t=n=>n!==null&&n.code===e&&!n.refused,o=setTimeout(async()=>{const n=S();if(n.length===0){y(l=>t(l)?{code:e,valid:!1,message:"Add a wheel to the cart first."}:l);return}x(!0);try{const l=await E.validateCoupon({code:e,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:O.current});y(B=>t(B)?Ce(e,l):B)}catch{}finally{x(!1)}},Ge);return()=>clearTimeout(o)},[a,r,p]);const P=u&&!u.refused?u.code:void 0;g(()=>{if(s)return;let e=!0;const t=setTimeout(async()=>{const o=S();if(o.length===0){j(null),z(void 0);return}try{const n=await E.quoteCart({items:o,currency:r,shippingMethodId:p??void 0,couponCode:P,customerEmail:O.current||void 0,country:I?.country||W||void 0,subdivision:I?.country&&I.subdivision||void 0});if(!e)return;j(n)}catch{if(!e)return}z(P)},Ke);return()=>{e=!1,clearTimeout(t)}},[a,r,p,P,W,I]);const _=i(e=>{M(t=>{const o=t.findIndex(n=>n.id===e.id);return o===-1?[...t,e]:t.map((n,l)=>l===o?{...n,qty:Math.min(he,n.qty+e.qty)}:n)}),Je(e,r)},[r]),se=i(e=>{M(t=>t.filter(o=>o.id!==e))},[]),re=i((e,t)=>{const o=Math.max(1,Math.min(he,t));M(n=>n.map(l=>l.id===e?{...l,qty:o}:l))},[]),ue=i(e=>{M(e)},[]),[T,Ae]=d(null),ie=A(null);ie.current=T;const h=A(null),U=A(""),ce=i((e,t)=>{const o=e.trim().toLowerCase();ze(o)&&Ae(n=>n&&n.email===o&&n.firstName===(t??"")?n:{email:o,firstName:t??""})},[]);g(()=>{if(s||!T)return;const e=He(a.filter(ye),n=>L(n,r)===null?Fe:be(L(n,r),r)),t={email:T.email,firstName:T.firstName,currency:r,items:e},o=JSON.stringify(t);if(o!==U.current)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,U.current=o,E.captureCart(t).catch(n=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart capture failed",n)})},Ze),()=>{h.current&&(clearTimeout(h.current),h.current=null)}},[a,T,r,s]);const ae=i(()=>{h.current&&(clearTimeout(h.current),h.current=null);const e=ie.current;e&&(U.current="",E.captureCart({email:e.email,firstName:e.firstName,currency:r,items:[]}).catch(t=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart clear failed",t)}))},[r]),le=pe(()=>{const e=a.reduce((f,b)=>{const q=L(b,r);return q===null?f:f+q},0),t=a.some(f=>ge(f,r)===null),o=a.reduce((f,b)=>f+b.qty,0),n=u?.valid?u.effects:void 0,l=n?Math.min(e,Number(n.discountAmount)):0,B=m?.bundleDiscount??0,Pe=m?.appliedBundles??[],w=!!n?.freeShipping,fe=C.find(f=>f.id===p),me=w?0:m?.shipping??fe?.amount??0,Ue=Xe({quoted:m!==null,optionCount:C.length,chosenAmount:fe?.amount,couponWaivesFreight:w}),R={};for(const f of n?.freeUnits??[])R[f.partNumber]=(R[f.partNumber]??0)+f.quantity;const we=m?.tax??null,Re=m?m.grandTotal:e-l-B+me;return{sets:o,units:a.reduce((f,b)=>f+(b.components??[]).reduce((q,Le)=>q+Le.wheels*b.qty,0),0),subtotal:e,hasUnpricedLine:t,discount:l,bundleDiscount:B,appliedBundles:Pe,shipping:me,freeShipping:w,shippingStatus:Ue,freeUnitsByPartNumber:R,tax:we,grand:Re,repricing:!!u?.refused&&m!==null&&F===u?.code,currency:r}},[a,r,u,C,p,m,F]),de=i(e=>{_(e),N()},[_,N]),De=pe(()=>({isOpen:k,preview:s,open:N,close:Y,toggle:G,items:a,catalog:Q,bundles:v,warmCatalog:Z,add:_,addAndOpen:de,remove:se,setQty:re,replaceItems:ue,identify:ce,clearCapturedCart:ae,coupon:u,applyCoupon:te,removeCoupon:ne,refuseCoupon:oe,couponBusy:J,deliveryOptions:C,setQuoteDestination:K,shippingMethodId:p,setShippingMethodId:X,totals:le}),[k,s,N,Y,G,a,Q,v,Z,_,de,se,re,ue,ce,ae,u,te,ne,oe,J,C,K,p,le]);return We(Ne.Provider,{value:De,children:c})}function dt(){const c=Qe(Ne);if(!c)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return c}export{lt as CartProvider,ye as isOrderable,L as lineTotal,dt as useCart};
1
+ "use client";import{jsx as Ve}from"react/jsx-runtime";import{createContext as ve,useCallback as u,useContext as je,useEffect as g,useMemo as ye,useRef as A,useState as c}from"react";import{products as E}from"../lib/api/index.js";import{couponDeferredToCheckout as Fe}from"../lib/cart/coupon-preview.js";import{snapshotCartLines as ze}from"../lib/cart/snapshot-lines.js";import{MAX_QTY_PER_LINE as Ce,orderLinesForSets as Je,setPrice as Xe}from"../lib/commerce.js";import{UNPRICED_LABEL as Ye}from"../lib/wheels/price-display.js";import{isValidEmail as Ge}from"../lib/email-shape.js";import{trackAddToCart as Ke}from"../lib/google-tag.js";import{shippingStatus as Ze}from"../lib/cart/shipping-status.js";import{useCurrency as $e}from"./CurrencyContext.js";const et=400,tt=400,nt=1500;function ge(a){return(a.components?.length??0)>0}function Ee(a,s){return{code:a,valid:s.valid,deferred:Fe(s,s.askedAsShopper),message:s.message||void 0,effects:s.effects??void 0}}function Ne(a,s){return Xe(a.components,s)}function k(a,s){const r=Ne(a,s);return r===null?null:r*a.qty}function Te(a){return a!=="tyre"}const be=ve(null);function pt({children:a,preview:s=!1}){const{currency:r,country:L,formatMoney:qe}=$e(),[W,D]=c(s),[l,M]=c([]),[Q,Be]=c([]),[H,Me]=c([]),[V,Ie]=c(!1),[v,xe]=c(!1),[Oe,Se]=c(!1),[_e,Ae]=c(!1),[m,j]=c(null),[De,Pe]=c(0),F=u(()=>Pe(e=>e+1),[]),[z,J]=c(void 0),[N,Ue]=c(null),[i,y]=c(null),[X,I]=c(!1),[p,Y]=c(null),x=A(void 0),T=u(()=>D(!0),[]),G=u(()=>D(!1),[]),K=u(()=>D(e=>!e),[]);g(()=>{s||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&T()},[T,s]);const Z=u(e=>{Ue(t=>t?.country===e?.country&&t?.subdivision===e?.subdivision&&t?.postcode===e?.postcode?t:e)},[]),$=u(e=>{Ae(!0),Te(e)&&Se(!0)},[]),ee=Oe||l.some(e=>Te(e.kind)),te=_e||l.length>0;g(()=>{if(s||!ee||V)return;let e=!0;return E.listWheels().then(t=>{e&&(Be(t),Ie(!0))}),()=>{e=!1}},[s,ee,V]),g(()=>{if(s||!te||v)return;let e=!0;return E.listBundles().then(t=>{e&&(Me(t),xe(!0))}),()=>{e=!1}},[s,te,v]);const C=m?.deliveryOptions??[],ne=m?.courier??null;g(()=>{m&&Y(e=>e&&C.some(t=>t.id===e)?e:C[0]?.id??null)},[m]);const O=u(()=>l.filter(ge).flatMap(e=>Je(e.components,e.qty)),[l]),oe=u(async(e,t)=>{const o=e.trim().toUpperCase();if(!o)return;const n=O();if(n.length===0){y({code:o,valid:!1,message:"Add a wheel to the cart first."});return}I(!0),x.current=t;try{const d=await E.validateCoupon({code:o,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:t});y(Ee(o,d))}catch{y({code:o,valid:!1,message:"Could not check that code. Please try again."})}finally{I(!1)}},[O,r,p]),se=u(()=>{y(null),x.current=void 0},[]),re=u(e=>{if(!i)return;const{code:t}=i;y(o=>o&&o.code===t?{code:t,valid:!1,refused:!0,message:e}:o)},[i]);g(()=>{if(!i||i.refused)return;const e=i.code,t=n=>n!==null&&n.code===e&&!n.refused,o=setTimeout(async()=>{const n=O();if(n.length===0){y(d=>t(d)?{code:e,valid:!1,message:"Add a wheel to the cart first."}:d);return}I(!0);try{const d=await E.validateCoupon({code:e,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:x.current});y(B=>t(B)?Ee(e,d):B)}catch{}finally{I(!1)}},et);return()=>clearTimeout(o)},[l,r,p]);const P=i&&!i.refused?i.code:void 0;g(()=>{if(s)return;let e=!0;const t=setTimeout(async()=>{const o=O();if(o.length===0){j(null),J(void 0);return}try{const n=await E.quoteCart({items:o,currency:r,shippingMethodId:p??void 0,couponCode:P,customerEmail:x.current||void 0,country:N?.country||L||void 0,subdivision:N?.country&&N.subdivision||void 0,postcode:N?.country&&N.postcode||void 0});if(!e)return;j(n)}catch{if(!e)return}J(P)},tt);return()=>{e=!1,clearTimeout(t)}},[l,r,p,P,L,N,De]);const S=u(e=>{M(t=>{const o=t.findIndex(n=>n.id===e.id);return o===-1?[...t,e]:t.map((n,d)=>d===o?{...n,qty:Math.min(Ce,n.qty+e.qty)}:n)}),Ke(e,r)},[r]),ue=u(e=>{M(t=>t.filter(o=>o.id!==e))},[]),ie=u((e,t)=>{const o=Math.max(1,Math.min(Ce,t));M(n=>n.map(d=>d.id===e?{...d,qty:o}:d))},[]),ce=u(e=>{M(e)},[]),[q,we]=c(null),ae=A(null);ae.current=q;const h=A(null),U=A(""),le=u((e,t)=>{const o=e.trim().toLowerCase();Ge(o)&&we(n=>n&&n.email===o&&n.firstName===(t??"")?n:{email:o,firstName:t??""})},[]);g(()=>{if(s||!q)return;const e=ze(l.filter(ge),n=>k(n,r)===null?Ye:qe(k(n,r),r)),t={email:q.email,firstName:q.firstName,currency:r,items:e},o=JSON.stringify(t);if(o!==U.current)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,U.current=o,E.captureCart(t).catch(n=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart capture failed",n)})},nt),()=>{h.current&&(clearTimeout(h.current),h.current=null)}},[l,q,r,s]);const de=u(()=>{h.current&&(clearTimeout(h.current),h.current=null);const e=ae.current;e&&(U.current="",E.captureCart({email:e.email,firstName:e.firstName,currency:r,items:[]}).catch(t=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart clear failed",t)}))},[r]),fe=ye(()=>{const e=l.reduce((f,b)=>{const _=k(b,r);return _===null?f:f+_},0),t=l.some(f=>Ne(f,r)===null),o=l.reduce((f,b)=>f+b.qty,0),n=i?.valid?i.effects:void 0,d=n?Math.min(e,Number(n.discountAmount)):0,B=m?.bundleDiscount??0,ke=m?.appliedBundles??[],w=!!n?.freeShipping,pe=C.find(f=>f.id===p),he=w?0:m?.shipping??pe?.amount??0,Le=Ze({quoted:m!==null,optionCount:C.length,chosenAmount:pe?.amount,couponWaivesFreight:w}),R={};for(const f of n?.freeUnits??[])R[f.partNumber]=(R[f.partNumber]??0)+f.quantity;const We=m?.tax??null,Qe=m?m.grandTotal:e-d-B+he;return{sets:o,units:l.reduce((f,b)=>f+(b.components??[]).reduce((_,He)=>_+He.wheels*b.qty,0),0),subtotal:e,hasUnpricedLine:t,discount:d,bundleDiscount:B,appliedBundles:ke,shipping:he,freeShipping:w,shippingStatus:Le,freeUnitsByPartNumber:R,tax:We,grand:Qe,repricing:!!i?.refused&&m!==null&&z===i?.code,currency:r}},[l,r,i,C,p,m,z]),me=u(e=>{S(e),T()},[S,T]),Re=ye(()=>({isOpen:W,preview:s,open:T,close:G,toggle:K,items:l,catalog:Q,bundles:H,warmCatalog:$,add:S,addAndOpen:me,remove:ue,setQty:ie,replaceItems:ce,identify:le,clearCapturedCart:de,coupon:i,applyCoupon:oe,removeCoupon:se,refuseCoupon:re,couponBusy:X,deliveryOptions:C,setQuoteDestination:Z,courier:ne,requote:F,shippingMethodId:p,setShippingMethodId:Y,totals:fe}),[W,s,T,G,K,l,Q,H,$,S,me,ue,ie,ce,le,de,i,oe,se,re,X,C,Z,ne,F,p,fe]);return Ve(be.Provider,{value:Re,children:a})}function ht(){const a=je(be);if(!a)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return a}export{pt as CartProvider,ge as isOrderable,k as lineTotal,ht as useCart};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l,Fragment as b}from"react/jsx-runtime";import{ChatBubbleLeftRightIcon as f,ChatBubbleOvalLeftEllipsisIcon as m,ChatIcon as g,MegaphoneIcon as x,PhoneIcon as L,SparklesIcon as C}from"efficient-shell/icons/efficient-glyphs";import{chatLauncherColor as I,chatLauncherIcon as _,chatLauncherPosition as S}from"efficient-web-builder/format/lib/content/chat-launcher";import{accentInk as v}from"efficient-web-builder/format/lib/theme";import{PART_PHONE_MAX_CSS as w}from"efficient-web-builder/render/lib/document/part-styles";const y={"chat-bubble-left-right":f,"chat-bubble-oval-left-ellipsis":m,chat:g,megaphone:x,phone:L,sparkles:C};function E(a){const t=I(a?.launcherColor)||"var(--btn)";return{"--assistant-launcher-bg":t,"--assistant-launcher-ink":t==="var(--btn)"?"var(--btn-ink)":v(t),"--assistant-launcher-bg-hover":`color-mix(in oklab, ${t} 85%, black)`}}function O(a){return a?.launcherLabel?.trim()??""}function P(a){return S(a?.launcherPosition)==="left"}const k={position:"fixed",bottom:16,minWidth:48,height:48,padding:0,display:"flex",alignItems:"center",border:0,borderRadius:9999,cursor:"pointer",background:"var(--assistant-launcher-bg)",color:"var(--assistant-launcher-ink)",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"},N={width:48,height:48,flex:"none",display:"flex",alignItems:"center",justifyContent:"center"},j="[data-chat-launcher-label]{max-width:0;opacity:0;overflow:hidden;white-space:nowrap;font-size:14px;font-weight:500;line-height:1;transition:max-width 120ms ease-out,opacity 120ms ease-out,padding 120ms ease-out}[data-chat-launcher]:hover [data-chat-launcher-label],[data-chat-launcher]:focus-visible [data-chat-launcher-label]{max-width:16em;opacity:1;padding-inline-end:16px}@media (prefers-reduced-motion:reduce){[data-chat-launcher-label]{transition:none}}",A=`@media ${w}{[data-chat-launcher][data-hide-on-phones]{display:none!important}}`;function H({label:a,onOpen:t,onWarm:c,zIndex:d=1e3,badge:u,look:n}){const r=_(n?.launcherIcon),p=y[r],o=O(n),i=P(n),s=n?.showOnPhones===!1,h=(o?j:"")+(s?A:"");return l(b,{children:[h&&e("style",{children:h}),l("button",{type:"button","aria-label":a,onClick:t,onPointerEnter:c,onFocus:c,"data-sf-floating":"","data-chat-launcher":"","data-side":i?"left":"right","data-hide-on-phones":s?"":void 0,style:{...E(n),...k,...i?{left:16}:{right:16},zIndex:d},children:[e("span",{style:N,children:e(p,{size:22,"data-icon":r})}),o&&e("span",{"data-chat-launcher-label":"",children:o}),u]})]})}export{P as chatLauncherOnLeft,E as chatLauncherTokens,H as default};
1
+ "use client";import{jsx as e,jsxs as l,Fragment as b}from"react/jsx-runtime";import{ChatBubbleLeftRightIcon as f,ChatBubbleOvalLeftEllipsisIcon as m,ChatIcon as g,MegaphoneIcon as x,PhoneIcon as L,SparklesIcon as I}from"efficient-shell/icons/efficient-glyphs";import{chatLauncherColor as C,chatLauncherIcon as _,chatLauncherPosition as v}from"efficient-web-builder/format/lib/content/chat-launcher";import{accentInk as w}from"efficient-web-builder/format/lib/theme";import{PHONE_MEDIA as y}from"efficient-web-builder/render/lib/content/view-values";const E={"chat-bubble-left-right":f,"chat-bubble-oval-left-ellipsis":m,chat:g,megaphone:x,phone:L,sparkles:I};function O(a){const t=C(a?.launcherColor)||"var(--btn)";return{"--assistant-launcher-bg":t,"--assistant-launcher-ink":t==="var(--btn)"?"var(--btn-ink)":w(t),"--assistant-launcher-bg-hover":`color-mix(in oklab, ${t} 85%, black)`}}function S(a){return a?.launcherLabel?.trim()??""}function P(a){return v(a?.launcherPosition)==="left"}const k={position:"fixed",bottom:16,minWidth:48,height:48,padding:0,display:"flex",alignItems:"center",border:0,borderRadius:9999,cursor:"pointer",background:"var(--assistant-launcher-bg)",color:"var(--assistant-launcher-ink)",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"},N={width:48,height:48,flex:"none",display:"flex",alignItems:"center",justifyContent:"center"},j="[data-chat-launcher-label]{max-width:0;opacity:0;overflow:hidden;white-space:nowrap;font-size:14px;font-weight:500;line-height:1;transition:max-width 120ms ease-out,opacity 120ms ease-out,padding 120ms ease-out}[data-chat-launcher]:hover [data-chat-launcher-label],[data-chat-launcher]:focus-visible [data-chat-launcher-label]{max-width:16em;opacity:1;padding-inline-end:16px}@media (prefers-reduced-motion:reduce){[data-chat-launcher-label]{transition:none}}",H=`@media ${y}{[data-chat-launcher][data-hide-on-phones]{display:none!important}}`;function A({label:a,onOpen:t,onWarm:c,zIndex:d=1e3,badge:u,look:n}){const r=_(n?.launcherIcon),p=E[r],o=S(n),i=P(n),s=n?.showOnPhones===!1,h=(o?j:"")+(s?H:"");return l(b,{children:[h&&e("style",{children:h}),l("button",{type:"button","aria-label":a,onClick:t,onPointerEnter:c,onFocus:c,"data-sf-floating":"","data-chat-launcher":"","data-side":i?"left":"right","data-hide-on-phones":s?"":void 0,style:{...O(n),...k,...i?{left:16}:{right:16},zIndex:d},children:[e("span",{style:N,children:e(p,{size:22,"data-icon":r})}),o&&e("span",{"data-chat-launcher-label":"",children:o}),u]})]})}export{P as chatLauncherOnLeft,O as chatLauncherTokens,A as default};
@@ -0,0 +1,13 @@
1
+ import { type ContactView } from "../lib/sections/messaging.js";
2
+ export declare const CONTACT_WORDS: {
3
+ call: (name: string) => string;
4
+ email: (name: string) => string;
5
+ };
6
+ interface ContactCardsProps {
7
+ title?: string;
8
+ description?: string;
9
+ contacts: readonly ContactView[];
10
+ contained: boolean;
11
+ }
12
+ export default function ContactCards({ title, description, contacts, contained }: ContactCardsProps): import("react").JSX.Element | null;
13
+ export {};
@@ -0,0 +1 @@
1
+ import{jsx as a,jsxs as r}from"react/jsx-runtime";import x from"efficient-web-builder/render/components/BlockFrame";import{renderGold as f,renderHeadline as g,splitParagraphs as o}from"efficient-web-builder/render/components/goldPhrases";import N from"./CopyText.js";import t from"./QrCode.js";import{MESSAGING_ACTION as i,MESSAGING_WORDS as d}from"../lib/sections/messaging.js";const p={call:l=>l?`Call ${l}`:"Call",email:l=>l?`Email ${l}`:"Email"};function c({title:l,description:s,contacts:n,contained:h}){return n.length?a(x,{contained:h,className:"py-6",children:r("div",{className:"flex flex-col gap-6",children:[(l||s)&&r("div",{className:"flex max-w-[680px] flex-col gap-3",children:[l&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:g(l,!1)}),s&&o(s).map((e,m)=>a("p",{className:"text-[15px] leading-[1.6] opacity-85",children:f(e)},m))]}),a("ul",{className:"grid gap-3 sm:grid-cols-2 md:gap-4 lg:grid-cols-3","data-contact-cards":"",children:n.map((e,m)=>r("li",{className:"flex min-w-0 items-start justify-between gap-4 rounded-[var(--radius-card,12px)] border border-line p-4 md:p-5",children:[r("div",{className:"flex min-w-0 flex-col gap-1.5",children:[a("p",{className:"font-mono text-[12px] uppercase tracking-[0.14em] text-fg-dim",children:e.way}),e.name&&a("p",{className:"font-heading2 text-[18px] font-medium leading-tight",children:e.name}),a("p",{className:"break-all text-[15px] text-fg-dim",children:e.handle}),a("div",{className:"pt-1",children:e.kind==="phone"?a("a",{href:e.href,className:i,children:p.call(e.name)}):e.kind==="email"?a("a",{href:e.href,className:i,children:p.email(e.name)}):e.href?r("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:i,children:[d.open(e.way),r("span",{className:"sr-only",children:[" ",d.opensApp]})]}):a(N,{text:e.handle,className:i})})]}),e.qr&&a(t,{text:e.qr,label:d.qrLabel(e.way,e.handle),className:"aspect-square w-24 shrink-0 rounded-sm"})]},m))})]})}):null}export{p as CONTACT_WORDS,c as default};
@@ -0,0 +1,4 @@
1
+ export default function CopyText({ text, className }: {
2
+ text: string;
3
+ className?: string;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as n,jsxs as a}from"react/jsx-runtime";import{useEffect as c,useState as l}from"react";import{MESSAGING_WORDS as i}from"../lib/sections/messaging.js";function u({text:t,className:r}){const[e,o]=l(!1);return c(()=>{if(!e)return;const s=setTimeout(()=>o(!1),2e3);return()=>clearTimeout(s)},[e]),a("button",{type:"button",className:r,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>o(!0),()=>{})},children:[e?i.copied:i.copyId,n("span",{className:"sr-only","aria-live":"polite",children:e?` ${t}`:""})]})}export{u as default};
@@ -3,7 +3,10 @@ export type { EventPost };
3
3
  export type EventCard = EventPost & {
4
4
  href?: string;
5
5
  facets?: CardFacets;
6
+ tags?: readonly string[];
6
7
  };
8
+ export declare const MAX_CARD_TAGS = 4;
9
+ export declare function readTags(value: unknown): readonly string[] | undefined;
7
10
  export type CardFacets = Readonly<Record<string, string | readonly string[]>>;
8
11
  export declare function readFacets(value: unknown): CardFacets | undefined;
9
12
  export declare function facetChoices(cards: readonly EventCard[]): {
@@ -1 +1 @@
1
- import{jsx as n,jsxs as l}from"react/jsx-runtime";import{useId as xe,useState as K}from"react";import{containerGapProps as ge}from"efficient-web-builder/format/lib/content/container-gap";import ue from"efficient-web-builder/render/components/SectionHeader";import F from"efficient-web-builder/render/components/PostCard";import he from"efficient-web-builder/render/components/Placeholder";import{SiteLink as z}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as x,renderHeadline as v}from"efficient-web-builder/render/components/goldPhrases";import{say as N}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as be}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as G}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as ve}from"../lib/sections/fill-row.js";import{headIsEmpty as Ne,ownPadding as Ee}from"../lib/sections/own-padding.js";function tt(t){if(!t||typeof t!="object"||Array.isArray(t))return;const a={};for(const[e,s]of Object.entries(t))if(e.trim()){if(typeof s=="string")s.trim()&&(a[e]=s.trim());else if(Array.isArray(s)){const o=s.filter(c=>typeof c=="string"&&!!c.trim()).map(c=>c.trim());o.length&&(a[e]=o)}}return Object.keys(a).length?a:void 0}function H(t,a){const e=t.facets?.[a];return e===void 0?[]:typeof e=="string"?[e]:e}const ye=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function Te(t){const a=[],e=new Map;for(const s of t)for(const o of Object.keys(s.facets??{})){e.has(o)||(a.push(o),e.set(o,new Set));for(const c of H(s,o))e.get(o).add(c)}return a.map(s=>({label:s,values:[...e.get(s)].sort(ye.compare)}))}function _e(t,a){return Object.entries(a).every(([e,s])=>s===""||H(t,e).includes(s))}const W=3,J="featured",X="tabs",q="portrait",u="spread",Q="count",nt=[{label:"Even grid",value:"even"},{label:"Featured first",value:J},{label:"Tabs",value:X},{label:"Photo cards",value:q},{label:"Staggered spread",value:u},{label:"Count",value:Q}],Ae=[q,u],at="even",k={min:2,max:11,step:1,fallback:7,unit:"of 12"},Le="bottom-left",Ce=55,Oe="bottom";function Se(t){const a=typeof t=="number"?t:Number.parseFloat(String(t??"")),e=Number.isFinite(a)?Math.min(k.max,Math.max(k.min,Math.round(a))):k.fallback;return`${e}fr ${12-e}fr`}const Z={1:"grid-cols-1",2:"grid-cols-2 max-[800px]:grid-cols-1",3:"grid-cols-3 max-[800px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1"},ee={2:"grid-cols-2",3:"grid-cols-3 max-[800px]:grid-cols-2",4:"grid-cols-4 max-[1100px]:grid-cols-3 max-[800px]:grid-cols-2"},$e="Find by name",we="Nobody by that name.",Fe="Nobody matches.",ze="Any";function ke(t,a){const e=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),s=e(a);return s===""||e(t).includes(s)}function te({typed:t,onType:a,wide:e=!1}){return l("label",{className:`flex max-w-[360px] flex-col gap-1.5${e?" w-full":""}`,children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:$e}),n("input",{type:"search",value:t,onChange:s=>a(s.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function Re({card:t,scaffold:a,lower:e=!1}){return l(z,{href:t.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${e?" min-[801px]:mt-16":""}`,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,children:[n("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:n(he,{label:`card-${t.slug}`,src:t.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),n("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),t.meta&&n("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:x(t.meta)}),l("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-[800px]:p-3",children:[n("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:v(t.title,!1)}),t.dateLabel&&n("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:x(t.dateLabel)}),t.excerpt&&n("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:x(t.excerpt)})]})]})}function Ie({cards:t,scaffold:a}){return n("nav",{"aria-label":"Days",className:"-mx-1 [scrollbar-width:none] max-[800px]:overflow-x-auto [&::-webkit-scrollbar]:hidden",children:n("ul",{className:"flex flex-wrap gap-2 px-1 pb-1 max-[800px]:min-w-max max-[800px]:flex-nowrap",children:t.map((e,s)=>{const o=!!e.meta;return n("li",{children:l(z,{href:e.href||"#","aria-current":o?"page":void 0,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,className:`flex flex-col gap-0.5 rounded-[var(--sf-button-radius,999px)] border px-5 py-2.5 transition-colors ${o?"border-accent bg-accent text-accent-ink":"border-line text-fg hover:border-accent hover:text-accent"}`,children:[n("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:v(e.title,!1)}),e.excerpt&&n("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${o?"opacity-80":"text-fg-dim"}`,children:x(e.excerpt)})]})},`${e.slug}-${s}`)})})})}function Ue({count:t,words:a,href:e}){const s=l("span",{className:"inline-flex items-baseline gap-3",children:[n("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:t}),a!==void 0&&n("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:a})]});return e?n(z,{href:e,className:"inline-flex hover:opacity-85",children:s}):s}const Me="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",De="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",Pe="relative z-[2] bg-bg py-[32px] max-[800px]:py-[24px]";function je({num:t,title:a,link:e,posts:s,columns:o,limit:c,showAll:E=!1,editing:y=!1,cardImage:ne,gap:ae,layout:f,featuredWidth:se,listCover:re=!0,featuredDarken:oe,omitHead:h=!1,sample:T,nameFilter:le=!1,padTop:ce,padBottom:ie}){const[_,R]=K(""),[I,de]=K({}),A=`ev-${xe().replace(/:/g,"")}`,U=s??[],M=E?U.length:typeof c=="number"&&c>0?c:W,L=U.slice(0,M),m=y&&L.length===0;if(L.length===0&&!y)return null;const D=E?W:M,i=m?T?.length?T.slice(0,E?T.length:D):Array.from({length:D},(r,d)=>({slug:`placeholder-${d}`,title:N("Blog post title"),excerpt:N("A short summary of the post appears here."),cover:"",meta:N("Journal"),dateLabel:N("Date")})):L,p=ge("Events",ae,"both"),C=f===J&&i.length>1,pe=Se(se),O=f===X,P=f===Q,j=Ae.includes(f??""),S=le&&!O&&!P&&!C,$=S?Te(i):[],b=S?i.filter(r=>ke(r.title,_)&&_e(r,I)):i,w=Ee(ce,ie),fe=!y&&Ne(t,a,e?.text),V=f===u?"grid-cols-3 max-[800px]:grid-cols-2":ee[Math.min(4,Math.max(2,o??3))]??ee[3],Y=Z[Math.min(4,Math.max(1,o??3))]??Z[3],B=O||C||f===u?"":ve(A,j?V:Y,{cards:b.length});return P?n("section",{className:Pe,style:Object.keys(w).length?w:void 0,children:n("div",{className:G,children:n(Ue,{count:i.length,words:h||a===void 0?void 0:v(a,!1),href:h?void 0:e?.href})})}):n("section",{className:h?De:Me,style:{...be(ne),...w},children:l("div",{className:G,children:[h||fe?null:n(ue,{num:t!==void 0?x(t):void 0,title:a!==void 0?v(a,!1):void 0,link:e?{text:x(e.text),href:e.href}:void 0}),S&&l("div",{className:"mb-6 flex flex-col gap-2",children:[$.length===0?n(te,{typed:_,onType:R}):l("div",{className:"flex flex-wrap items-end gap-3",children:[n(te,{typed:_,onType:R,wide:!0}),$.map(({label:r,values:d})=>l("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-[800px]:flex-1",children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:r}),l("select",{value:I[r]??"",onChange:g=>de(me=>({...me,[r]:g.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[n("option",{value:"",children:ze}),d.map(g=>n("option",{value:g,children:g},g))]})]},r))]}),b.length===0&&n("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:$.length===0?we:Fe})]}),B&&n("style",{children:B}),O?n(Ie,{cards:i,scaffold:m}):j?n("div",{className:`${A} sf-card-grid grid${p.className} ${V}`,style:p.style,children:b.map((r,d)=>n(Re,{card:r,scaffold:m,lower:f===u&&d%3===1},`${r.slug}-${d}`))}):C?l("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-[800px]:grid-cols-1${p.className}`,style:{...p.style,"--sf-events-split":pe},children:[n(F,{post:i[0],href:i[0].href,scaffold:m,layout:"cover",darken:oe??Ce,darkenStyle:Oe,placement:Le},`${i[0].slug}-0`),n("div",{className:`grid auto-rows-min${p.className}`,style:p.style,children:i.slice(1).map((r,d)=>n(F,{post:r,href:r.href,scaffold:m,showCover:re},`${r.slug}-${d+1}`))})]}):n("div",{className:`${A} sf-card-grid grid${p.className} ${Y}`,style:p.style,children:b.map((r,d)=>n(F,{post:r,href:r.href,scaffold:m},`${r.slug}-${d}`))})]})})}export{k as EVENTS_FEATURED_WIDTH,nt as EVENTS_LAYOUTS,Q as EVENTS_LAYOUT_COUNT,at as EVENTS_LAYOUT_FALLBACK,J as EVENTS_LAYOUT_FEATURED,q as EVENTS_LAYOUT_PORTRAIT,u as EVENTS_LAYOUT_SPREAD,X as EVENTS_LAYOUT_TABS,Ae as EVENTS_PHOTO_LAYOUTS,je as default,Te as facetChoices,_e as matchesFacets,ke as matchesName,tt as readFacets};
1
+ import{jsx as n,jsxs as o}from"react/jsx-runtime";import{useId as ge,useState as G}from"react";import{containerGapProps as ue}from"efficient-web-builder/format/lib/content/container-gap";import he from"efficient-web-builder/render/components/SectionHeader";import v from"efficient-web-builder/render/components/PostCard";import be from"efficient-web-builder/render/components/Placeholder";import{SiteLink as z}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as x,renderHeadline as N}from"efficient-web-builder/render/components/goldPhrases";import{say as y}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as ve}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as K}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as Ne}from"../lib/sections/fill-row.js";import{headIsEmpty as ye,ownPadding as Ee}from"../lib/sections/own-padding.js";const Te=4;function at(t){if(!Array.isArray(t))return;const a=t.filter(e=>typeof e=="string"&&!!e.trim()).map(e=>e.trim()).slice(0,Te);return a.length?a:void 0}function rt(t){if(!t||typeof t!="object"||Array.isArray(t))return;const a={};for(const[e,r]of Object.entries(t))if(e.trim()){if(typeof r=="string")r.trim()&&(a[e]=r.trim());else if(Array.isArray(r)){const l=r.filter(c=>typeof c=="string"&&!!c.trim()).map(c=>c.trim());l.length&&(a[e]=l)}}return Object.keys(a).length?a:void 0}function H(t,a){const e=t.facets?.[a];return e===void 0?[]:typeof e=="string"?[e]:e}const Ae=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function _e(t){const a=[],e=new Map;for(const r of t)for(const l of Object.keys(r.facets??{})){e.has(l)||(a.push(l),e.set(l,new Set));for(const c of H(r,l))e.get(l).add(c)}return a.map(r=>({label:r,values:[...e.get(r)].sort(Ae.compare)}))}function Le(t,a){return Object.entries(a).every(([e,r])=>r===""||H(t,e).includes(r))}const W=3,X="featured",J="tabs",q="portrait",u="spread",Q="count",st=[{label:"Even grid",value:"even"},{label:"Featured first",value:X},{label:"Tabs",value:J},{label:"Photo cards",value:q},{label:"Staggered spread",value:u},{label:"Count",value:Q}],Ce=[q,u],lt="even",k={min:2,max:11,step:1,fallback:7,unit:"of 12"},$e="bottom-left",Oe=55,Se="bottom";function we(t){const a=typeof t=="number"?t:Number.parseFloat(String(t??"")),e=Number.isFinite(a)?Math.min(k.max,Math.max(k.min,Math.round(a))):k.fallback;return`${e}fr ${12-e}fr`}const Z={1:"grid-cols-1",2:"grid-cols-2 max-[800px]:grid-cols-1",3:"grid-cols-3 max-[800px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1"},ee={2:"grid-cols-2",3:"grid-cols-3 max-[800px]:grid-cols-2",4:"grid-cols-4 max-[1100px]:grid-cols-3 max-[800px]:grid-cols-2"},Fe="Find by name",ze="Nobody by that name.",ke="Nobody matches.",Re="Any";function Ie(t,a){const e=l=>l.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),r=e(a);return r===""||e(t).includes(r)}function te({typed:t,onType:a,wide:e=!1}){return o("label",{className:`flex max-w-[360px] flex-col gap-1.5${e?" w-full":""}`,children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:Fe}),n("input",{type:"search",value:t,onChange:r=>a(r.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function ne({tags:t}){return n("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:t.map((a,e)=>n("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:a},`${a}-${e}`))})}function Me({card:t,scaffold:a,lower:e=!1}){return o(z,{href:t.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${e?" min-[801px]:mt-16":""}`,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,children:[n("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:n(be,{label:`card-${t.slug}`,src:t.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),n("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),t.meta&&n("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:x(t.meta)}),o("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-[800px]:p-3",children:[n("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:N(t.title,!1)}),t.dateLabel&&n("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:x(t.dateLabel)}),t.tags&&t.tags.length>0&&n(ne,{tags:t.tags}),t.excerpt&&n("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:x(t.excerpt)})]})]})}function Ue({cards:t,scaffold:a}){return n("nav",{"aria-label":"Days",className:"-mx-1 [scrollbar-width:none] max-[800px]:overflow-x-auto [&::-webkit-scrollbar]:hidden",children:n("ul",{className:"flex flex-wrap gap-2 px-1 pb-1 max-[800px]:min-w-max max-[800px]:flex-nowrap",children:t.map((e,r)=>{const l=!!e.meta;return n("li",{children:o(z,{href:e.href||"#","aria-current":l?"page":void 0,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,className:`flex flex-col gap-0.5 rounded-[var(--sf-button-radius,999px)] border px-5 py-2.5 transition-colors ${l?"border-accent bg-accent text-accent-ink":"border-line text-fg hover:border-accent hover:text-accent"}`,children:[n("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:N(e.title,!1)}),e.excerpt&&n("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${l?"opacity-80":"text-fg-dim"}`,children:x(e.excerpt)})]})},`${e.slug}-${r}`)})})})}function De({count:t,words:a,href:e}){const r=o("span",{className:"inline-flex items-baseline gap-3",children:[n("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:t}),a!==void 0&&n("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:a})]});return e?n(z,{href:e,className:"inline-flex hover:opacity-85",children:r}):r}const Pe="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",je="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",Ve="relative z-[2] bg-bg py-[32px] max-[800px]:py-[24px]";function Ye({num:t,title:a,link:e,posts:r,columns:l,limit:c,showAll:E=!1,editing:T=!1,cardImage:ae,gap:re,layout:f,featuredWidth:se,listCover:le=!0,featuredDarken:oe,omitHead:h=!1,sample:A,nameFilter:ie=!1,padTop:ce,padBottom:de}){const[_,R]=G(""),[I,pe]=G({}),L=`ev-${ge().replace(/:/g,"")}`,M=r??[],U=E?M.length:typeof c=="number"&&c>0?c:W,C=M.slice(0,U),m=T&&C.length===0;if(C.length===0&&!T)return null;const D=E?W:U,d=m?A?.length?A.slice(0,E?A.length:D):Array.from({length:D},(s,i)=>({slug:`placeholder-${i}`,title:y("Blog post title"),excerpt:y("A short summary of the post appears here."),cover:"",meta:y("Journal"),dateLabel:y("Date")})):C,p=ue("Events",re,"both"),$=f===X&&d.length>1,fe=we(se),O=f===J,P=f===Q,j=Ce.includes(f??""),S=ie&&!O&&!P&&!$,w=S?_e(d):[],b=S?d.filter(s=>Ie(s.title,_)&&Le(s,I)):d,F=Ee(ce,de),me=!T&&ye(t,a,e?.text),V=f===u?"grid-cols-3 max-[800px]:grid-cols-2":ee[Math.min(4,Math.max(2,l??3))]??ee[3],Y=Z[Math.min(4,Math.max(1,l??3))]??Z[3],B=O||$||f===u?"":Ne(L,j?V:Y,{cards:b.length});return P?n("section",{className:Ve,style:Object.keys(F).length?F:void 0,children:n("div",{className:K,children:n(De,{count:d.length,words:h||a===void 0?void 0:N(a,!1),href:h?void 0:e?.href})})}):n("section",{className:h?je:Pe,style:{...ve(ae),...F},children:o("div",{className:K,children:[h||me?null:n(he,{num:t!==void 0?x(t):void 0,title:a!==void 0?N(a,!1):void 0,link:e?{text:x(e.text),href:e.href}:void 0}),S&&o("div",{className:"mb-6 flex flex-col gap-2",children:[w.length===0?n(te,{typed:_,onType:R}):o("div",{className:"flex flex-wrap items-end gap-3",children:[n(te,{typed:_,onType:R,wide:!0}),w.map(({label:s,values:i})=>o("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-[800px]:flex-1",children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:s}),o("select",{value:I[s]??"",onChange:g=>pe(xe=>({...xe,[s]:g.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[n("option",{value:"",children:Re}),i.map(g=>n("option",{value:g,children:g},g))]})]},s))]}),b.length===0&&n("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:w.length===0?ze:ke})]}),B&&n("style",{children:B}),O?n(Ue,{cards:d,scaffold:m}):j?n("div",{className:`${L} sf-card-grid grid${p.className} ${V}`,style:p.style,children:b.map((s,i)=>n(Me,{card:s,scaffold:m,lower:f===u&&i%3===1},`${s.slug}-${i}`))}):$?o("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-[800px]:grid-cols-1${p.className}`,style:{...p.style,"--sf-events-split":fe},children:[n(v,{post:d[0],href:d[0].href,scaffold:m,layout:"cover",darken:oe??Oe,darkenStyle:Se,placement:$e},`${d[0].slug}-0`),n("div",{className:`grid auto-rows-min${p.className}`,style:p.style,children:d.slice(1).map((s,i)=>n(v,{post:s,href:s.href,scaffold:m,showCover:le},`${s.slug}-${i+1}`))})]}):n("div",{className:`${L} sf-card-grid grid${p.className} ${Y}`,style:p.style,children:b.map((s,i)=>s.tags&&s.tags.length>0?o("div",{className:"flex flex-col gap-2",children:[n(v,{post:s,href:s.href,scaffold:m}),n(ne,{tags:s.tags})]},`${s.slug}-${i}`):n(v,{post:s,href:s.href,scaffold:m},`${s.slug}-${i}`))})]})})}export{k as EVENTS_FEATURED_WIDTH,st as EVENTS_LAYOUTS,Q as EVENTS_LAYOUT_COUNT,lt as EVENTS_LAYOUT_FALLBACK,X as EVENTS_LAYOUT_FEATURED,q as EVENTS_LAYOUT_PORTRAIT,u as EVENTS_LAYOUT_SPREAD,J as EVENTS_LAYOUT_TABS,Ce as EVENTS_PHOTO_LAYOUTS,Te as MAX_CARD_TAGS,Ye as default,_e as facetChoices,Le as matchesFacets,Ie as matchesName,rt as readFacets,at as readTags};
@@ -0,0 +1,5 @@
1
+ import { type MessagingChannel } from "../lib/sections/messaging.js";
2
+ export default function FooterMessaging({ heading, channels, }: {
3
+ heading?: string;
4
+ channels: readonly MessagingChannel[];
5
+ }): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ import{jsx as r,jsxs as a}from"react/jsx-runtime";import m from"./QrCode.js";import{MESSAGING_WORDS as o}from"../lib/sections/messaging.js";function d({heading:l,channels:t}){const s=t.filter(e=>e.qr),p=t.filter(e=>!e.qr&&e.handle);return!s.length&&!p.length?null:a("div",{className:"flex flex-col gap-2.5 text-[13px]","data-footer-messaging":"",children:[l&&r("p",{children:l}),s.length>0&&r("ul",{className:"flex flex-wrap gap-x-4 gap-y-3","aria-label":l||void 0,children:s.map(e=>a("li",{className:"flex w-[72px] flex-col items-center gap-1.5 md:w-[88px]",children:[r(m,{text:e.qr,label:o.qrLabel(e.name,e.handle),className:"aspect-square w-full rounded-sm"}),e.href?a("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-[12px] underline underline-offset-4",children:[e.name,a("span",{className:"sr-only",children:[" ",o.opensApp]})]}):r("span",{className:"text-[12px]",children:e.name})]},e.app))}),p.map(e=>a("p",{children:[e.name," ID ",r("span",{className:"break-all",children:e.handle})]},e.app))]})}export{d as default};
@@ -0,0 +1,11 @@
1
+ import { type PaymentMethodLike } from "efficient-shell/icons/payment";
2
+ export type FooterPaymentSize = "sm" | "md";
3
+ export type FooterPaymentAlign = "start" | "center" | "end";
4
+ export interface FooterPaymentProps {
5
+ lead?: string;
6
+ methods: readonly PaymentMethodLike[];
7
+ size?: FooterPaymentSize;
8
+ align?: FooterPaymentAlign;
9
+ editing?: boolean;
10
+ }
11
+ export default function FooterPayment({ lead, methods, size, align, editing }: FooterPaymentProps): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as c}from"react/jsx-runtime";import{PaymentMark as y,paymentMarks as u}from"efficient-shell/icons/payment";import{say as r}from"efficient-web-builder/format/lib/editor-words";const s={sm:{mark:16,text:"text-[12px]"},md:{mark:20,text:"text-[13px]"}},n={start:"justify-start",center:"justify-center",end:"justify-end"};function h({lead:t,methods:i,size:m="sm",align:d="start",editing:l=!1}){const a=u(i);if(!a.length)return l?e("div",{"data-payment-placeholder":"",className:"rounded border border-dashed border-line px-3 py-2 text-[13px] text-fg-dim",children:r("Add the ways you take payment")}):null;const{mark:x,text:o}=s[m]??s.sm;return c("div",{"data-footer-payment":"",className:`flex flex-wrap items-center gap-x-3 gap-y-1.5 leading-[1.5] text-fg-dim ${o} ${n[d]??n.start}`,children:[t&&e("span",{"aria-hidden":!0,children:t}),e("ul",{"aria-label":t||r("Ways to pay"),className:"flex list-none flex-wrap items-center gap-x-3 gap-y-1.5 p-0 text-fg",children:a.map((p,f)=>e("li",{className:"flex",children:e(y,{item:p,size:x})},f))})]})}export{h as default};
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as o,Fragment as x}from"react/jsx-runtime";import{createContext as G,useCallback as M,useContext as Y,useEffect as W,useRef as B,useState as L}from"react";import S from"next/link";import D from"./GalleryCard.js";import F,{LightboxClose as V}from"./Lightbox.js";import{useSiteSells as q}from"./SiteRecordContext.js";import{renderGold as d,renderHeadline as O}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as U}from"efficient-web-builder/format/lib/sized-image";const Z="(max-width: 1100px) 100vw, min(59vw, 1050px)",J=G({}),he=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],K="data-gallery-grid",C="data-gallery-tile";function Q(e,n){const[l,s]=L(null);return W(()=>{const c=e.current,a=c?.closest(`[${K}]`);if(!c||!a)return;const u=()=>{const v=Array.from(a.querySelectorAll(`[${C}]`)),y=v.indexOf(c),m=y>=0?{index:y+1,total:v.length}:null;s(h=>h?.index===m?.index&&h?.total===m?.total?h:m)};if(u(),!n)return;const b=new MutationObserver(u);return b.observe(a,{childList:!0,subtree:!0}),()=>b.disconnect()},[e,n]),l}const fe={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},X=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),ge=Array.from({length:6},X);function ee(e,n){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||n}function te(e){const n=(e.photos??[]).map(a=>a?.src).filter(a=>!!a),l=e.image||n[0]||"",s=[l,...n].filter(a=>!!a),c=ee(e.name,"gallery-item");return{car:e.eyebrow??"",wheel:e.name??"",process:e.process??"",finish:e.meta??"",imageLabel:`${c}.jpg`,detailLabel:`${c}-detail.jpg`,imageSrc:l||void 0,detailSrc:n[0]||l||void 0,photos:s,href:e.href}}function re({editing:e=!1,previewHover:n,ratio:l,captionPlace:s,...c}){const{galleryHref:a="/gallery",submitHref:u="/contact",previewHover:b,display:v,displayPhone:y,styleOwner:m,photosOnly:h=!1}=Y(J),t=te(c),f=q()&&!h,z=!f&&!ne(t),i=t.photos??(t.imageSrc?[t.imageSrc]:[]),P=B(null),_=M(p=>{P.current=p},[]),j=Q(P,e),H=e&&(!!n||!!b),[I,g]=L(!1),[w,N]=L(0),E=()=>N(p=>(p-1+i.length)%i.length),T=()=>N(p=>(p+1)%i.length),k=i[w]??t.imageSrc??"",$=r(D,{build:t,forceHover:H,index:j?.index,total:j?.total,ratio:l,captionPlace:s,display:v,displayPhone:y,styleOwner:m,editing:e});return o(x,{children:[e?r("div",{ref:_,[C]:"",className:"block w-full text-left",children:$}):r("button",{ref:_,[C]:"",type:"button","aria-label":f?`Open ${t.car||"build"} on ${t.wheel||"wheel"}`:R(t),onClick:()=>{N(0),g(!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:$}),r(F,{open:I,onClose:()=>g(!1),label:f?`${t.car} on ${t.wheel}`:R(t),onPrev:i.length>1?E:void 0,onNext:i.length>1?T:void 0,className:"flex items-center justify-center p-6 backdrop-blur-[8px] max-[700px]:p-3",style:{background:"color-mix(in oklab, var(--bg) 78%, transparent)"},children:o("div",{onClick:p=>p.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${z?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-[1100px]:grid-cols-1 max-[1100px]:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(V,{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:"color-mix(in oklab, var(--bg) 70%, transparent)"},children:"✕"}),o("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-[1100px]:min-h-[450px]",children:[k&&r("img",{...U(k,{fallbackWidth:1280}),sizes:Z,alt:`${(f?t.car:t.wheel||t.car)||"Photo"} — ${w+1} of ${i.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},k),i.length>1&&o(x,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:E,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:T,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:"▷"}),o("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:[w+1," / ",i.length]})]})]}),f?o("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-[1100px]:px-9 max-[1100px]:py-[54px]",children:[t.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:d(t.process)}),t.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:O(t.wheel,!1)}),t.car&&o("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:d(t.car,!0)})]}),o("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:[t.wheel&&o(x,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:d(t.wheel)})]}),t.process&&o(x,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:d(t.process)})]}),t.finish&&o(x,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:d(t.finish)})]}),t.car&&o(x,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:d(t.car)})]})]}),o("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[o(S,{href:t.href||"/wheels",onClick:()=>g(!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:"→"})]}),o(S,{href:a,onClick:()=>g(!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:"→"})]}),o(S,{href:u,onClick:()=>g(!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:"→"})]})]})]}):!z&&r(oe,{build:t})]})})]})}function A(e){return[e.process,e.car,e.finish].filter((n,l,s)=>!!n&&n!==e.wheel&&s.indexOf(n)===l)}function ne(e){return!!e.wheel||A(e).length>0}function R(e){const n=e.wheel||e.car;return n?`Open photo of ${n}`:"Open photo"}function oe({build:e}){const n=e.wheel,l=A(e);return o("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-[1100px]:px-9 max-[1100px]:py-[54px]",children:[n&&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:O(n,!1)}),l.map(s=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:d(s)},s))]})}export{K as GALLERY_GRID_ATTR,fe as GALLERY_ITEM_HINTS,ge as GALLERY_ITEM_SEEDS,C as GALLERY_TILE_ATTR,he as GALLERY_TILE_PARTS,J as GalleryLinksContext,re as default};
1
+ "use client";import{jsx as r,jsxs as n,Fragment as m}from"react/jsx-runtime";import{createContext as G,useCallback as M,useContext as Y,useEffect as W,useRef as B,useState as L}from"react";import S from"next/link";import{slugify as D}from"efficient-shell/format";import F from"./GalleryCard.js";import V,{LightboxClose as q}from"./Lightbox.js";import{useSiteSells as U}from"./SiteRecordContext.js";import{renderGold as d,renderHeadline as $}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as Z}from"efficient-web-builder/format/lib/sized-image";const J="(max-width: 1100px) 100vw, min(59vw, 1050px)",K=G({}),fe=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],Q="data-gallery-grid",C="data-gallery-tile";function X(t,o){const[l,s]=L(null);return W(()=>{const c=t.current,a=c?.closest(`[${Q}]`);if(!c||!a)return;const u=()=>{const v=Array.from(a.querySelectorAll(`[${C}]`)),y=v.indexOf(c),x=y>=0?{index:y+1,total:v.length}:null;s(h=>h?.index===x?.index&&h?.total===x?.total?h:x)};if(u(),!o)return;const b=new MutationObserver(u);return b.observe(a,{childList:!0,subtree:!0}),()=>b.disconnect()},[t,o]),l}const ge={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},ee=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),ue=Array.from({length:6},ee);function te(t){const o=(t.photos??[]).map(a=>a?.src).filter(a=>!!a),l=t.image||o[0]||"",s=[l,...o].filter(a=>!!a),c=D(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${c}.jpg`,detailLabel:`${c}-detail.jpg`,imageSrc:l||void 0,detailSrc:o[0]||l||void 0,photos:s,href:t.href}}function re({editing:t=!1,previewHover:o,ratio:l,captionPlace:s,...c}){const{galleryHref:a="/gallery",submitHref:u="/contact",previewHover:b,display:v,displayPhone:y,styleOwner:x,photosOnly:h=!1}=Y(K),e=te(c),f=U()&&!h,P=!f&&!oe(e),i=e.photos??(e.imageSrc?[e.imageSrc]:[]),_=B(null),z=M(p=>{_.current=p},[]),j=X(_,t),H=t&&(!!o||!!b),[I,g]=L(!1),[w,N]=L(0),E=()=>N(p=>(p-1+i.length)%i.length),T=()=>N(p=>(p+1)%i.length),k=i[w]??e.imageSrc??"",O=r(F,{build:e,forceHover:H,index:j?.index,total:j?.total,ratio:l,captionPlace:s,display:v,displayPhone:y,styleOwner:x,editing:t});return n(m,{children:[t?r("div",{ref:z,[C]:"",className:"block w-full text-left",children:O}):r("button",{ref:z,[C]:"",type:"button","aria-label":f?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:R(e),onClick:()=>{N(0),g(!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:O}),r(V,{open:I,onClose:()=>g(!1),label:f?`${e.car} on ${e.wheel}`:R(e),onPrev:i.length>1?E:void 0,onNext:i.length>1?T:void 0,className:"flex items-center justify-center p-6 backdrop-blur-[8px] max-[700px]:p-3",style:{background:"color-mix(in oklab, var(--bg) 78%, transparent)"},children:n("div",{onClick:p=>p.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${P?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-[1100px]:grid-cols-1 max-[1100px]:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(q,{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:"color-mix(in oklab, var(--bg) 70%, transparent)"},children:"✕"}),n("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-[1100px]:min-h-[450px]",children:[k&&r("img",{...Z(k,{fallbackWidth:1280}),sizes:J,alt:`${(f?e.car:e.wheel||e.car)||"Photo"} — ${w+1} of ${i.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},k),i.length>1&&n(m,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:E,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:T,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:"▷"}),n("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:[w+1," / ",i.length]})]})]}),f?n("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-[1100px]:px-9 max-[1100px]:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:d(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:$(e.wheel,!1)}),e.car&&n("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:d(e.car,!0)})]}),n("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&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:d(e.wheel)})]}),e.process&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:d(e.process)})]}),e.finish&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:d(e.finish)})]}),e.car&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:d(e.car)})]})]}),n("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[n(S,{href:e.href||"/wheels",onClick:()=>g(!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:"→"})]}),n(S,{href:a,onClick:()=>g(!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:"→"})]}),n(S,{href:u,onClick:()=>g(!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:"→"})]})]})]}):!P&&r(ne,{build:e})]})})]})}function A(t){return[t.process,t.car,t.finish].filter((o,l,s)=>!!o&&o!==t.wheel&&s.indexOf(o)===l)}function oe(t){return!!t.wheel||A(t).length>0}function R(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function ne({build:t}){const o=t.wheel,l=A(t);return n("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-[1100px]:px-9 max-[1100px]: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:$(o,!1)}),l.map(s=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:d(s)},s))]})}export{Q as GALLERY_GRID_ATTR,ge as GALLERY_ITEM_HINTS,ue as GALLERY_ITEM_SEEDS,C as GALLERY_TILE_ATTR,fe as GALLERY_TILE_PARTS,K as GalleryLinksContext,re as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as r,Fragment as N}from"react/jsx-runtime";import $e from"next/link";import{useMemo as W,useState as w}from"react";import{stripMarkup as F}from"efficient-web-builder/format/lib/markup";import{renderChrome as k,renderGold as i,renderHeadline as Ce}from"efficient-web-builder/render/components/goldPhrases";import T from"efficient-web-builder/render/components/Placeholder";import je,{LightboxClose as ze}from"./Lightbox.js";import Se from"./ThemedSelect.js";import{say as $}from"efficient-web-builder/format/lib/editor-words";const n={bodyUpTo720:"max-[720px]:text-[length:var(--size-body,15px)]",labelUpTo720:"max-[720px]:text-[length:var(--size-label,11px)]",body:"text-[length:var(--size-body,17px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"};function G(m,d){return(m??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||d}function Y(m){const d=[m.image,...(m.photos??[]).map(u=>u?.src)].filter(u=>!!u);return d.length?d:[""]}const O=6,Le=()=>Array.from({length:O},(m,d)=>({image:"",process:$("Tag"),eyebrow:$("Category"),name:$("Item name"),meta:$("{n} photos",{n:`0${d+1}`})}));function _e({mode:m="both",kicker:d,breadcrumbLabel:u,vehicleTabLabel:X="Gallery A",vehicleTitle:ee,vehicleBody1:te,vehicleBody2:ae,vehicleStats:re,vehicleCards:B,wheelTabLabel:U="Gallery B",wheelTitle:ne,wheelBody1:le,wheelBody2:se,wheelStats:oe,wheelCards:E,othersTitle:ie,othersBody1:ce,othersBody2:pe,othersStats:me,othersCards:de,showBreadcrumb:xe=!0,showStats:ge=!0,showIntro:ue=!0,showTabs:fe=!0,showFilters:H=!0,showCount:M=!0,showSort:I=!0,previewTab:C,previewHover:he=!1,editing:b=!1}){const j=m==="both",v=j?["vehicles","wheels"]:m==="wheels"?["wheels"]:m==="others"?["others"]:["vehicles"],[Z,be]=w(v[0]),y=(b&&j&&C&&v.includes(C)?C:null)??(v.includes(Z)?Z:v[0]),ve=b&&he,[z,D]=w("all"),[S,ye]=w("newest"),[L,h]=w(null),l=y==="vehicles"?{title:ee,body1:te,body2:ae,stats:re??[],cards:B??[],unit:"items",word:X}:y==="others"?{title:ie,body1:ce,body2:pe,stats:me??[],cards:de??[],unit:"items",word:"Others"}:{title:ne,body1:le,body2:se,stats:oe??[],cards:E??[],unit:"items",word:U},V=W(()=>{const e=[];for(const a of l.cards)a.process&&!e.includes(a.process)&&e.push(a.process);return e},[l.cards]),_=z!=="all"&&V.includes(z)?z:"all",q=_==="all"?l.cards:l.cards.filter(e=>e.process===_),J=W(()=>{const e=[...q];return S==="name"&&e.sort((a,o)=>(a.name??"").localeCompare(o.name??"")),e},[q,S]),K=l.cards.length===0,A=b&&K,P=A?Le():J,Ne=A?O:l.cards.length,we=A?O:J.length,Q=d?`${d} · ${F(l.word)}`:void 0;function ke(e){e!==y&&(be(e),D("all"))}return r("section",{className:"relative z-[2] bg-bg",children:[xe&&r("nav",{className:`mx-auto flex max-w-[var(--sf-site-width,1600px)] items-center gap-4 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[720px]:py-4`,children:[t("span",{className:"hover:text-fg",children:"Home"}),t("span",{className:"opacity-40",children:"/"}),t("span",{className:"text-fg",children:u?k(u):"Gallery"})]}),r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-end gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] pt-[100px] pb-[60px] max-[1100px]:grid-cols-1 max-[1100px]:gap-5 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-[60px]",children:[t("span",{className:`pb-4 font-mono ${n.labelXl} uppercase tracking-[0.3em] text-accent`,children:Q?i(Q):null}),t("h2",{className:"font-display text-[length:min(var(--size-headingLarge,clamp(64px,9vw,140px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.9] tracking-[-0.04em]",children:l.title?Ce(l.title,!0):null}),t("div",{className:`pb-4 text-right font-mono ${n.labelLarge} uppercase leading-[1.8] tracking-[0.18em] text-fg-dim max-[1100px]:text-left`,children:ge&&l.stats.map((e,a)=>r("div",{children:[e.value?t("strong",{className:"font-normal text-fg",children:i(e.value)}):null," ",e.label?i(e.label):null]},a))})]}),ue&&(l.body1||l.body2)&&r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-2 gap-[60px] px-[var(--sf-site-gutter,40px)] pt-8 max-[1100px]:grid-cols-1 max-[1100px]:gap-4 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[l.body1&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body1)}),l.body2&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body2)})]}),j&&fe&&t("div",{className:"mx-auto mt-10 flex max-w-[var(--sf-site-width,1600px)] items-stretch border-y border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[720px]:px-3",children:["vehicles","wheels"].map((e,a)=>{const o=y===e,c=e==="vehicles"?X:U,f=e==="vehicles"?(B??[]).length:(E??[]).length,p=(c||"").trim().split(/\s+/),x=p.slice(0,-1).join(" "),s=p.slice(-1)[0]??"";return r("button",{type:"button",onClick:()=>ke(e),className:["group relative grid flex-1 cursor-pointer grid-cols-[auto_1fr_auto] items-end gap-5 px-6 py-8 text-left transition-colors",a===0?"border-r border-line":"","max-[720px]:grid-cols-[auto_1fr] max-[720px]:items-center max-[720px]:gap-2 max-[720px]:px-3 max-[720px]:py-3",o?"bg-surface":"hover:bg-fg/[0.04]"].join(" "),children:[t("span",{className:[`pb-2 font-mono ${n.labelLarge} tracking-[0.3em] max-[720px]:pb-0 ${n.labelUpTo720} max-[720px]:tracking-[0.24em]`,o?"text-accent":"text-fg-dim group-hover:text-accent"].join(" "),children:a===0?"A":"B"}),r("span",{className:`font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3.6vw,48px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] ${n.bodyUpTo720}`,children:[x?r(N,{children:[k(x)," "]}):null,t("em",{className:"font-normal italic text-accent",children:k(s)})]}),r("span",{className:`pb-2 text-right font-mono ${n.labelSmall} uppercase leading-[1.7] tracking-[0.24em] text-fg-dim max-[720px]:hidden`,children:[t("strong",{className:"font-normal text-fg",children:f})," ","items",t("br",{}),e==="vehicles"?"Community photos":"Featured photos"]}),o&&t("span",{className:"pointer-events-none absolute inset-x-0 -bottom-px h-0.5 bg-accent"})]},e)})}),(H||M||I)&&r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-5 max-[720px]:grid-cols-1 max-[720px]:gap-4 max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[720px]:py-3",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[t("div",{className:"flex flex-wrap gap-1",children:H&&["all",...V].map(e=>{const a=_===e,o=e==="all"?"All":e;return t("button",{type:"button",onClick:()=>D(e),className:[`cursor-pointer border px-4 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.2em] transition-colors`,a?"border-fg bg-fg text-bg":"border-transparent text-fg-dim hover:text-fg"].join(" "),children:k(o)},e)})}),M?r("div",{className:`text-center font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[t("strong",{className:"font-normal text-accent",children:we})," / ",Ne," ",l.unit]}):t("div",{}),I?r("div",{className:`flex items-center gap-3 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:[t("span",{children:"Sort"}),r(Se,{value:S,onChange:e=>ye(e.target.value),className:`cursor-pointer border border-line bg-bg px-3 py-2 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg`,children:[t("option",{value:"newest",children:"Newest"}),t("option",{value:"featured",children:"Featured"}),t("option",{value:"name",children:"Name A–Z"})]})]}):t("div",{})]}),t("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-5 pb-20 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:P.length>0?t("div",{className:"grid grid-cols-6 gap-2 max-[1100px]:grid-cols-2 max-[720px]:grid-cols-1",children:P.map((e,a)=>{const o=Y(e)[0],f=`group relative block aspect-[4/3] w-full overflow-hidden bg-surface-2 text-left ${a<2?"col-span-3 max-[1100px]:col-span-1":"col-span-2 max-[1100px]:col-span-1"}`,p=`${e.name??"card"}-${a}`,x=r(N,{children:[t(T,{label:G(e.name,`gallery-card-${a+1}`),src:o||void 0,alt:F(e.name??""),sizes:"(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw",className:`transition-transform duration-700 ${ve?"scale-[1.04]":"group-hover:scale-[1.04]"}`}),r("div",{className:"pointer-events-none absolute inset-0 z-10 flex flex-col justify-between p-6 max-[720px]:p-3",style:{background:"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)"},children:[r("div",{className:`flex items-start justify-between font-mono ${n.labelSmall} uppercase tracking-[0.24em]`,children:[e.process?t("span",{className:"text-accent",children:i(e.process)}):t("span",{}),r("span",{className:"text-overlay-fg/70",children:[String(a+1).padStart(2,"0")," / ",String(P.length).padStart(2,"0")]})]}),r("div",{className:"flex flex-col gap-2",children:[e.eyebrow&&t("div",{className:`font-mono ${n.labelSmall} uppercase tracking-[0.24em] text-accent`,children:i(e.eyebrow)}),e.name&&t("div",{className:"font-heading3 text-[length:var(--size-headingSmall,clamp(22px,2.4vw,32px))] font-medium uppercase leading-none tracking-[-0.02em] text-overlay-fg",children:i(e.name)}),e.meta&&t("div",{className:`flex flex-wrap gap-3 pt-1 font-mono ${n.labelXs} uppercase tracking-[0.2em] text-overlay-fg/70`,children:t("span",{children:i(e.meta)})})]})]})]});return b?t("div",{className:f,children:x},p):t("button",{type:"button",onClick:()=>h({card:e,index:0}),"aria-label":`Open ${e.name??"gallery item"}`,className:`${f} cursor-pointer focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2`,children:x},p)})}):t("div",{className:`py-20 text-center font-mono ${n.labelXl} uppercase tracking-[0.2em] text-fg-dim`,children:K?"No items in this gallery yet.":"No items match this filter."})}),L&&(()=>{const e=Y(L.card),{card:a,index:o}=L,c=e.length,f=e[o]??e[0]??"",p=s=>h(g=>g&&{...g,index:(g.index+s+c)%c}),x=[a.process,a.meta].filter(Boolean).join(" · ");return r(je,{open:!0,onClose:()=>h(null),label:a.name??"Gallery item",onPrev:c>1?()=>p(-1):void 0,onNext:c>1?()=>p(1):void 0,className:"flex cursor-zoom-out flex-col items-center justify-center bg-overlay-scrim/92 p-6 backdrop-blur-sm max-[720px]:p-3",children:[r("div",{className:"relative flex w-full flex-1 items-center justify-center",children:[t("div",{className:"relative h-full max-h-[72vh] w-full max-w-[92vw]",children:t(T,{label:G(a.name,"gallery-photo"),src:f||void 0,alt:F(a.name??""),objectFit:"contain",sizes:"92vw"})}),c>1&&r(N,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:s=>{s.stopPropagation(),p(-1)},className:"absolute left-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:s=>{s.stopPropagation(),p(1)},className:"absolute right-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"})]})]}),r("div",{className:`mt-5 flex flex-col items-center gap-3 text-center font-mono ${n.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,onClick:s=>s.stopPropagation(),children:[r("div",{className:"flex flex-col items-center gap-1",children:[a.name&&t("span",{className:"text-accent",children:i(a.name)}),a.eyebrow&&t("span",{children:i(a.eyebrow)}),r("span",{className:"text-fg-dim/70",children:[x?r(N,{children:[i(x)," · "]}):null,o+1," / ",c]})]}),a.href&&t($e,{href:a.href,onClick:()=>h(null),className:`cursor-pointer border border-btn bg-btn/[0.08] px-5 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.28em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,children:"View Product →"})]}),c>1&&t("div",{onClick:s=>s.stopPropagation(),className:"mt-5 flex max-w-[92vw] gap-2 overflow-x-auto pb-1",children:e.map((s,g)=>t("button",{type:"button","aria-label":`Photo ${g+1}`,onClick:()=>h(R=>R&&{...R,index:g}),className:["relative h-16 w-24 shrink-0 cursor-pointer overflow-hidden border transition-colors max-[720px]:h-12 max-[720px]:w-16",g===o?"border-accent":"border-line opacity-60 hover:border-fg-dim hover:opacity-100"].join(" "),children:t(T,{label:G(a.name,"gallery-photo"),src:s||void 0,alt:"",sizes:"120px"})},`${s}-${g}`))}),t(ze,{})]})})()]})}export{_e as default};
1
+ "use client";import{jsx as t,jsxs as r,Fragment as N}from"react/jsx-runtime";import $e from"next/link";import{useMemo as W,useState as w}from"react";import{slugify as F}from"efficient-shell/format";import{stripMarkup as T}from"efficient-web-builder/format/lib/markup";import{renderChrome as k,renderGold as i,renderHeadline as Ce}from"efficient-web-builder/render/components/goldPhrases";import G from"efficient-web-builder/render/components/Placeholder";import je,{LightboxClose as Se}from"./Lightbox.js";import ze from"./ThemedSelect.js";import{say as $}from"efficient-web-builder/format/lib/editor-words";const n={bodyUpTo720:"max-[720px]:text-[length:var(--size-body,15px)]",labelUpTo720:"max-[720px]:text-[length:var(--size-label,11px)]",body:"text-[length:var(--size-body,17px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"};function Y(x){const g=[x.image,...(x.photos??[]).map(u=>u?.src)].filter(u=>!!u);return g.length?g:[""]}const O=6,Le=()=>Array.from({length:O},(x,g)=>({image:"",process:$("Tag"),eyebrow:$("Category"),name:$("Item name"),meta:$("{n} photos",{n:`0${g+1}`})}));function _e({mode:x="both",kicker:g,breadcrumbLabel:u,vehicleTabLabel:X="Gallery A",vehicleTitle:ee,vehicleBody1:te,vehicleBody2:ae,vehicleStats:re,vehicleCards:B,wheelTabLabel:U="Gallery B",wheelTitle:ne,wheelBody1:le,wheelBody2:se,wheelStats:oe,wheelCards:E,othersTitle:ie,othersBody1:ce,othersBody2:pe,othersStats:me,othersCards:de,showBreadcrumb:xe=!0,showStats:ge=!0,showIntro:ue=!0,showTabs:fe=!0,showFilters:H=!0,showCount:M=!0,showSort:I=!0,previewTab:C,previewHover:he=!1,editing:b=!1}){const j=x==="both",v=j?["vehicles","wheels"]:x==="wheels"?["wheels"]:x==="others"?["others"]:["vehicles"],[Z,be]=w(v[0]),y=(b&&j&&C&&v.includes(C)?C:null)??(v.includes(Z)?Z:v[0]),ve=b&&he,[S,D]=w("all"),[z,ye]=w("newest"),[L,h]=w(null),l=y==="vehicles"?{title:ee,body1:te,body2:ae,stats:re??[],cards:B??[],unit:"items",word:X}:y==="others"?{title:ie,body1:ce,body2:pe,stats:me??[],cards:de??[],unit:"items",word:"Others"}:{title:ne,body1:le,body2:se,stats:oe??[],cards:E??[],unit:"items",word:U},V=W(()=>{const e=[];for(const a of l.cards)a.process&&!e.includes(a.process)&&e.push(a.process);return e},[l.cards]),_=S!=="all"&&V.includes(S)?S:"all",q=_==="all"?l.cards:l.cards.filter(e=>e.process===_),J=W(()=>{const e=[...q];return z==="name"&&e.sort((a,o)=>(a.name??"").localeCompare(o.name??"")),e},[q,z]),K=l.cards.length===0,A=b&&K,P=A?Le():J,Ne=A?O:l.cards.length,we=A?O:J.length,Q=g?`${g} · ${T(l.word)}`:void 0;function ke(e){e!==y&&(be(e),D("all"))}return r("section",{className:"relative z-[2] bg-bg",children:[xe&&r("nav",{className:`mx-auto flex max-w-[var(--sf-site-width,1600px)] items-center gap-4 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[720px]:py-4`,children:[t("span",{className:"hover:text-fg",children:"Home"}),t("span",{className:"opacity-40",children:"/"}),t("span",{className:"text-fg",children:u?k(u):"Gallery"})]}),r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-end gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] pt-[100px] pb-[60px] max-[1100px]:grid-cols-1 max-[1100px]:gap-5 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-[60px]",children:[t("span",{className:`pb-4 font-mono ${n.labelXl} uppercase tracking-[0.3em] text-accent`,children:Q?i(Q):null}),t("h2",{className:"font-display text-[length:min(var(--size-headingLarge,clamp(64px,9vw,140px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.9] tracking-[-0.04em]",children:l.title?Ce(l.title,!0):null}),t("div",{className:`pb-4 text-right font-mono ${n.labelLarge} uppercase leading-[1.8] tracking-[0.18em] text-fg-dim max-[1100px]:text-left`,children:ge&&l.stats.map((e,a)=>r("div",{children:[e.value?t("strong",{className:"font-normal text-fg",children:i(e.value)}):null," ",e.label?i(e.label):null]},a))})]}),ue&&(l.body1||l.body2)&&r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-2 gap-[60px] px-[var(--sf-site-gutter,40px)] pt-8 max-[1100px]:grid-cols-1 max-[1100px]:gap-4 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[l.body1&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body1)}),l.body2&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body2)})]}),j&&fe&&t("div",{className:"mx-auto mt-10 flex max-w-[var(--sf-site-width,1600px)] items-stretch border-y border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[720px]:px-3",children:["vehicles","wheels"].map((e,a)=>{const o=y===e,c=e==="vehicles"?X:U,f=e==="vehicles"?(B??[]).length:(E??[]).length,p=(c||"").trim().split(/\s+/),m=p.slice(0,-1).join(" "),s=p.slice(-1)[0]??"";return r("button",{type:"button",onClick:()=>ke(e),className:["group relative grid flex-1 cursor-pointer grid-cols-[auto_1fr_auto] items-end gap-5 px-6 py-8 text-left transition-colors",a===0?"border-r border-line":"","max-[720px]:grid-cols-[auto_1fr] max-[720px]:items-center max-[720px]:gap-2 max-[720px]:px-3 max-[720px]:py-3",o?"bg-surface":"hover:bg-fg/[0.04]"].join(" "),children:[t("span",{className:[`pb-2 font-mono ${n.labelLarge} tracking-[0.3em] max-[720px]:pb-0 ${n.labelUpTo720} max-[720px]:tracking-[0.24em]`,o?"text-accent":"text-fg-dim group-hover:text-accent"].join(" "),children:a===0?"A":"B"}),r("span",{className:`font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3.6vw,48px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] ${n.bodyUpTo720}`,children:[m?r(N,{children:[k(m)," "]}):null,t("em",{className:"font-normal italic text-accent",children:k(s)})]}),r("span",{className:`pb-2 text-right font-mono ${n.labelSmall} uppercase leading-[1.7] tracking-[0.24em] text-fg-dim max-[720px]:hidden`,children:[t("strong",{className:"font-normal text-fg",children:f})," ","items",t("br",{}),e==="vehicles"?"Community photos":"Featured photos"]}),o&&t("span",{className:"pointer-events-none absolute inset-x-0 -bottom-px h-0.5 bg-accent"})]},e)})}),(H||M||I)&&r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-5 max-[720px]:grid-cols-1 max-[720px]:gap-4 max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[720px]:py-3",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[t("div",{className:"flex flex-wrap gap-1",children:H&&["all",...V].map(e=>{const a=_===e,o=e==="all"?"All":e;return t("button",{type:"button",onClick:()=>D(e),className:[`cursor-pointer border px-4 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.2em] transition-colors`,a?"border-fg bg-fg text-bg":"border-transparent text-fg-dim hover:text-fg"].join(" "),children:k(o)},e)})}),M?r("div",{className:`text-center font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[t("strong",{className:"font-normal text-accent",children:we})," / ",Ne," ",l.unit]}):t("div",{}),I?r("div",{className:`flex items-center gap-3 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:[t("span",{children:"Sort"}),r(ze,{value:z,onChange:e=>ye(e.target.value),className:`cursor-pointer border border-line bg-bg px-3 py-2 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg`,children:[t("option",{value:"newest",children:"Newest"}),t("option",{value:"featured",children:"Featured"}),t("option",{value:"name",children:"Name A–Z"})]})]}):t("div",{})]}),t("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-5 pb-20 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:P.length>0?t("div",{className:"grid grid-cols-6 gap-2 max-[1100px]:grid-cols-2 max-[720px]:grid-cols-1",children:P.map((e,a)=>{const o=Y(e)[0],f=`group relative block aspect-[4/3] w-full overflow-hidden bg-surface-2 text-left ${a<2?"col-span-3 max-[1100px]:col-span-1":"col-span-2 max-[1100px]:col-span-1"}`,p=`${e.name??"card"}-${a}`,m=r(N,{children:[t(G,{label:F(e.name)||`gallery-card-${a+1}`,src:o||void 0,alt:T(e.name??""),sizes:"(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw",className:`transition-transform duration-700 ${ve?"scale-[1.04]":"group-hover:scale-[1.04]"}`}),r("div",{className:"pointer-events-none absolute inset-0 z-10 flex flex-col justify-between p-6 max-[720px]:p-3",style:{background:"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)"},children:[r("div",{className:`flex items-start justify-between font-mono ${n.labelSmall} uppercase tracking-[0.24em]`,children:[e.process?t("span",{className:"text-accent",children:i(e.process)}):t("span",{}),r("span",{className:"text-overlay-fg/70",children:[String(a+1).padStart(2,"0")," / ",String(P.length).padStart(2,"0")]})]}),r("div",{className:"flex flex-col gap-2",children:[e.eyebrow&&t("div",{className:`font-mono ${n.labelSmall} uppercase tracking-[0.24em] text-accent`,children:i(e.eyebrow)}),e.name&&t("div",{className:"font-heading3 text-[length:var(--size-headingSmall,clamp(22px,2.4vw,32px))] font-medium uppercase leading-none tracking-[-0.02em] text-overlay-fg",children:i(e.name)}),e.meta&&t("div",{className:`flex flex-wrap gap-3 pt-1 font-mono ${n.labelXs} uppercase tracking-[0.2em] text-overlay-fg/70`,children:t("span",{children:i(e.meta)})})]})]})]});return b?t("div",{className:f,children:m},p):t("button",{type:"button",onClick:()=>h({card:e,index:0}),"aria-label":`Open ${e.name??"gallery item"}`,className:`${f} cursor-pointer focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2`,children:m},p)})}):t("div",{className:`py-20 text-center font-mono ${n.labelXl} uppercase tracking-[0.2em] text-fg-dim`,children:K?"No items in this gallery yet.":"No items match this filter."})}),L&&(()=>{const e=Y(L.card),{card:a,index:o}=L,c=e.length,f=e[o]??e[0]??"",p=s=>h(d=>d&&{...d,index:(d.index+s+c)%c}),m=[a.process,a.meta].filter(Boolean).join(" · ");return r(je,{open:!0,onClose:()=>h(null),label:a.name??"Gallery item",onPrev:c>1?()=>p(-1):void 0,onNext:c>1?()=>p(1):void 0,className:"flex cursor-zoom-out flex-col items-center justify-center bg-overlay-scrim/92 p-6 backdrop-blur-sm max-[720px]:p-3",children:[r("div",{className:"relative flex w-full flex-1 items-center justify-center",children:[t("div",{className:"relative h-full max-h-[72vh] w-full max-w-[92vw]",children:t(G,{label:F(a.name)||"gallery-photo",src:f||void 0,alt:T(a.name??""),objectFit:"contain",sizes:"92vw"})}),c>1&&r(N,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:s=>{s.stopPropagation(),p(-1)},className:"absolute left-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:s=>{s.stopPropagation(),p(1)},className:"absolute right-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"})]})]}),r("div",{className:`mt-5 flex flex-col items-center gap-3 text-center font-mono ${n.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,onClick:s=>s.stopPropagation(),children:[r("div",{className:"flex flex-col items-center gap-1",children:[a.name&&t("span",{className:"text-accent",children:i(a.name)}),a.eyebrow&&t("span",{children:i(a.eyebrow)}),r("span",{className:"text-fg-dim/70",children:[m?r(N,{children:[i(m)," · "]}):null,o+1," / ",c]})]}),a.href&&t($e,{href:a.href,onClick:()=>h(null),className:`cursor-pointer border border-btn bg-btn/[0.08] px-5 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.28em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,children:"View Product →"})]}),c>1&&t("div",{onClick:s=>s.stopPropagation(),className:"mt-5 flex max-w-[92vw] gap-2 overflow-x-auto pb-1",children:e.map((s,d)=>t("button",{type:"button","aria-label":`Photo ${d+1}`,onClick:()=>h(R=>R&&{...R,index:d}),className:["relative h-16 w-24 shrink-0 cursor-pointer overflow-hidden border transition-colors max-[720px]:h-12 max-[720px]:w-16",d===o?"border-accent":"border-line opacity-60 hover:border-fg-dim hover:opacity-100"].join(" "),children:t(G,{label:F(a.name)||"gallery-photo",src:s||void 0,alt:"",sizes:"120px"})},`${s}-${d}`))}),t(Se,{})]})})()]})}export{_e as default};
@@ -1,7 +1,8 @@
1
+ import { type HeaderCall } from "./HeaderCallButton.js";
1
2
  import { type HeaderSettings } from "../lib/api/index.js";
2
3
  import type { PreviewHeaderSettings } from "efficient-web-builder/render/components/PreviewHeaderContext";
3
4
  export default function Header({ previewSettings, initialSettings, editorPreview, showThemeToggle, wordmark, hideLogo, hideMenu, siteName, commerceEnabled, }?: {
4
- previewSettings?: PreviewHeaderSettings;
5
+ previewSettings?: PreviewHeaderSettings & HeaderCall;
5
6
  initialSettings?: HeaderSettings | null;
6
7
  editorPreview?: boolean;
7
8
  showThemeToggle?: boolean;
@@ -1 +1 @@
1
- "use client";import{jsx as o,Fragment as I,jsxs as s}from"react/jsx-runtime";import te from"next/link";import{usePathname as Ke}from"next/navigation";import{useCallback as Ve,useEffect as O,useState as p}from"react";import{useCart as qe}from"./CartContext.js";import{useSearch as Ye}from"./SearchContext.js";import Je,{useCountrySelectShows as Xe}from"./CountrySelect.js";import{resolveCountryShowAs as Qe}from"../lib/content/country-show-as.js";import ne from"./HeaderNavItem.js";import Ze from"efficient-web-builder/render/components/Logo";import et from"./MenuPlaceholderLabel.js";import{withRMark as re}from"efficient-web-builder/render/components/RMark";import{AccountButton as tt,CartButton as nt,SearchButton as rt}from"./HeaderTools.js";import{useHeaderBar as ot}from"./useHeaderBar.js";import{useModalDismiss as st}from"./useModalDismiss.js";import at from"./ThemeToggle.js";import{products as lt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as it}from"../lib/header-settings-fetch.js";import{HEADER_MENU_PLACEHOLDER_COUNT as ct}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as dt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as mt,resolveChromeWidth as ut}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as ht}from"../lib/content/header-theme.js";import{headerSolidBackground as ft,isProductPage as pt}from"../lib/content/header-bar.js";import{surfaceIsLight as gt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as bt,HEADER_SET_HEIGHT_CSS as xt}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_ATTR as vt,HEADER_INK_OVERRIDE_ATTR as yt,resolveHeaderInkMode as wt}from"efficient-web-builder/render/lib/document/header-ink";const oe={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},St=Array.from({length:ct},()=>({href:"#",label:o(et,{})}));function kt({previewSettings:g,initialSettings:$,editorPreview:T,showThemeToggle:se,wordmark:ae,hideLogo:le,hideMenu:ie,siteName:L,commerceEnabled:b=!0}={}){const M=Ke(),[ce,de]=p(!1);O(()=>{const e=v.current?.ownerDocument??document,t=()=>de(e.querySelector(`[${vt}="light"]`)!=null);t();const f=requestAnimationFrame(t);return()=>cancelAnimationFrame(f)},[M]);const z=pt(M),[c,w]=p(!1),{open:me,totals:ue}=qe(),{open:he}=Ye(),[C,fe]=p(!1),[pe,ge]=p(null),[be,xe]=p(null),[n,ve]=p($??null),r=g??(n?{logoUrl:n.logoUrl,reverseLogo:n.reverseLogo,logoReversed:n.logoReversed,logoInkIsDark:n.logoInkIsDark,logoPosition:n.logoPosition,logoSize:n.logoSize,logoSizePx:n.logoSizePx,menuItems:(n.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[]})),menuSplit:n.menuSplit??3,menuPosition:n.menuPosition,menuRow:n.menuRow,menuGapPx:n.menuGapPx??null,searchEnabled:n.searchEnabled,searchPosition:n.searchPosition,searchRow:n.searchRow,countrySelectorEnabled:n.countrySelectorEnabled,countrySelectorShowAs:n.countrySelectorShowAs,countryUrls:n.countryUrls,accountEnabled:n.accountEnabled,cartEnabled:n.cartEnabled,utilStyle:n.utilStyle,navTextCase:n.navTextCase,lightReverseText:n.lightReverseText,topTextColor:n.topTextColor,transparentTop:n.transparentTop,surface:n.surface,theme:n.theme,width:n.width,heightPx:n.heightPx,sticky:n.sticky}:null),ye=le?null:r?.logoUrl??null,we=r?.reverseLogo??!1,Se=r?.logoReversed??null,ke=r?.logoInkIsDark??null,i=r?.logoPosition??"center",Ne=r?.logoSize??"medium",Pe=r?.logoSizePx??null,B=Math.min(Math.max(r?.menuSplit??3,1),4),Ee=(r?.menuPosition??"left")==="center",Ie=(r?.menuPosition??"left")==="beside",U=(r?.menuRow??"top")==="inline",F=r?.menuGapPx??null,$e=F!=null?{gap:`${F}px`}:void 0,S=U?oe.inline:oe.stacked,Te=r?.searchEnabled??!1,G=r?.searchPosition??"right",Le=r?.countrySelectorEnabled??!0,Ce=Qe(r?.countrySelectorShowAs),_=r?.accountEnabled??!0,_e=r?.cartEnabled??!0,A=(r?.utilStyle??"icon")==="text",a=`mono-eyebrow${(r?.navTextCase??"uppercase")==="capitalised"?" mono-eyebrow-plain":""}`,W=r?.countryUrls??{},Ae=ut(r?.width),De=mt(Ae)??void 0,Re=r?.heightPx??bt.default,K=r?.sticky??"always",k=wt(r?.topTextColor),m=ht(r?.theme),N=Object.keys(W),V=Xe(N.length?N:void 0),x=Le?o(Je,{countries:N.length?N:void 0,urls:g?void 0:W,showAs:Ce}):null,{headerRef:v,scrolled:q,navHidden:He}=ot({stickyMode:K,heightPx:Re}),je=m?JSON.stringify(m.style):null;O(()=>{const e=v.current?.ownerDocument??document,t=e.defaultView??window,f=ee=>ee?gt(t.getComputedStyle(ee).getPropertyValue("--bg")):null,Z=()=>{fe(e.documentElement.getAttribute("data-theme")==="light"),ge(f(e.body)),xe(f(v.current))};Z();const j=new MutationObserver(Z);return j.observe(e.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e.body&&j.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>j.disconnect()},[v,je]);const y=se??dt?o(at,{}):null;O(()=>{if(!it({editorPreview:!!T,hasPreviewSettings:!!g,hasInitialSettings:!!$}))return;let e=!1;return lt.getHeaderSettings().then(t=>!e&&ve(t)).catch(t=>{console.warn("[header] settings fetch failed; using built-in defaults",t)}),()=>{e=!0}},[T,g,$]);const P=q||z,Y=ft(C,z),J=k==="auto"?ce:k==="light",Oe=P||!J,Me=P?be??C:(pe??C)&&!J,ze=k==="auto"?null:{[yt]:k},Be=Ve(()=>w(!1),[]);st({active:c,onDismiss:Be});const d=(e,t,f="start")=>o(ne,{item:e,dropdownAlign:f},t),Ue=!ie&&(r?.menuItems?.length??0)>0,X=!!T||!!g,l=Ue?r.menuItems.map(e=>({href:e.url||"",label:re(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(t=>({href:t.url||"",label:re(t.label),plainLabel:t.label}))})):X?St.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Fe=l.length>0||b&&_||!!x&&V||!!y,Ge=i==="center"?l.slice(0,B):i==="right"?l:[],We=i==="center"?l.slice(B):i==="left"?l:[],E=Te&&b?o(rt,{onClick:X?void 0:he,asText:A}):null,D=b&&_?o(tt,{asText:A}):null,R=e=>b&&_e?o(nt,{onClick:me,count:ue.sets,asText:A,className:e}):null,u=s(I,{children:[G==="left"?E:null,x,y,D,R(),G==="right"?E:null]}),H=(e,t=!1)=>o(te,{href:"/","aria-label":L?`${L} home`:"Home",className:e,children:o(Ze,{variant:"header",scrolled:Oe,src:ye,reverse:we,onLightSurface:Me,reversedSrc:Se,inkIsDark:ke,size:Ne,sizePx:Pe,wordmark:ae,siteName:L,fitToContainer:t})}),h=H("inline-flex shrink-0 items-center justify-center"),Q="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(I,{children:[o("header",{ref:v,"data-scrolled":q||void 0,...ze,className:["sf-site-header",...m?[m.className]:[],K==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",P?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:xt,...He?{transform:"translateY(-100%)"}:null,...P?{background:Y,color:"var(--fg)","--sf-header-ground":Y}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:De,children:[Ee?s("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?o("nav",{className:`${a} flex items-center gap-8`,children:u}):o("div",{className:"flex items-center",children:h}),o("nav",{className:`${a} flex items-center justify-center gap-8`,children:l.map((e,t)=>d(e,`${e.href}-${t}`,"center"))}),i==="right"?o("div",{className:"flex items-center justify-end",children:h}):o("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):i==="center"?s("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[o("nav",{className:`${a} flex items-center gap-8`,children:Ge.map((e,t)=>d(e,`${e.href}-${t}`))}),h,s("nav",{className:`${a} flex items-center justify-end gap-8`,children:[We.map((e,t)=>d(e,`${e.href}-${t}`,"end")),u]})]}):Ie?s("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:$e,children:[h,o("nav",{className:`${a} flex items-center gap-8`,children:l.map((e,t)=>d(e,`${e.href}-${t}`))})]}),o("nav",{className:`${a} flex items-center justify-end gap-8`,children:u})]}):o("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:i==="right"?s(I,{children:[s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,t)=>d(e,`${e.href}-${t}`)),u]}),h]}):s(I,{children:[h,s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,t)=>d(e,`${e.href}-${t}`)),u]})]})}),!U&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[H(Q,!0),s("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[E,x,y,D,R()]})]}),o("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:l.map((e,t)=>d(e,`${e.href}-${t}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[H(Q,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[E,D,R(a),Fe&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>w(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),o("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[l.map((e,t)=>o(ne,{item:e,mobile:!0,onNavigate:()=>w(!1)},`${e.href}-${t}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[b&&_&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),o(te,{href:"/account",onClick:()=>w(!1),className:"mono-eyebrow underline",children:"Your account"})]}),x&&V&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),x]}),y&&s("div",{className:"flex items-center justify-between",children:[o("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),y]})]})]})]})}export{kt as default};
1
+ "use client";import{jsx as r,Fragment as $,jsxs as a}from"react/jsx-runtime";import oe from"next/link";import{usePathname as Ye}from"next/navigation";import{useCallback as Je,useEffect as M,useState as p}from"react";import{useCart as Xe}from"./CartContext.js";import{useSearch as Qe}from"./SearchContext.js";import Ze,{useCountrySelectShows as et}from"./CountrySelect.js";import{resolveCountryShowAs as tt}from"../lib/content/country-show-as.js";import re from"./HeaderNavItem.js";import nt from"efficient-web-builder/render/components/Logo";import ot from"./MenuPlaceholderLabel.js";import{withRMark as ae}from"efficient-web-builder/render/components/RMark";import{AccountButton as rt,CartButton as at,SearchButton as lt}from"./HeaderTools.js";import st from"./HeaderCallButton.js";import{useHeaderBar as ct}from"./useHeaderBar.js";import{useModalDismiss as it}from"./useModalDismiss.js";import dt from"./ThemeToggle.js";import{products as mt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as ut}from"../lib/header-settings-fetch.js";import{HEADER_MENU_PLACEHOLDER_COUNT as ht}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as ft}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as pt,resolveChromeWidth as gt}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as bt}from"../lib/content/header-theme.js";import{headerSolidBackground as xt,isProductPage as vt}from"../lib/content/header-bar.js";import{surfaceIsLight as yt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as wt,HEADER_SET_HEIGHT_CSS as St}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_ATTR as kt,HEADER_INK_OVERRIDE_ATTR as Nt,resolveHeaderInkMode as Pt}from"efficient-web-builder/render/lib/document/header-ink";const le={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},Et=Array.from({length:ht},()=>({href:"#",label:r(ot,{})}));function It({previewSettings:g,initialSettings:T,editorPreview:L,showThemeToggle:se,wordmark:ce,hideLogo:ie,hideMenu:de,siteName:C,commerceEnabled:b=!0}={}){const z=Ye(),[me,ue]=p(!1);M(()=>{const e=v.current?.ownerDocument??document,n=()=>ue(e.querySelector(`[${kt}="light"]`)!=null);n();const f=requestAnimationFrame(n);return()=>cancelAnimationFrame(f)},[z]);const U=vt(z),[i,w]=p(!1),{open:he,totals:fe}=Xe(),{open:pe}=Qe(),[_,ge]=p(!1),[be,xe]=p(null),[ve,ye]=p(null),[t,we]=p(T??null),o=g??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[]})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),Se=ie?null:o?.logoUrl??null,ke=o?.reverseLogo??!1,Ne=o?.logoReversed??null,Pe=o?.logoInkIsDark??null,c=o?.logoPosition??"center",Ee=o?.logoSize??"medium",Ie=o?.logoSizePx??null,F=Math.min(Math.max(o?.menuSplit??3,1),4),$e=(o?.menuPosition??"left")==="center",Te=(o?.menuPosition??"left")==="beside",G=(o?.menuRow??"top")==="inline",W=o?.menuGapPx??null,Le=W!=null?{gap:`${W}px`}:void 0,S=G?le.inline:le.stacked,Ce=o?.searchEnabled??!1,K=o?.searchPosition??"right",_e=o?.countrySelectorEnabled??!0,He=tt(o?.countrySelectorShowAs),H=o?.accountEnabled??!0,Ae=o?.cartEnabled??!0,A=(o?.utilStyle??"icon")==="text",l=`mono-eyebrow${(o?.navTextCase??"uppercase")==="capitalised"?" mono-eyebrow-plain":""}`,V=o?.countryUrls??{},De=gt(o?.width),Re=pt(De)??void 0,je=o?.heightPx??wt.default,q=o?.sticky??"always",k=Pt(o?.topTextColor),m=bt(o?.theme),N=Object.keys(V),Y=et(N.length?N:void 0),x=_e?r(Ze,{countries:N.length?N:void 0,urls:g?void 0:V,showAs:He}):null,{headerRef:v,scrolled:J,navHidden:Oe}=ct({stickyMode:q,heightPx:je}),Be=m?JSON.stringify(m.style):null;M(()=>{const e=v.current?.ownerDocument??document,n=e.defaultView??window,f=ne=>ne?yt(n.getComputedStyle(ne).getPropertyValue("--bg")):null,te=()=>{ge(e.documentElement.getAttribute("data-theme")==="light"),xe(f(e.body)),ye(f(v.current))};te();const B=new MutationObserver(te);return B.observe(e.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e.body&&B.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>B.disconnect()},[v,Be]);const y=se??ft?r(dt,{}):null;M(()=>{if(!ut({editorPreview:!!L,hasPreviewSettings:!!g,hasInitialSettings:!!T}))return;let e=!1;return mt.getHeaderSettings().then(n=>!e&&we(n)).catch(n=>{console.warn("[header] settings fetch failed; using built-in defaults",n)}),()=>{e=!0}},[L,g,T]);const P=J||U,X=xt(_,U),Q=k==="auto"?me:k==="light",Me=P||!Q,ze=P?ve??_:(be??_)&&!Q,Ue=k==="auto"?null:{[Nt]:k},Fe=Je(()=>w(!1),[]);it({active:i,onDismiss:Fe});const d=(e,n,f="start")=>r(re,{item:e,dropdownAlign:f},n),Ge=!de&&(o?.menuItems?.length??0)>0,E=!!L||!!g,s=Ge?o.menuItems.map(e=>({href:e.url||"",label:ae(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(n=>({href:n.url||"",label:ae(n.label),plainLabel:n.label}))})):E?Et.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],We=s.length>0||b&&H||!!x&&Y||!!y,Ke=c==="center"?s.slice(0,F):c==="right"?s:[],Ve=c==="center"?s.slice(F):c==="left"?s:[],I=Ce&&b?r(lt,{onClick:E?void 0:pe,asText:A}):null,D=b&&H?r(rt,{asText:A}):null,R=e=>b&&Ae?r(at,{onClick:he,count:fe.sets,asText:A,className:e}):null,qe=o?.callPhone??"",Z=o?.callHref??"",j=e=>o?.callButton&&(Z||E)?r(st,{href:E?"":Z,label:e?"Call":qe||"Call"}):null,u=a($,{children:[K==="left"?I:null,x,y,D,R(),K==="right"?I:null,j(!1)]}),O=(e,n=!1)=>r(oe,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(nt,{variant:"header",scrolled:Me,src:Se,reverse:ke,onLightSurface:ze,reversedSrc:Ne,inkIsDark:Pe,size:Ee,sizePx:Ie,wordmark:ce,siteName:C,fitToContainer:n})}),h=O("inline-flex shrink-0 items-center justify-center"),ee="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return a($,{children:[r("header",{ref:v,"data-scrolled":J||void 0,...Ue,className:["sf-site-header",...m?[m.className]:[],q==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",P?"border-b border-line backdrop-blur-md":"border-b border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:St,...Oe?{transform:"translateY(-100%)"}:null,...P?{background:X,color:"var(--fg)","--sf-header-ground":X}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:a("div",{className:"w-full",style:Re,children:[$e?a("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[c==="right"?r("nav",{className:`${l} flex items-center gap-8`,children:u}):r("div",{className:"flex items-center",children:h}),r("nav",{className:`${l} flex items-center justify-center gap-8`,children:s.map((e,n)=>d(e,`${e.href}-${n}`,"center"))}),c==="right"?r("div",{className:"flex items-center justify-end",children:h}):r("nav",{className:`${l} flex items-center justify-end gap-8`,children:u})]}):c==="center"?a("div",{"data-header-band":"",className:`${S.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${l} flex items-center gap-8`,children:Ke.map((e,n)=>d(e,`${e.href}-${n}`))}),h,a("nav",{className:`${l} flex items-center justify-end gap-8`,children:[Ve.map((e,n)=>d(e,`${e.href}-${n}`,"end")),u]})]}):Te?a("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:[a("div",{className:"flex items-center gap-8",style:Le,children:[h,r("nav",{className:`${l} flex items-center gap-8`,children:s.map((e,n)=>d(e,`${e.href}-${n}`))})]}),r("nav",{className:`${l} flex items-center justify-end gap-8`,children:u})]}):r("div",{"data-header-band":"",className:`${S.flex} items-center justify-between gap-8`,children:c==="right"?a($,{children:[a("nav",{className:`${l} flex items-center gap-8`,children:[s.map((e,n)=>d(e,`${e.href}-${n}`)),u]}),h]}):a($,{children:[h,a("nav",{className:`${l} flex items-center gap-8`,children:[s.map((e,n)=>d(e,`${e.href}-${n}`)),u]})]})}),!G&&a("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[a("div",{className:"flex items-center justify-between",children:[O(ee,!0),a("div",{className:`${l} flex shrink-0 items-center gap-5`,children:[I,x,y,D,R(),j(!1)]})]}),r("nav",{className:`${l} flex items-center gap-6 border-t border-line/60 pt-3`,children:s.map((e,n)=>d(e,`${e.href}-${n}`))})]}),a("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[O(ee,!0),a("div",{className:"flex shrink-0 items-center gap-4",children:[I,D,R(l),j(!0),We&&a("button",{type:"button","aria-label":i?"Close menu":"Open menu","aria-expanded":i,onClick:()=>w(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${i?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${i?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${i?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),i&&a("div",{"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[s.map((e,n)=>r(re,{item:e,mobile:!0,onNavigate:()=>w(!1)},`${e.href}-${n}`)),a("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[b&&H&&a("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(oe,{href:"/account",onClick:()=>w(!1),className:"mono-eyebrow underline",children:"Your account"})]}),x&&Y&&a("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),x]}),y&&a("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),y]})]})]})]})}export{It as default};
@@ -0,0 +1,9 @@
1
+ export interface HeaderCall {
2
+ callButton?: boolean;
3
+ callPhone?: string;
4
+ callHref?: string;
5
+ }
6
+ export default function HeaderCallButton({ href, label }: {
7
+ href: string;
8
+ label: string;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as n}from"react/jsx-runtime";const r="sf-button inline-flex shrink-0 items-center whitespace-nowrap border border-btn bg-btn px-3 py-2 font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.12em] text-btn-ink transition-colors hover:border-btn-2 hover:bg-btn-2";function a({href:e,label:t}){return e?n("a",{href:e,className:r,"data-header-call":"",children:t}):n("span",{className:r,"data-header-call":"",children:t})}export{a as default};
@@ -12,7 +12,6 @@ export declare function AccountTool({ style }: {
12
12
  style?: ToolStyle;
13
13
  }): import("react").JSX.Element | null;
14
14
  export declare function ThemeSwitchTool(): import("react").JSX.Element | null;
15
- export declare function CountrySwitchTool({ editing, showAs, }: {
16
- editing?: boolean;
15
+ export declare function CountrySwitchTool({ showAs, }: {
17
16
  showAs?: CountryShowAs;
18
17
  }): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{useCart as u}from"./CartContext.js";import c,{useCountrySelectShows as i}from"./CountrySelect.js";import{AccountButton as a,CartButton as m,SearchButton as h}from"./HeaderTools.js";import f from"./ThemeToggle.js";import{useOfferToPhoneMenu as s}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as p}from"./SearchContext.js";import{useSiteSells as l,useSiteThemeSwitchShown as d}from"./SiteRecordContext.js";import{say as x}from"efficient-web-builder/format/lib/editor-words";function j({style:e="icon",editing:o=!1}){const{open:n}=p(),r=l();return s(r?"search":null),r?t("span",{"data-phone-menu-tool":"search",className:"contents",children:t(h,{onClick:o?void 0:n,asText:e==="text"})}):null}function k({style:e="icon",editing:o=!1}){const{open:n,totals:r}=u();return l()?t(m,{onClick:o?()=>{}:n,count:r.sets,asText:e==="text"}):null}function v({style:e="icon"}){const o=l();return s(o?"account":null),o?t(a,{asText:e==="text"}):null}function M(){const e=d();return s(e?"theme":null),e?t("span",{"data-phone-menu-tool":"theme",className:"contents",children:t(f,{})}):null}function O({editing:e=!1,showAs:o}){const n=i();return s(n?"region":null),n?t("span",{"data-phone-menu-tool":"region",className:"contents",children:t(c,{showAs:o})}):e?t("div",{"data-country-placeholder":"",className:"rounded border border-dashed border-line px-3 py-2 text-[13px] text-fg-dim",children:x("No regions yet")}):null}export{v as AccountTool,k as CartTool,O as CountrySwitchTool,j as SearchTool,M as ThemeSwitchTool};
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import{useCart as u}from"./CartContext.js";import c,{useCountrySelectShows as i}from"./CountrySelect.js";import{AccountButton as a,CartButton as m,SearchButton as h}from"./HeaderTools.js";import f from"./ThemeToggle.js";import{useOfferToPhoneMenu as r}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as p}from"./SearchContext.js";import{useSiteSells as l,useSiteThemeSwitchShown as x}from"./SiteRecordContext.js";function N({style:t="icon",editing:e=!1}){const{open:s}=p(),n=l();return r(n?"search":null),n?o("span",{"data-phone-menu-tool":"search",className:"contents",children:o(h,{onClick:e?void 0:s,asText:t==="text"})}):null}function j({style:t="icon",editing:e=!1}){const{open:s,totals:n}=u();return l()?o(m,{onClick:e?()=>{}:s,count:n.sets,asText:t==="text"}):null}function k({style:t="icon"}){const e=l();return r(e?"account":null),e?o(a,{asText:t==="text"}):null}function M(){const t=x();return r(t?"theme":null),t?o("span",{"data-phone-menu-tool":"theme",className:"contents",children:o(f,{})}):null}function O({showAs:t}){const e=i();return r(e?"region":null),e?o("span",{"data-phone-menu-tool":"region",className:"contents",children:o(c,{showAs:t})}):null}export{k as AccountTool,j as CartTool,O as CountrySwitchTool,N as SearchTool,M as ThemeSwitchTool};
@@ -0,0 +1,9 @@
1
+ import { type MessagingChannel } from "../lib/sections/messaging.js";
2
+ interface MessagingCardsProps {
3
+ title?: string;
4
+ description?: string;
5
+ channels: readonly MessagingChannel[];
6
+ contained: boolean;
7
+ }
8
+ export default function MessagingCards({ title, description, channels, contained }: MessagingCardsProps): import("react").JSX.Element | null;
9
+ export {};