efficient-storefront-blocks 0.133.2 → 0.133.4

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.
@@ -1195,6 +1195,24 @@ body .sf-site-header[data-header-ink="dark"] {
1195
1195
  letter-spacing: normal;
1196
1196
  }
1197
1197
 
1198
+ /* Header → Letters: Capitalised reaches the cart drawer too (the drawer is
1199
+ a sibling of the bar, so the page is asked). Its capitals are drawn as
1200
+ typed, and the "N° 1 ·" line number goes: the process name stands alone.
1201
+ The drawer is found by its dialog name (components/CartDrawer
1202
+ `CART_DRAWER_LABEL`), so a site without Letters keeps today's markup. */
1203
+ :root:has([data-header-nav-case="capitalised"]) [role="dialog"][aria-label="Your cart"] .uppercase {
1204
+ text-transform: none;
1205
+ letter-spacing: normal;
1206
+ }
1207
+ :root:has([data-header-nav-case="capitalised"]) [role="dialog"][aria-label="Your cart"] [data-cart-line-no] {
1208
+ display: none;
1209
+ }
1210
+ /* Without their letter space the 9, 10 and 11 px capitals read too small, so
1211
+ they are drawn at the checkout's label size. */
1212
+ :root:has([data-header-nav-case="capitalised"]) [role="dialog"][aria-label="Your cart"] :is(.text-\[9px\], .text-\[10px\], .text-\[11px\]) {
1213
+ font-size: 12px;
1214
+ }
1215
+
1198
1216
  /* A Form's Label weight, Regular: its field labels at the regular weight
1199
1217
  (components/FormBlock `data-form-label`). Unset is today's semibold. */
1200
1218
  [data-form-label="regular"] .font-semibold {
@@ -1,4 +1,5 @@
1
1
  import { type CartDrawerContent, type CartDrawerLook } from "efficient-web-builder/format/lib/content/cart-drawer";
2
+ export declare const CART_DRAWER_LABEL = "Your cart";
2
3
  export default function CartDrawer({ content, look, }: {
3
4
  content?: CartDrawerContent;
4
5
  look?: CartDrawerLook;
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useRef as u}from"react";import{useCart as C}from"./CartContext.js";import{isTyreLine as d}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as R}from"./useTyreCatalog.js";import w from"./PopupFrame.js";import{CartActions as T,CartCouponRow as x,CartDrawerHeader as O,CartLines as _,CartStatusRail as v,CartTotals as y,CartTrustMarkers as A,CartUpsell as D}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as L,resolveCartDrawerLook as h}from"efficient-web-builder/format/lib/content/cart-drawer";const j=h(void 0);function E({content:e=L,look:t=j}){const{isOpen:l,preview:n,close:i,items:c,setAutoOpen:o}=C(),s=u(null),p=R(c.filter(d).map(f=>f.slug));return m(()=>{o(t.autoOpen)},[t.autoOpen,o]),a(w,{look:t,drawer:{closeRef:s,lockScroll:!n},open:l,onClose:i,label:"Your cart",children:[r(O,{content:e,closeRef:s}),r(v,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(_,{content:e,tyres:p}),r(D,{}),r(x,{}),r(A,{content:e})]}),r(y,{}),r(T,{})]})}export{E as default};
1
+ "use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useRef as u}from"react";import{useCart as C}from"./CartContext.js";import{isTyreLine as R}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as d}from"./useTyreCatalog.js";import w from"./PopupFrame.js";import{CartActions as A,CartCouponRow as T,CartDrawerHeader as _,CartLines as x,CartStatusRail as L,CartTotals as D,CartTrustMarkers as E,CartUpsell as O}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as v,resolveCartDrawerLook as y}from"efficient-web-builder/format/lib/content/cart-drawer";const h=y(void 0),j="Your cart";function S({content:e=v,look:t=h}){const{isOpen:l,preview:n,close:i,items:c,setAutoOpen:o}=C(),s=u(null),p=d(c.filter(R).map(f=>f.slug));return m(()=>{o(t.autoOpen)},[t.autoOpen,o]),a(w,{look:t,drawer:{closeRef:s,lockScroll:!n},open:l,onClose:i,label:j,children:[r(_,{content:e,closeRef:s}),r(L,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(x,{content:e,tyres:p}),r(O,{}),r(T,{}),r(E,{content:e})]}),r(D,{}),r(A,{})]})}export{j as CART_DRAWER_LABEL,S as default};
@@ -30,5 +30,6 @@ export interface FooterMenuProps {
30
30
  menuPanelWidth?: unknown;
31
31
  menuPanelTintColor?: unknown;
32
32
  menuPanelTintOpacity?: unknown;
33
+ menuPanelTextStyle?: unknown;
33
34
  }
34
35
  export default function FooterMenu(props: FooterMenuProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as H,jsxs as p}from"react/jsx-runtime";import{createContext as we,useCallback as be,useContext as ge,useEffect as X,useRef as F,useState as P}from"react";import{createPortal as xe}from"react-dom";import{CloseIcon as Ne,MenuIcon as Ee}from"efficient-shell/icons/efficient-glyphs";import Ce from"./PopupFrame.js";import{POPUP_LOOK_DEFAULTS as Z}from"efficient-web-builder/format/lib/popup/look";import{REPEAT_ATTRIBUTE as Te,REPEAT_INDEX_ATTRIBUTE as _e}from"efficient-easel/draw";import{MenuPlaceContext as ye}from"./MenuLinkBlock.js";import{CardRowContext as Me,CardTemplateRows as ke}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as $}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as J}from"./HeaderTools.js";import{usePhoneMenuTools as ve}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as Le}from"./SearchContext.js";import{useModalDismiss as Oe}from"./useModalDismiss.js";import{PhoneSheet as Ae}from"./PhoneSheet.js";import{useAccountInPhoneMenu as Re}from"./PhoneMenuAccount.js";import{usePreviewMenus as Se}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as Pe,FOOTER_MENU_PLACEHOLDER_HEADING as Ie,FOOTER_MENU_PLACEHOLDER_HINT as Ue}from"../lib/content/menu-placeholder.js";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{isMenuOrphaned as De}from"../lib/menu-source.js";import{legacyBlockAlignOf as He}from"efficient-web-builder/format/lib/content/block-align";import{MENU_PANEL_TINT_OPACITY_DEFAULT as Fe,MENU_PANEL_WIDTH_DEFAULT as $e,MENU_STYLE_BUTTON as ee,MENU_STYLE_TABS as Be,menuLinkInRange as Ye,menuShowClasses as ne,resolveMenuLinkRange as Qe}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as te}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as re,currentLinkIndex as We,marksCurrentLink as le}from"../lib/content/tab-strip.js";import{useAddressQuery as je}from"./wheels-plp/usePlpFiltersInUrl.js";import{useCurrentPagePath as qe}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as M}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as ze}from"../lib/block-parts.js";import{MENU_BLOCK_TYPE as Ge}from"../lib/document/document-nodes.js";const l=ze(Ge),Ve=`flex list-none flex-col gap-3 ${te}`,G="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",B="text-[12px] italic text-fg-dim/70",oe=(n,t)=>n&&t>0?"border-t border-line pt-3":"",Ke=n=>({label:n.label??"",url:n.href??"",served:n}),ae=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},Xe=Array.from({length:Pe},()=>({label:"",href:""}));function I({owner:n,items:t,place:c,wrap:h,markCurrent:E=!1}){const C=t?t.map(ae):Xe,m=qe(),w=ge(ce),_=t&&E?We(t.map(g=>g.url??""),m,w):-1,b=_<0?null:{index:_,href:t[_].url??""};return e(ye.Provider,{value:t?b?{...c,current:b}:c:{...c,placeholder:!0},children:e(ke,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:C,items:t??void 0,fallback:null,wrapCopy:h,children:g=>g})})}const Y=n=>(n.template?.blockCount??0)>0,Ze="Nothing to show yet: this menu's entries come from its Menu content.",ie="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function se({owner:n,items:t,label:c,editing:h,linkAlign:E,linkRange:C,markCurrent:m,menuStyle:w,menuStylePhone:_,panelLook:b}){const g=He(E),k=Qe(C),A=!!k&&t!==null&&k.to!==void 0&&k.to<t.length,[u,R]=P(!1),v=F(null),f=ve(),Q=Re(),{open:W}=Le(),N=c||"Menu",i=be(()=>R(!1),[]),r=w===ee||_===ee,y=ne(w,_),[U,S]=P("sheet"),d=F(null),x=F(null),[D,me]=P(void 0),[L,ue]=P(null),V=()=>{if(!u&&r){const s=v.current?.ownerDocument.defaultView;S(s?.matchMedia("(min-width: 720px)").matches?"side":"sheet");const o=d.current?.querySelector("span");if(o&&s){const a=s.getComputedStyle(o);me({fontFamily:a.fontFamily,fontSize:a.fontSize,letterSpacing:a.letterSpacing,textTransform:a.textTransform});const T=(d.current?.querySelector("svg")??d.current)?.getBoundingClientRect();ue(T?{left:T.left,top:T.top,height:T.height}:null)}}R(s=>!s)};X(()=>{if(!u||!r)return;const o=v.current?.ownerDocument.defaultView?.matchMedia("(min-width: 720px)");if(!o)return;const a=()=>R(!1);return o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[u,r]);const j=F(null);Oe({active:u&&!(u&&r&&U==="side"),onDismiss:i,scopeRef:v,focusRef:j,trapRef:j});const de=e(I,{owner:n,items:t,place:{place:"row"},markCurrent:m,wrap:(s,o)=>{const a=t!==null&&k&&!Ye(k,o.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...a,...l("menu-item"),children:s})}}),q=(s,o,a)=>h?{[Te]:`${s}:${a<0?"panel":"dropdown"}`,[_e]:`${a+1}.${o.index}`}:null,pe=e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(s,o)=>p(H,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...q(n.id,o,-1),...l("menu-item"),children:s}),t===null?null:(o.item?.dropdown_items??[]).map((a,T)=>e(Me.Provider,{value:{...o,row:ae(a),item:a},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...q(n.id,o,T),...l("menu-item"),children:s})},T))]})}),he=f&&(f.search||f.cart||f.region||f.account||f.theme)?f:null;if(!h&&t!==null&&!Y(n)&&!he)return null;const K=e(Ae,{role:"dialog",panelRef:j,name:N,entries:pe,tools:f,withAccount:!r||Q,editing:h,onClose:i,onSearch:W,phoneOnly:!r,marker:r?"sheet":void 0,listStyle:r&&L?{paddingLeft:L.left,paddingRight:L.left}:void 0});let z=null;if(r){const s=v.current?.ownerDocument,o={...Z,placement:"left",height:"full",closeButton:"none",width:typeof b?.width=="number"?b.width:$e,tintColor:typeof b?.tintColor=="string"?b.tintColor:Z.tintColor,tintOpacity:typeof b?.tintOpacity=="number"?b.tintOpacity:Fe},a=e(Ce,{look:o,drawer:{closeRef:x},open:!0,onClose:i,label:N,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:x,type:"button",onClick:i,className:"inline-flex h-11 items-center gap-2",style:D,children:[e(Ne,{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,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(T,fe)=>e("li",{className:"flex min-h-12 items-center",...q(n.id,fe,-1),...l("menu-item"),children:T})})})]})});z=p(H,{children:[p("button",{ref:d,type:"button",className:`mono-eyebrow-ctl ${y.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":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...l("menu-button"),children:[e(Ee,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap max-view-tablet:hidden",children:J.menu})]}),u&&s?xe(U==="side"?a:K,s.body):null]})}else y.drawsButton&&(z=p(H,{children:[e("button",{type:"button",className:`${y.buttonHead} h-11 w-11 items-center justify-center${y.buttonTail}`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...l("menu-button"),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:u?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),u?K:null]}));return p(M,{as:"nav",ref:v,"aria-label":N,"data-menu-row":"",...r?{"data-menu-show":"button"}:null,...!r&&g?{"data-menu-align":g}:null,...!r&&A?{"data-menu-part":"lead"}:null,className:"min-w-0",...l("menu-block"),children:[e("ul",{className:`m-0 ${y.listHead} list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${te} uppercase tracking-[0.18em]${y.listTail}`,...l("menu"),children:de}),z]})}function Je({owner:n,items:t,label:c,editing:h,markCurrent:E,strip:C=""}){return!h&&(t===null||t.length===0||!Y(n))?null:e(M,{as:"nav","aria-label":c||"Menu","data-menu-tabs":"",className:C?`min-w-0 ${C}`:"min-w-0",...l("menu-block"),children:e("ul",{className:re.list,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"tab"},markCurrent:E,wrap:(m,w)=>e("li",{className:re.item(w.index===0,h),...l("menu-item"),children:m})})})})}const ce=we("");function en(n){const t=!n.editing&&le(n.layout,n.currentPage),c=je(n.pageQuery??"",t);return e(ce.Provider,{value:c,children:e(nn,{...n})})}function nn({owner:n,menu:t,served:c,heading:h,accordionMobile:E=!1,showDividers:C=!1,editing:m=!1,layout:w="column",linkAlign:_,linkRange:b,menuStyle:g,currentPage:k,menuStylePhone:A,menuPanelWidth:u,menuPanelTintColor:R,menuPanelTintOpacity:v}){const f=le(w,k),{live:Q,ready:W}=Se(),N=!c&&De({id:t?.id,handle:t?.handle,editing:m,ready:W,live:Q}),i=c?c.map(Ke):N?[]:t?.items??[],r=h||(c?"":t?.name)||"",[y,U]=P(!1);if(X(()=>{if(!E)return;const d=window.matchMedia("(max-width: 800px)"),x=()=>U(d.matches);return x(),d.addEventListener("change",x),()=>d.removeEventListener("change",x)},[E]),c&&i.length===0)return m?e(M,{as:"p",className:B,children:O(Ze)}):null;if(w==="row"&&m&&!N&&i.length>0&&!Y(n))return e(M,{as:"p",className:B,children:O(ie)});if(w==="row"&&g===Be){const{strip:d}=ne(g,A),x=e(Je,{owner:n,items:N?null:i,label:r,editing:m,markCurrent:f,strip:d});return d?p(H,{children:[x,e(se,{owner:n,items:N?null:i,label:r,editing:m,markCurrent:f,menuStyle:g,menuStylePhone:A})]}):x}if(w==="row")return e(se,{owner:n,items:N?null:i,label:r,editing:m,linkAlign:_,linkRange:b,markCurrent:f,menuStyle:g,menuStylePhone:A,panelLook:{width:u,tintColor:R,tintOpacity:v}});const S=d=>e("ul",{className:Ve,...l("menu"),children:e(I,{owner:n,items:d,place:{place:"column"},wrap:(x,D)=>e("li",{className:d?oe(C,D.index):`text-fg ${oe(C,D.index)}`,...l("menu-item"),children:x})})});return N?p(M,{as:"div",className:"min-w-0",...l("menu-block"),children:[e("h4",{className:G,...l("heading"),children:h?$(h):O(Ie)}),S(null),e("p",{className:`mt-3 ${B}`,children:O(Ue)})]}):i.length===0||!Y(n)?p(M,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,m?e("p",{className:B,children:i.length===0?O("This menu has no links yet — add them in {place}.",{place:O("Storefront → Menus")}):O(ie)}):null]}):E&&y?p(M,{as:"details",className:"min-w-0 border-b border-line",...l("menu-block"),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:[$(r),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:S(i)})]}):p(M,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,S(i)]})}export{en as default};
1
+ "use client";import{jsx as e,Fragment as H,jsxs as p}from"react/jsx-runtime";import{createContext as Ne,useCallback as Ee,useContext as Te,useEffect as J,useRef as F,useState as P}from"react";import{createPortal as Ce}from"react-dom";import{CloseIcon as ee,MenuIcon as _e}from"efficient-shell/icons/efficient-glyphs";import ye from"./PopupFrame.js";import{POPUP_LOOK_DEFAULTS as ne}from"efficient-web-builder/format/lib/popup/look";import{REPEAT_ATTRIBUTE as Me,REPEAT_INDEX_ATTRIBUTE as ke}from"efficient-easel/draw";import{MenuPlaceContext as ve}from"./MenuLinkBlock.js";import{CardRowContext as Le,CardTemplateRows as Oe}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as $}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as te}from"./HeaderTools.js";import{usePhoneMenuTools as Ae}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as Re}from"./SearchContext.js";import{useModalDismiss as Se}from"./useModalDismiss.js";import{PhoneSheet as Pe}from"./PhoneSheet.js";import{useAccountInPhoneMenu as Ie}from"./PhoneMenuAccount.js";import{usePreviewMenus as Ue}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as De,FOOTER_MENU_PLACEHOLDER_HEADING as He,FOOTER_MENU_PLACEHOLDER_HINT as Fe}from"../lib/content/menu-placeholder.js";import{say as R}from"efficient-web-builder/format/lib/editor-words";import{isMenuOrphaned as $e}from"../lib/menu-source.js";import{legacyBlockAlignOf as Be}from"efficient-web-builder/format/lib/content/block-align";import{MENU_PANEL_TINT_OPACITY_DEFAULT as ze,MENU_PANEL_WIDTH_DEFAULT as Ve,MENU_STYLE_BUTTON as re,MENU_STYLE_TABS as We,menuLinkInRange as Ye,menuShowClasses as le,resolveMenuLinkRange as je}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as oe}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as ae,currentLinkIndex as Qe,marksCurrentLink as ie}from"../lib/content/tab-strip.js";import{useAddressQuery as qe}from"./wheels-plp/usePlpFiltersInUrl.js";import{useCurrentPagePath as Ge}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as k}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as Ke}from"../lib/block-parts.js";import{MENU_BLOCK_TYPE as Xe}from"../lib/document/document-nodes.js";import{textKindVars as Ze}from"../lib/content/text-kind-vars.js";const l=Ke(Xe),Je=`flex list-none flex-col gap-3 ${oe}`,G="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",en={font:"--sf-menu-panel-font",size:"--sf-menu-panel-size"},B="text-[12px] italic text-fg-dim/70",se=(n,t)=>n&&t>0?"border-t border-line pt-3":"",nn=n=>({label:n.label??"",url:n.href??"",served:n}),ce=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},tn=Array.from({length:De},()=>({label:"",href:""}));function I({owner:n,items:t,place:c,wrap:h,markCurrent:E=!1}){const T=t?t.map(ce):tn,m=Ge(),w=Te(de),y=t&&E?Qe(t.map(g=>g.url??""),m,w):-1,b=y<0?null:{index:y,href:t[y].url??""};return e(ve.Provider,{value:t?b?{...c,current:b}:c:{...c,placeholder:!0},children:e(Oe,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:T,items:t??void 0,fallback:null,wrapCopy:h,children:g=>g})})}const z=n=>(n.template?.blockCount??0)>0,rn="Nothing to show yet: this menu's entries come from its Menu content.",me="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function ue({owner:n,items:t,label:c,editing:h,linkAlign:E,linkRange:T,markCurrent:m,menuStyle:w,menuStylePhone:y,panelLook:b,panelTextStyle:g}){const U=Be(E),C=je(T),V=!!C&&t!==null&&C.to!==void 0&&C.to<t.length,[u,S]=P(!1),v=F(null),f=Ae(),W=Ie(),{open:Y}=Re(),x=c||"Menu",i=Ee(()=>S(!1),[]),r=w===re||y===re,M=le(w,y),D=Ze(g,en),L=Object.keys(D).length>0?D:void 0,[d,N]=P("sheet"),O=F(null),K=F(null),[pe,he]=P(void 0),[A,fe]=P(null),X=()=>{if(!u&&r){const s=v.current?.ownerDocument.defaultView;N(s?.matchMedia("(min-width: 720px)").matches?"side":"sheet");const o=O.current?.querySelector("span");if(o&&s){const a=s.getComputedStyle(o);he({fontFamily:a.fontFamily,fontSize:a.fontSize,letterSpacing:a.letterSpacing,textTransform:a.textTransform});const _=(O.current?.querySelector("svg")??O.current)?.getBoundingClientRect();fe(_?{left:_.left,top:_.top,height:_.height}:null)}}S(s=>!s)};J(()=>{if(!u||!r)return;const o=v.current?.ownerDocument.defaultView?.matchMedia("(min-width: 720px)");if(!o)return;const a=()=>S(!1);return o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[u,r]);const j=F(null);Se({active:u&&!(u&&r&&d==="side"),onDismiss:i,scopeRef:v,focusRef:j,trapRef:j});const we=e(I,{owner:n,items:t,place:{place:"row"},markCurrent:m,wrap:(s,o)=>{const a=t!==null&&C&&!Ye(C,o.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...a,...l("menu-item"),children:s})}}),Q=(s,o,a)=>h?{[Me]:`${s}:${a<0?"panel":"dropdown"}`,[ke]:`${a+1}.${o.index}`}:null,be=e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(s,o)=>p(H,{children:[e("li",{className:L?"flex min-h-12 items-center":"flex min-h-14 items-center border-b border-line",...Q(n.id,o,-1),...l("menu-item"),children:s}),t===null?null:(o.item?.dropdown_items??[]).map((a,_)=>e(Le.Provider,{value:{...o,row:ce(a),item:a},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...Q(n.id,o,_),...l("menu-item"),children:s})},_))]})}),ge=f&&(f.search||f.cart||f.region||f.account||f.theme)?f:null;if(!h&&t!==null&&!z(n)&&!ge)return null;const Z=e(Pe,{role:"dialog",panelRef:j,name:x,entries:be,tools:f,withAccount:!r||W,editing:h,onClose:i,onSearch:Y,phoneOnly:!r,marker:r?"sheet":void 0,listStyle:r&&A?{paddingLeft:A.left,paddingRight:A.left}:void 0,words:L});let q=null;if(r){const s=v.current?.ownerDocument,o={...ne,placement:"left",height:"full",closeButton:"none",width:typeof b?.width=="number"?b.width:Ve,tintColor:typeof b?.tintColor=="string"?b.tintColor:ne.tintColor,tintOpacity:typeof b?.tintOpacity=="number"?b.tintOpacity:ze},a=e(ye,{look:o,drawer:{closeRef:K},open:!0,onClose:i,label:x,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:A?{paddingLeft:A.left}:void 0,children:p("button",{ref:K,type:"button",onClick:i,className:"inline-flex h-11 items-center gap-2",style:pe,children:[e(ee,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap",children:te.close})]})}),e("ul",{className:"m-0 flex list-none flex-col px-8 pb-8",style:A?{paddingLeft:A.left}:void 0,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(_,xe)=>e("li",{className:"flex min-h-12 items-center",...Q(n.id,xe,-1),...l("menu-item"),children:_})})})]})});q=p(H,{children:[p("button",{ref:O,type:"button",className:`mono-eyebrow-ctl ${M.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":u,"aria-label":u?"Close the menu":"Open the menu",onClick:X,...l("menu-button"),children:[L&&u&&d==="sheet"?e(ee,{size:20,"aria-hidden":"true"}):e(_e,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap max-view-tablet:hidden",children:te.menu})]}),u&&s?Ce(d==="side"?a:Z,s.body):null]})}else M.drawsButton&&(q=p(H,{children:[e("button",{type:"button",className:`${M.buttonHead} h-11 w-11 items-center justify-center${M.buttonTail}`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:X,...l("menu-button"),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:u?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),u?Z:null]}));return p(k,{as:"nav",ref:v,"aria-label":x,"data-menu-row":"",...r?{"data-menu-show":"button"}:null,...!r&&U?{"data-menu-align":U}:null,...!r&&V?{"data-menu-part":"lead"}:null,className:"min-w-0",...l("menu-block"),children:[e("ul",{className:`m-0 ${M.listHead} list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${oe} uppercase tracking-[0.18em]${M.listTail}`,...l("menu"),children:we}),q]})}function ln({owner:n,items:t,label:c,editing:h,markCurrent:E,strip:T=""}){return!h&&(t===null||t.length===0||!z(n))?null:e(k,{as:"nav","aria-label":c||"Menu","data-menu-tabs":"",className:T?`min-w-0 ${T}`:"min-w-0",...l("menu-block"),children:e("ul",{className:ae.list,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"tab"},markCurrent:E,wrap:(m,w)=>e("li",{className:ae.item(w.index===0,h),...l("menu-item"),children:m})})})})}const de=Ne("");function on(n){const t=!n.editing&&ie(n.layout,n.currentPage),c=qe(n.pageQuery??"",t);return e(de.Provider,{value:c,children:e(an,{...n})})}function an({owner:n,menu:t,served:c,heading:h,accordionMobile:E=!1,showDividers:T=!1,editing:m=!1,layout:w="column",linkAlign:y,linkRange:b,menuStyle:g,currentPage:U,menuStylePhone:C,menuPanelWidth:V,menuPanelTintColor:u,menuPanelTintOpacity:S,menuPanelTextStyle:v}){const f=ie(w,U),{live:W,ready:Y}=Ue(),x=!c&&$e({id:t?.id,handle:t?.handle,editing:m,ready:Y,live:W}),i=c?c.map(nn):x?[]:t?.items??[],r=h||(c?"":t?.name)||"",[M,D]=P(!1);if(J(()=>{if(!E)return;const d=window.matchMedia("(max-width: 800px)"),N=()=>D(d.matches);return N(),d.addEventListener("change",N),()=>d.removeEventListener("change",N)},[E]),c&&i.length===0)return m?e(k,{as:"p",className:B,children:R(rn)}):null;if(w==="row"&&m&&!x&&i.length>0&&!z(n))return e(k,{as:"p",className:B,children:R(me)});if(w==="row"&&g===We){const{strip:d}=le(g,C),N=e(ln,{owner:n,items:x?null:i,label:r,editing:m,markCurrent:f,strip:d});return d?p(H,{children:[N,e(ue,{owner:n,items:x?null:i,label:r,editing:m,markCurrent:f,menuStyle:g,menuStylePhone:C})]}):N}if(w==="row")return e(ue,{owner:n,items:x?null:i,label:r,editing:m,linkAlign:y,linkRange:b,markCurrent:f,menuStyle:g,menuStylePhone:C,panelLook:{width:V,tintColor:u,tintOpacity:S},panelTextStyle:v});const L=d=>e("ul",{className:Je,...l("menu"),children:e(I,{owner:n,items:d,place:{place:"column"},wrap:(N,O)=>e("li",{className:d?se(T,O.index):`text-fg ${se(T,O.index)}`,...l("menu-item"),children:N})})});return x?p(k,{as:"div",className:"min-w-0",...l("menu-block"),children:[e("h4",{className:G,...l("heading"),children:h?$(h):R(He)}),L(null),e("p",{className:`mt-3 ${B}`,children:R(Fe)})]}):i.length===0||!z(n)?p(k,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,m?e("p",{className:B,children:i.length===0?R("This menu has no links yet — add them in {place}.",{place:R("Storefront → Menus")}):R(me)}):null]}):E&&M?p(k,{as:"details",className:"min-w-0 border-b border-line",...l("menu-block"),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:[$(r),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:L(i)})]}):p(k,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,L(i)]})}export{on as default};
@@ -1 +1 @@
1
- "use client";import{jsx as r,Fragment as E,jsxs as s}from"react/jsx-runtime";import oe from"next/link";import{usePathname as Ze}from"next/navigation";import{useCallback as et,useEffect as re,useRef as tt,useState as v}from"react";import{rootIsDark as nt,watchRootTheme as ot}from"efficient-shell/format";import{useCart as rt}from"./CartContext.js";import{useSearch as st}from"./SearchContext.js";import lt,{useCountrySelectShows as at}from"./CountrySelect.js";import{resolveCountryShowAs as it}from"../lib/content/country-show-as.js";import se from"./HeaderNavItem.js";import ct from"efficient-web-builder/render/components/Logo";import{siteLengthCss as dt}from"efficient-web-builder/format/lib/content/css-length";import mt from"./MenuPlaceholderLabel.js";import{withRMark as le}from"efficient-web-builder/render/components/RMark";import{AccountButton as ut,CartButton as ht,SearchButton as ft}from"./HeaderTools.js";import pt from"./HeaderCallButton.js";import{useHeaderBar as gt}from"./useHeaderBar.js";import{useHeaderAtTopIsDark as bt}from"./useHeaderAtTopIsDark.js";import{usePageOwnsTop as xt}from"./usePageOwnsTop.js";import{useModalDismiss as vt}from"./useModalDismiss.js";import yt from"./ThemeToggle.js";import{products as wt}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as St}from"../lib/header-settings-fetch.js";import{menuDropdownAside as kt}from"../lib/menu-link.js";import{HEADER_MENU_PLACEHOLDER_COUNT as Nt}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as Pt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as Tt,resolveChromeWidth as Et}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as It}from"../lib/content/header-theme.js";import{headerSolidBackground as $t,isProductPage as Ct,resolveMenuRow as Lt,resolveNavTextCase as _t,resolveUtilStyle as Ht}from"../lib/content/header-bar.js";import{surfaceIsLight as Rt}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as At,HEADER_MENU_GAP_PX as Dt,HEADER_SET_HEIGHT_CSS as Ut}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as Mt,resolveHeaderInkMode as jt}from"efficient-web-builder/render/lib/document/header-ink";const ae={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},Ot=Array.from({length:Nt},()=>({href:"#",label:r(mt,{})}));function zt({previewSettings:p,initialSettings:I,editorPreview:$,showThemeToggle:ie,wordmark:ce,hideLogo:de,hideMenu:me,siteName:C,commerceEnabled:g=!0}={}){const ue=Ze(),B=Ct(ue),[c,y]=v(!1),{open:he,totals:fe}=rt(),{open:pe}=st(),[L,ge]=v(!1),[be,xe]=v(null),[ve,ye]=v(null),[t,we]=v(I??null),n=p??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,logoSizeUnit:t.logoSizeUnit??null,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[],dropdown_aside:e.dropdownAside??null})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,menuGapUnit:t.menuGapUnit??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,borderThickness:t.borderThickness??null,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),Se=de?null:n?.logoUrl??null,ke=n?.reverseLogo??!1,Ne=n?.logoReversed??null,Pe=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Te=n?.logoSize??"medium",Ee=n?.logoSizePx??null,Ie=n?.logoSizeUnit??null,G=Math.min(Math.max(n?.menuSplit??3,1),4),$e=(n?.menuPosition??"left")==="center",Ce=(n?.menuPosition??"left")==="beside",F=Lt(n?.menuRow)==="inline",_=n?.menuGapPx??null,Le=_!=null?{gap:dt(_,n?.menuGapUnit,"gap",Dt)??`${_}px`}:void 0,w=F?ae.inline:ae.stacked,_e=n?.searchEnabled??!1,W=n?.searchPosition??"right",He=n?.countrySelectorEnabled??!0,Re=it(n?.countrySelectorShowAs),H=n?.accountEnabled??!0,Ae=n?.cartEnabled??!0,R=Ht(n?.utilStyle)==="text",l=`mono-eyebrow${_t(n?.navTextCase)==="capitalised"?" mono-eyebrow-plain":""}`,V=n?.countryUrls??{},De=Et(n?.width),Ue=Tt(De)??void 0,Me=n?.heightPx??At.default,K=Math.round(n?.borderThickness??1),je=Number.isFinite(K)?Math.min(Math.max(K,0),20):1,X=n?.sticky??"always",A=jt(n?.topTextColor),m=It(n?.theme),S=Object.keys(V),Y=at(S.length?S:void 0),b=He?r(lt,{countries:S.length?S:void 0,urls:p?void 0:V,showAs:Re}):null,{headerRef:u,scrolled:J,navHidden:Oe}=gt({stickyMode:X,heightPx:Me}),ze=m?JSON.stringify(m.style):null;re(()=>{const e=u.current?.ownerDocument??document,o=e.defaultView??window,T=ne=>ne?Rt(o.getComputedStyle(ne).getPropertyValue("--bg")):null,z=()=>{ge(!nt({doc:e,whenUnset:!0})),xe(T(e.body)),ye(T(u.current))};z();const Qe=ot(z,{doc:e}),te=new MutationObserver(z);return e.body&&te.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{Qe(),te.disconnect()}},[u,ze]);const x=ie??Pt?r(yt,{}):null;re(()=>{if(!St({editorPreview:!!$,hasPreviewSettings:!!p,hasInitialSettings:!!I}))return;let e=!1;return wt.getHeaderSettings().then(o=>!e&&we(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[$,p,I]);const Be=xt(u),k=J||B||Be,q=$t(L,B),Q=bt(u,A),Ge=k||!Q,Fe=k?ve??L:(be??L)&&!Q,We=A==="auto"?null:{[Mt]:A},Ve=et(()=>y(!1),[]),D=tt(null);vt({active:c,onDismiss:Ve,focusRef:D,trapRef:D});const d=(e,o,T="start")=>r(se,{item:e,dropdownAlign:T},o),Ke=!me&&(n?.menuItems?.length??0)>0,N=!!$||!!p,a=Ke?n.menuItems.map(e=>({href:e.url||"",label:le(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(o=>({href:o.url||"",label:le(o.label),plainLabel:o.label,description:o.description,image:o.image,badge:o.badge})),dropdownAside:kt(e.dropdown_aside)})):N?Ot.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Xe=a.length>0||g&&H||!!b&&Y||!!x,Ye=i==="center"?a.slice(0,G):i==="right"?a:[],Je=i==="center"?a.slice(G):i==="left"?a:[],P=_e&&g?r(ft,{onClick:N?void 0:pe,asText:R}):null,U=g&&H?r(ut,{asText:R}):null,M=e=>g&&Ae?r(ht,{onClick:he,count:fe.sets,asText:R,className:e}):null,qe=n?.callPhone??"",Z=n?.callHref??"",j=e=>n?.callButton&&(Z||N)?r(pt,{href:N?"":Z,label:e?"Call":qe||"Call"}):null,h=s(E,{children:[W==="left"?P:null,b,x,U,M(),W==="right"?P:null,j(!1)]}),O=(e,o=!1)=>r(oe,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(ct,{variant:"header",scrolled:Ge,src:Se,reverse:ke,onLightSurface:Fe,reversedSrc:Ne,inkIsDark:Pe,size:Te,sizePx:Ee,sizeUnit:Ie,wordmark:ce,siteName:C,fitToContainer:o})}),f=O("inline-flex shrink-0 items-center justify-center"),ee="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(E,{children:[r("header",{ref:u,"data-scrolled":J||void 0,...We,className:["sf-site-header",...m?[m.className]:[],X==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",k?"border-solid border-line backdrop-blur-md":"border-solid border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:Ut,borderBottomWidth:`${je}px`,...Oe?{transform:"translateY(-100%)"}:null,...k?{background:q,color:"var(--fg)","--sf-header-ground":q}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:Ue,children:[$e?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${l} flex items-center gap-8`,children:h}):r("div",{className:"flex items-center",children:f}),r("nav",{className:`${l} flex items-center justify-center gap-8`,children:a.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:f}):r("nav",{className:`${l} flex items-center justify-end gap-8`,children:h})]}):i==="center"?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${l} flex items-center gap-8`,children:Ye.map((e,o)=>d(e,`${e.href}-${o}`))}),f,s("nav",{className:`${l} flex items-center justify-end gap-8`,children:[Je.map((e,o)=>d(e,`${e.href}-${o}`,"end")),h]})]}):Ce?s("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:Le,children:[f,r("nav",{className:`${l} flex items-center gap-8`,children:a.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${l} flex items-center justify-end gap-8`,children:h})]}):r("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:i==="right"?s(E,{children:[s("nav",{className:`${l} flex items-center gap-8`,children:[a.map((e,o)=>d(e,`${e.href}-${o}`)),h]}),f]}):s(E,{children:[f,s("nav",{className:`${l} flex items-center gap-8`,children:[a.map((e,o)=>d(e,`${e.href}-${o}`)),h]})]})}),!F&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[O(ee,!0),s("div",{className:`${l} flex shrink-0 items-center gap-5`,children:[P,b,x,U,M(),j(!1)]})]}),r("nav",{className:`${l} flex items-center gap-6 border-t border-line/60 pt-3`,children:a.map((e,o)=>d(e,`${e.href}-${o}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[O(ee,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[P,U,M(l),j(!0),Xe&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>y(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{ref:D,role:"dialog","aria-modal":"true","aria-label":"Menu",tabIndex:-1,"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[a.map((e,o)=>r(se,{item:e,mobile:!0,onNavigate:()=>y(!1)},`${e.href}-${o}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[g&&H&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(oe,{href:"/account",onClick:()=>y(!1),className:"mono-eyebrow underline",children:"Your account"})]}),b&&Y&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),b]}),x&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),x]})]})]})]})}export{zt as default};
1
+ "use client";import{jsx as r,Fragment as E,jsxs as s}from"react/jsx-runtime";import re from"next/link";import{usePathname as et}from"next/navigation";import{useCallback as tt,useEffect as se,useRef as nt,useState as v}from"react";import{rootIsDark as ot,watchRootTheme as rt}from"efficient-shell/format";import{useCart as st}from"./CartContext.js";import{useSearch as at}from"./SearchContext.js";import lt,{useCountrySelectShows as it}from"./CountrySelect.js";import{resolveCountryShowAs as ct}from"../lib/content/country-show-as.js";import ae from"./HeaderNavItem.js";import dt from"efficient-web-builder/render/components/Logo";import{siteLengthCss as mt}from"efficient-web-builder/format/lib/content/css-length";import ut from"./MenuPlaceholderLabel.js";import{withRMark as le}from"efficient-web-builder/render/components/RMark";import{AccountButton as ht,CartButton as ft,SearchButton as pt}from"./HeaderTools.js";import gt from"./HeaderCallButton.js";import{useHeaderBar as bt}from"./useHeaderBar.js";import{useHeaderAtTopIsDark as xt}from"./useHeaderAtTopIsDark.js";import{usePageOwnsTop as vt}from"./usePageOwnsTop.js";import{useModalDismiss as yt}from"./useModalDismiss.js";import wt from"./ThemeToggle.js";import{products as St}from"../lib/api/index.js";import{shouldFetchPublicHeaderSettings as kt}from"../lib/header-settings-fetch.js";import{menuDropdownAside as Nt}from"../lib/menu-link.js";import{HEADER_MENU_PLACEHOLDER_COUNT as Pt}from"../lib/content/menu-placeholder.js";import{DEFAULT_SWITCH_SHOWN as Tt}from"efficient-web-builder/format/lib/theme";import{chromeWidthStyle as Et,resolveChromeWidth as It}from"efficient-web-builder/format/lib/content/page-width";import{headerThemeWrap as $t}from"../lib/content/header-theme.js";import{headerSolidBackground as Ct,isProductPage as Lt,resolveMenuRow as _t,resolveNavTextCase as Ht,resolveUtilStyle as Rt}from"../lib/content/header-bar.js";import{surfaceIsLight as At}from"../lib/logo/surface-is-light.js";import{HEADER_HEIGHT_PX as Dt,HEADER_MENU_GAP_PX as Ut,HEADER_SET_HEIGHT_CSS as Mt}from"efficient-web-builder/render/lib/document/header-clearance";import{HEADER_INK_OVERRIDE_ATTR as jt,resolveHeaderInkMode as Ot}from"efficient-web-builder/render/lib/document/header-ink";const ie={stacked:{grid:"hidden min-[1501px]:grid",flex:"hidden min-[1501px]:flex"},inline:{grid:"hidden view-tablet:grid",flex:"hidden view-tablet:flex"}},zt=Array.from({length:Pt},()=>({href:"#",label:r(ut,{})}));function Bt({previewSettings:p,initialSettings:I,editorPreview:$,showThemeToggle:ce,wordmark:de,hideLogo:me,hideMenu:ue,siteName:C,commerceEnabled:g=!0}={}){const he=et(),B=Lt(he),[c,y]=v(!1),{open:fe,totals:pe}=st(),{open:ge}=at(),[L,be]=v(!1),[xe,ve]=v(null),[ye,we]=v(null),[t,Se]=v(I??null),n=p??(t?{logoUrl:t.logoUrl,reverseLogo:t.reverseLogo,logoReversed:t.logoReversed,logoInkIsDark:t.logoInkIsDark,logoPosition:t.logoPosition,logoSize:t.logoSize,logoSizePx:t.logoSizePx,logoSizeUnit:t.logoSizeUnit??null,menuItems:(t.menuItems??[]).map(e=>({label:e.label,url:e.url,dropdown_menu:null,dropdown_items:e.dropdownItems??[],dropdown_aside:e.dropdownAside??null})),menuSplit:t.menuSplit??3,menuPosition:t.menuPosition,menuRow:t.menuRow,menuGapPx:t.menuGapPx??null,menuGapUnit:t.menuGapUnit??null,searchEnabled:t.searchEnabled,searchPosition:t.searchPosition,searchRow:t.searchRow,countrySelectorEnabled:t.countrySelectorEnabled,countrySelectorShowAs:t.countrySelectorShowAs,countryUrls:t.countryUrls,accountEnabled:t.accountEnabled,cartEnabled:t.cartEnabled,utilStyle:t.utilStyle,navTextCase:t.navTextCase,lightReverseText:t.lightReverseText,topTextColor:t.topTextColor,transparentTop:t.transparentTop,surface:t.surface,theme:t.theme,width:t.width,heightPx:t.heightPx,borderThickness:t.borderThickness??null,sticky:t.sticky,callButton:t.callButton,callPhone:t.callPhone,callHref:t.callHref}:null),ke=me?null:n?.logoUrl??null,Ne=n?.reverseLogo??!1,Pe=n?.logoReversed??null,Te=n?.logoInkIsDark??null,i=n?.logoPosition??"center",Ee=n?.logoSize??"medium",Ie=n?.logoSizePx??null,$e=n?.logoSizeUnit??null,G=Math.min(Math.max(n?.menuSplit??3,1),4),Ce=(n?.menuPosition??"left")==="center",Le=(n?.menuPosition??"left")==="beside",F=_t(n?.menuRow)==="inline",_=n?.menuGapPx??null,_e=_!=null?{gap:mt(_,n?.menuGapUnit,"gap",Ut)??`${_}px`}:void 0,w=F?ie.inline:ie.stacked,He=n?.searchEnabled??!1,W=n?.searchPosition??"right",Re=n?.countrySelectorEnabled??!0,Ae=ct(n?.countrySelectorShowAs),H=n?.accountEnabled??!0,De=n?.cartEnabled??!0,R=Rt(n?.utilStyle)==="text",V=Ht(n?.navTextCase)==="capitalised",a=`mono-eyebrow${V?" mono-eyebrow-plain":""}`,K=n?.countryUrls??{},Ue=It(n?.width),Me=Et(Ue)??void 0,je=n?.heightPx??Dt.default,X=Math.round(n?.borderThickness??1),Oe=Number.isFinite(X)?Math.min(Math.max(X,0),20):1,Y=n?.sticky??"always",A=Ot(n?.topTextColor),m=$t(n?.theme),S=Object.keys(K),J=it(S.length?S:void 0),b=Re?r(lt,{countries:S.length?S:void 0,urls:p?void 0:K,showAs:Ae}):null,{headerRef:u,scrolled:q,navHidden:ze}=bt({stickyMode:Y,heightPx:je}),Be=m?JSON.stringify(m.style):null;se(()=>{const e=u.current?.ownerDocument??document,o=e.defaultView??window,T=oe=>oe?At(o.getComputedStyle(oe).getPropertyValue("--bg")):null,z=()=>{be(!ot({doc:e,whenUnset:!0})),ve(T(e.body)),we(T(u.current))};z();const Ze=rt(z,{doc:e}),ne=new MutationObserver(z);return e.body&&ne.observe(e.body,{attributes:!0,attributeFilter:["style"]}),()=>{Ze(),ne.disconnect()}},[u,Be]);const x=ce??Tt?r(wt,{}):null;se(()=>{if(!kt({editorPreview:!!$,hasPreviewSettings:!!p,hasInitialSettings:!!I}))return;let e=!1;return St.getHeaderSettings().then(o=>!e&&Se(o)).catch(o=>{console.warn("[header] settings fetch failed; using built-in defaults",o)}),()=>{e=!0}},[$,p,I]);const Ge=vt(u),k=q||B||Ge,Q=Ct(L,B),Z=xt(u,A),Fe=k||!Z,We=k?ye??L:(xe??L)&&!Z,Ve=A==="auto"?null:{[jt]:A},Ke=tt(()=>y(!1),[]),D=nt(null);yt({active:c,onDismiss:Ke,focusRef:D,trapRef:D});const d=(e,o,T="start")=>r(ae,{item:e,dropdownAlign:T},o),Xe=!ue&&(n?.menuItems?.length??0)>0,N=!!$||!!p,l=Xe?n.menuItems.map(e=>({href:e.url||"",label:le(e.label),plainLabel:e.label,dropdownItems:(e.dropdown_items??[]).map(o=>({href:o.url||"",label:le(o.label),plainLabel:o.label,description:o.description,image:o.image,badge:o.badge})),dropdownAside:Nt(e.dropdown_aside)})):N?zt.map(e=>({...e,plainLabel:"Menu item",dropdownItems:[]})):[],Ye=l.length>0||g&&H||!!b&&J||!!x,Je=i==="center"?l.slice(0,G):i==="right"?l:[],qe=i==="center"?l.slice(G):i==="left"?l:[],P=He&&g?r(pt,{onClick:N?void 0:ge,asText:R}):null,U=g&&H?r(ht,{asText:R}):null,M=e=>g&&De?r(ft,{onClick:fe,count:pe.sets,asText:R,className:e}):null,Qe=n?.callPhone??"",ee=n?.callHref??"",j=e=>n?.callButton&&(ee||N)?r(gt,{href:N?"":ee,label:e?"Call":Qe||"Call"}):null,h=s(E,{children:[W==="left"?P:null,b,x,U,M(),W==="right"?P:null,j(!1)]}),O=(e,o=!1)=>r(re,{href:"/","aria-label":C?`${C} home`:"Home",className:e,children:r(dt,{variant:"header",scrolled:Fe,src:ke,reverse:Ne,onLightSurface:We,reversedSrc:Pe,inkIsDark:Te,size:Ee,sizePx:Ie,sizeUnit:$e,wordmark:de,siteName:C,fitToContainer:o})}),f=O("inline-flex shrink-0 items-center justify-center"),te="flex min-w-0 flex-1 items-center overflow-x-clip [container-type:inline-size]";return s(E,{children:[r("header",{ref:u,"data-scrolled":q||void 0,"data-header-nav-case":V?"capitalised":void 0,...Ve,className:["sf-site-header",...m?[m.className]:[],Y==="none"?"absolute":"fixed","inset-x-0 top-0 z-50","flex items-center","px-[var(--sf-site-gutter,40px)] max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]",k?"border-solid border-line backdrop-blur-md":"border-solid border-transparent","transition-[background,border-color,transform] duration-300 ease-out"].join(" "),style:{...m?m.style:null,minHeight:Mt,borderBottomWidth:`${Oe}px`,...ze?{transform:"translateY(-100%)"}:null,...k?{background:Q,color:"var(--fg)","--sf-header-ground":Q}:{color:"var(--sf-header-overlay-fg)","--sf-header-ground":"var(--sf-header-overlay-ground)"}},children:s("div",{className:"w-full",style:Me,children:[Ce?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[i==="right"?r("nav",{className:`${a} flex items-center gap-8`,children:h}):r("div",{className:"flex items-center",children:f}),r("nav",{className:`${a} flex items-center justify-center gap-8`,children:l.map((e,o)=>d(e,`${e.href}-${o}`,"center"))}),i==="right"?r("div",{className:"flex items-center justify-end",children:f}):r("nav",{className:`${a} flex items-center justify-end gap-8`,children:h})]}):i==="center"?s("div",{"data-header-band":"",className:`${w.grid} grid-cols-[1fr_auto_1fr] items-center gap-8`,children:[r("nav",{className:`${a} flex items-center gap-8`,children:Je.map((e,o)=>d(e,`${e.href}-${o}`))}),f,s("nav",{className:`${a} flex items-center justify-end gap-8`,children:[qe.map((e,o)=>d(e,`${e.href}-${o}`,"end")),h]})]}):Le?s("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:[s("div",{className:"flex items-center gap-8",style:_e,children:[f,r("nav",{className:`${a} flex items-center gap-8`,children:l.map((e,o)=>d(e,`${e.href}-${o}`))})]}),r("nav",{className:`${a} flex items-center justify-end gap-8`,children:h})]}):r("div",{"data-header-band":"",className:`${w.flex} items-center justify-between gap-8`,children:i==="right"?s(E,{children:[s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,o)=>d(e,`${e.href}-${o}`)),h]}),f]}):s(E,{children:[f,s("nav",{className:`${a} flex items-center gap-8`,children:[l.map((e,o)=>d(e,`${e.href}-${o}`)),h]})]})}),!F&&s("div",{"data-header-band":"",className:"hidden view-tablet:max-[1501px]:flex flex-col gap-3",children:[s("div",{className:"flex items-center justify-between",children:[O(te,!0),s("div",{className:`${a} flex shrink-0 items-center gap-5`,children:[P,b,x,U,M(),j(!1)]})]}),r("nav",{className:`${a} flex items-center gap-6 border-t border-line/60 pt-3`,children:l.map((e,o)=>d(e,`${e.href}-${o}`))})]}),s("div",{"data-header-phone":"",className:"hidden max-view-tablet:flex items-center justify-between",children:[O(te,!0),s("div",{className:"flex shrink-0 items-center gap-4",children:[P,U,M(a),j(!0),Ye&&s("button",{type:"button","aria-label":c?"Close menu":"Open menu","aria-expanded":c,onClick:()=>y(e=>!e),className:"flex h-11 w-11 flex-col items-center justify-center gap-2",children:[r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"translate-y-[3px] rotate-45":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"opacity-0":""}`}),r("span",{className:`block h-px w-5 bg-current transition-transform ${c?"-translate-y-[3px] -rotate-45":""}`})]})]})]})]})}),c&&s("div",{ref:D,role:"dialog","aria-modal":"true","aria-label":"Menu",tabIndex:-1,"data-header-phone-menu":"",className:"fixed inset-x-0 top-0 bottom-0 z-40 hidden flex-col gap-8 overflow-y-auto bg-bg px-6 pt-24 pb-10 max-view-tablet:flex",children:[l.map((e,o)=>r(ae,{item:e,mobile:!0,onNavigate:()=>y(!1)},`${e.href}-${o}`)),s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line pt-6",children:[g&&H&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),r(re,{href:"/account",onClick:()=>y(!1),className:"mono-eyebrow underline",children:"Your account"})]}),b&&J&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),b]}),x&&s("div",{className:"flex items-center justify-between",children:[r("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),x]})]})]})]})}export{Bt as default};
@@ -1,6 +1,6 @@
1
1
  import type { CSSProperties, ReactNode, RefObject } from "react";
2
2
  import type { PhoneMenuTools } from "efficient-web-builder/render/components/PhoneMenuTools";
3
- export declare function PhoneSheet({ role, panelRef, name, entries, tools, withAccount, editing, onClose, onSearch, phoneOnly, marker, listStyle, }: {
3
+ export declare function PhoneSheet({ role, panelRef, name, entries, tools, withAccount, editing, onClose, onSearch, phoneOnly, marker, listStyle, words, }: {
4
4
  role: "dialog";
5
5
  panelRef: RefObject<HTMLDivElement | null>;
6
6
  name: string;
@@ -13,4 +13,5 @@ export declare function PhoneSheet({ role, panelRef, name, entries, tools, withA
13
13
  phoneOnly?: boolean;
14
14
  marker?: string;
15
15
  listStyle?: CSSProperties;
16
+ words?: Readonly<Record<string, string>>;
16
17
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as n}from"react/jsx-runtime";import g from"next/link";import y from"efficient-easel/screen/components/UiIcon";import N from"./CountrySelect.js";import w from"./ThemeToggle.js";import{useCart as j}from"./CartContext.js";import{CartGlyph as v,cartLabel as C,useHeaderGlyph as T,UTIL_WORDS as f}from"./HeaderTools.js";import{UNDER_HEADER_SHEET_CLASS as _}from"../lib/content/header-bar.js";const h="flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]";function I({role:l,panelRef:a,name:o,entries:c,tools:e,withAccount:s,editing:m,onClose:i,onSearch:p,phoneOnly:x=!1,marker:u,listStyle:b}){const d=T(),r=e&&(e.search||e.cart||e.region||s&&e.account||e.theme)?e:null;return n("div",{ref:a,role:l,"aria-modal":"true","aria-label":o,tabIndex:-1,...u?{"data-menu-panel":u}:null,className:`${_} z-[60] flex flex-col overflow-y-auto bg-bg text-fg${x?" view-tablet:hidden":""}`,children:[t("ul",{className:"m-0 flex list-none flex-col px-5 py-3 font-mono text-[16px] uppercase tracking-[0.18em]",style:b,children:c}),r?n("div",{className:"mt-auto flex flex-col gap-4 border-t border-line bg-surface p-5",children:[r.search?n("button",{type:"button",className:h,onClick:m?void 0:()=>{i(),p()},children:[t(y,{name:"search",size:d.size,strokeWidth:d.stroke,rounded:!0}),f.search]}):null,r.cart?t(k,{editing:m,onClose:i}):null,s&&r.account?n("div",{className:"flex items-center justify-between",children:[t("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),t(g,{href:"/account",onClick:i,className:"mono-eyebrow underline",children:"Your account"})]}):null,r.region?n("div",{className:"flex items-center justify-between",children:[t("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),t(N,{})]}):null,r.theme?n("div",{className:"flex items-center justify-between",children:[t("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),t(w,{})]}):null]}):null]})}function k({editing:l,onClose:a}){const{open:o,totals:c}=j(),e=c.sets;return n("button",{type:"button",className:h,"aria-label":C(e),onClick:l?void 0:()=>{a(),o()},children:[t(v,{}),f.cart,e>0?` ${e}`:""]})}export{I as PhoneSheet};
1
+ "use client";import{jsx as n,jsxs as t}from"react/jsx-runtime";import y from"next/link";import N from"efficient-easel/screen/components/UiIcon";import v from"./CountrySelect.js";import T from"./ThemeToggle.js";import{useCart as _}from"./CartContext.js";import{CartGlyph as S,cartLabel as j,useHeaderGlyph as w,UTIL_WORDS as x}from"./HeaderTools.js";import{UNDER_HEADER_SHEET_CLASS as C}from"../lib/content/header-bar.js";const h="flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]",R="m-0 flex list-none flex-col px-5 py-3 font-mono text-[16px] uppercase tracking-[0.18em]",k="m-0 flex list-none flex-col px-5 py-6 font-[family-name:var(--sf-menu-panel-font)] text-[length:var(--sf-menu-panel-size)]";function $({role:r,panelRef:a,name:o,entries:c,tools:e,withAccount:m,editing:f,onClose:i,onSearch:b,phoneOnly:g=!1,marker:u,listStyle:d,words:s}){const p=w(),l=e&&(e.search||e.cart||e.region||m&&e.account||e.theme)?e:null;return t("div",{ref:a,role:r,"aria-modal":"true","aria-label":o,tabIndex:-1,...u?{"data-menu-panel":u}:null,className:`${C} z-[60] flex flex-col overflow-y-auto bg-bg text-fg${g?" view-tablet:hidden":""}`,children:[n("ul",{className:s?k:R,style:s?{...d,...s}:d,children:c}),l?t("div",{className:"mt-auto flex flex-col gap-4 border-t border-line bg-surface p-5",children:[l.search?t("button",{type:"button",className:h,onClick:f?void 0:()=>{i(),b()},children:[n(N,{name:"search",size:p.size,strokeWidth:p.stroke,rounded:!0}),x.search]}):null,l.cart?n(L,{editing:f,onClose:i}):null,m&&l.account?t("div",{className:"flex items-center justify-between",children:[n("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),n(y,{href:"/account",onClick:i,className:"mono-eyebrow underline",children:"Your account"})]}):null,l.region?t("div",{className:"flex items-center justify-between",children:[n("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),n(v,{})]}):null,l.theme?t("div",{className:"flex items-center justify-between",children:[n("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),n(T,{})]}):null]}):null]})}function L({editing:r,onClose:a}){const{open:o,totals:c}=_(),e=c.sets;return t("button",{type:"button",className:h,"aria-label":j(e),onClick:r?void 0:()=>{a(),o()},children:[n(S,{}),x.cart,e>0?` ${e}`:""]})}export{$ as PhoneSheet};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as a,Fragment as o}from"react/jsx-runtime";import u from"next/link";import{FIGURE_UPDATING as N,FREE_PRICE as b,UNPRICED_LABEL as k}from"../../lib/wheels/price-display.js";import w from"../CartLineThumbnail.js";import C from"../CouponField.js";import S from"../QuantityStepper.js";import j from"efficient-web-builder/render/components/RMark";import{lineTotal as v,useCart as d}from"../CartContext.js";import{COUPON_DEFERRED_TOTAL as T}from"../../lib/cart/coupon-preview.js";import{couponSaving as B,shippingWords as F,TAX_PENDING as $}from"../../lib/cart/shipping-status.js";import{useCurrency as g}from"../CurrencyContext.js";import{cartSubtitle as _}from"efficient-web-builder/format/lib/content/cart-drawer";function X({content:e,closeRef:r}){const{close:s,items:n}=d(),l=r;return a("header",{className:"flex flex-shrink-0 flex-col gap-4 border-b border-line px-8 pb-6 pt-8 max-[640px]:px-6 max-[640px]:pt-6 max-[640px]:pb-5",children:[a("div",{className:"flex items-center justify-between",children:[a("span",{className:"flex items-center gap-3 font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[e.kickerBadge?t("span",{className:"border px-2 py-1 text-[10px]",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 50%, transparent)"},children:e.kickerBadge}):null,(e.kickerBadge?"· ":"")+e.kickerText]}),t("button",{ref:l,type:"button",onClick:s,"aria-label":"Close cart",className:"flex h-8 w-8 items-center justify-center border border-line text-[14px] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"✕"})]}),a("h1",{className:"font-display text-[38px] font-medium uppercase leading-[0.95] tracking-[-0.03em] max-[640px]:text-[30px]",children:[e.titleLead+" ",t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.02em] normal-case",children:e.titleAccent})]}),t("p",{className:"font-serif text-[13px] italic leading-[1.5] text-fg-dim",children:_(e,n.length)})]})}function Y({content:e}){const{totals:r}=d(),{activeCountry:s}=g(),n=s?.name??e.shipsToFallback,l=1+(e.leadTimeValue?1:0)+(n?1:0);return t(o,{children:a("div",{className:`grid flex-shrink-0 ${R[l-1]} gap-px border-b border-line bg-line`,children:[t(h,{label:"Items",value:a(o,{children:[t("em",{className:"font-serif font-normal italic text-accent",children:r.sets})," set",r.sets===1?"":"s"," · ",r.units," item",r.units===1?"":"s"]})}),e.leadTimeValue?t(h,{label:"Lead time",value:e.leadTimeValue}):null,n?t(h,{label:"Ships to",value:n}):null]})})}function J({content:e,tyres:r}){const{items:s,remove:n,setQty:l}=d();return t(o,{children:s.length===0?t(A,{content:e}):s.map(c=>t(E,{line:c,tyre:r.get(c.slug),onRemove:()=>n(c.id),onQtyChange:m=>l(c.id,m)},c.id))})}function Z(){const{items:e,totals:r,bundles:s}=d(),{formatMoney:n}=g(),l=new Set(e.flatMap(i=>(i.components??[]).map(x=>x.partNumber))),c=new Set(r.appliedBundles.map(i=>i.slug)),m=s.filter(i=>!c.has(i.slug)).filter(i=>i.components.some(x=>l.has(x.partNumber))).slice(0,2);return t(o,{children:m.length>0&&a("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",style:{background:"color-mix(in oklab, var(--site-surface) 60%, transparent)"},children:[a("div",{className:"mb-4 flex items-center justify-between font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[t("span",{children:"You may also need"}),t("span",{className:"font-display text-[11px] normal-case tracking-[0.08em] text-fg-dim",children:"Buy together, save"})]}),t("div",{className:"grid grid-cols-2 gap-2 max-[640px]:grid-cols-1",children:m.map(i=>t(L,{href:`/bundles/${i.slug}`,title:i.name,sub:U(i,r.currency,n)},i.slug))})]})})}function ee(){return t(o,{children:t("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",children:t(C,{})})})}function te({content:e}){return t(o,{children:e.promises.length>0&&t("div",{className:"flex flex-wrap justify-center gap-5 border-b border-line px-8 pt-6 pb-8 font-mono text-[9px] uppercase tracking-[0.24em] text-fg-dim max-[640px]:px-6",children:e.promises.map(r=>t(I,{children:r},r))})})}function re(){const{totals:e,coupon:r}=d(),{formatMoney:s}=g();return t(o,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-2 border-t border-line px-8 pt-5 max-[640px]:px-6",children:[t(p,{label:`Subtotal · ${e.sets} set${e.sets===1?"":"s"}`,value:s(e.subtotal,e.currency)}),e.appliedBundles.map(n=>t(p,{label:`Bundle · ${n.name}${n.multiples>1?` ×${n.multiples}`:""}`,value:a("span",{style:{color:"var(--green)"},children:["− ",s(n.discount,e.currency)]})},n.slug)),(e.discount>0||e.deliverySaving>0)&&r?.valid&&t(p,{label:`Coupon · ${r.code}`,value:t("span",{style:{color:"var(--green)"},children:B(e,n=>s(n,e.currency))})}),r?.deferred&&t(p,{label:`Coupon · ${r.code}`,value:T}),r?.valid&&r.effects?.gift&&t(p,{label:`Free gift · ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` ×${r.effects.gift.quantity}`:""}`,value:t("span",{style:{color:"var(--green)"},children:b})}),t(p,{label:"Shipping",value:e.shippingStatus==="free"?t("span",{style:{color:"var(--green)"},children:b}):F(e.shippingStatus)??s(e.shipping,e.currency)}),e.tax&&(e.tax.charged?t(p,{label:e.tax.inclusive?`${e.tax.name} included · ${e.tax.rate}%`:e.tax.name,value:s(e.tax.amount,e.currency)}):e.tax.name?t(p,{label:e.tax.name,value:$}):null),a("div",{className:"mt-2 flex items-center justify-between border-t border-line pt-4 text-fg",children:[a("span",{className:"font-display text-[22px] font-medium tracking-[-0.02em] normal-case",children:["Total ",t("em",{className:"font-serif font-normal italic text-accent",children:"due"})]}),t("span",{className:"text-right font-display text-[30px] font-medium tracking-[-0.025em] text-fg",children:e.repricing?N:s(e.grand,e.currency)})]})]})})}function ae(){const{items:e,close:r}=d();return t(o,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-3 px-8 pb-6 pt-4 max-[640px]:px-6",children:[a(u,{href:"/checkout",onClick:r,"aria-disabled":e.length===0,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[12px] uppercase tracking-[0.3em] transition-colors",e.length===0?"pointer-events-none cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:["Begin checkout",t("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}),t("div",{className:"flex items-center justify-between px-1 py-2 font-mono text-[10px] uppercase tracking-[0.24em] text-fg-dim",children:t(u,{href:"/wheels",onClick:r,className:"text-fg transition-colors hover:text-accent",children:"← Keep browsing"})})]})})}const R=["grid-cols-1","grid-cols-2","grid-cols-3"];function h({label:e,value:r}){return a("div",{className:"flex flex-col gap-1 bg-bg px-4 py-4",children:[t("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-fg-dim",children:e}),t("span",{className:"font-display text-[14px] font-medium tracking-[-0.005em] text-fg",children:r})]})}function E({line:e,tyre:r,onRemove:s,onQtyChange:n}){const{catalog:l,totals:c}=d(),m=(e.components??[]).reduce((f,y)=>f+(c.freeUnitsByPartNumber[y.partNumber]??0),0),{currency:i,formatMoney:x}=g();return a(o,{children:[a("article",{className:"grid grid-cols-[96px_1fr] gap-5 border-b border-line px-8 py-6 transition-colors hover:bg-[color-mix(in_oklab,var(--site-surface)_60%,transparent)] max-[640px]:grid-cols-[78px_1fr] max-[640px]:px-6 max-[640px]:py-5",children:[t(w,{line:e,catalog:l,tyre:r}),a("div",{className:"flex min-w-0 flex-col gap-2",children:[a("div",{className:"flex items-start justify-between gap-3",children:[a("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-accent",children:["N° ",e.positionNo," · ",e.process==="FusionForge®"?a(o,{children:["FusionForge",t(j,{})]}):e.process]}),t("span",{className:"whitespace-nowrap font-display text-[16px] font-medium tracking-[-0.015em] text-fg",children:v(e,i)===null?k:x(v(e,i),i)})]}),a("h3",{className:"mt-0.5 font-display text-[22px] font-medium uppercase leading-none tracking-[-0.02em]",children:[e.name.lead,t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em] normal-case",children:e.name.accent})]}),e.config.length>0&&a("div",{className:"mt-1 flex flex-wrap gap-2",children:[e.config.map(f=>t("span",{className:["border px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em]",f.gold?"border-[color-mix(in_oklab,var(--accent)_45%,var(--site-line))] text-accent":"border-line text-fg-dim"].join(" "),children:f.label},f.label)),m>0&&a("span",{className:"border border-accent bg-accent px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em] text-bg",children:[m,"× free"]})]}),a("div",{className:"mt-3 flex items-center justify-between gap-3",children:[t(S,{value:e.qty,onChange:n,size:"small"}),a("div",{className:"flex gap-4 font-mono text-[10px] uppercase tracking-[0.22em]",children:[t(u,{href:e.href??`/wheels/${e.slug}`,className:"text-fg-dim transition-colors hover:text-accent",children:e.href?"View product":"Edit finish"}),t("button",{type:"button",onClick:s,className:"text-fg-dim transition-colors hover:text-alert",children:"Remove"})]})]})]})]}),e.verifiedFor&&a("div",{className:"mx-8 -mt-px flex items-start gap-3 border-t-0 px-4 py-4 font-display text-[13px] leading-[1.45] text-fg max-[640px]:mx-6",style:{background:"color-mix(in oklab, var(--accent) 8%, transparent)",border:"1px solid color-mix(in oklab, var(--accent) 35%, var(--site-line))",borderTop:"0"},children:[t("span",{className:"flex-shrink-0 pt-px font-mono text-[10px] uppercase tracking-[0.24em] text-accent",children:"Fits"}),a("span",{children:["Verified for your ",t("strong",{className:"font-medium text-accent",children:e.verifiedFor}),". Final torque values shipped with the wheels."]})]})]})}function L({title:e,sub:r,href:s}){return a(u,{href:s,className:"flex items-center justify-between border border-line bg-bg px-4 py-3 text-left transition-colors hover:border-accent",children:[a("span",{className:"flex min-w-0 flex-col gap-1",children:[t("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-display text-[13px] font-medium tracking-[-0.005em] text-fg",children:e}),t("span",{className:"font-mono text-[9px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),t("span",{className:"ml-2 flex h-6 w-6 flex-shrink-0 items-center justify-center font-mono text-[13px] text-accent",style:{borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))",borderWidth:1,borderStyle:"solid"},children:"+"})]})}function U(e,r,s){const n=e.savings[r];if(n===void 0)return"Buy together";const l=s(n,r);return e.savingIsFrom?`Save from ${l}`:`Save ${l}`}function I({children:e}){return t("span",{className:"inline-flex items-center gap-2 before:text-[6px] before:text-accent before:content-['●']",children:e})}function p({label:e,value:r}){return a("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.18em] text-fg-dim",children:[t("span",{children:e}),t("strong",{className:"font-display text-[14px] font-normal tracking-[-0.005em] normal-case text-fg",children:r})]})}function A({content:e}){return a("div",{className:"flex flex-col items-center justify-center gap-3 px-8 py-20 text-center",children:[t("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:e.emptyKicker}),t("p",{className:"font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:e.emptyBody}),a(u,{href:"/wheels",className:"mt-3 inline-flex items-center gap-3 border border-line px-5 py-3 font-mono text-[11px] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:["Browse the catalog ",t("span",{className:"text-accent",children:"→"})]})]})}export{ae as CartActions,ee as CartCouponRow,X as CartDrawerHeader,E as CartLineRow,J as CartLines,Y as CartStatusRail,re as CartTotals,te as CartTrustMarkers,Z as CartUpsell};
1
+ "use client";import{jsx as t,jsxs as a,Fragment as c}from"react/jsx-runtime";import u from"next/link";import{FIGURE_UPDATING as N,FREE_PRICE as b,UNPRICED_LABEL as k}from"../../lib/wheels/price-display.js";import w from"../CartLineThumbnail.js";import C from"../CouponField.js";import S from"../QuantityStepper.js";import j from"efficient-web-builder/render/components/RMark";import{lineTotal as v,useCart as d}from"../CartContext.js";import{COUPON_DEFERRED_TOTAL as T}from"../../lib/cart/coupon-preview.js";import{couponSaving as B,shippingWords as F,TAX_PENDING as $}from"../../lib/cart/shipping-status.js";import{useCurrency as g}from"../CurrencyContext.js";import{cartSubtitle as _}from"efficient-web-builder/format/lib/content/cart-drawer";function X({content:e,closeRef:r}){const{close:s,items:n}=d(),l=r;return a("header",{className:"flex flex-shrink-0 flex-col gap-4 border-b border-line px-8 pb-6 pt-8 max-[640px]:px-6 max-[640px]:pt-6 max-[640px]:pb-5",children:[a("div",{className:"flex items-center justify-between",children:[a("span",{className:"flex items-center gap-3 font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[e.kickerBadge?t("span",{className:"border px-2 py-1 text-[10px]",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 50%, transparent)"},children:e.kickerBadge}):null,(e.kickerBadge?"· ":"")+e.kickerText]}),t("button",{ref:l,type:"button",onClick:s,"aria-label":"Close cart",className:"flex h-8 w-8 items-center justify-center border border-line text-[14px] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"✕"})]}),a("h1",{className:"font-display text-[38px] font-medium uppercase leading-[0.95] tracking-[-0.03em] max-[640px]:text-[30px]",children:[e.titleLead+" ",t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.02em] normal-case",children:e.titleAccent})]}),t("p",{className:"font-serif text-[13px] italic leading-[1.5] text-fg-dim",children:_(e,n.length)})]})}function Y({content:e}){const{totals:r}=d(),{activeCountry:s}=g(),n=s?.name??e.shipsToFallback,l=1+(e.leadTimeValue?1:0)+(n?1:0);return t(c,{children:a("div",{className:`grid flex-shrink-0 ${R[l-1]} gap-px border-b border-line bg-line`,children:[t(h,{label:"Items",value:a(c,{children:[t("em",{className:"font-serif font-normal italic text-accent",children:r.sets})," set",r.sets===1?"":"s"," · ",r.units," item",r.units===1?"":"s"]})}),e.leadTimeValue?t(h,{label:"Lead time",value:e.leadTimeValue}):null,n?t(h,{label:"Ships to",value:n}):null]})})}function J({content:e,tyres:r}){const{items:s,remove:n,setQty:l}=d();return t(c,{children:s.length===0?t(A,{content:e}):s.map(o=>t(E,{line:o,tyre:r.get(o.slug),onRemove:()=>n(o.id),onQtyChange:m=>l(o.id,m)},o.id))})}function Z(){const{items:e,totals:r,bundles:s}=d(),{formatMoney:n}=g(),l=new Set(e.flatMap(i=>(i.components??[]).map(x=>x.partNumber))),o=new Set(r.appliedBundles.map(i=>i.slug)),m=s.filter(i=>!o.has(i.slug)).filter(i=>i.components.some(x=>l.has(x.partNumber))).slice(0,2);return t(c,{children:m.length>0&&a("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",style:{background:"color-mix(in oklab, var(--site-surface) 60%, transparent)"},children:[a("div",{className:"mb-4 flex items-center justify-between font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:[t("span",{children:"You may also need"}),t("span",{className:"font-display text-[11px] normal-case tracking-[0.08em] text-fg-dim",children:"Buy together, save"})]}),t("div",{className:"grid grid-cols-2 gap-2 max-[640px]:grid-cols-1",children:m.map(i=>t(L,{href:`/bundles/${i.slug}`,title:i.name,sub:U(i,r.currency,n)},i.slug))})]})})}function ee(){return t(c,{children:t("section",{className:"border-b border-line px-8 py-6 max-[640px]:px-6",children:t(C,{})})})}function te({content:e}){return t(c,{children:e.promises.length>0&&t("div",{className:"flex flex-wrap justify-center gap-5 border-b border-line px-8 pt-6 pb-8 font-mono text-[9px] uppercase tracking-[0.24em] text-fg-dim max-[640px]:px-6",children:e.promises.map(r=>t(I,{children:r},r))})})}function re(){const{totals:e,coupon:r}=d(),{formatMoney:s}=g();return t(c,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-2 border-t border-line px-8 pt-5 max-[640px]:px-6",children:[t(p,{label:`Subtotal · ${e.sets} set${e.sets===1?"":"s"}`,value:s(e.subtotal,e.currency)}),e.appliedBundles.map(n=>t(p,{label:`Bundle · ${n.name}${n.multiples>1?` ×${n.multiples}`:""}`,value:a("span",{style:{color:"var(--green)"},children:["− ",s(n.discount,e.currency)]})},n.slug)),(e.discount>0||e.deliverySaving>0)&&r?.valid&&t(p,{label:`Coupon · ${r.code}`,value:t("span",{style:{color:"var(--green)"},children:B(e,n=>s(n,e.currency))})}),r?.deferred&&t(p,{label:`Coupon · ${r.code}`,value:T}),r?.valid&&r.effects?.gift&&t(p,{label:`Free gift · ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` ×${r.effects.gift.quantity}`:""}`,value:t("span",{style:{color:"var(--green)"},children:b})}),t(p,{label:"Shipping",value:e.shippingStatus==="free"?t("span",{style:{color:"var(--green)"},children:b}):F(e.shippingStatus)??s(e.shipping,e.currency)}),e.tax&&(e.tax.charged?t(p,{label:e.tax.inclusive?`${e.tax.name} included · ${e.tax.rate}%`:e.tax.name,value:s(e.tax.amount,e.currency)}):e.tax.name?t(p,{label:e.tax.name,value:$}):null),a("div",{className:"mt-2 flex items-center justify-between border-t border-line pt-4 text-fg",children:[a("span",{className:"font-display text-[22px] font-medium tracking-[-0.02em] normal-case",children:["Total ",t("em",{className:"font-serif font-normal italic text-accent",children:"due"})]}),t("span",{className:"text-right font-display text-[30px] font-medium tracking-[-0.025em] text-fg",children:e.repricing?N:s(e.grand,e.currency)})]})]})})}function ae(){const{items:e,close:r}=d();return t(c,{children:a("div",{className:"flex flex-shrink-0 flex-col gap-3 px-8 pb-6 pt-4 max-[640px]:px-6",children:[a(u,{href:"/checkout",onClick:r,"aria-disabled":e.length===0,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[12px] uppercase tracking-[0.3em] transition-colors",e.length===0?"pointer-events-none cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:["Begin checkout",t("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}),t("div",{className:"flex items-center justify-between px-1 py-2 font-mono text-[10px] uppercase tracking-[0.24em] text-fg-dim",children:t(u,{href:"/wheels",onClick:r,className:"text-fg transition-colors hover:text-accent",children:"← Keep browsing"})})]})})}const R=["grid-cols-1","grid-cols-2","grid-cols-3"];function h({label:e,value:r}){return a("div",{className:"flex flex-col gap-1 bg-bg px-4 py-4",children:[t("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-fg-dim",children:e}),t("span",{className:"font-display text-[14px] font-medium tracking-[-0.005em] text-fg",children:r})]})}function E({line:e,tyre:r,onRemove:s,onQtyChange:n}){const{catalog:l,totals:o}=d(),m=(e.components??[]).reduce((f,y)=>f+(o.freeUnitsByPartNumber[y.partNumber]??0),0),{currency:i,formatMoney:x}=g();return a(c,{children:[a("article",{className:"grid grid-cols-[96px_1fr] gap-5 border-b border-line px-8 py-6 transition-colors hover:bg-[color-mix(in_oklab,var(--site-surface)_60%,transparent)] max-[640px]:grid-cols-[78px_1fr] max-[640px]:px-6 max-[640px]:py-5",children:[t(w,{line:e,catalog:l,tyre:r}),a("div",{className:"flex min-w-0 flex-col gap-2",children:[a("div",{className:"flex items-start justify-between gap-3",children:[a("span",{className:"font-mono text-[9px] uppercase tracking-[0.26em] text-accent",children:[a("span",{"data-cart-line-no":"",children:["N° ",e.positionNo," · "]}),e.process==="FusionForge®"?a(c,{children:["FusionForge",t(j,{})]}):e.process]}),t("span",{className:"whitespace-nowrap font-display text-[16px] font-medium tracking-[-0.015em] text-fg",children:v(e,i)===null?k:x(v(e,i),i)})]}),a("h3",{className:"mt-0.5 font-display text-[22px] font-medium uppercase leading-none tracking-[-0.02em]",children:[e.name.lead,t("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em] normal-case",children:e.name.accent})]}),e.config.length>0&&a("div",{className:"mt-1 flex flex-wrap gap-2",children:[e.config.map(f=>t("span",{className:["border px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em]",f.gold?"border-[color-mix(in_oklab,var(--accent)_45%,var(--site-line))] text-accent":"border-line text-fg-dim"].join(" "),children:f.label},f.label)),m>0&&a("span",{className:"border border-accent bg-accent px-2 py-1 font-mono text-[9px] uppercase tracking-[0.18em] text-bg",children:[m,"× free"]})]}),a("div",{className:"mt-3 flex items-center justify-between gap-3",children:[t(S,{value:e.qty,onChange:n,size:"small"}),a("div",{className:"flex gap-4 font-mono text-[10px] uppercase tracking-[0.22em]",children:[t(u,{href:e.href??`/wheels/${e.slug}`,className:"text-fg-dim transition-colors hover:text-accent",children:e.href?"View product":"Edit finish"}),t("button",{type:"button",onClick:s,className:"text-fg-dim transition-colors hover:text-alert",children:"Remove"})]})]})]})]}),e.verifiedFor&&a("div",{className:"mx-8 -mt-px flex items-start gap-3 border-t-0 px-4 py-4 font-display text-[13px] leading-[1.45] text-fg max-[640px]:mx-6",style:{background:"color-mix(in oklab, var(--accent) 8%, transparent)",border:"1px solid color-mix(in oklab, var(--accent) 35%, var(--site-line))",borderTop:"0"},children:[t("span",{className:"flex-shrink-0 pt-px font-mono text-[10px] uppercase tracking-[0.24em] text-accent",children:"Fits"}),a("span",{children:["Verified for your ",t("strong",{className:"font-medium text-accent",children:e.verifiedFor}),". Final torque values shipped with the wheels."]})]})]})}function L({title:e,sub:r,href:s}){return a(u,{href:s,className:"flex items-center justify-between border border-line bg-bg px-4 py-3 text-left transition-colors hover:border-accent",children:[a("span",{className:"flex min-w-0 flex-col gap-1",children:[t("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-display text-[13px] font-medium tracking-[-0.005em] text-fg",children:e}),t("span",{className:"font-mono text-[9px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),t("span",{className:"ml-2 flex h-6 w-6 flex-shrink-0 items-center justify-center font-mono text-[13px] text-accent",style:{borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))",borderWidth:1,borderStyle:"solid"},children:"+"})]})}function U(e,r,s){const n=e.savings[r];if(n===void 0)return"Buy together";const l=s(n,r);return e.savingIsFrom?`Save from ${l}`:`Save ${l}`}function I({children:e}){return t("span",{className:"inline-flex items-center gap-2 before:text-[6px] before:text-accent before:content-['●']",children:e})}function p({label:e,value:r}){return a("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.18em] text-fg-dim",children:[t("span",{children:e}),t("strong",{className:"font-display text-[14px] font-normal tracking-[-0.005em] normal-case text-fg",children:r})]})}function A({content:e}){return a("div",{className:"flex flex-col items-center justify-center gap-3 px-8 py-20 text-center",children:[t("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] text-accent",children:e.emptyKicker}),t("p",{className:"font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:e.emptyBody}),a(u,{href:"/wheels",className:"mt-3 inline-flex items-center gap-3 border border-line px-5 py-3 font-mono text-[11px] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:["Browse the catalog ",t("span",{className:"text-accent",children:"→"})]})]})}export{ae as CartActions,ee as CartCouponRow,X as CartDrawerHeader,E as CartLineRow,J as CartLines,Y as CartStatusRail,re as CartTotals,te as CartTrustMarkers,Z as CartUpsell};
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{declaredBlockSource as k,sourcedRows as M}from"efficient-web-builder/format/lib/content/block-sources";import T from"../../components/FooterMenu.js";import{addressQueryOf as S}from"../wheels/selected-ranges.js";import{menuLayoutOf as x}from"../content/tab-strip.js";import{MENU_BLOCK_TYPE as l}from"./document-nodes.js";import{resolveNavTextCase as w}from"../content/header-bar.js";const A={[l]:"FooterMenu",EmailFormBlock:"FooterEmailSignup",SocialLogosBlock:"FooterSocial",PaymentLogosBlock:"FooterPayment"},C="data-menu-case",L="column";function N({id:e,template:o,menu:r,dataSource:n,dataRows:d,heading:s,accordionMobile:c,showDividers:m,direction:u,linkAlign:f,linkRange:p,menuStyle:g,currentPage:E,menuStylePhone:P,menuPanelWidth:y,menuPanelTintColor:F,menuPanelTintOpacity:_,textCase:B,editor:t,...O}){const i=a(T,{owner:{id:String(e??""),type:l,template:o},menu:r,served:k({dataSource:n})?M({dataSource:n,dataRows:d},!!t?.isEditing).rows:void 0,heading:s||void 0,accordionMobile:c,showDividers:m,layout:x(u),linkAlign:f,linkRange:p,menuStyle:g,currentPage:E,pageQuery:S(O)||void 0,menuStylePhone:P,menuPanelWidth:y,menuPanelTintColor:F,menuPanelTintOpacity:_,editing:t?.isEditing});return w(B)!=="capitalised"?i:a("div",{className:"contents",[C]:"capitalised",children:i})}function b(e){for(const[r,n]of Object.entries(A))e[r]={...e[n]};const o=e.MenuBlock;o.defaultProps={...o.defaultProps,direction:L},o.render=N}export{C as MENU_CASE_ATTR,A as PAGE_BLOCKS_FROM_FOOTER,L as PAGE_MENU_DIRECTION_DEFAULT,b as addPageBlocksFromFooter};
1
+ import{jsx as a}from"react/jsx-runtime";import{declaredBlockSource as k,sourcedRows as M}from"efficient-web-builder/format/lib/content/block-sources";import S from"../../components/FooterMenu.js";import{addressQueryOf as x}from"../wheels/selected-ranges.js";import{menuLayoutOf as w}from"../content/tab-strip.js";import{MENU_BLOCK_TYPE as l}from"./document-nodes.js";import{resolveNavTextCase as A}from"../content/header-bar.js";const C={[l]:"FooterMenu",EmailFormBlock:"FooterEmailSignup",SocialLogosBlock:"FooterSocial",PaymentLogosBlock:"FooterPayment"},L="data-menu-case",N="column";function R({id:e,template:o,menu:r,dataSource:n,dataRows:d,heading:m,accordionMobile:s,showDividers:u,direction:c,linkAlign:f,linkRange:p,menuStyle:g,currentPage:P,menuStylePhone:E,menuPanelWidth:y,menuPanelTintColor:F,menuPanelTintOpacity:_,menuPanelTextStyle:B,textCase:O,editor:t,...T}){const i=a(S,{owner:{id:String(e??""),type:l,template:o},menu:r,served:k({dataSource:n})?M({dataSource:n,dataRows:d},!!t?.isEditing).rows:void 0,heading:m||void 0,accordionMobile:s,showDividers:u,layout:w(c),linkAlign:f,linkRange:p,menuStyle:g,currentPage:P,pageQuery:x(T)||void 0,menuStylePhone:E,menuPanelWidth:y,menuPanelTintColor:F,menuPanelTintOpacity:_,menuPanelTextStyle:B,editing:t?.isEditing});return A(O)!=="capitalised"?i:a("div",{className:"contents",[L]:"capitalised",children:i})}function G(e){for(const[r,n]of Object.entries(C))e[r]={...e[n]};const o=e.MenuBlock;o.defaultProps={...o.defaultProps,direction:N},o.render=R}export{L as MENU_CASE_ATTR,C as PAGE_BLOCKS_FROM_FOOTER,N as PAGE_MENU_DIRECTION_DEFAULT,G as addPageBlocksFromFooter};