efficient-storefront-blocks 0.97.0 → 0.99.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 (182) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/chunks/EditorPreviewCheckout-J76THKIJ.js +4 -0
  3. package/dist/chunks/{SiteEditorProvider-VZUU5OPZ.js → SiteEditorProvider-YAIB64UV.js} +1 -1
  4. package/dist/chunks/chunk-B2IYTOE3.js +1 -0
  5. package/dist/chunks/chunk-EIBYUCDE.js +1 -0
  6. package/dist/chunks/chunk-GOVYQQA4.js +1 -0
  7. package/dist/chunks/chunk-KRMWJLBM.js +412 -0
  8. package/dist/chunks/{fitment-data-MCGKHSA4.js → fitment-data-OUHMES66.js} +1 -1
  9. package/dist/consent.js +1 -1
  10. package/dist/contract.js +11 -3
  11. package/dist/editor/components/EditorPreviewCheckout.js +1 -1
  12. package/dist/editor/components/GalleryShowcaseSource.js +1 -1
  13. package/dist/editor/components/HeaderSettingsPanel.js +1 -1
  14. package/dist/editor/lib/document/blocks/commerce/Collections/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/commerce/SearchBlock/fields.js +1 -1
  16. package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
  17. package/dist/editor/lib/document/blocks/commerce/WheelDiagram/fields.d.ts +2 -0
  18. package/dist/editor/lib/document/blocks/commerce/WheelDiagram/fields.js +1 -0
  19. package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
  20. package/dist/editor/lib/document/blocks/commerce/index.js +1 -1
  21. package/dist/editor/lib/document/blocks/service/BookingBox/fields.js +1 -1
  22. package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -1
  23. package/dist/editor/lib/document/blocks/service/SiteHeader/fields.js +1 -1
  24. package/dist/editor/lib/document/blocks/service/SubmitBox/fields.js +1 -1
  25. package/dist/editor/lib/document/box-header-for-site.d.ts +5 -0
  26. package/dist/editor/lib/document/box-header-for-site.js +1 -1
  27. package/dist/editor/lib/document/box-header.d.ts +2 -0
  28. package/dist/editor/lib/document/box-header.js +1 -1
  29. package/dist/editor/lib/document/config.d.ts +1 -0
  30. package/dist/editor/lib/document/config.js +1 -1
  31. package/dist/editor/lib/document/popup-look-fields.d.ts +1 -0
  32. package/dist/editor/lib/document/popup-look-fields.js +1 -1
  33. package/dist/editor/lib/document/text-kind-style-rows.d.ts +5 -0
  34. package/dist/editor/lib/document/text-kind-style-rows.js +1 -0
  35. package/dist/editor/lib/efficient-block-sources.js +1 -1
  36. package/dist/editor/lib/header-settings-source.js +1 -1
  37. package/dist/editor/lib/storefront-editor-words.d.ts +6 -3
  38. package/dist/editor/lib/storefront-editor-words.js +1 -1
  39. package/dist/editor.css +1 -1
  40. package/dist/index.d.ts +12 -1
  41. package/dist/index.js +212 -44
  42. package/dist/links.js +1 -1
  43. package/dist/render/app/globals.css +136 -12
  44. package/dist/render/built-with.json +1 -1
  45. package/dist/render/components/BundleCard.js +1 -1
  46. package/dist/render/components/CatalogFilterBarSection.js +1 -1
  47. package/dist/render/components/ChatWidget.js +1 -1
  48. package/dist/render/components/CollectionCard.d.ts +3 -0
  49. package/dist/render/components/CollectionCard.js +1 -1
  50. package/dist/render/components/Collections.d.ts +2 -1
  51. package/dist/render/components/Collections.js +1 -1
  52. package/dist/render/components/CompatibleTyres.js +1 -1
  53. package/dist/render/components/CountrySelect.js +1 -1
  54. package/dist/render/components/CurrencyContext.d.ts +3 -0
  55. package/dist/render/components/CurrencyContext.js +1 -1
  56. package/dist/render/components/FooterGroup.js +1 -1
  57. package/dist/render/components/FooterLogo.js +1 -1
  58. package/dist/render/components/FooterMenu.d.ts +5 -3
  59. package/dist/render/components/FooterMenu.js +1 -1
  60. package/dist/render/components/FooterPayment.js +1 -1
  61. package/dist/render/components/FooterSection.js +1 -1
  62. package/dist/render/components/FooterSocial.js +1 -1
  63. package/dist/render/components/FooterText.js +1 -1
  64. package/dist/render/components/FormBlock.d.ts +4 -1
  65. package/dist/render/components/FormBlock.js +1 -1
  66. package/dist/render/components/Header.js +1 -1
  67. package/dist/render/components/HeaderToolBlocks.d.ts +4 -2
  68. package/dist/render/components/HeaderToolBlocks.js +1 -1
  69. package/dist/render/components/HeaderTools.d.ts +7 -2
  70. package/dist/render/components/HeaderTools.js +1 -1
  71. package/dist/render/components/PhoneSheet.d.ts +16 -0
  72. package/dist/render/components/PhoneSheet.js +1 -0
  73. package/dist/render/components/PreOrderPanel.js +1 -1
  74. package/dist/render/components/ProductGridSection.js +1 -1
  75. package/dist/render/components/ProductRef.js +1 -1
  76. package/dist/render/components/SectionGroupBody.d.ts +2 -1
  77. package/dist/render/components/SectionGroupBody.js +1 -1
  78. package/dist/render/components/SpecTable.d.ts +2 -1
  79. package/dist/render/components/SpecTable.js +1 -1
  80. package/dist/render/components/Subscribe.d.ts +1 -0
  81. package/dist/render/components/Subscribe.js +1 -1
  82. package/dist/render/components/WheelCardFrame.js +1 -1
  83. package/dist/render/components/WheelDiagram.d.ts +16 -0
  84. package/dist/render/components/WheelDiagram.js +1 -0
  85. package/dist/render/components/card-pieces/CardName.js +1 -1
  86. package/dist/render/components/card-pieces/CardPrice.js +1 -1
  87. package/dist/render/components/card-pieces/CardSurfaceFrame.d.ts +1 -1
  88. package/dist/render/components/card-pieces/ProductCardState.d.ts +1 -0
  89. package/dist/render/components/card-pieces/ProductCardState.js +1 -1
  90. package/dist/render/components/catalog/CatalogFilterBar.d.ts +5 -1
  91. package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
  92. package/dist/render/components/catalog/CatalogFilterContext.d.ts +2 -0
  93. package/dist/render/components/catalog/CatalogFilterContext.js +1 -1
  94. package/dist/render/components/catalog/FilterPill.js +1 -1
  95. package/dist/render/components/catalog/PriceRange.d.ts +6 -1
  96. package/dist/render/components/catalog/PriceRange.js +1 -1
  97. package/dist/render/components/catalog/ShopperFilters.js +1 -1
  98. package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
  99. package/dist/render/components/checkout/checkout-parts.js +1 -1
  100. package/dist/render/components/checkout/checkout-state.d.ts +5 -0
  101. package/dist/render/components/checkout/checkout-state.js +3 -3
  102. package/dist/render/components/fitment/PickerField.js +1 -1
  103. package/dist/render/components/formSubmission.d.ts +4 -2
  104. package/dist/render/components/formSubmission.js +1 -1
  105. package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
  106. package/dist/render/components/pdp-dynamic/DynamicWheelDiagram.d.ts +6 -0
  107. package/dist/render/components/pdp-dynamic/DynamicWheelDiagram.js +1 -0
  108. package/dist/render/components/pdp-dynamic/KindGate.d.ts +2 -1
  109. package/dist/render/components/pdp-dynamic/KindGate.js +1 -1
  110. package/dist/render/components/submit/SubmitRegions.js +1 -1
  111. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  112. package/dist/render/components/wheels-plp/PlpActiveChips.d.ts +2 -1
  113. package/dist/render/components/wheels-plp/PlpActiveChips.js +1 -1
  114. package/dist/render/components/wheels-plp/PlpSidebar.d.ts +15 -7
  115. package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
  116. package/dist/render/components/wheels-plp/useVehicleCatalog.d.ts +6 -1
  117. package/dist/render/components/wheels-plp/useVehicleCatalog.js +1 -1
  118. package/dist/render/lib/api/index.d.ts +4 -1
  119. package/dist/render/lib/api/index.js +1 -1
  120. package/dist/render/lib/booking/text-kinds.js +1 -1
  121. package/dist/render/lib/checkout/pay-first.d.ts +1 -0
  122. package/dist/render/lib/checkout/pay-first.js +1 -1
  123. package/dist/render/lib/consent/rules.js +1 -1
  124. package/dist/render/lib/content/article-page-seed.js +1 -1
  125. package/dist/render/lib/content/collection-card-look.d.ts +13 -0
  126. package/dist/render/lib/content/collection-card-look.js +1 -0
  127. package/dist/render/lib/content/menu-row.d.ts +16 -0
  128. package/dist/render/lib/content/menu-row.js +1 -1
  129. package/dist/render/lib/content/text-kind-vars.d.ts +4 -0
  130. package/dist/render/lib/content/text-kind-vars.js +1 -0
  131. package/dist/render/lib/countries.js +1 -1
  132. package/dist/render/lib/document/blocks/commerce/Collections/meta.d.ts +4 -0
  133. package/dist/render/lib/document/blocks/commerce/Collections/meta.js +1 -1
  134. package/dist/render/lib/document/blocks/commerce/Collections/render.js +1 -1
  135. package/dist/render/lib/document/blocks/commerce/SearchBlock/render.js +1 -1
  136. package/dist/render/lib/document/blocks/commerce/WheelDiagram/meta.d.ts +2 -0
  137. package/dist/render/lib/document/blocks/commerce/WheelDiagram/meta.js +1 -0
  138. package/dist/render/lib/document/blocks/commerce/WheelDiagram/render.d.ts +2 -0
  139. package/dist/render/lib/document/blocks/commerce/WheelDiagram/render.js +1 -0
  140. package/dist/render/lib/document/blocks/commerce/metas.d.ts +1 -0
  141. package/dist/render/lib/document/blocks/commerce/metas.js +1 -1
  142. package/dist/render/lib/document/blocks/commerce/renders.d.ts +1 -0
  143. package/dist/render/lib/document/blocks/commerce/renders.js +1 -1
  144. package/dist/render/lib/document/blocks/service/SiteHeader/render.js +1 -1
  145. package/dist/render/lib/document/card-templates.d.ts +2 -0
  146. package/dist/render/lib/document/card-templates.js +1 -1
  147. package/dist/render/lib/document/current-record.js +1 -1
  148. package/dist/render/lib/document/footer-page-blocks.js +1 -1
  149. package/dist/render/lib/document/lazy-draws.js +1 -1
  150. package/dist/render/lib/document/render-config.d.ts +4 -0
  151. package/dist/render/lib/document/render-config.js +1 -1
  152. package/dist/render/lib/document/section-to-box-rows-collections.d.ts +1 -0
  153. package/dist/render/lib/document/section-to-box-rows-collections.js +1 -0
  154. package/dist/render/lib/document/section-to-box-rows-service.js +1 -1
  155. package/dist/render/lib/document/section-to-box-rows-spec.js +1 -1
  156. package/dist/render/lib/document/template-product-kind.d.ts +1 -0
  157. package/dist/render/lib/document/template-product-kind.js +1 -1
  158. package/dist/render/lib/next-fonts.js +1 -1
  159. package/dist/render/lib/popup/text-kind-style.js +1 -1
  160. package/dist/render/lib/sections/gallery-toolbar.js +1 -1
  161. package/dist/render/lib/storefront-page-groups.js +1 -1
  162. package/dist/render/lib/submit/text-kinds.js +1 -1
  163. package/dist/render/lib/wheels/catalog-filters-to-listing.d.ts +1 -1
  164. package/dist/render/lib/wheels/catalog-filters-to-listing.js +1 -1
  165. package/dist/render/lib/wheels/fitments.js +1 -1
  166. package/dist/render/lib/wheels/plp-filters.d.ts +5 -0
  167. package/dist/render/lib/wheels/plp-filters.js +1 -1
  168. package/dist/render/lib/wheels/price-display.d.ts +5 -1
  169. package/dist/render/lib/wheels/price-display.js +1 -1
  170. package/dist/render/lib/wheels/wheel-sheet.d.ts +3 -0
  171. package/dist/render/lib/wheels/wheel-sheet.js +1 -0
  172. package/dist/render/lib/wheels/wheel-specs.js +1 -1
  173. package/dist/words.d.ts +13 -3
  174. package/dist/words.js +4 -4
  175. package/package.json +5 -4
  176. package/dist/chunks/EditorPreviewCheckout-O7F36ZXB.js +0 -4
  177. package/dist/chunks/chunk-AOZEO73W.js +0 -401
  178. package/dist/chunks/chunk-MXWQOFM6.js +0 -1
  179. package/dist/chunks/chunk-NYEB6V2R.js +0 -1
  180. package/dist/chunks/chunk-SQ62RGWV.js +0 -1
  181. /package/dist/chunks/{chunk-AOZEO73W.js.LEGAL.txt → chunk-KRMWJLBM.js.LEGAL.txt} +0 -0
  182. /package/dist/chunks/{chunk-UFEEFZ5M.js → chunk-QP2F42DV.js} +0 -0
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 ue=["main","text","background","muted"],en=[...ue,"surface"];var nn={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",style:"styled text"};var ce=[{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 _=[{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}],pe=["highlight","quiet"],tn=ce.map(e=>e.style).filter(e=>_.some(n=>n.kind===e)).filter(e=>!pe.includes(e)),rn=[..._,{open:"*",close:"*",kind:"accent"}],on=[..._,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var sn=["http","https","mailto","tel"];function $(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||sn.includes(n[1].toLowerCase())}var de=["width","profile","rim"];var ln=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,an={width:[100,500],profile:[20,100],rim:[10,30]};function B(e){let n=ln.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return de.every(o=>{let[i,a]=an[o];return t[o]>=i&&t[o]<=a})?t:null}function R(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 fe(e){return[R({width:e.width}),R({width:e.width,profile:e.profile}),R(e)]}var k=["alloy-wheel","tyre"],me=["alloy-wheel"],F={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var yt=k.map(e=>({value:e,label:F[e]}));function O(e){return e==null?[...me]:Array.isArray(e)?k.filter(n=>e.includes(n)):[...me]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function W(e){return m(e).brand??""}function ge(e){return m(e).prices??void 0}function he(e){return m(e).inStock!==!1}function ye(e){let n=m(e),t=d(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function G(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function Pe(e){return G(e).map(n=>n.family)}function H(e){if(d(e)==="tyre")return[];let n=m(e);return Array.isArray(n.categories)?n.categories:n.process?[n.process]:[]}function Se(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function be(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ke(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function xe(e){if(d(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>B(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var Y=e=>typeof e=="string"&&e?e:void 0;var we=null;function Te(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=we?we[e]:void 0;if(typeof t=="function"){try{let r=Y(t(n??{}));if(r)return r}catch{}return Te(e,n)}return Te(Y(t)??e,n)}function V(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var A=(e,n,t,r)=>({default:e,min:n,max:t,step:r}),wt=A(30,0,100,10),Tt=A(0,0,100,5),Lt=A(100,0,100,5),_t=A(2,0,4,.5);function Le(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var _e="homepage";var E=[{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 I(e){return e.offersCommerce&&e.offersService?E:E.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var q="#popup:";function Re(e){return`${q}${e}`}function Fe(e){return e.startsWith(q)&&e.slice(q.length).trim()||null}function P(e){return e===_e?"/":`/${e}`}function N(e){return`/journal/${e}`}function C(e){return`/wheels/${e}`}function v(e,n){return`${P(e)}#${n}`}function D(...e){let n=new Set,t=[];for(let r of e)for(let o of r?.content??[]){let i=Le(o?.props?.anchor);if(!i)continue;let a=V(i);!a||n.has(a)||(n.add(a),t.push({slug:a,name:i}))}return t}function Oe(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var un=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function K(e,n,t){if(!e)return"page";if(Fe(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Oe(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 Ae(e,n){let t=un(),r=e.pages.map(s=>({value:P(s.slug),label:s.title})),o=n?.pageOptions?n.pageOptions(r):r,i=o.map(s=>s.value),a=e.pages.map(s=>({label:s.title,options:D(...s.docs).map(u=>({value:v(s.slug,u.slug),label:u.name}))})).filter(s=>s.options.length>0),p=s=>{switch(s){case"page":return{type:"select",options:o,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:a,placeholder:a.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:N(u.slug),label:u.title||u.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:Re(u.slug),label:u.title||u.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},l=I(e.offers).map(s=>({value:s.value,label:y(s.label),target:p(s.value),...s.value==="anchor"?{hint:t.sectionHint}:{},...s.value==="blog"||s.value==="product"||s.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:l,rules:{kindOf:s=>K(s,i),targetOf:s=>s,readFilter:()=>null,withFilter:s=>s}};let c=s=>{let u=n.withFilter(s,null);return n.listingPaths.includes(u)?u:s};return{kinds:l,rules:{kindOf:s=>K(s,i,{listingPaths:n.listingPaths,targetOf:c}),targetOf:c,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:s=>n.listingPaths.includes(s)?n.filtersFor(s):null}}var Ee=Object.freeze([]);function j(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function Ie(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let i=o[t];if(typeof i!="number"||!Number.isFinite(i))continue;let a=r.get(o.fieldKey);(a===void 0||i<a)&&r.set(o.fieldKey,i)}return o=>o?r.get(o):void 0}function Ne(e,n,t,r){let o=new Map;for(let l of t){let c=l[r];typeof c=="number"&&o.set(l.fieldKey,c)}if(o.size===0)return e;let i=[],a=[];e.forEach((l,c)=>{let s=n(l);s&&(i.push(c),a.push({item:l,index:c,order:o.get(s)}))}),a.sort((l,c)=>l.order!==void 0&&c.order!==void 0?l.order-c.order||l.index-c.index:l.order!==void 0?-1:c.order!==void 0?1:l.index-c.index);let p=[...e];return i.forEach((l,c)=>{p[l]=a[c].item}),p.every((l,c)=>l===e[c])?e:p}function Ce(e){return pn(e,"filter")}var cn="collection";function Z(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":cn},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function pn(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}var Q={inStock:"In stock",outOfStock:"Out of stock",notInStockHere:"Not in stock here"};function dn(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ve(e,n){let t=e?.[n];return dn(t)?t:null}function De(e,n,t,r){if(t==null&&r==null)return!0;let o=ve(e,n);return!(o===null||t!=null&&o<t||r!=null&&o>r)}function Ke(e){let n=e.spec?.lugs;return typeof n=="number"?n:null}var fn={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},cr=Object.keys(fn);var X=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],J={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},mn={diameters:"tyreSizes"};function gn(e){if(e.length===0)return[];let n=X.filter(t=>e.every(r=>J[t].includes(r)));return n.filter(t=>{let r=mn[t];return!r||!n.includes(r)})}function hn(e){let n=new Set;for(let t of e)n.add(d(t));return[...n]}var ee={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Me(e,n,t,r=null,o="fail"){let i=d(e),a=p=>o==="fail"||(p==="lugs"?i==="alloy-wheel":J[p].includes(i));if(r!=="kind"&&n.kind&&i!==n.kind)return!1;for(let p of X){if(r===p)continue;let l=n[p];if(l.length===0||!a(p))continue;let c=l.map(String);if(!Ue(e,p).some(s=>c.includes(s)))return!1}if(r!=="lugs"&&n.lugs&&n.lugs.length>0&&a("lugs")){let p=Ke(e);if(p===null||!n.lugs.includes(p))return!1}return!(r!=="price"&&!De(ge(e),t,n.priceMin??null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!he(e))}var yn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Ue(e,n){switch(n){case"tyreSizes":return[...new Set(xe(e).flatMap(fe))];case"brands":return W(e)?[W(e)]:[];case"finishes":return Pe(e);case"diameters":return ye(e).map(String);case"collections":return H(e);case"pcds":return Se(e);case"tyreTypes":return be(e);case"speedRatings":return ke(e)}}function Pn(e){let n=new Map;for(let t of e)for(let r of G(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function ze(e,n,t,r=hn(e),o=Ee,i="fail"){let a=u=>bn(u,r,o),p=Pn(e),c=(i==="pass"?X.filter(u=>r.some(b=>J[u].includes(b))):gn(r)).filter(u=>u!=="tyreSizes").filter(a).map(u=>{let b=n[u].map(String),ae=new Set,z=new Map,L=new Map;for(let f of e){let S=Ue(f,u);for(let g of S)ae.add(g);for(let g of new Set(S))L.set(g,(L.get(g)??0)+1);if(Me(f,n,t,u,i))for(let g of new Set(S))z.set(g,(z.get(g)??0)+1)}let Je=[...ae].map(f=>({value:f,label:u==="diameters"?`${f}\u2033`:f,count:z.get(f)??0,checked:b.includes(f),swatch:u==="finishes"?p.get(f)??null:null})).sort((f,S)=>{if(u==="diameters")return Number(f.value)-Number(S.value);let g=(L.get(S.value)??0)-(L.get(f.value)??0);return g!==0?g:f.value.localeCompare(S.value)});return{key:u,label:yn[u],options:Je}}).filter(u=>u.options.length>Sn),s=[];for(let u of c){let b=kn(u.key,r,o);b!==void 0&&s.push({fieldKey:u.key,filterOrder:b})}return[...Ne(c,u=>u.key,s,"filterOrder")]}var Sn=1;function $e(e){return e.showCollection===!1?["collections"]:[]}function bn(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>Ce(j(t,r))(Z(e,r)))}function kn(e,n,t){if(t.length===0)return;let r;for(let o of n){let i=Ie(j(t,o),"filter")(Z(e,o));i!==void 0&&(r===void 0||i<r)&&(r=i)}return r}var ne={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},te="type";var x="FilterBlock";function Be(e){let n=e;return!!n&&typeof n=="object"&&typeof n.type=="string"&&!!n.props&&typeof n.props=="object"}function xn(e){return Object.entries(e.props??{}).filter(n=>Array.isArray(n[1])&&n[1].length>0&&n[1].every(Be))}function wn(e){let n=e??{},t=[];Array.isArray(n.content)&&t.push(n.content);for(let r of Object.values(n.zones??{}))Array.isArray(r)&&t.push(r);return t}function We(e){let n=[],t=(r,o)=>{let i=[r,...o];for(let a of r)if(Be(a)){n.push({node:a,order:n.length,lists:i});for(let[,p]of xn(a))t(p,i)}};for(let r of wn(e))t(r,[]);return n}function w(e){return We(e).map(n=>n.node)}var re={vehicle:"My Car",process:"Process",size:"Size",lugs:"Lugs",finish:"Finish",price:"Price"};var kr=[{value:"inStock",label:Q.inStock},{value:"category",label:"Category"},{value:"lugs",label:re.lugs},{value:"price",label:re.price}];var He="AlloyWheelsListing";function Ye(e){return $(e.trim())}var T="/wheels",M="Products";function Ve(e,n){return n>1?`${M} \xB7 ${e}`:M}function oe(...e){for(let n of[He,x])for(let t of e){let r=w({content:t?.content}).find(o=>o.type===n);if(r)return r.props??{}}return null}function U(...e){return oe(...e)!==null}function qe(e,n){let t=e.filter(r=>U(...r.docs)).map(r=>P(r.slug));return n.fallback&&!t.includes(T)?[...t,T]:t}var ie=[te,...Object.entries(ne).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function je(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:t}}function Rn(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ze(e){let n=new URLSearchParams(je(e).query);for(let t of ie){let r=n.get(t);if(r)return{param:t,value:r}}return null}function se(e,n){let{path:t,query:r,hash:o}=je(e),i=r.split("&").filter(a=>a&&!ie.includes(Rn(a.split("=")[0])));return n?.value&&i.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${i.length?`?${i.join("&")}`:""}${o}`}function Qe(e,n){let t=se(e,null);return n.includes(t)?t:e}function Fn(e,n,t=[]){return K(e,n,{listingPaths:t,targetOf:r=>Qe(r,t)})}function On(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 Xe="Product type",An="AUD";function le(e,n){let t=n.listing??{},r=O(t.kinds),o=e.filter(l=>r.includes(d(l))),i=$e(t),a=ze(o,ee,An,r,n.fieldUsage).filter(l=>!i.includes(l.key)).map(l=>({param:ne[l.key],label:l.label,values:l.options.filter(c=>!c.value.includes(",")).map(c=>({value:c.value,label:c.label}))})).filter(l=>l.values.length>0),p=k.filter(l=>r.includes(l)&&o.some(c=>d(c)===l));return p.length>1&&a.unshift({param:te,label:Xe,values:p.map(l=>({value:l,label:F[l]}))}),a}function En(e){return n=>{let t=qe(n,{fallback:e.offersCommerce}),r=n.filter(o=>U(...o.docs)).length;return{listingPaths:t,pageOptions:o=>{let i=o.map(a=>{let p=n.find(l=>P(l.slug)===a.value);return p&&U(...p.docs)?{...a,label:Ve(p.title,r)}:a});return r===0&&e.offersCommerce&&!i.some(a=>a.value===T)&&i.push({value:T,label:M}),i},filtersFor:o=>{if(!t.includes(o))return null;let i=n.find(a=>P(a.slug)===o);return le(e.catalogue,{listing:i?oe(...i.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ze,withFilter:se}}}function In(e){let n=En({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Ae({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:C(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ye},filtersFor:t.filtersFor??(()=>null)}}function fo(e,n){return le(e,n)}export{T as BUILT_IN_LISTING_PATH,E as LINK_KINDS,ie as LISTING_FILTER_PARAMS,M as LISTING_PAGE_LABEL,Xe as PRODUCT_TYPE_FILTER_LABEL,v as anchorPath,On as fieldUsageFromAdminRows,Fn as inferLinkKind,U as isProductListingPage,Ye as isSafeLink,I as linkKindsFor,In as linkPickerSetup,fo as listingFilterFields,oe as listingNode,Ve as listingPageLabel,Qe as listingTarget,D as pageAnchors,P as pagePath,N as postPath,qe as productListingPaths,Ze as readListingFilter,C as wheelPath,se as withListingFilter};
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 ce=["main","text","background","muted"],tn=[...ce,"surface"];var rn={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",style:"styled text"};var pe=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var _=[{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}],de=["highlight","quiet"],on=pe.map(e=>e.style).filter(e=>_.some(n=>n.kind===e)).filter(e=>!de.includes(e)),sn=[..._,{open:"*",close:"*",kind:"accent"}],ln=[..._,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var an=["http","https","mailto","tel"];function $(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||an.includes(n[1].toLowerCase())}var fe=["width","profile","rim"];var un=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,cn={width:[100,500],profile:[20,100],rim:[10,30]};function B(e){let n=un.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return fe.every(o=>{let[i,a]=cn[o];return t[o]>=i&&t[o]<=a})?t:null}function R(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 me(e){return[R({width:e.width}),R({width:e.width,profile:e.profile}),R(e)]}var k=["alloy-wheel","tyre"],ge=["alloy-wheel"],F={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var St=k.map(e=>({value:e,label:F[e]}));function O(e){return e==null?[...ge]:Array.isArray(e)?k.filter(n=>e.includes(n)):[...ge]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function W(e){return m(e).brand??""}function he(e){return m(e).prices??void 0}function ye(e){return m(e).inStock!==!1}function Pe(e){let n=m(e),t=d(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function G(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function Se(e){return G(e).map(n=>n.family)}function H(e){if(d(e)==="tyre")return[];let n=m(e);return Array.isArray(n.categories)?n.categories:n.process?[n.process]:[]}function be(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function ke(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function xe(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function we(e){if(d(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>B(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var Y=e=>typeof e=="string"&&e?e:void 0;function V(e,n){return Object.hasOwn(e,n)?e[n]:void 0}function Te(e,n){return Object.hasOwn(e,n)}var Le=null;function _e(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Te(n,r)?String(V(n,r)):t):e}function y(e,n){let t=Le?V(Le,e):void 0;if(typeof t=="function"){try{let r=Y(t(n??{}));if(r)return r}catch{}return _e(e,n)}return _e(Y(t)??e,n)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var A=(e,n,t,r)=>({default:e,min:n,max:t,step:r}),Rt=A(30,0,100,10),Ft=A(0,0,100,5),Ot=A(100,0,100,5),At=A(2,0,4,.5);function Re(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var Fe="homepage";var E=[{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 I(e){return e.offersCommerce&&e.offersService?E:E.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var j="#popup:";function Oe(e){return`${j}${e}`}function Ae(e){return e.startsWith(j)&&e.slice(j.length).trim()||null}function P(e){return e===Fe?"/":`/${e}`}function N(e){return`/journal/${e}`}function C(e){return`/wheels/${e}`}function v(e,n){return`${P(e)}#${n}`}function D(...e){let n=new Set,t=[];for(let r of e)for(let o of r?.content??[]){let i=Re(o?.props?.anchor);if(!i)continue;let a=q(i);!a||n.has(a)||(n.add(a),t.push({slug:a,name:i}))}return t}function Ee(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var pn=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function K(e,n,t){if(!e)return"page";if(Ae(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Ee(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 Ie(e,n){let t=pn(),r=e.pages.map(s=>({value:P(s.slug),label:s.title})),o=n?.pageOptions?n.pageOptions(r):r,i=o.map(s=>s.value),a=e.pages.map(s=>({label:s.title,options:D(...s.docs).map(u=>({value:v(s.slug,u.slug),label:u.name}))})).filter(s=>s.options.length>0),p=s=>{switch(s){case"page":return{type:"select",options:o,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:a,placeholder:a.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:N(u.slug),label:u.title||u.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:Oe(u.slug),label:u.title||u.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},l=I(e.offers).map(s=>({value:s.value,label:y(s.label),target:p(s.value),...s.value==="anchor"?{hint:t.sectionHint}:{},...s.value==="blog"||s.value==="product"||s.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:l,rules:{kindOf:s=>K(s,i),targetOf:s=>s,readFilter:()=>null,withFilter:s=>s}};let c=s=>{let u=n.withFilter(s,null);return n.listingPaths.includes(u)?u:s};return{kinds:l,rules:{kindOf:s=>K(s,i,{listingPaths:n.listingPaths,targetOf:c}),targetOf:c,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:s=>n.listingPaths.includes(s)?n.filtersFor(s):null}}var Ne=Object.freeze([]);function Z(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function Ce(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let i=o[t];if(typeof i!="number"||!Number.isFinite(i))continue;let a=r.get(o.fieldKey);(a===void 0||i<a)&&r.set(o.fieldKey,i)}return o=>o?r.get(o):void 0}function ve(e,n,t,r){let o=new Map;for(let l of t){let c=l[r];typeof c=="number"&&o.set(l.fieldKey,c)}if(o.size===0)return e;let i=[],a=[];e.forEach((l,c)=>{let s=n(l);s&&(i.push(c),a.push({item:l,index:c,order:o.get(s)}))}),a.sort((l,c)=>l.order!==void 0&&c.order!==void 0?l.order-c.order||l.index-c.index:l.order!==void 0?-1:c.order!==void 0?1:l.index-c.index);let p=[...e];return i.forEach((l,c)=>{p[l]=a[c].item}),p.every((l,c)=>l===e[c])?e:p}function De(e){return fn(e,"filter")}var dn="collection";function Q(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":dn},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function fn(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}var X={inStock:"In stock",outOfStock:"Out of stock",notInStockHere:"Not in stock here"};function mn(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ke(e,n){let t=e?.[n];return mn(t)?t:null}function Me(e,n,t,r){if(t==null&&r==null)return!0;let o=Ke(e,n);return!(o===null||t!=null&&o<t||r!=null&&o>r)}function Ue(e){let n=e.spec?.lugs;return typeof n=="number"?n:null}var gn={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},mr=Object.keys(gn);var J=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],ee={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},hn={diameters:"tyreSizes"};function yn(e){if(e.length===0)return[];let n=J.filter(t=>e.every(r=>ee[t].includes(r)));return n.filter(t=>{let r=hn[t];return!r||!n.includes(r)})}function Pn(e){let n=new Set;for(let t of e)n.add(d(t));return[...n]}var ne={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,priceMin:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function ze(e,n,t,r=null,o="fail"){let i=d(e),a=p=>o==="fail"||(p==="lugs"?i==="alloy-wheel":ee[p].includes(i));if(r!=="kind"&&n.kind&&i!==n.kind)return!1;for(let p of J){if(r===p)continue;let l=n[p];if(l.length===0||!a(p))continue;let c=l.map(String);if(!$e(e,p).some(s=>c.includes(s)))return!1}if(r!=="lugs"&&n.lugs&&n.lugs.length>0&&a("lugs")){let p=Ue(e);if(p===null||!n.lugs.includes(p))return!1}return!(r!=="price"&&!Me(he(e),t,n.priceMin??null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!ye(e))}var Sn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function $e(e,n){switch(n){case"tyreSizes":return[...new Set(we(e).flatMap(me))];case"brands":return W(e)?[W(e)]:[];case"finishes":return Se(e);case"diameters":return Pe(e).map(String);case"collections":return H(e);case"pcds":return be(e);case"tyreTypes":return ke(e);case"speedRatings":return xe(e)}}function bn(e){let n=new Map;for(let t of e)for(let r of G(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function Be(e,n,t,r=Pn(e),o=Ne,i="fail"){let a=u=>xn(u,r,o),p=bn(e),c=(i==="pass"?J.filter(u=>r.some(b=>ee[u].includes(b))):yn(r)).filter(u=>u!=="tyreSizes").filter(a).map(u=>{let b=n[u].map(String),ue=new Set,z=new Map,L=new Map;for(let f of e){let S=$e(f,u);for(let g of S)ue.add(g);for(let g of new Set(S))L.set(g,(L.get(g)??0)+1);if(ze(f,n,t,u,i))for(let g of new Set(S))z.set(g,(z.get(g)??0)+1)}let nn=[...ue].map(f=>({value:f,label:u==="diameters"?`${f}\u2033`:f,count:z.get(f)??0,checked:b.includes(f),swatch:u==="finishes"?p.get(f)??null:null})).sort((f,S)=>{if(u==="diameters")return Number(f.value)-Number(S.value);let g=(L.get(S.value)??0)-(L.get(f.value)??0);return g!==0?g:f.value.localeCompare(S.value)});return{key:u,label:Sn[u],options:nn}}).filter(u=>u.options.length>kn),s=[];for(let u of c){let b=wn(u.key,r,o);b!==void 0&&s.push({fieldKey:u.key,filterOrder:b})}return[...ve(c,u=>u.key,s,"filterOrder")]}var kn=1;function We(e){return e.showCollection===!1?["collections"]:[]}function xn(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>De(Z(t,r))(Q(e,r)))}function wn(e,n,t){if(t.length===0)return;let r;for(let o of n){let i=Ce(Z(t,o),"filter")(Q(e,o));i!==void 0&&(r===void 0||i<r)&&(r=i)}return r}var te={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},re="type";var x="FilterBlock";function Ge(e){let n=e;return!!n&&typeof n=="object"&&typeof n.type=="string"&&!!n.props&&typeof n.props=="object"}function Tn(e){return Object.entries(e.props??{}).filter(n=>Array.isArray(n[1])&&n[1].length>0&&n[1].every(Ge))}function Ln(e){let n=e??{},t=[];Array.isArray(n.content)&&t.push(n.content);for(let r of Object.values(n.zones??{}))Array.isArray(r)&&t.push(r);return t}function He(e){let n=[],t=(r,o)=>{let i=[r,...o];for(let a of r)if(Ge(a)){n.push({node:a,order:n.length,lists:i});for(let[,p]of Tn(a))t(p,i)}};for(let r of Ln(e))t(r,[]);return n}function w(e){return He(e).map(n=>n.node)}var oe={vehicle:"My Car",process:"Process",size:"Size",lugs:"Lugs",finish:"Finish",price:"Price"};var Lr=[{value:"inStock",label:X.inStock},{value:"category",label:"Category"},{value:"lugs",label:oe.lugs},{value:"price",label:oe.price}];var Ve="AlloyWheelsListing";function qe(e){return $(e.trim())}var T="/wheels",M="Products";function je(e,n){return n>1?`${M} \xB7 ${e}`:M}function ie(...e){for(let n of[Ve,x])for(let t of e){let r=w({content:t?.content}).find(o=>o.type===n);if(r)return r.props??{}}return null}function U(...e){return ie(...e)!==null}function Ze(e,n){let t=e.filter(r=>U(...r.docs)).map(r=>P(r.slug));return n.fallback&&!t.includes(T)?[...t,T]:t}var se=[re,...Object.entries(te).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Qe(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:t}}function On(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Xe(e){let n=new URLSearchParams(Qe(e).query);for(let t of se){let r=n.get(t);if(r)return{param:t,value:r}}return null}function le(e,n){let{path:t,query:r,hash:o}=Qe(e),i=r.split("&").filter(a=>a&&!se.includes(On(a.split("=")[0])));return n?.value&&i.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${i.length?`?${i.join("&")}`:""}${o}`}function Je(e,n){let t=le(e,null);return n.includes(t)?t:e}function An(e,n,t=[]){return K(e,n,{listingPaths:t,targetOf:r=>Je(r,t)})}function En(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 en="Product type",In="AUD";function ae(e,n){let t=n.listing??{},r=O(t.kinds),o=e.filter(l=>r.includes(d(l))),i=We(t),a=Be(o,ne,In,r,n.fieldUsage).filter(l=>!i.includes(l.key)).map(l=>({param:te[l.key],label:l.label,values:l.options.filter(c=>!c.value.includes(",")).map(c=>({value:c.value,label:c.label}))})).filter(l=>l.values.length>0),p=k.filter(l=>r.includes(l)&&o.some(c=>d(c)===l));return p.length>1&&a.unshift({param:re,label:en,values:p.map(l=>({value:l,label:F[l]}))}),a}function Nn(e){return n=>{let t=Ze(n,{fallback:e.offersCommerce}),r=n.filter(o=>U(...o.docs)).length;return{listingPaths:t,pageOptions:o=>{let i=o.map(a=>{let p=n.find(l=>P(l.slug)===a.value);return p&&U(...p.docs)?{...a,label:je(p.title,r)}:a});return r===0&&e.offersCommerce&&!i.some(a=>a.value===T)&&i.push({value:T,label:M}),i},filtersFor:o=>{if(!t.includes(o))return null;let i=n.find(a=>P(a.slug)===o);return ae(e.catalogue,{listing:i?ie(...i.docs):null,fieldUsage:e.fieldUsage})},readFilter:Xe,withFilter:le}}}function Cn(e){let n=Nn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Ie({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:C(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:qe},filtersFor:t.filtersFor??(()=>null)}}function yo(e,n){return ae(e,n)}export{T as BUILT_IN_LISTING_PATH,E as LINK_KINDS,se as LISTING_FILTER_PARAMS,M as LISTING_PAGE_LABEL,en as PRODUCT_TYPE_FILTER_LABEL,v as anchorPath,En as fieldUsageFromAdminRows,An as inferLinkKind,U as isProductListingPage,qe as isSafeLink,I as linkKindsFor,Cn as linkPickerSetup,yo as listingFilterFields,ie as listingNode,je as listingPageLabel,Je as listingTarget,D as pageAnchors,P as pagePath,N as postPath,Ze as productListingPaths,Xe as readListingFilter,C as wheelPath,le as withListingFilter};
@@ -1113,19 +1113,19 @@ body .sf-site-header[data-header-ink="dark"] {
1113
1113
  Header Setting To The Box Header: `Own row` stacks exactly as the old
1114
1114
  header did, to 1500px, so a switched site looks the same at every width. */
1115
1115
  @media (min-width: 720px) and (max-width: 1500px) {
1116
- [data-section-group="header"]:not([data-header-menu-row="inline"]) .flex-row:has([data-menu-row]) {
1116
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) .flex-row:has([data-menu-row]) {
1117
1117
  flex-wrap: wrap;
1118
1118
  row-gap: 12px;
1119
1119
  }
1120
1120
  /* The links: their own line, last, under the hairline. */
1121
- [data-section-group="header"]:not([data-header-menu-row="inline"]) .flex-row:has([data-menu-row]) > :is([data-menu-row], :has([data-menu-row])) {
1121
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) .flex-row:has([data-menu-row]) > :is([data-menu-row], :has([data-menu-row])) {
1122
1122
  order: 99;
1123
1123
  flex: 1 0 100%;
1124
1124
  border-top: 1px solid color-mix(in oklab, var(--site-line) 60%, transparent);
1125
1125
  padding-top: 10px;
1126
1126
  }
1127
1127
  /* The logo takes the top line's room, so the tools sit at its end. */
1128
- [data-section-group="header"]:not([data-header-menu-row="inline"]) .flex-row:has([data-menu-row]) > :first-child:not([data-menu-row], :has([data-menu-row])) {
1128
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) .flex-row:has([data-menu-row]) > :first-child:not([data-menu-row], :has([data-menu-row])) {
1129
1129
  flex: 1 1 0;
1130
1130
  container-type: inline-size;
1131
1131
  overflow-x: clip;
@@ -1158,6 +1158,77 @@ body .sf-site-header[data-header-ink="dark"] {
1158
1158
  letter-spacing: normal;
1159
1159
  }
1160
1160
 
1161
+ /* ─── THE MENU BUTTON HEADER ─────────────────────────────────────────
1162
+ A header group whose one-row Menu stores `Menu style` Menu button
1163
+ (`data-menu-show="button"`, components/FooterMenu) is ONE line at every
1164
+ width: the Box holding the Menu at the left, the logo in the middle, the
1165
+ last Box at the right (the design's grid `1fr auto 1fr`). The phone rules
1166
+ that put the menu button last, and the 720-1500 two-row rules (which skip
1167
+ this group, above), step aside. */
1168
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"], > [data-easel-block] [data-menu-show="button"]) {
1169
+ flex-wrap: nowrap;
1170
+ }
1171
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"]) > :first-child,
1172
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"]) > :last-child {
1173
+ flex: 1 1 0%;
1174
+ min-width: 0;
1175
+ order: 0;
1176
+ }
1177
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"]) > :not(:first-child):not(:last-child) {
1178
+ flex: 0 0 auto;
1179
+ order: 0;
1180
+ container-type: normal;
1181
+ }
1182
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"]) .flex-row {
1183
+ flex-wrap: nowrap;
1184
+ }
1185
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"]) .flex-row > * {
1186
+ /* A Box's items-per-row below 1100 (`phoneRow`) would give each item a
1187
+ third of the cell: in the bar each is as wide as it draws. */
1188
+ flex: 0 0 auto;
1189
+ width: auto;
1190
+ }
1191
+ /* 720 to 1099: the one line does not hold the logo at its own size, so the
1192
+ logo's cell takes what is left and the Logo fits itself to it. */
1193
+ @media (min-width: 720px) and (max-width: 1099px) {
1194
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"]) > :first-child,
1195
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"]) > :last-child {
1196
+ flex: 0 0 auto;
1197
+ }
1198
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"]) > :not(:first-child):not(:last-child) {
1199
+ flex: 1 1 0%;
1200
+ min-width: 0;
1201
+ container-type: inline-size;
1202
+ overflow-x: clip;
1203
+ display: flex;
1204
+ justify-content: center;
1205
+ }
1206
+ }
1207
+ @media not all and (min-width: 720px) {
1208
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has([data-menu-row]) > :is([data-menu-row], :has([data-menu-row])) {
1209
+ order: 0;
1210
+ }
1211
+ /* The logo's cell takes the middle share and is the query container the
1212
+ Logo fits itself to (components/Logo `fitToContainer`). */
1213
+ [data-section-group="header"]:has([data-menu-show="button"]) .flex-row:has(> * [data-menu-show="button"]) > :not(:first-child):not(:last-child) {
1214
+ flex: 2 1 0%;
1215
+ min-width: 0;
1216
+ container-type: inline-size;
1217
+ overflow-x: clip;
1218
+ display: flex;
1219
+ justify-content: center;
1220
+ }
1221
+ }
1222
+ /* The header's tool words (Menu, Search, Contact, US · USD): ONE site text
1223
+ style (the Site Header's `Tool words`). Only a stored style sets the
1224
+ attribute, so an unset header draws exactly today's label type. */
1225
+ [data-section-group="header"][data-header-tool-style] .mono-eyebrow-ctl,
1226
+ [data-section-group="header"][data-header-tool-style] [data-menu-row] > ul,
1227
+ [data-section-group="header"][data-header-tool-style] [data-phone-menu-tool="region"] button {
1228
+ font-family: var(--sf-header-tool-font);
1229
+ font-size: var(--sf-header-tool-size);
1230
+ }
1231
+
1161
1232
  /* ─── THE BOX HEADER'S MENU ALIGNMENT ─────────────────────────────────
1162
1233
  Where the old header put its menu, as the page Menu's `Link alignment` and
1163
1234
  `Show links` (lib/content/menu-row; Lewis 2026-10-12).
@@ -1228,16 +1299,16 @@ body .sf-site-header[data-header-ink="dark"] {
1228
1299
  }
1229
1300
  @media (min-width: 720px) and (max-width: 1500px) {
1230
1301
  /* Own row stacks: the links start their own line, as the old second row. */
1231
- [data-section-group="header"]:not([data-header-menu-row="inline"]) [data-menu-row][data-menu-align] > ul {
1302
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) [data-menu-row][data-menu-align] > ul {
1232
1303
  justify-content: flex-start;
1233
1304
  }
1234
- [data-section-group="header"]:not([data-header-menu-row="inline"]) [data-menu-row] li[data-menu-out] {
1305
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) [data-menu-row] li[data-menu-out] {
1235
1306
  display: list-item;
1236
1307
  }
1237
- [data-section-group="header"]:not([data-header-menu-row="inline"]) .flex-row > :is([data-menu-part="lead"], :has([data-menu-part="lead"])) {
1308
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) .flex-row > :is([data-menu-part="lead"], :has([data-menu-part="lead"])) {
1238
1309
  display: none;
1239
1310
  }
1240
- [data-section-group="header"]:not([data-header-menu-row="inline"]) .flex-row > :is([data-menu-part="lead"], :has([data-menu-part="lead"])) + * {
1311
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) .flex-row > :is([data-menu-part="lead"], :has([data-menu-part="lead"])) + * {
1241
1312
  flex: 1 1 0;
1242
1313
  container-type: inline-size;
1243
1314
  overflow-x: clip;
@@ -1246,15 +1317,15 @@ body .sf-site-header[data-header-ink="dark"] {
1246
1317
  Search position (components/Header, the medium band); the position only
1247
1318
  ever applied to the one-row bar. The logo stays ahead of it where a
1248
1319
  centred logo's Box is opened below. */
1249
- [data-section-group="header"]:not([data-header-menu-row="inline"]) [data-phone-menu-tool="search"] > *,
1250
- [data-section-group="header"]:not([data-header-menu-row="inline"]) [data-easel-block]:has(> * > [data-phone-menu-tool="search"]) {
1320
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) [data-phone-menu-tool="search"] > *,
1321
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) [data-easel-block]:has(> * > [data-phone-menu-tool="search"]) {
1251
1322
  order: -1;
1252
1323
  }
1253
- [data-section-group="header"]:not([data-header-menu-row="inline"]) .flex-row > :is([data-menu-part="lead"], :has([data-menu-part="lead"])) + * {
1324
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) .flex-row > :is([data-menu-part="lead"], :has([data-menu-part="lead"])) + * {
1254
1325
  order: -2;
1255
1326
  }
1256
- [data-section-group="header"]:not([data-header-menu-row="inline"]) .flex-row:has([data-menu-part="lead"]) > :has([data-menu-row]):not([data-menu-row]):not(:has([data-menu-part="lead"])),
1257
- [data-section-group="header"]:not([data-header-menu-row="inline"]) .flex-row:has([data-menu-part="lead"]) > :has([data-menu-row]):not([data-menu-row]):not(:has([data-menu-part="lead"])) :has([data-menu-row]):not([data-menu-row]) {
1327
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) .flex-row:has([data-menu-part="lead"]) > :has([data-menu-row]):not([data-menu-row]):not(:has([data-menu-part="lead"])),
1328
+ [data-section-group="header"]:not([data-header-menu-row="inline"]):not(:has([data-menu-show="button"])) .flex-row:has([data-menu-part="lead"]) > :has([data-menu-row]):not([data-menu-row]):not(:has([data-menu-part="lead"])) :has([data-menu-row]):not([data-menu-row]) {
1258
1329
  display: contents;
1259
1330
  }
1260
1331
  }
@@ -3788,3 +3859,56 @@ em.text-accent {
3788
3859
  [data-sf-repeat$=":optionTemplate"] .sf-section-border-self .sf-section-border-self {
3789
3860
  border-color: var(--sf-hero-option-dot);
3790
3861
  }
3862
+
3863
+ /* THE PRICE CONTROL'S TWO THUMBS (components/catalog/PriceRange). Two native
3864
+ range inputs lie on one track; the track and its accent fill are drawn by
3865
+ the control, so each input is see-through and takes the pointer on its
3866
+ thumb only (the usual two-range pattern), or the top input would swallow
3867
+ every press meant for the other thumb. A thumb is 16 px; its colours are
3868
+ set by the control (--price-thumb: the accent, --price-thumb-ring: the
3869
+ page ground), so they are theme variables only. */
3870
+ .price-range-thumbs {
3871
+ -webkit-appearance: none;
3872
+ appearance: none;
3873
+ margin: 0;
3874
+ background: transparent;
3875
+ pointer-events: none;
3876
+ }
3877
+ .price-range-thumbs::-webkit-slider-runnable-track {
3878
+ background: transparent;
3879
+ border: 0;
3880
+ }
3881
+ .price-range-thumbs::-moz-range-track {
3882
+ background: transparent;
3883
+ border: 0;
3884
+ }
3885
+ .price-range-thumbs::-webkit-slider-thumb {
3886
+ -webkit-appearance: none;
3887
+ appearance: none;
3888
+ width: 16px;
3889
+ height: 16px;
3890
+ border-radius: 9999px;
3891
+ background: var(--price-thumb);
3892
+ box-shadow: 0 0 0 2px var(--price-thumb-ring);
3893
+ border: 0;
3894
+ cursor: pointer;
3895
+ pointer-events: auto;
3896
+ }
3897
+ .price-range-thumbs::-moz-range-thumb {
3898
+ width: 16px;
3899
+ height: 16px;
3900
+ border-radius: 9999px;
3901
+ background: var(--price-thumb);
3902
+ box-shadow: 0 0 0 2px var(--price-thumb-ring);
3903
+ border: 0;
3904
+ cursor: pointer;
3905
+ pointer-events: auto;
3906
+ }
3907
+ .price-range-thumbs:focus-visible::-webkit-slider-thumb {
3908
+ outline: 2px solid var(--price-thumb);
3909
+ outline-offset: 2px;
3910
+ }
3911
+ .price-range-thumbs:focus-visible::-moz-range-thumb {
3912
+ outline: 2px solid var(--price-thumb);
3913
+ outline-offset: 2px;
3914
+ }
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "66.0.0"
2
+ "efficient-web-builder": "67.4.0"
3
3
  }
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as a}from"react/jsx-runtime";import n from"next/link";import o from"next/image";import{bundleSaving as r}from"../lib/commerce.js";function c({bundle:e,currency:i}){const s=r(e,i);return a(n,{href:`/bundles/${e.slug}`,className:"sf-card group flex flex-col border border-line bg-bg transition-colors hover:border-accent",children:[a("div",{className:"sf-card-image relative aspect-[4/3] overflow-hidden bg-surface",children:[e.image?t(o,{src:e.image,alt:e.name,fill:!0,sizes:"(max-width: 640px) 100vw, 33vw",className:"object-cover transition-transform duration-500 group-hover:scale-[1.03]"}):a("div",{className:"flex h-full items-center justify-center font-mono text-[10px] uppercase tracking-[0.3em] text-fg-dim",children:[e.components.length," piece",e.components.length===1?"":"s"]}),s&&t("span",{className:"absolute left-0 top-4 bg-accent px-3 py-2 font-mono text-[10px] uppercase tracking-[0.24em] text-bg",children:s})]}),a("div",{className:"flex flex-1 flex-col gap-2 px-5 py-4",children:[t("span",{className:"font-display text-[18px] font-medium tracking-[-0.015em] text-fg",children:e.name}),e.subtitle&&t("span",{className:"text-[13px] leading-snug text-fg-dim",children:e.subtitle}),!e.inStock&&t("span",{className:"mt-1 font-mono text-[9px] uppercase tracking-[0.24em] text-fg-dim",children:"Currently unavailable"})]})]})}export{r as bundleSaving,c as default};
1
+ "use client";import{jsx as t,jsxs as a}from"react/jsx-runtime";import o from"next/link";import c from"next/image";import{bundleSaving as n}from"../lib/commerce.js";import{bundlePrice as m}from"../lib/wheels/price-display.js";function l({bundle:e,currency:r}){const i=n(e,r),s=m(e,r);return a(o,{href:`/bundles/${e.slug}`,className:"sf-card group flex flex-col border border-line bg-bg transition-colors hover:border-accent",children:[a("div",{className:"sf-card-image relative aspect-[4/3] overflow-hidden bg-surface",children:[e.image?t(c,{src:e.image,alt:e.name,fill:!0,sizes:"(max-width: 640px) 100vw, 33vw",className:"object-cover transition-transform duration-500 group-hover:scale-[1.03]"}):a("div",{className:"flex h-full items-center justify-center font-mono text-[10px] uppercase tracking-[0.3em] text-fg-dim",children:[e.components.length," piece",e.components.length===1?"":"s"]}),i&&t("span",{className:"absolute left-0 top-4 bg-accent px-3 py-2 font-mono text-[10px] uppercase tracking-[0.24em] text-bg",children:i})]}),a("div",{className:"flex flex-1 flex-col gap-2 px-5 py-4",children:[t("span",{className:"font-display text-[18px] font-medium tracking-[-0.015em] text-fg",children:e.name}),e.subtitle&&t("span",{className:"text-[13px] leading-snug text-fg-dim",children:e.subtitle}),s&&a("span",{className:"mt-1 font-mono text-[13px] text-fg",children:[t("span",{className:"mr-2 text-fg-dim line-through",children:s.was}),s.amount]}),!e.inStock&&t("span",{className:"mt-1 font-mono text-[9px] uppercase tracking-[0.24em] text-fg-dim",children:"Currently unavailable"})]})]})}export{n as bundleSaving,l as default};
@@ -1 +1 @@
1
- "use client";import{jsx as j}from"react/jsx-runtime";import{useEffect as p,useMemo as E}from"react";import $ from"./catalog/CatalogFilterBar.js";import{useCatalogFilter as B}from"./catalog/CatalogFilterContext.js";import{useVehicleFit as N}from"./fitment/useVehicleFit.js";import{answersForKind as _}from"../lib/content/field-usage.js";import{appendVehicleParams as q,VEHICLE_PARAM as I}from"../lib/wheels/plp-vehicle-params.js";import{listingLinkFromCatalogFilters as K,unmappableCatalogFacets as D}from"../lib/wheels/catalog-filters-to-listing.js";function G({show:c,layout:u,processOptions:f,fieldUsage:s,editing:t=!1,resultsHref:l,resultsLabel:m}){const{filters:o,setProcess:d,setSize:h,setLugs:w,setFinish:g,setPriceMin:P,setPriceMax:F,setSort:v,clearAll:O,total:S,scrollProcess:y,publishVehicle:n,lugOptions:L,sizeOptions:A,finishOptions:C,categoryOptions:M,optionsReported:k}=B(),x=E(()=>s?_(s,"alloy-wheel"):void 0,[s]),e=N({editing:t,autoApply:!0});p(()=>{n({fit:e.fit,name:e.appliedName,resolving:e.resolving,unresolved:e.unresolved})},[n,e.fit,e.appliedName,e.resolving,e.unresolved]);const r=e.applied?.vehicle??null;p(()=>{if(t||!e.restored||typeof window>"u")return;const i=new URLSearchParams(window.location.search);for(const R of Object.values(I))i.delete(R);q(i,r);const a=i.toString();window.history.replaceState(null,"",`${window.location.pathname}${a?`?${a}`:""}`)},[t,e.restored,r]);const V=D(o),b=(m??"").trim()||"See all results",z=l&&!t&&V.length===0?{href:K(l,o,r),label:b}:void 0;return j($,{resultsLink:z,filters:o,setProcess:d,setSize:h,setLugs:w,setFinish:g,setPriceMin:P,setPriceMax:F,setSort:v,clearAll:O,total:S,lugOptions:L,sizeOptions:A,finishOptions:C,scrollProcess:y,show:c,layout:u,processOptions:f??M,optionsReported:k,fieldUsage:x,picker:e})}export{G as default};
1
+ "use client";import{jsx as $}from"react/jsx-runtime";import{useEffect as c,useMemo as u}from"react";import N from"./catalog/CatalogFilterBar.js";import{useCatalogFilter as _}from"./catalog/CatalogFilterContext.js";import{useVehicleFit as q}from"./fitment/useVehicleFit.js";import{answersForKind as I}from"../lib/content/field-usage.js";import{appendVehicleParams as K,VEHICLE_PARAM as D}from"../lib/wheels/plp-vehicle-params.js";import{plpPriceBoundsOf as G}from"../lib/wheels/plp-filters.js";import{listingLinkFromCatalogFilters as H,unmappableCatalogFacets as J}from"../lib/wheels/catalog-filters-to-listing.js";function Q({show:f,layout:m,processOptions:d,fieldUsage:t,editing:s=!1,resultsHref:l,resultsLabel:h}){const{filters:o,setProcess:w,setSize:g,setLugs:P,setFinish:O,setPriceMin:F,setPriceMax:v,setSort:S,clearAll:y,total:L,scrollProcess:A,publishVehicle:n,lugOptions:C,sizeOptions:M,finishOptions:k,categoryOptions:x,optionsReported:B,priceOptions:a}=_(),V=u(()=>G(a),[a]),b=u(()=>t?I(t,"alloy-wheel"):void 0,[t]),e=q({editing:s,autoApply:!0});c(()=>{n({fit:e.fit,name:e.appliedName,resolving:e.resolving,unresolved:e.unresolved})},[n,e.fit,e.appliedName,e.resolving,e.unresolved]);const r=e.applied?.vehicle??null;c(()=>{if(s||!e.restored||typeof window>"u")return;const i=new URLSearchParams(window.location.search);for(const E of Object.values(D))i.delete(E);K(i,r);const p=i.toString();window.history.replaceState(null,"",`${window.location.pathname}${p?`?${p}`:""}`)},[s,e.restored,r]);const z=J(o),R=(h??"").trim()||"See all results",j=l&&!s&&z.length===0?{href:H(l,o,r),label:R}:void 0;return $(N,{resultsLink:j,filters:o,setProcess:w,setSize:g,setLugs:P,setFinish:O,setPriceMin:F,setPriceMax:v,setSort:S,clearAll:y,total:L,lugOptions:C,sizeOptions:M,finishOptions:k,priceBounds:V,scrollProcess:A,show:f,layout:m,processOptions:d??x,optionsReported:B,fieldUsage:b,picker:e})}export{Q as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useEffect as S,useRef as A,useState as u}from"react";import{stripMarkup as B}from"efficient-web-builder/format/lib/markup";import{sizedImage as z}from"efficient-web-builder/format/lib/sized-image";import D,{chatLauncherOnLeft as W}from"./ChatLauncher.js";import{useChat as U}from"./ChatContext.js";import{scrollBehavior as F}from"efficient-web-builder/render/components/useReducedMotion";const M="Chat with us",O="We usually reply within a few minutes",R="Hi! Ask us anything — about a wheel, an order, or fitment. Leave your details and we’ll reply.";function $({m:t}){if(t.sender_role==="system")return e("div",{className:"text-center text-[11px] text-fg/50 py-1",children:t.body});const a=t.sender_role==="bot",s=t.sender_role==="employee"||a;return e("div",{className:`flex ${s?"justify-start":"justify-end"}`,children:r("div",{className:`max-w-[80%] rounded-2xl px-3 py-2 text-sm ${s?"bg-fg/5 text-fg":"bg-accent text-accent-ink"}`,children:[s&&r("div",{className:"mb-0.5 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-fg/50",children:[a&&e("span",{"aria-hidden":"true",children:"✦"}),e("span",{children:a?t.sender_name||"Assistant":t.sender_name||"Support"}),a&&e("span",{className:"font-normal normal-case tracking-normal",children:"· automated"})]}),t.body&&e("p",{className:"whitespace-pre-wrap",children:t.body}),t.image_url&&e("a",{href:t.image_url,target:"_blank",rel:"noopener noreferrer",children:e("img",{...z(t.image_url,{fallbackWidth:640,maxWidth:1280}),sizes:"(max-width: 640px) 80vw, 320px",alt:"Attachment",className:"mt-2 max-h-48 w-auto rounded-lg"})})]})})}function G({title:t,subtitle:a,greeting:s,look:x}={}){const{isOpen:l,toggle:N,close:_,messages:o,sending:i,error:h,unread:f,hasConversation:k,isSignedIn:C,send:L}=U(),g=t?.trim()||M,E=a?.trim()||O,T=s?.trim()||R,[d,b]=u(""),[c,j]=u(""),[m,I]=u(""),y=A(null),p=!C&&!k;S(()=>{l&&y.current?.scrollIntoView({behavior:F(),block:"nearest"})},[o.length,l]);const v=d.trim().length>0&&(!p||c.trim()&&/.+@.+/.test(m)),w=()=>{!v||i||(L(d,p?{name:c.trim(),email:m.trim()}:void 0),b(""))};return l?r("aside",{role:"dialog","aria-label":"Chat with us","data-sf-floating":"",className:`fixed bottom-5 ${W(x)?"left-5":"right-5"} z-[61] flex h-[min(560px,80vh)] w-[min(380px,calc(100vw-2.5rem))] flex-col overflow-hidden rounded-2xl border border-line bg-bg shadow-[0_20px_60px_rgba(0,0,0,.45)]`,style:{color:"var(--fg)"},children:[r("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[r("div",{children:[e("div",{className:"text-sm font-semibold text-fg",children:g}),e("div",{className:"text-[11px] text-fg/50",children:E})]}),e("button",{type:"button",onClick:_,"aria-label":"Close chat",className:"rounded-md p-1 text-fg/60 hover:bg-fg/5",children:e("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),r("div",{className:"flex-1 space-y-2 overflow-y-auto px-3 py-3",children:[o.length===0&&e("p",{className:"px-2 py-4 text-center text-sm text-fg/50",children:T}),o.map(n=>e($,{m:n},n.id)),e("div",{ref:y})]}),r("div",{className:"border-t border-line p-3",children:[p&&r("div",{className:"mb-2 grid grid-cols-2 gap-2",children:[e("input",{value:c,onChange:n=>j(n.target.value),placeholder:"Your name",className:"rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"}),e("input",{value:m,onChange:n=>I(n.target.value),type:"email",placeholder:"Email",className:"rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"})]}),h&&e("p",{className:"mb-2 text-xs text-alert",children:h}),r("div",{className:"flex items-end gap-2",children:[e("textarea",{value:d,onChange:n=>b(n.target.value),onKeyDown:n=>{n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),w())},rows:1,placeholder:"Type a message…",className:"max-h-28 flex-1 resize-none rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"}),e("button",{type:"button",onClick:w,disabled:!v||i,className:"rounded-lg bg-btn px-3 py-2 text-sm font-semibold text-btn-ink disabled:opacity-40",children:i?"…":"Send"})]})]})]}):e(D,{label:B(g),onOpen:N,zIndex:60,look:x,badge:f>0&&e("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-red-600 px-1 text-[11px] font-bold text-white",children:f})})}export{R as DEFAULT_GREETING,O as DEFAULT_SUBTITLE,M as DEFAULT_TITLE,G as default};
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useEffect as S,useRef as A,useState as u}from"react";import{stripMarkup as B}from"efficient-web-builder/format/lib/markup";import{sizedImage as z}from"efficient-web-builder/format/lib/sized-image";import D,{chatLauncherOnLeft as W}from"./ChatLauncher.js";import{useChat as M}from"./ChatContext.js";import{scrollBehavior as U}from"efficient-web-builder/render/components/useReducedMotion";const F="Chat with us",O="We usually reply within a few minutes",R="Hi! Ask us anything — about a wheel, an order, or fitment. Leave your details and we’ll reply.";function $({m:t}){if(t.sender_role==="system")return e("div",{className:"text-center text-[11px] text-fg/50 py-1",children:t.body});const a=t.sender_role==="bot",s=t.sender_role==="employee"||a;return e("div",{className:`flex ${s?"justify-start":"justify-end"}`,children:n("div",{className:`max-w-[80%] rounded-2xl px-3 py-2 text-sm ${s?"bg-fg/5 text-fg":"bg-accent text-accent-ink"}`,children:[s&&n("div",{className:"mb-0.5 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-fg/50",children:[a&&e("span",{"aria-hidden":"true",children:"✦"}),e("span",{children:a?t.sender_name||"Assistant":t.sender_name||"Support"}),a&&e("span",{className:"font-normal normal-case tracking-normal",children:"· automated"})]}),t.body&&e("p",{className:"whitespace-pre-wrap",children:t.body}),t.image_url&&e("a",{href:t.image_url,target:"_blank",rel:"noopener noreferrer",children:e("img",{...z(t.image_url,{fallbackWidth:640,maxWidth:1280}),sizes:"(max-width: 640px) 80vw, 320px",alt:"Attachment",className:"mt-2 max-h-48 w-auto rounded-lg"})})]})})}function G({title:t,subtitle:a,greeting:s,look:x}={}){const{isOpen:l,toggle:N,close:_,messages:o,sending:i,error:h,unread:f,hasConversation:k,isSignedIn:C,send:E}=M(),g=t?.trim()||F,L=a?.trim()||O,T=s?.trim()||R,[d,b]=u(""),[c,j]=u(""),[m,I]=u(""),y=A(null),p=!C&&!k;S(()=>{l&&y.current?.scrollIntoView({behavior:U(),block:"nearest"})},[o.length,l]);const v=d.trim().length>0&&(!p||c.trim()&&/.+@.+/.test(m)),w=()=>{!v||i||(E(d,p?{name:c.trim(),email:m.trim()}:void 0),b(""))};return l?n("aside",{role:"dialog","aria-label":"Chat with us","data-sf-floating":"",className:`fixed bottom-5 ${W(x)?"left-5":"right-5"} z-[61] flex h-[min(560px,80vh)] w-[min(380px,calc(100vw-2.5rem))] flex-col overflow-hidden rounded-2xl border border-line bg-bg shadow-[0_20px_60px_rgba(0,0,0,.45)]`,style:{color:"var(--fg)"},children:[n("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[n("div",{children:[e("div",{className:"text-sm font-semibold text-fg",children:g}),e("div",{className:"text-[11px] text-fg/50",children:L})]}),e("button",{type:"button",onClick:_,"aria-label":"Close chat",className:"rounded-md p-1 text-fg/60 hover:bg-fg/5",children:e("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),n("div",{className:"flex-1 space-y-2 overflow-y-auto px-3 py-3",children:[o.length===0&&e("p",{className:"px-2 py-4 text-center text-sm text-fg/50",children:T}),o.map(r=>e($,{m:r},r.id)),e("div",{ref:y})]}),n("div",{className:"border-t border-line p-3",children:[p&&n("div",{className:"mb-2 grid grid-cols-2 gap-2",children:[e("input",{value:c,onChange:r=>j(r.target.value),placeholder:"Your name","aria-label":"Your name",className:"rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"}),e("input",{value:m,onChange:r=>I(r.target.value),type:"email",placeholder:"Email","aria-label":"Email",className:"rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"})]}),h&&e("p",{className:"mb-2 text-xs text-alert",children:h}),n("div",{className:"flex items-end gap-2",children:[e("textarea",{value:d,onChange:r=>b(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),w())},rows:1,placeholder:"Type a message…","aria-label":"Message",className:"max-h-28 flex-1 resize-none rounded-lg border border-line bg-transparent px-3 py-2 text-sm outline-none focus:border-accent"}),e("button",{type:"button",onClick:w,disabled:!v||i,className:"rounded-lg bg-btn px-3 py-2 text-sm font-semibold text-btn-ink disabled:opacity-40",children:i?"…":"Send"})]})]})]}):e(D,{label:B(g),onOpen:N,zIndex:60,look:x,badge:f>0&&e("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-red-600 px-1 text-[11px] font-bold text-white",children:f})})}export{R as DEFAULT_GREETING,O as DEFAULT_SUBTITLE,F as DEFAULT_TITLE,G as default};
@@ -1,10 +1,13 @@
1
1
  import type { PartStyles } from "efficient-web-builder/render/lib/document/part-styles";
2
+ import type { SlotComponent } from "efficient-easel/blocks";
2
3
  export declare function resolveCategoryImage(src?: string): string | undefined;
3
4
  export interface CollectionCardStyle {
4
5
  showPrice?: boolean;
5
6
  cardStyle?: "minimal" | "bordered" | "shadow";
6
7
  partStyles?: PartStyles;
7
8
  editing?: boolean;
9
+ ownerId?: string;
10
+ Template?: SlotComponent;
8
11
  }
9
12
  export declare const CollectionCardStyleContext: import("react").Context<CollectionCardStyle>;
10
13
  export interface CollectionRef {
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{createContext as C,useContext as _}from"react";import N from"next/link";import E from"efficient-web-builder/render/components/Placeholder";import{SIZE_STEP_OF_ROLE as k}from"efficient-web-builder/format/lib/fonts";import{COLLECTION_CARD_REGIONS as T,COLLECTION_CARD_TEXT_SIZE as r}from"efficient-web-builder/format/lib/sections/collection-card-text-regions";import{TEXT_REGION_ATTR as O,regionStyle as S,textRegionPartKey as I}from"efficient-web-builder/format/lib/sections/text-regions";import{renderGold as c,renderHeadline as L,splitParagraphs as R}from"efficient-web-builder/render/components/goldPhrases";import{absolutizeApiUrl as $}from"efficient-web-builder/render/lib/media";import{useTakeViewHide as P,withViewHide as j}from"efficient-web-builder/render/components/ViewHideRoot";function z(i){return $(i)??void 0}const A=C({}),J=3;function D({tag:i,name:n,desc:m,href:f,imageSrc:g,imageLabel:x,price:d}){const{showPrice:u,cardStyle:p,partStyles:h,editing:w}=_(A),b=p==="bordered"?" border border-line":p==="shadow"?" shadow-[0_8px_30px_rgba(0,0,0,0.12)]":"",v=z(g),s=P(),o=t=>w?{[O]:t}:{},a=t=>S(h?.[I(t)]?.role,T[t],k);return s.scope(l(N,{href:f||"#",className:j(`sf-card group relative block w-full min-w-0 overflow-hidden bg-surface-2${b}`,s.className),...s.attrs,children:[e("div",{className:"relative z-0 aspect-[4/5] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)] group-hover:scale-[1.04]",children:e(E,{label:x||"collection.jpg",src:v})}),e("div",{className:"pointer-events-none absolute inset-0 z-[1] [background:rgba(0,0,0,0.4)] group-hover:[background:rgba(0,0,0,0.3)] max-view-wide:hidden",style:{transition:"none"}}),l("div",{className:"absolute inset-x-8 bottom-8 z-[2] flex flex-col gap-3 text-overlay-fg max-view-wide:relative max-view-wide:inset-auto max-view-wide:p-6 max-view-wide:gap-3 max-view-wide:text-fg",children:[i&&e("span",{...o("tag"),style:a("tag"),className:`font-mono ${r.tag} uppercase tracking-[0.25em] opacity-70`,children:c(i)}),n&&e("h3",{...o("name"),style:a("name"),className:`font-heading2 ${r.name} font-medium leading-none tracking-[-0.03em] ${r.namePhone}`,children:typeof n=="string"?L(n,!1):n}),m&&R(m).map((t,y)=>e("p",{...o("body"),style:a("body"),className:`max-w-[420px] ${r.body} leading-[1.5] opacity-80`,children:c(t)},y)),u&&d&&e("span",{...o("price"),style:a("price"),className:`font-mono ${r.price} tracking-[0.05em] text-accent`,children:c(d)}),l("span",{...o("link"),style:a("link"),className:`mt-2 inline-flex items-center gap-3 font-mono ${r.link} uppercase tracking-[0.2em]`,children:["Explore",e("span",{className:"transition-transform group-hover:translate-x-[3px]","aria-hidden":!0,children:"→"})]})]})]}))}export{J as COLLECTION_CARD_SEED_COUNT,A as CollectionCardStyleContext,D as default,z as resolveCategoryImage};
1
+ "use client";import{jsx as e,jsxs as m}from"react/jsx-runtime";import{createContext as v,useContext as b}from"react";import E from"next/link";import S from"efficient-web-builder/render/components/Placeholder";import{COLLECTION_HOVER_ZOOM_CLASS as L,COLLECTION_WASH_CLASS as k}from"../lib/content/collection-card-look.js";import{SIZE_STEP_OF_ROLE as I}from"efficient-web-builder/format/lib/fonts";import{COLLECTION_CARD_REGIONS as R,COLLECTION_CARD_TEXT_SIZE as i}from"efficient-web-builder/format/lib/sections/collection-card-text-regions";import{TEXT_REGION_ATTR as $,regionStyle as A,textRegionPartKey as H}from"efficient-web-builder/format/lib/sections/text-regions";import{renderGold as d,renderHeadline as P,splitParagraphs as j}from"efficient-web-builder/render/components/goldPhrases";import{absolutizeApiUrl as z}from"efficient-web-builder/render/lib/media";import{useTakeViewHide as D,withViewHide as C}from"efficient-web-builder/render/components/ViewHideRoot";import{CardTemplateRows as G}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as U}from"efficient-web-builder/format/lib/content/page-width";function V(n){return z(n)??void 0}const X=v({}),ie=3;function Z({tag:n,name:t,desc:l,href:p,imageSrc:f,imageLabel:_,price:x}){const{showPrice:h,cardStyle:g,partStyles:y,editing:N,ownerId:O,Template:w}=b(X),T=g==="bordered"?" border border-line":g==="shadow"?" shadow-[0_8px_30px_rgba(0,0,0,0.12)]":"",u=V(f),r=D();if(w){const o={key:typeof t=="string"&&t?t:f??"card",name:typeof t=="string"?t:"",desc:l??"",image:u??"",tag:n??"",href:p||"#"};return r.scope(e("div",{className:C(`block w-full min-w-0 ${U}`,r.className),...r.attrs,children:e(G,{ownerId:O??"Collections",ownerType:"Collections",Template:w,rows:[o],fallback:null,children:c=>c})}))}const a=o=>N?{[$]:o}:{},s=o=>A(y?.[H(o)]?.role,R[o],I);return r.scope(m(E,{href:p||"#",className:C(`sf-card group relative block w-full min-w-0 overflow-hidden bg-surface-2${T}`,r.className),...r.attrs,children:[e("div",{className:`relative z-0 aspect-[4/5] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)] ${L}`,children:e(S,{label:_||"collection.jpg",src:u})}),e("div",{className:`pointer-events-none absolute inset-0 z-[1] ${k} max-view-wide:hidden`,style:{transition:"none"}}),m("div",{className:"absolute inset-x-8 bottom-8 z-[2] flex flex-col gap-3 text-overlay-fg max-view-wide:relative max-view-wide:inset-auto max-view-wide:p-6 max-view-wide:gap-3 max-view-wide:text-fg",children:[n&&e("span",{...a("tag"),style:s("tag"),className:`font-mono ${i.tag} uppercase tracking-[0.25em] opacity-70`,children:d(n)}),t&&e("h3",{...a("name"),style:s("name"),className:`font-heading2 ${i.name} font-medium leading-none tracking-[-0.03em] ${i.namePhone}`,children:typeof t=="string"?P(t,!1):t}),l&&j(l).map((o,c)=>e("p",{...a("body"),style:s("body"),className:`max-w-[420px] ${i.body} leading-[1.5] opacity-80`,children:d(o)},c)),h&&x&&e("span",{...a("price"),style:s("price"),className:`font-mono ${i.price} tracking-[0.05em] text-accent`,children:d(x)}),m("span",{...a("link"),style:s("link"),className:`mt-2 inline-flex items-center gap-3 font-mono ${i.link} uppercase tracking-[0.2em]`,children:["Explore",e("span",{className:"transition-transform group-hover:translate-x-[3px]","aria-hidden":!0,children:"→"})]})]})]}))}export{ie as COLLECTION_CARD_SEED_COUNT,X as CollectionCardStyleContext,Z as default,V as resolveCategoryImage};
@@ -9,9 +9,10 @@ export interface CollectionsProps {
9
9
  layout?: "grid" | "carousel" | "list";
10
10
  limit?: number;
11
11
  cards?: SlotComponent;
12
+ template?: SlotComponent;
12
13
  omitHead?: boolean;
13
14
  nodeId?: string;
14
15
  partStyles?: PartStyles;
15
16
  editing?: boolean;
16
17
  }
17
- export default function Collections({ eyebrow, heading, columns, showPrice, cardStyle, layout, limit, cards: Cards, omitHead, nodeId, partStyles, editing, }?: CollectionsProps): import("react").JSX.Element;
18
+ export default function Collections({ eyebrow, heading, columns, showPrice, cardStyle, layout, limit, cards: Cards, template, omitHead, nodeId, partStyles, editing, }?: CollectionsProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{Fragment as m,jsx as e,jsxs as o}from"react/jsx-runtime";import{useScopeClass as N}from"../lib/use-scope-class.js";import _ from"efficient-web-builder/render/components/SectionHeader";import{SectionTextParts as y}from"efficient-web-builder/render/lib/document/editing-bridges";import{CollectionCardStyleContext as T}from"./CollectionCard.js";import{fillRowCss as E}from"../lib/sections/fill-row.js";import{renderHeadline as M}from"efficient-web-builder/render/components/goldPhrases";import{CONTENT_CAP_GUTTER as x}from"../lib/sections/content-cap-gutter.js";function S({editing:t,nodeId:i,children:s}){return!t||!i?e(m,{children:s}):e(y,{nodeId:i,sectionType:"Collections",children:s})}const $=`${x} py-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:py-[70px]`,R=`${x} pt-0 pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-0 max-view-wide:pb-[70px]`,j={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5"};function A({eyebrow:t,heading:i,columns:s,showPrice:f,cardStyle:g,layout:u,limit:n,cards:l,omitHead:c=!1,nodeId:w,partStyles:h,editing:a=!1}={}){const r=N("cg"),C=typeof n=="number"&&n>0,v=u==="list"?"grid-cols-1":s===void 0?"grid-cols-3":j[Math.min(5,Math.max(2,Math.round(s)))]??"grid-cols-3",d=`${r} grid ${v} gap-4 max-view-wide:grid-cols-1 max-view-wide:gap-3`,p=E(r,d,{limit:n});return o("section",{className:c?R:$,children:[c?null:e(_,{num:t!==void 0?t:"01 / Collections",accentNum:!0,title:i!==void 0?M(i,!1):o(m,{children:["Three ranges,",e("br",{}),"one standard."]}),link:{text:"View all",href:"/wheels"}}),l&&e(S,{editing:a,nodeId:w,children:o(T.Provider,{value:{showPrice:f,cardStyle:g,partStyles:h,editing:a},children:[C&&e("style",{children:`.${r} > *:nth-child(n+${n+1}){display:none}`}),p&&e("style",{children:p}),e(l,{className:d,minEmptyHeight:260})]})})]})}export{A as default};
1
+ "use client";import{Fragment as x,jsx as e,jsxs as o}from"react/jsx-runtime";import{useScopeClass as h}from"../lib/use-scope-class.js";import E from"efficient-web-builder/render/components/SectionHeader";import{SectionTextParts as M}from"efficient-web-builder/render/lib/document/editing-bridges";import{CollectionCardStyleContext as v}from"./CollectionCard.js";import{fillRowCss as L}from"../lib/sections/fill-row.js";import{renderHeadline as S}from"efficient-web-builder/render/components/goldPhrases";import{CONTENT_CAP_GUTTER as l}from"../lib/sections/content-cap-gutter.js";import{COLLECTIONS_ROOM_BOTTOM as $,COLLECTIONS_ROOM_BOTTOM_PHONE as R,COLLECTIONS_ROOM_Y as I,COLLECTIONS_ROOM_Y_PHONE as y}from"../lib/content/collection-card-look.js";function P({editing:i,nodeId:r,children:s}){return!i||!r?e(x,{children:s}):e(M,{nodeId:r,sectionType:"Collections",children:s})}const A=`${l} ${I} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${y}`,F=`${l} pt-0 ${$} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-0 ${R}`,j=`${l} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]`,B={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5"};function H({eyebrow:i,heading:r,columns:s,showPrice:u,cardStyle:_,layout:g,limit:t,cards:c,template:a,omitHead:d=!1,nodeId:m,partStyles:N,editing:p=!1}={}){const n=h("cg"),w=typeof t=="number"&&t>0,T=g==="list"?"grid-cols-1":s===void 0?"grid-cols-3":B[Math.min(5,Math.max(2,Math.round(s)))]??"grid-cols-3",f=`${n} grid ${T} gap-4 max-view-wide:grid-cols-1 max-view-wide:gap-3`,O=L(n,f,{limit:t}),C=Number(a?.blockCount??0)>0;return o("section",{className:d?C?j:F:A,children:[d?null:e(E,{num:i!==void 0?i:"01 / Collections",accentNum:!0,title:r!==void 0?S(r,!1):o(x,{children:["Three ranges,",e("br",{}),"one standard."]}),link:{text:"View all",href:"/wheels"}}),c&&e(P,{editing:p,nodeId:m,children:o(v.Provider,{value:{showPrice:u,cardStyle:_,partStyles:N,editing:p,ownerId:m,Template:C?a:void 0},children:[w&&e("style",{children:`.${n} > *:nth-child(n+${t+1}){display:none}`}),O&&e("style",{children:O}),e(c,{className:f,minEmptyHeight:260})]})})]})}export{H as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as f}from"react/jsx-runtime";import E from"./SectionBand.js";import{useScopeClass as I}from"../lib/use-scope-class.js";import R from"efficient-web-builder/render/components/SectionHeader";import j from"./SectionFootnote.js";import z from"./TyreCard.js";import F from"./ViewMoreLink.js";import{renderGold as p,renderHeadline as L}from"efficient-web-builder/render/components/goldPhrases";import{useCurrency as H}from"./CurrencyContext.js";import{tyrePagePath as O}from"../lib/tyres/tyre-page-path.js";import{TYRE_ILLUSTRATION_NOTE as P}from"../lib/wheels/tyre-render.js";import{cardImageShapeTokens as B}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_CARD_INDEX_FORMAT as $,cardIndexCss as U}from"efficient-web-builder/format/lib/sections/product-card-style";import{say as Y}from"efficient-web-builder/format/lib/editor-words";const G="border-b border-line py-[120px] max-view-desktop:py-20";function u({frameClassName:i,style:o,children:t}){return i!==void 0?e("section",{className:i,style:o,children:t}):e(E,{className:G,style:o,children:t})}const g={2:"grid grid-cols-2 gap-2 max-view-tablet:grid-cols-1",3:"grid grid-cols-3 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1",4:"grid grid-cols-4 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1"};function V({num:i,title:o,description:t,tyres:x,footnote:h,footnoteLinkText:b,footnoteLinkHref:y,viewMore:n,editing:T=!1,frameClassName:l,omitHead:k=!1,columns:N=3,cardImage:S,outline:w,indexBadge:_}){const{currency:v,formatPrice:C}=H(),s=x??[],c=I("ct"),m=_??$,a=U(c,m),A=s.some(r=>!r.image),D=[h,A?P:null].filter(Boolean).join(" "),d=k?null:e(R,{num:i!=null?p(i):void 0,title:o!=null?L(o,!1):void 0,description:t!=null?p(t):void 0,accent:!0});return s.length===0?T?f(u,{frameClassName:l,children:[d,e("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:Y("No compatible tyres found for this wheel’s sizes yet — tyres appear automatically when a matching size is active and priced in the catalog.")})]}):null:f(u,{frameClassName:l,style:B(S),children:[a&&e("style",{children:a}),d,e("div",{className:`${a?`${c} `:""}${g[N]??g[3]}`,children:s.map(r=>e(z,{outline:w,showIndex:m!=="off",size:r.size,specs:r.specs,prices:r.prices,image:r.image,inStock:r.inStock,href:O(r.slug),currency:v,formatPrice:C},r.sku))}),n&&e("div",{className:"mt-10 flex",children:e(F,{href:n.href,label:n.label})}),e(j,{text:D,linkText:b,linkHref:y})]})}export{V as default};
1
+ "use client";import{jsx as e,jsxs as u}from"react/jsx-runtime";import D from"./SectionBand.js";import{useScopeClass as E}from"../lib/use-scope-class.js";import I from"efficient-web-builder/render/components/SectionHeader";import O from"./SectionFootnote.js";import R from"./TyreCard.js";import z from"./ViewMoreLink.js";import{renderGold as g,renderHeadline as F}from"efficient-web-builder/render/components/goldPhrases";import{useCurrency as L}from"./CurrencyContext.js";import{tyrePagePath as H}from"../lib/tyres/tyre-page-path.js";import{TYRE_ILLUSTRATION_NOTE as P}from"../lib/wheels/tyre-render.js";import{cardImageShapeTokens as B}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_CARD_INDEX_FORMAT as $,cardIndexCss as U}from"efficient-web-builder/format/lib/sections/product-card-style";import{say as Y}from"efficient-web-builder/format/lib/editor-words";const G="border-b border-line py-[120px] max-view-desktop:py-20";function x({frameClassName:i,style:o,children:t}){return i!==void 0?e("section",{className:i,style:o,children:t}):e(D,{className:G,style:o,children:t})}const l={2:"grid grid-cols-2 gap-2 max-view-tablet:grid-cols-1",3:"grid grid-cols-3 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1",4:"grid grid-cols-4 gap-2 max-view-desktop:grid-cols-2 max-view-tablet:grid-cols-1"};function V({num:i,title:o,description:t,tyres:h,footnote:b,footnoteLinkText:y,footnoteLinkHref:T,viewMore:n,editing:k=!1,frameClassName:c,omitHead:w=!1,columns:m=3,cardImage:N,outline:S,indexBadge:_}){const{currency:v,formatPrice:C}=L(),s=h??[],d=E("ct"),f=_??$,a=U(d,f),j=s.some(r=>!r.image),A=[b,j?P:null].filter(Boolean).join(" "),p=w?null:e(I,{num:i!=null?g(i):void 0,title:o!=null?F(o,!1):void 0,description:t!=null?g(t):void 0,accent:!0});return s.length===0?k?u(x,{frameClassName:c,children:[p,e("p",{className:"border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:Y("No compatible tyres found for this wheel’s sizes yet — tyres appear automatically when a matching size is active and priced in the catalog.")})]}):null:u(x,{frameClassName:c,style:B(N),children:[a&&e("style",{children:a}),p,e("div",{className:`${a?`${d} `:""}${(Object.hasOwn(l,m)?l[m]:void 0)??l[3]}`,children:s.map(r=>e(R,{outline:S,showIndex:f!=="off",size:r.size,specs:r.specs,prices:r.prices,image:r.image,inStock:r.inStock,href:H(r.slug),currency:v,formatPrice:C},r.sku))}),n&&e("div",{className:"mt-10 flex",children:e(z,{href:n.href,label:n.label})}),e(O,{text:A,linkText:y,linkHref:T})]})}export{V as default};
@@ -1 +1 @@
1
- "use client";import{jsx as n,Fragment as f,jsxs as l}from"react/jsx-runtime";import{ThemedSelectList as I,useThemedSelect as S}from"./ThemedSelect.js";import{useCurrency as y}from"./CurrencyContext.js";import{countryName as k}from"../lib/countries.js";import{regionSwitchHref as v}from"../lib/menu-link.js";import{FlagAuIcon as N,FlagCaIcon as _,FlagEuIcon as R,FlagGbIcon as A,FlagNzIcon as U,FlagUsIcon as T,GlobeIcon as j}from"efficient-shell/icons/efficient";import{COUNTRY_SHOW_AS_DEFAULT as E,countryShowAsHasFlag as G}from"../lib/content/country-show-as.js";const x={US:T,CA:_,AU:N,NZ:U,GB:A,EU:R};function b({code:c,width:e}){const a=x[c];return a?n("span",{"aria-hidden":!0,className:"inline-flex shrink-0 border border-line",children:n(a,{size:e})}):null}function H(c,e){const a=n(b,{code:e.code,width:18});switch(c){case"code_currency":return e.currency?l(f,{children:[n("span",{children:e.code}),n("span",{"aria-hidden":!0,className:"opacity-50",children:"·"}),n("span",{children:e.currency})]}):n("span",{children:e.code});case"globe_code":return l(f,{children:[n(j,{size:14,className:"shrink-0"}),n("span",{children:e.code})]});case"currency":return n("span",{children:e.currency??e.code});case"flag_code":return l(f,{children:[a,n("span",{children:e.code})]});case"flag":return x[e.code]?a:n("span",{children:e.code});default:return n("span",{children:e.name})}}function w(c,e,a){const s=new Map(c.map(t=>[t.code,t]));return(e?.length?e:c.map(t=>t.code)).map(t=>{const i=s.get(t);return{code:t,name:i?.name||k(t),currency:i?.currency,url:i?.url||a?.[t]||""}})}function $(c){const{countries:e}=y();return w(e,c).length>0}function L({urls:c,countries:e,showAs:a=E}={}){const{country:s,setCountry:t,countries:i}=y(),d=w(i,e,c),p=d.find(o=>o.code===s)??d[0];function F(o){const h=c?v(d.find(m=>m.code===o)?.url,window.location.href):null;if(h){window.location.href=h;return}i.some(m=>m.code===o)&&t(o)}const C=G(a),g=d.map(o=>({value:o.code,label:o.name,meta:o.currency,...C?{lead:n(b,{code:o.code,width:21})}:{}})),r=S({items:g,value:s,onPick:F});if(!p)return null;const u=r.open;return l("div",{ref:r.wrapRef,className:"relative",children:[l("button",{ref:o=>{r.triggerRef.current=o},type:"button","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":u?r.listId:void 0,"aria-activedescendant":r.activeId,"aria-label":`Region: ${p.name}. Click to change.`,onClick:r.toggle,onKeyDown:r.onTriggerKeyDown,suppressHydrationWarning:!0,className:"inline-flex items-center gap-2 whitespace-nowrap border border-fg-dim px-3 py-2 font-mono text-[13px] uppercase tracking-[0.18em] transition-colors hover:border-fg",style:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:[H(a,p),n("span",{"aria-hidden":!0,className:`text-[11px] opacity-70 transition-transform ${u?"rotate-180":""}`,children:"▾"})]}),u&&n(I,{id:r.listId,tone:"region",ariaLabel:"Choose region",items:g,value:s,focusIdx:r.focusIdx,onFocus:r.setFocusIdx,onPick:r.pick,listRef:r.listRef})]})}export{L as default,$ as useCountrySelectShows};
1
+ "use client";import{jsx as n,Fragment as f,jsxs as l}from"react/jsx-runtime";import{ThemedSelectList as I,useThemedSelect as S}from"./ThemedSelect.js";import{useCurrency as x}from"./CurrencyContext.js";import{countryName as k}from"../lib/countries.js";import{regionSwitchHref as v}from"../lib/menu-link.js";import{FlagAuIcon as N,FlagCaIcon as _,FlagEuIcon as R,FlagGbIcon as j,FlagNzIcon as A,FlagUsIcon as O,GlobeIcon as U}from"efficient-shell/icons/efficient";import{COUNTRY_SHOW_AS_DEFAULT as T,countryShowAsHasFlag as E}from"../lib/content/country-show-as.js";const g={US:O,CA:_,AU:N,NZ:A,GB:j,EU:R};function b({code:r,width:e}){const a=Object.hasOwn(g,r)?g[r]:void 0;return a?n("span",{"aria-hidden":!0,className:"inline-flex shrink-0 border border-line",children:n(a,{size:e})}):null}function G(r,e){const a=n(b,{code:e.code,width:18});switch(r){case"code_currency":return e.currency?l(f,{children:[n("span",{children:e.code}),n("span",{"aria-hidden":!0,className:"opacity-50",children:"·"}),n("span",{children:e.currency})]}):n("span",{children:e.code});case"globe_code":return l(f,{children:[n(U,{size:14,className:"shrink-0"}),n("span",{children:e.code})]});case"currency":return n("span",{children:e.currency??e.code});case"flag_code":return l(f,{children:[a,n("span",{children:e.code})]});case"flag":return Object.hasOwn(g,e.code)?a:n("span",{children:e.code});default:return n("span",{children:e.name})}}function w(r,e,a){const s=new Map(r.map(t=>[t.code,t]));return(e?.length?e:r.map(t=>t.code)).map(t=>{const i=s.get(t);return{code:t,name:i?.name||k(t),currency:i?.currency,url:i?.url||a?.[t]||""}})}function $(r){const{countries:e}=x();return w(e,r).length>0}function H({urls:r,countries:e,showAs:a=T}={}){const{country:s,setCountry:t,countries:i}=x(),d=w(i,e,r),p=d.find(c=>c.code===s)??d[0];function F(c){const y=r?v(d.find(m=>m.code===c)?.url,window.location.href):null;if(y){window.location.href=y;return}i.some(m=>m.code===c)&&t(c)}const C=E(a),h=d.map(c=>({value:c.code,label:c.name,meta:c.currency,...C?{lead:n(b,{code:c.code,width:21})}:{}})),o=S({items:h,value:s,onPick:F});if(!p)return null;const u=o.open;return l("div",{ref:o.wrapRef,className:"relative",children:[l("button",{ref:c=>{o.triggerRef.current=c},type:"button","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":u?o.listId:void 0,"aria-activedescendant":o.activeId,"aria-label":`Region: ${p.name}. Click to change.`,onClick:o.toggle,onKeyDown:o.onTriggerKeyDown,suppressHydrationWarning:!0,className:"inline-flex items-center gap-2 whitespace-nowrap border border-fg-dim px-3 py-2 font-mono text-[13px] uppercase tracking-[0.18em] transition-colors hover:border-fg",style:{color:"color-mix(in oklab, currentColor 80%, transparent)"},children:[G(a,p),n("span",{"aria-hidden":!0,className:`text-[11px] opacity-70 transition-transform ${u?"rotate-180":""}`,children:"▾"})]}),u&&n(I,{id:o.listId,tone:"region",ariaLabel:"Choose region",items:h,value:s,focusIdx:o.focusIdx,onFocus:o.setFocusIdx,onPick:o.pick,listRef:o.listRef})]})}export{H as default,$ as useCountrySelectShows};
@@ -22,6 +22,9 @@ interface CurrencyValue {
22
22
  export declare function createPriceFormatter(currencies: SiteCurrency[]): (amount: number, currency: string) => string;
23
23
  export declare function createMoneyFormatter(currencies: SiteCurrency[]): (amount: number, currency: string) => string;
24
24
  export declare function CurrencyProvider({ children, currencies, countries, defaultCurrency, defaultCountry, }: CurrencyProviderProps): import("react").JSX.Element;
25
+ export declare function useCurrency(options: {
26
+ optional: true;
27
+ }): CurrencyValue | null;
25
28
  export declare function useCurrency(): CurrencyValue;
26
29
  export declare function useActiveCountry(): string;
27
30
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as h}from"react/jsx-runtime";import{createContext as A,useContext as v,useEffect as O,useMemo as i,useState as E}from"react";import{currencyFormat as T}from"../lib/commerce.js";import{safeLocalStorage as P}from"efficient-web-builder/format/lib/safe-storage";const Y="storefront-country",g=Y,l=A(null);function j(r){return S(r,"catalogue")}function D(r){return S(r,"money")}function S(r,a){const f=new Map(r.map(n=>[n.code,n.decimalPlaces]));return(n,s)=>{if(!s)return"";const t=f.get(s)??0;return T(s,a==="money"?t:0,t).format(n)}}function L({children:r,currencies:a,countries:f,defaultCurrency:n,defaultCountry:s}){const t=i(()=>a??[],[a]),o=i(()=>f??[],[f]),C=i(()=>n||t.find(e=>e.isDefault)?.code||t[0]?.code||"",[n,t]),w=i(()=>s||o.find(e=>e.isDefault)?.code||o[0]?.code||"",[s,o]),[m,p]=E(w),[x,F]=E(!1);O(()=>{const e=P.getItem(g);e&&o.some(u=>u.code===e)&&p(e),F(!0)},[o]);function M(e){p(e),P.setItem(g,e)}const R=i(()=>{const e=o.find(c=>c.code===m)??null,u=e?.currency,d=u&&t.some(c=>c.code===u)?u:C,_=j(t),b=D(t);return{country:m,currency:d,setCountry:M,currencies:t,countries:o,activeCountry:e,formatPrice:(c,y)=>_(c,y??d),formatMoney:(c,y)=>b(c,y??d),ready:x}},[m,t,o,C,x]);return h(l.Provider,{value:R,children:r})}function N(){const r=v(l);if(!r)throw new Error("useCurrency must be used within a CurrencyProvider");return r}function U(){return v(l)?.country??""}export{Y as COUNTRY_STORAGE_KEY,L as CurrencyProvider,D as createMoneyFormatter,j as createPriceFormatter,U as useActiveCountry,N as useCurrency};
1
+ "use client";import{jsx as h}from"react/jsx-runtime";import{createContext as A,useContext as v,useEffect as O,useMemo as a,useState as E}from"react";import{currencyFormat as T}from"../lib/commerce.js";import{safeLocalStorage as P}from"efficient-web-builder/format/lib/safe-storage";const Y="storefront-country",g=Y,l=A(null);function j(r){return S(r,"catalogue")}function D(r){return S(r,"money")}function S(r,n){const f=new Map(r.map(c=>[c.code,c.decimalPlaces]));return(c,u)=>{if(!u)return"";const t=f.get(u)??0;return T(u,n==="money"?t:0,t).format(c)}}function L({children:r,currencies:n,countries:f,defaultCurrency:c,defaultCountry:u}){const t=a(()=>n??[],[n]),o=a(()=>f??[],[f]),p=a(()=>c||t.find(e=>e.isDefault)?.code||t[0]?.code||"",[c,t]),w=a(()=>u||o.find(e=>e.isDefault)?.code||o[0]?.code||"",[u,o]),[m,C]=E(w),[x,F]=E(!1);O(()=>{const e=P.getItem(g);e&&o.some(i=>i.code===e)&&C(e),F(!0)},[o]);function M(e){C(e),P.setItem(g,e)}const R=a(()=>{const e=o.find(s=>s.code===m)??null,i=e?.currency,d=i&&t.some(s=>s.code===i)?i:p,_=j(t),b=D(t);return{country:m,currency:d,setCountry:M,currencies:t,countries:o,activeCountry:e,formatPrice:(s,y)=>_(s,y??d),formatMoney:(s,y)=>b(s,y??d),ready:x}},[m,t,o,p,x]);return h(l.Provider,{value:R,children:r})}function N(r){const n=v(l);if(!n&&!r?.optional)throw new Error("useCurrency must be used within a CurrencyProvider");return n}function U(){return v(l)?.country??""}export{Y as COUNTRY_STORAGE_KEY,L as CurrencyProvider,D as createMoneyFormatter,j as createPriceFormatter,U as useActiveCountry,N as useCurrency};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{containerGapProps as i}from"efficient-web-builder/format/lib/content/container-gap";import{HideTaker as l}from"efficient-web-builder/render/components/ViewHideRoot";const m={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function c({direction:t="vertical",gap:o,gapPhone:s,align:a="start",content:n}){const e=i("FooterGroup",o,t==="horizontal"?"inline":"block",s);return r(l,{as:"div",className:"min-w-0",children:r(n,{className:`flex ${t==="horizontal"?"flex-row flex-wrap":"flex-col"} ${m[a]}${e.className}`,style:e.style,minEmptyHeight:80})})}export{c as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{containerGapProps as c}from"efficient-web-builder/format/lib/content/container-gap";import{HideTaker as l}from"efficient-web-builder/render/components/ViewHideRoot";const s={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function m({direction:t="vertical",gap:n,gapPhone:a,align:e="start",content:i}){const r=c("FooterGroup",n,t==="horizontal"?"inline":"block",a);return o(l,{as:"div",className:"min-w-0",children:o(i,{className:`flex ${t==="horizontal"?"flex-row flex-wrap":"flex-col"} ${Object.hasOwn(s,e)?s[e]:void 0}${r.className}`,style:r.style,minEmptyHeight:80})})}export{m as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as k}from"react/jsx-runtime";import w from"next/link";import L,{FOOTER_LOGO_PX as N,WORDMARK_FIT_FLOOR_PX as O}from"efficient-web-builder/render/components/Logo";import{useSiteLogo as _}from"efficient-web-builder/render/components/SiteLogoContext";import{renderGold as v}from"efficient-web-builder/render/components/goldPhrases";import{say as F}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as P}from"efficient-web-builder/render/components/ViewHideRoot";const j={left:"items-start text-left",center:"items-center text-center",right:"items-end text-right"};function y({tagline:t,widthPct:n=100,align:l="left",reverse:m=!0,color:d=null,padTop:i=0,padRight:o=0,padBottom:s=0,padLeft:a=0,editing:c=!1}){const{src:x,reversedSrc:f,inkIsDark:p,wordmark:g,siteName:r}=_(),u=Math.round(N*(n/100)),h={...i?{paddingTop:i}:{},...o?{paddingRight:o}:{},...s?{paddingBottom:s}:{},...a?{paddingLeft:a}:{}};return k(P,{as:"div",className:`flex min-w-0 flex-col ${j[l]} [container-type:inline-size]`,style:h,children:[e(w,{href:"/","aria-label":r?`${r} home`:"Home",className:"inline-flex max-w-full overflow-x-clip",children:e(L,{variant:"footer",sizePx:u,src:x,reverse:m,color:d,reversedSrc:f,inkIsDark:p,wordmark:g,siteName:r,fitWordmarkToContainer:!0,fitFloorPx:O})}),t?e("p",{className:"mt-4 max-w-[280px] text-[13px] leading-[1.5] text-fg-dim",children:v(t)}):c?e("p",{className:"mt-4 max-w-[280px] text-[13px] italic leading-[1.5] text-fg-dim/60",children:F("Add a short brand tagline →")}):null]})}export{y as default};
1
+ "use client";import{jsx as e,jsxs as O}from"react/jsx-runtime";import w from"next/link";import L,{FOOTER_LOGO_PX as N,WORDMARK_FIT_FLOOR_PX as _}from"efficient-web-builder/render/components/Logo";import{useSiteLogo as v}from"efficient-web-builder/render/components/SiteLogoContext";import{renderGold as j}from"efficient-web-builder/render/components/goldPhrases";import{say as F}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as P}from"efficient-web-builder/render/components/ViewHideRoot";const l={left:"items-start text-left",center:"items-center text-center",right:"items-end text-right"};function y({tagline:r,widthPct:m=100,align:i="left",reverse:d=!0,color:c=null,padTop:o=0,padRight:s=0,padBottom:n=0,padLeft:a=0,editing:x=!1}){const{src:f,reversedSrc:p,inkIsDark:g,wordmark:u,siteName:t}=v(),h=Math.round(N*(m/100)),k={...o?{paddingTop:o}:{},...s?{paddingRight:s}:{},...n?{paddingBottom:n}:{},...a?{paddingLeft:a}:{}};return O(P,{as:"div",className:`flex min-w-0 flex-col ${Object.hasOwn(l,i)?l[i]:void 0} [container-type:inline-size]`,style:k,children:[e(w,{href:"/","aria-label":t?`${t} home`:"Home",className:"inline-flex max-w-full overflow-x-clip",children:e(L,{variant:"footer",sizePx:h,src:f,reverse:d,color:c,reversedSrc:p,inkIsDark:g,wordmark:u,siteName:t,fitWordmarkToContainer:!0,fitFloorPx:_})}),r?e("p",{className:"mt-4 max-w-[280px] text-[13px] leading-[1.5] text-fg-dim",children:j(r)}):x?e("p",{className:"mt-4 max-w-[280px] text-[13px] italic leading-[1.5] text-fg-dim/60",children:F("Add a short brand tagline →")}):null]})}export{y as default};
@@ -25,7 +25,9 @@ export interface FooterMenuProps {
25
25
  linkRange?: unknown;
26
26
  menuStyle?: unknown;
27
27
  currentPage?: unknown;
28
+ menuStylePhone?: unknown;
29
+ menuPanelWidth?: unknown;
30
+ menuPanelTintColor?: unknown;
31
+ menuPanelTintOpacity?: unknown;
28
32
  }
29
- export declare const MENU_STYLE_PLAIN = "plain";
30
- export declare const MENU_STYLE_TABS = "tabs";
31
- export default function FooterMenu({ owner, menu, served, heading, accordionMobile, showDividers, editing, layout, linkAlign, linkRange, menuStyle, currentPage, }: FooterMenuProps): import("react").JSX.Element | null;
33
+ export default function FooterMenu({ owner, menu, served, heading, accordionMobile, showDividers, editing, layout, linkAlign, linkRange, menuStyle, currentPage, menuStylePhone, menuPanelWidth, menuPanelTintColor, menuPanelTintOpacity, }: FooterMenuProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as F,jsxs as i}from"react/jsx-runtime";import{useCallback as j,useEffect as B,useRef as Y,useState as O}from"react";import W from"next/link";import{REPEAT_ATTRIBUTE as G,REPEAT_INDEX_ATTRIBUTE as z}from"efficient-easel/draw";import q from"./CountrySelect.js";import{MenuPlaceContext as V}from"./MenuLinkBlock.js";import X from"./ThemeToggle.js";import{CardRowContext as Z,CardTemplateRows as J}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as v}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as K}from"./HeaderTools.js";import{usePhoneMenuTools as Q}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as ee}from"./SearchContext.js";import{useModalDismiss as ne}from"./useModalDismiss.js";import le from"efficient-easel/screen/components/UiIcon";import{usePreviewMenus as re}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as te,FOOTER_MENU_PLACEHOLDER_HEADING as ae,FOOTER_MENU_PLACEHOLDER_HINT as oe}from"../lib/content/menu-placeholder.js";import{say as T}from"efficient-web-builder/format/lib/editor-words";import{UNDER_HEADER_SHEET_CLASS as se}from"../lib/content/header-bar.js";import{isMenuOrphaned as ie}from"../lib/menu-source.js";import{legacyBlockAlignOf as ce}from"efficient-web-builder/format/lib/content/block-align";import{menuLinkInRange as me,resolveMenuLinkRange as ue}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as P}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as H,currentLinkIndex as de}from"../lib/content/tab-strip.js";import{useCurrentPagePath as pe}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as E}from"efficient-web-builder/render/components/ViewHideRoot";const qe="plain",he="tabs",fe=`flex list-none flex-col gap-3 ${P}`,y="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",L="text-[12px] italic text-fg-dim/70",U=(n,l)=>n&&l>0?"border-t border-line pt-3":"",xe=n=>({label:n.label??"",url:n.href??"",served:n}),D=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},be=Array.from({length:te},()=>({label:"",href:""}));function M({owner:n,items:l,place:a,wrap:c,markCurrent:h=!1}){const x=l?l.map(D):be,o=pe(),m=l&&h?de(l.map(g=>g.url??""),o):-1,u=m<0?null:{index:m,href:l[m].url??""};return e(V.Provider,{value:l?u?{...a,current:u}:a:{...a,placeholder:!0},children:e(J,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:x,items:l??void 0,fallback:null,wrapCopy:c,children:g=>g})})}const R=n=>(n.template?.blockCount??0)>0,Ne="Nothing to show yet: this menu's entries come from its Menu content.",$="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function Ee({owner:n,items:l,label:a,editing:c,linkAlign:h,linkRange:x,markCurrent:o}){const m=ce(h),u=ue(x),g=!!u&&l!==null&&u.to!==void 0&&u.to<l.length,[w,C]=O(!1),_=Y(null),b=Q(),{open:S}=ee(),N=a||"Menu",s=j(()=>C(!1),[]);ne({active:w,onDismiss:s,scopeRef:_});const f=e(M,{owner:n,items:l,place:{place:"row"},markCurrent:o,wrap:(r,t)=>{const p=l!==null&&u&&!me(u,t.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...p,children:r})}}),k=(r,t,p)=>c?{[G]:`${r}:${p<0?"panel":"dropdown"}`,[z]:`${p+1}.${t.index}`}:null,A=e(M,{owner:n,items:l,place:{place:"panel",onNavigate:s},markCurrent:o,wrap:(r,t)=>i(F,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...k(n.id,t,-1),children:r}),l===null?null:(t.item?.dropdown_items??[]).map((p,I)=>e(Z.Provider,{value:{...t,row:D(p),item:p},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...k(n.id,t,I),children:r})},I))]})}),d=b&&(b.search||b.region||b.account||b.theme)?b:null;return!c&&l!==null&&!R(n)&&!d?null:i(E,{as:"nav",ref:_,"aria-label":N,"data-menu-row":"",...m?{"data-menu-align":m}:null,...g?{"data-menu-part":"lead"}:null,className:"min-w-0",children:[e("ul",{className:`m-0 hidden list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${P} uppercase tracking-[0.18em] view-tablet:flex`,children:f}),e("button",{type:"button",className:"flex h-11 w-11 items-center justify-center view-tablet:hidden","aria-expanded":w,"aria-label":w?"Close the menu":"Open the menu",onClick:()=>C(r=>!r),children:e("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:w?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),w?i("div",{role:"dialog","aria-label":N,className:`${se} z-[60] flex flex-col overflow-y-auto bg-bg text-fg view-tablet:hidden`,children:[e("ul",{className:"m-0 flex list-none flex-col px-5 py-3 font-mono text-[16px] uppercase tracking-[0.18em]",children:A}),d?i("div",{className:"mt-auto flex flex-col gap-4 border-t border-line bg-surface p-5",children:[d.search?i("button",{type:"button",className:"flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]",onClick:c?void 0:()=>{s(),S()},children:[e(le,{name:"search",size:18,strokeWidth:1.6,rounded:!0}),K.search]}):null,d.account?i("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),e(W,{href:"/account",onClick:s,className:"mono-eyebrow underline",children:"Your account"})]}):null,d.region?i("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),e(q,{})]}):null,d.theme?i("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),e(X,{})]}):null]}):null]}):null]})}function ge({owner:n,items:l,label:a,editing:c,markCurrent:h}){return!c&&(l===null||l.length===0||!R(n))?null:e(E,{as:"nav","aria-label":a||"Menu","data-menu-tabs":"",className:"min-w-0",children:e("ul",{className:H.list,children:e(M,{owner:n,items:l,place:{place:"tab"},markCurrent:h,wrap:(x,o)=>e("li",{className:H.item(o.index===0,c),children:x})})})})}function we({owner:n,menu:l,served:a,heading:c,accordionMobile:h=!1,showDividers:x=!1,editing:o=!1,layout:m="column",linkAlign:u,linkRange:g,menuStyle:w,currentPage:C}){const _=m==="row"&&C===!0,{live:b,ready:S}=re(),N=!a&&ie({id:l?.id,handle:l?.handle,editing:o,ready:S,live:b}),s=a?a.map(xe):N?[]:l?.items??[],f=c||(a?"":l?.name)||"",[k,A]=O(!1);if(B(()=>{if(!h)return;const r=window.matchMedia("(max-width: 800px)"),t=()=>A(r.matches);return t(),r.addEventListener("change",t),()=>r.removeEventListener("change",t)},[h]),a&&s.length===0)return o?e(E,{as:"p",className:L,children:T(Ne)}):null;if(m==="row"&&o&&!N&&s.length>0&&!R(n))return e(E,{as:"p",className:L,children:T($)});if(m==="row"&&w===he)return e(ge,{owner:n,items:N?null:s,label:f,editing:o,markCurrent:_});if(m==="row")return e(Ee,{owner:n,items:N?null:s,label:f,editing:o,linkAlign:u,linkRange:g,markCurrent:_});const d=r=>e("ul",{className:fe,children:e(M,{owner:n,items:r,place:{place:"column"},wrap:(t,p)=>e("li",{className:r?U(x,p.index):`text-fg ${U(x,p.index)}`,children:t})})});return N?i(E,{as:"div",className:"min-w-0",children:[e("h4",{className:y,children:c?v(c):T(ae)}),d(null),e("p",{className:`mt-3 ${L}`,children:T(oe)})]}):s.length===0||!R(n)?i(E,{as:"div",className:"min-w-0",children:[f?e("h4",{className:y,children:v(f)}):null,o?e("p",{className:L,children:s.length===0?T("This menu has no links yet — add them in {place}.",{place:T("Storefront → Menus")}):T($)}):null]}):h&&k?i(E,{as:"details",className:"min-w-0 border-b border-line",children:[i("summary",{className:"flex cursor-pointer list-none items-center justify-between py-3 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",children:[v(f),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:d(s)})]}):i(E,{as:"div",className:"min-w-0",children:[f?e("h4",{className:y,children:v(f)}):null,d(s)]})}export{qe as MENU_STYLE_PLAIN,he as MENU_STYLE_TABS,we as default};
1
+ "use client";import{jsx as e,Fragment as D,jsxs as p}from"react/jsx-runtime";import{useCallback as de,useEffect as X,useRef as H,useState as k}from"react";import{createPortal as pe}from"react-dom";import{CloseIcon as he,MenuIcon as fe}from"efficient-shell/icons/efficient-glyphs";import we from"./PopupFrame.js";import{POPUP_LOOK_DEFAULTS as Z}from"efficient-web-builder/format/lib/popup/look";import{REPEAT_ATTRIBUTE as xe,REPEAT_INDEX_ATTRIBUTE as Ne}from"efficient-easel/draw";import{MenuPlaceContext as be}from"./MenuLinkBlock.js";import{CardRowContext as ge,CardTemplateRows as Ee}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as F}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as J}from"./HeaderTools.js";import{usePhoneMenuTools as Te}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as Ce}from"./SearchContext.js";import{useModalDismiss as _e}from"./useModalDismiss.js";import{PhoneSheet as ye}from"./PhoneSheet.js";import{usePreviewMenus as ve}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as Me,FOOTER_MENU_PLACEHOLDER_HEADING as Le,FOOTER_MENU_PLACEHOLDER_HINT as Oe}from"../lib/content/menu-placeholder.js";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{isMenuOrphaned as Re}from"../lib/menu-source.js";import{legacyBlockAlignOf as Se}from"efficient-web-builder/format/lib/content/block-align";import{MENU_PANEL_TINT_OPACITY_DEFAULT as Ae,MENU_PANEL_WIDTH_DEFAULT as ke,MENU_STYLE_BUTTON as Q,MENU_STYLE_TABS as Pe,menuLinkInRange as Ie,menuShowClasses as ee,resolveMenuLinkRange as Ue}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as ne}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as te,currentLinkIndex as De}from"../lib/content/tab-strip.js";import{useCurrentPagePath as He}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as C}from"efficient-web-builder/render/components/ViewHideRoot";const Fe=`flex list-none flex-col gap-3 ${ne}`,G="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",$="text-[12px] italic text-fg-dim/70",le=(n,t)=>n&&t>0?"border-t border-line pt-3":"",$e=n=>({label:n.label??"",url:n.href??"",served:n}),re=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},Be=Array.from({length:Me},()=>({label:"",href:""}));function P({owner:n,items:t,place:m,wrap:h,markCurrent:b=!1}){const g=t?t.map(re):Be,i=He(),u=t&&b?De(t.map(f=>f.url??""),i):-1,_=u<0?null:{index:u,href:t[u].url??""};return e(be.Provider,{value:t?_?{...m,current:_}:m:{...m,placeholder:!0},children:e(Ee,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:g,items:t??void 0,fallback:null,wrapCopy:h,children:f=>f})})}const B=n=>(n.template?.blockCount??0)>0,We="Nothing to show yet: this menu's entries come from its Menu content.",ae="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function oe({owner:n,items:t,label:m,editing:h,linkAlign:b,linkRange:g,markCurrent:i,menuStyle:u,menuStylePhone:_,panelLook:f}){const y=Se(b),v=Ue(g),R=!!v&&t!==null&&v.to!==void 0&&v.to<t.length,[c,S]=k(!1),M=H(null),x=Te(),{open:W}=Ce(),A=m||"Menu",d=de(()=>S(!1),[]),l=u===Q||_===Q,s=ee(u,_),[I,Y]=k("sheet"),T=H(null),w=H(null),[N,U]=k(void 0),[L,ie]=k(null),V=()=>{if(!c&&l){const o=M.current?.ownerDocument.defaultView;Y(o?.matchMedia("(min-width: 720px)").matches?"side":"sheet");const r=T.current?.querySelector("span");if(r&&o){const a=o.getComputedStyle(r);U({fontFamily:a.fontFamily,fontSize:a.fontSize,letterSpacing:a.letterSpacing,textTransform:a.textTransform});const E=(T.current?.querySelector("svg")??T.current)?.getBoundingClientRect();ie(E?{left:E.left,top:E.top,height:E.height}:null)}}S(o=>!o)};X(()=>{if(!c||!l)return;const r=M.current?.ownerDocument.defaultView?.matchMedia("(min-width: 720px)");if(!r)return;const a=()=>S(!1);return r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[c,l]);const j=H(null);_e({active:c&&!(c&&l&&I==="side"),onDismiss:d,scopeRef:M,focusRef:j,trapRef:j});const se=e(P,{owner:n,items:t,place:{place:"row"},markCurrent:i,wrap:(o,r)=>{const a=t!==null&&v&&!Ie(v,r.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...a,children:o})}}),q=(o,r,a)=>h?{[xe]:`${o}:${a<0?"panel":"dropdown"}`,[Ne]:`${a+1}.${r.index}`}:null,ce=e(P,{owner:n,items:t,place:{place:"panel",onNavigate:d},markCurrent:i,wrap:(o,r)=>p(D,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...q(n.id,r,-1),children:o}),t===null?null:(r.item?.dropdown_items??[]).map((a,E)=>e(ge.Provider,{value:{...r,row:re(a),item:a},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...q(n.id,r,E),children:o})},E))]})}),me=x&&(x.search||x.region||x.account||x.theme)?x:null;if(!h&&t!==null&&!B(n)&&!me)return null;const K=e(ye,{role:"dialog",panelRef:j,name:A,entries:ce,tools:x,withAccount:!l,editing:h,onClose:d,onSearch:W,phoneOnly:!l,marker:l?"sheet":void 0,listStyle:l&&L?{paddingLeft:L.left,paddingRight:L.left}:void 0});let z=null;if(l){const o=M.current?.ownerDocument,r={...Z,placement:"left",height:"full",closeButton:"none",width:typeof f?.width=="number"?f.width:ke,tintColor:typeof f?.tintColor=="string"?f.tintColor:Z.tintColor,tintOpacity:typeof f?.tintOpacity=="number"?f.tintOpacity:Ae},a=e(we,{look:r,drawer:{closeRef:w},open:!0,onClose:d,label:A,children:p("div",{"data-menu-panel":"side",className:"flex h-full flex-col overflow-y-auto text-fg",children:[e("div",{className:"flex min-h-[var(--sf-header-h,88px)] shrink-0 items-center px-8",style:L?{paddingLeft:L.left}:void 0,children:p("button",{ref:w,type:"button",onClick:d,className:"inline-flex h-11 items-center gap-2",style:N,children:[e(he,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap",children:J.close})]})}),e("ul",{className:"m-0 flex list-none flex-col px-8 pb-8",style:L?{paddingLeft:L.left}:void 0,children:e(P,{owner:n,items:t,place:{place:"panel",onNavigate:d},markCurrent:i,wrap:(E,ue)=>e("li",{className:"flex min-h-12 items-center",...q(n.id,ue,-1),children:E})})})]})});z=p(D,{children:[p("button",{ref:T,type:"button",className:`mono-eyebrow-ctl ${s.button} h-11 min-w-11 items-center gap-2 opacity-80 transition-opacity hover:opacity-100 max-view-tablet:-mx-3 max-view-tablet:min-w-0 max-view-tablet:px-3`,"aria-expanded":c,"aria-label":c?"Close the menu":"Open the menu",onClick:V,children:[e(fe,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap max-view-tablet:hidden",children:J.menu})]}),c&&o?pe(I==="side"?a:K,o.body):null]})}else s.drawsButton&&(z=p(D,{children:[e("button",{type:"button",className:`${s.buttonHead} h-11 w-11 items-center justify-center${s.buttonTail}`,"aria-expanded":c,"aria-label":c?"Close the menu":"Open the menu",onClick:V,children:e("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:c?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),c?K:null]}));return p(C,{as:"nav",ref:M,"aria-label":A,"data-menu-row":"",...l?{"data-menu-show":"button"}:null,...!l&&y?{"data-menu-align":y}:null,...!l&&R?{"data-menu-part":"lead"}:null,className:"min-w-0",children:[e("ul",{className:`m-0 ${s.listHead} list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${ne} uppercase tracking-[0.18em]${s.listTail}`,children:se}),z]})}function Ye({owner:n,items:t,label:m,editing:h,markCurrent:b,strip:g=""}){return!h&&(t===null||t.length===0||!B(n))?null:e(C,{as:"nav","aria-label":m||"Menu","data-menu-tabs":"",className:g?`min-w-0 ${g}`:"min-w-0",children:e("ul",{className:te.list,children:e(P,{owner:n,items:t,place:{place:"tab"},markCurrent:b,wrap:(i,u)=>e("li",{className:te.item(u.index===0,h),children:i})})})})}function je({owner:n,menu:t,served:m,heading:h,accordionMobile:b=!1,showDividers:g=!1,editing:i=!1,layout:u="column",linkAlign:_,linkRange:f,menuStyle:y,currentPage:v,menuStylePhone:R,menuPanelWidth:c,menuPanelTintColor:S,menuPanelTintOpacity:M}){const x=u==="row"&&v===!0,{live:W,ready:A}=ve(),d=!m&&Re({id:t?.id,handle:t?.handle,editing:i,ready:A,live:W}),l=m?m.map($e):d?[]:t?.items??[],s=h||(m?"":t?.name)||"",[I,Y]=k(!1);if(X(()=>{if(!b)return;const w=window.matchMedia("(max-width: 800px)"),N=()=>Y(w.matches);return N(),w.addEventListener("change",N),()=>w.removeEventListener("change",N)},[b]),m&&l.length===0)return i?e(C,{as:"p",className:$,children:O(We)}):null;if(u==="row"&&i&&!d&&l.length>0&&!B(n))return e(C,{as:"p",className:$,children:O(ae)});if(u==="row"&&y===Pe){const{strip:w}=ee(y,R),N=e(Ye,{owner:n,items:d?null:l,label:s,editing:i,markCurrent:x,strip:w});return w?p(D,{children:[N,e(oe,{owner:n,items:d?null:l,label:s,editing:i,markCurrent:x,menuStyle:y,menuStylePhone:R})]}):N}if(u==="row")return e(oe,{owner:n,items:d?null:l,label:s,editing:i,linkAlign:_,linkRange:f,markCurrent:x,menuStyle:y,menuStylePhone:R,panelLook:{width:c,tintColor:S,tintOpacity:M}});const T=w=>e("ul",{className:Fe,children:e(P,{owner:n,items:w,place:{place:"column"},wrap:(N,U)=>e("li",{className:w?le(g,U.index):`text-fg ${le(g,U.index)}`,children:N})})});return d?p(C,{as:"div",className:"min-w-0",children:[e("h4",{className:G,children:h?F(h):O(Le)}),T(null),e("p",{className:`mt-3 ${$}`,children:O(Oe)})]}):l.length===0||!B(n)?p(C,{as:"div",className:"min-w-0",children:[s?e("h4",{className:G,children:F(s)}):null,i?e("p",{className:$,children:l.length===0?O("This menu has no links yet — add them in {place}.",{place:O("Storefront → Menus")}):O(ae)}):null]}):b&&I?p(C,{as:"details",className:"min-w-0 border-b border-line",children:[p("summary",{className:"flex cursor-pointer list-none items-center justify-between py-3 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",children:[F(s),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:T(l)})]}):p(C,{as:"div",className:"min-w-0",children:[s?e("h4",{className:G,children:F(s)}):null,T(l)]})}export{je as default};