efficient-storefront-blocks 0.11.0 → 0.12.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.
- package/CHANGELOG.md +32 -0
- package/dist/chunks/{EditorPreviewCheckout-J27HMNBW.js → EditorPreviewCheckout-D2J57RZY.js} +1 -1
- package/dist/chunks/PreviewFooter-WL76Z4NK.js +1 -0
- package/dist/chunks/SectionEditorShell-U3CXCPYO.js +1 -0
- package/dist/chunks/SiteEditorProvider-N7LE6HYF.js +1 -0
- package/dist/chunks/chunk-BAXOL3AI.js +1 -0
- package/dist/chunks/chunk-I5J42GI3.js +16 -0
- package/dist/chunks/chunk-NQIIJI3Z.js +1 -0
- package/dist/chunks/chunk-QL3UVEEM.js +1 -0
- package/dist/chunks/chunk-R2JQPRJX.js +1 -0
- package/dist/chunks/chunk-XNYKOAQ3.js +153 -0
- package/dist/chunks/chunk-YARJ4IUJ.js +230 -0
- package/dist/chunks/fitment-data-3PTG4BJX.js +1 -0
- package/dist/chunks/render-client-DYF6CWVJ.js +1 -0
- package/dist/contract.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +114 -977
- package/dist/links.d.ts +59 -0
- package/dist/links.js +1 -1
- package/package.json +2 -2
- package/dist/chunks/PreviewFooter-BMBCVZQC.js +0 -1
- package/dist/chunks/SectionEditorShell-K4OEOAY4.js +0 -1
- package/dist/chunks/SiteEditorProvider-ECGZVKLG.js +0 -1
- package/dist/chunks/StorefrontEditorChrome-T6DTL7T7.js +0 -1
- package/dist/chunks/chunk-3J4FEDNZ.js +0 -2
- package/dist/chunks/chunk-6CP4D6VJ.js +0 -1
- package/dist/chunks/chunk-6XRKNA2E.js +0 -1
- package/dist/chunks/chunk-C2CHF6AL.js +0 -15
- package/dist/chunks/chunk-ENDWECYV.js +0 -1
- package/dist/chunks/chunk-HVOO2GNE.js +0 -1
- package/dist/chunks/chunk-MYSIADXX.js +0 -1
- package/dist/chunks/chunk-NJXX5BI2.js +0 -1
- package/dist/chunks/chunk-RRHBLOH4.js +0 -1
- package/dist/chunks/chunk-TGIEMCNA.js +0 -1
- package/dist/chunks/chunk-THATLL5Z.js +0 -230
- package/dist/chunks/chunk-TOY67YUY.js +0 -153
- package/dist/chunks/chunk-UBWM4USZ.js +0 -1
- package/dist/chunks/fitment-data-BXI7KQRZ.js +0 -1
- package/dist/chunks/render-client-UQ5CUPRL.js +0 -1
- /package/dist/chunks/{chunk-C2CHF6AL.js.LEGAL.txt → chunk-I5J42GI3.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-TOY67YUY.js.LEGAL.txt → chunk-XNYKOAQ3.js.LEGAL.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createContext as rn,useCallback as s,useContext as an,useMemo as ln,useState as Re}from"react";import{createContext as ue,useContext as L}from"react";import{createContext as gt}from"react";var se=gt(null);var ht=ue(null),I=ue({logo:null,placeholder:!1,wordmark:null});function En(){let e=L(se),t=L(ht),n=L(I),o=!e&&n.placeholder,r=e?e.logoUrl:n.logo?.logoUrl??t?.logoUrl??null;return{src:o?null:r,reversedSrc:e?e.logoReversed:n.logo?.logoReversed??t?.logoReversed??null,inkIsDark:e?e.logoInkIsDark:n.logo?.logoInkIsDark??t?.logoInkIsDark??null,wordmark:e?null:n.wordmark,siteName:e?.siteName??t?.siteName}}import{createContext as pt,useCallback as de,useContext as ft,useRef as mt,useState as St}from"react";var P=0;function ce(e){P+=1;try{return e()}finally{P-=1}}function Rn(){return P>0}import{jsx as bt}from"react/jsx-runtime";function F(){let e=mt(()=>{}),t=de((...o)=>ce(()=>e.current(...o)),[]),n=de(o=>{e.current=o},[]);return{select:t,setSelectHandler:n}}function vn(e){let t=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`,n=(i,u,c,d)=>({[e]:i,[t]:u,select:c,setSelectHandler:d}),o=pt(n(null,()=>{},()=>{},()=>{}));function r({children:i}){let[u,c]=St(null),{select:d,setSelectHandler:h}=F();return bt(o.Provider,{value:n(u,c,d,h),children:i})}return{Provider:r,useSelection:()=>ft(o)}}var In="storefront-theme",Pn="sf:theme-mode",Fn="sf:theme-switch",On="hide",G="light";function yt(e){return e>=7&&e<18}function Mn(e){let{mode:t,override:n,switchShown:o,hour:r}=e;return o&&(n==="light"||n==="dark")?n:t==="auto"?yt(r)?"light":"dark":t==="light"?"light":"dark"}var m={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},xt=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],H={selected:0,themes:xt};function ge(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...H}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function O(e,t,n){let o=R(e),r=R(t);if(o===null||r===null)return e;let l=i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0");return`#${o.map((i,u)=>l(i+(r[u]-i)*n)).join("")}`}var _t={light:"#ffffff",dark:"#0a0a0a"},Dn=["light","dark"];function Vn(e,t){let n=_t[t],o=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:O(e,o,.1),line:O(e,o,.22),muted:O(n,e,.35),brandInk:t}}function w(e){let t=ge(e);return t.themes[t.selected]}function he(e){return{text:e.text,accent:e.accent,background:e.background||m.background,surface:e.surface||m.surface,line:e.line||m.line,muted:e.muted||m.muted}}function R(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=t[1].length===3?[...t[1]].map(i=>i+i).join(""):t[1],[o,r,l]=[0,2,4].map(i=>parseInt(n.slice(i,i+2),16));return[o,r,l]}function N(e){let t=R(e);if(t===null)return null;let[n,o,r]=t.map(l=>{let i=l/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return .2126*n+.7152*o+.0722*r}var Tt=.4,Et=4.5,Ct=3;function Rt(e,t){let n=N(e),o=N(t);if(n===null||o===null)return null;let[r,l]=n>=o?[n,o]:[o,n];return(r+.05)/(l+.05)}var Nn={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Gn(e){return e>=Et?"good":e>=Ct?"large-only":"hard"}var M=["#000000","#ffffff"];function A(e){let t=M[0],n=-1;for(let o of M){let r=Rt(e,o);if(r===null)return M[0];r>n&&(n=r,t=o)}return t}var Ht=[.25,.4,.55];function Un(e){let t=R(e);return t===null?[]:Ht.map(n=>"#"+t.map(o=>Math.round(o*(1-n)).toString(16).padStart(2,"0")).join(""))}function zn(e){let t=w(e),n={"--theme-fg":t.text},o=N(t.text);return(o===null||o>=Tt)&&(n["--overlay-fg"]=t.text),n}var wt=82;function U(e){return`color-mix(in srgb, ${e} ${wt}%, #000)`}function $n(e){let t=w(e);return{"--theme-accent":t.accent,"--theme-accent-2":U(t.accent),"--theme-accent-ink":A(t.accent)}}function pe(e){let t=e?.button;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Bn(e){let t=w(e),n=pe(t),o=fe(t);if(n===null&&o===null)return{};let r={};return n!==null&&(r["--theme-btn"]=n,r["--theme-btn-2"]=U(n)),r["--theme-btn-ink"]=o??A(n),r}function fe(e){let t=e?.buttonInk;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Yn(e,t){return fe(e)??A(pe(e)??t)}function Wn(e){let t={};return ge(e).themes.forEach((n,o)=>{let r=he(n);t[`--theme-preset-${o}-accent`]=r.accent,t[`--theme-preset-${o}-accent-2`]=U(r.accent),t[`--theme-preset-${o}-accent-ink`]=A(r.accent),t[`--theme-preset-${o}-bg`]=r.background,t[`--theme-preset-${o}-fg`]=r.text,t[`--theme-preset-${o}-surface`]=r.surface,t[`--theme-preset-${o}-surface-2`]=`color-mix(in srgb, ${r.surface} 60%, ${r.line})`,t[`--theme-preset-${o}-line`]=r.line,t[`--theme-preset-${o}-muted`]=r.muted}),t}var Kn=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function Xn(e){let t=he(w(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,o={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==m.surface||t.line!==m.line)&&(o["--theme-surface-2"]=n),o}var At=["heading","body","label"];function qn(e){if(!e)return null;for(let t of At)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}var me=["headingLarge","headingMedium","headingSmall","accent","body","label"];var z={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},vt=8,kt=200,Zn=1;function Lt(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.round(e);return t>=vt&&t<=kt?t:null}function It(e){let t={};for(let n of me)t[n]=Lt(e?.[n]);return t}function jn(e){let t=It(e),n={};for(let o of me){let r=t[o];r!==null&&(n[`--size-${o}`]=`${r}px`)}return n}var Pt=["square","small","large"],Ft="small";function Jn(e){return Pt.includes(e??"")?e:Ft}var Se=0,Ot=40,Qn={square:0,small:null,large:16},Mt={"--sf-card-radius":1,"--sf-button-radius":.5,"--radius":.5,"--radius-xs":.25,"--radius-sm":.5,"--radius-md":.75,"--radius-lg":1,"--radius-xl":1.25,"--radius-2xl":1.5,"--radius-3xl":2,"--radius-4xl":2.5};function be(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(Ot,Math.max(Se,Math.round(t))):null}function Dt(e){let t=be(e);return t===null?{}:Object.fromEntries(Object.entries(Mt).map(([n,o])=>{let r=t*o/16;return[n,r===0?"0":`${r}rem`]}))}function eo(e){return Dt(be(e)??Se)}var Vt=["none","soft","lifted"],Nt="soft",ye="none",Gt=["tight","normal","roomy"],Ut="normal",v="normal",zt=["none","lift","highlight"],$t="lift",Bt="highlight",xe="#141416";function _e(e){return Vt.includes(e??"")?e:Nt}function Yt(e){return Gt.includes(e??"")?e:Ut}function Te(e){return zt.includes(e??"")?e:$t}function Wt(e){return/^#[0-9a-fA-F]{6}$/.test(e??"")?e.toLowerCase():xe}function to(e){let t=_e(e);return t===ye?void 0:t}function no(e){let t=Yt(e);return t===v?void 0:t}function oo(e){let t=Te(e);return t===Bt?void 0:t}function ro(e,t,n){let o=Wt(t);return o===xe?{}:_e(e)!==ye||Te(n)==="lift"?{"--sf-shadow-color":o}:{}}var Kt=["normal","tight","compressed"],T="normal";function Ee(e){return Kt.includes(e??"")?e:T}function ao(e){let t=Ee(e);return t===T?void 0:t}function io(e){switch(Ee(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}var $={case:"authored",weight:null,weightStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},D=100,V=900,Xt=24,qt=200;function C(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function B(e){let t=C(e?.weight,D,V),n=e?.case==="sentence"?"sentence":"authored",o=l=>l==null?t:C(l,D,V),r=l=>l==="sentence"?"sentence":l==="authored"?"authored":n;return{case:n,weight:t,weightStrong:C(e?.weightStrong,D,V),maxPx:C(e?.maxPx,Xt,qt),weight2:o(e?.weight2),weight3:o(e?.weight3),case2:r(e?.case2),case3:r(e?.case3)}}function lo(e){let t=B(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function so(e){return B({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}function uo(e){let t=B(e);return{heading_case:t.case,heading_weight:t.weight,heading_weight_strong:t.weightStrong,heading_max_px:t.maxPx,heading_2_weight:t.weight2,heading_3_weight:t.weight3,heading_2_case:t.case2,heading_3_case:t.case3}}var Y=[{key:"space-grotesk",label:"Space Grotesk",cssVar:"--font-display",category:"sans",italic:!1,italicLoaded:!1},{key:"inter",label:"Inter",cssVar:"--font-body",category:"sans",italic:!0,italicLoaded:!0},{key:"poppins",label:"Poppins",cssVar:"--font-poppins",category:"sans",italic:!0,italicLoaded:!0},{key:"dm-sans",label:"DM Sans",cssVar:"--font-dm-sans",category:"sans",italic:!0,italicLoaded:!0},{key:"sora",label:"Sora",cssVar:"--font-sora",category:"sans",italic:!1,italicLoaded:!1},{key:"oswald",label:"Oswald",cssVar:"--font-oswald",category:"sans",italic:!1,italicLoaded:!1},{key:"archivo",label:"Archivo",cssVar:"--font-archivo",category:"sans",italic:!0,italicLoaded:!0},{key:"outfit",label:"Outfit",cssVar:"--font-outfit",category:"sans",italic:!1,italicLoaded:!1},{key:"manrope",label:"Manrope",cssVar:"--font-manrope",category:"sans",italic:!1,italicLoaded:!1},{key:"big-shoulders",label:"Big Shoulders",cssVar:"--font-big-shoulders",category:"sans",italic:!1,italicLoaded:!1},{key:"michroma",label:"Michroma",cssVar:"--font-michroma",category:"sans",italic:!1,italicLoaded:!1},{key:"fraunces",label:"Fraunces",cssVar:"--font-serif",category:"serif",italic:!0,italicLoaded:!0},{key:"playfair-display",label:"Playfair Display",cssVar:"--font-playfair",category:"serif",italic:!0,italicLoaded:!0},{key:"cormorant",label:"Cormorant",cssVar:"--font-cormorant",category:"serif",italic:!0,italicLoaded:!0},{key:"jetbrains-mono",label:"JetBrains Mono",cssVar:"--font-mono-loaded",category:"mono",italic:!0,italicLoaded:!0}],p=new Map(Y.map(e=>[e.key,e])),Zt={sans:"Sans",serif:"Serif",mono:"Mono"};function go(){return Object.keys(Zt).map(e=>[e,Y.filter(t=>t.category===e)]).filter(([,e])=>e.length>0)}function ho(e){return p.get(e)?.italicLoaded??!1}function po(e){return p.get(e)}var Ce=["heading","heading2","heading3","body","accent","label"],fo={heading:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",body:"Body",accent:"Accent",label:"Labels"},jt=[["font-heading2","heading2"],["font-heading3","heading3"],["font-display","heading"],["font-serif","accent"],["font-mono","label"],["font-body","body"]],Jt=/var\(--size-(headingLarge|headingMedium|headingSmall|accent|body|label)\s*,/,mo={heading:"headingLarge",heading2:"headingMedium",heading3:"headingSmall",accent:"accent",body:"body",label:"label"},Qt={headingLarge:"heading",headingMedium:"heading2",headingSmall:"heading3",accent:"accent",body:"body",label:"label"};function So(e){let t=e?Jt.exec(e):null;return t?Qt[t[1]]??null:en(e)}function en(e){if(!e)return null;let t=e.split(/\s+/).filter(n=>!n.slice(0,n.lastIndexOf(":")+1).includes("&")).map(n=>n.slice(n.lastIndexOf(":")+1));for(let[n,o]of jt)if(t.includes(n))return o;return null}var tn=["heading","heading2","heading3"];function bo(e){return tn.includes(e)}var f={heading:"space-grotesk",heading2:"space-grotesk",heading3:"space-grotesk",body:"inter",accent:"fraunces",label:"jetbrains-mono"};function nn(e){let t=n=>{let o=e?.[n];if(o&&p.has(o))return o;if(n==="heading2"||n==="heading3"){let r=e?.heading;return r&&p.has(r)?r:f.heading}return f[n]};return Object.fromEntries(Ce.map(n=>[n,t(n)]))}function on(e,t){return p.get(e[t])??p.get(f[t])}function S(e,t){return`var(${on(e,t).cssVar})`}var yo=[...new Set(Ce.map(e=>p.get(f[e]).cssVar))],xo=[...new Set(Y.map(e=>e.cssVar))];function _o(e){let t=nn(e);return{"--font-role-heading":S(t,"heading"),"--font-role-heading2":S(t,"heading2"),"--font-role-heading3":S(t,"heading3"),"--font-role-body":S(t,"body"),"--font-role-accent":S(t,"accent"),"--font-role-label":S(t,"label"),fontFamily:"var(--font-role-body)"}}import{jsx as He}from"react/jsx-runtime";var Ae=rn({settings:null,setSettings:()=>{},primeSettings:()=>{},websiteName:null,templateChrome:!1,templateName:null,chromePlaceholder:!1,themeMode:G,setThemeMode:()=>{},themeSwitchShown:!1,setThemeSwitchShown:()=>{},theme:H,setTheme:()=>{},fonts:f,setFonts:()=>{},sizes:z,setSizes:()=>{},cornerRadiusPx:null,setCornerRadiusPx:()=>{},cardShadow:null,setCardShadow:()=>{},shadowColor:null,setShadowColor:()=>{},cardGap:v,setCardGap:()=>{},hoverEffect:null,setHoverEffect:()=>{},headingCompression:T,setHeadingCompression:()=>{},siteWidth:null,setSiteWidth:()=>{},siteGutter:null,blockGap:null,setSiteGutter:()=>{},setBlockGap:()=>{},headingTypography:$,setHeadingTypography:()=>{},heroBackgroundFollowsWidth:null,setHeroBackgroundFollowsWidth:()=>{},photographyGrayscale:null,setPhotographyGrayscale:()=>{},themeFromDocument:!1,selected:!1,setSelected:()=>{},select:()=>{},setSelectHandler:()=>{}});function Ao({children:e,websiteName:t=null,templateChrome:n=!1,templateName:o=null,chromePlaceholder:r=!1,themeMode:l=G,onThemeModeChange:i,themeSwitchShown:u=!1,onThemeSwitchShownChange:c,theme:d=H,onThemeChange:h,fonts:b=f,onFontsChange:y,sizes:x=z,onSizesChange:g,cornerRadiusPx:k=null,onCornerRadiusPxChange:E,cardShadow:ke=null,onCardShadowChange:W,shadowColor:Le=null,onShadowColorChange:K,cardGap:Ie=v,onCardGapChange:X,hoverEffect:Pe=null,onHoverEffectChange:q,headingCompression:Fe=T,onHeadingCompressionChange:Z,siteWidth:Oe=null,onSiteWidthChange:j,siteGutter:Me=null,blockGap:De=null,onSiteGutterChange:J,onBlockGapChange:Q,headingTypography:Ve=$,onHeadingTypographyChange:ee,heroBackgroundFollowsWidth:Ne=null,onHeroBackgroundFollowsWidthChange:te,photographyGrayscale:Ge=null,onPhotographyGrayscaleChange:ne,themeFromDocument:Ue=!1}){let[_,oe]=Re(null),ze=s(a=>oe(dt=>dt??a),[]),[$e,Be]=Re(!1),Ye=s(a=>i?.(a),[i]),We=s(a=>c?.(a),[c]),Ke=s(a=>h?.(a),[h]),Xe=s(a=>y?.(a),[y]),qe=s(a=>g?.(a),[g]),Ze=s(a=>j?.(a),[j]),je=s(a=>J?.(a),[J]),Je=s(a=>Q?.(a),[Q]),Qe=s(a=>te?.(a),[te]),et=s(a=>ne?.(a),[ne]),tt=s(a=>E?.(a),[E]),nt=s(a=>W?.(a),[W]),ot=s(a=>K?.(a),[K]),rt=s(a=>X?.(a),[X]),at=s(a=>q?.(a),[q]),it=s(a=>Z?.(a),[Z]),lt=s(a=>ee?.(a),[ee]),{select:st,setSelectHandler:ut}=F(),re=_?.logoUrl,ae=_?.logoReversed,ie=_?.logoInkIsDark,le=_!==null,ct=ln(()=>({logo:le?{logoUrl:re,logoReversed:ae,logoInkIsDark:ie}:null,placeholder:n||r,wordmark:n?o:t}),[le,re,ae,ie,n,r,o,t]);return He(I.Provider,{value:ct,children:He(Ae.Provider,{value:{settings:_,setSettings:oe,primeSettings:ze,websiteName:t,templateChrome:n,templateName:o,chromePlaceholder:r,themeMode:l,setThemeMode:Ye,themeSwitchShown:u,setThemeSwitchShown:We,theme:d,setTheme:Ke,fonts:b,setFonts:Xe,sizes:x,setSizes:qe,cornerRadiusPx:k,setCornerRadiusPx:tt,cardShadow:ke,setCardShadow:nt,shadowColor:Le,setShadowColor:ot,cardGap:Ie,setCardGap:rt,hoverEffect:Pe,setHoverEffect:at,headingCompression:Fe,setHeadingCompression:it,siteWidth:Oe,setSiteWidth:Ze,siteGutter:Me,blockGap:De,setSiteGutter:je,setBlockGap:Je,headingTypography:Ve,setHeadingTypography:lt,heroBackgroundFollowsWidth:Ne,setHeroBackgroundFollowsWidth:Qe,photographyGrayscale:Ge,setPhotographyGrayscale:et,themeFromDocument:Ue,selected:$e,setSelected:Be,select:st,setSelectHandler:ut},children:e})})}var vo=()=>an(Ae);var sn="Storefront";function Io(e){return e?.trim()||sn}import{forwardRef as un}from"react";import{jsx as gn}from"react/jsx-runtime";var cn={position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,color:"transparent"},dn=un(function({src:t,width:n,height:o,fill:r,priority:l,loading:i,style:u,quality:c,placeholder:d,blurDataURL:h,unoptimized:b,loader:y,overrideSrc:x,...g},k){let E=x??(typeof t=="string"?t:t.src);return gn("img",{ref:k,src:E,width:r?void 0:n,height:r?void 0:o,loading:l?"eager":i??"lazy",fetchPriority:l?"high":void 0,decoding:"async",style:r?{...cn,...u}:{color:"transparent",...u},...g})}),Oo=dn;function Mo(e){return{props:{src:e.overrideSrc??(typeof e.src=="string"?e.src:e.src.src),sizes:e.sizes}}}import{forwardRef as hn}from"react";import{jsx as mn}from"react/jsx-runtime";function pn(e){if(typeof e=="string")return e;let t=e.query?`?${new URLSearchParams(e.query).toString()}`:"",n=e.hash?e.hash.startsWith("#")?e.hash:`#${e.hash}`:"";return`${e.pathname??""}${t}${n}`}var fn=hn(function({href:t,prefetch:n,replace:o,scroll:r,shallow:l,legacyBehavior:i,passHref:u,locale:c,onClick:d,children:h,...b},y){let x=g=>{d?.(g),!(g.defaultPrevented||b.target==="_blank")&&g.preventDefault()};return mn("a",{ref:y,href:pn(t),onClick:x,...b,children:h})}),Go=fn;var ve=["instagram","facebook","tiktok","youtube","x","linkedin","pinterest","whatsapp"],Sn={instagram:"Instagram",facebook:"Facebook",tiktok:"TikTok",youtube:"YouTube",x:"X",linkedin:"LinkedIn",pinterest:"Pinterest",whatsapp:"WhatsApp"},bn={};function $o(e){if(!e||typeof e!="object")return bn;let t={};for(let n of ve){let o=e[n];if(typeof o!="string")continue;let r=o.trim();!r||!/^https?:\/\//i.test(r)||(t[n]=r)}return t}function Bo(e){return ve.flatMap(t=>{let n=e[t];return n?[{platform:t,href:n,label:Sn[t]}]:[]})}var Yo=e=>`${e}_url`;export{Oo as a,Mo as b,Go as c,Y as d,Zt as e,go as f,ho as g,po as h,Ce as i,fo as j,mo as k,So as l,en as m,bo as n,f as o,nn as p,_o as q,Rn as r,F as s,vn as t,In as u,Pn as v,Fn as w,On as x,G as y,Mn as z,xt as A,ge as B,Dn as C,Vn as D,w as E,he as F,Rt as G,Nn as H,Gn as I,A as J,Un as K,zn as L,$n as M,pe as N,Bn as O,fe as P,Yn as Q,Wn as R,Kn as S,Xn as T,qn as U,z as V,vt as W,kt as X,Zn as Y,It as Z,jn as _,Jn as $,Se as aa,Ot as ba,Qn as ca,be as da,Dt as ea,eo as fa,Vt as ga,Nt as ha,ye as ia,v as ja,zt as ka,$t as la,Bt as ma,xe as na,_e as oa,Yt as pa,Te as qa,Wt as ra,to as sa,no as ta,oo as ua,ro as va,T as wa,Ee as xa,ao as ya,io as za,$ as Aa,D as Ba,V as Ca,Xt as Da,qt as Ea,B as Fa,lo as Ga,so as Ha,uo as Ia,se as Ja,En as Ka,Ao as La,vo as Ma,sn as Na,Io as Oa,ve as Pa,Sn as Qa,bn as Ra,$o as Sa,Bo as Ta,Yo as Ua};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createContext as d,useContext as n}from"react";import{jsx as a}from"react/jsx-runtime";var i={connected:!1,ownsDocument:!0,send:()=>{},subscribe:()=>()=>{},address:{search:()=>"",show:()=>{},load:()=>{},reload:()=>{}}},s=d(i);function y({host:o,children:t}){return a(s.Provider,{value:o,children:t})}function f(){return n(s)}function u(o){let t=new Set;return{host:{connected:!0,ownsDocument:!1,send:((e,r)=>{o.onMessage({type:e,...r})}),subscribe(e){return t.add(e),()=>{t.delete(e)}},address:o.address},deliver:e=>{for(let r of[...t])r(e)}}}export{y as a,f as b,u as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Gc as l}from"./chunk-C2CHF6AL.js";import{d as s}from"./chunk-6CP4D6VJ.js";var n=()=>Promise.reject(new l("unavailable","This editor's backend keeps no section templates.")),a={list:()=>Promise.resolve([]),get:()=>Promise.resolve(null),ensure:n,save:n,update:n,rename:n,remove:n},o=()=>s().sectionTemplates??a,p={list:()=>o().list(),get:t=>o().get(t),ensure:(t,e,r)=>o().ensure(t,e,r),save:(t,e)=>o().save(t,e),update:(t,e)=>o().update(t,e),rename:(t,e)=>o().rename(t,e),remove:t=>o().remove(t)};var i=new Map;async function c(t,e){try{return(await s().site.get({siteId:e})).slug?.trim()||null}catch(r){return console.warn("[editor-site-slug] could not resolve the site slug",r),null}}function f(t,e){let r=i.get(e);return r||(r=c(t,e),i.set(e,r),r.catch(()=>{i.get(e)===r&&i.delete(e)})),r}export{p as a,f as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Aa as It,Ab as En,Ae as he,Bb as xn,Ca as ce,Da as Ft,Ga as Ht,Ia as Z,Ib as j,Kh as Vn,La as At,Ma as Ot,Mg as zn,Na as Lt,O as Ct,Oa as Bt,Ob as J,Pa as Dt,Pe as On,Qa as Wt,Qe as Ln,Qg as Mn,Ra as Gt,Re as Bn,Sa as zt,Ta as Mt,Td as Hn,Ue as Dn,Ya as Vt,Zb as We,Zf as Wn,ab as Ut,hb as $t,ib as Kt,jb as Xt,kb as Yt,lb as de,mb as qt,mf as G,nd as kn,ob as Le,od as Nn,pb as ue,pd as In,pe as Ge,qb as Zt,rb as jt,ua as kt,ud as Fn,vd as S,ze as An}from"./chunk-C2CHF6AL.js";import{b as _n}from"./chunk-HVOO2GNE.js";import{$ as ln,B as Jt,Ba as wn,C as Qt,Ca as Tn,D as en,Da as vn,E as tn,Ea as Cn,F as nn,Fa as Pn,Ia as Rn,Ma as F,Na as Gn,V as on,W as an,X as sn,Y as rn,aa as Be,ba as cn,ca as dn,d as Pt,da as un,e as Rt,f as Et,g as xt,ga as hn,h as L,ha as pn,i as He,j as Ae,ka as mn,la as fn,n as K,na as gn,o as Oe,p as _t,r as Nt,ra as yn,wa as De,xa as bn,za as Sn}from"./chunk-ENDWECYV.js";var ko=".sf-editor #preview-frame",X=()=>document.querySelector(ko);function mr(e){Nt()||requestAnimationFrame(()=>{X()?.contentDocument?.querySelector(`[data-puck-component="${CSS.escape(e)}"]`)?.scrollIntoView({behavior:"smooth",block:"start"})})}function fr(e,t){let n=X()?.contentWindow;if(!n)return;let o={id:e,index:t};n.dispatchEvent(new CustomEvent(Vn,{detail:o}))}function gr(){requestAnimationFrame(()=>{X()?.contentWindow?.scrollTo({top:0,behavior:"smooth"})})}function Un(e,{passes:t=[150,400],onPinned:n}={}){let o=0,r=!1,a=[],i=()=>{let l=X(),p=l?.contentWindow,h=l?.contentDocument;if(!p||!h)return!1;let C=e(p,h);if(C==null)return!1;if(p.scrollTo({left:p.scrollX,top:C,behavior:"instant"}),!r){r=!0,n?.();for(let T of t)a.push(setTimeout(i,T))}return!0},d=()=>{!i()&&o++<150&&a.push(setTimeout(d,32))};return d(),()=>a.forEach(clearTimeout)}function yr(e){return Un((t,n)=>{let o=n.querySelector(`[data-puck-component="${CSS.escape(e)}"]`);return o?t.scrollY+o.getBoundingClientRect().top:null})}function br(e){return Un((t,n)=>{if(!n.querySelector("[data-puck-component]"))return null;let o=Math.max(n.documentElement.scrollHeight,n.body?.scrollHeight??0);return o<=n.documentElement.clientHeight?null:o},{passes:[150,400,800,1300,2e3],onPinned:e})}import{useEasel as mt}from"efficient-easel/easel";import{useEffect as Ps,useRef as yo,useState as ke}from"react";import{useState as Kn}from"react";import{SettingsField as Io}from"efficient-easel/panel";import{jsx as Q,jsxs as ze}from"react/jsx-runtime";function No(e){return e===1?"1 color theme":`${e} color themes`}function $n({count:e,onCancel:t,onConfirm:n}){return Q("div",{className:"sf-cleardlg-veil",role:"dialog","aria-modal":"true","aria-labelledby":"sf-clear-colours-title",children:ze("div",{className:"sf-cleardlg",children:[Q("h2",{id:"sf-clear-colours-title",className:"sf-cleardlg-title",children:"Clear this site\u2019s colors?"}),ze("p",{className:"sf-cleardlg-body",children:["This site has ",No(e)," of its own. Clearing takes them away and puts back the four the shop supplies."]}),Q("p",{className:"sf-cleardlg-final",children:"This cannot be undone."}),ze("div",{className:"sf-cleardlg-btns",children:[Q("button",{type:"button",onClick:t,className:"sf-cleardlg-btn",children:"Cancel"}),Q("button",{type:"button",onClick:n,className:"sf-cleardlg-btn sf-cleardlg-btn--danger",children:"Clear colors"})]})]})})}import{Fragment as Lo,jsx as z,jsxs as Yn}from"react/jsx-runtime";var Fo=On("the row's whole content is an action; the gutter names a subject and this row has none \u2014 the button's label is the name GG, 2026-09-23");function Ho(){return z("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:z("path",{d:"M12 5v14M5 12h14"})})}var Xn="Reset color",Ao={selected:0,themes:[]};function Oo(e){e(Ao)}function Me({value:e,onChange:t}){let n=e?.themes??[],o=n.length===0,r=Jt(e),[a,i]=Kn(!1),[d,l]=Kn(null),p=(s,g)=>{t({...r,themes:r.themes.map((v,I)=>I===s?g:v)})},h=tn(r).accent,C=new Set(r.themes.map(s=>s.brandInk).filter(Boolean)),T=Qt.filter(s=>!C.has(s)).map(s=>en(h,s)),m=[...r.themes,...T],w=s=>{if(s<r.themes.length)return t({...r,selected:s});let g=[...r.themes,m[s]];t({...r,themes:g,selected:g.length-1})},R=()=>{let s=[...r.themes,{...nn(r.themes[r.selected])}];t({...r,themes:s,selected:s.length-1}),l(s.length-1)};return Yn(Lo,{children:[o?null:z(Io,{label:Xn,icon:Ln(Fo),labelId:"sf-theme-reset",action:z(S,{label:Xn,what:"change",onClear:()=>i(!0)})}),a&&z($n,{count:n.length,onCancel:()=>i(!1),onConfirm:()=>{i(!1),Oo(t)}}),z("div",{className:"sf-theme-list",role:"radiogroup","aria-label":"Theme",children:m.map((s,g)=>z(Nn,{index:g,colors:s,selected:g===r.selected,open:d===g&&g<r.themes.length,editable:g<r.themes.length,onPick:()=>w(g),onEdit:()=>l(v=>v===g?null:g),onChangeColors:v=>p(g,v)},g))}),Yn("button",{type:"button",onClick:R,className:"sf-theme-add",children:[z(Ho,{}),"Add new theme"]})]})}import{SettingsField as ga}from"efficient-easel/panel";import{SquareIcon as ya}from"efficient-easel/icons";import{useEffect as me,useId as Ko,useRef as $e,useState as Ke}from"react";import{FieldSelect as Xo,InspectorField as Yo}from"efficient-easel/fields";import{SettingsField as so,SettingsGroup as qo}from"efficient-easel/panel";import{StylesIcon as Zo,TextColorIcon as jo,TypeIcon as Jo}from"efficient-easel/icons";import{useEasel as Qo}from"efficient-easel/easel";import{ColourSwatchRow as Bo}from"efficient-easel/text-styles";import{jsx as qn}from"react/jsx-runtime";function Zn({value:e,label:t,colors:n,onChange:o}){let r=e===null,a=e||void 0,i=n.find(l=>l.key===a),d=i?i.value:a&&/^#[0-9a-f]{6}$/i.test(a)?a:void 0;return qn("div",{className:"sf-part-ink",children:qn(Bo,{value:a,hex:d,colours:n,label:t,followsWord:r?"Mixed":"Follows the style",anyWord:"Any color",onChange:l=>o(l===a&&i?null:l)})})}import{COPY_CELLS as pe,CopyBox as Do}from"efficient-easel/copy";import{PaddingYIcon as Wo,WidthIcon as Go}from"efficient-easel/icons";import{jsx as Ve,jsxs as Uo}from"react/jsx-runtime";var zo=["left","center","right","justify"],Mo=["bold","italic","underline","strike","link","sup","sub"],Vo=["bullet","number"];function jn({text:e,onTextChange:t,multiline:n,markup:o=!0,styled:r=!0,style:a,base:i,setValue:d,colors:l,placeholder:p,ariaLabel:h,head:C}){let T=jt(a),m=a.size??i.sizePx,w=[{...pe.fontSize,value:a.size,styleValue:Math.round(i.sizePx),onChange:s=>d({size:s??null})},{...pe.lineHeight,value:T.lineHeight,styleValue:i.lineRatio,onChange:s=>d(s===void 0?{lineHeight:null,line:null}:{lineHeight:s})},{...pe.letterSpacing,scale:m,value:T.letterSpacingEm,styleValue:i.letterEm,onChange:s=>d(s===void 0?{letterSpacing:null,letter:null}:{letterSpacing:s})},{...pe.paragraphSpacing,value:a.paragraphSpacing,styleValue:0,onChange:s=>d({paragraphSpacing:s??null})},{key:"padding",name:"Padding",icon:Ve(Wo,{}),unit:"px",step:Xt,shiftStep:10,min:$t,max:Kt,value:a.padding,styleValue:i.paddingPx,onChange:s=>d({padding:s??null})},{key:"width",name:"Width",icon:Ve(Go,{}),unit:"px",step:qt,shiftStep:100,min:Yt,max:de,value:a.width,styleValue:i.widthPx,onChange:s=>d({width:s??null})}],R=o?[...Mo,...n?Vo:[]]:[];return Uo("div",{className:"sf-part-textbox",children:[C,Ve(Do,{value:e,onChange:t,multiline:n,placeholder:p,ariaLabel:h,rules:Ft,tools:R,colors:o?l:[],align:r?{value:a.align??i.align,allow:zo,onChange:s=>d({align:s})}:void 0,letterCase:r?{value:a.case??"",onChange:s=>d({case:s||null})}:void 0,cells:r?w:void 0})]})}function Jn(e,t){let n=Dt(e);return n?.control==="textList"?t.rowKey===(n.itemKey??"text")?Wn(n,t.index):null:Wt(e)?.[t.rowKey]??null}function Qn(e,t,n){let o=e.node.props,{key:r,row:a}=ce(e.propKey),i=a?Mt(o,r,a,e.kind,t):Bt(o,r,e.kind,t);return i?(n(e.zone,e.index,{...e.node,props:i}),!0):!1}var $o={CollectionCard:"product",FooterMenu:"menu",Gallery:"product",GalleryItem:"product",ProductGrid:"product",ProductHero:"product",SpecTable:"product",Events:"blog",FeaturedCover:"blog",LongRead:"blog",SubscribeBlogs:"blog"},eo={product:"Synced from the product.",blog:"Synced from the blog post.",menu:"Synced from the site menu."},to="Open",no={product:{type:"storefront-editor:open-product",needsSlug:!0},blog:{type:"storefront-editor:open-post",needsSlug:!0},menu:{type:"storefront-editor:open-menus",needsSlug:!1}};function Ue(e){let n=e?.source?.slug;return typeof n=="string"&&n.length>0?n:void 0}function oo(e){return $o[e]??null}import{Fragment as ge,jsx as c,jsxs as y}from"react/jsx-runtime";var ea={400:"Regular",500:"Medium",600:"Semibold",700:"Bold"},ro=[{key:"font",label:"Font",group:"Style"},{key:"color",label:"Color",group:"Style"}],ta=[...new Set(ro.map(e=>e.group))],na={font:c(Jo,{}),color:c(jo,{})};function fe(e){return e.kind==="role"?Ae[e.role]:e.kind==="custom"?"Custom":null}var oa=e=>e.kind==="role"?`role:${e.role}`:e.kind;function aa(e){let t=e.role;return t&&He.includes(t)?{kind:"role",role:t}:null}function sa(e,t){if(!e)return{kind:"unread"};let{faceRole:n,base:o}=e;if(t[n]===o.fontKey)return{kind:"role",role:n};let r=Object.keys(t).filter(a=>t[a]===o.fontKey);return r.length===1?{kind:"role",role:r[0]}:{kind:"custom"}}function Xe(e,t,n,o){return aa(Le(e,t))??sa(n,o)}function Ei(e,t,n,o){return fe(Xe(e,t,n,o))}function Ye(e,t){if(!e.length)return null;let n=t(e[0]);return e.every(o=>t(o)===n)?n:null}function ra(e){return Object.values(e).filter(t=>t!==void 0).length}function ia(e,t){let n=e.style[t];return t==="color"?n??"":n!==void 0?String(n):e.base.fontKey}function io({face:e,base:t,onPick:n}){let[o,r]=Ke(!1),a=$e(null),i=$e(null),d=Ko();me(()=>{if(!o)return;let h=C=>{a.current&&!a.current.contains(C.target)&&r(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o]);let l=e.kind==="role"?e.role:null,p=h=>{n(h),r(!1),i.current?.focus()};return y("div",{className:"sf-part-style-pick",ref:a,children:[y("button",{ref:i,type:"button",className:"sf-part-style-trigger","aria-expanded":o,"aria-controls":d,"aria-label":`Follows ${fe(e)??"no style"} \u2014 change`,onClick:()=>r(h=>!h),onKeyDown:h=>{h.key==="Escape"&&o&&(h.preventDefault(),r(!1))},children:[c("span",{className:"sf-part-style-name",style:{fontFamily:t?.fontKey?`var(${L(t.fontKey)?.cssVar})`:void 0,fontWeight:t?.weight},children:fe(e)}),c("span",{className:"sf-part-style-sign","aria-hidden":"true"})]}),o&&y("div",{className:"sf-multi-menu sf-part-style-menu",id:d,role:"listbox",onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),r(!1),i.current?.focus())},children:[y("button",{type:"button",role:"option","aria-selected":l===null,className:`sf-part-style-option${l===null?" is-on":""}`,onClick:()=>p(null),children:[c("span",{className:"sf-part-style-option-name",children:"No style"}),c("span",{className:"sf-note",children:"Section\u2019s own"})]}),He.map(h=>c("button",{type:"button",role:"option","aria-selected":l===h,className:`sf-part-style-option${l===h?" is-on":""}`,onClick:()=>p(h),children:c("span",{className:"sf-part-style-option-name",style:{fontFamily:`var(--font-role-${h})`},children:Ae[h]})},h))]})]})}function la({parts:e,onEditStyle:t,onClearAll:n,onFollowStyle:o,kindLabel:r}){let i=Ye(e,C=>oa(C.face))?e[0].face:null,d=i?fe(i):null,l=i&&i.kind!=="unread"?e[0].base:null,p=e.reduce((C,T)=>C+ra(T.style),0),h=l?L(l.fontKey)?.label:void 0;return y("div",{className:`sf-part-style${p?" has-overrides":""}`,children:[c("div",{className:"sf-part-style-caption",children:"Style"}),e.length>1&&y("div",{className:"sf-part-style-count",children:[e.length," selected"]}),e.length===1&&r&&y("div",{className:"sf-part-style-count",children:[r," \xB7 every row"]}),d&&l?y(ge,{children:[o&&i?c(io,{face:i,base:l,onPick:o}):c("div",{className:"sf-part-style-name",style:{fontFamily:h?`var(${L(l.fontKey)?.cssVar})`:void 0,fontWeight:l.weight},children:d}),c("div",{className:"sf-part-style-meta",children:[h,`${Math.round(l.sizePx)} px`,ea[l.weight]].filter(Boolean).join(" \xB7 ")})]}):c("div",{className:"sf-part-style-name",children:"Mixed styles"}),y("div",{className:"sf-part-style-top",children:[d?p?y(ge,{children:[y("span",{className:"sf-part-chip",children:[p," changed"]}),c("button",{type:"button",className:"sf-part-link",onClick:n,children:"Clear"})]}):c("span",{className:"sf-part-style-state",children:"This text follows the site style."}):c("span",{className:"sf-part-style-state",children:"Changes apply to all selected."}),c("span",{className:"sf-part-style-gap"}),d&&t&&c("button",{type:"button",className:"sf-part-link",onClick:t,children:"Edit"})]})]})}function ca({sectionName:e,onBack:t,textEditor:n,styleRow:o,children:r}){return y("div",{className:"sf-part-panel",children:[y("button",{type:"button",className:"sf-part-back",onClick:t,children:[c(ye,{}),y("span",{children:["All of ",e]})]}),n,o,r]})}function ye(){return c("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c("path",{d:"M15 5 8 12l7 7"})})}function lo({source:e,slug:t}){let n=_n(),o=no[e],r=!o.needsSlug||!!t;return c("div",{className:"sf-note sf-note--source",children:y("p",{className:"sf-field-hint",children:[eo[e],r?y(ge,{children:[" ",c("button",{type:"button",className:"sf-source-open",onClick:()=>{o.type==="storefront-editor:open-menus"?n.send(o.type):t&&n.send(o.type,{slug:t})},children:to})]}):null]})})}var ao=4,da=120;function ua({region:e,sizePx:t,face:n,base:o,onFollowStyle:r,source:a,slug:i,onBack:d}){let l=e.follows;return y("div",{className:"sf-note",children:[c("p",{children:c("strong",{children:e.label})}),y("p",{children:["Its size follows Site styles \u25B8 ",l,t?` \u2014 ${Math.round(t)}px right now`:"","."]}),r?y(ge,{children:[c(so,{label:"Style",icon:c(Zo,{}),children:c(io,{face:n,base:o,onPick:r})}),y("p",{className:"sf-field-hint",children:["Every ",e.label.toLowerCase()," in this section follows it. The face and the size change; the letter case is the section\u2019s own and stays as it is."]})]}):c("p",{className:"sf-field-hint",children:"Only the size follows a site style. This section sets its own font, weight and letter case."}),a?c(lo,{source:a,slug:i}):null,y("button",{type:"button",className:"sf-part-back",onClick:d,children:[c(ye,{}),c("span",{children:"Back to the page"})]})]})}function ha({onBack:e}){return y("div",{className:"sf-note",children:[c("p",{children:c("strong",{children:"This part is no longer here."})}),c("p",{children:"The section it belonged to has been changed or removed."}),y("button",{type:"button",className:"sf-part-back",onClick:e,children:[c(ye,{}),c("span",{children:"Back to the page"})]})]})}function pa({onBack:e,partId:t,why:n}){return y("div",{className:"sf-note",children:[c("p",{children:c("strong",{children:"This part's settings did not open."})}),c("p",{children:"The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead."}),c("p",{className:"sf-note-detail",children:y("code",{children:[t," \u2014 ",n]})}),y("button",{type:"button",className:"sf-part-back",onClick:e,children:[c(ye,{}),c("span",{children:"Back to the page"})]})]})}function ma({nodeId:e,propKey:t,onBack:n,onEditStyle:o}){let{getItemById:r,getSelectorForId:a,config:i}=Qo(u=>u),d=Fn(),{partStyle:l}=It(),{fonts:p}=F(),[h,C]=Ke({}),T=$e(null),m=r(e),w=a(e),R=m?i.components[m.type]:void 0,{key:s,row:g}=ce(t),v=R?.fields?.[s],I=g?Jn(v,g):v,D=Vt(e,t),_=m?.props??{},W=At(I),gt=Dn(I),yt=Ut(I),oe=m?oo(m.type):null,E=g?Gt(_[s],g):_[s],M=!!g&&!(Array.isArray(_[s])&&g.index<_[s].length);me(()=>{T.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[D]);let[x,bt]=Ke(0);me(()=>bt(0),[D]);let Ne=!!m&&!M&&(!w||!I);me(()=>{if(!Ne||x>=ao)return;let u=setTimeout(()=>bt(P=>P+1),da);return()=>clearTimeout(u)},[Ne,x]);let wo=Ne&&x<ao;if(!m||M)return c(ha,{onBack:n});let ae=Mn(m.type),St=ae?zn(ae,t):null;if(ae&&St){let u=l?.partId===D?l:null,P=ae[St],N=P.writable===!0&&!!w,H=k=>{w&&d.replaceComponent(w.zone,w.index,{...m,props:ue(_,t,"role",k)})};return c(ua,{region:P,sizePx:u?.base.sizePx??null,face:Xe(_,t,u,p),base:u?.base??null,onFollowStyle:N?H:void 0,source:oe,slug:Ue(_),onBack:n})}if(!w||!I)return wo?c("div",{className:"sf-note","aria-busy":"true"}):c(pa,{onBack:n,partId:D,why:w?"no field":"no selector"});let se=u=>{d.replaceComponent(w.zone,w.index,{...m,props:u})},Ie=u=>{if(Z(u).hidden!==Z(E).hidden||!W){let N=g?zt(_,s,g,u):{..._,[s]:u};N&&se(N);return}Qn({node:m,propKey:t,kind:W,zone:w.zone,index:w.index},Z(u).text,d.replaceComponent)},To=E,re=xn(m?.type,t),vo=Le(_,re),ie=l?.partId===D?l:null,A=[{partKey:re,face:Xe(_,re,ie,p),sizeGroup:ie?.sizeGroup??null,base:ie?.base??fa,style:vo}],Co=Ye(A,u=>u.sizeGroup),wt=kt(ie?.inks),le=(u,P)=>{let N=_;for(let H of A)N=ue(N,H.partKey,u,P);se(N)},Po=u=>le("role",u),Ro=()=>{let u=_;for(let P of A)u=Zt(u,P.partKey);se(u)},Eo=u=>{let P=_;for(let N of A)for(let[H,k]of Object.entries(u))P=ue(P,N.partKey,H,k??null);se(P)},xo=(u,P)=>{let N=A.some(O=>O.style[u]!==void 0),H=Ye(A,O=>ia(O,u)),k=H===null,$=`sf-part-${e}-${t}-${u}`;return u==="color"?c(Zn,{value:k?null:String(H),label:P,colors:wt,onChange:O=>le("color",O)},u):c(so,{label:P,icon:na[u],className:"sf-part-field",changed:N,htmlFor:$,action:N?c(S,{label:P,onClear:()=>le(u,null)}):void 0,children:u==="font"?c(Xo,{id:$,ariaLabel:P,value:!k&&L(String(H))?String(H):void 0,placeholder:k?"Mixed":"Site style",options:Pt.map(O=>({label:O.label,value:O.key})),onChange:O=>le("font",O||null)}):null},u)},Tt=W==="text"||W==="textarea",{text:vt,hidden:V}=Z(E),U=I?.[Ht]?.label??t,_o=y("div",{className:"sf-field-head",children:[c(Bn,{}),c("span",{className:"sf-field-label sf-field-label--inline",children:U}),Tt&&c("button",{type:"button",className:"sf-field-eye","aria-pressed":V,"aria-label":V?`Show ${U} on the slide`:`Hide ${U} on the slide`,title:V?`Show ${U} on the slide`:`Hide ${U} on the slide`,onClick:()=>Ie({text:vt,hidden:!V}),children:V?c(Ge,{name:"eye-off",size:14}):c(Ge,{name:"eye",size:14})})]}),Fe=!gt&&yt;return y(ca,{sectionName:R?.label??m.type,onBack:n,textEditor:y("div",{ref:T,className:"sf-part-text",children:[W?c(jn,{text:vt,onTextChange:u=>Ie(Tt?{text:u,hidden:V}:u),multiline:Ot(W),markup:W!=="plainText",styled:Fe,style:A[0].style,base:A[0].base,setValue:Eo,colors:wt.map(u=>({name:u.key,label:u.name,value:u.value})),placeholder:Lt(I),ariaLabel:U,head:_o}):c(Yo,{field:I,name:t,value:To,onChange:Ie,id:`sf-part-${e}-${t}`}),Fe&&W&&Co===null&&c("p",{className:"sf-field-hint",children:"Fixed size \u2014 the site\u2019s Text setting doesn\u2019t resize this."})]}),children:[oe&&c(lo,{source:oe,slug:Ue(_)}),Fe&&ta.map(u=>{let P=ro.filter(k=>k.group===u),N=P.filter(k=>A.some($=>$.style[k.key]!==void 0)).length,H=`sf-part-g-${e}-${t}-${u.replace(/\W+/g,"-")}`;return y(qo,{id:H,title:u,open:h[u]!==!0,onToggle:k=>C($=>({...$,[u]:!k})),count:N,children:[c(la,{parts:A,onEditStyle:o,onClearAll:Ro,onFollowStyle:Po,kindLabel:En[re]}),P.map(k=>xo(k.key,k.label))]},u)})]})}var fa={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:de};import{jsx as be}from"react/jsx-runtime";var ba="Applies to panels, cards, inputs and buttons. Round things \u2014 color swatches, switches, status dots \u2014 stay round.",qe="Corners",Sa="Not set";function Ze({value:e,onChange:t,showHint:n=!0}){let o=e===null;return be(ga,{label:qe,icon:be(ya,{}),value:o?Sa:`${e}px`,changed:!o,action:o?null:be(S,{label:qe,what:"change",onClear:()=>t(null)}),hint:n?ba:void 0,children:be(G,{min:Be,max:cn,step:1,value:e??Be,readout:!1,ariaLabel:qe,onChange:t})})}import{SettingsField as wa,SettingsSegmented as Ta}from"efficient-easel/panel";import{ShadowIcon as va}from"efficient-easel/icons";var B="Not set";import{jsx as ee}from"react/jsx-runtime";var co={none:"None",soft:"Soft",lifted:"Lifted"},Ca="Applies to cards \u2014 products, brands, journal entries and filter cells. Round things like swatches and status dots are never shadowed.",Pa={none:"none",soft:"0 1px 1px rgba(20, 20, 22, 0.10), 0 2px 4px -1px rgba(20, 20, 22, 0.14)",lifted:"0 1px 2px rgba(20, 20, 22, 0.10), 0 4px 7px -2px rgba(20, 20, 22, 0.30)"},Ra={labelsPx:90.25,widestLabelPx:34.6};function je({value:e,onChange:t,showHint:n=!0}){let o=e===null,r=e??pn;return ee(wa,{label:"Card shadow",icon:ee(va,{}),value:o?B:co[e],changed:!o,action:o?void 0:ee(S,{label:"Card shadow",what:"change",onClear:()=>t(null)}),hint:n?Ca:void 0,children:ee(Ta,{options:hn.map(a=>({id:a,label:co[a],icon:ee("span",{className:"sf-shadow-chip",style:{boxShadow:Pa[a]}})})),value:r,ariaLabel:"Card shadow",fit:Ra,onChange:t})})}import{SettingsField as Ea}from"efficient-easel/panel";import{ShadowIcon as xa}from"efficient-easel/icons";import{Fragment as ka,jsx as Je,jsxs as Na}from"react/jsx-runtime";var _a="Most useful on a dark theme, where a black shadow cannot be seen. Also used by the Lift hover, even with the card shadow off.";function Qe({value:e,onChange:t,showHint:n=!0}){let o=e===null;return Je(Ea,{label:"Shadow color",icon:Je(xa,{}),changed:!o,action:Na(ka,{children:[kn({value:e??gn,onChange:t,label:"Shadow color",caption:o?B:void 0}),o?null:Je(S,{label:"Shadow color",what:"change",onClear:()=>t(null)})]}),hint:n?_a:void 0})}import{SettingsField as Ia}from"efficient-easel/panel";import{AlignSeparateIcon as Fa}from"efficient-easel/icons";import{jsx as Se}from"react/jsx-runtime";var Ha="The space between the blocks inside a row, a grid or a box. Not set means each one keeps the spacing it already has.",et="Block gap",Aa=An.Grid;function tt({value:e,onChange:t,showHint:n=!0}){let o=e===null;return Se(Ia,{label:et,labelId:"sf-block-gap",icon:Se(Fa,{}),value:o?"Not set":`${e}px`,changed:!o,action:o?void 0:Se(S,{label:et,what:"change",onClear:()=>t(null)}),hint:n?Ha:void 0,children:Se(G,{min:he.min,max:he.max,step:he.step,value:o?Aa:e,readout:!1,ariaLabel:et,onChange:t})})}import{SettingsField as Oa,SettingsSegmented as La}from"efficient-easel/panel";import{HoverIcon as Ba}from"efficient-easel/icons";import{jsx as we}from"react/jsx-runtime";var uo={none:"None",lift:"Lift",highlight:"Highlight"},Da="What a card does when a shopper points at it \u2014 or taps it, on a phone. Highlight is the effect your cards already use.";function nt({value:e,onChange:t,showHint:n=!0}){let o=e===null,r=e??fn;return we(Oa,{label:"Hover effect",icon:we(Ba,{}),value:o?B:uo[e],changed:!o,action:o?void 0:we(S,{label:"Hover effect",what:"change",onClear:()=>t(null)}),hint:n?Da:void 0,children:we(La,{options:mn.map(a=>({id:a,label:uo[a]})),value:r,ariaLabel:"Hover effect",onChange:t})})}import{SettingsField as Wa,SettingsSegmented as Ga}from"efficient-easel/panel";import{ImageIcon as za}from"efficient-easel/icons";import{jsx as Te}from"react/jsx-runtime";var ot="Hero image",ho=[{followsWidth:!1,label:We.full},{followsWidth:!0,label:We.page}],Ma="Whether the big picture at the top of a page runs edge to edge, or sits inside the page width. The words follow the page width either way.";function at({value:e,onChange:t,showHint:n=!0}){let o=e===null,r=e??!1;return Te(Wa,{label:ot,icon:Te(za,{}),value:o?B:ho.find(a=>a.followsWidth===e).label,changed:!o,action:o?void 0:Te(S,{label:ot,what:"change",onClear:()=>t(null)}),hint:n?Ma:void 0,children:Te(Ga,{options:ho.map(a=>({id:a.followsWidth,label:a.label})),value:r,ariaLabel:ot,onChange:t})})}import{SettingsField as Va,SettingsSegmented as Ua}from"efficient-easel/panel";import{DropIcon as $a}from"efficient-easel/icons";import{jsx as ve}from"react/jsx-runtime";var st="Photography",po=[{grayscale:!1,label:"As shot"},{grayscale:!0,label:"Black and white"}],Ka="Black and white photographs return to color on hover. Wheels and tyres keep their real finish either way.";function rt({value:e,onChange:t,showHint:n=!0}){let o=e===null,r=e??!1;return ve(Va,{label:st,icon:ve($a,{}),value:o?B:po.find(a=>a.grayscale===e).label,changed:!o,action:o?void 0:ve(S,{label:st,what:"change",onClear:()=>t(null)}),hint:n?Ka:void 0,children:ve(Ua,{options:po.map(a=>({id:a.grayscale,label:a.label})),value:r,ariaLabel:st,onChange:t})})}import{SettingsField as Xa}from"efficient-easel/panel";import{PaddingXIcon as Ya}from"efficient-easel/icons";import{jsx as Ce}from"react/jsx-runtime";var it="Side space",qa="Not set",Za=J.default,ja="The room left at the left and right edge of every page.";function lt({value:e,onChange:t,showHint:n=!0}){let o=e===null;return Ce(Xa,{label:it,labelId:"sf-side-space",icon:Ce(Ya,{}),value:o?qa:`${e}px`,changed:!o,action:o?void 0:Ce(S,{label:it,what:"change",onClear:()=>t(null)}),hint:n?ja:void 0,children:Ce(G,{min:J.min,max:J.max,step:J.step,value:e??Za,readout:!1,ariaLabel:it,onChange:t})})}import{SettingsField as Ja}from"efficient-easel/panel";import{WidthIcon as Qa}from"efficient-easel/icons";import{jsx as Pe}from"react/jsx-runtime";var ct="Content width",es="Not set",ts=j.default,ns="The standard width every page on this site renders at.";function dt({value:e,onChange:t,showHint:n=!0}){let o=e===null;return Pe(Ja,{label:ct,labelId:"sf-site-width",icon:Pe(Qa,{}),value:o?es:`${e}px`,changed:!o,action:o?void 0:Pe(S,{label:ct,what:"change",onClear:()=>t(null)}),hint:n?ns:void 0,children:Pe(G,{min:j.min,max:j.max,step:j.step,value:e??ts,readout:!1,ariaLabel:ct,onChange:t})})}import{SettingsField as Ee}from"efficient-easel/panel";import{AccentIcon as os,CaseIcon as as,StylesIcon as ss,TextLinesIcon as fo,TextSizeIcon as te,TextSmallIcon as rs,TypeIcon as is,WeightIcon as ls}from"efficient-easel/icons";import{Fragment as ht,jsx as f,jsxs as Re}from"react/jsx-runtime";var cs=[{role:"heading",title:"Heading 1",group:"heading",step:"headingLarge",base:17,icon:f(te,{})},{role:"heading2",title:"Heading 2",group:"heading",step:"headingMedium",base:15,icon:f(te,{})},{role:"heading3",title:"Heading 3",group:"heading",step:"headingSmall",base:13,icon:f(te,{})},{role:"accent",title:"Accent",step:"accent",base:15,icon:f(os,{})},{role:"body",title:"Body",group:"body",step:"body",base:14,icon:f(fo,{})},{role:"label",title:"Labels",group:"label",step:"label",base:11,icon:f(rs,{})}];var ds=9,Y=500,us=100,hs=80,ps=4,ms=600,fs=700,gs=400,ys="0.18em";function bs({id:e,value:t,onChange:n}){return f("select",{id:e,className:"sf-select w-full min-w-0",value:t,onChange:o=>n(o.target.value),style:{fontFamily:`var(${L(t)?.cssVar??"--font-body"})`},children:Et().map(([o,r])=>f("optgroup",{label:Rt[o],children:r.map(a=>f("option",{value:a.key,children:a.label},a.key))},o))})}function Ss({label:e,icon:t,readout:n,min:o,max:r,step:a,value:i,onChange:d,action:l,hint:p}){return f(Ee,{label:e,icon:t,value:n,action:l,hint:p,children:f("input",{type:"range",min:o,max:r,step:a,value:i,onChange:h=>d(Number(h.target.value)),className:"h-1 w-full cursor-pointer","aria-label":e})})}function ut({label:e,icon:t,value:n,fallback:o,min:r,max:a,step:i,suffix:d="",hint:l,onChange:p}){let h=n===null;return f(Ss,{label:e,icon:t,readout:h?"Auto":`${n}${d}`,min:r,max:a,step:i,value:h?o:n,onChange:p,action:h?null:f(S,{label:e,what:"change",onClear:()=>p(null)}),hint:l})}function mo({label:e,icon:t,options:n,value:o,onChange:r,hint:a,action:i}){return f(Ee,{label:e,icon:t,value:n.find(d=>d.value===o)?.label,hint:a,action:i,children:f("div",{className:"sf-rungs",children:n.map(d=>f("button",{type:"button","aria-pressed":d.value===o,onClick:()=>r(d.value),className:`sf-rung${d.value===o?" is-active":""}`,children:d.label},d.value))})})}var ws=[{value:"authored",label:"As designed"},{value:"sentence",label:"As typed"}],Ts=[{value:"normal",label:"Normal"},{value:"tight",label:"Tight"},{value:"compressed",label:"Compressed"}];function vs({fontKey:e,weight:t,fallbackWeight:n,onWeight:o}){let a=(t??n)>=ms,i=xt(e),d=L(e)?.label??"This face";return f(Ee,{label:"Style",icon:f(ss,{}),value:a?"Bold":"Normal",hint:"Bold is the weight above \u2014 one value, two ways to set it.",children:Re("div",{className:"sf-rungs",children:[f("button",{type:"button","aria-pressed":a,"aria-label":"Bold",title:"Bold",onClick:()=>o(a?gs:fs),className:`sf-rung sf-rung--glyph${a?" is-active":""}`,style:{fontWeight:700},children:"B"}),f("button",{type:"button","aria-pressed":!1,"aria-label":"Italic",disabled:!0,title:i?"Italic is not saved yet \u2014 the theme row has no column for it (card 66162.b).":`${d} is loaded without an italic, so it cannot be set in italic. Slanting it would deform the letters rather than style them.`,className:"sf-rung sf-rung--glyph",style:{fontStyle:"italic"},children:"I"})]})})}function pt({fonts:e,compression:t,headingTypography:n,openRole:o,onOpenRole:r,onFontChange:a,sizes:i,onSizeChange:d,onCompressionChange:l,onHeadingTypographyChange:p,livePx:h,savedRole:C=null}){let T=s=>p({...n,...s}),m=s=>s==="accent"?"weightStrong":s==="heading2"?"weight2":s==="heading3"?"weight3":"weight",w=s=>s==="heading2"?"case2":s==="heading3"?"case3":"case",R=Sn(t);return f("div",{className:"sf-style-list",children:cs.map(s=>{let g=o===s.role;return f(Hn,{styleKey:s.role,label:s.title,icon:s.icon,value:L(e[s.role])?.label??e[s.role],sampleStyle:Cs(s,e,n,R),open:g,onToggle:()=>r(g?null:s.role),saved:C===s.role,children:g&&Re(ht,{children:[f(Ee,{label:"Font",icon:f(is,{}),htmlFor:`sf-font-${s.role}`,action:e[s.role]===Oe[s.role]?null:f(S,{label:"Font",what:"change",onClear:()=>a(s.role,Oe[s.role])}),children:f(bs,{id:`sf-font-${s.role}`,value:e[s.role],onChange:v=>a(s.role,v)})}),s.step&&d&&f(ut,{label:"Size",icon:f(te,{}),value:i[s.step],fallback:s.base*2,min:an,max:sn,step:rn,suffix:"px",hint:i[s.step]===null?"Auto = this style states no size, and text following it keeps the size its section drew.":"The size a text takes when you set it to follow this style. Sections keep their own sizes.",onChange:v=>d(s.step,v)}),(K(s.role)||s.role==="accent")&&Re(ht,{children:[f(ut,{label:"Weight",icon:f(ls,{}),value:n[m(s.role)],fallback:K(s.role)?Y:n.weight??Y,min:wn,max:Tn,step:us,hint:s.role==="accent"?"Auto = the accent phrase takes the heading's own weight.":void 0,onChange:v=>T({[m(s.role)]:v})}),f(vs,{fontKey:e[s.role],weight:n[m(s.role)],fallbackWeight:K(s.role)?Y:n.weight??Y,onWeight:v=>T({[m(s.role)]:v})})]}),K(s.role)&&Re(ht,{children:[f(mo,{label:"Line & text gap",icon:f(fo,{}),options:Ts,value:t,onChange:l,hint:R.lineHeight===void 0?"The built-in spacing.":`Line gap ${R.lineHeight} \xB7 text gap ${R.letterSpacing}em.`,action:t===De?null:f(S,{label:"Line & text gap",what:"change",onClear:()=>l(De)})}),f(mo,{label:"Capitals",icon:f(as,{}),options:ws,value:n[w(s.role)],onChange:v=>T({[w(s.role)]:v}),hint:"The only setting that changes a heading's capitals.",action:n[w(s.role)]==="authored"?null:f(S,{label:"Capitals",what:"change",onClear:()=>T({[w(s.role)]:"authored"})})}),f(ut,{label:"Largest size",icon:f(te,{}),value:n.maxPx,fallback:hs,min:vn,max:Cn,step:ps,suffix:"px",hint:"Caps the biggest heading on the site. Auto = each section's own.",onChange:v=>T({maxPx:v})})]})]})},s.role)})})}function Cs(e,t,n,o){let r=Math.max(ds,e.base),a={fontFamily:`var(${L(t[e.role])?.cssVar??"--font-body"})`,fontSize:`${r.toFixed(1)}px`,lineHeight:1.15};return K(e.role)?(a.fontWeight=n.weight??Y,a.textTransform=n.case==="sentence"?"none":"uppercase",o.letterSpacing!==void 0&&(a.letterSpacing=`${o.letterSpacing}em`)):e.role==="accent"?(a.fontWeight=n.weightStrong??n.weight??Y,o.letterSpacing!==void 0&&(a.letterSpacing=`${o.letterSpacing}em`)):e.role==="label"&&(a.textTransform="uppercase",a.letterSpacing=ys),a}import{SettingsTabs as Rs}from"efficient-easel/panel";import{ContrastIcon as Es,NoteIcon as xs,SettingsIcon as _s,TypeIcon as ks}from"efficient-easel/icons";function go(e){switch(e.status){case"saved":return null;case"failed":return{msg:"Not saved. Try again.",tone:"error"};case"skipped":switch(e.reason){case"empty":return null;case"no-token":return{msg:"Not saved. Reload the page.",tone:"error"};case"template":return{msg:"Templates keep their look. Press Save.",tone:"success"}}}}import{Fragment as ne,jsx as b,jsxs as q}from"react/jsx-runtime";var _e="sf-site-styles-tabpanel",Ns=!1,Is="Show hints";function Fs({shown:e,onChange:t}){return b("div",{className:"sf-hints",children:q("button",{type:"button","aria-pressed":e,onClick:()=>t(!e),className:`sf-rung sf-hints-toggle${e?" is-active":""}`,children:[b(xs,{size:13}),Is]})})}var wc="text",xe=[{id:"basics",label:"Basics",icon:b(_s,{}),htmlId:"sf-site-styles-tab-basics",panelId:_e},{id:"theme",label:"Theme",icon:b(Es,{}),htmlId:"sf-site-styles-tab-theme",panelId:_e},{id:"text",label:"Text",icon:b(ks,{}),htmlId:"sf-site-styles-tab-text",panelId:_e}];function Hs({themeFromDocument:e,persist:t}){let{appState:n,dispatch:o}=mt(p=>p),{theme:r,setTheme:a}=F(),i=n.data,d=i.root?.props??{},l=p=>{if(e){let h={...d,theme:p};o({type:"replaceRoot",root:{...i.root,props:h},recordHistory:!0})}else a(p);t({selected_preset:p.selected,theme_presets:p.themes})};return b(Me,{value:e?d.theme:r,onChange:l})}function As(e,t){let[n,o]=ke(null),r=yo(null),a=JSON.stringify(e),i=yo(t);return i.current=t,Ps(()=>{if(r.current===null){r.current=a;return}if(r.current===a)return;r.current=a;let d=window.setTimeout(()=>o(i.current),700),l=window.setTimeout(()=>o(null),2200);return()=>{window.clearTimeout(d),window.clearTimeout(l)}},[a]),n}function Os({themeFromDocument:e,persist:t}){let{appState:n,dispatch:o}=mt(E=>E),[r,a]=ke(null),{fonts:i,setFonts:d,sizes:l,setSizes:p,headingCompression:h,setHeadingCompression:C,headingTypography:T,setHeadingTypography:m}=F(),w=n.data,R=w.root?.props??{},s=e?_t(R.fonts):i,g=e?on:l,v=e?bn(R.headingCompression):h,I=e?Pn(R.headingTypography):T,D=E=>o({type:"replaceRoot",root:{...w.root,props:{...R,...E}},recordHistory:!0}),_=As({curFonts:s,curCompression:v,curTypography:I},r);return b(pt,{fonts:s,sizes:g,compression:v,headingTypography:I,openRole:r,onOpenRole:a,onFontChange:(E,M)=>{let x={...s,[E]:M};e?D({fonts:x}):d(x),t({heading_font:x.heading,body_font:x.body,accent_font:x.accent,label_font:x.label})},onSizeChange:e?void 0:(E,M)=>{let x={...g,[E]:M};p(x),t({heading_size_large_px:x.headingLarge,heading_size_medium_px:x.headingMedium,heading_size_small_px:x.headingSmall,accent_size_px:x.accent,body_size_px:x.body,label_size_px:x.label})},onCompressionChange:E=>{e?D({headingCompression:E}):C(E),t({heading_compression:E})},onHeadingTypographyChange:E=>{e?D({headingTypography:E}):m(E),t(Rn(E))},livePx:Bs,savedRole:_})}var Ls={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function Bs(e){if(typeof document>"u")return null;let n=(X()?.contentDocument??document).querySelector(Ls[e]);if(!n)return null;let o=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(o)?o:null}function Ds({themeFromDocument:e,persist:t,showHint:n}){let{appState:o,dispatch:r}=mt(m=>m),{cornerRadiusPx:a,setCornerRadiusPx:i}=F(),d=o.data,l=d.root?.props??{},p=l.cornerRadiusPx===void 0?dn[ln(l.cornerStyle)]:un(l.cornerRadiusPx),h=e?p:a,C=m=>r({type:"replaceRoot",root:{...d.root,props:{...l,...m}},recordHistory:!0});return b(Ze,{value:h,onChange:m=>{e?C({cornerRadiusPx:m}):i(m),t({corner_radius_px:m})},showHint:n})}function Ws(e){return{site_width:e}}function Gs({persist:e,showHint:t}){let{siteWidth:n,setSiteWidth:o}=F();return b(dt,{value:n,onChange:a=>{o(a),e(Ws(a),a===null)},showHint:t})}function zs(e){return{block_gap:e}}function Ms(e){return{site_gutter:e}}function Vs({persist:e,showHint:t}){let{siteGutter:n,setSiteGutter:o}=F();return b(lt,{value:n,onChange:a=>{o(a),e(Ms(a),a===null)},showHint:t})}function Us({persist:e,showHint:t}){let{blockGap:n,setBlockGap:o}=F();return b(tt,{value:n,onChange:a=>{o(a),e(zs(a),a===null)},showHint:t})}function $s({persist:e,showHint:t}){let{heroBackgroundFollowsWidth:n,setHeroBackgroundFollowsWidth:o}=F();return b(at,{value:n,onChange:a=>{o(a),e({hero_background_follows_width:a},!0)},showHint:t})}function Ks({persist:e,showHint:t=!0}){return q(ne,{children:[b(Gs,{persist:e,showHint:t}),b(Vs,{persist:e,showHint:t}),b(Us,{persist:e,showHint:t}),b($s,{persist:e,showHint:t})]})}function Xs(e){return{card_shadow:e}}function Ys(e){return e===null?{shadow_color:null}:{shadow_color:yn(e)}}function qs(e){return{hover_effect:e}}function Zs({persist:e,showHint:t=!0}){let{cardShadow:n,setCardShadow:o,shadowColor:r,setShadowColor:a,hoverEffect:i,setHoverEffect:d}=F();return q(ne,{children:[b(je,{value:n,onChange:l=>{o(l),e(Xs(l),!0)},showHint:t}),b(Qe,{value:r,onChange:l=>{a(l),e(Ys(l),l===null)},showHint:t}),b(nt,{value:i,onChange:l=>{d(l),e(qs(l),!0)},showHint:t})]})}function js(e){return{photography_grayscale:e}}function Js({persist:e,showHint:t}){let{photographyGrayscale:n,setPhotographyGrayscale:o}=F();return b(rt,{value:n,onChange:a=>{o(a),e(js(a),!0)},showHint:t})}function Qs({persist:e,showHint:t=!0}){return b(ne,{children:b(Js,{persist:e,showHint:t})})}function Tc(){let{websiteName:e}=F();return e?.trim()||Gn}function er({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:o,tab:r,onTabChange:a}){let{persist:i}=In({themeFromDocument:e,tokenRef:t,siteId:n,onResult:R=>{let s=go(R);s&&o?.(s.msg,s.tone)}}),[d,l]=ke(xe[0].id),p=r!==void 0,h=p?r:d,C=p?a??(()=>{}):l,T=xe.find(R=>R.id===h)??xe[0],[m,w]=ke(Ns);return q(ne,{children:[b(Rs,{items:xe,activeId:T.id,onSelect:C,ariaLabel:"Site styles"}),q("div",{id:_e,role:"tabpanel","aria-labelledby":T.htmlId,children:[h==="basics"&&q(ne,{children:[b(Ds,{themeFromDocument:e,persist:i,showHint:m}),!e&&b(Zs,{persist:i,showHint:m}),!e&&b(Ks,{persist:i,showHint:m}),!e&&b(Qs,{persist:i,showHint:m}),b(Fs,{shown:m,onChange:w})]}),h==="theme"&&b(Hs,{themeFromDocument:e,persist:i}),h==="text"&&b(Os,{themeFromDocument:e,persist:i})]})]})}function Rc(e){return{root:{props:{}},content:[e],zones:{}}}function Ec(e){return(e.content??[])[0]??null}function tr(e){return Array.isArray(e)&&e.length>0&&e.every(t=>!!t&&typeof t=="object"&&typeof t.type=="string"&&typeof t.props=="object")}function nr(e){let t={...e.props,id:Ct(e.type)};for(let[n,o]of Object.entries(t))tr(o)&&(t[n]=o.map(nr));return{type:e.type,props:t}}import{createContext as or,useContext as ar}from"react";import{Fragment as ir,jsx as ft,jsxs as lr}from"react/jsx-runtime";var sr={mirrorHostStyles:!0,css:null,fontHrefs:[]},bo=or(sr);function kc({value:e,children:t}){return ft(bo.Provider,{value:e,children:t})}function rr(){return ar(bo)}function Nc(){let{css:e,fontHrefs:t}=rr();return lr(ir,{children:[t.map(n=>ft("link",{rel:"stylesheet",href:n},n)),e?ft("style",{"data-sf-canvas-css":"",children:e}):null]})}import{createContext as cr,useContext as dr}from"react";import{jsx as ur}from"react/jsx-runtime";var So=cr(void 0);function Ac({metadata:e,children:t}){return ur(So.Provider,{value:e,children:t})}var Oc=()=>dr(So);export{Jn as a,Ue as b,oo as c,Ei as d,lo as e,ma as f,mr as g,fr as h,gr as i,yr as j,br as k,Ns as l,Fs as m,wc as n,xe as o,Tc as p,er as q,Rc as r,Ec as s,nr as t,kc as u,rr as v,Nc as w,Ac as x,Oc as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t={siteSlug:null,shopOrigin:""},i=t;function e(n){i={siteSlug:n.siteSlug?.trim()||null,shopOrigin:(n.shopOrigin??"").trim().replace(/\/+$/,"")}}function u(){return i.siteSlug}function r(){return i.shopOrigin}export{e as a,u as b,r as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as nt,i as me,p as rt,r as ot,t as q}from"./chunk-UBWM4USZ.js";import{c as tt}from"./chunk-RRHBLOH4.js";import{Na as de,Oa as Ze,Ra as Re,Sa as et}from"./chunk-ENDWECYV.js";import{l as Je,u as re}from"./chunk-6CP4D6VJ.js";import{createContext as Qt,useContext as jt,useEffect as Jt,useMemo as pe,useState as at}from"react";function it(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function oe(e,t){if(e.length===0)return null;let n=0;for(let r of e){let o=r.prices?.[t];if(typeof o!="number"||!Number.isFinite(o)||o<=0)return null;n+=o*r.wheels}return n}var Me=4,sr=1,ar={unit:"set",spares:0,spareSide:"left"};function st(e){return e.unit==="single"?1:Me+e.spares}function lr(e,t){return[{partNumber:e.partNumber,wheels:st(t),prices:e.prices}]}function ur(e,t){let n=st(t)-Me;if(n<=0||e.length===0)return e;let r=Xt(e),o=r?r[t.spareSide]:0;return e.map((i,s)=>s===o?{...i,wheels:i.wheels+n}:i)}function Xt(e){let t,n;for(let r=0;r<e.length;r+=1){let o=e[r].hand;if(o!=="left"&&o!=="right")continue;if((o==="left"?t:n)!==void 0)return null;o==="left"?t=r:n=r}return t!==void 0&&n!==void 0?{left:t,right:n}:null}function Yt(e,t){return t.spares>0?`${e} + spare`:e}function cr(e){return e.unit==="single"?"Single":Yt(`Set of ${Me}`,e)}var dr="data-add-to-basket",De=9,Oe="en";function fe(e,t,n=0){return new Intl.NumberFormat(Oe,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:n}).format(e)}import{jsx as tn}from"react/jsx-runtime";var lt="storefront-country",ut=Qt(null);function Zt(e){return ct(e,"catalogue")}function en(e){return ct(e,"money")}function ct(e,t){let n=new Map(e.map(o=>[o.code,o.decimalPlaces])),r=new Map;return(o,i)=>{if(!i)return"";let s=r.get(i);if(!s){let u=n.get(i)??0;s=new Intl.NumberFormat(Oe,{style:"currency",currency:i,minimumFractionDigits:t==="money"?u:0,maximumFractionDigits:u}),r.set(i,s)}return s.format(o)}}function yr({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=pe(()=>t??[],[t]),s=pe(()=>n??[],[n]),u=pe(()=>r||i.find(C=>C.isDefault)?.code||i[0]?.code||"",[r,i]),c=pe(()=>o||s.find(C=>C.isDefault)?.code||s[0]?.code||"",[o,s]),[l,d]=at(c),[f,P]=at(!1);Jt(()=>{let C=re.getItem(lt);C&&s.some(L=>L.code===C)&&d(C),P(!0)},[s]);function w(C){d(C),re.setItem(lt,C)}let h=pe(()=>{let C=s.find(I=>I.code===l)??null,L=C?.currency,N=L&&i.some(I=>I.code===L)?L:u,M=Zt(i),x=en(i);return{country:l,currency:N,setCountry:w,currencies:i,countries:s,activeCountry:C,formatPrice:(I,v)=>M(I,v??N),formatMoney:(I,v)=>x(I,v??N),ready:f}},[l,i,s,u,f]);return tn(ut.Provider,{value:h,children:e})}function dt(){let e=jt(ut);if(!e)throw new Error("useCurrency must be used within a CurrencyProvider");return e}import{createContext as pn,useCallback as _,useContext as gn,useEffect as B,useMemo as vt,useRef as ie,useState as A}from"react";function ft(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var pt="We'll confirm this discount when you place your order.",xr="Confirmed at checkout";function vr(e){return e&&(e.valid||e.deferred)?e.code:void 0}var mt="coupon_code: ";function Sr(e){return!(e instanceof me)||e.status!==400||!e.message.startsWith(mt)?null:e.message.slice(mt.length)}function gt(e,t){return e.map(n=>({qty:n.qty,slug:n.slug,name:`${n.name.lead}${n.name.accent}`.trim(),finish:n.finishName,size:n.size,kind:n.kind,sku:n.sku,pack:n.pack,priceLabel:t(n)}))}var Pe="Price on request",rn="Request a quote";function Fe(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ue(e,t){let n=e?.[t];return Fe(n)?n:null}function Ir(e,t,n,r){let o=Ue(e,n),i=Ue(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function wr(e,t,n,r){if(n==null&&r==null)return!0;let o=Ue(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var on={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function sn(e,t,n){if(!Fe(e))return on;let r=Fe(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function Tr(e,t,n=""){return!e.priced||e.unit==null?Pe:`${n}${fe(e.unit,t)}`}function Nr(e,t){return e.was==null?null:fe(e.was,t)}function an(e,t,n=1){let r=oe(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((s,u)=>s+u.wheels,0),i=Math.min(...e.map(s=>s.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var ln={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function kr(e,t,n,r=1){let o=sn(e.prices[n],e.msrpPrices?.[n],4),i=o.setTotal==null?null:o.setTotal*r;if(!t)return{priced:o.priced,unit:o.unit,isFrom:!0,was:o.was,onSale:o.onSale,setTotal:null,fromSetTotal:i};let s=an(t.components,n,r);return s.priced?{priced:!0,unit:s.unit,isFrom:s.isFrom,was:null,onSale:!1,setTotal:s.setTotal,fromSetTotal:i}:{...ln,fromSetTotal:i}}function un(e,t){return!e.priced||e.unit==null?Pe:`${e.isFrom?"from ":""}${fe(e.unit,t)}`}function _r(e,t){return e.was==null?null:fe(e.was,t)}function Ar(e,t){return!e.priced||e.unit==null?rn:un(e,t)}var cn=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function yt(e){return cn.test(e.trim())}var bt="sf:ga-purchases",dn=20;function Ct(){return typeof window>"u"||window.parent!==window}function ge(...e){try{if(Ct()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function mn(e,t){let n=e.config.find(r=>r.gold)?.label;return{item_id:`${e.slug}|${e.finishName}|${e.size}`,item_name:`${e.name.lead}${e.name.accent}`.trim(),...n?{item_variant:n}:{},price:oe(e.components,t)??0,quantity:e.qty}}function $e(e,t){return e.filter(Le).map(n=>mn(n,t))}function Ur(e){ge("event","view_item",{currency:e.currency,value:e.pricePerSet,items:[{item_id:e.itemId,item_name:e.itemName,...e.variant?{item_variant:e.variant}:{},price:e.pricePerSet,quantity:1}]})}function xt(e,t){let n=$e([e],t);n.length!==0&&ge("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function $r(e){let t=$e(e.lines,e.currency);t.length!==0&&ge("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var ht=new Set;function fn(e){if(ht.has(e))return!1;ht.add(e);try{let t=JSON.parse(re.getItem(bt)??"[]");if(t.includes(e))return!1;re.setItem(bt,JSON.stringify([...t,e].slice(-dn)))}catch{}return!0}function qr(e){let t=e.confirmation;if(Ct()||!fn(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);ge("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:$e(e.lines,n)}),e.adsSendTo&&ge("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}import{jsx as Cn}from"react/jsx-runtime";var yn=400,bn=400,hn=1500;function Le(e){return(e.components?.length??0)>0}function St(e,t){return{code:e,valid:t.valid,deferred:ft(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function Pt(e,t){return oe(e.components,t)}function qe(e,t){let n=Pt(e,t);return n===null?null:n*e.qty}function Et(e){return e!=="tyre"}var Lt=pn(null);function jr({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=dt(),[i,s]=A(t),[u,c]=A([]),[l,d]=A([]),[f,P]=A([]),[w,h]=A(!1),[C,L]=A(!1),[N,M]=A(!1),[x,I]=A(!1),[v,H]=A(null),[W,Q]=A(void 0),b=ie(r),S=ie("");b.current=b.current||r;let[m,K]=A(null),[j,V]=A(!1),[R,J]=A(null),Z=ie(void 0),D=_(()=>s(!0),[]),Ce=_(()=>s(!1),[]),O=_(()=>s(a=>!a),[]);B(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&D()},[D,t]);let xe=_(a=>{I(!0),Et(a)&&M(!0)},[]),ee=N||u.some(a=>Et(a.kind)),ae=x||u.length>0;B(()=>{if(t||!ee||w)return;let a=!0;return q.listWheels().then(p=>{a&&(d(p),h(!0))}),()=>{a=!1}},[t,ee,w]),B(()=>{if(t||!ae||C)return;let a=!0;return q.listBundles().then(p=>{a&&(P(p),L(!0))}),()=>{a=!1}},[t,ae,C]);let U=v?.deliveryOptions??[];B(()=>{U.length!==0&&J(a=>a&&U.some(p=>p.id===a)?a:U[0]?.id??null)},[v]);let G=_(()=>u.filter(Le).flatMap(a=>it(a.components,a.qty)),[u]),le=_(async(a,p)=>{let y=a.trim().toUpperCase();if(!y)return;let g=G();if(g.length===0){K({code:y,valid:!1,message:"Add a wheel to the cart first."});return}V(!0),Z.current=p;try{let T=await q.validateCoupon({code:y,items:g,currency:n,shippingMethodId:R??void 0,customerEmail:p});K(St(y,T))}catch{K({code:y,valid:!1,message:"Could not check that code. Please try again."})}finally{V(!1)}},[G,n,R]),te=_(()=>{K(null),Z.current=void 0},[]),ve=_(a=>{if(!m)return;let{code:p}=m;K(y=>y&&y.code===p?{code:p,valid:!1,refused:!0,message:a}:y)},[m]);B(()=>{if(!m||m.refused)return;let a=m.code,p=g=>g!==null&&g.code===a&&!g.refused,y=setTimeout(async()=>{let g=G();if(g.length===0){K(T=>p(T)?{code:a,valid:!1,message:"Add a wheel to the cart first."}:T);return}V(!0);try{let T=await q.validateCoupon({code:a,items:g,currency:n,shippingMethodId:R??void 0,customerEmail:Z.current});K(ce=>p(ce)?St(a,T):ce)}catch{}finally{V(!1)}},yn);return()=>clearTimeout(y)},[u,n,R]);let Se=m&&!m.refused?m.code:void 0;B(()=>{if(t)return;let a=!0,p=setTimeout(async()=>{let y=G();if(y.length===0){H(null),Q(void 0);return}try{let g=await q.quoteCart({items:y,currency:n,shippingMethodId:R??void 0,couponCode:Se,customerEmail:Z.current||void 0,country:b.current||void 0,subdivision:S.current||void 0});if(!a)return;H(g)}catch{if(!a)return}Q(Se)},bn);return()=>{a=!1,clearTimeout(p)}},[u,n,R,Se,r]),B(()=>{if(t||!i)return;let a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=a}},[i,t]);let E=_(a=>{c(p=>{let y=p.findIndex(g=>g.id===a.id);return y===-1?[...p,a]:p.map((g,T)=>T===y?{...g,qty:Math.min(De,g.qty+a.qty)}:g)}),xt(a,n)},[n]),F=_(a=>{c(p=>p.filter(y=>y.id!==a))},[]),X=_((a,p)=>{let y=Math.max(1,Math.min(De,p));c(g=>g.map(T=>T.id===a?{...T,qty:y}:T))},[]),ze=_(a=>{c(a)},[]),[ue,Ht]=A(null),Ve=ie(null);Ve.current=ue;let $=ie(null),_e=ie(""),Ge=_((a,p)=>{let y=a.trim().toLowerCase();yt(y)&&Ht(g=>g&&g.email===y&&g.firstName===(p??"")?g:{email:y,firstName:p??""})},[]);B(()=>{if(t||!ue)return;let a=gt(u.filter(Le),g=>qe(g,n)===null?Pe:o(qe(g,n),n)),p={email:ue.email,firstName:ue.firstName,currency:n,items:a},y=JSON.stringify(p);if(y!==_e.current)return $.current&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,_e.current=y,q.captureCart(p).catch(g=>{})},hn),()=>{$.current&&(clearTimeout($.current),$.current=null)}},[u,ue,n,t]);let Xe=_(()=>{$.current&&(clearTimeout($.current),$.current=null);let a=Ve.current;a&&(_e.current="",q.captureCart({email:a.email,firstName:a.firstName,currency:n,items:[]}).catch(p=>{}))},[n]),Ye=vt(()=>{let a=u.reduce((k,ne)=>{let Ee=qe(ne,n);return Ee===null?k:k+Ee},0),p=u.some(k=>Pt(k,n)===null),y=u.reduce((k,ne)=>k+ne.qty,0),g=m?.valid?m.effects:void 0,T=g?Math.min(a,Number(g.discountAmount)):0,ce=v?.bundleDiscount??0,Wt=v?.appliedBundles??[],Qe=!!g?.freeShipping,Bt=U.find(k=>k.id===R),je=Qe?0:v?.shipping??Bt?.amount??0,Ae={};for(let k of g?.freeUnits??[])Ae[k.partNumber]=(Ae[k.partNumber]??0)+k.quantity;let zt=v?.tax??null,Vt=v?v.grandTotal:a-T-ce+je;return{sets:y,units:u.reduce((k,ne)=>k+(ne.components??[]).reduce((Ee,Gt)=>Ee+Gt.wheels*ne.qty,0),0),subtotal:a,hasUnpricedLine:p,discount:T,bundleDiscount:ce,appliedBundles:Wt,shipping:je,freeShipping:Qe,freeUnitsByPartNumber:Ae,tax:zt,grand:Vt,repricing:!!m?.refused&&v!==null&&W===m?.code,currency:n}},[u,n,m,U,R,v,W]),Kt=vt(()=>({isOpen:i,open:D,close:Ce,toggle:O,items:u,catalog:l,bundles:f,warmCatalog:xe,add:E,remove:F,setQty:X,replaceItems:ze,identify:Ge,clearCapturedCart:Xe,coupon:m,applyCoupon:le,removeCoupon:te,refuseCoupon:ve,couponBusy:j,deliveryOptions:U,shippingMethodId:R,setShippingMethodId:J,totals:Ye}),[i,D,Ce,O,u,l,f,xe,E,F,X,ze,Ge,Xe,m,le,te,ve,j,U,R,Ye]);return Cn(Lt.Provider,{value:Kt,children:e})}function It(){let e=gn(Lt);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as kn}from"react";function wt(e,t,n,r){for(;e.size>=t;){let o,i;for(let[u,c]of e){if(c.expiresAt<=r){o=u;break}i===void 0&&n(u)&&(i=u)}let s=o??i??e.keys().next().value;if(s===void 0)return;e.delete(s)}}var xn=6e4,vn=5e3,Sn=500,Ie=new Map;async function En(e){let{host:t,matchesRequestHost:n}=await rt();if(!t)return"";let r=await ot();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}var Pn=e=>e.includes("|slug:")||e.includes("|xhost:");async function Tt(e,t){let n=await En(e);if(!n)return t();let r=Date.now(),o=Ie.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),s=i.outcome.state==="failed",u=s?vn:xn,c=Ie.get(n)?.lastGood,l=i.outcome.state==="ok"?i:s?c:void 0,d=s&&l?l:i;return wt(Ie,Sn,Pn,r),Ie.set(n,{load:d,expiresAt:r+u,lastGood:l}),d}var Ln=404;function In(e){if(e instanceof me&&e.status===Ln)return{state:"absent"};let t=e instanceof me?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var wn="[storefront:chrome-load-failed]";function Tn(e,t){console.error(`${wn} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function Nt(e,t,n,r){try{let o=await t();return r?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){let i=In(o);return i.state==="failed"&&Tn(e,i),{value:n,outcome:i}}}function Nn(e){return e==="production"?"silent":"banner"}var io=Nn("production");function _n(e,t){return e?.trim()||t}function po({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=_n(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var An={name:de,legalName:null,foundedYear:null,faviconUrl:null,currencies:[],defaultCurrency:null,countries:[],defaultCountry:null,commerceEnabled:!0,cardPayments:!1,paymentMethods:[],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,mapsApiKey:null,mapsMapId:null,socialLinks:Re},go=kn(async()=>Tt("site",()=>Nt("site",async()=>{let e=await q.getSite();return{name:Ze(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,mapsApiKey:e.mapsApiKey??null,mapsMapId:e.mapsMapId??null,socialLinks:et(e.socialLinks)}},An)));var yo={name:de,legalName:null,foundedYear:null,faviconUrl:null,currencies:[{code:"USD",symbol:"$",decimalPlaces:2,isDefault:!0}],defaultCurrency:"USD",countries:[{code:"US",name:"United States",currency:"USD",url:"",isDefault:!0,chargeTax:!1,taxDisplay:"none",taxName:"",taxRate:null,postalLabel:"Zip Code"}],defaultCountry:"US",commerceEnabled:!0,cardPayments:!0,paymentMethods:["card"],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,mapsApiKey:null,mapsMapId:null,socialLinks:Re};import{useEffect as we,useRef as _t,useState as Te}from"react";var ye=new Map,Rn=64;async function Mn(e){if(!Je())return null;try{let t=await fetch(`${tt()}/logo-analysis.json?url=${encodeURIComponent(e)}`);if(!t.ok)return null;let n=await t.json();if(!n||typeof n!="object")return null;let{reversed:r,inkIsDark:o}=n;return typeof r!="string"?null:{reversed:r,inkIsDark:typeof o=="boolean"?o:null}}catch{return null}}function kt(e){let t=ye.get(e);if(t)return t;let n=Mn(e);if(ye.set(e,n),ye.size>Rn){let r=ye.keys().next();r.done||ye.delete(r.value)}return n}import{jsx as At,jsxs as Rt}from"react/jsx-runtime";var Dn={small:54,medium:66,large:84},On=44,Fn=202/22,Lo=16,Io=140,Un=.88,wo=16,$n="invert(1)";function qn({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,onLightSurface:o,reversedSrc:i,inkIsDark:s,size:u="medium",sizePx:c,wordmark:l,siteName:d=de,fitToContainer:f=!1,fitWordmarkToContainer:P=!1,fitFloorPx:w}){let h=l&&l.trim()?l.trim():d,[C,L]=Te(!1),N=_t(null),M=E=>{N.current=E};we(()=>{let E=N.current?.ownerDocument??document,F=()=>{L(E.documentElement.getAttribute("data-theme")==="light")};F();let X=new MutationObserver(F);return X.observe(E.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>X.disconnect()},[]);let x=n&&n.trim()?n.trim():null,I=!!x&&nt(x),v=o??(C&&t),H=r&&I&&x&&i!=null?{reversed:i,inkIsDark:s??null}:null,W=H!==null,[Q,b]=Te(null);we(()=>{if(!r||!x||!I||W){b(null);return}let E=!1;return b(null),kt(x).then(F=>{E||b(F)}),()=>{E=!0}},[r,x,I,W]);let S=H??Q,m=!!S&&S.inkIsDark!==null&&(v?!S.inkIsDark:S.inkIsDark),K=r&&!!x&&!I&&!v,j=m&&S?S.reversed:x,V=j?[j]:[],[R,J]=Te(0);we(()=>{J(0)},[x,m]);let Z=e==="footer"?On:Dn[u],D=c&&c>0?c:Z,Ce=Math.round(D*Fn),O=R<V.length?V[R]:null,[xe,ee]=Te(j),ae=O!==null&&O===xe,U=_t(null);we(()=>{let E=U.current;if(!E||!E.complete)return;if(E.naturalWidth>0||E.naturalHeight>0){ee(O);return}let F=!1;return E.decode().then(()=>!F&&ee(O),()=>!F&&J(X=>X+1)),()=>{F=!0}},[O]);let G=f||P,le=`calc(100cqi / ${((h.length+1)*Un).toFixed(2)})`,te=G&&w&&w>0?Math.min(w,D):null,ve=G?te===null?`min(${D}px, ${le})`:`clamp(${te}px, ${le}, ${D}px)`:`${D}px`;return Rt("span",{ref:M,className:"inline-flex items-center",children:[!ae&&Rt("span",{className:`font-display font-bold tracking-[0.18em] ${te===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:ve,lineHeight:1},"aria-label":h,children:[h,At("span",{className:"text-accent",children:"."})]}),O&&At("img",{ref:U,src:O,alt:h,width:Ce,height:D,className:"shrink-0 object-contain",style:{...ae?{height:`${D}px`,width:"auto",...f?{maxWidth:"100cqi"}:{}}:{display:"none"},...K?{filter:$n}:{}},onLoad:()=>ee(O),onError:()=>J(E=>E+1)},O)]})}import{Children as Kn,isValidElement as Wn,useEffect as Dt,useId as Bn,useLayoutEffect as zn,useRef as Y,useState as Ot}from"react";var Ne=(e,t)=>!!e[t]&&!e[t].disabled;function He(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(Ne(e,i))return i}return t}function Ke(e,t){return He(e,t===1?-1:e.length,t)}function We(e,t){return Ne(e,t)?t:Math.max(Ke(e,1),0)}function Mt(e,t,n){let{open:r,focus:o}=e,i=s=>({...e,...s});if(t.length===1&&/\S/.test(t)){let s=e.typed+t.toLowerCase(),u=n.findIndex((c,l)=>Ne(n,l)&&c.label.toLowerCase().startsWith(s));return{state:i({open:!0,typed:s,focus:u>=0?u:o}),handled:!0}}if(!r)return t==="ArrowDown"||t==="ArrowUp"||t==="Enter"||t===" "?{state:i({open:!0,typed:""}),handled:!0}:{state:e,handled:!1};switch(t){case"ArrowDown":return{state:i({focus:He(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:He(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:Ke(n,1)}),handled:!0};case"End":return{state:i({focus:Ke(n,-1)}),handled:!0};case"Enter":case" ":return Ne(n,o)?{state:i({open:!1,typed:""}),commit:o,refocus:!0,handled:!0}:{state:e,handled:!0};case"Escape":return{state:i({open:!1,typed:""}),refocus:!0,handled:!0};case"Tab":return{state:i({open:!1,typed:""}),handled:!1};default:return{state:e,handled:!1}}}import{Fragment as Qn,jsx as z,jsxs as Ft}from"react/jsx-runtime";function Vn({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[s,u]=Ot(!1),c=r!==void 0,l=c?r:s,[d,f]=Ot(0),P=Y({text:"",timer:0}),w=Y(null),h=Y(null),C=Y(null),L=Bn(),N=Y(null),M=e.findIndex(b=>b.value===t),x=b=>{b!==l&&(c||u(b),b?o?.():i?.())},I=b=>{let S=e[b];!S||S.disabled||(n(S.value),x(!1),h.current?.focus())},v=b=>{let S={open:l,focus:l?d:We(e,M),typed:P.current.text},m=Mt(S,b,e);return!m.handled&&m.state.open===l?!1:(m.state.typed!==S.typed&&(P.current.text=m.state.typed,window.clearTimeout(P.current.timer),P.current.timer=window.setTimeout(()=>{P.current.text=""},500)),f(m.state.focus),m.commit!==void 0?I(m.commit):x(m.state.open),m.refocus&&h.current?.focus(),m.handled)},H=Y(v);H.current=v;let W=Y(()=>x(!1));W.current=()=>x(!1);let Q=b=>{l||(N.current=b.nativeEvent,H.current(b.key)&&b.preventDefault())};return Dt(()=>{if(!l)return;let b=m=>{w.current?.contains(m.target)||W.current()},S=m=>{m!==N.current&&H.current(m.key)&&m.preventDefault()};return document.addEventListener("mousedown",b),document.addEventListener("keydown",S),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",S)}},[l]),Dt(()=>{l&&(P.current.text||f(We(e,M)))},[l]),zn(()=>{if(!l||!C.current)return;C.current.children.item(d)?.scrollIntoView({block:"nearest"})},[d,l]),{open:l,toggle:()=>x(!l),close:()=>x(!1),focusIdx:d,setFocusIdx:f,pick:b=>I(e.findIndex(S=>S.value===b)),wrapRef:w,triggerRef:h,listRef:C,listId:L,onTriggerKeyDown:Q,activeId:l?`${L}-${d}`:void 0}}var Gn={select:{list:"absolute left-0 top-full z-50 mt-1 max-h-[280px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:(e,t,n)=>["px-3 py-2.5 font-mono text-[13px] font-semibold uppercase tracking-[0.1em] transition-colors whitespace-nowrap",n?"cursor-not-allowed opacity-40":"cursor-pointer",e&&!n?"bg-accent text-bg":"bg-bg text-fg"].join(" ")},cell:{list:"absolute left-0 top-full z-50 mt-1 max-h-[320px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:e=>["cursor-pointer whitespace-nowrap px-6 py-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.1em] transition-colors",e?"bg-accent text-bg":"bg-bg text-fg"].join(" "),pickerMarker:!0},hairline:{list:"absolute left-0 top-full z-50 max-h-[320px] w-full overflow-y-auto border border-line bg-bg shadow-[0_6px_20px_rgba(0,0,0,0.10)]",item:(e,t)=>["flex cursor-pointer items-center justify-between gap-4 border-b border-line px-4 py-3 text-left text-[length:var(--size-body,14px)] transition-colors last:border-b-0",t?"border-fg font-medium text-fg":e?"border-fg text-fg":"text-fg-dim"].join(" "),pickerMarker:!0},region:{list:"absolute right-0 top-full z-[200] mt-2 flex min-w-[240px] flex-col border border-line bg-surface text-fg",item:(e,t,n,r)=>["flex w-full cursor-pointer items-center gap-3 px-3.5 py-3 text-left transition-colors","font-mono text-[13px] uppercase tracking-[0.18em]",e?"bg-surface-2 text-fg":"",r?"":"border-b border-line",t?"text-accent":""].join(" "),itemStyle:e=>e?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"}}};function Xn({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:s,listRef:u,ariaLabel:c}){let l=Gn[t];return z("ul",{ref:u,id:e,role:"listbox","aria-label":c,...l.pickerMarker?{"data-picker-menu":""}:{},className:l.list,children:n.map((d,f)=>{let P=d.value===r;return z("li",{id:`${e}-${f}`,role:"option","aria-selected":P,"aria-disabled":d.disabled||void 0,onMouseEnter:()=>!d.disabled&&i(f),onMouseDown:w=>{w.preventDefault(),d.disabled||s(d.value)},className:l.item(f===o,P&&d.value!=="",!!d.disabled,f===n.length-1),style:l.itemStyle?.(P),children:d.meta===void 0?d.label:Ft(Qn,{children:[z("span",{className:"flex-1 whitespace-nowrap",children:d.label}),z("span",{className:"ml-auto text-[12px] opacity-50",children:d.meta})]})},`${d.value}_${f}`)})})}function Yn({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:s,id:u,"aria-label":c}){let l=Kn.toArray(r).flatMap(h=>{if(!Wn(h))return[];if(h.type!=="option")return[];let L=h.props,N=L.value!==void 0?String(L.value):"",M=L.children,x=typeof M=="string"||typeof M=="number"?String(M):N;return[{value:N,label:x,disabled:!!L.disabled}]}),d=e??"",f=Vn({items:l,value:d,onPick:h=>t?.({target:{value:h}})}),w=l.find(h=>h.value===d)?.label??l[0]?.label??"";return Ft("div",{ref:f.wrapRef,className:"relative",children:[s&&z("input",{type:"hidden",name:s,value:d}),z("button",{ref:h=>{f.triggerRef.current=h},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":f.open,"aria-controls":f.open?f.listId:void 0,"aria-activedescendant":f.activeId,"aria-label":c,id:u,onClick:()=>!n&&f.toggle(),onKeyDown:h=>!n&&f.onTriggerKeyDown(h),className:`block w-full ${o??""}`,style:i,children:z("span",{className:"block w-full truncate text-left",children:w})}),f.open&&z(Xn,{id:f.listId,tone:"select",items:l,value:d,focusIdx:f.focusIdx,onFocus:f.setFocusIdx,onPick:f.pick,listRef:f.listRef})]})}var Fo="#c9a461",Ut=[{f:"black",label:"Black",hex:"#171717"},{f:"silver",label:"Silver",hex:"#cccccc"},{f:"bronze",label:"Bronze",hex:"#8a6438"},{f:"graphite",label:"Graphite",hex:"#3a3c3f"},{f:"red",label:"Candy Red",hex:"#7a0f14"}],Uo={name:"",color:"var(--fg)",family:"silver",src:""};function jn(e,t){let n=r=>{let o=Ut.findIndex(i=>i.f===r);return o===-1?Ut.length:o};return n(e)-n(t)||e.localeCompare(t)}function $o(e){let t=new Set;for(let n of e)for(let r of n.finishes??[])r?.family&&t.add(r.family);return[...t].sort(jn)}import{jsx as be,jsxs as ke}from"react/jsx-runtime";var Jn="font-mono text-[length:var(--size-label,12px)]",Zn="font-semibold uppercase tracking-[0.22em] text-fg";function $t(e){return`${e??Jn} ${Zn}`}function qt(){return be("span",{className:"text-accent",children:" *"})}function er({children:e,required:t,labelFace:n}){return ke("span",{className:$t(n),children:[e,t?be(qt,{}):null]})}function tr({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:s,children:u}){let c=s?`flex flex-col gap-2 ${s}`:"flex flex-col gap-2",l=n?be("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?ke("div",{className:c,children:[ke("label",{htmlFor:o,className:$t(i),children:[e,t?be(qt,{}):null]}),u,l]}):ke("label",{htmlFor:o,className:c,children:[be(er,{required:t,labelFace:i,children:e}),u]})}import{jsx as he,jsxs as rr}from"react/jsx-runtime";function nr({spokes:e,mesh:t=!1,className:n}){let s=c=>Math.round(c*1e3)/1e3,u=[];for(let c=0;c<e;c++){let l=c/e*Math.PI*2-Math.PI/2;if(u.push({x1:s(100+Math.cos(l)*22),y1:s(100+Math.sin(l)*22),x2:s(100+Math.cos(l)*86),y2:s(100+Math.sin(l)*86),main:!0}),t){let d=l+Math.PI/e;u.push({x1:s(100+Math.cos(d)*22*1.4),y1:s(100+Math.sin(d)*22*1.4),x2:s(100+Math.cos(d)*78),y2:s(100+Math.sin(d)*78),main:!1})}}return rr("svg",{viewBox:"0 0 200 200",fill:"none",stroke:"currentColor",className:n??"block h-[70%] w-[70%] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",children:[he("circle",{cx:100,cy:100,r:92,strokeWidth:2}),he("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),he("circle",{cx:100,cy:100,r:22,strokeWidth:2}),he("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),u.map((c,l)=>he("line",{x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:"currentColor",strokeWidth:c.main?6:3,strokeLinecap:"round",opacity:c.main?1:.5},l))]})}import{useState as or}from"react";import{jsx as se,jsxs as Be}from"react/jsx-runtime";function ir({customerEmail:e}){let{coupon:t,applyCoupon:n,removeCoupon:r,couponBusy:o}=It(),[i,s]=or("");async function u(){o||!i.trim()||(await n(i,e),s(""))}return Be("div",{className:"flex flex-col gap-2",children:[t===null?Be("div",{className:"flex border border-line",children:[se("input",{type:"text",value:i,onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),u())},placeholder:"Coupon code","aria-label":"Coupon code",className:"flex-1 bg-transparent px-3.5 py-3.5 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim"}),se("button",{type:"button",onClick:()=>{u()},disabled:o,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:o?"\u2026":"Apply"})]}):Be("div",{className:["flex items-center justify-between gap-3 border px-3.5 py-3",t.valid?"border-accent":"border-line"].join(" "),style:t.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[se("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",t.valid?"text-accent":t.deferred?"text-fg":"text-fg-dim line-through"].join(" "),children:t.code}),se("button",{type:"button",onClick:r,"aria-label":`Remove coupon ${t.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),t?.deferred?se("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:pt}):t&&!t.valid&&t.message&&se("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:t.message})]})}function Qo(){let e=typeof crypto<"u"?crypto:void 0;if(typeof e?.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}export{xr as a,vr as b,Sr as c,it as d,Me as e,sr as f,ar as g,lr as h,ur as i,Xt as j,Yt as k,cr as l,dr as m,De as n,Oe as o,fe as p,Pe as q,rn as r,Ue as s,Ir as t,wr as u,sn as v,Tr as w,Nr as x,an as y,kr as z,un as A,_r as B,Ar as C,yt as D,Ur as E,$r as F,qr as G,yr as H,dt as I,Le as J,qe as K,jr as L,It as M,po as N,An as O,yo as P,Dn as Q,On as R,Lo as S,Io as T,wo as U,qn as V,Vn as W,Xn as X,Yn as Y,Fo as Z,Ut as _,Uo as $,jn as aa,$o as ba,er as ca,tr as da,nr as ea,ir as fa,Qo as ga};
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import{a as lt,b as dt,c as ct,d as pt,e as ut,f as ft,l as gt,m as bt,p as yt,q as wt,t as kt,v as Pt,w as It,y as Tt}from"./chunk-NJXX5BI2.js";import{Aa as ze,Ca as De,Dg as at,Fc as V,H as Me,Jc as Ve,Jh as ht,Kd as Ze,Nh as vt,Oe as Je,P as He,Q as R,R as ce,Ua as Ke,Va as pe,Wa as N,Wf as me,Ya as K,Yf as tt,Za as $e,Zh as St,_a as qe,_h as Et,bb as Ue,bf as Qe,cb as Ge,cf as et,ed as fe,eg as nt,fb as Ye,jf as J,ld as Z,ma as D,og as ot,pe as je,ph as mt,qa as Be,sa as We,ud as j,vg as rt,ya as _,yg as he,zg as ge}from"./chunk-C2CHF6AL.js";import{b as ue}from"./chunk-HVOO2GNE.js";import{B as Xe,Ma as X,Pa as it,Qa as st}from"./chunk-ENDWECYV.js";import{d as de}from"./chunk-6CP4D6VJ.js";import{InspectorHead as cn,InspectorIconButton as Nt}from"efficient-easel/chrome";import{jsx as Rt,jsxs as dn}from"react/jsx-runtime";function Q({side:e}){return dn("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,children:[Rt("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),Rt("path",{d:e==="left"?"M9 4v16":"M15 4v16"})]})}import{Fragment as Ct,jsx as P,jsxs as xt}from"react/jsx-runtime";function pn({icon:e,title:t,context:n,actions:o,side:s="left",onHide:r}){return P(cn,{icon:e,name:t,kind:n,actions:o||r?xt(Ct,{children:[o,r?P(ee,{side:s,onHide:r,divider:!!o}):null]}):void 0})}function ee({side:e,onHide:t,divider:n=!1}){return xt(Ct,{children:[n?P("span",{className:"sf-head-divider","aria-hidden":"true"}):null,P(Nt,{label:`Hide the ${e} panel`,title:"Hide panel",onClick:t,children:P(Q,{side:e})})]})}function Fo({side:e,onShow:t}){return P("div",{className:`es-sidepanel es-sidepanel--${e} sf-panel-strip`,children:P(Nt,{label:`Show the ${e} panel`,title:"Show panel",onClick:t,children:P(Q,{side:e})})})}function _o({label:e,onClick:t,description:n}){return P("button",{type:"button",className:"es-btn-ghost sf-head-textbtn",onClick:t,title:n,children:e})}var te="Flex",un={FooterMenu:"MenuBlock",FooterEmailSignup:"EmailFormBlock",FooterSocial:"SocialLogosBlock"},fn=e=>{let{id:t,...n}=e;return n},Ot=e=>typeof e=="string"?e:"";function Lt(e,t){let n=e.props??{},o=un[e.type];if(o)return[t(o,fn(n))];switch(e.type){case"FooterLogo":{let s=t("LogoBlock",n.reverse?{reverse:n.reverse}:{}),r=Ot(n.tagline).trim();return r?[s,t("Text",{text:r,tone:"dim",align:n.align==="center"?"center":"left"})]:[s]}case"FooterText":return[t("Text",{text:Ot(n.text),tone:typeof n.tone=="string"?n.tone:"default"})];case"FooterDivider":return[t("Divider")];case"FooterGroup":{let s=Array.isArray(n.blocks)?n.blocks:[];return[t(te,{direction:n.direction==="horizontal"?"row":"column",content:s.flatMap(r=>Lt(r,t))})]}default:return[]}}function At(e,t,n){let s=(e&&Array.isArray(e.props?.blocks)?e.props.blocks:[]).flatMap(p=>{let d=Lt(p,t);return d.length<=1?d:[t(te,{direction:"column",content:d})]}),r=t(te,{direction:"row",wrap:!0,share:"equal",content:s}),l=t(te,{direction:"column",content:[t("LegalLineBlock")]});return Be(D,n,[r,l])}import{MediaPanelHead as mn,mediaPickKind as hn}from"efficient-easel/chrome";import{Fragment as bn,jsx as be,jsxs as yn}from"react/jsx-runtime";function gn({panel:e,pick:t,onHide:n}){let o=yt();return yn(bn,{children:[be(mn,{context:o,pick:t?{kind:hn(t.accept),field:t.title||void 0}:null,onCancel:()=>t&&fe(t.requestId,null),onHide:n}),be("div",{className:"sf-media-panel",children:be(e,{pick:t,onPick:s=>t&&fe(t.requestId,s)})})]})}import{DEFAULT_PANEL_W as wn,clampPanelWidth as vn}from"efficient-easel/chrome";import{MAX_PANEL_W as jo,MIN_PANEL_W as Jo,panelWidthVars as Qo}from"efficient-easel/chrome";var Go="sf-editor-panel-widths",Yo={...wn},Xo=e=>vn(e);import{useState as io}from"react";import{useEasel as so}from"efficient-easel/easel";import{InspectorHead as ao,InspectorIconButton as qt}from"efficient-easel/chrome";import{DuplicateIcon as lo,TrashIcon as co}from"efficient-easel/icons";function Ft(e,t){if(!t)return null;let n=e.components?.[t.type],o=n?.fields??null;if(!o||typeof n?.resolveFields!="function")return o;try{let s=n.resolveFields({type:t.type,props:t.props},{fields:o,lastFields:o,lastData:null,changed:{},parent:null,appState:{}});return!s||typeof s.then=="function"?o:s}catch{return o}}import{useEffect as kn,useId as Sn,useState as En}from"react";import{SettingsField as Pn,SettingsSwitch as In}from"efficient-easel/panel";import{TypeIcon as Tn}from"efficient-easel/icons";import{Fragment as xn,jsx as v,jsxs as _t}from"react/jsx-runtime";var Rn="Chat with us",Nn="We usually reply within a few minutes",Cn="Hi! Ask us anything \u2014 about a wheel, an order, or fitment. Leave your details and we\u2019ll reply.";function ye({label:e,value:t,placeholder:n,onCommit:o,multiline:s=!1}){let[r,l]=En(t);kn(()=>l(t),[t]);let p=()=>{r!==t&&o(r)};return v(Pn,{label:e,icon:v(Tn,{}),children:s?v("textarea",{value:r,placeholder:n,rows:3,onChange:d=>l(d.target.value),onBlur:p,"aria-label":e}):v("input",{type:"text",value:r,placeholder:n,onChange:d=>l(d.target.value),onBlur:p,onKeyDown:d=>{d.key==="Enter"&&d.currentTarget.blur()},"aria-label":e,autoComplete:"off"})})}function we(){let{chat:e,setChat:t}=rt(),n=Sn();return _t(xn,{children:[_t("div",{className:"sf-field sf-field--row",children:[v("span",{id:n,className:"sf-field-label sf-field-label--inline",children:"Show the chat bubble"}),v(In,{checked:e.enabled,onChange:o=>t({enabled:o}),ariaLabelledBy:n})]}),v("p",{className:"sf-field-hint",children:e.enabled?"The floating chat bubble shows in the corner of every page.":"The chat bubble is hidden across the whole site."}),v(J,{label:"Wording"}),v(ye,{label:"Title",value:e.title,placeholder:Rn,onCommit:o=>t({title:o})}),v(ye,{label:"Subtitle",value:e.subtitle,placeholder:Nn,onCommit:o=>t({subtitle:o})}),v(ye,{label:"Greeting message",value:e.greeting,placeholder:Cn,onCommit:o=>t({greeting:o}),multiline:!0}),v("p",{className:"sf-field-hint",children:"Leave a field blank to use the built-in wording."})]})}import{useEffect as On,useId as Mt,useState as Ht}from"react";import{SettingsField as Ln}from"efficient-easel/panel";import{Fragment as ve,jsx as x,jsxs as Bt}from"react/jsx-runtime";var An={instagram:"instagram.com/yourshop",facebook:"facebook.com/yourshop",tiktok:"tiktok.com/@yourshop",youtube:"youtube.com/@yourshop",x:"x.com/yourshop",linkedin:"linkedin.com/company/yourshop",pinterest:"pinterest.com/yourshop",whatsapp:"wa.me/61400000000"};function Fn({platform:e}){let{rows:t,saveLink:n}=he(),{value:o,error:s}=t[e],[r,l]=Ht(o),[p,d]=Ht(!1),h=Mt(),i=Mt();On(()=>l(o),[o]);let f=async()=>{if(r.trim()===o){r!==o&&l(o);return}d(!0),await n(e,r),d(!1)},b=st[e];return Bt(ve,{children:[x(Ln,{label:b,htmlFor:h,icon:x(vt,{platform:e,iconStyle:"outline",size:18}),children:x("input",{id:h,type:"text",inputMode:"url",value:r,placeholder:An[e],onChange:g=>l(g.target.value),onBlur:()=>{f()},onKeyDown:g=>{g.key==="Enter"&&g.currentTarget.blur(),g.key==="Escape"&&(l(o),g.currentTarget.blur())},"aria-invalid":s?!0:void 0,"aria-describedby":s?i:void 0,"aria-busy":p||void 0,autoComplete:"off",spellCheck:!1})}),s&&x("p",{id:i,className:"sf-note sf-note--error",role:"alert",children:s})]})}function ke({unavailable:e}){let{canSave:t}=he();return!t&&e?x(ve,{children:e}):Bt(ve,{children:[x("p",{className:"sf-field-hint",children:"Paste a link to each profile. A platform left empty shows nothing on the site."}),it.map(n=>x(Fn,{platform:n},n))]})}import{useId as _n,useMemo as Mn}from"react";import{useEasel as Hn}from"efficient-easel/easel";import{SettingsSwitch as Bn}from"efficient-easel/panel";import{jsx as $,jsxs as Wt}from"react/jsx-runtime";var Wn="root:default-zone";function Se({heroId:e}){let{appState:t,dispatch:n}=Hn(i=>i),o=t.data.content??[],s=o.findIndex(i=>i.props.id===e),r=s>=0?o[s]:null,l=r?r.props.showTicker??!0:!0,p=Mn(()=>{let i=r?.props.tickerItems;return Array.isArray(i)?i:ht.map(f=>({text:f}))},[r]),d=_n();if(!r)return $("div",{className:"sf-field",style:{color:"var(--sf-muted)",fontSize:12},children:"This ticker\u2019s hero is no longer on the page."});let h=i=>n({type:"replace",destinationZone:Wn,destinationIndex:s,data:{...r,props:{...r.props,...i}}});return Wt("div",{children:[$(J,{label:"Ticker"}),Wt("div",{className:"sf-field sf-field--row",children:[$("span",{id:d,className:"sf-field-label sf-field-label--inline",children:"Show ticker"}),$(Bn,{checked:l,onChange:i=>h({showTicker:i}),ariaLabelledBy:d})]}),$(tt,{label:me.label,icon:me.icon,items:p,placeholder:"item",onChange:i=>h({tickerItems:i}),markup:!0})]})}import{useCallback as zn,useEffect as Dn,useRef as Kn,useState as M}from"react";import{createPortal as $n}from"react-dom";import{InspectorIconButton as qn}from"efficient-easel/chrome";import{CopyToPageIcon as Un}from"efficient-easel/icons";import{Fragment as zt,jsx as S,jsxs as ne}from"react/jsx-runtime";function Ee({node:e,currentSlug:t,siteId:n,tokenRef:o,runAuthed:s,onNotify:r}){let[l,p]=M(!1),[d,h]=M(null),i=V(),[f,b]=M(!1),[g,y]=M(null),O=Kn(null),[T,re]=M(null),[a,U]=M(null),ie=zn(async()=>{if(i.usesBridgedToken&&!o.current){b(!0);return}try{h(await de(i).pages.list(n?{siteId:n}:void 0))}catch{b(!0)}},[o,n,i]),E=()=>{if(l){p(!1);return}let u=O.current?.getBoundingClientRect();u&&re({top:u.bottom+6,right:Math.max(8,window.innerWidth-u.right)}),U(O.current?.closest(".sf-editor")??document.body),h(null),b(!1),ie(),p(!0)};Dn(()=>{if(!l)return;let u=m=>{m.key==="Escape"&&p(!1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l]);let G=(d??[]).filter(u=>u.slug!==t),se=async u=>{if(g)return;y(u.slug);let m=kt(e),w=i.documentHooks?.storedNode?.(m)??m,B=de(i).pages,W=await s(async()=>{let L=await B.load({id:u.id});if(!L)throw new Error(`Page "${u.slug}" no longer exists.`);let A=L.layout??{},F=Array.isArray(A.content)?[...A.content]:[],Y=F.findIndex(ae=>ae?.type===R);F.splice(Y===-1?F.length:Y,0,w),await B.save(u.id,{layout:{root:{},zones:{},...A,content:F}},{version:L.version,clientId:""})});y(null),p(!1),r?.(W?`Duplicated to \u201C${u.label}\u201D`:"Couldn\u2019t duplicate the section \u2014 please retry",W?"success":"error")};return ne(zt,{children:[S(qn,{buttonRef:O,label:"Duplicate to another page",hasPopup:"menu",expanded:l,onClick:E,children:S(Un,{size:15})}),l&&T&&a&&$n(ne(zt,{children:[S("div",{className:"sf-dupmenu-backdrop",onClick:()=>p(!1)}),ne("div",{className:"sf-dupmenu",role:"menu",style:{top:T.top,right:T.right},children:[S("div",{className:"sf-dupmenu-head",children:"Duplicate to page\u2026"}),f?S("div",{className:"sf-dupmenu-empty",children:"Couldn\u2019t load pages"}):d===null?S("div",{className:"sf-dupmenu-empty",children:"Loading\u2026"}):G.length===0?S("div",{className:"sf-dupmenu-empty",children:"No other pages"}):G.map(u=>ne("button",{type:"button",role:"menuitem",className:"sf-dupmenu-item",disabled:g!==null,onClick:()=>se(u),children:[S("span",{className:"sf-dupmenu-name",children:u.label}),g===u.slug?S("span",{className:"sf-note",children:"Copying\u2026"}):u.draft&&S("span",{className:"sf-note",children:"draft"})]},u.id))]})]}),a)]})}import{SettingsDrill as Gn}from"efficient-easel/panel";import{jsx as q,jsxs as Vn}from"react/jsx-runtime";var Yn="Not shown on the page";function Xn({part:e,onOpen:t}){return q(Gn,{name:e.label,preview:e.offPage?Yn:e.preview||"Empty",offPage:e.offPage,status:e.hidden?q("span",{className:"sf-entry-eye",role:"img","aria-label":"Hidden on the page",children:q(je,{name:"eye-off",size:14})}):void 0,onOpen:()=>t(e.key)})}function Dt({parts:e,onOpen:t}){let n=e.filter(o=>!o.identifier);return n.length?Vn("div",{className:"sf-entries",children:[q("h3",{className:"sf-entries-head",children:"Text"}),n.map(o=>q(Xn,{part:o,onOpen:t},o.key))]}):null}import{useState as Zn}from"react";import{createNode as jn,newId as Jn}from"efficient-easel/data";import{useEasel as Qn}from"efficient-easel/easel";import{jsx as oe,jsxs as Kt}from"react/jsx-runtime";function Pe(){let{appState:e,dispatch:t,config:n}=Qn(i=>i),{readOnly:o}=Z(),[s,r]=Zn(!1),l=e.data.content;if(o||l.some(i=>i.type===D))return null;let p=l.find(i=>i.type===R)??null,d=(i,f)=>jn(n,i,f);return Kt("div",{className:"sf-box-footer-switch",children:[oe("p",{className:"sf-box-footer-switch-text",children:"Build this footer out of Boxes and blocks, like a page: the same menus, signup, social links and logo, with the copyright as a Legal Line. Your current footer is kept."}),s?Kt("div",{className:"sf-box-footer-switch-row",children:[oe("button",{type:"button",className:"es-btn-primary",onClick:()=>{let i=At(p,d,Jn(D));t({type:"setData",data:f=>({...f,content:[...We(f.content,i)]}),recordHistory:!0}),r(!1)},children:"Switch now"}),oe("button",{type:"button",className:"es-btn-ghost",onClick:()=>r(!1),children:"Cancel"})]}):oe("button",{type:"button",className:"es-btn-ghost",onClick:()=>r(!0),children:"Switch to Box footer"})]})}import{useState as eo}from"react";import{useSelectedFields as to}from"efficient-easel/easel";import{Inspector as no,planFields as oo}from"efficient-easel/fields";import{jsx as $t}from"react/jsx-runtime";var Ie=new Map,ro=Object.fromEntries(nt.map(e=>{let t=Qe[e];return[e,$t(t,{},e)]}));function Te({entries:e}){let{id:t,fields:n,values:o,readOnly:s,onChange:r}=to(),[l,p]=eo(()=>Ie.get(t)),d=Ie.get(t),h=oo(n).buckets,i=d&&h.includes(d)?d:l&&h.includes(l)?l:h[0],f=i===void 0||et(h,i)!==!0;return $t(no,{fields:n,values:o,onChange:r,readOnly:s,tab:i,onTab:b=>{Ie.set(t,b),p(b)},tabIcons:ro,idPrefix:t,ariaLabel:"Section settings",children:f?e:null})}import{SettingsSwitch as po}from"efficient-easel/panel";import{Fragment as Re,jsx as c,jsxs as I}from"react/jsx-runtime";var Ne={kind:"puck"},Ai={kind:"header"},Fi={kind:"website"},_i={kind:"chat"},Mi={kind:"social"},H="Part";function uo(e,t,n){let o=e.describeNode(t);return{name:n,kindLabel:o?`${H} of ${o.label}`:H}}function Ut({what:e}){return I("div",{className:"sf-note",children:[c("p",{children:I("strong",{children:[e," settings belong to a website."]})}),I("p",{children:["A template is a blueprint \u2014 it has no website of its own, so there is nothing here to change. Each website created from this template sets its own ",e.toLowerCase()," afterwards."]})]})}var fo={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,t)=>{let n=t.hostPanels?.header;return n?c(n,{placeholderMode:t.capabilities.placeholderFrames,tokenRef:t.tokenRef,siteId:t.siteId,websiteName:t.websiteName,onOpenWebsiteSettings:t.onOpenWebsiteSettings,onAuthExpired:()=>t.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(e,t)=>c(wt,{themeFromDocument:!t.capabilities.hasSiteTheme,tokenRef:t.tokenRef,siteId:t.siteId,onNotify:t.onNotify})},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>c(we,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>c(ke,{unavailable:c(Ut,{what:"Social link"})})},ticker:{name:ge,kindLabel:H,icon:"ticker",head:(e,t)=>e.kind==="ticker"?uo(t,e.heroId,ge):null,render:e=>c(Se,{heroId:e.kind==="ticker"?e.heroId:""})},part:{name:H,kindLabel:H,icon:"Text",head:(e,t)=>{if(e.kind!=="part")return null;let n=t.describeNode(e.nodeId);if(!n)return null;let{key:o,row:s}=De(e.propKey),r=s?lt(n.fields[o],s):n.fields[o],l=Ke(Ge(Ue(r??{},o)),s);return{name:t.styleNameOfPart(e.nodeId,e.propKey)??l,kindLabel:`${H} of ${n.label}`}},render:(e,t)=>e.kind==="part"?c(ft,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>t.onSelectNode(e.nodeId),onEditStyle:t.onOpenSiteStyles}):null}},mo=new Set(["header","website","chat"]);function ho(e,t){if(e==="puck")return null;let n=fo[e];return mo.has(e)&&!t.hasSiteSettings?{...n,kindLabel:"Not part of a template",render:()=>c(Ut,{what:n.name})}:n}function go({mode:e,onOpenWebsiteSettings:t,onOpenSiteStyles:n,onSelectNode:o,hideNodeActions:s=!1,onNotify:r,onHidePanel:l}){let{capabilities:p,tokenRef:d,notifyParent:h,currentSlug:i,siteId:f,runAuthed:b}=Z(),{websiteName:g,fonts:y}=X(),{partStyle:O}=ze(),T=j(),{select:re}=_(),{selectedItem:a,getItemById:U,getSelectorForId:ie,config:E,appState:G}=so(k=>k),se=Ft(E,a?{type:a.type,props:a.props}:null),u=k=>E.components[k]?.label??k,m=a?ie(a.props.id):void 0,w=ho(e.kind,p),B=V(),W=B.chrome?.panels?.chromePage,L={capabilities:p,tokenRef:d,hostPanels:B.chrome?.panels,describeNode:k=>{let C=U(k);if(!C)return null;let z=E.components[C.type];return{type:C.type,label:z?.label??C.type,fields:z?.fields??{}}},styleNameOfPart:(k,C)=>{let z=U(k);if(!z)return null;let an=K(k,C),ln=O?.partId===an?O:null;return pt(z.props,C,ln,y)},siteId:f,websiteName:g??null,notifyParent:h,onNotify:r,onOpenWebsiteSettings:t,onOpenSiteStyles:n,onSelectNode:o},A=w?.head?.(e,L)??null,F=A?.name??(w?w.name:a?u(a.type):"Page settings"),Y=A?.kindLabel??(w?w.kindLabel:a?m&&m.zone!==ce?"Block":"Section":"Page"),ae=w?w.icon:a?a.type:"page",Oe=w?null:a?E.components[a.type]?.fields??null:E.root?.fields??null,Qt=Oe?ot(Oe):2,Le=e.kind==="puck"&&a?ct(a.type):null,en=!!a&&!!m&&m.zone===ce&&a.type!==R&&a.type!==He,le=Me(G?.data,a),tn=()=>{le||m&&T.duplicateComponent(m.zone,m.index)},nn=()=>{m&&(T.removeComponent(m.zone,m.index),T.select(null))},on=a?E.components[a.type]?.defaultProps?.previewHover:void 0,Ae=e.kind==="puck"&&!!a&&!!m&&on!==void 0,Fe=Ae&&a.props.previewHover===!0,rn=()=>{!a||!m||T.replaceComponent(m.zone,m.index,{...a,props:{...a.props,previewHover:!Fe}})},[_e,sn]=io(gt);return I("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right${_e?"":" sf-hints-folded"}`,children:[c(ao,{icon:c(at,{type:ae,size:15}),name:F,kind:Y,actions:!s&&e.kind==="puck"&&a&&a.type!==R?I(Re,{children:[c(qt,{label:"Duplicate section",title:le??void 0,disabled:le!==null,onClick:tn,children:c(lo,{size:15})}),en&&p.hasSiteSettings&&c(Ee,{node:a,currentSlug:i,siteId:f??void 0,tokenRef:d,runAuthed:b,onNotify:r}),c(qt,{label:"Remove section",danger:!0,onClick:nn,children:c(co,{size:15})}),l?c(ee,{side:"right",onHide:l,divider:!0}):null]}):l?c(ee,{side:"right",onHide:l}):void 0}),Ae&&I("div",{className:"sf-preview-pin",children:[I("div",{className:"sf-preview-pin-text",children:[c("span",{className:"sf-preview-pin-label",children:"Preview hover state"}),c("span",{className:"sf-preview-pin-hint",children:"not shown live"})]}),c(po,{checked:Fe,onChange:rn,ariaLabel:"Preview hover state"})]}),c(Je,{tier:Qt,children:c("div",{className:"sf-insp-body sf-scroll",children:w?w.render(e,L):a?I(Re,{children:[c(Ze,{children:c(Te,{entries:c(Dt,{parts:Ye(se??E.components[a.type]?.fields,a.props),onOpen:k=>re(K(a.props.id,k))})})}),a.type===R&&p.hasSiteSettings&&c(Pe,{}),Le&&c(ut,{source:Le,slug:dt(a?.props)}),c(bt,{shown:_e,onChange:sn})]}):I(Re,{children:[c(Te,{}),i===Ve&&p.hasSiteSettings&&W&&c(W,{})]})})})]})}import{useCallback as Gt,useEffect as Yt}from"react";import{useEasel as bo}from"efficient-easel/easel";function Ui({mode:e,setMode:t,onOpenPart:n}){let{getSelectorForId:o}=bo(i=>i),s=j(),{setSelectedPartId:r,setSelectHandler:l}=_(),p=Gt(i=>{let f=$e(i);if(!f)return;let{nodeId:b,propKey:g}=f;if(!g){t(y=>y.kind==="part"?Ne:y);return}t(y=>y.kind==="part"&&y.nodeId===b&&y.propKey===g?y:{kind:"part",nodeId:b,propKey:g}),n?.(b)},[t,n]);Yt(()=>{l(p)},[l,p]);let d=e.kind==="part"?K(e.nodeId,e.propKey):null;return Yt(()=>{r(d)},[d,r]),{selectNode:Gt(i=>{t(()=>Ne);let f=o(i);f&&s.select(f)},[t,o,s]),openPartId:d}}import{useEffect as Xt,useState as yo}from"react";import{bindUndoKeys as wo,useEaselApi as vo}from"efficient-easel/easel";function ko(e){let t=ue(),[n,o]=yo(null);return Xt(()=>o(e.current),[e]),t.ownsDocument?typeof document>"u"?null:document:n}function Zi(e){let t=ue(),n=vo(),o=ko(e);Xt(()=>{if(!(t.ownsDocument||!o))return wo(o,n)},[t,n,o])}import{EaselCanvas as No}from"efficient-easel/easel";import{useEffect as Zt,useLayoutEffect as Po}from"react";var So=String.raw`(function (doc) {
|
|
2
|
-
if (doc.__sfFitWords) return;
|
|
3
|
-
var win = doc.defaultView;
|
|
4
|
-
var SELECTOR = "h1,h2,h3,h4,h5,h6,[class*='font-heading'],[class*='font-display']";
|
|
5
|
-
var MIN_SCALE = 0.3, MIN_PX = 16, SLACK = 1;
|
|
6
|
-
|
|
7
|
-
function measure(el) {
|
|
8
|
-
var widest = 0, current = 0, last = null, split = false, lastBlock = null;
|
|
9
|
-
function blockOf(n) {
|
|
10
|
-
for (var p = n.parentElement; p && p !== el; p = p.parentElement) {
|
|
11
|
-
var d = win.getComputedStyle(p).display;
|
|
12
|
-
if (d.indexOf("inline") !== 0 && d !== "contents") return p;
|
|
13
|
-
}
|
|
14
|
-
return el;
|
|
15
|
-
}
|
|
16
|
-
function close() { if (current > widest) widest = current; current = 0; last = null; }
|
|
17
|
-
var walker = doc.createTreeWalker(el, 5), range = doc.createRange(), node;
|
|
18
|
-
while ((node = walker.nextNode())) {
|
|
19
|
-
if (node.nodeType === 1) {
|
|
20
|
-
if (node.tagName === "BR" || node.tagName === "WBR") close();
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
var block = blockOf(node);
|
|
24
|
-
if (block !== lastBlock) close();
|
|
25
|
-
lastBlock = block;
|
|
26
|
-
var re = /(\S+)|(\s+)/g, m;
|
|
27
|
-
while ((m = re.exec(node.data))) {
|
|
28
|
-
if (m[2]) { close(); continue; }
|
|
29
|
-
range.setStart(node, m.index);
|
|
30
|
-
range.setEnd(node, m.index + m[0].length);
|
|
31
|
-
var rects = range.getClientRects();
|
|
32
|
-
for (var i = 0; i < rects.length; i++) {
|
|
33
|
-
var r = rects[i];
|
|
34
|
-
if (r.width <= 0) continue;
|
|
35
|
-
current += r.width;
|
|
36
|
-
if (last && r.top > last.top + last.height / 2) split = true;
|
|
37
|
-
last = r;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
close();
|
|
42
|
-
return { widest: widest, split: split };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function lineWidth(el) {
|
|
46
|
-
var cs = win.getComputedStyle(el);
|
|
47
|
-
return el.getBoundingClientRect().width - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight)
|
|
48
|
-
- parseFloat(cs.borderLeftWidth) - parseFloat(cs.borderRightWidth);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// ⚠️ THE HEADING ELEMENT IS NEVER TOUCHED — no style="", no data-*. This
|
|
52
|
-
// runs before React hydrates, and React 19 in development reports ANY
|
|
53
|
-
// attribute that differs from what it rendered ("a tree hydrated but some
|
|
54
|
-
// attributes didn't match"): first our inline font-size on the hero (which
|
|
55
|
-
// React owns via --heading-size), then, when that moved to a data-sf-fit
|
|
56
|
-
// attribute, the attribute itself. So the fitted size lives only in this
|
|
57
|
-
// script's own stylesheet, in <head>, addressed to each heading by its
|
|
58
|
-
// POSITION (":root>*:nth-child(2)>…"). A position goes stale when the page's
|
|
59
|
-
// structure changes, so the rules are rewritten in the MutationObserver
|
|
60
|
-
// callback, which runs before the next paint. !important so the size also
|
|
61
|
-
// beats a part's own inline size.
|
|
62
|
-
var head = doc.head || doc.documentElement;
|
|
63
|
-
var fitEl = doc.createElement("style");
|
|
64
|
-
fitEl.id = "storefront-fit-words-sizes";
|
|
65
|
-
head.appendChild(fitEl);
|
|
66
|
-
var fitted = new Map(); // heading -> fitted size, e.g. "43.8px"
|
|
67
|
-
|
|
68
|
-
function pathOf(el) {
|
|
69
|
-
var parts = [];
|
|
70
|
-
for (var e = el; e && e.parentElement; e = e.parentElement) {
|
|
71
|
-
var i = 1, s = e;
|
|
72
|
-
while ((s = s.previousElementSibling)) i++;
|
|
73
|
-
parts.unshift("*:nth-child(" + i + ")");
|
|
74
|
-
}
|
|
75
|
-
return ":root>" + parts.join(">");
|
|
76
|
-
}
|
|
77
|
-
function writeRules() {
|
|
78
|
-
var css = "";
|
|
79
|
-
fitted.forEach(function (size, el) {
|
|
80
|
-
if (!el.isConnected) { fitted.delete(el); return; }
|
|
81
|
-
css += pathOf(el) + "{font-size:" + size + " !important}";
|
|
82
|
-
});
|
|
83
|
-
if (fitEl.textContent !== css) fitEl.textContent = css;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function unfit(el) {
|
|
87
|
-
if (fitted.delete(el)) writeRules();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function fits(el) {
|
|
91
|
-
var m = measure(el);
|
|
92
|
-
return !m.split && m.widest <= lineWidth(el) + SLACK;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function fit(el) {
|
|
96
|
-
unfit(el);
|
|
97
|
-
if (lineWidth(el) <= 0) return; // hidden, or not laid out yet
|
|
98
|
-
if (fits(el)) return;
|
|
99
|
-
var set = parseFloat(win.getComputedStyle(el).fontSize);
|
|
100
|
-
if (!set) return;
|
|
101
|
-
var floor = Math.max(set * MIN_SCALE, MIN_PX);
|
|
102
|
-
if (floor >= set) return;
|
|
103
|
-
function size(px) { return Math.floor(px * 10) / 10 + "px"; }
|
|
104
|
-
// The SEARCH tries sizes on the element's own style and then puts that
|
|
105
|
-
// attribute back byte for byte (or removes it, if it had none), so nothing
|
|
106
|
-
// is left for React to see. A trial in a stylesheet instead restyles the
|
|
107
|
-
// whole page per step: a full pass on the Hartes home took 75–160ms at 4x
|
|
108
|
-
// CPU that way.
|
|
109
|
-
var hadStyle = el.hasAttribute("style"), origStyle = el.getAttribute("style");
|
|
110
|
-
function attempt(px) { el.style.setProperty("font-size", size(px), "important"); }
|
|
111
|
-
function done() { if (hadStyle) el.setAttribute("style", origStyle); else el.removeAttribute("style"); }
|
|
112
|
-
attempt(floor);
|
|
113
|
-
if (!fits(el)) { done(); return; } // even the floor does not fit: leave it as set
|
|
114
|
-
var lo = floor, hi = set;
|
|
115
|
-
for (var i = 0; i < 8; i++) {
|
|
116
|
-
var mid = (lo + hi) / 2;
|
|
117
|
-
attempt(mid);
|
|
118
|
-
if (fits(el)) lo = mid; else hi = mid;
|
|
119
|
-
}
|
|
120
|
-
done();
|
|
121
|
-
fitted.set(el, size(lo));
|
|
122
|
-
writeRules();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// What each heading measured right after we last fitted it, so the
|
|
126
|
-
// ResizeObserver below can tell a real change (a font swap, a rotate, a
|
|
127
|
-
// container that moved) from the size change our own write just caused.
|
|
128
|
-
var seen = new WeakMap();
|
|
129
|
-
function remember(el) {
|
|
130
|
-
var b = el.getBoundingClientRect();
|
|
131
|
-
seen.set(el, b.width + "x" + b.height);
|
|
132
|
-
}
|
|
133
|
-
function fitAndRemember(el) { fit(el); remember(el); }
|
|
134
|
-
|
|
135
|
-
// ⚠️ A ResizeObserver, NOT fonts.ready or a resize event, and the reason is
|
|
136
|
-
// WHEN it runs: after layout, BEFORE paint. The web font arriving re-wraps a
|
|
137
|
-
// fitted heading, and fonts.ready resolves only after that frame is painted —
|
|
138
|
-
// measured on the Hartes hero: a 42px jump in 2 of 3 loads. A size change
|
|
139
|
-
// reported here is fitted in the same frame, so the broken state is never
|
|
140
|
-
// drawn. It also covers a container that resizes.
|
|
141
|
-
var ro = new win.ResizeObserver(function (entries) {
|
|
142
|
-
for (var i = 0; i < entries.length; i++) {
|
|
143
|
-
var el = entries[i].target;
|
|
144
|
-
var b = el.getBoundingClientRect();
|
|
145
|
-
if (seen.get(el) === b.width + "x" + b.height) continue; // our own write
|
|
146
|
-
fitAndRemember(el);
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
function watch(el) { if (!seen.has(el)) { remember(el); ro.observe(el); } }
|
|
150
|
-
|
|
151
|
-
function fitAll() {
|
|
152
|
-
var els = doc.querySelectorAll(SELECTOR);
|
|
153
|
-
for (var i = 0; i < els.length; i++) { fitAndRemember(els[i]); watch(els[i]); }
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
var queued = 0, all = false, touched = new Set();
|
|
157
|
-
function run() {
|
|
158
|
-
queued = 0;
|
|
159
|
-
if (all) { all = false; touched.clear(); fitAll(); return; }
|
|
160
|
-
var els = Array.from(touched);
|
|
161
|
-
touched.clear();
|
|
162
|
-
for (var i = 0; i < els.length; i++) if (els[i].isConnected) { fitAndRemember(els[i]); watch(els[i]); }
|
|
163
|
-
}
|
|
164
|
-
function schedule() { if (!queued) queued = win.requestAnimationFrame(run); }
|
|
165
|
-
function scheduleAll() { all = true; schedule(); }
|
|
166
|
-
|
|
167
|
-
fitAll();
|
|
168
|
-
// A backstop only: a font that changes widths without changing any
|
|
169
|
-
// heading's box is not seen by the ResizeObserver.
|
|
170
|
-
if (doc.fonts && doc.fonts.ready) doc.fonts.ready.then(scheduleAll, function () {});
|
|
171
|
-
|
|
172
|
-
// …and the viewport WIDTH, which the ResizeObserver cannot stand in for: a
|
|
173
|
-
// heading sized to its own text (fit-content, a flex item) keeps the SAME box
|
|
174
|
-
// when the phone turns to 844, so nothing reports a change and it would stay
|
|
175
|
-
// shrunk. The probe's rotate check caught exactly that.
|
|
176
|
-
var lastWidth = win.innerWidth;
|
|
177
|
-
function onResize() {
|
|
178
|
-
if (win.innerWidth === lastWidth) return; // a phone's toolbar changing HEIGHT is not our business
|
|
179
|
-
lastWidth = win.innerWidth;
|
|
180
|
-
scheduleAll();
|
|
181
|
-
}
|
|
182
|
-
win.addEventListener("resize", onResize);
|
|
183
|
-
|
|
184
|
-
var mo = new win.MutationObserver(function (records) {
|
|
185
|
-
// Positions first: a node added or removed anywhere can shift the
|
|
186
|
-
// nth-child path of a fitted heading, and this callback runs before paint.
|
|
187
|
-
if (fitted.size) {
|
|
188
|
-
for (var q = 0; q < records.length; q++) if (records[q].type === "childList") { writeRules(); break; }
|
|
189
|
-
}
|
|
190
|
-
for (var i = 0; i < records.length; i++) {
|
|
191
|
-
var r = records[i];
|
|
192
|
-
var target = r.target.nodeType === 1 ? r.target : r.target.parentElement;
|
|
193
|
-
var own = target && target.closest(SELECTOR);
|
|
194
|
-
if (own) touched.add(own);
|
|
195
|
-
for (var j = 0; j < r.addedNodes.length; j++) {
|
|
196
|
-
var n = r.addedNodes[j];
|
|
197
|
-
if (n.nodeType !== 1) continue;
|
|
198
|
-
if (n.matches(SELECTOR)) touched.add(n);
|
|
199
|
-
var inner = n.querySelectorAll(SELECTOR);
|
|
200
|
-
for (var k = 0; k < inner.length; k++) touched.add(inner[k]);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
if (touched.size) schedule();
|
|
204
|
-
});
|
|
205
|
-
mo.observe(doc.body, { childList: true, subtree: true, characterData: true });
|
|
206
|
-
|
|
207
|
-
doc.__sfFitWords = function stop() {
|
|
208
|
-
win.removeEventListener("resize", onResize);
|
|
209
|
-
ro.disconnect();
|
|
210
|
-
mo.disconnect();
|
|
211
|
-
if (queued) win.cancelAnimationFrame(queued);
|
|
212
|
-
fitted.clear();
|
|
213
|
-
fitEl.remove();
|
|
214
|
-
delete doc.__sfFitWords;
|
|
215
|
-
};
|
|
216
|
-
// For the probe and for debugging: which headings are fitted, at what size,
|
|
217
|
-
// and the sheet that holds it (disable it to read a heading's set size).
|
|
218
|
-
doc.__sfFitWords.fitted = fitted;
|
|
219
|
-
doc.__sfFitWords.sheet = fitEl;
|
|
220
|
-
})(document);`,Eo="storefront-fit-words";function Vt(e){let t=e.createElement("script");return t.id=Eo,t.textContent=So,(e.head??e.documentElement).appendChild(t),()=>{e.__sfFitWords?.(),t.remove()}}import{Fragment as To,jsx as jt,jsxs as Ro}from"react/jsx-runtime";var Io=`
|
|
221
|
-
[${pe}][${pe}] { cursor: text; }
|
|
222
|
-
[${N}][${N}][${N}] {
|
|
223
|
-
outline: 1px solid ${mt.accent};
|
|
224
|
-
outline-offset: 2px;
|
|
225
|
-
}
|
|
226
|
-
[${N}][${N}]:has([${N}]),
|
|
227
|
-
[data-puck-overlay-portal][data-puck-overlay-portal]:has([${N}]) {
|
|
228
|
-
outline: none;
|
|
229
|
-
}
|
|
230
|
-
`;function Ce({children:e,document:t}){let{theme:n,themeMode:o,themeSwitchShown:s}=X(),r=Xe(n);return Zt(()=>{if(t)return St(t,{mode:o,switchShown:s})},[t,o,s]),Zt(()=>{if(t)return Et(t,r)},[t,r]),Po(()=>{if(t)return Vt(t)},[t]),Ro(To,{children:[jt(It,{}),jt("style",{children:Io}),e]})}import{Fragment as Jt,jsx as xe}from"react/jsx-runtime";function Co({children:e,componentId:t}){let{selectedPartId:n}=_();return qe(n,t)?xe(Jt,{}):xe(Jt,{children:e})}function hs(e){let{mirrorHostStyles:t}=Pt(),n=Tt();return xe(No,{...e,metadata:e.metadata??n,height:"fill",mirrorStyles:t,frameWrapper:Ce,overlay:Co})}export{pn as a,Fo as b,_o as c,At as d,gn as e,Go as f,Yo as g,Xo as h,jo as i,Jo as j,Qo as k,Ft as l,Ne as m,Ai as n,Fi as o,_i as p,Mi as q,go as r,Ui as s,ko as t,Zi as u,hs as v};
|