@iksnerd/blazon 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -16
- package/dist/chunks/{site-builder-vpzUWoiA.js → site-builder-CPfjBOmR.js} +1312 -1285
- package/dist/cli/index.js +1 -1
- package/dist/core/checker/catalogue.d.ts +16 -0
- package/dist/core/checker/catalogue.d.ts.map +1 -1
- package/dist/core/docs/directives.d.ts +9 -0
- package/dist/core/docs/directives.d.ts.map +1 -1
- package/dist/core/docs/parser.d.ts.map +1 -1
- package/dist/core/tokens/walk.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins/roles/roles.d.ts +4 -0
- package/dist/plugins/roles/roles.d.ts.map +1 -1
- package/dist/ui/assets/{index-DluSqfla.css → index-D0WCUmtA.css} +1 -1
- package/dist/ui/assets/{index-BdbihVvH.js → index-DhSc0Zxv.js} +45 -47
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
- package/plugins/blazon.print-book/README.md +3 -1
- package/plugins/blazon.print-book/bin/blazon-blazon.print-book./360/237/224/214 +7 -1
- package/plugins/shipped.lock +1 -1
- package/template/docs/01-principles.md +1 -1
|
@@ -11,67 +11,65 @@ Error generating stack: `+e.message+`
|
|
|
11
11
|
`:n})})}function th({...e}){return(0,Z.jsx)(Mp,{"data-slot":`dialog`,...e})}function nh({...e}){return(0,Z.jsx)(Ip,{"data-slot":`dialog-trigger`,...e})}function rh({...e}){return(0,Z.jsx)(mp,{"data-slot":`dialog-portal`,...e})}function ih({className:e,...t}){return(0,Z.jsx)(qf,{"data-slot":`dialog-overlay`,className:$(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function ah({className:e,children:t,showCloseButton:n=!0,...r}){return(0,Z.jsxs)(rh,{children:[(0,Z.jsx)(ih,{}),(0,Z.jsxs)(fp,{"data-slot":`dialog-content`,className:$(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,Z.jsxs)(Jf,{"data-slot":`dialog-close`,render:(0,Z.jsx)(Tu,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Z.jsx)(hd,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function oh({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`dialog-header`,className:$(`flex flex-col gap-2`,e),...t})}function sh({className:e,...t}){return(0,Z.jsx)(Np,{"data-slot":`dialog-title`,className:$(`font-heading text-base leading-none font-medium`,e),...t})}function ch({className:e,...t}){return(0,Z.jsx)(Yf,{"data-slot":`dialog-description`,className:$(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}var lh=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function uh(){return _.useContext(lh)}function dh(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=K(i),[,o]=_.useState(0),s=Ge(ph).current,c=Ge(fh).current,l=_.useRef(0),u=_.useRef(!0),d=_.useRef(null),f=_.useRef(null),p=K(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=K((e,t)=>{c.set(e,t),p()}),h=K(e=>{c.delete(e),p()}),g=K(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function v(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!gh(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&_h(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=hh(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=K(()=>{let[e,t]=mh(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});v(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});G(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),G(()=>{u.current&&y()}),G(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=K(e=>(s.add(e),()=>{s.delete(e)})),x=_.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,Z.jsx)(lh.Provider,{value:x,children:t})}function fh(){return new Map}function ph(){return new Set}function mh(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>_h(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function hh(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function gh(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function _h(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var vh=_.createContext(void 0);function yh(){let e=_.useContext(vh);if(e===void 0)throw Error(qe(64));return e}var bh=`data-activation-direction`,xh={tabActivationDirection:e=>({[bh]:e})},Sh=_.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=_.useRef([]),[f,p]=_.useState(()=>new Map),[m,h]=qd({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[v,y]=_.useState(()=>new Map),b=_.useRef(void 0),x=_.useCallback(e=>Ch(v,e),[v]),[S,C]=_.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:w,tabActivationDirection:T}=S,E=T,D=!1;w!==m&&(E=wh(w,m,a,v),D=w!=null&&m!=null&&x(m)==null);let O=D?w:m,k=w!==O||T!==E;G(()=>{k&&C({previousValue:O,tabActivationDirection:E})},[O,k,E]);let A=K((e,t)=>{t.activationDirection=wh(m,e,a,v),i?.(e,t),t.isCanceled||h(()=>e)}),j=K((e,t)=>{i?.(e,Ya(t,void 0,void 0,{activationDirection:`none`}))}),M=K((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),N=_.useCallback(e=>f.get(e),[f]),P=_.useCallback(e=>{for(let t of v.values())if(e===t.value)return t.id},[v]),F=_.useMemo(()=>({getTabElementBySelectedValue:x,getTabIdByPanelValue:P,getTabPanelIdByValue:N,onValueChange:A,orientation:a,registerMountedTabPanel:M,setTabMap:y,tabActivationDirection:E,value:m}),[x,P,N,A,a,M,y,E,m]),I=_.useMemo(()=>{for(let e of v.values())if(e.value===m)return e},[v,m]),L=_.useMemo(()=>{for(let e of v.values())if(!e.disabled)return e.value},[v]),R=_.useRef(!u),z=_.useRef(r),ee=_.useRef(u),te=_.useRef(!1);G(()=>{if(g)return;function e(e,t){h(()=>e),C({previousValue:e,tabActivationDirection:`none`}),j(e,t),R.current=!1}if(v.size===0){te.current&&m!==null&&!b.current?.isConnected&&e(null,ao);return}te.current=!0,b.current=v.keys().next().value;let t=I?.disabled,n=I==null&&m!==null;if(!t&&m===z.current&&(ee.current=!1),ee.current&&t&&m===z.current)return;let r=R.current;if(t||n){let n=L??null;if(m===n){R.current=!1;return}let i=ao;r?i=oo:t&&(i=io),e(n,i)}else r&&I!=null&&(j(m,oo),R.current=!1)},[L,g,j,I,h,v,m]);let B=Vi(`div`,e,{state:{orientation:a,tabActivationDirection:E},ref:t,props:l,stateAttributesMapping:xh});return(0,Z.jsx)(vh.Provider,{value:F,children:(0,Z.jsx)(dh,{elementsRef:d,children:B})})});function Ch(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function wh(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=Ch(r,e),c=Ch(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var Th=`data-composite-item-active`;function Eh(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=uh(),u=_.useRef(-1),[d,f]=_.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=_.useRef(null),h=_.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return G(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function Dh(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Va(),{ref:i,index:a}=Eh(e),o=n===a,s=_.useRef(null),c=gi(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}var Oh=_.createContext(void 0);function kh(){let e=_.useContext(Oh);if(e===void 0)throw Error(qe(65));return e}var Ah=_.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=yh(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:v}=kh(),{highlightedIndex:y,onHighlightedIndexChange:b}=Va(),x=Jd(o),{compositeProps:S,compositeRef:C,index:w}=Dh({metadata:_.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),T=a===u,E=_.useRef(!1),D=_.useRef(null),O=K(e=>{D.current?.(),D.current=e?g(e):null});G(()=>{if(E.current){E.current=!1;return}if(!(T&&w>-1&&y!==w))return;let e=v;if(e!=null){let t=Sn(J(e));if(t&&X(e,t))return}r||b(w)},[T,w,y,b,r,v]);let{getButtonProps:k,buttonRef:A}=Wa({disabled:r,native:s,focusableWhenDisabled:!0}),j=d(a),M=_.useRef(!1),N=_.useRef(!1);function P(e){f(a,Ya(Xa,e.nativeEvent,void 0,{activationDirection:`none`}))}function F(e){T||r||P(e)}function I(e){T||r||h&&(!M.current||N.current)&&P(e)}function L(e){if(T||r)return;M.current=!0,N.current=e.button===0;let t=J(e.currentTarget);function n(){M.current=!1,N.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return Vi(`button`,e,{state:{disabled:r,active:T,orientation:p,tabActivationDirection:m},ref:[t,A,C,O],props:[S,{role:`tab`,"aria-controls":j,"aria-selected":T,id:x,onClick:F,onFocus:I,onPointerDown:L,[Th]:T?``:void 0,onKeyDownCapture(){E.current=!0}},l,k],stateAttributesMapping:xh})}),jh=`data-index`,Mh={...xh,...jn},Nh=_.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=yh(),p=Jd(),{ref:m,index:h}=Eh(),g=r===c,{mounted:v,transitionStatus:y,setMounted:b}=cs(g),x=!v,S=l(r),C={hidden:x,orientation:u,tabActivationDirection:d,transitionStatus:y},w=_.useRef(null),T=Vi(`div`,e,{state:C,ref:[t,m,w],props:[{"aria-labelledby":S,hidden:x,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:Xi(!g),[jh]:h},s],stateAttributesMapping:Mh});return aa({open:g,ref:w,onComplete(){g||b(!1)}}),G(()=>{if(!(p==null||x&&!a))return f(r,p)},[x,a,r,p,f]),a||v?T:null});function Ph(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Fh(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=Ve}=e,[p,m]=_.useState(0),h=r!=null,g=_.useRef(null),v=gi(g,c),y=_.useRef([]),b=_.useRef(!1),x=_.useRef(null),S=o??p,C=K((e,t=!1)=>{if(x.current=y.current[e]??null,(s??m)(e),t){let t=y.current[e];op(g.current,t,a,n)}}),w=K(e=>{if(e.size===0)return;if(b.current){let e=y.current,t=e.indexOf(x.current);if(t===-1){let t=e[S];!t||Ir(e,S,d)?C(Ih(e,d)):x.current=t}else t!==S&&C(t);return}b.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)C(i);else if(Ir(t,S,d)){let e=Fr(t,{disabledIndices:d});Mr(t,e)||C(e)}op(g.current,r,a,n)});G(()=>{if(d==null||o!=null||!b.current)return;let e=y.current;if(Ir(e,S,d)){let t=Fr(e,{disabledIndices:d});Mr(e,t)||C(t)}},[d,o,S,y,C]);let T=K((e,t,n)=>i?i(e,t,n,y):n),E=K(e=>{let o=e.key===`Home`||e.key===`End`;if(!np.has(e.key)||!l&&o||Lh(e,f)||!g.current)return;let s=a===`rtl`,c=s?ep:tp,p=s?tp:ep,m=n===`vertical`?$f:c,_=n===`vertical`?Qf:p,v=wn(e.nativeEvent);if(v!=null&&ap(v)&&!Ph(v)){let t=v.selectionStart,n=v.selectionEnd,r=v.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=S,x=Nr(y,d),w=Pr(y,d);r!=null&&(b=r({disabledIndices:d,elementsRef:y,event:e,highlightedIndex:S,loopFocus:t,maxIndex:w,minIndex:x,onLoop:T,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=x:e.key===`End`&&(b=w)),b===S&&(E||D)&&(t&&b===w&&E?(b=x,i&&(b=i(e,S,b,y))):t&&b===x&&D?(b=w,i&&(b=i(e,S,b,y))):b=Fr(y.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==S&&!Mr(y.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),C(b,!0),queueMicrotask(()=>{y.current[b]?.focus()}))});return{props:{ref:v,onFocus(e){let t=g.current,n=wn(e.nativeEvent);t&&n!=null&&ap(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:y,onMapChange:w,relayKeyboardEvent:E}}function Ih(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!Ir(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function Lh(e,t){for(let n of rp)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Rh(e){let{render:t,className:n,style:r,refs:i=Ve,props:a=Ve,state:o=He,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:v,disabledIndices:y,modifierKeys:b,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=Fh({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:v,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:il(),disabledIndices:y,modifierKeys:b}),A=Vi(S,e,{state:o,ref:i,props:[w,...a,C],stateAttributesMapping:s}),j=_.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:k}),[T,E,x,k]);return(0,Z.jsx)(Ba.Provider,{value:j,children:(0,Z.jsx)(dh,{elementsRef:D,onMapChange:e=>{h?.(e),O(e)},children:A})})}var zh=_.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=yh(),[d,f]=_.useState(0),[p,m]=_.useState(null),h=_.useRef(new Set),g=_.useRef(new Set),v=_.useRef(null);G(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return v.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),v.current=null}},[p]);let y=K(e=>(h.current.add(e),()=>{h.current.delete(e)})),b=K(e=>(g.current.add(e),v.current?.observe(e),()=>{g.current.delete(e),v.current?.unobserve(e)})),x={orientation:c,tabActivationDirection:u},S={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},C=_.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:b,tabsListElement:p}),[n,y,b,p]);return(0,Z.jsx)(Oh.Provider,{value:C,children:(0,Z.jsx)(Rh,{render:a,className:r,style:o,state:x,refs:[t,m],props:[S,s],stateAttributesMapping:xh,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:Ve})})});function Bh({className:e,orientation:t=`horizontal`,...n}){return(0,Z.jsx)(Sh,{"data-slot":`tabs`,"data-orientation":t,className:$(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Vh=Cu(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Hh({className:e,variant:t=`default`,...n}){return(0,Z.jsx)(zh,{"data-slot":`tabs-list`,"data-variant":t,className:$(Vh({variant:t}),e),...n})}function Uh({className:e,...t}){return(0,Z.jsx)(Ah,{"data-slot":`tabs-trigger`,className:$(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function Wh({className:e,...t}){return(0,Z.jsx)(Nh,{"data-slot":`tabs-content`,className:$(`flex-1 text-sm outline-none`,e),...t})}function Gh(){let e=Gm();return e?(0,Z.jsxs)(th,{children:[(0,Z.jsxs)(nh,{render:(0,Z.jsx)(Tu,{variant:`ghost`,size:`sm`,className:`hidden md:inline-flex`}),children:[(0,Z.jsx)(sd,{}),`Connect your agent`]}),(0,Z.jsxs)(ah,{className:`max-h-[85svh] overflow-y-auto sm:max-w-2xl`,children:[(0,Z.jsxs)(oh,{children:[(0,Z.jsx)(sh,{children:`Connect your agent`}),(0,Z.jsxs)(ch,{children:[`blazon-mcp lets a coding agent ask blazon about this brand as tool calls. Paste one of these into your client. Nothing is written for you. The brand folder is`,` `,(0,Z.jsx)(`code`,{className:`font-mono text-[0.9em]`,children:e.brand}),`. The server runs no plugin, but what the brand says reaches your agent as tool results, so use a folder you trust.`]})]}),(0,Z.jsxs)(Bh,{defaultValue:e.clients[0]?.client,children:[(0,Z.jsx)(Hh,{className:`h-auto flex-wrap`,children:e.clients.map(e=>(0,Z.jsx)(Uh,{value:e.client,children:e.title},e.client))}),e.clients.map(e=>(0,Z.jsxs)(Wh,{value:e.client,className:`mt-3 flex flex-col gap-3`,children:[e.note&&(0,Z.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:e.note}),e.snippets.map(e=>(0,Z.jsxs)(qm,{size:`sm`,children:[(0,Z.jsxs)(Jm,{children:[(0,Z.jsx)(Ym,{children:e.label}),(0,Z.jsx)(Zm,{value:e.text})]}),(0,Z.jsx)(Qm,{wrap:!0,children:e.text})]},e.label))]},e.client))]})]})]}):null}function Kh({className:e,...t}){return(0,Z.jsx)(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:$(e),...t})}function qh({className:e,...t}){return(0,Z.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:$(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,e),...t})}function Jh({className:e,...t}){return(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:$(`inline-flex items-center gap-1`,e),...t})}function Yh({className:e,...t}){return(0,Z.jsx)(`span`,{"data-slot":`breadcrumb-page`,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:$(`font-normal text-foreground`,e),...t})}function Xh({children:e,className:t,...n}){return(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:$(`[&>svg]:size-3.5`,t),...n,children:e??(0,Z.jsx)(Gu,{})})}function Zh(e,t,n){let r=new Set;for(let i=e;i&&!r.has(i.path);i=i.aliasOf?t.find(e=>e.path===i.aliasOf):void 0){r.add(i.path);let e=i.blazon.logo;if(Array.isArray(e?.deny)&&e.deny.includes(n))return{path:i.path,...typeof e.reason==`string`&&{reason:e.reason}}}}var Qh=4;function $h(e){if(window.innerHeight+window.scrollY>=document.documentElement.scrollHeight-2)return e.at(-1)?.id;let t=e[0]?.id;for(let n of e){let e=document.getElementById(n.id);if(!e)continue;let r=parseFloat(getComputedStyle(e).scrollMarginTop)||0;e.getBoundingClientRect().top-r<=8&&(t=n.id)}return t}function eg(){let e=(0,_.useRef)(null),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)();(0,_.useEffect)(()=>{let t=[...(e.current?.closest(`main`))?.querySelectorAll(`section[data-section]`)??[]],r=new Map;for(let e of t)r.set(e.dataset.section,(r.get(e.dataset.section)??0)+1);let i=t.map(e=>({id:e.id,label:r.get(e.dataset.section)>1&&e.dataset.path?`${e.dataset.section} · ${e.dataset.path}`:e.dataset.section}));n(e=>JSON.stringify(e)===JSON.stringify(i)?e:i)}),(0,_.useEffect)(()=>{if(t.length<Qh)return;let e=0,n=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>i($h(t)))};return n(),window.addEventListener(`scroll`,n,{passive:!0}),window.addEventListener(`resize`,n),()=>{cancelAnimationFrame(e),window.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n)}},[t]);let a=t.some(e=>e.id===r)?r:void 0;return(0,_.useEffect)(()=>{let t=e.current?.firstElementChild,n=t?.querySelector(`[aria-current="true"]`);t instanceof HTMLElement&&n&&(n.offsetLeft<t.scrollLeft||n.offsetLeft+n.offsetWidth>t.scrollLeft+t.clientWidth)&&t.scrollTo?.({left:n.offsetLeft-24})},[a]),(0,Z.jsx)(`nav`,{ref:e,"data-section-index":``,"aria-label":`On this page`,hidden:t.length<Qh,className:`sticky top-14 z-[5] border-b bg-background/95 backdrop-blur xl:h-0 xl:border-b-0 xl:bg-transparent xl:backdrop-blur-none`,children:t.length>=Qh&&(0,Z.jsxs)(`div`,{className:`flex gap-1.5 overflow-x-auto px-[clamp(24px,5vw,72px)] py-2.5 [scrollbar-width:none] xl:absolute xl:top-10 xl:right-[clamp(24px,5vw,72px)] xl:max-h-[calc(100vh-8rem)] xl:w-56 xl:flex-col xl:gap-0 xl:overflow-y-auto xl:px-0 xl:py-0`,children:[(0,Z.jsx)(`p`,{className:`hidden pb-3 pl-3 text-xs font-semibold tracking-wide text-muted-foreground uppercase xl:block`,children:`On this page`}),t.map(e=>(0,Z.jsx)(`button`,{type:`button`,"aria-current":e.id===a?`true`:void 0,className:$(`shrink-0 rounded-[2px] border px-3 py-1 text-[13px] whitespace-nowrap transition-colors hover:bg-muted`,`xl:rounded-none xl:border-0 xl:border-l-2 xl:border-transparent xl:py-1.5 xl:text-left xl:whitespace-normal xl:text-muted-foreground xl:hover:bg-transparent xl:hover:text-foreground`,e.id===a&&`border-primary bg-primary text-primary-foreground hover:bg-primary xl:border-l-primary xl:bg-transparent xl:font-semibold xl:text-foreground`),onClick:()=>document.getElementById(e.id)?.scrollIntoView?.({block:`start`,behavior:window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`}),children:e.label},e.id))]})})}var tg=`px-[clamp(24px,5vw,72px)]`;function ng({label:e,title:t,intro:n,children:r}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`header`,{className:$(tg,`border-b pt-12 pb-10`),children:[(0,Z.jsx)(`p`,{className:`mb-3 text-[13px] font-semibold`,children:e}),(0,Z.jsx)(`h1`,{className:`font-heading text-[clamp(32px,4.5vw,56px)] leading-[1.05] font-semibold tracking-[-0.03em]`,children:t}),n&&(0,Z.jsx)(`p`,{className:`mt-4 max-w-[40em] text-muted-foreground`,children:n}),r]}),(0,Z.jsx)(eg,{})]})}function rg({title:e,trail:t}){return(0,Z.jsxs)(`footer`,{className:$(tg,`mt-12 flex justify-between gap-6 border-t py-5 text-xs text-muted-foreground`),children:[(0,Z.jsx)(`span`,{children:e}),(0,Z.jsx)(`span`,{children:t})]})}function ig({children:e}){return(0,Z.jsx)(`div`,{"data-page-body":``,className:tg,children:e})}function ag(e,t){let n=[typeof t==`string`?t:void 0,e].filter(Boolean).join(` `);return n?`section-${n.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}`:void 0}function og({heading:e,path:t,wide:n,children:r}){let i=ag(t,e);return(0,Z.jsxs)(`section`,{id:i,"data-section":typeof e==`string`?e:void 0,"data-path":t,className:$(`grid scroll-mt-28 gap-x-12 gap-y-6 border-b py-10 last:border-b-0`,n?`grid-cols-1`:`lg:grid-cols-[minmax(140px,220px)_minmax(0,1fr)]`),children:[(0,Z.jsxs)(`div`,{children:[e&&(0,Z.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:e}),t&&(0,Z.jsx)(`code`,{className:`mt-1 block font-mono text-[0.86em] text-muted-foreground`,children:t})]}),(0,Z.jsx)(`div`,{className:$(`min-w-0`,!n&&`max-w-[980px]`),children:r})]})}function sg({children:e}){return(0,Z.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:e})}var cg=[`radius`,`square`,`stroke`,`tracking`,`fontSize`,`frame`,`opacity`,`border`,`bar`];function lg(e){let t=e.blazon.preview;if(t&&cg.includes(t))return t;let n=e.name.toLowerCase(),r=e.path.toLowerCase();if(e.type===`border`)return`border`;if(e.type===`number`)return/opacity|alpha/.test(n)?`opacity`:void 0;if(e.type===`dimension`)return/radius|radii|corner/.test(r)?`radius`:/letterspacing|tracking|kerning/.test(n)?`tracking`:/fontsize/.test(n)?`fontSize`:/stroke|linewidth|borderwidth/.test(n)?`stroke`:/canvas|artboard|frame/.test(n)?`frame`:/size|grid/.test(n)?`square`:`bar`}function ug(e){let t=String(e).trim().match(/^(-?[\d.]+)(px|rem|em)?$/);if(!t)return;let n=Number(t[1]);return t[2]===`rem`||t[2]===`em`?n*16:n}var dg=[`dots`,`lines`,`diagonal`,`grid`,`checks`],fg=`brand-assets`,pg=16;function mg(e){return e.slice(0,Math.max(0,e.lastIndexOf(`.`)))}function hg(e){return e.slice(e.lastIndexOf(`.`)+1)}function gg(e){let t=e?.type===`dimension`?String(e.value).match(/^(-?[\d.]+)(px|rem)$/):void 0;if(!t)return;let n=Number(t[1])*(t[2]===`rem`?pg:1);return Number.isFinite(n)?n:void 0}var _g=(e,t)=>{let n=t.replace(/\.\*$/,``);return{clean:n,tokens:e.filter(e=>e.path.startsWith(`${n}.`))}};function vg(e,t){return new Map(e.filter(e=>mg(e.path)===t).map(e=>[hg(e.path),e]))}function yg(e,t){let{clean:n,tokens:r}=_g(e.items,t),i=[...new Set(r.filter(e=>[`width`,`height`].includes(hg(e.path))).map(e=>mg(e.path)))];if(i.length===0)return{found:[],problems:[`no format at ${n} (a group with dimension tokens width and height)`]};let a=[],o=[];for(let t of i){let n=vg(e.items,t),r=gg(n.get(`width`)),i=gg(n.get(`height`));if(!r||!i||r<=0||i<=0){o.push(`${t}: needs positive px or rem dimension tokens width and height`);continue}let s=n.get(`margin`),c=s?gg(s):void 0,l=n.get(`columns`);s&&c===void 0&&o.push(`${t}.margin must be a px or rem dimension`),l&&!(l.type===`number`&&Number.isInteger(l.value)&&Number(l.value)>=1)&&o.push(`${t}.columns must be a whole number of at least 1`),a.push({path:t,name:hg(t),width:r,height:i,...c!==void 0&&{margin:c},...l&&l.type===`number`&&{columns:Number(l.value)}})}return{found:a,problems:o}}function bg(e,t){let n=t.replace(/\.\*$/,``),r=e.groupMeta.filter(e=>(e.path===n||e.path.startsWith(`${n}.`))&&e.blazon.pattern!==void 0);if(r.length===0)return{found:[],problems:[`no pattern at ${n} (a group with dev.blazon.pattern set to ${dg.join(`, `)})`]};let i=[],a=[];for(let{path:t,blazon:n}of r){let r=n.pattern;if(!dg.includes(r)){a.push(`${t}: pattern must be one of ${dg.join(`, `)}, got ${JSON.stringify(r)}`);continue}let o=vg(e.items,t),s=gg(o.get(`size`));if(!s||s<=0){a.push(`${t}: needs a positive px or rem dimension token size`);continue}let c=o.has(`stroke`)?gg(o.get(`stroke`)):s/8,l=e=>{let t=o.get(e);if(t)return t.type===`color`||t.type===`gradient`?String(t.value):!1},u=l(`ink`),d=l(`ground`);(c===void 0||c<=0)&&a.push(`${t}.stroke must be a positive px or rem dimension`),u===!1&&a.push(`${t}.ink must be a color or gradient`),d===!1&&a.push(`${t}.ground must be a color or gradient`),c===void 0||c<=0||u===!1||d===!1||i.push({path:t,name:hg(t),kind:r,size:s,stroke:c,...u&&{ink:u},...d&&{ground:d}})}return{found:i,problems:a}}var xg=[`color`,`gradient`];function Sg(e){return xg.includes(e.type??``)}function Cg(e){return e.type===`border`}function wg(e,t){let n=t.replace(/\.\*$/,``),r=e.find(e=>e.path===n);return r?[r]:e.filter(e=>e.path.startsWith(`${n}.`))}function Tg(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`)}function Eg(e,t,n=`span`){return`<${n} class="blazon-badge" data-color-badge style="background:${Tg(e)};color:${O(e)}">${Tg(t)}</${n}>`}var Dg=/(?<![\w&#])(?:#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})(?![0-9a-zA-Z])|rgba?\(\s*\d{1,3}\s*[,\s]\s*\d{1,3}\s*[,\s]\s*\d{1,3}(?:\s*[,/]\s*[\d.]+%?)?\s*\))/g,Og=`pre, a, script, style, [data-color-badge]`;function kg(e){if(!/#[0-9a-fA-F]{6}|rgba?\(/.test(e))return e;let t=new DOMParser().parseFromString(`<div>${e}</div>`,`text/html`),n=t.body.firstElementChild,r=t.createTreeWalker(n,NodeFilter.SHOW_TEXT),i=[];for(let e=r.nextNode();e;e=r.nextNode())i.push(e);for(let e of i){if(e.parentElement?.closest(Og))continue;let n=[...e.data.matchAll(Dg)];if(n.length===0)continue;let r=e.parentElement?.closest(`code`);if(r&&r.childNodes.length===1&&n.length===1&&n[0][0]===e.data.trim()){let e=n[0][0],i=t.createElement(`code`);i.className=`blazon-badge`,i.setAttribute(`data-color-badge`,``),i.style.background=e,i.style.color=O(e),i.textContent=e,r.replaceWith(i);continue}let i=t.createDocumentFragment(),a=0;for(let r of n){let n=r.index;n>a&&i.append(e.data.slice(a,n));let o=t.createElement(`span`);o.className=`blazon-badge`,o.setAttribute(`data-color-badge`,``),o.style.background=r[0],o.style.color=O(r[0]),o.textContent=r[0],i.append(o),a=n+r[0].length}a<e.data.length&&i.append(e.data.slice(a)),e.replaceWith(i)}return n.innerHTML}function Ag(e,t){return wg(e.tokens.items,t)}function jg(e){return`${he.find(t=>t.has(e))?.hash??`#tokens/all`}?token=${encodeURIComponent(e.path)}`}function Mg(e,t){return e.replace(/<code>([A-Za-z][\w-]*(?:\.[\w-]+)+(?:\.\*)?)<\/code>/g,(e,n)=>{let[r]=Ag(t,n);if(!r)return e;let i=!n.endsWith(`.*`)&&(r.type===`color`||r.type===`gradient`)?Eg(String(r.value),n,`code`):e;return`<a class="blazon-token-link" href="${Tg(jg(r))}" title="${Tg(`${r.path}: ${String(r.value)}`)}">${i}</a>`})}function Ng({paint:e,children:t}){let n=k(e);return(0,Z.jsx)(`span`,{"data-color-badge":!0,className:`blazon-badge [overflow-wrap:anywhere]`,style:{background:e,color:O(e)},title:n===e?void 0:e,children:t??n})}var Pg=96;function Fg({children:e}){return(0,Z.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:e})}function Ig({token:e}){return(0,Z.jsx)(`span`,{"data-preview":`radius`,className:`block size-24 border-2 border-foreground`,style:{borderRadius:String(e.value)}})}function Lg({token:e}){let t=Math.max(1,ug(e.value)??24),n=t<=48?1:t/24,r=[];for(let e=n;e<t;e+=n)r.push((0,Z.jsx)(`line`,{x1:e,y1:0,x2:e,y2:t},`v${e}`),(0,Z.jsx)(`line`,{x1:0,y1:e,x2:t,y2:e},`h${e}`));return(0,Z.jsxs)(`span`,{className:`flex flex-col items-start gap-1`,children:[(0,Z.jsxs)(`svg`,{"data-preview":`square`,viewBox:`0 0 ${t} ${t}`,width:Pg,height:Pg,"aria-hidden":`true`,className:`text-foreground`,children:[(0,Z.jsx)(`g`,{stroke:`currentColor`,strokeOpacity:`0.15`,strokeWidth:t/Pg,children:r}),(0,Z.jsx)(`rect`,{x:0,y:0,width:t,height:t,fill:`none`,stroke:`currentColor`,strokeWidth:2*t/Pg})]}),(0,Z.jsxs)(Fg,{children:[t,` × `,t]})]})}function Rg({token:e}){let t=ug(e.value)??1;return(0,Z.jsxs)(`span`,{className:`flex flex-col items-start gap-1`,children:[(0,Z.jsxs)(`svg`,{"data-preview":`stroke`,viewBox:`0 0 24 24`,width:Pg,height:Pg,"aria-hidden":`true`,className:`text-foreground`,children:[(0,Z.jsx)(`rect`,{x:.25,y:.25,width:23.5,height:23.5,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.15`,strokeWidth:.25}),(0,Z.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeWidth:String(t),strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Z.jsx)(`circle`,{cx:12,cy:12,r:8}),(0,Z.jsx)(`path`,{d:`M8.5 12.5l2.5 2.5 5-6`})]})]}),(0,Z.jsxs)(Fg,{children:[`×`,Pg/24,` on a 24 grid`]})]})}function zg({token:e}){return(0,Z.jsx)(`span`,{"data-preview":`tracking`,className:`font-heading text-2xl font-semibold`,style:{letterSpacing:String(e.value)},children:`Identity`})}function Bg({token:e}){return(0,Z.jsx)(`span`,{className:`block max-w-full overflow-hidden`,children:(0,Z.jsx)(`span`,{"data-preview":`fontSize`,className:`block font-heading leading-none font-semibold`,style:{fontSize:String(e.value)},children:`Aa`})})}function Vg({token:e}){let t=ug(e.value);return(0,Z.jsx)(`span`,{"data-preview":`frame`,className:`flex size-24 items-center justify-center rounded-sm border-2 border-dashed border-muted-foreground/60`,children:(0,Z.jsx)(Fg,{children:t===void 0?String(e.value):`${t} × ${t}`})})}function Hg({token:e}){return(0,Z.jsxs)(`span`,{"data-preview":`opacity`,className:`flex items-end gap-2`,children:[(0,Z.jsxs)(`span`,{className:`flex flex-col items-center gap-1`,children:[(0,Z.jsx)(`span`,{className:`block size-10 rounded-md bg-primary`}),(0,Z.jsx)(Fg,{children:`1`})]}),(0,Z.jsxs)(`span`,{className:`flex flex-col items-center gap-1`,children:[(0,Z.jsx)(`span`,{"data-faded":!0,className:`block size-10 rounded-md bg-primary`,style:{opacity:Number(e.value)}}),(0,Z.jsx)(Fg,{children:String(e.value)})]})]})}function Ug({token:e}){let t=e.parts??{},n=ug(t.width??`1px`)??1,r=Math.min(10,Math.max(1,2/n)),i=Pg/r,a=t.style===`dashed`?`${n*4} ${n*3}`:t.style===`dotted`?`0 ${n*2}`:void 0;return(0,Z.jsxs)(`span`,{className:`flex flex-col items-start gap-1`,children:[(0,Z.jsx)(`svg`,{"data-preview":`border`,viewBox:`0 0 ${i} ${i}`,width:Pg,height:Pg,"aria-hidden":`true`,className:`rounded-md ring-1 ring-border`,style:{background:`#F4F5F6`},children:(0,Z.jsx)(`path`,{d:`M${i*.2} ${i*.8}L${i*.2} ${i*.2}L${i*.8} ${i*.2}`,fill:`none`,stroke:String(t.color??`currentColor`),strokeWidth:String(n),strokeLinecap:`round`,strokeLinejoin:`round`,strokeDasharray:a})}),(0,Z.jsx)(Fg,{children:r>1?`×${Math.round(r*10)/10}`:`actual size`})]})}function Wg({token:e}){let t=Math.abs(ug(e.value)??0);return(0,Z.jsx)(`span`,{"data-preview":`bar`,className:`block h-3 max-w-full rounded-sm bg-primary`,style:{width:`${t}px`}})}var Gg={radius:Ig,square:Lg,stroke:Rg,tracking:zg,fontSize:Bg,frame:Vg,opacity:Hg,border:Ug,bar:Wg};function Kg({token:e,kind:t}){let n=Gg[t];return(0,Z.jsx)(n,{token:e})}function qg({path:e,className:t}){let n=e.split(`.`);return(0,Z.jsx)(`code`,{className:$(`font-mono text-xs [overflow-wrap:anywhere]`,t),children:n.map((e,t)=>t<n.length-1?(0,Z.jsxs)(_.Fragment,{children:[`${e}.`,(0,Z.jsx)(`wbr`,{})]},t):e)})}function Jg({text:e}){let t=[],n=0;for(let r of e.matchAll(Dg)){let i=r.index;i>n&&t.push(e.slice(n,i)),t.push((0,Z.jsx)(Ng,{paint:r[0]},i)),n=i+r[0].length}return t.length===0?e:(n<e.length&&t.push(e.slice(n)),(0,Z.jsx)(Z.Fragment,{children:t}))}function Yg(e){return e.description&&e.description.length<32?e.description:te(e.name)}function Xg({token:e}){let t=String(e.value),n=lg(e),r=e.type===`color`||e.type===`gradient`;return(0,Z.jsxs)(`button`,{type:`button`,"data-token":e.path,className:`flex min-w-0 flex-col gap-2 rounded-lg border p-3 text-left hover:bg-muted/50`,title:`Copy var(${e.cssVariable})`,onClick:()=>kd(`var(${e.cssVariable})`),children:[r&&(0,Z.jsx)(`span`,{"data-swatch":!0,className:`h-14 rounded-md border`,style:{background:t,color:C(t)}}),e.type===`typography`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-4xl leading-none`,style:{fontFamily:String(e.parts?.fontFamily??`inherit`),fontWeight:String(e.parts?.fontWeight??`inherit`)},children:`Aa`}),(0,Z.jsx)(`span`,{className:`text-xs`,children:oe(e)})]}),!r&&e.type!==`typography`&&n&&(0,Z.jsx)(Kg,{token:e,kind:n}),(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:Yg(e)}),(0,Z.jsx)(qg,{path:e.path,className:`text-muted-foreground`}),r&&(0,Z.jsx)(Ng,{paint:t}),!r&&e.type!==`typography`&&(0,Z.jsx)(`span`,{className:`font-mono text-xs`,children:(0,Z.jsx)(Jg,{text:t})})]})}function Zg({data:e,paths:t}){return(0,Z.jsx)(`div`,{className:`not-prose my-4 grid grid-cols-[repeat(auto-fill,minmax(184px,1fr))] gap-2.5`,children:t.flatMap(t=>{let n=Ag(e,t);return n.length===0?[(0,Z.jsxs)(`p`,{className:`col-span-full text-[13px] text-destructive`,children:[`No token at `,t]},t)]:n.map(e=>(0,Z.jsx)(Xg,{token:e},`${t}:${e.path}`))})})}var Qg=Cu(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-foreground underline underline-offset-4 hover:no-underline`}},defaultVariants:{variant:`default`}});function $g({className:e,variant:t=`default`,render:n,...r}){return Cf({defaultTagName:`span`,props:Oi({className:$(Qg({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function e_({kind:e,className:t}){return e?(0,Z.jsx)($g,{variant:`outline`,...e===`experiment`?{"data-experiment":``}:{"data-reference":``},className:$(`border-current bg-transparent text-current`,t),children:e===`experiment`?`Experiment`:`Reference`}):null}function t_(e){return te(e.replace(/^dont-/,`don't-`).replace(/-/g,` `))}function n_(e){return e.meta?.title??t_(e.name)}function r_(e){if(e.startsWith(`dont-`))return`dont`;if(e.startsWith(`do-`))return`do`}var i_=2;function a_(e){let t=Number(e.width),n=Number(e.height);return t>0&&n>0?{css:`${t} / ${n}`,value:t/n}:void 0}function o_({asset:e,named:t,markedAs:n}){let r=t??t_(e.name),i=r_(e.name),a=a_(e);return(0,Z.jsxs)(`figure`,{"data-asset":e.id,className:`flex min-w-0 flex-col gap-2${a&&a.value>i_?` col-span-full`:``}`,children:[(0,Z.jsx)(`div`,{"data-frame":!0,className:`flex items-center justify-center overflow-hidden rounded-lg bg-muted p-3`,style:{aspectRatio:a?.css??`4 / 3`},children:(0,Z.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:e.url,alt:r,loading:`lazy`})}),(0,Z.jsxs)(`figcaption`,{className:`flex items-start gap-2 text-sm`,children:[i&&(0,Z.jsx)(`span`,{role:`img`,"aria-label":i===`do`?`Do`:`Don't`,className:`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full text-white ${i===`do`?`bg-emerald-600`:`bg-destructive`}`,children:i===`do`?(0,Z.jsx)(Vu,{className:`size-3`}):(0,Z.jsx)(hd,{className:`size-3`})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:t?null:(0,Z.jsx)(Jg,{text:r})}),(0,Z.jsx)(e_,{kind:n}),(0,Z.jsx)(`a`,{className:`shrink-0 text-[13px] text-muted-foreground underline underline-offset-2`,href:e.url,children:`Full size`})]})]})}function s_({data:e,args:t}){let[n,...r]=t,i=ye(e).find(e=>e.category===n);if(!n||!i)return(0,Z.jsxs)(`p`,{className:`text-[13px] text-destructive`,children:[`No asset at `,n]});let a=c_(i,r);return(0,Z.jsx)(`div`,{className:`not-prose my-4 grid gap-4 ${a.length===1?`grid-cols-1`:`grid-cols-[repeat(auto-fill,minmax(200px,1fr))]`}`,children:a.map(({name:e,asset:t})=>t?(0,Z.jsx)(o_,{asset:t,markedAs:be(i)},t.id):(0,Z.jsxs)(`p`,{className:`col-span-full text-[13px] text-destructive`,children:[`No asset at `,n,`/`,e]},e))})}function c_(e,t){return t.length?t.map(t=>({name:t,asset:e.assets.find(e=>e.name===t)})):e.assets.map(e=>({name:e.name,asset:e}))}function l_(e){return e&&`Source: ${e.doc}, ${e.locator}`}function u_({label:e,items:t,kind:n}){return t?.length?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e&&(0,Z.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[13px] font-semibold`,children:[n&&(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 items-center justify-center rounded-full text-white ${n===`do`?`bg-emerald-600`:`bg-destructive`}`,children:n===`do`?(0,Z.jsx)(Vu,{className:`size-3`}):(0,Z.jsx)(hd,{className:`size-3`})}),e]}),(0,Z.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 text-sm`,children:t.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(Jg,{text:e})},e))})]}):null}function d_({asset:e,markedAs:t}){let n=e.meta??{},r=n_(e),i=l_(n.source);return(0,Z.jsxs)(`div`,{"data-section-asset":e.id,className:`grid gap-4 md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,Z.jsx)(`h3`,{className:`text-[15px] font-semibold`,children:r}),n.description&&(0,Z.jsx)(`p`,{className:`text-sm`,children:(0,Z.jsx)(Jg,{text:n.description})}),(0,Z.jsx)(u_,{items:n.traits}),(0,Z.jsx)(u_,{label:`Do`,items:n.do,kind:`do`}),(0,Z.jsx)(u_,{label:`Don't`,items:n.dont,kind:`dont`}),i&&(0,Z.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:i})]}),(0,Z.jsx)(o_,{asset:e,named:r,markedAs:t})]})}function f_({data:e,args:t}){let[n,...r]=t,i=ye(e).find(e=>e.category===n);if(!n||!i)return(0,Z.jsxs)(`p`,{className:`text-[13px] text-destructive`,children:[`No asset at `,n]});let a=fe(i.rules),o=l_(i.source);return(0,Z.jsxs)(`div`,{"data-print-split":``,className:`not-prose my-4 flex flex-col gap-8`,children:[c_(i,r).map(({name:e,asset:t})=>t?(0,Z.jsx)(d_,{asset:t,markedAs:be(i)},t.id):(0,Z.jsxs)(`p`,{className:`text-[13px] text-destructive`,children:[`No asset at `,n,`/`,e]},e)),(a||i.notSpecified?.length||o)&&(0,Z.jsxs)(`div`,{"data-section-end":n,className:`flex flex-col gap-3 border-t pt-4`,children:[a&&(0,Z.jsx)(`p`,{className:`text-sm`,children:a}),(0,Z.jsx)(u_,{label:`Not specified`,items:i.notSpecified}),o&&(0,Z.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:o})]})]})}function p_({children:e}){return(0,Z.jsx)(`p`,{className:`col-span-full text-[13px] text-destructive`,children:e})}function m_(e,t){return t.flatMap(t=>{let n=Ag(e,t).filter(Sg);return n.length?n:[{missing:t}]})}function h_({token:e}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:Yg(e)}),(0,Z.jsx)(qg,{path:e.path,className:`text-muted-foreground`})]})}function g_({icons:e,paint:t}){return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:e.map(e=>(0,Z.jsx)(`span`,{"data-icon":e.id,role:`img`,"aria-label":e.name,title:e.name,className:`blazon-icon size-8`,style:{background:t,"--blazon-icon":`url("${new URL(e.url,document.baseURI).href}")`}},e.id))})}function __({data:e,args:t}){let[n,...r]=t,i=ye(e).find(e=>e.category===n);if(!n||!i)return(0,Z.jsxs)(p_,{children:[`No asset at `,n]});let a=`grid items-center gap-3 rounded-lg border p-3`;return(0,Z.jsxs)(`div`,{className:`not-prose my-4 flex flex-col gap-2.5`,children:[be(i)&&(0,Z.jsx)(`div`,{children:(0,Z.jsx)(e_,{kind:be(i)})}),r.length===0&&(0,Z.jsx)(`div`,{"data-icon-row":``,className:a,children:(0,Z.jsx)(g_,{icons:i.assets,paint:`currentColor`})}),m_(e,r).map(e=>`missing`in e?(0,Z.jsxs)(p_,{children:[`No token at `,e.missing]},e.missing):(0,Z.jsxs)(`div`,{"data-icon-row":e.path,className:`${a} sm:grid-cols-[200px_minmax(0,1fr)]`,children:[(0,Z.jsx)(h_,{token:e}),(0,Z.jsx)(g_,{icons:i.assets,paint:String(e.value)})]},e.path))]})}function v_({data:e,args:t}){let n=e.logo?.onLight??e.logo?.onDark;return(0,Z.jsxs)(`figure`,{className:`not-prose my-4 flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-2.5`,children:m_(e,t).map(e=>`missing`in e?(0,Z.jsxs)(p_,{children:[`No token at `,e.missing]},e.missing):(0,Z.jsxs)(`div`,{"data-card":e.path,className:`flex flex-col gap-2 rounded-[calc(var(--radius)*1.6)] p-4`,style:{background:String(e.value)},children:[(0,Z.jsxs)(`div`,{className:`flex min-h-48 flex-col items-start gap-4 rounded-[var(--radius)] bg-[var(--blazon-bg)] p-5 text-[var(--blazon-text)]`,children:[n&&(0,Z.jsx)(`img`,{className:`h-5 w-auto`,src:n,alt:``}),(0,Z.jsx)(`span`,{className:`font-[family-name:var(--blazon-font-display)] text-xl leading-tight font-semibold`,children:Yg(e)}),(0,Z.jsx)(`span`,{className:`mt-auto rounded-[calc(var(--radius)*0.6)] bg-[var(--blazon-inverse)] px-3 py-1.5 text-xs font-semibold text-[var(--blazon-inverse-text)]`,children:`Read more →`})]}),(0,Z.jsx)(`span`,{style:{color:(T(String(e.value))??0)>=3?`#fff`:`#000`},children:(0,Z.jsx)(qg,{path:e.path})})]},e.path))}),(0,Z.jsx)(`figcaption`,{className:`text-[13px] text-muted-foreground`,children:`Built from tokens: each frame takes its token, the card the theme's background, display font, corner radius and inverse color. Sizes and spacing are blazon's own.`})]})}function y_({data:e,args:t}){return e.logo?(0,Z.jsx)(`div`,{className:`not-prose my-4 grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2.5`,children:m_(e,t).map(t=>{if(`missing`in t)return(0,Z.jsxs)(p_,{children:[`No token at `,t.missing]},t.missing);let n=String(t.value),r=(T(n)??0)>=3,i=r?`#fff`:`#000`,a=Te(e,n,r);return(0,Z.jsxs)(`figure`,{"data-logo-on":t.path,className:`flex min-h-40 flex-col justify-between gap-6 rounded-lg border p-6`,style:{background:n,color:i},children:[a&&(0,Z.jsx)(`img`,{className:`my-auto h-7 w-auto self-center`,src:a,alt:``}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:Yg(t)}),(0,Z.jsx)(qg,{path:t.path,className:`opacity-80`})]})]},t.path)})}):(0,Z.jsx)(p_,{children:`No logo is configured (blazon.json → logo).`})}function b_(e){let t=e.parts??{};return{color:String(t.color??`currentColor`),width:ug(t.width??`1px`)??1}}function x_(e,t){return t.flatMap(t=>{let n=Ag(e,t).filter(Cg);return n.length?n:[{missing:t}]})}var S_=250;function C_({stroke:e,paint:t,fill:n}){return(0,Z.jsx)(`svg`,{viewBox:`0 0 ${S_} ${S_}`,width:S_,height:S_,"aria-hidden":`true`,className:n?`aspect-square h-auto w-full`:`h-auto max-w-full`,style:t?{background:t}:void 0,children:(0,Z.jsxs)(`g`,{fill:`none`,stroke:e.color,strokeWidth:e.width,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Z.jsx)(`circle`,{cx:`85`,cy:`90`,r:`45`}),(0,Z.jsx)(`rect`,{x:`120`,y:`110`,width:`95`,height:`95`,rx:`18`}),(0,Z.jsx)(`path`,{d:`M30 200 C 50 150, 90 150, 110 190 S 70 235, 30 200`})]})})}function w_({data:e,args:t}){return(0,Z.jsxs)(`figure`,{className:`not-prose my-4 flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(250px,1fr))] gap-2.5`,children:x_(e,t).map(e=>`missing`in e?(0,Z.jsxs)(p_,{children:[`No border token at `,e.missing]},e.missing):(0,Z.jsxs)(`div`,{"data-stroke":e.path,className:`flex flex-col gap-2 rounded-lg border p-3`,children:[(0,Z.jsx)(C_,{stroke:b_(e),paint:`var(--blazon-canvas, transparent)`}),(0,Z.jsx)(h_,{token:e})]},e.path))}),(0,Z.jsxs)(`figcaption`,{className:`text-[13px] text-muted-foreground`,children:[`Drawn at actual size on a `,S_,`px canvas with rounded caps and joins. Sample shapes are blazon's own.`]})]})}function T_({token:e,stroke:t}){let n=String(e.value),r=t!==void 0&&t.color.toLowerCase()===n.toLowerCase(),i=t&&!r?t:{color:C(n),width:t?.width??1};return(0,Z.jsxs)(`figure`,{"data-spot":e.path,className:`flex flex-col gap-2 overflow-hidden rounded-lg border`,children:[(0,Z.jsx)(C_,{stroke:i,paint:n,fill:!0}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col gap-1 px-3 pb-3`,children:[(0,Z.jsx)(h_,{token:e}),r&&(0,Z.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[`The stroke token has this background's color; drawn in `,i.color===`#fff`?`white`:`black`,`.`]})]})]})}function E_({data:e,args:t}){let n=t=>Ag(e,t).some(Cg),r=x_(e,t.filter(n)).find(e=>!(`missing`in e)),i=r?b_(r):void 0;return(0,Z.jsx)(`div`,{className:`not-prose my-4 grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2.5`,children:m_(e,t.filter(e=>!n(e))).map(e=>`missing`in e?(0,Z.jsxs)(p_,{children:[`No token at `,e.missing]},e.missing):(0,Z.jsx)(T_,{token:e,stroke:i},e.path))})}function D_({data:e,args:t}){if(!e.logo)return(0,Z.jsx)(p_,{children:`No logo is configured (blazon.json → logo).`});let n=we(e);return(0,Z.jsx)(`div`,{className:`not-prose my-4 grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-2.5`,children:m_(e,t).map(t=>{if(`missing`in t)return(0,Z.jsxs)(p_,{children:[`No token at `,t.missing]},t.missing);let r=String(t.value);return(0,Z.jsxs)(`figure`,{"data-logo-contrast":t.path,className:`flex flex-col gap-3 rounded-lg border p-4`,style:{background:r},children:[n.map(n=>{let i=n.ratio(r),a=i!==void 0&&i>=3,o=n.names.map(n=>Zh(t,e.tokens.items,n)).find(e=>e!==void 0);return(0,Z.jsxs)(`div`,{"data-variant":n.name,"data-legible":a,"data-forbidden":o!==void 0,className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`img`,{className:`h-6 w-auto`,src:n.src,alt:``}),(0,Z.jsx)(`span`,{className:`rounded bg-background px-2 py-0.5 font-mono text-[11px] text-foreground`,children:o?`${i===void 0?``:`${i.toFixed(1)}:1 `}✗ forbidden`:i===void 0?`n/a`:`${i.toFixed(1)}:1 ${a?`✓`:`✗`}`}),o&&(0,Z.jsx)(`span`,{"data-forbidden-reason":``,className:`basis-full rounded bg-background px-2 py-0.5 text-[11px] text-foreground`,children:o.reason??`The brand forbids this logo on this background.`})]},n.name)}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col rounded bg-background/90 px-2 py-1 text-[13px] text-foreground`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:Yg(t)}),(0,Z.jsx)(qg,{path:t.path,className:`text-muted-foreground`})]})]},t.path)})})}function O_(e){return e===`dark`?{fill:`var(--blazon-surface-dark)`,ink:`var(--blazon-surface-dark-text)`}:{fill:`var(--blazon-surface-light)`,ink:`var(--blazon-surface-light-text)`}}function k_(e){let t=L(e),n=e.meta?.clearSpace&&P(e.meta.clearSpace,e.meta)||0,r=t.width+2*n;return{size:t,space:n,total:r,scale:Math.min(1,320/r)}}function A_({asset:e}){let{size:t,space:n,total:r,scale:i}=k_(e),{fill:a}=O_(e.meta?.background);return(0,Z.jsx)(`div`,{"data-clear-zone":``,className:`w-full self-center`,style:{maxWidth:`${r*i}px`},children:(0,Z.jsx)(`div`,{"data-clear-band":``,className:`rounded-sm outline-1 outline-dashed outline-[var(--blazon-accent,currentColor)]`,style:{padding:`${Math.round(n/r*1e5)/1e3}%`,background:`repeating-linear-gradient(45deg, color-mix(in srgb, var(--blazon-accent, currentColor) 22%, transparent) 0 4px, transparent 4px 8px), ${a}`},children:(0,Z.jsx)(`img`,{src:e.url,alt:``,width:t.width,height:t.height,className:`block h-auto`,style:{width:`100%`,background:a}})})})}function j_({data:e,args:t}){let[n,...r]=t,i=ye(e).find(e=>e.category===n);if(!n||!i)return(0,Z.jsxs)(p_,{children:[`No asset at `,n]});let a=(r.length?r.map(e=>i.assets.find(t=>t.name===e)).filter(e=>e!==void 0):i.assets).filter(e=>e.meta?.clearSpace||e.meta?.minSize);return a.length===0?(0,Z.jsxs)(p_,{children:[`No asset at `,n,` states a clear space or minimum size`]}):(0,Z.jsx)(`div`,{className:`not-prose my-4 grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-2.5`,children:a.map(e=>{let{clearSpace:t,minSize:n,background:r}=e.meta,{scale:a}=k_(e),o=O_(r).fill;return(0,Z.jsxs)(`figure`,{"data-logo-space":e.id,className:`flex min-w-0 flex-col gap-3 rounded-lg border p-4`,children:[t&&(0,Z.jsx)(A_,{asset:e}),n&&(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-2 self-center`,children:[(0,Z.jsx)(`div`,{className:`rounded-sm p-2`,style:{background:o},children:(0,Z.jsx)(`img`,{"data-min-size":n.width?M(n.width):M(n.height),"data-min-axis":n.width?`width`:`height`,src:e.url,alt:``,className:`block max-w-none`,style:n.width?{width:M(n.width),height:`auto`}:{height:M(n.height),width:`auto`}})}),(0,Z.jsxs)(`span`,{className:`font-mono text-[11px] whitespace-nowrap text-muted-foreground`,children:[`Minimum `,n.width?`width ${n.width.value}${n.width.unit}`:`height ${n.height.value}${n.height.unit}`]})]}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col text-[13px]`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center justify-between gap-2 font-semibold`,children:[n_(e),(0,Z.jsx)(e_,{kind:be(i)})]}),t&&(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Clear space `,z(t,e.meta),a<1&&`, drawn at ×${Math.round(a*100)/100}`]})]})]},e.id)})})}function M_({children:e}){return(0,Z.jsx)(`p`,{className:`col-span-full text-[13px] text-destructive`,children:e})}function N_(e,t){return t===0?e:N_(t,e%t)}function P_(e,t){let n=N_(Math.round(e),Math.round(t));return`${Math.round(e)/n}:${Math.round(t)/n}`}var F_=280;function I_({data:e,args:t}){let n=e.logo?.onLight??e.logo?.onDark,r=t.map(t=>yg(e.tokens,t)),i=r.flatMap(e=>e.found),a=F_/Math.max(1,...i.flatMap(e=>[e.width,e.height]));return(0,Z.jsxs)(`div`,{className:`not-prose my-4 flex flex-wrap items-end gap-4`,children:[r.flatMap(e=>e.problems).map(e=>(0,Z.jsx)(M_,{children:e},e)),i.map(e=>{let t=(e.margin??0)*a;return(0,Z.jsxs)(`figure`,{"data-format":e.path,className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{"data-frame":``,className:`relative overflow-hidden rounded-[var(--radius)] border bg-[var(--blazon-bg)] text-[var(--blazon-text)]`,style:{width:e.width*a,height:e.height*a},children:[e.margin!==void 0&&(0,Z.jsx)(`div`,{"data-margin":``,className:`absolute border border-dashed border-[var(--blazon-accent,currentColor)]`,style:{inset:t},children:e.columns!==void 0&&Array.from({length:e.columns-1},(t,n)=>(0,Z.jsx)(`span`,{"data-column":``,className:`absolute inset-y-0 border-l border-dashed border-[var(--blazon-accent,currentColor)] opacity-40`,style:{left:`${(n+1)/e.columns*100}%`}},n))}),(0,Z.jsxs)(`div`,{className:`absolute flex flex-col justify-between`,style:{inset:Math.max(t,6)},children:[(0,Z.jsx)(`span`,{className:`font-[family-name:var(--blazon-font-display)] leading-tight font-semibold`,style:{fontSize:Math.max(8,e.width*a*.09)},children:`Headline`}),n&&(0,Z.jsx)(`img`,{className:`w-auto self-start`,style:{height:Math.max(8,e.width*a*.07)},src:n,alt:``})]})]}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:e.name}),(0,Z.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[Math.round(e.width),` × `,Math.round(e.height),` px · `,P_(e.width,e.height)]}),(e.margin!==void 0||e.columns!==void 0)&&(0,Z.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.margin!==void 0&&`margin ${e.margin}px`,e.columns!==void 0&&`${e.columns} columns`].filter(Boolean).join(` · `)})]})]},e.path)})]})}function L_({kind:e,size:t,stroke:n}){let r=t,i=r/2,a=(e,t,n,r)=>`<path d="M${e} ${t}L${n} ${r}"/>`;return`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}" fill="none" stroke="#000" stroke-width="${n}">${{dots:`<circle cx="${i}" cy="${i}" r="${n/2}" fill="#000" stroke="none"/>`,lines:a(0,i,r,i),diagonal:a(0,r,r,0)+a(-i,i,i,-i)+a(i,r+i,r+i,i),grid:a(0,i,r,i)+a(i,0,i,r),checks:`<rect x="0" y="0" width="${i}" height="${i}" fill="#000" stroke="none"/><rect x="${i}" y="${i}" width="${i}" height="${i}" fill="#000" stroke="none"/>`}[e]}</svg>`}function R_({pattern:e}){let t=`url("data:image/svg+xml,${encodeURIComponent(L_(e))}")`,n=e.ink??`var(--blazon-text)`,r={WebkitMask:`${t} 0 0 / ${e.size}px ${e.size}px repeat`,mask:`${t} 0 0 / ${e.size}px ${e.size}px repeat`};return(0,Z.jsxs)(`figure`,{"data-pattern":e.path,"data-kind":e.kind,className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`relative aspect-square overflow-hidden rounded-lg border`,style:{background:e.ground??`var(--blazon-bg)`},children:(0,Z.jsx)(`div`,{"data-ink":``,className:`absolute inset-0`,style:{background:n,...r}})}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:e.name}),(0,Z.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.kind,` · `,e.size,`px · `,e.stroke,`px`]})]})]})}function z_({data:e,args:t}){let n=t.map(t=>bg(e.tokens,t));return(0,Z.jsxs)(`div`,{className:`not-prose my-4 grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2.5`,children:[n.flatMap(e=>e.problems).map(e=>(0,Z.jsx)(M_,{children:e},e)),n.flatMap(e=>e.found).map(e=>(0,Z.jsx)(R_,{pattern:e},e.path))]})}function B_(e,t){return`${fg}/icon-sets/${e.name}/${encodeURIComponent(t)}.svg`}function V_(e,t){return new URL(B_(e,t),document.baseURI).href}function H_({children:e}){return(0,Z.jsx)(`p`,{className:`text-[13px] text-destructive`,children:e})}function U_({set:e,category:t}){let[n,r]=(0,_.useState)(!1);return(0,Z.jsxs)(`section`,{"data-icon-category":t.name,className:`rounded-lg border`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>r(!n),className:`flex w-full items-center gap-2 px-3 py-2.5 text-left text-sm font-semibold hover:bg-muted/50`,children:[(0,Z.jsx)(Gu,{className:`size-4 shrink-0 transition-transform ${n?`rotate-90`:``}`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.name}),(0,Z.jsx)(`span`,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:t.icons.length})]}),n&&(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(88px,1fr))] gap-1 border-t p-2`,children:t.icons.map(t=>(0,Z.jsxs)(`figure`,{"data-icon-name":t,title:t,className:`flex min-w-0 flex-col items-center gap-1.5 rounded-md p-2 text-center`,children:[(0,Z.jsx)(`span`,{"data-icon-mask":``,role:`img`,"aria-label":t,className:`blazon-icon size-6`,style:{background:`var(--blazon-text, currentColor)`,"--blazon-icon":`url("${V_(e,t)}")`}}),(0,Z.jsx)(`figcaption`,{className:`w-full truncate text-[11px] text-muted-foreground`,children:t})]},t))})]})}function W_({data:e,args:t}){let[n,...r]=t,i=e.iconSets.find(e=>e.name===n);if(!i)return(0,Z.jsxs)(H_,{children:[`No icon set at `,n]});let a=r.filter(e=>!i.categories.some(t=>t.name===e)),o=r.length?i.categories.filter(e=>r.includes(e.name)):i.categories;return(0,Z.jsxs)(`div`,{className:`not-prose my-4 flex flex-col gap-2`,children:[(0,Z.jsx)(`p`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`${i.package}${i.version?` ${i.version}`:``}`,i.license,`${i.count} icons`].filter(Boolean).join(` · `)}),a.map(e=>(0,Z.jsx)(H_,{children:`No category ${e} in ${i.name}`},e)),o.map(e=>(0,Z.jsx)(U_,{set:i,category:e},e.name))]})}var G_=e=>Math.max(1,e/100);function K_(e,t){let n=e.meta.partnership;if(!n)return;let r=P(n.gap,e.meta)??0,i=n.dividerHeight?P(n.dividerHeight,e.meta)??e.size.height:0,a=n.partnerHeight&&P(n.partnerHeight,e.meta)||e.size.height,o=t.size.width*a/t.size.height,s=Math.max(e.size.height,i,a),c=n.dividerHeight?G_(e.size.height):0,l=n.dividerHeight?e.size.width+r+c+r:e.size.width+r,u=e.size.width+r+c/2;return{width:l+o,height:s,logo:{x:0,y:s-e.size.height,...e.size},partner:{x:l,y:s-a,width:o,height:a},...n.dividerHeight&&{divider:{x:u,y1:(s-i)/2,y2:(s+i)/2,stroke:c}}}}function q_(e,t){let n=e.meta.initiative;if(!n)return;let r=P(n.gap,e.meta)??0,i=n.markHeight&&P(n.markHeight,e.meta)||e.size.height,a=t.size.width*i/t.size.height;if(n.position===`below`)return{width:Math.max(e.size.width,a),height:e.size.height+r+i,logo:{x:0,y:0,...e.size},mark:{x:0,y:e.size.height+r,width:a,height:i}};let o=Math.max(e.size.height,i);return{width:e.size.width+r+a,height:o,logo:{x:0,y:o-e.size.height,...e.size},mark:{x:e.size.width+r,y:o-i,width:a,height:i}}}function J_({children:e}){return(0,Z.jsx)(`p`,{className:`col-span-full text-[13px] text-destructive`,children:e})}var Y_=(e,t)=>e.assets.all.find(e=>e.id===t),X_=e=>`${e[0].toUpperCase()}${e.slice(1)}`;function Z_({data:e,args:t}){let[n,...r]=t,i=ye(e).find(e=>e.category===n);if(!n||!i)return(0,Z.jsxs)(J_,{children:[`No asset at `,n]});let a=(r.length?r.map(e=>i.assets.find(t=>t.name===e)).filter(e=>e!==void 0):i.assets).filter(e=>e.meta?.lockup);return a.length===0?(0,Z.jsxs)(J_,{children:[`No asset at `,n,` states a lockup`]}):(0,Z.jsx)(`div`,{className:`not-prose my-4 flex flex-col gap-5`,children:e.vocabulary.lockups.map(t=>{let n=a.filter(e=>e.meta.lockup===t);return n.length===0?null:(0,Z.jsxs)(`section`,{"data-lockup-group":t,className:`not-prose flex flex-col gap-2.5`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:X_(t)}),(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-2.5`,children:n.map(t=>{let{clearSpace:n,minSize:r,maxSize:a,replacedBelow:o,description:s,background:c}=t.meta,l=L(t);return(0,Z.jsxs)(`figure`,{"data-logo-lockup":t.id,className:`flex min-w-0 flex-col gap-3 rounded-lg border p-4`,children:[n?(0,Z.jsx)(A_,{asset:t}):(0,Z.jsx)(`div`,{className:`w-full self-center rounded-sm p-4`,style:{background:O_(c).fill,maxWidth:`calc(${Math.min(l.width,320)}px + 2rem)`},children:(0,Z.jsx)(`img`,{src:t.url,alt:``,width:l.width,height:l.height,className:`block h-auto w-full`})}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col text-[13px]`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center justify-between gap-2 font-semibold`,children:[n_(t),(0,Z.jsx)(e_,{kind:be(i)})]}),s&&(0,Z.jsx)(`span`,{children:(0,Z.jsx)(Jg,{text:s})}),n&&(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Clear space `,z(n,t.meta)]}),r&&(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Minimum `,r.width?`width ${R(r.width)}`:`height ${R(r.height)}`]}),a&&(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Maximum `,W(a)]}),o&&(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:ce(o,t=>{let n=e.assets.all.find(e=>e.id===t);return n&&n_(n)})})]})]},t.id)})})]},t)})})}var Q_=480;function $_({data:e,args:t}){let[n,r]=t,i=Y_(e,n),a=Y_(e,r);if(!i)return(0,Z.jsxs)(J_,{children:[`No asset at `,n]});if(!a)return(0,Z.jsxs)(J_,{children:[`No asset at `,r]});let o=i.meta?.partnership;if(!o)return(0,Z.jsxs)(J_,{children:[i.id,` states no partnership`]});let s=K_({size:L(i),meta:i.meta},{size:L(a)}),{width:c,height:l,divider:u}=s,d=O_(i.meta?.background);return(0,Z.jsx)(`div`,{className:`not-prose my-4`,children:(0,Z.jsxs)(`figure`,{"data-logo-partner":`${i.id}+${a.id}`,className:`flex flex-col gap-3 rounded-lg border p-4`,children:[(0,Z.jsx)(`div`,{className:`rounded-sm p-5`,style:{background:d.fill,color:d.ink},children:(0,Z.jsxs)(`svg`,{viewBox:`0 0 ${c} ${l}`,className:`block h-auto w-full`,style:{maxWidth:`${Math.min(c,Q_)}px`},role:`img`,"aria-label":`${n_(i)} and ${n_(a)}`,children:[(0,Z.jsx)(`image`,{href:ee(i.url),x:s.logo.x,y:s.logo.y,width:s.logo.width,height:s.logo.height}),u&&(0,Z.jsx)(`line`,{"data-divider":``,x1:u.x,x2:u.x,y1:u.y1,y2:u.y2,stroke:`currentColor`,strokeWidth:u.stroke}),(0,Z.jsx)(`image`,{href:ee(a.url),x:s.partner.x,y:s.partner.y,width:s.partner.width,height:s.partner.height})]})}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col text-[13px]`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center justify-between gap-2 font-semibold`,children:[(0,Z.jsxs)(`span`,{children:[n_(i),` and `,n_(a)]}),(0,Z.jsx)(e_,{kind:xe(e,i)??xe(e,a)})]}),(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:o.dividerHeight?`Gap ${z(o.gap,i.meta)} each side, divider ${z(o.dividerHeight,i.meta)} high, one baseline`:`Gap ${z(o.gap,i.meta)} between the logos, no divider, one baseline`})]})]})})}function ev({data:e,args:t}){let[n]=t,r=Y_(e,n);if(!r)return(0,Z.jsxs)(J_,{children:[`No asset at `,n]});let i=r.meta?.initiative;if(!i)return(0,Z.jsxs)(J_,{children:[r.id,` states no initiative`]});let a=Y_(e,i.mark);if(!a)return(0,Z.jsxs)(J_,{children:[`No asset at `,i.mark]});let o=q_({size:L(r),meta:r.meta},{size:L(a)}),{width:s,height:c}=o,l=O_(r.meta?.background);return(0,Z.jsx)(`div`,{className:`not-prose my-4`,children:(0,Z.jsxs)(`figure`,{"data-logo-initiative":`${r.id}+${a.id}`,className:`flex flex-col gap-3 rounded-lg border p-4`,children:[(0,Z.jsx)(`div`,{className:`rounded-sm p-5`,style:{background:l.fill,color:l.ink},children:(0,Z.jsxs)(`svg`,{viewBox:`0 0 ${s} ${c}`,className:`block h-auto w-full`,style:{maxWidth:`${Math.min(s,Q_)}px`},role:`img`,"aria-label":`${n_(r)}, ${i.name}`,children:[(0,Z.jsx)(`image`,{href:ee(r.url),x:o.logo.x,y:o.logo.y,width:o.logo.width,height:o.logo.height}),(0,Z.jsx)(`image`,{href:ee(a.url),x:o.mark.x,y:o.mark.y,width:o.mark.width,height:o.mark.height})]})}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col text-[13px]`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center justify-between gap-2 font-semibold`,children:[(0,Z.jsxs)(`span`,{children:[n_(r),`, `,i.name]}),(0,Z.jsx)(e_,{kind:xe(e,r)??xe(e,a)})]}),(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:i.position===`below`?`Gap ${z(i.gap,r.meta)} under the logo, left edges aligned`:`Gap ${z(i.gap,r.meta)} beside the logo, one baseline`})]})]})})}var tv={width:320,height:180},nv=tv.height*.1,rv=tv.width*.05,iv=10,av={"top-left":`Top left`,"top-right":`Top right`,"bottom-left":`Bottom left`,"bottom-right":`Bottom right`};function ov({data:e,args:t}){let[n,r]=t,i=Y_(e,n);if(!i)return(0,Z.jsxs)(J_,{children:[`No asset at `,n]});let a=i.meta?.placement;if(!a)return(0,Z.jsxs)(J_,{children:[i.id,` states no placement`]});let o=L(i),s=o.width*nv/o.height,c=O_(i.meta?.background);return(0,Z.jsx)(`div`,{className:`not-prose my-4`,children:(0,Z.jsxs)(`figure`,{"data-logo-placement":i.id,className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-2.5`,children:a.map(e=>{let t=e.startsWith(`top`),n=e.endsWith(`left`),a=n?rv:tv.width-rv-s,o=t?rv:tv.height-rv-nv;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsxs)(`svg`,{"data-corner":e,viewBox:`0 0 ${tv.width} ${tv.height}`,className:`block h-auto w-full rounded-md border`,style:{background:c.fill,color:c.ink},role:`img`,"aria-label":`${n_(i)}, ${av[e].toLowerCase()}`,children:[(0,Z.jsx)(`image`,{href:ee(i.url),x:a,y:o,width:s,height:nv}),r&&(0,Z.jsx)(`text`,{"data-url":``,x:n?tv.width-rv:rv,y:o+nv*(t?.7:.9),textAnchor:n?`end`:`start`,fontSize:iv,fill:`currentColor`,style:{fontFamily:`var(--blazon-font-body, sans-serif)`},children:r})]}),(0,Z.jsx)(`span`,{className:`text-[13px] font-semibold`,children:av[e]})]},e)})}),(0,Z.jsxs)(`figcaption`,{className:`flex items-center justify-between gap-2 text-[13px] text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[n_(i),`: the corners come from the sidecar. The frame, the logo's size and the margin are blazon's own.`]}),(0,Z.jsx)(e_,{kind:xe(e,i)})]})]})})}var sv=/<pre><code(?: class="language-([^"]*)")?>([\s\S]*?)<\/code><\/pre>/g;function cv(e){return e.replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&/g,`&`)}function lv(e){let t=[],n=0;for(let r of e.matchAll(sv))r.index>n&&t.push({html:e.slice(n,r.index)}),t.push({code:cv(r[2]),language:r[1]??``}),n=r.index+r[0].length;return n<e.length&&t.push({html:e.slice(n)}),t}var uv=/^[-+−]?\s?[$€£]?\s?\d{1,3}(?:[ \u00a0\u202f,.']\d{3})*(?:[.,]\d+)?(?:\s?(?:%|‰|€|EUR|BGN|USD|px|pt|em|rem|ms|s|×|x))?$|^[-+−]?\s?[$€£]?\s?\d+(?:[.,]\d+)?(?:\s?(?:%|‰|€|EUR|BGN|USD|px|pt|em|rem|ms|s|×|x))?$/,dv=e=>uv.test(e.trim()),fv=`text-align:right;font-variant-numeric:tabular-nums`;function pv(e){if(!/<table[\s>]/i.test(e))return e;let t=new DOMParser().parseFromString(`<div>${e}</div>`,`text/html`).body.firstElementChild,n=!1;for(let e of t.querySelectorAll(`table`)){if(e.querySelector(`[colspan], [rowspan]`))continue;let t=[...e.querySelectorAll(`tbody > tr`)].map(e=>[...e.children]),r=[...e.querySelectorAll(`thead > tr`)].map(e=>[...e.children]),i=Math.max(0,...t.map(e=>e.length));if(!(t.length===0||t.some(e=>e.length!==i))){for(let e=0;e<i;e++)if(t.every(t=>dv(t[e].textContent??``)))for(let i of[...t.map(t=>t[e]),...r.map(t=>t[e]).filter(e=>e!==void 0)])i.setAttribute(`style`,[i.getAttribute(`style`),fv].filter(Boolean).join(`;`)),n=!0}}return n?t.innerHTML:e}async function mv(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.cssText=`position:fixed;top:0;left:0;opacity:0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}catch{return!1}}function hv({code:e,language:t}){let[n,r]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),2e3);return()=>clearTimeout(e)},[n]);let i=e.replace(/\n$/,``);return(0,Z.jsxs)(qm,{className:`not-prose my-4 bg-muted/40 print:break-inside-avoid`,children:[(0,Z.jsxs)(Jm,{children:[(0,Z.jsx)(Ym,{className:`font-mono text-xs font-normal text-muted-foreground`,children:t||`text`}),(0,Z.jsx)(Xm,{children:(0,Z.jsxs)(Tu,{variant:`ghost`,size:`xs`,"aria-label":n?`Copied`:`Copy`,onClick:()=>void mv(i).then(e=>e?r(!0):gd.add({title:`Copy failed`,type:`error`})),children:[n?(0,Z.jsx)(Vu,{}):(0,Z.jsx)(Yu,{}),n?`Copied`:`Copy`]})})]}),(0,Z.jsx)(Qm,{children:i})]})}var gv=[`name`,`position`,`phone`,`email`],_v=`Arial, Helvetica, sans-serif`,vv=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`);function yv(e){let t=(e??``).split(`,`)[0]?.trim().replace(/^["']|["']$/g,``);return!t||/^(ui-|system-ui|sans-serif|serif|monospace|-apple-system)/.test(t)?_v:`${/\s/.test(t)?`'${t}'`:t}, ${_v}`}function bv(e){let t=e.trim();return`${t.startsWith(`+`)?`+`:``}${t.replace(/\D/g,``)}`}function xv(e,t){let n={};t.name.trim()||(n.name=`Enter your name`),t.position.trim()||(n.position=`Enter your position`);let r=bv(t.phone).replace(`+`,``);t.phone.trim()?(!/^\+?[\d\s().-]+$/.test(t.phone.trim())||r.length<7||r.length>15)&&(n.phone=`Use digits, spaces and a leading +, such as +44 20 7946 0000`):n.phone=`Enter your phone number`;let i=t.email.trim().toLowerCase(),a=i.split(`@`)[1]??``;return i?/^[a-z0-9._+'-]+@[a-z0-9-]+(?:\.[a-z0-9-]+)*\.[a-z]{2,}$/.test(i)?e.domains&&!e.domains.includes(a)&&(n.email=`Use your ${e.domains.map(e=>`@${e}`).join(` or `)} address`):n.email=`Enter a full email address, like name@company.com`:n.email=`Enter your email address`,n}function Sv(e,t,n,r={}){let i=vv(yv(n.font)),a=vv(n.text),o=vv(n.muted),s=t.email.trim().toLowerCase(),{width:c,height:l}=e.logoSize,u=(e,t)=>`<tr><td style="${t}">${e}</td></tr>`,d=(e,t)=>`<a href="${vv(e)}" style="color:${a};text-decoration:none">${vv(t)}</a>`;return`<table cellpadding="0" cellspacing="0" border="0" role="presentation" style="max-width:480px;border-collapse:collapse;font-family:${i};font-size:13px;line-height:18px;color:${a}">${[u(vv(t.name.trim()),`padding:0;font-size:15px;line-height:20px;font-weight:bold;color:${a}`),u(vv(t.position.trim()),`padding:0 0 8px 0;color:${o}`),u(d(`tel:${bv(t.phone)}`,t.phone.trim()),`padding:0`),u(d(`mailto:${s}`,s),`padding:0`),u(`<img src="${vv(r.logoSrc??e.logoUrl)}" width="${c}" height="${l}" alt="${vv(e.logoAlt)}" style="display:block;border:0;outline:none;width:${c}px;height:${l}px">`,`padding:12px 0 0 0`),...(e.lines??[]).map((e,t)=>u(vv(e),`padding:${t===0?12:4}px 0 0 0;font-size:11px;line-height:16px;color:${o}`))].join(``)}</table>`}function Cv(e,t){return[t.name.trim(),t.position.trim(),t.phone.trim(),t.email.trim().toLowerCase(),``,e.logoAlt,...e.lines??[]].join(`
|
|
12
12
|
`)}function wv(e,t,n){return`<!doctype html>\n<html><head><meta charset="utf-8"><title>${vv(t.name.trim())}</title></head><body>${Sv(e,t,n)}</body></html>\n`}var Tv={name:`Name`,position:`Position`,phone:`Phone`,email:`Email`},Ev={name:`text`,position:`text`,phone:`tel`,email:`email`},Dv={name:`name`,position:`organization-title`,phone:`tel`,email:`email`};function Ov(e){return{name:`Alex Morgan`,position:`Head of Partnerships`,phone:`+44 20 7946 0000`,email:`alex.morgan@${e??`example.com`}`}}var kv={name:``,position:``,phone:``,email:``};async function Av(e,t){try{return await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:`text/html`}),"text/plain":new Blob([t],{type:`text/plain`})})]),!0}catch{let t=document.createElement(`div`);t.innerHTML=e,t.style.position=`fixed`,t.style.left=`-9999px`,document.body.appendChild(t);let n=document.createRange();n.selectNodeContents(t);let r=window.getSelection();r?.removeAllRanges(),r?.addRange(n);let i=document.execCommand(`copy`);return r?.removeAllRanges(),t.remove(),i}}function jv(e,t){let n=URL.createObjectURL(new Blob([t],{type:`text/html`})),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),URL.revokeObjectURL(n)}function Mv({data:e}){let t=e.emailSignature,[n,r]=(0,_.useState)(kv),[i,a]=(0,_.useState)({}),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(void 0),[u,d]=(0,_.useState)(180),f=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(!t)return;let e=!0,n=new Image;return n.onload=()=>e&&l(!0),n.onerror=()=>e&&l(!1),n.src=t.logoUrl,()=>{e=!1}},[t]);let p=(0,_.useMemo)(()=>({text:e.theme.text??`#111111`,muted:e.theme.muted??`#555555`,font:e.theme.fontBody}),[e.theme]);if(!t)return(0,Z.jsx)(`p`,{className:`text-[13px] text-destructive`,children:`No email signature is configured (blazon.json → emailSignature).`});let m=xv(t,n),h=Object.keys(m).length===0,g=Ov(t.domains?.[0]),v=Object.fromEntries(gv.map(e=>[e,n[e].trim()?n[e]:g[e]])),y=Sv(t,v,p),b=Se(e,`light`),x=b?Sv(t,v,p,{logoSrc:b}):y,S=async()=>s(await Av(y,Cv(t,v))?`Copied. Paste it into your mail app’s signature settings.`:`The browser did not allow copying: download the file instead.`);return(0,Z.jsx)(`div`,{className:`not-prose @container my-4`,"data-email-signature":``,children:(0,Z.jsxs)(`div`,{className:`grid gap-5 @2xl:grid-cols-[minmax(0,300px)_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`form`,{className:`flex flex-col gap-3 print:hidden`,onSubmit:e=>e.preventDefault(),noValidate:!0,children:[gv.map(e=>{let t=i[e]?m[e]:void 0;return(0,Z.jsxs)(`label`,{className:`flex flex-col gap-1 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:Tv[e]}),(0,Z.jsx)(Wf,{type:Ev[e],autoComplete:Dv[e],placeholder:g[e],value:n[e],"aria-invalid":t?!0:void 0,onChange:t=>{r({...n,[e]:t.target.value}),s(``)},onBlur:()=>a({...i,[e]:!0})}),t&&(0,Z.jsx)(`span`,{className:`text-destructive`,children:t})]},e)}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:[(0,Z.jsx)(Tu,{type:`button`,disabled:!h,onClick:()=>void S(),children:`Copy signature`}),(0,Z.jsx)(Tu,{type:`button`,variant:`outline`,disabled:!h,onClick:()=>{jv(`email-signature.html`,wv(t,v,p)),s(`Downloaded email-signature.html.`)},children:`Download .html`})]}),(0,Z.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,"aria-live":`polite`,children:o||(h?`Ready to copy.`:`Fill in all four fields to copy or download.`)})]}),(0,Z.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,Z.jsx)(`iframe`,{ref:f,title:`Email signature preview`,sandbox:`allow-same-origin`,srcDoc:`<!doctype html><html><head><meta charset="utf-8"></head><body style="margin:20px;background:#ffffff">${x}</body></html>`,onLoad:()=>d(f.current?.contentDocument?.documentElement.scrollHeight??u),style:{height:u},className:`w-full rounded-lg border bg-white`}),(0,Z.jsxs)(`figcaption`,{className:`text-[13px] text-muted-foreground`,children:[n.name.trim()?`Your signature, as a mail app shows it.`:`A sample signature. Fill in the form to make yours.`,b&&(0,Z.jsxs)(`span`,{className:`block print:hidden`,children:[`The preview shows the book’s own logo. The signature you copy loads it from `,(0,Z.jsx)(`code`,{className:`break-all`,children:t.logoUrl}),`.`]}),c===!1&&(0,Z.jsxs)(`span`,{"data-logo-warning":``,className:`block text-destructive print:hidden`,children:[`That address did not load here, so it is not hosted yet: a signature made now shows “`,t.logoAlt,`” in mail apps in place of the logo.`]})]}),(0,Z.jsxs)(`details`,{"data-logo-why":``,className:`text-[13px] text-muted-foreground print:hidden`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Why the logo comes from a web address`}),(0,Z.jsxs)(`p`,{className:`mt-2 max-w-[46em]`,children:[`A mail app draws the logo when someone opens the email, so it fetches the image from the address in the signature. A file on your computer does not exist for the reader, and most mail apps do not show SVG, so the signature needs a public https link to a PNG. The preview above uses the book’s own copy so you can see the result; the address is `,(0,Z.jsx)(`code`,{children:`emailSignature.logoUrl`}),` in `,(0,Z.jsx)(`code`,{children:`blazon.json`}),`.`]})]})]})]})})}var Nv={canvas:`bg-muted text-foreground`,accent:`bg-primary text-primary-foreground`,inverse:`bg-[var(--blazon-inverse)] text-[var(--blazon-inverse-text)]`};function Pv(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`)}function Fv(e,t,n){let r=e.themeTokens?.[t],i=r?e.tokens.items.find(e=>e.path===r):void 0;return!!(i&&Zh(i,e.tokens.items,n))}function Iv(e){if(!e.logo)return`<p class="text-[13px] text-muted-foreground">No logo is configured (blazon.json → logo).</p>`;let t=Te(e,e.theme.accent,Ee(e.theme.accent,e.theme.accentText),!1),n=(t,n)=>Fv(e,t,n),r=Ee(e.theme.background,e.theme.text)&&!Ee(e.theme.inverse,e.theme.inverseText),i={role:`background`,className:`bg-[var(--blazon-bg)] text-[var(--blazon-text)] border`},a={role:`inverse`,className:`bg-[var(--blazon-inverse)] text-[var(--blazon-inverse-text)]`},[o,s]=r?[a,i]:[i,a];return`<div class="not-prose mt-4 grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2.5">${[{label:`On light backgrounds`,className:o.className,src:n(o.role,`onLight`)?void 0:e.logo.onLight},{label:`On dark backgrounds`,className:s.className,src:n(s.role,`onDark`)?void 0:e.logo.onDark},{label:`On the accent color`,className:`bg-primary text-primary-foreground`,src:t&&t===e.logo.onDark&&n(`accent`,`onDark`)||t&&t===e.logo.onLight&&n(`accent`,`onLight`)?void 0:t}].filter(e=>e.src).map(e=>`<figure class="flex min-h-40 flex-col justify-between gap-6 rounded-lg p-6 ${e.className}"><img class="my-auto h-7 w-auto self-center" src="${Pv(e.src)}" alt="" /><figcaption class="text-[13px]">${e.label}</figcaption></figure>`).join(``)}</div>`}var Lv={"logo-usage":Iv},Rv={tokens:({data:e,args:t})=>(0,Z.jsx)(Zg,{data:e,paths:t}),assets:s_,section:f_,icons:__,"logo-on":y_,"logo-contrast":D_,"logo-space":j_,"logo-lockups":Z_,"logo-partner":$_,"logo-initiative":ev,"logo-placement":ov,cards:v_,strokes:w_,spots:E_,"icon-set":W_,formats:I_,patterns:z_,"email-signature":Mv},zv=Object.keys(Rv).join(`|`);function Bv(e,t){return e.replace(RegExp(`<!--\\s*blazon:(${zv})(?:\\s+([^>]*?))?\\s*-->`,`g`),(e,t,n)=>`<div data-blazon-${t}="${(n??``).replace(/"/g,``)}"></div>`).replace(/<!--\s*blazon:([\w-]+)\s*-->/g,(e,n)=>Lv[n]?.(t)??e)}var Vv=RegExp(`<div data-blazon-(${zv})="([^"]*)"></div>`,`g`);function Hv({html:e,data:t}){let n=e.split(Vv),r=[];for(let e=0;e<n.length;e+=3){let i=n[e];lv(i).forEach((n,i)=>{`code`in n?r.push((0,Z.jsx)(hv,{code:n.code,language:n.language},`${e}-${i}`)):n.html&&r.push((0,Z.jsx)(`div`,{"data-print-split":``,dangerouslySetInnerHTML:{__html:kg(Mg(pv(n.html),t))}},`${e}-${i}`))});let a=n[e+1],o=(n[e+2]??``).split(/\s+/).filter(Boolean);if(a){let n=Rv[a];r.push((0,Z.jsx)(n,{data:t,args:o},`${e}-${a}`))}}return(0,Z.jsx)(`div`,{className:`blazon-prose min-w-0 max-w-[980px]`,children:r})}function Uv(e){let t=new DOMParser().parseFromString(`<div>${e}</div>`,`text/html`).body.firstElementChild,n=[],r={heading:``,body:``},i=()=>{(r.heading||r.body)&&n.push(r),r={heading:``,body:``}};for(let e of Array.from(t.children))e.tagName===`H2`?(i(),r.heading=e.innerHTML):e.tagName!==`H1`&&(r.body+=e.outerHTML);return i(),n}function Wv(e){return new DOMParser().parseFromString(e,`text/html`).body.textContent?.trim()??``}function Gv(e){let t=e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-|-$/g,``);return t?`section-${t}`:void 0}function Kv(e){let t=new Map;return e.map((e,n)=>{let r=Wv(e.heading);if(!r)return{section:e,text:r,id:void 0};let i=Gv(r)??`section-${n+1}`,a=(t.get(i)??0)+1;return t.set(i,a),{section:e,text:r,id:a===1?i:`${i}-${a}`}})}function qv(e,t){return t.meta.opener===`full`||t.meta.opener===`compact`?t.meta.opener===`full`:e.docs[0]?.slug===t.slug}function Jv({data:e,doc:t,mode:n,print:r=!1}){let i=String(t.meta.cover)in Nv?String(t.meta.cover):`canvas`,a=r||qv(e,t),o=_e(t),s=i===`canvas`?n===`dark`:i===`accent`?Ee(e.theme.accent,e.theme.accentText):Ee(e.theme.inverse,e.theme.inverseText),c=Te(e,i===`accent`?e.theme.accent:i===`inverse`?e.theme.inverse:void 0,s,!1),l=c===void 0?void 0:c===e.logo?.onDark?`onDark`:c===e.logo?.onLight?`onLight`:void 0,u=l!==void 0&&Fv(e,i===`accent`?`accent`:i===`inverse`?`inverse`:`background`,l)?void 0:c,d=typeof t.meta.description==`string`?t.meta.description:void 0,f=Kv(Uv(Bv(t.html,e)));return(0,Z.jsxs)(Z.Fragment,{children:[a?(0,Z.jsxs)(`section`,{className:$(tg,Nv[i],`relative flex min-h-[min(78vh,720px)] flex-col justify-center pt-8 pb-24`),children:[(0,Z.jsx)(`p`,{"data-opener-label":``,className:`absolute top-7 text-[13px] font-semibold`,children:o}),(0,Z.jsx)(`h1`,{className:`mb-7 font-heading text-[clamp(40px,10vw,152px)] leading-[0.95] font-semibold tracking-[-0.035em] hyphens-auto [overflow-wrap:anywhere]`,children:t.title}),d&&(0,Z.jsx)(`p`,{className:`max-w-[34em] text-base`,children:(0,Z.jsx)(Jg,{text:d})}),u&&(0,Z.jsx)(`img`,{"data-opener-mark":``,className:`absolute bottom-7 h-[22px] w-auto`,src:u,alt:``})]}):(0,Z.jsxs)(`section`,{className:$(tg,Nv[i],`pt-12 pb-10`),children:[(0,Z.jsx)(`p`,{"data-opener-label":``,className:`mb-3 text-[13px] font-semibold`,children:o}),(0,Z.jsx)(`h1`,{className:`font-heading text-[clamp(32px,4.5vw,56px)] leading-[1.05] font-semibold tracking-[-0.03em] [overflow-wrap:anywhere]`,children:t.title}),d&&(0,Z.jsx)(`p`,{className:`mt-4 max-w-[40em] text-base`,children:(0,Z.jsx)(Jg,{text:d})})]}),!r&&(0,Z.jsx)(eg,{}),(0,Z.jsx)(`article`,{"data-page-body":``,className:tg,children:f.map(({section:t,text:n,id:r},i)=>(0,Z.jsxs)(`section`,{id:r,"data-section":n||void 0,className:$(`grid scroll-mt-28 gap-x-12 gap-y-6 border-b py-10 last:border-b-0`,t.heading&&`lg:grid-cols-[minmax(140px,220px)_minmax(0,1fr)]`),children:[t.heading&&(0,Z.jsx)(`div`,{children:(0,Z.jsx)(`h2`,{className:`text-[15px] font-semibold`,dangerouslySetInnerHTML:{__html:t.heading}})}),(0,Z.jsx)(Hv,{html:t.body,data:e})]},i))}),(0,Z.jsx)(rg,{title:e.title,trail:`${o} / ${t.title}`})]})}function Yv({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,Z.jsx)(`table`,{"data-slot":`table`,className:$(`w-full caption-bottom text-sm`,e),...t})})}function Xv({className:e,...t}){return(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:$(`[&_tr]:border-b`,e),...t})}function Zv({className:e,...t}){return(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:$(`[&_tr:last-child]:border-0`,e),...t})}function Qv({className:e,...t}){return(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:$(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function $v({className:e,...t}){return(0,Z.jsx)(`th`,{"data-slot":`table-head`,className:$(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function ey({className:e,...t}){return(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:$(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}function ty({token:e}){return e.type===`color`||e.type===`gradient`?(0,Z.jsx)(Ng,{paint:String(e.value)}):(0,Z.jsx)(Jg,{text:String(e.value)})}function ny({tokens:e}){return(0,Z.jsxs)(`div`,{className:tg,children:[(0,Z.jsx)(`ul`,{"aria-label":`Tokens`,className:`flex flex-col md:hidden`,children:e.map(e=>(0,Z.jsxs)(`li`,{"data-token":e.path,className:`flex flex-col gap-1 border-b py-3`,children:[(0,Z.jsx)(qg,{path:e.path}),(0,Z.jsx)(`span`,{className:`flex items-center gap-2 text-sm [overflow-wrap:anywhere]`,children:(0,Z.jsx)(ty,{token:e})}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0 font-mono text-xs`,onClick:()=>kd(`var(${e.cssVariable})`),children:e.cssVariable}),e.type??`none`]})]},e.path))}),(0,Z.jsxs)(Yv,{className:`hidden md:table`,children:[(0,Z.jsx)(Xv,{children:(0,Z.jsxs)(Qv,{children:[(0,Z.jsx)($v,{children:`Token`}),(0,Z.jsx)($v,{children:`Value`}),(0,Z.jsx)($v,{children:`CSS variable`}),(0,Z.jsx)($v,{children:`Type`})]})}),(0,Z.jsx)(Zv,{children:e.map(e=>(0,Z.jsxs)(Qv,{"data-token":e.path,children:[(0,Z.jsx)(ey,{children:(0,Z.jsx)(`code`,{className:`font-mono text-xs`,children:e.path})}),(0,Z.jsx)(ey,{className:`whitespace-normal`,children:(0,Z.jsx)(`span`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(ty,{token:e})})}),(0,Z.jsx)(ey,{children:(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0 font-mono text-xs`,onClick:()=>kd(`var(${e.cssVariable})`),children:e.cssVariable})}),(0,Z.jsx)(ey,{children:e.type??`none`})]},e.path))})]})]})}function ry({data:e}){let t=e.tokens.items,[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),o=[...new Set(t.map(e=>e.type??`none`))].sort(),s=[...new Set(t.map(e=>e.group))],c=t.filter(e=>(!n||(e.type??`none`)===n)&&(!i||e.group===i)),l=!!(n||i);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Tokens`,title:`All tokens`,intro:`${t.length} tokens. Click a variable to copy it.`,children:(0,Z.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center gap-3 text-[13px]`,children:[(0,Z.jsxs)(Wd,{size:`sm`,"aria-label":`Type`,value:n,onChange:e=>r(e.target.value),children:[(0,Z.jsx)(Gd,{value:``,children:`All types`}),o.map(e=>(0,Z.jsx)(Gd,{value:e,children:e},e))]}),(0,Z.jsxs)(Wd,{size:`sm`,"aria-label":`Group`,value:i,onChange:e=>a(e.target.value),children:[(0,Z.jsx)(Gd,{value:``,children:`All groups`}),s.map(e=>(0,Z.jsx)(Gd,{value:e,children:e},e))]}),l&&(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[c.length,` of `,t.length,` tokens`]})]})}),c.length>0?(0,Z.jsx)(ny,{tokens:c}):(0,Z.jsx)(`p`,{className:`${tg} py-10 text-muted-foreground`,children:`No tokens match these filters.`}),(0,Z.jsx)(rg,{title:e.title,trail:`Tokens / All tokens`})]})}function iy({data:e,query:t}){let{tokens:n,docs:r}=ke(e,t),i=`Search: ${t}`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Tokens`,title:i,intro:`${n.length} tokens. Click a variable to copy it.`,children:r.length>0&&(0,Z.jsxs)(`p`,{className:`mt-4 max-w-[40em] text-muted-foreground`,children:[`Pages:`,` `,r.map((e,t)=>(0,Z.jsxs)(`span`,{children:[t>0&&`, `,(0,Z.jsx)(`a`,{className:`text-foreground underline underline-offset-2`,href:`#doc/${e.slug}`,children:e.title})]},e.slug))]})}),(0,Z.jsx)(ny,{tokens:n}),(0,Z.jsx)(rg,{title:e.title,trail:`Tokens / ${i}`})]})}function ay({className:e}){return(0,Z.jsx)($g,{variant:`outline`,className:$(`border-current bg-transparent text-current`,e),children:`Review`})}function oy(e){kd(`var(${e.cssVariable})`)}function sy({data:e,token:t}){let n=String(t.value),r=t.blazon.print,i=De(e,t.path).some(e=>e.code===`review-pending`||e.code===`token-value-duplicate`),a=[`HEX ${n.toUpperCase()}`,A(n)?`RGB ${A(n)}`:``,r?.cmyk?`CMYK ${r.cmyk.join(` `)}`:``,r?.pms?`PMS ${r.pms}`:``,r?.ral?`RAL ${r.ral}`:``].filter(Boolean),o=t.description&&t.description.length<32?t.description:te(t.name);return(0,Z.jsxs)(`button`,{type:`button`,"data-token":t.path,className:`blazon-swatch relative flex min-h-48 flex-col justify-between gap-6 rounded-lg p-5 text-left outline-offset-2 transition-transform hover:-translate-y-0.5`,style:{background:n,color:C(n)},title:`Copy var(${t.cssVariable})`,onClick:()=>oy(t),children:[(0,Z.jsx)(`span`,{className:`text-lg font-semibold`,children:o}),(0,Z.jsx)(`span`,{className:`flex flex-col gap-0.5 font-mono text-xs`,children:a.map(e=>(0,Z.jsx)(`span`,{children:e},e))}),i&&(0,Z.jsx)(ay,{className:`absolute top-4 right-4`})]})}function cy({data:e,tokens:t}){return(0,Z.jsxs)(`div`,{className:`grid grid-cols-[120px_minmax(0,1fr)] items-center gap-4`,children:[(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:V(B(t[0].path))}),(0,Z.jsx)(`div`,{className:`blazon-swatch flex overflow-hidden rounded-lg`,children:t.map(t=>{let n=String(t.value),r=De(e,t.path).length>0;return(0,Z.jsxs)(`button`,{type:`button`,"data-token":t.path,className:`flex min-h-20 min-w-0 flex-1 flex-col justify-end gap-0.5 overflow-hidden p-2 text-left font-mono text-[11px]`,style:{background:n,color:C(n)},title:`Copy var(${t.cssVariable})`,onClick:()=>oy(t),children:[(0,Z.jsxs)(`span`,{className:`truncate`,children:[te(t.name),r?` *`:``]}),(0,Z.jsx)(`span`,{className:`truncate`,children:n.toUpperCase()})]},t.path)})})]})}function ly({tokens:e}){return(0,Z.jsx)(`div`,{className:`flex flex-col`,children:e.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"data-token":e.path,className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-3 border-b py-2 text-left last:border-b-0 hover:bg-muted`,onClick:()=>oy(e),children:[(0,Z.jsx)(`span`,{className:`font-mono text-sm`,children:e.path}),(0,Z.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.aliasOf??``}),(0,Z.jsx)(Ng,{paint:String(e.value)})]},e.path))})}function uy({tokens:e}){return(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2.5`,children:e.map(e=>(0,Z.jsx)(`button`,{type:`button`,"data-token":e.path,className:`blazon-swatch flex min-h-36 items-end rounded-lg p-5 text-left font-semibold text-white`,style:{background:String(e.value)},title:`Copy var(${e.cssVariable})`,onClick:()=>oy(e),children:te(e.name)},e.path))})}function dy(e,t){return e.tokens.items.find(e=>e.path.startsWith(`${t}.`)&&e.type===`color`&&!/white/i.test(e.name))}function fy(e,t){return Object.entries(t).map(([t,n])=>{if(typeof n==`number`){let r=dy(e,t);return{key:t,share:n,label:V(t),tokens:r?[r]:[],covers:[t]}}let r=(n.tokens??[]).map(e=>e.replace(/^\{|\}$/g,``)),i=r.map(t=>e.tokens.items.find(e=>e.path===t)).filter(e=>!!e);return{key:t,share:n.share,label:t,tokens:i,covers:r}})}function py({data:e}){return e.tokens.groupMeta.filter(e=>e.blazon.proportion).map(t=>{let n=fy(e,t.blazon.proportion);return(0,Z.jsxs)(og,{heading:`Proportions`,path:t.path,children:[(0,Z.jsx)(`div`,{className:`blazon-swatch flex min-h-24 overflow-hidden rounded-lg`,children:n.map(e=>{let t=C(String(e.tokens[0]?.value??``));return(0,Z.jsxs)(`span`,{"data-bucket":!0,className:`@container relative flex min-w-0 border-r border-[var(--blazon-edge)] last:border-r-0`,style:{flex:e.share},children:[(0,Z.jsx)(`span`,{className:`absolute inset-0 flex flex-col`,children:e.tokens.length>0?e.tokens.map(e=>(0,Z.jsx)(`span`,{"data-swatch":!0,className:`flex-1`,style:{background:String(e.value)}},e.path)):(0,Z.jsx)(`span`,{className:`flex-1 bg-muted`})}),(0,Z.jsxs)(`span`,{className:`relative mt-auto p-2 text-sm font-semibold @[7rem]:p-3`,style:{color:e.tokens.length?t:void 0},children:[Math.round(e.share*100),`%`,(0,Z.jsxs)(`span`,{className:`hidden @[7rem]:inline`,children:[` `,e.label]})]})]},e.key)})}),(0,Z.jsx)(`ul`,{className:`mt-4 flex flex-col gap-1 text-[13px]`,children:n.map(e=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,Z.jsxs)(`span`,{className:`font-semibold`,children:[Math.round(e.share*100),`% `,e.label]}),e.covers.map(e=>(0,Z.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground`,children:e},e))]},e.key))})]},t.path)})}function my({data:e}){let t=e.tokens.items.filter(e=>e.type===`color`||e.type===`gradient`),n=new Set;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Tokens`,title:`Colors`,intro:`Click a color to copy its CSS variable.`}),(0,Z.jsxs)(ig,{children:[(0,Z.jsx)(py,{data:e}),H(t).map(({heading:t,groups:r})=>{let i=Oe(e,t),a=i&&!n.has(i.path)?i:void 0;a&&n.add(a.path);let o=ne(r[0][0]);return(0,Z.jsx)(og,{heading:V(t),path:t,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[a?.description&&(0,Z.jsx)(`p`,{children:(0,Z.jsx)(Jg,{text:a.description})}),o&&(0,Z.jsx)(sg,{children:o}),r.map(t=>{let n=t[0].path;return t[0].type===`gradient`?(0,Z.jsx)(uy,{tokens:t},n):re(t)?(0,Z.jsx)(cy,{data:e,tokens:t},n):t.every(e=>e.aliasOf)?(0,Z.jsx)(ly,{tokens:t},n):(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2.5`,children:t.map(t=>(0,Z.jsx)(sy,{data:e,token:t},t.path))},n)})]})},t)})]}),(0,Z.jsx)(rg,{title:e.title,trail:`Tokens / Colors`})]})}function hy(e,t){return`${e.endsWith(`-`)?e:`${e}-`}${t.map(e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[_\s]+/g,`-`).toLowerCase()).join(`-`)}`}function gy(e){return hy(``,e.split(`.`)).replace(/^-/,``)}var _y=`Not loaded by this brand book: the specimen uses the first font in its stack that this computer has.`;function vy(e,t){let n=t.rawValue,r=typeof n?.fontFamily==`string`?n.fontFamily.match(/^\{([^{}]+)\}$/)?.[1]:void 0,i=r?e.tokens.items.find(e=>e.path===r):void 0;return i&&i.blazon.webFont!==void 0?i:void 0}function yy({font:e}){let t=[e.license,e.licenseUrl].filter(Boolean).join(`, `);return(0,Z.jsxs)(`span`,{"data-font-facts":``,className:`flex flex-col text-[13px] text-muted-foreground`,children:[e.source&&(0,Z.jsxs)(`span`,{children:[`Source: `,e.source]}),t&&(0,Z.jsxs)(`span`,{children:[`License: `,t]})]})}function by({data:e}){let t=e.tokens.items.filter(e=>e.type===`fontFamily`),n=new Set(t.map(e=>e.path)),r=t.filter(e=>!e.aliasOf||!n.has(e.aliasOf)),i=e.tokens.items.filter(e=>e.type===`typography`),a=e.tokens.items.filter(e=>e.type===`fontWeight`);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Tokens`,title:`Typography`,intro:`Each style is set in itself. Click a style to copy its class name from typography.css.`}),(0,Z.jsxs)(ig,{children:[r.length>0&&(0,Z.jsx)(og,{heading:`Typefaces`,children:(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2.5`,children:r.map(t=>(0,Z.jsxs)(`button`,{type:`button`,"data-token":t.path,className:`relative flex flex-col gap-1 rounded-lg bg-muted p-6 text-left`,onClick:()=>kd(`var(${t.cssVariable})`),children:[De(e,t.path).length>0&&(0,Z.jsx)(ay,{className:`absolute top-4 right-4`}),(0,Z.jsx)(`span`,{className:`text-[96px] leading-none`,style:{fontFamily:String(t.value)},children:`Aa`}),(0,Z.jsx)(`span`,{className:`mt-4 font-semibold`,children:ae(t.value)}),t.description&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:(0,Z.jsx)(Jg,{text:t.description})}),t.blazon.webFont!==void 0&&(0,Z.jsxs)(`span`,{"data-not-loaded":``,className:`flex flex-col text-[13px] text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:_y}),t.blazon.webFont&&(0,Z.jsx)(`span`,{children:t.blazon.webFont})]}),t.blazon.font&&(0,Z.jsx)(yy,{font:t.blazon.font}),(0,Z.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground`,children:t.path})]},t.path))})}),i.length>0&&(0,Z.jsx)(og,{heading:`Font scale`,wide:!0,children:(0,Z.jsx)(`ol`,{className:`flex flex-col`,children:i.map(t=>(0,Z.jsx)(`li`,{"data-token":t.path,children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex w-full flex-wrap items-baseline justify-between gap-x-6 gap-y-2 border-b py-4 text-left`,title:`Copy class name`,onClick:()=>kd(gy(t.path)),children:[(0,Z.jsx)(`span`,{style:{font:String(t.value),letterSpacing:String(t.parts?.letterSpacing??`normal`)},children:oe(t)}),(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[vy(e,t)&&(0,Z.jsx)(`span`,{"data-not-loaded":``,className:`text-xs text-muted-foreground`,title:_y,children:`Not loaded here`}),(0,Z.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground`,children:t.path}),De(e,t.path).length>0&&(0,Z.jsx)(ay,{})]})]})},t.path))})}),a.length>0&&(0,Z.jsx)(og,{heading:`Weights`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-x-8 gap-y-3 text-2xl`,children:a.map(e=>(0,Z.jsxs)(`button`,{type:`button`,style:{fontWeight:String(e.value)},onClick:()=>kd(`var(${e.cssVariable})`),children:[te(e.name),` `,String(e.value)]},e.path))})})]}),(0,Z.jsx)(rg,{title:e.title,trail:`Tokens / Typography`})]})}function xy(e){let t=new Map;for(let n of e){let e=B(n.path)||n.group;t.set(e,[...t.get(e)??[],n])}return[...t]}function Sy({token:e,demo:t,detail:n}){return(0,Z.jsxs)(`button`,{type:`button`,"data-token":e.path,className:`grid w-full grid-cols-[minmax(0,160px)_minmax(0,1fr)] items-center gap-6 border-b py-4 text-left last:border-b-0 hover:bg-muted/50`,title:`Copy var(${e.cssVariable})`,onClick:()=>kd(`var(${e.cssVariable})`),children:[(0,Z.jsx)(`span`,{className:`flex min-h-12 items-center`,children:t}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:te(e.name)}),(0,Z.jsx)(qg,{path:e.path,className:`text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-mono text-xs`,children:typeof n==`string`||n===void 0?(0,Z.jsx)(Jg,{text:n??String(e.value)}):n}),e.description&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:(0,Z.jsx)(Jg,{text:e.description})})]})]})}function Cy({data:e}){let t=e.tokens.items.filter(e=>e.type===`dimension`&&!e.path.startsWith(`font.`));return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Tokens`,title:`Dimensions`,intro:`Each value is drawn as what it measures. Click one to copy its CSS variable.`}),(0,Z.jsx)(ig,{children:xy(t).map(([e,t])=>{let n=t.every(e=>lg(e)===`radius`);return(0,Z.jsx)(og,{heading:V(e),path:e,children:n?(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-4`,children:t.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"data-token":e.path,className:`flex flex-col gap-2 text-left text-sm`,title:`Copy var(${e.cssVariable})`,onClick:()=>kd(`var(${e.cssVariable})`),children:[(0,Z.jsx)(Kg,{token:e,kind:`radius`}),(0,Z.jsxs)(`span`,{children:[te(e.name),` `,String(e.value)]}),e.description&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:(0,Z.jsx)(Jg,{text:e.description})})]},e.path))}):t.map(e=>(0,Z.jsx)(Sy,{token:e,demo:(0,Z.jsx)(Kg,{token:e,kind:lg(e)??`bar`})},e.path))},e)})}),(0,Z.jsx)(rg,{title:e.title,trail:`Tokens / Dimensions`})]})}var wy={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};function Ty(e){if(Array.isArray(e)&&e.length===4&&e.every(e=>typeof e==`number`))return e;if(typeof e!=`string`)return;let t=wy[e.trim()];if(t)return t;let n=e.match(/^cubic-bezier\(([^)]+)\)$/)?.[1]?.split(`,`).map(Number);return n?.length===4&&n.every(Number.isFinite)?n:void 0}function Ey([e,t,n,r]){let i=e=>Math.round(e*1e3)/10;return`M0,100 C${i(e)},${i(1-t)} ${i(n)},${i(1-r)} 100,0`}function Dy(e){return e&&typeof e==`object`&&`value`in e&&`unit`in e?`${e.value}${e.unit}`:String(e)}function Oy({duration:e=`1s`,timing:t=`ease`,delay:n=`0s`}){return(0,Z.jsx)(`span`,{className:`relative block h-2 w-full rounded-full bg-muted`,children:(0,Z.jsx)(`span`,{"data-demo":!0,className:`blazon-demo-slide absolute top-1/2 left-0 size-4 -translate-y-1/2 rounded-full bg-primary`,style:{animationDuration:e,animationTimingFunction:t,animationDelay:n}})})}function ky({value:e,label:t}){let n=Ty(e);return n?(0,Z.jsxs)(`svg`,{role:`img`,"aria-label":`Easing curve ${t}`,viewBox:`-4 -4 108 108`,className:`size-12 overflow-visible`,children:[(0,Z.jsx)(`rect`,{x:`0`,y:`0`,width:`100`,height:`100`,className:`fill-none stroke-border`,strokeWidth:`1`}),(0,Z.jsx)(`path`,{d:Ey(n),className:`fill-none stroke-primary`,strokeWidth:`4`,strokeLinecap:`round`})]}):(0,Z.jsx)(Oy,{timing:t})}function Ay({token:e}){let t=String(e.value);if(e.type===`duration`)return(0,Z.jsx)(Sy,{token:e,demo:(0,Z.jsx)(Oy,{duration:t})});if(e.type===`cubicBezier`)return(0,Z.jsx)(Sy,{token:e,demo:(0,Z.jsx)(ky,{value:e.resolvedValue,label:t})});let n=e.parts??{},r=String(n.duration??`1s`),i=String(n.timingFunction??`ease`),a=String(n.delay??`0s`);return(0,Z.jsx)(Sy,{token:e,demo:(0,Z.jsx)(Oy,{duration:r,timing:i,delay:a}),detail:(0,Z.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Z.jsxs)(`span`,{children:[`Duration `,r]}),(0,Z.jsxs)(`span`,{children:[`Easing `,i]}),(0,Z.jsxs)(`span`,{children:[`Delay `,a]})]})})}function jy({data:e}){let t=e.tokens.items.filter(e=>pe.includes(e.type??``));return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Tokens`,title:`Motion`,intro:`Durations, easings and transitions, each shown moving. Click one to copy its CSS variable.`}),(0,Z.jsx)(ig,{children:xy(t).map(([e,t])=>(0,Z.jsx)(og,{heading:V(e),path:e,children:t.map(e=>(0,Z.jsx)(Ay,{token:e},e.path))},e))}),(0,Z.jsx)(rg,{title:e.title,trail:`Tokens / Motion`})]})}function My({token:e}){let t=e.resolvedValue;if(t&&typeof t==`object`&&`dashArray`in t){let{dashArray:e,lineCap:n}=t;return(0,Z.jsx)(`svg`,{viewBox:`0 0 160 12`,className:`h-3 w-full`,"aria-hidden":`true`,children:(0,Z.jsx)(`line`,{x1:`6`,y1:`6`,x2:`154`,y2:`6`,className:`stroke-foreground`,strokeWidth:`4`,strokeDasharray:e.map(Dy).join(` `),strokeLinecap:n})})}return(0,Z.jsx)(`span`,{"data-demo":!0,className:`block w-full border-t-4 border-foreground`,style:{borderTopStyle:String(e.value)}})}function Ny({token:e}){let t=String(e.value);if(e.type===`strokeStyle`)return(0,Z.jsx)(Sy,{token:e,demo:(0,Z.jsx)(My,{token:e})});if(e.type===`border`)return(0,Z.jsx)(Sy,{token:e,demo:(0,Z.jsx)(Kg,{token:e,kind:`border`})});if(e.type===`shadow`)return(0,Z.jsx)(Sy,{token:e,demo:(0,Z.jsx)(`span`,{"data-demo":!0,className:`block size-12 rounded-md bg-background`,style:{boxShadow:t}})});let n=lg(e);return n?(0,Z.jsx)(Sy,{token:e,demo:(0,Z.jsx)(Kg,{token:e,kind:n}),detail:(0,Z.jsx)(`span`,{children:t})}):(0,Z.jsx)(Sy,{token:e,demo:(0,Z.jsx)(`span`,{className:`font-heading text-3xl font-semibold`,children:t}),detail:(0,Z.jsx)(`span`,{children:e.type})})}function Py({data:e}){let t=e.tokens.items.filter(e=>me.includes(e.type??``));return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Tokens`,title:`Strokes & effects`,intro:`Stroke styles, borders, shadows and plain numbers. Click one to copy its CSS variable.`}),(0,Z.jsx)(ig,{children:xy(t).map(([e,t])=>(0,Z.jsx)(og,{heading:V(e),path:e,children:t.map(e=>(0,Z.jsx)(Ny,{token:e},e.path))},e))}),(0,Z.jsx)(rg,{title:e.title,trail:`Tokens / Strokes & effects`})]})}var Fy={"#tokens/colors":my,"#tokens/typography":by,"#tokens/dimensions":Cy,"#tokens/motion":jy,"#tokens/effects":Py,"#tokens/all":ry};function Iy({data:e,path:t}){let n=e.tokens.items.find(e=>e.path===t),r=(0,Z.jsx)(qg,{path:t});return n?(0,Z.jsx)(`a`,{href:jg(n),className:`text-foreground underline underline-offset-2`,children:r}):r}function Ly({data:e,findings:t}){return(0,Z.jsx)(`ul`,{className:`flex flex-col`,children:t.map((t,n)=>(0,Z.jsxs)(`li`,{className:`grid gap-x-6 gap-y-1 border-b py-3 last:border-b-0 xl:grid-cols-[minmax(0,240px)_minmax(0,1fr)_auto]`,children:[(0,Z.jsx)(Iy,{data:e,path:t.path}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(Jg,{text:t.message})}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:t.context?`${t.code}, only in ${t.context}`:t.code})]},n))})}function Ry(e){let t=new Set(e.findings.filter(e=>e.code===`approval-stale`).map(e=>e.path));return[...e.tokens.items.map(e=>[e.path,e.blazon.review]),...e.tokens.groupMeta.map(e=>[e.path,e.blazon.review]),...ye(e).flatMap(e=>e.assets.map(e=>[e.id,e.meta?.review]))].flatMap(([e,n])=>n?.status===`ok`?[{path:e,review:n,stale:t.has(e)}]:[]).sort((e,t)=>Number(t.stale)-Number(e.stale)||e.path.localeCompare(t.path))}function zy({by:e,at:t}){return e&&t?`Approved by ${e} on ${t}`:e?`Approved by ${e}`:t?`Approved on ${t}`:`Approved, with no name or date recorded`}function By({data:e,items:t}){return(0,Z.jsx)(`ul`,{className:`flex flex-col`,children:t.map(({path:t,review:n,stale:r})=>(0,Z.jsxs)(`li`,{className:`grid gap-x-6 gap-y-1 border-b py-3 last:border-b-0 xl:grid-cols-[minmax(0,240px)_minmax(0,1fr)_auto]`,children:[(0,Z.jsx)(Iy,{data:e,path:t}),(0,Z.jsxs)(`span`,{children:[zy(n),n.note?`. ${n.note}`:``]}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:r?`changed since`:n.value?`value recorded`:`no value recorded`})]},t))})}function Vy({data:e,kind:t}){let n=ye(e).filter(e=>be(e)===t);return(0,Z.jsx)(`ul`,{className:`flex flex-col`,children:n.map(e=>(0,Z.jsxs)(`li`,{[t===`experiment`?`data-experiment-category`:`data-reference-category`]:e.category,className:`grid gap-x-6 gap-y-1 border-b py-3 last:border-b-0 xl:grid-cols-[minmax(0,240px)_minmax(0,1fr)_auto]`,children:[(0,Z.jsx)(`a`,{href:`#assets/${e.category}`,className:`text-foreground underline underline-offset-2`,children:(0,Z.jsx)(qg,{path:e.category})}),(0,Z.jsx)(`span`,{children:e.description??(t===`experiment`?`Explorations, not the brand's identity.`:`Kept for comparison or supplied by someone else.`)}),(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted-foreground`,children:[e.assets.length,` `,e.assets.length===1?`file`:`files`]})]},e.category))})}function Hy({data:e}){let t=e.findings.filter(e=>e.severity===`error`),n=e.findings.filter(e=>e.severity===`warning`),r=Ry(e),i=ye(e).some(e=>be(e)===`experiment`),a=ye(e).some(e=>be(e)===`reference`),o=e.findings.some(e=>e.severity!==`info`)?`What blazon check found in these tokens. Errors stop blazon build; warnings mark open questions.`:`blazon check found nothing to review.`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Quality`,title:`Review`,intro:o}),(0,Z.jsxs)(ig,{children:[t.length>0&&(0,Z.jsx)(og,{heading:`Errors`,children:(0,Z.jsx)(Ly,{data:e,findings:t})}),n.length>0&&(0,Z.jsx)(og,{heading:`Warnings`,children:(0,Z.jsx)(Ly,{data:e,findings:n})}),r.length>0&&(0,Z.jsx)(og,{heading:`Approved`,children:(0,Z.jsx)(By,{data:e,items:r})}),i&&(0,Z.jsxs)(og,{heading:`Experiments`,children:[(0,Z.jsx)(`p`,{className:`mb-2 text-sm text-muted-foreground`,children:`Explorations, not the brand's identity. Their review status does not gate the book, so they raise no warnings.`}),(0,Z.jsx)(Vy,{data:e,kind:`experiment`})]}),a&&(0,Z.jsxs)(og,{heading:`Reference`,children:[(0,Z.jsx)(`p`,{className:`mb-2 text-sm text-muted-foreground`,children:`Kept for comparison or supplied by someone else, not the brand's live assets. Their review status does not gate the book, so they raise no warnings.`}),(0,Z.jsx)(Vy,{data:e,kind:`reference`})]})]}),(0,Z.jsx)(rg,{title:e.title,trail:`Quality / Review`})]})}function Uy(e,t){this.v=e,this.k=t}function Wy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Gy(e){if(Array.isArray(e))return e}function Ky(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function qy(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
13
13
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jy(e,t){return Gy(e)||Ky(e,t)||Yy(e,t)||qy()}function Yy(e,t){if(e){if(typeof e==`string`)return Wy(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wy(e,t):void 0}}function Xy(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Uy;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}Xy.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},Xy.prototype.next=function(e){return this._invoke(`next`,e)},Xy.prototype.throw=function(e){return this._invoke(`throw`,e)},Xy.prototype.return=function(e){return this._invoke(`return`,e)};var Zy=Object.entries,Qy=Object.setPrototypeOf,$y=Object.isFrozen,eb=Object.getPrototypeOf,tb=Object.getOwnPropertyDescriptor,nb=Object.freeze,rb=Object.seal,ib=Object.create,ab=typeof Reflect<`u`&&Reflect,ob=ab.apply,sb=ab.construct;nb||=function(e){return e},rb||=function(e){return e},ob||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},sb||=function(e){return new e(...[...arguments].slice(1))};var cb=Mb(Array.prototype.forEach);Array.prototype.indexOf;var lb=Mb(Array.prototype.lastIndexOf),ub=Mb(Array.prototype.pop),db=Mb(Array.prototype.push),fb=Mb(Array.prototype.slice),pb=Mb(Array.prototype.splice),mb=Array.isArray,hb=Nb(Set),gb=Mb(Set.prototype.add),_b=Mb(Set.prototype.has),vb=Mb(String.prototype.toLowerCase),yb=Mb(String.prototype.toString),bb=Mb(String.prototype.match),xb=Mb(String.prototype.replace),Sb=Mb(String.prototype.indexOf),Cb=Mb(String.prototype.trim),wb=Mb(Number.prototype.toString),Tb=Mb(Boolean.prototype.toString),Eb=typeof BigInt>`u`?null:Mb(BigInt.prototype.toString),Db=typeof Symbol>`u`?null:Mb(Symbol.prototype.toString),Ob=Mb(Object.prototype.hasOwnProperty),kb=Mb(Object.prototype.toString),Ab=Mb(RegExp.prototype.test),jb=Nb(TypeError);function Mb(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ob(e,t,n)}}function Nb(e){return function(){return sb(e,[...arguments])}}function Pb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vb;if(Qy&&Qy(e,null),!mb(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&($y(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Fb(e){for(let t=0;t<e.length;t++)Ob(e,t)||(e[t]=null);return e}function Ib(e){let t=ib(null);for(let r of Zy(e)){var n=Jy(r,2);let i=n[0],a=n[1];Ob(e,i)&&(t[i]=mb(a)?Fb(a):a&&typeof a==`object`&&a.constructor===Object?Ib(a):a)}return t}function Lb(e){switch(typeof e){case`string`:return e;case`number`:return wb(e);case`boolean`:return Tb(e);case`bigint`:return Eb?Eb(e):`0`;case`symbol`:return Db?Db(e):`Symbol()`;case`undefined`:return kb(e);case`function`:case`object`:{if(e===null)return kb(e);let t=e,n=Rb(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:kb(e)}return kb(e)}default:return kb(e)}}function Rb(e,t){for(;e!==null;){let n=tb(e,t);if(n){if(n.get)return Mb(n.get);if(typeof n.value==`function`)return Mb(n.value)}e=eb(e)}function n(){return null}return n}function zb(e,t){for(;e!==null;){let n=tb(e,t);if(n)return n.get?Mb(n.get):null;e=eb(e)}return null}function Bb(e){try{return Ab(e,``),!0}catch{return!1}}var Vb=nb(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Hb=nb(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ub=nb([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Wb=nb([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Gb=nb(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Kb=nb([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),qb=nb([`#text`]),Jb=nb(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Yb=nb(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Xb=nb(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Zb=nb([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Qb=rb(/{{[\w\W]*|^[\w\W]*}}/g),$b=rb(/<%[\w\W]*|^[\w\W]*%>/g),ex=rb(/\${[\w\W]*/g),tx=rb(/^data-[\-\w.\u00B7-\uFFFF]+$/),nx=rb(/^aria-[\-\w]+$/),rx=rb(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ix=rb(/^(?:\w+script|data):/i),ax=rb(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ox=rb(/^html$/i),sx=rb(/^[a-z][.\w]*(-[.\w]+)+$/i),cx=rb(/<[/\w!]/g),lx=rb(/<[/\w]/g),ux=rb(/<\/no(script|embed|frames)/i),dx=rb(/\/>/i),fx={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},px=nb(Pb({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),mx=function(){return typeof window>`u`?null:window},hx=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},gx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_x=function(e,t,n,r){return Ob(e,t)&&mb(e[t])?Pb(r.base?Ib(r.base):{},e[t],r.transform):n},vx=function(e,t,n){let r=Ob(e,t)?e[t]:void 0;return r&&typeof r==`object`?Ib(r):n()};function yx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mx(),t=e=>yx(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==fx.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Rb(d,`cloneNode`),p=Rb(d,`remove`),m=Rb(d,`removeAttributeNode`),h=Rb(d,`nextSibling`),g=Rb(d,`childNodes`),_=Rb(d,`parentNode`),v=Rb(d,`shadowRoot`),y=Rb(d,`attributes`),b=o&&o.prototype?Rb(o.prototype,`nodeType`):null,x=o&&o.prototype?Rb(o.prototype,`nodeName`):null,S=o&&o.prototype?Rb(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName},T=zb(d,`namespaceURI`),E=function(e){return T?T(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let D,O=``,k,A=!1,j=0,M=function(){if(j>0)throw jb(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},N=function(e){M(),j++;try{return D.createHTML(e)}finally{j--}},P=function(e){M(),j++;try{return D.createScriptURL(e)}finally{j--}},F=function(){return A||=(k=hx(u,i),!0),k},I=n,L=I.implementation,R=I.createNodeIterator,z=I.createDocumentFragment,ee=I.getElementsByTagName,te=r.importNode,B=gx();t.isSupported=typeof Zy==`function`&&typeof _==`function`&&L&&L.createHTMLDocument!==void 0;let V=Qb,ne=$b,re=ex,H=tx,ie=nx,ae=ix,oe=ax,se=sx,U=rx,W=null,ce=Pb({},[...Vb,...Hb,...Ub,...Gb,...qb]),le=null,ue=Pb({},[...Jb,...Yb,...Xb,...Zb]),de=Object.seal(ib(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,pe=null,me=Object.seal(ib(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),he=!0,ge=!0,_e=!1,ve=!0,ye=!1,be=!0,xe=!1,Se=!1,Ce=null,we=null,Te=!1,Ee=!1,De=!1,Oe=!1,ke=!0,Ae=!1,je=`user-content-`,Me=!0,Ne=!1,Pe=null,Fe={},Ie=null,Le=Pb({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Re=null,ze=Pb({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Be=null,Ve=Pb({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),He=`http://www.w3.org/1998/Math/MathML`,Ue=`http://www.w3.org/2000/svg`,We=`http://www.w3.org/1999/xhtml`,Ge=We,G=!1,Ke=null,qe=Pb({},[He,Ue,We],yb),Je=nb([`mi`,`mo`,`mn`,`ms`,`mtext`]),Ye=Pb({},Je),Xe=nb([`annotation-xml`]),Ze=Pb({},Xe),Qe=Pb({},[`title`,`style`,`font`,`a`,`script`]),$e=null,et=[`application/xhtml+xml`,`text/html`],tt=null,nt=null,rt=n.createElement(`form`),it=function(e){return e instanceof RegExp||e instanceof Function},at=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nt&&nt===e)return;e&&typeof e==`object`||(e={}),e=Ib(e),$e=et.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,tt=$e===`application/xhtml+xml`?yb:vb,W=_x(e,`ALLOWED_TAGS`,ce,{transform:tt}),le=_x(e,`ALLOWED_ATTR`,ue,{transform:tt}),Ke=_x(e,`ALLOWED_NAMESPACES`,qe,{transform:yb}),Be=_x(e,`ADD_URI_SAFE_ATTR`,Ve,{transform:tt,base:Ve}),Re=_x(e,`ADD_DATA_URI_TAGS`,ze,{transform:tt,base:ze}),Ie=_x(e,`FORBID_CONTENTS`,Le,{transform:tt}),fe=_x(e,`FORBID_TAGS`,Ib({}),{transform:tt}),pe=_x(e,`FORBID_ATTR`,Ib({}),{transform:tt}),Fe=Ob(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ib(e.USE_PROFILES):e.USE_PROFILES:!1,he=e.ALLOW_ARIA_ATTR!==!1,ge=e.ALLOW_DATA_ATTR!==!1,_e=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=e.SAFE_FOR_TEMPLATES||!1,be=e.SAFE_FOR_XML!==!1,xe=e.WHOLE_DOCUMENT||!1,Ee=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Oe=e.RETURN_TRUSTED_TYPE||!1,Te=e.FORCE_BODY||!1,ke=e.SANITIZE_DOM!==!1,Ae=e.SANITIZE_NAMED_PROPS||!1,Me=e.KEEP_CONTENT!==!1,Ne=e.IN_PLACE||!1,U=Bb(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:rx,Ge=typeof e.NAMESPACE==`string`?e.NAMESPACE:We,Ye=vx(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Pb({},Je)),Ze=vx(e,`HTML_INTEGRATION_POINTS`,()=>Pb({},Xe));let t=vx(e,`CUSTOM_ELEMENT_HANDLING`,()=>ib(null));if(de=ib(null),Ob(t,`tagNameCheck`)&&it(t.tagNameCheck)&&(de.tagNameCheck=t.tagNameCheck),Ob(t,`attributeNameCheck`)&&it(t.attributeNameCheck)&&(de.attributeNameCheck=t.attributeNameCheck),Ob(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(de.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),rb(de),ye&&(ge=!1),De&&(Ee=!0),Fe&&(W=Pb({},qb),le=ib(null),Fe.html===!0&&(Pb(W,Vb),Pb(le,Jb)),Fe.svg===!0&&(Pb(W,Hb),Pb(le,Yb),Pb(le,Zb)),Fe.svgFilters===!0&&(Pb(W,Ub),Pb(le,Yb),Pb(le,Zb)),Fe.mathMl===!0&&(Pb(W,Gb),Pb(le,Xb),Pb(le,Zb))),me.tagCheck=null,me.attributeCheck=null,Ob(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?me.tagCheck=e.ADD_TAGS:mb(e.ADD_TAGS)&&(W===ce&&(W=Ib(W)),Pb(W,e.ADD_TAGS,tt))),Ob(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?me.attributeCheck=e.ADD_ATTR:mb(e.ADD_ATTR)&&(le===ue&&(le=Ib(le)),Pb(le,e.ADD_ATTR,tt))),Ob(e,`ADD_FORBID_CONTENTS`)&&mb(e.ADD_FORBID_CONTENTS)&&(Ie===Le&&(Ie=Ib(Ie)),Pb(Ie,e.ADD_FORBID_CONTENTS,tt)),Me&&(W[`#text`]=!0),xe&&Pb(W,[`html`,`head`,`body`]),W.table&&(Pb(W,[`tbody`]),delete fe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw jb(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw jb(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=D;D=e.TRUSTED_TYPES_POLICY;try{O=N(``)}catch(e){throw D=t,e}}else e.TRUSTED_TYPES_POLICY===null?(D=void 0,O=``):(D===void 0&&(D=F()),D&&typeof O==`string`&&(O=N(``)));nb&&nb(e),nt=e},ot=Pb({},[...Hb,...Ub,...Wb]),st=Pb({},[...Gb,...Kb]),ct=function(e,t,n){return t.namespaceURI===We?e===`svg`:t.namespaceURI===He?e===`svg`&&(n===`annotation-xml`||Ye[n]):!!ot[e]},lt=function(e,t,n){return t.namespaceURI===We?e===`math`:t.namespaceURI===Ue?e===`math`&&Ze[n]:!!st[e]},ut=function(e,t,n){return t.namespaceURI===Ue&&!Ze[n]||t.namespaceURI===He&&!Ye[n]?!1:!st[e]&&(Qe[e]||!ot[e])},dt=function(e){let t=E(e),n=vb(w(e)),r=_(e),i,a;return r&&C(r)===fx.element?(i={namespaceURI:E(r)},a=vb(w(r))):(i={namespaceURI:Ge},a=`template`),Ke[t]?t===Ue?ct(n,i,a):t===He?lt(n,i,a):t===We?ut(n,i,a):!!($e===`application/xhtml+xml`&&Ke[t]):!1},ft=function(e){db(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw jb(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},pt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},mt=function(e){vt(e);let t=g(e);t&&cb(fb(t),e=>{try{p(e)}catch{}});let n=C(e)===fx.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&pt(e,r,i)}},ht=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}db(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ee||De)try{ft(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},gt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||le[tt(i)]||pt(e,r,i)}},_t=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===fx.element){let t=v(e);jt(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},vt=function(e){_t(e,e=>{C(e)===fx.element&>(e)})},yt=function(e){let t=[];return _t(e,e=>{t.push(e)},!0),t},K=function(e,t){let n=hb();cb(yt(e),e=>{C(e)===fx.element&&gb(n,e)}),cb(t,e=>{C(e)===fx.element&&!_b(n,e)&>(e)})},bt=function(e,n){let r=!1;return cb(t.removed,t=>{t.element&&(r||=t.element===e,vt(t.element))}),K(e,n),r},xt=function(e,t){let n=Pe,r=null,i=()=>(r||(r=hb(),cb(t,e=>{gb(r,e)})),r);for(let t=0;;t++){let r=yt(e),a=[e],o=!1;if(cb(r,e=>{C(e)===fx.documentFragment?db(a,e):!o&&!_b(n,e)&&(o=_b(i(),e))}),!o)return;if(t>=8)throw jb(`the tree kept changing during in-place sanitization; refusing to return it`);cb(a,(t,n)=>{St(t,n>0,e,i())})}},St=function(e,t,n,r){let i=Dt(e),a;for(;a=i.nextNode();)_b(r,a)&&!_b(Pe,a)&&(t&&Nt(B.uponSanitizeShadowNode,a,null),zt(a,n),Kt(a,n),jt(a.content)&&qt(a.content))},Ct=function(e){Pe&&gb(Pe,e)},wt=function(e,t){return be?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Tt=function(e){be&&_t(e,e=>{let t=C(e);if(t===fx.processingInstruction||t===fx.comment&&Ab(lx,e.data)){try{p(e)}catch{}return!1}if(t===fx.element){let t=e,n=tt(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&wt(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Et=function(e){let t=null,r=null;if(Te)e=`<remove></remove>`+e;else{let t=bb(e,/^[\r\n\t ]+/);r=t&&t[0]}$e===`application/xhtml+xml`&&Ge===We&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=D?N(e):e;if(Ge===We)try{t=new l().parseFromString(i,$e)}catch{}if(!t||!t.documentElement){t=L.createDocument(Ge,`template`,null);try{t.documentElement.innerHTML=G?O:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ge===We?ee.call(t,xe?`html`:`body`)[0]:xe?t.documentElement:a},Dt=function(e){let t=S?S(e):e.ownerDocument;return R.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},q=function(e){return e=xb(e,V,` `),e=xb(e,ne,` `),e=xb(e,re,` `),e},Ot=function(e){kt(e);let t=e.querySelectorAll?.call(e,`template`);t&&cb(t,e=>{jt(e.content)&&Ot(e.content)})},kt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=R.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=q(r.data),r=n.nextNode()},At=function(e){let t=x?x(e):null;return typeof t!=`string`||tt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},jt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===fx.documentFragment}catch{return!1}},Mt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Nt(e,n,r){e.length!==0&&cb(e,e=>{e.call(t,n,r,nt)})}let Pt=function(e,t){return!!(be&&e.hasChildNodes()&&!Mt(e.firstElementChild)&&Ab(cx,e.textContent)&&Ab(cx,e.innerHTML)||be&&px[t]&&C(e)===fx.element&&E(e)===We&&(Mt(e.firstElementChild)||typeof e.textContent==`string`&&Ab(cx,e.textContent))||e.nodeType===fx.processingInstruction||be&&e.nodeType===fx.comment&&Ab(lx,e.data))},Ft=function(e,t){return e instanceof RegExp?Ab(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},It=function(e,t,n){if(!fe[t]&&Ht(t)&&Ft(de.tagNameCheck,t))return!1;if(Me&&!Ie[t]&&!Ie[vb(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return ft(e),!0},Lt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Ib(t):t},Rt=function(e,t){return e===t||_(e)!==null?!1:(Ne&&vt(e),!0)},zt=function(e,n){if(Ct(e),Nt(B.beforeSanitizeElements,e,null),Rt(e,n))return!0;if(At(e))return ft(e),!0;let r=tt(w(e));if(W=Lt(B.uponSanitizeElement,W,ce,Ce),Nt(B.uponSanitizeElement,e,{tagName:r,allowedTags:W}),Rt(e,n))return!0;if(Pt(e,r))return ft(e),!0;if(fe[r]||!(me.tagCheck instanceof Function&&me.tagCheck(r))&&!W[r]){let t=It(e,r,n);return t===!1&&(Nt(B.afterSanitizeElements,e,null),Rt(e,n))?!0:t}if(C(e)===fx.element&&!dt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ab(ux,e.innerHTML))return ft(e),!0;if(ye&&e.nodeType===fx.text){let n=q(e.textContent);e.textContent!==n&&(db(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Nt(B.afterSanitizeElements,e,null),Rt(e,n)},Bt=function(e,t,r){if(pe[t]||wt(t,e)||ke&&(t===`id`||t===`name`)&&(r in n||r in rt))return!1;let i=le[t]||me.attributeCheck instanceof Function&&me.attributeCheck(t,e);return ge&&Ab(H,t)||he&&Ab(ie,t)?!0:i?Be[t]||Ab(U,xb(r,oe,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Sb(r,`data:`)===0&&Re[e]||_e&&!Ab(ae,xb(r,oe,``))?!0:!r:Ht(e)&&Ft(de.tagNameCheck,e)&&Ft(de.attributeNameCheck,t,e)||t===`is`&&de.allowCustomizedBuiltInElements&&Ft(de.tagNameCheck,r)},Vt=Pb({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ht=function(e){return!Vt[vb(e)]&&Ab(se,e)},Ut=function(e,t,n,r){if(D&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return N(r);case`TrustedScriptURL`:return P(r)}return r},Wt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!At(e)||(ft(e),!1)}catch{return ht(t,e),!1}},Gt=function(e,t){return be&&Ab(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:vb(e)===`attributename`&&bb(t,`href`)!==null},Kt=function(e,n){if(Nt(B.beforeSanitizeAttributes,e,null),Rt(e,n))return;let r=e.attributes;if(!r||At(e))return;le=Lt(B.uponSanitizeAttribute,le,ue,we);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:le,forceKeepAttr:void 0},a=r.length,o=tt(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=tt(s),d=l,f=s===`value`?d:Cb(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Nt(B.uponSanitizeAttribute,e,i),f=i.attrValue,Ae&&(u===`id`||u===`name`)&&Sb(f,je)!==0&&(ht(s,e,n),f=je+f,p=!0),Gt(s,f)?ht(s,e,n):i.forceKeepAttr||(i.keepAttr?!ve&&Ab(dx,f)?ht(s,e,n):(ye&&(f=q(f)),Bt(o,u,f)?(f=Ut(o,u,c,f),f!==d&&Wt(e,s,c,f)&&p&&ub(t.removed)):ht(s,e,n)):ht(s,e,n))}Nt(B.afterSanitizeAttributes,e,null),Rt(e,n)},qt=function(e){let t=null,n=Dt(e);for(Nt(B.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Nt(B.uponSanitizeShadowNode,t,null),zt(t,e),Kt(t,e),jt(t.content)&&qt(t.content),C(t)===fx.element){let e=v(t);jt(e)&&(J(e),qt(e))}ye&&kt(e),Nt(B.afterSanitizeShadowDOM,e,null)},J=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){qt(e.shadow);continue}let n=e.node,r=C(n)===fx.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&tt(e)===`template`){let e=n.content;jt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);jt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(G=!e,G&&(e=`<!-->`),typeof e!=`string`&&!Mt(e)&&(e=Lb(e),typeof e!=`string`))throw jb(`dirty is not a string, aborting`);if(!t.isSupported)return e;Se?(W=Ce,le=we):at(n),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(W=Ib(W)),B.uponSanitizeAttribute.length>0&&(le=Ib(le)),t.removed=[];let c=Ne&&typeof e!=`string`&&Mt(e),l=[],u=Pe;if(c){Tt(e);let t=w(e);if(typeof t==`string`){let n=tt(t);if(!W[n]||fe[n])throw mt(e),jb(`root node is forbidden and cannot be sanitized in-place`)}if(At(e))throw mt(e),jb(`root node is clobbered and cannot be sanitized in-place`);l=yt(e),Pe=hb()}else if(Mt(e))i=Et(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===fx.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),J(i);else{if(!Ee&&!ye&&!xe&&e.indexOf(`<`)===-1)return D&&Oe?N(e):e;if(i=Et(e),!i)return Ee?null:Oe?O:``}i&&Te&&ft(i.firstChild);let d=c?e:i;try{c&&J(e);let t=Dt(d);for(;o=t.nextNode();)zt(o,d),Kt(o,d),jt(o.content)&&qt(o.content);c&&xt(e,l)}catch(t){throw c&&(mt(e),bt(e,l)),t}finally{Pe=u}if(c){if(bt(e,l))throw jb(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return ye&&Ot(e),e}if(Ee){if(ye&&Ot(i),De)for(s=z.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(le.shadowroot||le.shadowrootmode)&&(s=te.call(r,s,!0)),s}let f=xe?i.outerHTML:i.innerHTML;return xe&&W[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ab(ox,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
14
|
-
`+f),ye&&(f=q(f)),D&&Oe?N(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};at(e),Se=!0,Ce=W,we=le},t.clearConfig=function(){nt=null,Se=!1,Ce=null,we=null,D=k,O=``},t.isValidAttribute=function(e,t,n){nt||at({});let r=tt(e),i=tt(t);return typeof n==`string`&&(Gt(t,n)||!ve&&Ab(dx,n))?!1:Bt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Ob(B,e)&&db(B[e],t)},t.removeHook=function(e,t){if(Ob(B,e)){if(t!==void 0){let n=lb(B[e],t);return n===-1?void 0:pb(B[e],n,1)[0]}return ub(B[e])}},t.removeHooks=function(e){Ob(B,e)&&(B[e]=[])},t.removeAllHooks=function(){B=gx()},t}var bx=yx();function xx(e){return bx.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0}})}function Sx(e,t){return`export function ${t.split(/[-_]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}Icon(props: React.SVGProps<SVGSVGElement>) {\n return (\n ${e.replace(/class=/g,`className=`).replace(/fill-rule=/g,`fillRule=`).replace(/clip-rule=/g,`clipRule=`).replace(/\sstyle="([^"]*)"/g,(e,t)=>` style={${Cx(t)}}`).replace(/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/g,(e,t,n,r)=>n.trim()===``?`${t}${r}`:`${t}{\`${n.replace(/[\\`]|\$\{/g,e=>`\\${e}`)}\`}${r}`).replace(`<svg`,`<svg {...props}`)}\n );\n}`}function Cx(e){return`{ ${e.split(`;`).map(e=>e.trim()).filter(Boolean).flatMap(e=>{let t=e.indexOf(`:`);if(t<1)return[];let n=e.slice(0,t).trim();return[`${n.startsWith(`--`)?JSON.stringify(n):n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}: ${JSON.stringify(e.slice(t+1).trim().replace(/"/g,`"`))}`]}).join(`, `)} }`.replace(`{ }`,`{}`)}function wx(e,t){let n=URL.createObjectURL(new Blob([e],{type:`image/svg+xml`}));Object.assign(document.createElement(`a`),{href:n,download:t}).click(),URL.revokeObjectURL(n),Ad(`Downloaded ${t}`)}function Tx(e,t){let n=xx(e.svg??``);if(!n)return Ad(`${e.name} has no SVG content left after removing unsafe markup`);t(n)}function Ex({asset:e}){return(0,Z.jsxs)(`figure`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`div`,{className:`flex aspect-[4/3] items-center justify-center rounded-lg bg-muted p-6`,children:(0,Z.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:e.url,alt:e.name,loading:`lazy`})}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col text-sm`,children:[e.name,(0,Z.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:U(e)}),le(e).map(e=>(0,Z.jsx)(`span`,{"data-asset-rule":``,className:`text-[13px] text-muted-foreground`,children:(0,Z.jsx)(Jg,{text:e})},e))]}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-x-3`,children:e.svg?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0`,onClick:()=>Tx(e,t=>kd(t,`Copied ${e.name} SVG`)),children:`Copy SVG`}),(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0`,onClick:()=>Tx(e,t=>kd(Sx(t,e.name),`Copied ${e.name} JSX`)),children:`Copy JSX`}),(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0`,onClick:()=>Tx(e,t=>wx(t,`${e.name}.svg`)),children:`Download`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`a`,{className:wu({variant:`link`,size:`sm`,className:`h-auto px-0`}),href:e.url,download:!0,children:`Download`}),(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0`,onClick:()=>kd(new URL(e.url,window.location.href).href,`Copied ${e.name} URL`),children:`Copy URL`})]})})]})}function Dx({data:e,assets:t,title:n,description:r,rules:i,kind:a}){let o=`${t.length} ${t.length===1?`file`:`files`}.`,s=fe(i);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(ng,{label:`Assets`,title:n,intro:r?`${r} ${o}`:o,children:[a&&(0,Z.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,Z.jsx)(e_,{kind:a}),a===`experiment`?`Explorations, not the brand's identity. They are left out of the press kit, the logo kit and the deck.`:`Kept for comparison or supplied by someone else, not the brand's live assets. The deck leaves them out.`]}),s&&(0,Z.jsx)(`p`,{"data-asset-rules":``,className:`mt-2 max-w-[40em] text-sm text-muted-foreground`,children:s})]}),(0,Z.jsx)(`div`,{className:`${tg} grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-6 py-10`,children:t.map(e=>(0,Z.jsx)(Ex,{asset:e},e.filePath))}),(0,Z.jsx)(rg,{title:e.title,trail:`Assets / ${n}`})]})}var Ox={tabs:`The favicon in a light and a dark browser tab, with the 16 px and 32 px icons enlarged and drawn pixelated.`,masks:`The 1024 px master under the iOS and Android masks. Dashed circles: the maskable safe zone (80%) and the Android adaptive safe zone (66 dp).`,sizes:`The master at the iOS app-icon sizes, 180 px down to 29 px.`},kx=[[`ground`,`Ground`],[`ink`,`Ink`],[`favicon`,`Favicon`],[`themeColor`,`Theme color`]],Ax=/^#[0-9a-f]{3,8}$/i,jx=e=>`${(e*100).toFixed(1)}%`;function Mx(e,t){let n=Ox[e.id],{adaptive:r}=t;return e.id!==`masks`||!n||r?.symbolReach===void 0||r.safeRadius===void 0?n:`${n} The symbol reaches ${jx(r.symbolReach)} of the Android layer's width from its centre; the adaptive safe zone is ${jx(r.safeRadius)}.`}function Nx({data:e,favicons:t}){let n=kx.flatMap(([e,n])=>t.colors?.[e]?[{key:e,label:n,value:t.colors[e]}]:[]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Assets`,title:`Favicons`,intro:`The favicon and app-icon set drawn from ${t.symbol?`the symbol ${t.symbol}`:`the brand symbol`}, and how it looks in a browser tab, under each platform's mask and at each iOS size.`}),(0,Z.jsxs)(ig,{children:[(t.views??[]).map(e=>(0,Z.jsx)(og,{heading:e.title,wide:!0,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[Mx(e,t)&&(0,Z.jsx)(sg,{children:Mx(e,t)}),(0,Z.jsx)(`figure`,{"data-favicons-view":e.id,className:`overflow-hidden rounded-lg border`,children:(0,Z.jsx)(`img`,{src:Md(e.file),width:e.width,height:e.height,alt:e.title,loading:`lazy`,className:`h-auto w-full`})})]})},e.id)),t.files&&t.files.length>0&&(0,Z.jsx)(og,{heading:`Files`,wide:!0,children:(0,Z.jsxs)(`table`,{"data-favicons-files":``,className:`w-full text-left text-sm`,children:[(0,Z.jsx)(`thead`,{children:(0,Z.jsxs)(`tr`,{className:`border-b`,children:[(0,Z.jsx)(`th`,{className:`py-2 pr-4 font-semibold`,children:`File`}),(0,Z.jsx)(`th`,{className:`py-2 pr-4 font-semibold`,children:`Size`}),(0,Z.jsx)(`th`,{className:`py-2 font-semibold`,children:`Use`})]})}),(0,Z.jsx)(`tbody`,{children:t.files.map(e=>(0,Z.jsxs)(`tr`,{className:`border-b last:border-b-0`,children:[(0,Z.jsx)(`td`,{className:`py-2 pr-4 font-mono text-[13px]`,children:e.file}),(0,Z.jsx)(`td`,{className:`py-2 pr-4 text-muted-foreground`,children:e.size}),(0,Z.jsx)(`td`,{className:`py-2 text-muted-foreground`,children:e.use})]},e.file))})]})}),t.head&&(0,Z.jsx)(og,{heading:`Head snippet`,wide:!0,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(hv,{code:t.head,language:`html`}),n.length>0&&(0,Z.jsx)(`ul`,{"data-favicons-colors":``,className:`flex flex-wrap gap-x-8 gap-y-3`,children:n.map(({key:e,label:t,value:n})=>(0,Z.jsxs)(`li`,{className:`flex items-center gap-3 text-sm`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-7 rounded-md border`,style:Ax.test(n)?{background:n}:void 0}),(0,Z.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:t}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-muted-foreground`,children:n})]})]},e))})]})})]}),(0,Z.jsx)(rg,{title:e.title,trail:`Assets / Favicons`})]})}function Px(){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Not found`,title:`Nothing here`}),(0,Z.jsx)(ig,{children:(0,Z.jsx)(`p`,{className:`py-10`,children:`This page does not exist. Pick a page from the index.`})})]})}var Fx=.6,Ix=e=>e.continued?`section`:e.kind,Lx=.9;1/Lx;function Rx(e,t,n){let r=[],i=0,a=0;return e.forEach((e,o)=>{let s=r.length===0?t:n;o>i&&a+e>s&&(r.push([i,o]),i=o,a=0),a+=e}),e.length>i&&r.push([i,e.length]),r}function zx(e,t,n,r){let i=(t,n)=>e.slice(t,n).reduce((e,t)=>e+t,0),a=i=>{let a=[],o=[],s=0,c=0,l=()=>Math.min(i,a.length===0?t:n);return e.forEach((e,t)=>{t>s&&c+e>l()&&(o.push([s,t]),s=t,c=0,o.length===r&&(a.push(o),o=[])),c+=e}),e.length>s&&o.push([s,e.length]),o.length>0&&a.push(o),a},o=a(1/0),s=Math.max(0,...e),c=Math.min(Math.max(t,n,s),i(0,e.length));for(;c-s>1;){let e=Math.floor((s+c)/2);a(e).length<=o.length?c=e:s=e}return a(a(s).length<=o.length?s:c).map(e=>{if(r!==2||e.length<2)return e;let[t,n]=[e[0][0],e[1][1]],a=e[0][1];for(let e=t+1;e<n;e++)Math.max(i(t,e),i(e,n))<Math.max(i(t,a),i(a,n))&&(a=e);return[[t,a],[a,n]]})}function Bx(e,t){let n=[],r;e.forEach((e,t)=>{r&&(Ix(e)===`section`||Ix(e)===`opener`)&&(n.push(r),r=void 0);let i=r??{blocks:[],height:0,section:Ix(e)===`section`,opener:e.kind===`opener`,intro:e.kind===`heading`};i.blocks.push(t),i.height+=e.height,e.kind===`heading`&&!i.opener?r=i:(n.push(i),r=void 0)}),r&&n.push(r);let i=[];for(let r of n){let n=i.at(-1),a=e[r.blocks[0]];n&&!n.opener&&!r.section&&!r.opener&&n.blocks.length===1&&e[n.blocks[0]].lead&&(a.figure||a.table)&&n.height+r.height<=t*1.1111111111111112?(n.blocks.push(...r.blocks),n.height+=r.height):i.push(r)}return i}var Vx=(e,t)=>e.blocks.reduce((e,n)=>e+(t[n].slack??0),0),Hx=.35;function Ux(e,t,n){let r=e.map(e=>({...e,blocks:[...e.blocks]})),i=e=>e.blocks.reduce((e,n)=>e+t[n].height,0),a=e=>e?Ix(t[e.blocks[0]]):void 0,o=(e,t,r,a=!1)=>{e.blocks=r?[...t,...e.blocks]:[...e.blocks,...t],a?(e.squeeze=!0,e.scale=1):e.scale=Math.max(Lx,Math.min(1,n/i(e)))},s=[];return r.forEach((e,c)=>{let l=e.scale===1&&e.layout===void 0&&e.blocks.every(e=>t[e].kind===void 0&&!t[e].continued)&&i(e)<=n*Hx,u=s.at(-1),d=r[c+1];l&&u&&a(u)!==`opener`&&i(u)+i(e)<=n*1.1111111111111112?o(u,e.blocks,!1):l&&u&&a(u)!==`opener`&&u.scale===1&&i(u)+i(e)-Vx(u,t)<=n?o(u,e.blocks,!1,!0):l&&d&&a(d)!==`section`&&a(d)!==`opener`&&i(e)+i(d)<=n*1.1111111111111112?o(d,e.blocks,!0):s.push(e)}),s}function Wx(e,t){let n=[],r=0,i=!1,a=Bx(e,t);return a.forEach((o,s)=>{let c=n.at(-1),l=a[s+1],u=o.intro&&l!==void 0&&!l.section&&!l.opener&&r>0&&r+o.height+l.height>t*1.1111111111111112&&o.height+l.height<=t*1.1111111111111112;o.opener||o.height>t?(n.push({blocks:o.blocks,scale:o.opener?1:Math.max(Lx,t/o.height)}),i=!0):c&&!i&&!u&&!o.section&&r+o.height>t&&r+o.height<=t*1.1111111111111112?(c.blocks.push(...o.blocks),r+=o.height,c.scale=t/r):c&&!i&&!u&&!o.section&&r+o.height>t&&r+o.height-Vx(o,e)-Vx(c,e)<=t?(c.blocks.push(...o.blocks),c.squeeze=!0,r=t,i=!0):!c||i||u||o.section&&c.blocks.length>0||r+o.height>t?(n.push({blocks:[...o.blocks],scale:1}),r=o.height,i=!1):(c.blocks.push(...o.blocks),r+=o.height)}),Ux(n,e,t)}var Gx=.5,Kx=2/3;function qx(e,t,n){let r=[],i=e=>e.blocks.reduce((e,n)=>e+t[n].height,0);for(let a=0;a<e.length;a++){let o=e[a],s=e[a+1],c=s?.blocks.length===1?t[s.blocks[0]]:void 0,l=o.blocks.every(e=>!t[e].figure&&t[e].kind!==`opener`);s&&c?.figure&&c.kind!==`opener`&&!c.continued&&l&&i(o)<=n*Gx&&c.height*Kx<=n*1.1111111111111112?(r.push({blocks:[...o.blocks,...s.blocks],scale:1,layout:`split`}),a++):r.push(o)}return r}function Jx(e){if(e.tagName===`ARTICLE`)return!0;if(e.tagName===`SECTION`)return!e.querySelector(`:scope > h1`)&&!e.hasAttribute(`data-lockup-group`);if(e.tagName!==`DIV`)return!1;if(e.classList.contains(`blazon-prose`)||e.hasAttribute(`data-print-split`)||e.querySelector(`:scope > [data-lockup-group]`))return!0;let t=[...e.children];return e.parentElement?.tagName===`SECTION`||t.length>0&&t.every(e=>e.tagName===`SECTION`)}function Yx(e){return e.matches(`figure, img, svg, [data-section-asset], .not-prose`)||e.querySelector(`img, svg, figure, canvas`)!==null}function Xx(e){let t=[],n=(e,r)=>{let i=r;for(let r of e.children){if(!(r instanceof HTMLElement)||r.tagName===`FOOTER`||r.tagName===`STYLE`||r.hasAttribute(`data-print-chapter-title`)||r.hasAttribute(`data-section-index`))continue;if(Jx(r)){let e=t.length;n(r,i),t.length>e&&(i=!1);continue}let e=r.tagName===`HEADER`||r.tagName===`SECTION`&&r.querySelector(`:scope > h1`)?`opener`:i?`section`:/^H[2-6]$/.test(r.tagName)?`heading`:void 0,a=r.tagName===`TABLE`||r.querySelector(`:scope > table`)!==null;t.push({el:r,...e&&{kind:e},...Yx(r)&&{figure:!0},...a&&{table:!0},...r.tagName===`P`&&{lead:!0}}),i=!1}};return n(e,!0),t}function Zx(e,t){let n=e.map(e=>e.el.getBoundingClientRect().top),r=t.getBoundingClientRect().bottom;return n.map((e,t)=>Math.max(0,(n[t+1]??r)-e))}var Qx=[`logo`,`color`,`typography`];function $x(e,t){return e.docs.map(n=>({id:`doc/${n.slug}`,title:n.title,body:()=>(0,Z.jsx)(Jv,{data:e,doc:n,mode:t,print:!0})}))}function eS(e){return he.filter(t=>e.tokens.items.some(t.has)).map(t=>{let n=Fy[t.hash];return{id:t.hash.slice(1),title:t.label,body:()=>(0,Z.jsx)(n,{data:e})}})}function tS(e,t){return t?[{id:`favicons`,title:`Favicons`,body:()=>(0,Z.jsx)(Nx,{data:e,favicons:t})}]:[]}function nS(e,t,n,r,i){let a=[...$x(t,r),...tS(t,i)];if(e===`essentials`){let e=new Set(t.docs.filter(e=>e.sections.some(e=>Qx.includes(e))).map(e=>`doc/${e.slug}`));return a.filter(t=>e.has(t.id))}if(e===`reference`)return eS(n);if(e.startsWith(`pages=`)){let t=new Map([...a,...eS(n)].map(e=>[e.id,e]));return e.slice(6).split(`,`).flatMap(e=>t.get(e)??[])}return a}var rS={width:1280,height:720},iS={top:72,side:112,bottom:72},aS={width:rS.width-2*iS.side,height:rS.height-iS.top-iS.bottom},oS=aS.height-8,sS=(aS.width-96)/3,cS=e=>2+e;function lS(){let e=`[data-print-book]`;return`
|
|
15
|
-
@page { size: ${
|
|
14
|
+
`+f),ye&&(f=q(f)),D&&Oe?N(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};at(e),Se=!0,Ce=W,we=le},t.clearConfig=function(){nt=null,Se=!1,Ce=null,we=null,D=k,O=``},t.isValidAttribute=function(e,t,n){nt||at({});let r=tt(e),i=tt(t);return typeof n==`string`&&(Gt(t,n)||!ve&&Ab(dx,n))?!1:Bt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Ob(B,e)&&db(B[e],t)},t.removeHook=function(e,t){if(Ob(B,e)){if(t!==void 0){let n=lb(B[e],t);return n===-1?void 0:pb(B[e],n,1)[0]}return ub(B[e])}},t.removeHooks=function(e){Ob(B,e)&&(B[e]=[])},t.removeAllHooks=function(){B=gx()},t}var bx=yx();function xx(e){return bx.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0}})}function Sx(e,t){return`export function ${t.split(/[-_]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}Icon(props: React.SVGProps<SVGSVGElement>) {\n return (\n ${e.replace(/class=/g,`className=`).replace(/fill-rule=/g,`fillRule=`).replace(/clip-rule=/g,`clipRule=`).replace(/\sstyle="([^"]*)"/g,(e,t)=>` style={${Cx(t)}}`).replace(/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/g,(e,t,n,r)=>n.trim()===``?`${t}${r}`:`${t}{\`${n.replace(/[\\`]|\$\{/g,e=>`\\${e}`)}\`}${r}`).replace(`<svg`,`<svg {...props}`)}\n );\n}`}function Cx(e){return`{ ${e.split(`;`).map(e=>e.trim()).filter(Boolean).flatMap(e=>{let t=e.indexOf(`:`);if(t<1)return[];let n=e.slice(0,t).trim();return[`${n.startsWith(`--`)?JSON.stringify(n):n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}: ${JSON.stringify(e.slice(t+1).trim().replace(/"/g,`"`))}`]}).join(`, `)} }`.replace(`{ }`,`{}`)}function wx(e,t){let n=URL.createObjectURL(new Blob([e],{type:`image/svg+xml`}));Object.assign(document.createElement(`a`),{href:n,download:t}).click(),URL.revokeObjectURL(n),Ad(`Downloaded ${t}`)}function Tx(e,t){let n=xx(e.svg??``);if(!n)return Ad(`${e.name} has no SVG content left after removing unsafe markup`);t(n)}function Ex({asset:e}){return(0,Z.jsxs)(`figure`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`div`,{className:`flex aspect-[4/3] items-center justify-center rounded-lg bg-muted p-6`,children:(0,Z.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:e.url,alt:e.name,loading:`lazy`})}),(0,Z.jsxs)(`figcaption`,{className:`flex flex-col text-sm`,children:[e.name,(0,Z.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:U(e)}),le(e).map(e=>(0,Z.jsx)(`span`,{"data-asset-rule":``,className:`text-[13px] text-muted-foreground`,children:(0,Z.jsx)(Jg,{text:e})},e))]}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-x-3`,children:e.svg?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0`,onClick:()=>Tx(e,t=>kd(t,`Copied ${e.name} SVG`)),children:`Copy SVG`}),(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0`,onClick:()=>Tx(e,t=>kd(Sx(t,e.name),`Copied ${e.name} JSX`)),children:`Copy JSX`}),(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0`,onClick:()=>Tx(e,t=>wx(t,`${e.name}.svg`)),children:`Download`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`a`,{className:wu({variant:`link`,size:`sm`,className:`h-auto px-0`}),href:e.url,download:!0,children:`Download`}),(0,Z.jsx)(Tu,{variant:`link`,size:`sm`,className:`h-auto px-0`,onClick:()=>kd(new URL(e.url,window.location.href).href,`Copied ${e.name} URL`),children:`Copy URL`})]})})]})}function Dx({data:e,assets:t,title:n,description:r,rules:i,kind:a}){let o=`${t.length} ${t.length===1?`file`:`files`}.`,s=fe(i);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(ng,{label:`Assets`,title:n,intro:r?`${r} ${o}`:o,children:[a&&(0,Z.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,Z.jsx)(e_,{kind:a}),a===`experiment`?`Explorations, not the brand's identity. They are left out of the press kit, the logo kit and the deck.`:`Kept for comparison or supplied by someone else, not the brand's live assets. The deck leaves them out.`]}),s&&(0,Z.jsx)(`p`,{"data-asset-rules":``,className:`mt-2 max-w-[40em] text-sm text-muted-foreground`,children:s})]}),(0,Z.jsx)(`div`,{className:`${tg} grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-6 py-10`,children:t.map(e=>(0,Z.jsx)(Ex,{asset:e},e.filePath))}),(0,Z.jsx)(rg,{title:e.title,trail:`Assets / ${n}`})]})}var Ox={tabs:`The favicon in a light and a dark browser tab, with the 16 px and 32 px icons enlarged and drawn pixelated.`,masks:`The 1024 px master under the iOS and Android masks. Dashed circles: the maskable safe zone (80%) and the Android adaptive safe zone (66 dp).`,sizes:`The master at the iOS app-icon sizes, 180 px down to 29 px.`},kx=[[`ground`,`Ground`],[`ink`,`Ink`],[`favicon`,`Favicon`],[`themeColor`,`Theme color`]],Ax=/^#[0-9a-f]{3,8}$/i,jx=e=>`${(e*100).toFixed(1)}%`;function Mx(e,t){let n=Ox[e.id],{adaptive:r}=t;return e.id!==`masks`||!n||r?.symbolReach===void 0||r.safeRadius===void 0?n:`${n} The symbol reaches ${jx(r.symbolReach)} of the Android layer's width from its centre; the adaptive safe zone is ${jx(r.safeRadius)}.`}function Nx({data:e,favicons:t}){let n=kx.flatMap(([e,n])=>t.colors?.[e]?[{key:e,label:n,value:t.colors[e]}]:[]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Assets`,title:`Favicons`,intro:`The favicon and app-icon set drawn from ${t.symbol?`the symbol ${t.symbol}`:`the brand symbol`}, and how it looks in a browser tab, under each platform's mask and at each iOS size.`}),(0,Z.jsxs)(ig,{children:[(t.views??[]).map(e=>(0,Z.jsx)(og,{heading:e.title,wide:!0,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[Mx(e,t)&&(0,Z.jsx)(sg,{children:Mx(e,t)}),(0,Z.jsx)(`figure`,{"data-favicons-view":e.id,className:`overflow-hidden rounded-lg border`,children:(0,Z.jsx)(`img`,{src:Md(e.file),width:e.width,height:e.height,alt:e.title,loading:`lazy`,className:`h-auto w-full`})})]})},e.id)),t.files&&t.files.length>0&&(0,Z.jsx)(og,{heading:`Files`,wide:!0,children:(0,Z.jsxs)(`table`,{"data-favicons-files":``,className:`w-full text-left text-sm`,children:[(0,Z.jsx)(`thead`,{children:(0,Z.jsxs)(`tr`,{className:`border-b`,children:[(0,Z.jsx)(`th`,{className:`py-2 pr-4 font-semibold`,children:`File`}),(0,Z.jsx)(`th`,{className:`py-2 pr-4 font-semibold`,children:`Size`}),(0,Z.jsx)(`th`,{className:`py-2 font-semibold`,children:`Use`})]})}),(0,Z.jsx)(`tbody`,{children:t.files.map(e=>(0,Z.jsxs)(`tr`,{className:`border-b last:border-b-0`,children:[(0,Z.jsx)(`td`,{className:`py-2 pr-4 font-mono text-[13px]`,children:e.file}),(0,Z.jsx)(`td`,{className:`py-2 pr-4 text-muted-foreground`,children:e.size}),(0,Z.jsx)(`td`,{className:`py-2 text-muted-foreground`,children:e.use})]},e.file))})]})}),t.head&&(0,Z.jsx)(og,{heading:`Head snippet`,wide:!0,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(hv,{code:t.head,language:`html`}),n.length>0&&(0,Z.jsx)(`ul`,{"data-favicons-colors":``,className:`flex flex-wrap gap-x-8 gap-y-3`,children:n.map(({key:e,label:t,value:n})=>(0,Z.jsxs)(`li`,{className:`flex items-center gap-3 text-sm`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-7 rounded-md border`,style:Ax.test(n)?{background:n}:void 0}),(0,Z.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:t}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-muted-foreground`,children:n})]})]},e))})]})})]}),(0,Z.jsx)(rg,{title:e.title,trail:`Assets / Favicons`})]})}function Px(){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ng,{label:`Not found`,title:`Nothing here`}),(0,Z.jsx)(ig,{children:(0,Z.jsx)(`p`,{className:`py-10`,children:`This page does not exist. Pick a page from the index.`})})]})}var Fx=e=>e.continued?`section`:e.kind,Ix=.9;1/Ix;function Lx(e,t,n){let r=[],i=0,a=0;return e.forEach((e,o)=>{let s=r.length===0?t:n;o>i&&a+e>s&&(r.push([i,o]),i=o,a=0),a+=e}),e.length>i&&r.push([i,e.length]),r}function Rx(e,t,n,r){let i=(t,n)=>e.slice(t,n).reduce((e,t)=>e+t,0),a=i=>{let a=[],o=[],s=0,c=0,l=()=>Math.min(i,a.length===0?t:n);return e.forEach((e,t)=>{t>s&&c+e>l()&&(o.push([s,t]),s=t,c=0,o.length===r&&(a.push(o),o=[])),c+=e}),e.length>s&&o.push([s,e.length]),o.length>0&&a.push(o),a},o=a(1/0),s=Math.max(0,...e),c=Math.min(Math.max(t,n,s),i(0,e.length));for(;c-s>1;){let e=Math.floor((s+c)/2);a(e).length<=o.length?c=e:s=e}return a(a(s).length<=o.length?s:c).map(e=>{if(r!==2||e.length<2)return e;let[t,n]=[e[0][0],e[1][1]],a=e[0][1];for(let e=t+1;e<n;e++)Math.max(i(t,e),i(e,n))<Math.max(i(t,a),i(a,n))&&(a=e);return[[t,a],[a,n]]})}function zx(e,t){let n=[],r;e.forEach((e,t)=>{r&&(Fx(e)===`section`||Fx(e)===`opener`)&&(n.push(r),r=void 0);let i=r??{blocks:[],height:0,section:Fx(e)===`section`,opener:e.kind===`opener`,intro:e.kind===`heading`};i.blocks.push(t),i.height+=e.height,e.kind===`heading`&&!i.opener?r=i:(n.push(i),r=void 0)}),r&&n.push(r);let i=[];for(let r of n){let n=i.at(-1),a=e[r.blocks[0]];n&&!n.opener&&!r.section&&!r.opener&&n.blocks.length===1&&e[n.blocks[0]].lead&&(a.figure||a.table)&&n.height+r.height<=t*1.1111111111111112?(n.blocks.push(...r.blocks),n.height+=r.height):i.push(r)}return i}var Bx=(e,t)=>e.blocks.reduce((e,n)=>e+(t[n].slack??0),0),Vx=.35;function Hx(e,t,n){let r=e.map(e=>({...e,blocks:[...e.blocks]})),i=e=>e.blocks.reduce((e,n)=>e+t[n].height,0),a=e=>e?Fx(t[e.blocks[0]]):void 0,o=(e,t,r,a=!1)=>{e.blocks=r?[...t,...e.blocks]:[...e.blocks,...t],a?(e.squeeze=!0,e.scale=1):e.scale=Math.max(Ix,Math.min(1,n/i(e)))},s=[];return r.forEach((e,c)=>{let l=e.scale===1&&e.layout===void 0&&e.blocks.every(e=>t[e].kind===void 0&&!t[e].continued)&&i(e)<=n*Vx,u=s.at(-1),d=r[c+1];l&&u&&a(u)!==`opener`&&i(u)+i(e)<=n*1.1111111111111112?o(u,e.blocks,!1):l&&u&&a(u)!==`opener`&&u.scale===1&&i(u)+i(e)-Bx(u,t)<=n?o(u,e.blocks,!1,!0):l&&d&&a(d)!==`section`&&a(d)!==`opener`&&i(e)+i(d)<=n*1.1111111111111112?o(d,e.blocks,!0):s.push(e)}),s}function Ux(e,t){let n=[],r=0,i=!1,a=zx(e,t);return a.forEach((o,s)=>{let c=n.at(-1),l=a[s+1],u=o.intro&&l!==void 0&&!l.section&&!l.opener&&r>0&&r+o.height+l.height>t*1.1111111111111112&&o.height+l.height<=t*1.1111111111111112;o.opener||o.height>t?(n.push({blocks:o.blocks,scale:o.opener?1:Math.max(Ix,t/o.height)}),i=!0):c&&!i&&!u&&!o.section&&r+o.height>t&&r+o.height<=t*1.1111111111111112?(c.blocks.push(...o.blocks),r+=o.height,c.scale=t/r):c&&!i&&!u&&!o.section&&r+o.height>t&&r+o.height-Bx(o,e)-Bx(c,e)<=t?(c.blocks.push(...o.blocks),c.squeeze=!0,r=t,i=!0):!c||i||u||o.section&&c.blocks.length>0||r+o.height>t?(n.push({blocks:[...o.blocks],scale:1}),r=o.height,i=!1):(c.blocks.push(...o.blocks),r+=o.height)}),Hx(n,e,t)}var Wx=.5,Gx=2/3;function Kx(e,t,n){let r=[],i=e=>e.blocks.reduce((e,n)=>e+t[n].height,0);for(let a=0;a<e.length;a++){let o=e[a],s=e[a+1],c=s?.blocks.length===1?t[s.blocks[0]]:void 0,l=o.blocks.every(e=>!t[e].figure&&t[e].kind!==`opener`);s&&c?.figure&&c.kind!==`opener`&&!c.continued&&l&&i(o)<=n*Wx&&c.height*Gx<=n*1.1111111111111112?(r.push({blocks:[...o.blocks,...s.blocks],scale:1,layout:`split`}),a++):r.push(o)}return r}function qx(e){if(e.tagName===`ARTICLE`)return!0;if(e.tagName===`SECTION`)return!e.querySelector(`:scope > h1`)&&!e.hasAttribute(`data-lockup-group`);if(e.tagName!==`DIV`)return!1;if(e.classList.contains(`blazon-prose`)||e.hasAttribute(`data-print-split`)||e.querySelector(`:scope > [data-lockup-group]`))return!0;let t=[...e.children];return e.parentElement?.tagName===`SECTION`||t.length>0&&t.every(e=>e.tagName===`SECTION`)}function Jx(e){return e.matches(`figure, img, svg, [data-section-asset], .not-prose`)||e.querySelector(`img, svg, figure, canvas`)!==null}function Yx(e){let t=[],n=(e,r)=>{let i=r;for(let r of e.children){if(!(r instanceof HTMLElement)||r.tagName===`FOOTER`||r.tagName===`STYLE`||r.hasAttribute(`data-print-chapter-title`)||r.hasAttribute(`data-section-index`))continue;if(qx(r)){let e=t.length;n(r,i),t.length>e&&(i=!1);continue}let e=r.tagName===`HEADER`||r.tagName===`SECTION`&&r.querySelector(`:scope > h1`)?`opener`:i?`section`:/^H[2-6]$/.test(r.tagName)?`heading`:void 0,a=r.tagName===`TABLE`||r.querySelector(`:scope > table`)!==null;t.push({el:r,...e&&{kind:e},...Jx(r)&&{figure:!0},...a&&{table:!0},...r.tagName===`P`&&{lead:!0}}),i=!1}};return n(e,!0),t}function Xx(e,t){let n=e.map(e=>e.el.getBoundingClientRect().top),r=t.getBoundingClientRect().bottom;return n.map((e,t)=>Math.max(0,(n[t+1]??r)-e))}var Zx=[`logo`,`color`,`typography`];function Qx(e,t){return e.docs.map(n=>({id:`doc/${n.slug}`,title:n.title,body:()=>(0,Z.jsx)(Jv,{data:e,doc:n,mode:t,print:!0})}))}function $x(e){return he.filter(t=>e.tokens.items.some(t.has)).map(t=>{let n=Fy[t.hash];return{id:t.hash.slice(1),title:t.label,body:()=>(0,Z.jsx)(n,{data:e})}})}function eS(e,t){return t?[{id:`favicons`,title:`Favicons`,body:()=>(0,Z.jsx)(Nx,{data:e,favicons:t})}]:[]}function tS(e,t,n,r,i){let a=[...Qx(t,r),...eS(t,i)];if(e===`essentials`){let e=new Set(t.docs.filter(e=>e.sections.some(e=>Zx.includes(e))).map(e=>`doc/${e.slug}`));return a.filter(t=>e.has(t.id))}if(e===`reference`)return $x(n);if(e.startsWith(`pages=`)){let t=new Map([...a,...$x(n)].map(e=>[e.id,e]));return e.slice(6).split(`,`).flatMap(e=>t.get(e)??[])}return a}var nS={width:1280,height:720},rS={top:72,side:112,bottom:72},iS={width:nS.width-2*rS.side,height:nS.height-rS.top-rS.bottom},aS=iS.height-8,oS=(iS.width-96)/3,sS=e=>2+e,cS={compact:{squeezeFloor:.6,figureMax:380,sectionPadding:12,sectionGap:12,proseLeading:1.4,proseMargin:`0.6em`,headingMargin:`1em`},roomy:{squeezeFloor:1,figureMax:420,sectionPadding:24,sectionGap:16,proseLeading:1.5}},lS=`compact`;function uS(e){return e!==void 0&&Object.hasOwn(cS,e)?e:lS}var dS=e=>cS[e];function fS(e){let{figureMax:t,sectionPadding:n,sectionGap:r,proseLeading:i,proseMargin:a,headingMargin:o}=dS(e),s=`[data-print-book]`;return`
|
|
15
|
+
@page { size: ${nS.width}px ${nS.height}px; margin: 0; }
|
|
16
16
|
html, body { background: var(--background); }
|
|
17
17
|
/* Laid out (it is what the book measures) but off the page, in a box of no height, so it prints nothing */
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
padding: ${
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
18
|
+
${s} [data-print-flow] { position: absolute; left: -100000px; top: 0; width: ${iS.width}px; height: 0; overflow: hidden; }
|
|
19
|
+
${s} [data-print-slide] { position: relative; box-sizing: border-box; width: ${nS.width}px; height: ${nS.height}px;
|
|
20
|
+
padding: ${rS.top}px ${rS.side}px ${rS.bottom}px; overflow: hidden; break-after: page; }
|
|
21
|
+
${s} [data-print-slide]:not([data-print-slide="cover"]) { background: var(--background); }
|
|
22
|
+
${s} [data-print-slide]:last-child { break-after: auto; }
|
|
23
|
+
${s} [data-print-slide] > [data-print-slide-body] { height: ${iS.height}px; overflow: hidden; }
|
|
24
|
+
${s} [data-print-slide="opener"] { padding: 0; }
|
|
25
|
+
${s} [data-print-slide="cover"] { background: var(--blazon-inverse); padding: 80px 112px; }
|
|
26
26
|
/* An opener's section label and brand mark are placed absolutely, past its padding: give them the slide's margin */
|
|
27
|
-
${
|
|
28
|
-
${
|
|
29
|
-
${
|
|
30
|
-
${
|
|
31
|
-
${
|
|
27
|
+
${s} [data-print-slide="opener"] [data-opener-label] { top: ${rS.top}px; }
|
|
28
|
+
${s} [data-print-slide="opener"] [data-opener-mark] { bottom: ${rS.bottom}px; }
|
|
29
|
+
${s} [data-print-slide="opener"] > [data-print-slide-body] { height: 100%; }
|
|
30
|
+
${s} [data-print-slide="opener"] [data-print-slide-body] > * { box-sizing: border-box; height: 100%; min-height: 0; padding: 80px 112px; }
|
|
31
|
+
${s} [data-print-footer] { position: absolute; left: ${rS.side}px; right: ${rS.side}px; bottom: 28px; display: flex;
|
|
32
32
|
justify-content: space-between; font: 13px var(--font-sans); color: var(--muted-foreground); }
|
|
33
33
|
/* A long title is one line, cut with an ellipsis, so the footer is as high as it is with a short one */
|
|
34
|
-
${
|
|
35
|
-
${
|
|
36
|
-
${
|
|
37
|
-
@media screen { html, body { background: var(--muted); } ${
|
|
34
|
+
${s} [data-print-footer] > span { white-space: nowrap; }
|
|
35
|
+
${s} [data-print-footer] > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; margin-right: 24px; }
|
|
36
|
+
${s} [data-print-footer] > span:last-child { flex: none; }
|
|
37
|
+
@media screen { html, body { background: var(--muted); } ${s} { padding: 56px 0; } ${s} [data-print-slide] { margin: 0 auto 56px; outline: 1px solid var(--border); } }
|
|
38
38
|
/* Interactive chrome of the web page: the copy button of a code block has nothing to do on paper */
|
|
39
|
-
${
|
|
40
|
-
${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
${
|
|
47
|
-
${
|
|
48
|
-
${e} .blazon-prose blockquote { font-size: 15px; }
|
|
49
|
-
${e} .blazon-prose p, ${e} .blazon-prose li { max-width: 62ch; }
|
|
39
|
+
${s} [data-slot="code-block-actions"], ${s} [data-slot="code-block-copy-button"] { display: none !important; }
|
|
40
|
+
${s} footer, ${s} [data-section-index] { display: none; }
|
|
41
|
+
${s} article, ${s} [data-print-chapter] > div, ${s} header { padding-left: 0; padding-right: 0; }
|
|
42
|
+
${s} section:not([data-print-slide] [data-print-slide-body] > section:only-child) { grid-template-columns: minmax(0, 1fr); padding: ${n}px 0; border: 0; row-gap: ${r}px; }
|
|
43
|
+
${s} h2 { font-family: var(--font-heading); font-size: 38px; line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
|
|
44
|
+
${s} .blazon-prose { max-width: none; font-size: 20px; line-height: ${i}; }
|
|
45
|
+
${a?`${s} .blazon-prose :is(p, ul, ol, table) { margin-bottom: ${a}; }\n`:``}${o?`${s} .blazon-prose h3 { margin-top: ${o}; }\n`:``}${s} .blazon-prose table { font-size: 16px; }
|
|
46
|
+
${s} .blazon-prose blockquote { font-size: 15px; }
|
|
47
|
+
${s} .blazon-prose p, ${s} .blazon-prose li { max-width: 62ch; }
|
|
50
48
|
/* A continued slide's label, the section heading and "(continued)" in the muted colour on one line: the heading gives way
|
|
51
49
|
with an ellipsis, the suffix never. 14px, so 12.6px (9.5 pt) at the smallest a slide is drawn at */
|
|
52
|
-
${
|
|
53
|
-
${
|
|
54
|
-
${
|
|
50
|
+
${s} [data-print-continued-label] { display: flex; height: 20px; margin-bottom: 12px; font: 500 14px/20px var(--font-sans); color: var(--muted-foreground); }
|
|
51
|
+
${s} [data-print-continued-label] span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
52
|
+
${s} [data-print-continued-label] span:last-child { flex: none; white-space: pre; }
|
|
55
53
|
/* A split slide: the intro in a column on the left, the figure in the two thirds on the right */
|
|
56
|
-
${
|
|
57
|
-
${
|
|
58
|
-
${
|
|
59
|
-
${
|
|
54
|
+
${s} [data-print-slide-body][data-layout="split"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; align-items: start; }
|
|
55
|
+
${s} [data-section-asset] { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; }
|
|
56
|
+
${s} [data-section-asset] h3 { font-size: 27px; font-family: var(--font-heading); }
|
|
57
|
+
${s} [data-section-asset] p, ${s} [data-section-asset] li { font-size: 18px; }
|
|
60
58
|
/* An asset's figure beside its text, not below it as on a wide web page */
|
|
61
|
-
${
|
|
62
|
-
${
|
|
59
|
+
${s} [data-section-asset] figure { grid-column: auto; }
|
|
60
|
+
${s} [data-section-asset] figure > div { max-height: 360px; }
|
|
63
61
|
/* A figure is framed at its image's real ratio on the web, so its height grows with its width, and drawing the frame
|
|
64
62
|
smaller (fit) widens it again: a tall image never got shorter and was cut off at the foot of the slide. In print the
|
|
65
63
|
frame takes the image's own size, and the image is held to what a slide has room for. */
|
|
66
|
-
${
|
|
67
|
-
${
|
|
64
|
+
${s} [data-frame] { aspect-ratio: auto !important; }
|
|
65
|
+
${s} [data-frame] img { max-height: ${t}px; width: auto; }
|
|
68
66
|
/* A Favicons view is a picture at the full width of the page, as tall as its ratio makes it: a square sheet was 1054px tall and
|
|
69
67
|
wider still when the slide was drawn smaller, past what even the smallest size holds. It is held to what a slide has room for. */
|
|
70
|
-
${
|
|
71
|
-
${
|
|
68
|
+
${s} [data-favicons-view] img { max-height: ${t}px; width: auto; max-width: 100%; margin-inline: auto; object-fit: contain; }
|
|
69
|
+
${s} [data-section-asset] img { max-height: 330px; width: auto; max-width: 100%; margin-inline: auto; object-fit: contain; }
|
|
72
70
|
/* The viewer's small type, raised by the same 1.11 as the body: its smallest (a caption, a label) is 12px, 9 pt on the
|
|
73
71
|
slide and 8.1 pt at the smallest scale a slide is drawn at. In :where, so a rule above that sets a size (a heading) wins */
|
|
74
|
-
${
|
|
75
|
-
`)}`}var
|
|
76
|
-
`),[
|
|
77
|
-
M`,...
|
|
72
|
+
${pS.map(([e,t])=>`${s} :where([class~="${e}"]) { font-size: ${t}px; }`).join(`
|
|
73
|
+
`)}`}var pS=[[`text-[0.625rem]`,12],[`text-[11px]`,12.5],[`text-xs`,13.5],[`text-[0.8rem]`,14],[`text-[13px]`,14.5],[`text-sm`,16],[`text-[15px]`,17],[`text-base`,18],[`text-lg`,20]];function mS(e,t,n,r){let i=document.createElement(`div`);i.dataset.printSlide=e,r&&(i.dataset.printSqueeze=``);let a=document.createElement(`div`);a.dataset.printSlideBody=``,e===`content`&&(a.className=`blazon-prose`);let o=t.map(e=>e.cloneNode(!0));if(n===`split`){a.dataset.layout=`split`;let e=document.createElement(`div`);e.append(...o.slice(0,-1));let t=document.createElement(`div`);t.append(o.at(-1)),a.append(e,t)}else a.append(...o);let s=t[0]?.dataset.printContinued;return e===`content`&&s&&a.prepend(hS(s)),i.append(a),i}function hS(e){let t=document.createElement(`div`);t.dataset.printContinuedLabel=``;let[n,r]=[document.createElement(`span`),document.createElement(`span`)];return n.textContent=e,r.textContent=` (continued)`,t.append(n,r),t}function gS(e,t){let n=document.createElement(`div`);n.dataset.printFooter=``;let[r,i]=[document.createElement(`span`),document.createElement(`span`)];return r.textContent=e,i.textContent=String(t),n.append(r,i),n}var _S=`[data-frame] img:not([data-min-size]), [data-section-asset] img:not([data-min-size])`;function vS(e,t){let n=e.matches(_S)?[e]:[...e.querySelectorAll(_S)];return Math.floor(n.reduce((e,n)=>e+n.getBoundingClientRect().height*(1-t),0))}function yS(e,t){let n=[...e.querySelectorAll(_S)],r=n.map(e=>e.getBoundingClientRect().height),i=r.reduce((e,t)=>e+t,0);for(let a=0;a<bS;a++){let a=e.scrollHeight-iS.height;if(a<=1||i<=0)return;n.forEach((e,n)=>{let o=e.getBoundingClientRect().height;e.style.maxHeight=`${Math.max(r[n]*t,o-a*r[n]/i)}px`})}}var bS=4,xS=.5;function SS(e,t){for(let n of e.querySelectorAll(`[data-min-size]`)){let e=Number(n.dataset.minSize);if(!(e>0))continue;let r=n.dataset.minAxis===`height`?`height`:`width`;n.style[r]=`${e/t}px`,n.style[r===`width`?`height`:`width`]=`auto`}}function CS(e,t){let n=e.querySelector(`[data-print-slide-body]`);if(e.dataset.printSlide!==`content`)return;e.dataset.printSqueeze!==void 0&&yS(n,t);let r=1,i=[...n.querySelectorAll(`[data-frame] img:not([data-min-size]), [data-section-asset] img:not([data-min-size])`)].map(e=>[e,e.getBoundingClientRect().width]);for(let e=0;e<bS;e++){let e=n.scrollHeight;if(!e||e-iS.height/r<=1)break;let t=Math.max(xS,iS.height/e);if(t>=r)break;r=t,n.style.zoom=String(r),n.style.width=`${iS.width/r}px`,n.style.height=`${iS.height/r}px`,SS(n,r);for(let[e,t]of i)t>0&&(e.style.maxWidth=`${t}px`)}n.scrollHeight-iS.height/r>1&&(e.dataset.printClipped=``)}var wS=2,TS=e=>e instanceof HTMLElement&&![`STYLE`,`SCRIPT`].includes(e.tagName)&&e.getBoundingClientRect().height>0;function ES(e){if(e instanceof HTMLTableElement){let t=[...e.tBodies].flatMap(e=>[...e.rows]);return t.length>1?{target:e,groups:t.map(e=>[e]),head:e.tHead}:null}let t=[],n=-1/0;for(let r of e.children){if(!TS(r))continue;let e=r.getBoundingClientRect().top;t.length===0||e-n>=wS?t.push([r]):t.at(-1).push(r),n=e}return t.length>1?{target:e,groups:t,head:null}:null}function DS(e){if(e instanceof HTMLTableElement||e instanceof HTMLUListElement||e instanceof HTMLOListElement)return!0;let{display:t,flexWrap:n}=getComputedStyle(e);return t.includes(`grid`)||t.includes(`flex`)&&n!==`nowrap`}function OS(e){let t=null;for(let n of[e,...e.querySelectorAll(`table, div, ul, ol, section`)]){if(!DS(n)||n.closest(`figure`)!==null&&e.contains(n.closest(`figure`)))continue;let r=ES(n);r&&(!t||r.groups.length>t.groups.length)&&(t=r)}return t}function kS(e,t){let n=[];for(let r=t;r!==e;r=r.parentElement)n.unshift([...r.parentElement.children].indexOf(r));return n}function AS(e,t,n,r,i=``){let a=OS(e);if(!a)return null;if(jS(a)){let o=e.cloneNode(!0),s=o;for(let t of kS(e,a.target))s=s.children[t];for(let e of s.children)e instanceof HTMLElement&&(e.style.gridColumn=`auto`);e.after(o);try{let a=IS(o,t-e.getBoundingClientRect().height+o.getBoundingClientRect().height,n,r,i,!0);if(a)return a}finally{o.remove()}}return IS(e,t,n,r,i,!1)}function jS({target:e,groups:t}){return!(e instanceof HTMLTableElement)&&getComputedStyle(e).display.includes(`grid`)&&t.length>1&&t.every(e=>e.length===1&&e[0].classList.contains(`col-span-full`))}function MS(e){return e.length>2&&e.slice(0,-1).every(t=>Math.abs(t-e[0])<=1)}var NS=48;function PS({target:e,groups:t}){return e instanceof HTMLTableElement&&t.length>3&&e.getBoundingClientRect().width*2+NS<=iS.width&&e.tFoot===null&&e.caption===null&&e.querySelector(`[rowspan], [colspan], table table`)===null}function FS(e,t,n){let r=e.cloneNode(!0),i=e=>[...e.querySelectorAll(`tbody tr`)];i(e).slice(n).forEach(e=>e.remove()),i(r).slice(0,n).forEach(e=>e.remove());let a=document.createElement(`div`);a.dataset.printColumns=``,a.style.cssText=`display:flex;align-items:flex-start;gap:${NS}px;margin-bottom:${getComputedStyle(e).marginBottom}`;for(let n of[e,r]){for(let e of[...n.tBodies])e.rows.length===0&&e.remove();let e=document.createElement(`colgroup`);for(let n of t)e.append(Object.assign(document.createElement(`col`),{style:`width:${n}px`}));n.prepend(e),n.style.cssText=`table-layout:fixed;width:${t.reduce((e,t)=>e+t,0)}px;margin:0`,a.append(n)}return a}function IS(e,t,n,r,i,a){let o=OS(e);if(!o)return null;let{target:s,groups:c,head:l}=o,u=e.getBoundingClientRect().top,d=c.map(e=>e[0].getBoundingClientRect().top),f=Math.max(...c.at(-1).map(e=>e.getBoundingClientRect().bottom)),p=d.map((e,t)=>(d[t+1]??f)-e),m=d[0]-u,h=Math.max(0,t-m-p.reduce((e,t)=>e+t,0)),g=(l?d[0]-l.getBoundingClientRect().top:0)+(i?32:0),_=PS(o),v=d.length>1?d[1]-Math.max(...c[0].map(e=>e.getBoundingClientRect().bottom)):0,y=!_&&!a&&!(s instanceof HTMLTableElement||s instanceof HTMLUListElement||s instanceof HTMLOListElement)&&MS(p)?zS+(iS.height-aS)+Math.max(0,v):0,b=_||a?Rx(p,n-m,r-g,_?2:1):Lx(p,n-m+y,r-g+y).map(e=>[e]),x=b.map(e=>[e[0][0],e.at(-1)[1]]);if(x.length<2&&!(a||_&&b[0].length>1))return null;let S=_?[...(l?.rows[0]??s.tBodies[0].rows[0]).cells].map(e=>e.getBoundingClientRect().width):[],C=kS(e,s),w=[],T=[];return x.forEach(([t,n],r)=>{let a=e.cloneNode(!0),o=a,l=[a];for(let e of C)l.push(o=o.children[e]);l.forEach((e,t)=>{let n=l[t+1];if(!n)return;let i=[...e.children],a=i.indexOf(n);i.forEach((e,t)=>{(t<a&&r>0||t>a&&r<x.length-1)&&e.remove()})});let u=new Set(c.slice(t,n).flat()),d=s instanceof HTMLTableElement?[...o.querySelectorAll(`tbody tr`)]:[...o.children].filter(e=>e instanceof HTMLElement),f=s instanceof HTMLTableElement?c.flat():[...s.children].filter(e=>e instanceof HTMLElement);if(d.forEach((e,t)=>{u.has(f[t])||e.remove()}),o instanceof HTMLTableElement)for(let e of[...o.tBodies])e.rows.length===0&&e.remove();o instanceof HTMLOListElement&&(o.start=s.start+f.slice(0,f.indexOf(c[t][0])).filter(e=>e.tagName===`LI`).length);let v=a,y=b[r];if(_&&y.length>1&&o instanceof HTMLTableElement){let e=FS(o,S,y[0][1]-t);o===a?v=e:o.replaceWith(e)}if(r>0){v.dataset.printContinued=i;for(let e of v.querySelectorAll(`[id]`))e.removeAttribute(`id`);v.removeAttribute(`id`)}w.push(v);let E=Math.max(...y.map(([e,t])=>p.slice(e,t).reduce((e,t)=>e+t,0)));T.push(E+(r===0?m:g)+(r===x.length-1?h:0))}),{els:w,heights:T}}function LS(e,t,n){let r=0,i=n-1;for(i>=0&&e[i].lead&&(r+=t[i--]);i>=0&&e[i].kind===`heading`;)r+=t[i--];return r}function RS(e,t){let n=e=>(e?.textContent??``).replace(/\s+/g,` `).trim();for(let r=t-1;r>=0&&e[r].kind!==`opener`;r--){let t=e[r].el;if(/^H[2-6]$/.test(t.tagName)&&n(t))return n(t)}return n(e[t].el.querySelector(`h2, h3, h4, h5, h6`))}var zS=16;function BS(e,t,n){let r=[],i=[];return e.forEach((a,o)=>{let s=t[o],c=LS(e,t,o),l=a.kind!==`opener`&&c+s>n*1.1111111111111112?AS(a.el,s,n-c-zS,n-zS,RS(e,o)):null;l?l.els.forEach((e,t)=>{r.push({el:e,origin:a.el,...t===0&&a.kind&&{kind:a.kind},...t>0&&{continued:!0},...a.figure&&{figure:!0},...a.table&&{table:!0}}),i.push(l.heights[t])}):(r.push(a),i.push(s))}),{blocks:r,heights:i}}function VS(e){return e.length===0?[[]]:Rx(e,10,10,3)}function HS(e,t,n){let r=n-t;return e.map(e=>r>0?Math.max(1,Math.round((e-t)/r)+1):1)}var US=e=>`print-page-${e}`;function WS(e){let t=e.split(`/`).pop()??``,n=/^(?:\d+(?:\.\d+)?[-_.])?(.+?)\.(?:md|markdown)$/.exec(t);return n?`doc/${n[1]}`:null}function GS(e,t){try{return new URL(e,t).origin===t}catch{return!1}}function KS(e,t,n){let r;try{r=new URL(e,t)}catch{return null}if(r.origin!==t)return null;let i=decodeURIComponent(r.hash.slice(1)),a=WS(r.pathname);return a===null?null:i&&(n.headingPage.get(`${a}#section-${i}`)??n.headingPage.get(`${a}#${i}`))||n.chapterPage.get(a)||null}function qS(e,t,n){let r=0;for(let i of e.querySelectorAll(`a[href]`)){let e=i.getAttribute(`href`)??``,a=KS(e,t,n);if(a===null)GS(e,t)&&i.removeAttribute(`href`);else{if(i.setAttribute(`href`,`#${US(a)}`),!i.querySelector(`[data-print-page-ref]`)){let e=i.ownerDocument.createElement(`span`);e.dataset.printPageRef=``,e.textContent=`, p. ${a}`,i.append(e)}r++}}return r}var JS=15e3;async function YS(e){let t=[...e.querySelectorAll(`img`)];for(let e of t)e.loading=`eager`;let n=Promise.all([document.fonts?.ready,...t.map(e=>e.decode?.().catch(()=>void 0))]);await Promise.race([n,new Promise(e=>setTimeout(e,JS))])}function XS({data:e,view:t,mode:n,selection:r,title:i,subtitle:a,favicons:o,layout:s=`compact`}){let{squeezeFloor:c}=dS(s),l=i??e.title,u=a??e.description,d=tS(r,e,t,n,o),f=d.map(e=>e.title),p=f.join(`
|
|
74
|
+
`),[m,h]=(0,_.useState)(),g=VS(m?.key===p?m.lines:f.map(()=>1)),v=sS(g.length),y=(0,_.useRef)(null),b=(0,_.useRef)(null),x=(0,_.useRef)(null),[S,C]=(0,_.useState)([]);(0,_.useEffect)(()=>{let e=!1;return YS(y.current).then(()=>{if(e||!y.current)return;let[t,n,...r]=[...y.current.children].map(e=>e.getBoundingClientRect().height);h({key:p,lines:HS(r,t,n)})}),()=>{e=!0}},[p]),(0,_.useEffect)(()=>{let e=!1;if(Reflect.deleteProperty(window,`__blazonPrint`),o!==void 0&&m?.key===p)return YS(b.current).then(async()=>{if(e||!b.current||!x.current)return;let t=[],n=[],r=new Map,i=new Map;for(let e of b.current.querySelectorAll(`[data-print-chapter]`)){let a=Yx(e),{blocks:o,heights:s}=BS(a,Xx(a,e),aS),u=o.map((e,t)=>({height:s[t],...e.kind&&{kind:e.kind},...e.figure&&{figure:!0},...e.table&&{table:!0},...e.lead&&{lead:!0},...e.continued&&{continued:!0},...e.figure&&vS(e.el,c)>0&&{slack:vS(e.el,c)}})),d=Kx(Ux(u,aS),u,aS);t.push(v+n.length),i.set(e.dataset.printChapter,v+n.length);for(let t of e.querySelectorAll(`section[id]`)){let i=o.findIndex(e=>t.contains(e.origin??e.el)),a=d.findIndex(e=>e.blocks.includes(i));i>=0&&a>=0&&r.set(`${e.dataset.printChapter}#${t.id}`,v+n.length+a)}for(let e of d){let t=o[e.blocks[0]].kind===`opener`?`opener`:`content`,r=mS(t,e.blocks.map(e=>o[e].el),e.layout,e.squeeze);t===`content`&&r.append(gS(l,v+n.length)),n.push(r)}}n.forEach((e,t)=>void(e.id=US(v+t)));for(let e of n)qS(e,window.location.origin,{chapterPage:i,headingPage:r});x.current.replaceChildren(...n),await YS(x.current),e||(n.forEach(e=>CS(e,c)),C(t),window.__blazonPrint={ready:!0,pages:v-1+n.length,layout:s,clipped:n.flatMap((e,t)=>e.dataset.printClipped===void 0?[]:[v+t])})}),()=>{e=!0}},[r,o,l,v,m,p,s,c]);let w=Ee(e.theme.inverse,e.theme.inverseText)?`dark`:`light`,T=Te(e,e.theme.inverse,w===`dark`);return(0,Z.jsxs)(`main`,{"data-print-book":``,className:`bg-background text-foreground`,children:[(0,Z.jsx)(`style`,{children:fS(s)}),(0,Z.jsxs)(`div`,{"data-print-slide":`cover`,className:`flex flex-col justify-end gap-6 bg-[var(--blazon-inverse)] p-20 text-[var(--blazon-inverse-text)]`,children:[T&&(0,Z.jsx)(`img`,{"data-print-cover-logo":``,className:`mb-auto h-12 w-auto self-start`,src:T,alt:``}),(0,Z.jsx)(`h1`,{className:`font-heading text-[96px] leading-[0.95] font-semibold tracking-[-0.035em]`,children:l}),u&&(0,Z.jsx)(`p`,{className:`max-w-3xl text-xl opacity-80`,children:u})]}),g.map((e,t)=>(0,Z.jsxs)(`div`,{"data-print-slide":`contents`,"data-print-contents":``,children:[(0,Z.jsx)(`h2`,{className:`mb-8`,children:t===0?`Contents`:`Contents (continued)`}),(0,Z.jsx)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(3, minmax(0, 1fr))`,columnGap:48},children:e.map(([e,t])=>(0,Z.jsx)(`ol`,{className:`flex flex-col gap-y-2`,children:d.slice(e,t).map((t,n)=>(0,Z.jsxs)(`li`,{"data-chapter":t.id,className:`flex items-start justify-between gap-6 border-b py-1 text-lg`,children:[(0,Z.jsx)(`span`,{"data-title":``,className:`min-w-0 [overflow-wrap:anywhere]`,children:t.title}),S[e+n]!==void 0&&(0,Z.jsx)(`span`,{"data-page":``,className:`flex-none whitespace-nowrap`,children:S[e+n]})]},t.id))},e))}),(0,Z.jsxs)(`div`,{"data-print-footer":``,children:[(0,Z.jsx)(`span`,{children:l}),(0,Z.jsx)(`span`,{children:2+t})]})]},t)),(0,Z.jsx)(`ol`,{ref:y,"aria-hidden":`true`,"data-print-probe":``,className:`flex flex-col`,style:{position:`absolute`,left:-1e5,top:0,width:oS},children:[`M`,`M
|
|
75
|
+
M`,...f].map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex items-start justify-between gap-6 border-b py-1 text-lg`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 whitespace-pre-line [overflow-wrap:anywhere]`,children:e}),(0,Z.jsx)(`span`,{className:`flex-none whitespace-nowrap`,children:`9999`})]},t))}),(0,Z.jsx)(`div`,{ref:x,"data-print-deck":``}),(0,Z.jsx)(`div`,{ref:b,"data-print-flow":``,"aria-hidden":`true`,children:d.map(e=>(0,Z.jsxs)(`section`,{"data-print-chapter":e.id,children:[(0,Z.jsx)(`h2`,{"data-print-chapter-title":``,className:`sr-only`,children:e.title}),e.body()]},e.id))})]})}function ZS(e){let[t=``,n=``]=QS(e,`?`),r={selection:t.slice(7)};for(let e of n.split(`&`)){let[t=``,n=``]=QS(e,`=`);if(t===`title`||t===`subtitle`||t===`layout`)try{let e=decodeURIComponent(n);t===`layout`?r.layout=uS(e):e!==``&&(r[t]=e)}catch{}}return r}function QS(e,t){let n=e.indexOf(t);return n<0?[e]:[e.slice(0,n),e.slice(n+1)]}function $S(){let[e,t]=(0,_.useState)(()=>window.location.hash);return(0,_.useEffect)(()=>{let e=()=>t(window.location.hash);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function eC({data:e,view:t,hash:n,query:r,mode:i,favicons:a}){if(r)return(0,Z.jsx)(iy,{data:t,query:r});if(n.startsWith(`#doc/`)){let r=e.docs.find(e=>e.slug===n.slice(5));if(r)return(0,Z.jsx)(Jv,{data:t,doc:r,mode:i})}let o=Fy[n];if(o)return(0,Z.jsx)(o,{data:t});if(n===`#review`)return(0,Z.jsx)(Hy,{data:e});if(n===`#favicons`&&a!==null)return a?(0,Z.jsx)(Nx,{data:e,favicons:a}):null;if(n.startsWith(`#assets/`)){let t=ye(e).find(e=>`#assets/${e.category}`===n);if(t)return(0,Z.jsx)(Dx,{data:e,assets:t.assets,title:t.label,description:t.description,rules:t.rules,kind:be(t)})}return(0,Z.jsx)(Px,{})}function tC(e,t,n,r){if(n)return{section:`Search`,page:n};if(t.startsWith(`#doc/`)){let n=e.docs.find(e=>e.slug===t.slice(5));if(n)return{section:_e(n),page:n.title}}if(t===`#tokens/all`)return{section:`Tokens`,page:`All tokens`};let i=he.find(e=>e.hash===t);if(i)return{section:`Tokens`,page:i.label};if(t===`#review`)return{section:`Quality`,page:`Review`};if(t===`#favicons`&&r!==null)return{section:`Assets`,page:`Favicons`};let a=ye(e).find(e=>`#assets/${e.category}`===t);return a?{section:`Assets`,page:a.label}:{section:e.title,page:`Not found`}}var nC=()=>void 0;function rC(){let{toggleSidebar:e}=Cm();return(0,Z.jsx)(Tu,{variant:`ghost`,size:`icon`,"aria-label":`Menu`,className:`-ml-1 lg:hidden`,onClick:e,children:(0,Z.jsx)(td,{})})}function iC(){let e=b(),t=$S(),[n,r]=ze(),[i,a]=(0,_.useState)({text:``,hash:t});i.hash!==t&&a({text:``,hash:t});let o=i.text,s=e=>a({text:e,hash:t}),[c,l]=zd(e),u=Pd(),d=(0,_.useMemo)(()=>Ud(e,Vd(e,c,n)),[e,c,n]),f=(0,_.useRef)(null),p=(0,_.useRef)(e),[m,h]=t.split(`?`),g=m||ge(e),v=new URLSearchParams(h??``).get(`token`);if((0,_.useEffect)(()=>Ie(d),[d]),(0,_.useEffect)(()=>{document.documentElement.toggleAttribute(`data-mode-themed`,Bd(e)!==void 0)},[e]),(0,_.useEffect)(()=>{e!==p.current&&Ad(`Updated`)},[e]),(0,_.useEffect)(()=>{window.scrollTo?.(0,0)},[t]),(0,_.useEffect)(()=>{if(!v)return;let e=[...document.querySelectorAll(`[data-token="${CSS.escape(v)}"]`)],t=e.find(e=>e.getClientRects().length>0)??e[0];t&&(t.scrollIntoView?.({block:`center`}),t.classList.remove(`blazon-flash`),t.offsetWidth,t.classList.add(`blazon-flash`))},[v,g]),g===`#print`||g.startsWith(`#print/`))return(0,Z.jsx)(XS,{data:e,view:d,mode:n,...ZS(t),favicons:u});let y=o.trim().toLowerCase(),x=tC(e,g,y,u);return(0,Z.jsx)(Od,{children:(0,Z.jsx)(fm,{children:(0,Z.jsxs)(wm,{open:!0,onOpenChange:nC,className:`flex-col`,children:[(0,Z.jsxs)(`header`,{className:`sticky top-0 z-20 flex h-14 shrink-0 items-center gap-2 border-b bg-background/95 px-4 backdrop-blur`,children:[(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 lg:w-[calc(var(--sidebar-width)-1rem)]`,children:[(0,Z.jsx)(rC,{}),(0,Z.jsx)(Hm,{data:e,mode:n})]}),(0,Z.jsx)(Kh,{className:`hidden min-w-0 md:flex`,children:(0,Z.jsxs)(qh,{children:[(0,Z.jsx)(Jh,{children:x.section}),(0,Z.jsx)(Xh,{}),(0,Z.jsx)(Jh,{className:`min-w-0`,children:(0,Z.jsx)(Yh,{className:`truncate`,children:x.page})})]})}),(0,Z.jsxs)(`div`,{className:`ml-auto flex min-w-0 items-center gap-2`,children:[(0,Z.jsxs)(`label`,{className:`relative min-w-0`,children:[(0,Z.jsx)(ld,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,Z.jsx)(Wf,{type:`search`,placeholder:`Search tokens and pages`,"aria-label":`Search`,value:o,onChange:e=>s(e.target.value),className:`h-8 w-[clamp(140px,28vw,320px)] pl-8`})]}),(0,Z.jsx)(Kd,{data:e,selected:c,onSelect:l,exclude:Bd(e),className:`hidden md:flex`}),(0,Z.jsx)(Gh,{}),(0,Z.jsx)(Tu,{variant:`ghost`,size:`icon`,"aria-label":n===`dark`?`Light mode`:`Dark mode`,onClick:()=>r(n===`dark`?`light`:`dark`),children:n===`dark`?(0,Z.jsx)(dd,{}):(0,Z.jsx)(rd,{})})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-1`,children:[(0,Z.jsx)(Um,{data:e,hash:g,mode:n,favicons:u,contexts:c,onSelectContext:l,className:`lg:top-14 lg:h-[calc(100svh-3.5rem)]`}),(0,Z.jsx)(Dm,{ref:f,lang:Hd(e,`locale`,c),className:`min-w-0`,children:(0,Z.jsx)(eC,{data:e,view:d,hash:g,query:y,mode:n,favicons:u})})]})]})})})}(0,v.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(_.StrictMode,{children:(0,Z.jsx)(iC,{})}));
|