@getv.design/embed 0.5.1 → 0.5.2
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 +3 -3
- package/THIRD_PARTY_NOTICES.txt +1 -1
- package/dist/auto.js +2 -2
- package/dist/chunks/{chunk-OMFQR6TE.js → chunk-FMTYD7LD.js} +1 -1
- package/dist/chunks/{chunk-EFCLQF2H.js → chunk-NAQCHPKZ.js} +2 -2
- package/dist/chunks/{chunk-OQXGXTNC.js → chunk-ODPS4XJH.js} +2 -2
- package/dist/chunks/chunk-OE3F27L6.js +2 -0
- package/dist/chunks/{chunk-7K6NORUY.js → chunk-OM66E7BL.js} +1 -1
- package/dist/chunks/{chunk-VL77CJOG.js → chunk-OQJPNBNN.js} +2 -2
- package/dist/chunks/fonts.js +2 -2
- package/dist/cli.js +2 -2
- package/dist/edit.js +12 -12
- package/dist/index.js +2 -2
- package/dist/markdown-it.js +2 -2
- package/dist/markdown.js +2 -2
- package/dist/marked.js +2 -2
- package/dist/rehype.js +2 -2
- package/dist/static.js +2 -2
- package/dist/view.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/chunk-OK6J2L2H.js +0 -2
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ rebundling), so the editor and the font code still load only when needed:
|
|
|
36
36
|
```html
|
|
37
37
|
<div id="design"></div>
|
|
38
38
|
<script type="module">
|
|
39
|
-
import { view } from 'https://cdn.jsdelivr.net/npm/@getv.design/embed@0.5.
|
|
39
|
+
import { view } from 'https://cdn.jsdelivr.net/npm/@getv.design/embed@0.5.2/dist/view.js';
|
|
40
40
|
|
|
41
41
|
const text = await (await fetch('/designs/home.vd')).text();
|
|
42
42
|
await view(document.querySelector('#design'), text);
|
|
@@ -230,7 +230,7 @@ has no `problems` or `fonts` event yet to say so.
|
|
|
230
230
|
### Where the faces come from
|
|
231
231
|
|
|
232
232
|
The faces come from `fontBase`, by default this package's `fonts/` folder on
|
|
233
|
-
jsDelivr (`https://cdn.jsdelivr.net/npm/@getv.design/embed@0.5.
|
|
233
|
+
jsDelivr (`https://cdn.jsdelivr.net/npm/@getv.design/embed@0.5.2/fonts/`). That means
|
|
234
234
|
your readers' browsers request the faces from jsDelivr, and a content security
|
|
235
235
|
policy needs it in `connect-src`. To keep those requests on your own origin,
|
|
236
236
|
copy `node_modules/@getv.design/embed/fonts/` to your site and point `fontBase` at it:
|
|
@@ -259,7 +259,7 @@ The embed's styles reach the page by one of two routes.
|
|
|
259
259
|
```
|
|
260
260
|
|
|
261
261
|
Link them before the embed runs, from your own origin or from the CDN
|
|
262
|
-
(`https://cdn.jsdelivr.net/npm/@getv.design/embed@0.5.
|
|
262
|
+
(`https://cdn.jsdelivr.net/npm/@getv.design/embed@0.5.2/view.css`). The id is what
|
|
263
263
|
the embed looks for: linked without it, the stylesheet still works, but
|
|
264
264
|
the embed inserts its `<style>` as well.
|
|
265
265
|
|
package/THIRD_PARTY_NOTICES.txt
CHANGED
package/dist/auto.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @getv.design/embed v0.5.
|
|
2
|
-
import"./chunks/chunk-
|
|
1
|
+
/*! @getv.design/embed v0.5.2. Free to use under the vDesign Embed Licence. © 2026 vDesign. https://getv.design/docs/licence/ */
|
|
2
|
+
import"./chunks/chunk-OM66E7BL.js";var f="data-vd-live";async function L(n=document,s={}){let e=[...n.querySelectorAll('figure.vd-figure[data-vd-mode="view"]')].filter(t=>!t.hasAttribute(f)&&t.dataset.vdSource);if(e.length===0)return[];for(let t of e)t.setAttribute(f,"opening");let{view:r}=await import("./view.js");return(await Promise.all(e.map(t=>w(t,r,s)))).filter(t=>t!==void 0)}async function w(n,s,e){let r;try{let d=atob(n.dataset.vdSource??"");r=new TextDecoder().decode(Uint8Array.from(d,u=>u.charCodeAt(0)))}catch{n.removeAttribute(f);return}let i=n.querySelector(".vd-figure-art"),t=n.ownerDocument.createElement("div");t.className="vd-figure-live",t.style.height=`${x(n,i)}px`,i?.after(t);let o=n.dataset.vdPage;try{let d=await s(t,r,{fit:"page",...o===void 0?{}:{page:/^\d+$/.test(o)?Number(o):o},...e.fonts?{fonts:e.fonts}:{},...e.fontBase?{fontBase:e.fontBase}:{},...e.surface?{surface:e.surface}:{},...e.onLink?{onLink:e.onLink}:{}});return i?.setAttribute("hidden",""),n.setAttribute(f,"true"),d.pages().length>1&&H(n,t,d,o),d}catch{t.remove(),n.removeAttribute(f);return}}function H(n,s,e,r){let i=(a,v,y)=>{let b=n.ownerDocument.createElement(a);return b.className=v,b.textContent=y,b},t=i("div","vd-figure-pager",""),o=i("button","vd-figure-pager__button","\u2039"),d=i("span","vd-figure-pager__label",""),u=i("button","vd-figure-pager__button","\u203A"),m=i("button","vd-figure-pager__button","Present");o.setAttribute("aria-label","Previous page"),u.setAttribute("aria-label","Next page"),d.setAttribute("aria-live","polite");for(let a of[o,u,m])a.setAttribute("type","button");t.append(o,d,u,m),s.after(t);let c=e.pages(),g=r===void 0?-1:/^\d+$/.test(r)?Number(r):c.findIndex(a=>a.id===r),l=g>=0&&g<c.length?g:0,p=()=>{let a=c[l];d.textContent=`${a?.name??a?.id??""} \xB7 ${l+1} of ${c.length}`},h=a=>{l=Math.min(c.length-1,Math.max(0,l+a)),e.goTo(l),p()};e.on("page",a=>{l=Math.max(0,c.findIndex(v=>v.id===a.id)),p()}),o.addEventListener("click",()=>h(-1)),u.addEventListener("click",()=>h(1)),m.addEventListener("click",()=>{e.play()}),p()}function x(n,s){let e=Number(n.dataset.vdHeight);if(Number.isFinite(e)&&e>0)return e;let r=s?.getBoundingClientRect().height??0;return r>0?Math.max(240,Math.round(r)):420}export{L as hydrate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @getv.design/embed v0.5.
|
|
1
|
+
/*! @getv.design/embed v0.5.2. Free to use under the vDesign Embed Licence. © 2026 vDesign. https://getv.design/docs/licence/ */
|
|
2
2
|
var Fe=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],we=["left","center","right","justify"],$e=["top","middle","bottom"],ve=["cover","contain","fill"],Be=["nonzero","evenodd"],Ue=["butt","round","square"],We=["miter","round","bevel"],Wt=["canvas","frame","group","instance"];function ze(e){return Wt.includes(e)}function P(e){return ze(e.type)}function ke(e){return e.type==="group"}function V(e){return P(e)?e.children:[]}var zt={canvas:["w","h"],ellipse:["x","y","w","h","rotation","strokeWidth","opacity"],frame:["x","y","w","h"],group:[],instance:["x","y","w","h"],image:["x","y","w","h","rotation","radius","opacity"],rect:["x","y","w","h","rotation","strokeWidth","radius","opacity"],text:["x","y","w","h","rotation","size","weight","lineHeight","letterSpacing","opacity"],vector:["x","y","w","h","rotation","strokeWidth","opacity"]};function Xe(e){return zt[e.type]}function R(e,n,t){if(n(e,t)!==!1&&P(e))for(let r of e.children)R(r,n,e)}function W(e,n){let t;return R(e,r=>{if(t)return!1;r.id===n&&(t=r)}),t}function Y(e){let n=e.trim();if(n.startsWith("#")){let r=n.slice(1);return r===""?void 0:{kind:"frame",id:r}}let t;try{t=new URL(n)}catch{return}if(!(t.protocol!=="https:"&&t.protocol!=="mailto:"))return{kind:"url",url:n}}var ue="--- payload base64 ---",Qr="sha256-";function Xt(e){let n=oo(e);return n===-1?{head:e,payload:""}:{head:e.slice(0,n),payload:e.slice(n+ue.length)}}function eo(e){let{head:n,payload:t}=Xt(e);return{head:n,blocks:Jt(t)}}function Jt(e){let n=new Map;for(let t of e.split(`
|
|
3
3
|
`)){let r=t.indexOf(" ");if(r===-1)continue;let o=t.slice(0,r);o.startsWith(Qr)&&n.set(o,t.slice(r+1).trim())}return n}function no(e,n){return`data:${e};base64,${n}`}function to(e){let n=e.toBase64;if(typeof n=="function")return n.call(e);let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function ro(e){let n=Uint8Array.fromBase64;if(typeof n=="function")return n(e);let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o+=1)r[o]=t.charCodeAt(o);return r}function oo(e){if(e.startsWith(ue))return 0;let n=e.indexOf(`
|
|
4
4
|
${ue}`);return n===-1?-1:n+1}function q(e){return{expr:e}}function B(e){return typeof e=="object"&&e!==null&&typeof e.expr=="string"}var Fn=["light","dark"],Bn=["must","should"],Je=["no-gradient","contrast","font-only","logo-min"];var Gt=["role","logo","rule","guide","review"];function Ge(e){return Gt.includes(e)}function He(e="",n=1){return{slug:e,version:n,changes:[],sources:[],roles:{},logos:{},rules:{},guides:{},review:[]}}function Un(e){let n=/^([a-z0-9][a-z0-9-]*)(?:@(\d+))?$/.exec(e);if(!n)return;let t=n[2]===void 0?1:Number(n[2]);if(!(!Number.isSafeInteger(t)||t<1))return{slug:n[1],version:t}}var io=8,so=new Set(["type","id","children","component","overrides"]);function ae(e){return!so.has(e)}function Ye(e,n){return`${e}.${n}`}function ce(e){let n=new Map,t=r=>{if(r.type!=="instance"){r.type==="frame"&&r.component===!0&&n.set(r.id,r);for(let o of V(r))t(o)}};return t(e),n}function Ke(e,n){let t=[],r=o=>{if(o.type==="instance"){(n===void 0||o.component===n)&&t.push(o);return}for(let i of V(o))r(i)};return r(e),t}function Z(e){let n=e;for(let t=0;t<io;t+=1){let r=ce(n),o=Ht(n,r);if(o===n)return n;n=o}return n}var Wn=new WeakMap;function Ht(e,n){if(e.type==="instance"){let o=n.get(e.component)??null;if(Wn.has(e)&&Wn.get(e)===o)return e;let i=Kt(e,n,new Set),s=Jn(i,e.children)?e:{...e,children:i};return Wn.set(s,o),s}if(!P(e))return e;let t=!1,r=e.children.map(o=>{let i=Ht(o,n);return i!==o&&(t=!0),i});return t?{...e,children:r}:e}function Kt(e,n,t){let r=n.get(e.component);if(!r||t.has(r.id))return[];let o=new Set(t).add(r.id),i=r.children.map(s=>zn(s,e.id,n,o));return uo(i,e.id,e.overrides)}function zn(e,n,t,r){let o=Ye(n,e.id);if(e.type==="instance"){let i={...e,id:o};return{...i,children:Kt(i,t,r)}}if(e.type==="frame"){let i={...e};return delete i.component,{...i,id:o,children:e.children.map(s=>zn(s,n,t,r))}}return P(e)?{...e,id:o,children:e.children.map(i=>zn(i,n,t,r))}:{...e,id:o}}function uo(e,n,t){if(t===void 0)return[...e];let r=new Map;for(let[i,s]of Object.entries(t))r.set(Ye(n,i),s);let o=i=>{let s=r.get(i.id),u=i;if(s){let a={...i};for(let[c,d]of Object.entries(s))ae(c)&&(a[c]=d);u=a}return P(u)?{...u,children:u.children.map(o)}:u};return e.map(o)}function Gn(e){let n=[],t=ce(e);for(let i of Ke(e)){let s=t.get(i.component);if(!s){n.push({severity:"error",code:"missing-component",message:`${i.id} places ${i.component}, which is not a component \u2014 mark a frame with component, or point component= at one`,nodeId:i.id});continue}if(Xn(s,s.id,t,new Set)){n.push({severity:"error",code:"component-cycle",message:`${s.id} holds an instance of itself, so ${i.id} cannot be drawn`,nodeId:i.id});continue}for(let u of Object.keys(i.overrides??{}))W(i,Ye(i.id,u))||n.push({severity:"warning",code:"orphaned-override",message:`${i.id} overrides ${u}, which ${s.id} no longer has`,nodeId:i.id})}for(let[i]of t)e.type==="canvas"&&e.children.some(s=>s.id===i)||n.push({severity:"warning",code:"component-not-top-level",message:`${i} is a component inside another frame \u2014 keep components in the row below the pages, at the top level`,nodeId:i});let r=new Map,o=i=>{r.set(i.id,(r.get(i.id)??0)+1);for(let s of V(i))o(s)};o(e);for(let i of Ke(e))for(let s of i.children){let u=a=>{(r.get(a.id)??0)>1&&n.push({severity:"error",code:"duplicate-id",message:`${a.id} is both a node and a part of ${i.id} \u2014 rename one`,nodeId:a.id});for(let c of V(a))u(c)};u(s)}return n}function Xn(e,n,t,r){return V(e).some(o=>{if(o.type==="instance"){if(o.component===n)return!0;if(r.has(o.component))return!1;r.add(o.component);let i=t.get(o.component);return i!==void 0&&Xn(i,n,t,r)}return Xn(o,n,t,r)})}function qe(e){return ce(e).size>0||Ke(e).length>0}function Jn(e,n){if(e===n)return!0;if(typeof e!="object"||typeof n!="object"||e===null||n===null)return!1;if(Array.isArray(e)||Array.isArray(n))return Array.isArray(e)&&Array.isArray(n)&&e.length===n.length&&e.every((i,s)=>Jn(i,n[s]));let t=e,r=n,o=new Set([...Object.keys(t),...Object.keys(r)]);for(let i of o)if(!Jn(t[i],r[i]))return!1;return!0}var Ee=["design","brand"],de="design",Yt=new WeakMap;function F(e){let n=e.brand?.theme==="dark"?e.themes?.dark:void 0;if(n===void 0)return e.tokens;let t=Yt.get(e);if(t!==void 0)return t;let r={...e.tokens,...n};return Yt.set(e,r),r}var qt=4,Zt=5,Hn=6,Ze=[1,2,3,4,5,6],Qe=Hn;function H(e){return e.root!==void 0&&qe(e.root)?Hn:e.kind==="brand"||e.brand!==void 0||e.themes!==void 0||ao(e.fonts)?Zt:qt}function ao(e){return Object.values(e??{}).some(n=>(n.faces??[]).some(t=>t.asset!==void 0))}var Q="doc";function Se(e){return{type:"canvas",...e}}function en(e={}){let n=e.kind??de,t=fe(e.themes),r=Z(e.root??Se({id:Q,children:[]}));return{version:H({kind:n,root:r,...e.fonts===void 0?{}:{fonts:e.fonts},...e.brand===void 0?{}:{brand:e.brand},...t===void 0?{}:{themes:t}}),kind:n,...e.title===void 0?{}:{title:e.title},tokens:e.tokens??{},fonts:e.fonts??{},assets:e.assets??{},...e.motion===void 0||Object.keys(e.motion).length===0?{}:{motion:e.motion},...e.brand===void 0?{}:{brand:e.brand},...t===void 0?{}:{themes:t},root:r}}function fe(e){let n=e?.dark;return n===void 0||Object.keys(n).length===0?void 0:{dark:n}}var nn=["beat","bar"];var co=/^(\d+(?:\.\d+)?)(beats?|bars?)$/;function le(e){let n=co.exec(e);if(!n)return;let t=Number(n[1]);if(Number.isFinite(t))return{count:t,unit:n[2].startsWith("bar")?"bar":"beat"}}function pe(e,n){return`${String(Math.round(e*1e6)/1e6)}${n}${e===1?"":"s"}`}function he(e){return typeof e=="string"&&le(e)!==void 0}function ee(e){let n=e?.bpm;if(n===void 0)return;let t=e?.meter??4,r=6e4/n;return{bpm:n,meter:t,beat:r,bar:r*t}}function Oe(e,n,t){if(e===void 0)return t;if(typeof e=="number")return e;let r=le(e);return!r||!n?t:r.count*(r.unit==="bar"?n.bar:n.beat)}var Me=36e5;var tn=["cut","fade","push","slide"],rn=["cut","fade","rise","drop","pop","wipe","grow","count","draw"],me=["cut","fade","rise","drop","pop"],on=["pulse"],sn=["out","in","inout","linear","spring"],un=["word","letter"],ne=["left","right","top","bottom"],Qt=400,Te=1e4,an=18e4,te=7680;function ge(e){let n=e.trim();return n==="back"?{kind:"back"}:n==="next"?{kind:"next"}:Y(n)}function Ae(e){return e===void 0||e.enter===void 0&&e.duration===void 0&&e.scroll!==!0&&e.length===void 0&&e.w===void 0&&e.h===void 0&&e.bpm===void 0&&e.meter===void 0&&e.music===void 0&&e.lines.length===0}function cn(e){return e.camera===!0||e.enter!==void 0||e.exit!==void 0||e.emphasis!==void 0||e.go!==void 0}var lo=["camera","emphasis","from","by","stagger","hold","at","after","with","on","ease","pad"];function er(e){return e===void 0?!1:e.length!==void 0||e.w!==void 0||e.h!==void 0||e.bpm!==void 0||e.meter!==void 0||e.music!==void 0?!0:e.lines.some(n=>lo.some(t=>n[t]!==void 0)||n.enter!==void 0&&!me.includes(n.enter)||n.exit!==void 0&&!me.includes(n.exit))}function dn(e){let n=e.motion;if(!n)return[];let t=e.root.children.map(o=>o.id).filter(o=>o in n),r=Object.keys(n).filter(o=>!t.includes(o)).sort();return[...t,...r]}function fn(e){return new Set(e.root.children.filter(n=>n.type==="frame"&&n.component!==!0).map(n=>n.id))}function ln(e){let n=new Map;for(let t of e.root.children)t.type!=="frame"||t.component===!0||R(t,r=>{n.set(r.id,t.id)});return n}function po(e){let n=new Set;return R(e,t=>{n.add(t.id)}),n}function Ne(e,n){let t=e.motion;if(!t)return[];let r=[],o=fn(e),i=ln(e),s=po(e.root),u=(a,c)=>{let d=n?.(a,c);return d===void 0?"":`Line ${d}: `};for(let a of dn(e)){let c=t[a];if(!c)continue;if(!o.has(a)){r.push({severity:"warning",code:"motion-not-a-page",message:`${u(a)}motion ${a}: ${a} is not a page (a top-level frame), so none of it plays`,nodeId:a});continue}let d=new Set;for(let f of c.lines){let p=u(a,f.id);for(let k of["after","with"]){let l=f[k];l!==void 0&&!d.has(l)&&r.push({severity:"warning",code:"motion-anchor-missing",message:`${p}motion ${a}: ${k}=${l} names no line above, so it starts after the line above instead`,nodeId:f.id})}f.camera!==!0&&d.add(f.id);let m=s.has(f.id)?W(e.root,f.id):void 0;m&&r.push(...ho(f,m,p,a)),s.has(f.id)?i.get(f.id)!==a&&r.push({severity:"warning",code:"motion-wrong-page",message:`${p}motion ${a}: ${f.id} is not on ${a}, so Play skips it`,nodeId:f.id}):r.push({severity:"warning",code:"unknown-reference",message:`${p}motion ${a}: no node ${f.id}`,nodeId:f.id});let x=f.go===void 0?void 0:ge(f.go);x?.kind==="frame"&&!yo(e,x.id)&&r.push({severity:"warning",code:"unknown-reference",message:`${p}motion ${a}: go=#${x.id} names no frame`,nodeId:f.id})}}return r}function ho(e,n,t,r){let o=[],i=(u,a)=>{o.push({severity:"warning",code:u,message:`${t}motion ${r}: ${a}`,nodeId:n.id})};if(e.camera===!0)return o;let s=e.enter??e.exit;return s==="count"&&(n.type!=="text"||!/\d/.test(pn(n.content)))&&i("count-no-number",`${n.id} has no number to count, so it fades in instead`),s==="draw"&&!go(n)&&i("draw-no-stroke",`${n.id} has no stroked vector to draw, so it fades in instead`),e.by!==void 0&&n.type!=="text"?i("by-not-text",`by=${e.by} splits text, and ${n.id} is a ${n.type}`):e.by!==void 0&&n.type==="text"&&mo(n)&&i("by-rotated",`${n.id} is rotated, so by=${e.by} enters it whole`),e.stagger!==void 0&&e.by===void 0&&V(n).length===0&&i("stagger-no-children",`${n.id} has no children to stagger: split a text with by=word`),o}function mo(e){let n=e.rotation;return n!==void 0&&n!==0}function go(e){let n=!1;return R(e,t=>(t.type==="vector"&&t.stroke!==void 0&&(n=!0),n?!1:void 0)),n}function pn(e){return typeof e=="string"?e:e.map(n=>typeof n=="string"?n:n.text).join("")}function yo(e,n){let t=!1;return R(e.root,r=>{if(t)return!1;r.id===n&&(t=r.type==="frame")}),t}function y(e){if(!Number.isFinite(e))return"0";let n=Math.round(e*1e4)/1e4,t=Object.is(n,-0)?0:n;return Math.abs(t)>=1e21?t.toFixed(0):String(t)}var xo={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function Kn(e){let n=[],t,r=0,o=0,i=0,s=0,u,a,c=wo(e),d=()=>(t||(t={anchors:[{x:r,y:o}],closed:!1},n.push(t)),t.anchors[t.anchors.length-1]),f=(k,l)=>{d(),t?.anchors.push({x:k,y:l}),r=k,o=l},p=(k,l,O,M)=>{d().out=k,t?.anchors.push({x:O,y:M,in:l}),r=O,o=M},m="",x=!0;for(;c.more();){let k=c.command();if(k!==void 0)m=k,x=!0;else if(m===""||m.toUpperCase()==="Z")return{contours:hn(n),error:`Expected a command at ${c.at()}`};let l=m.toUpperCase(),O=m!==l,M=xo[l];if(M===void 0)return{contours:hn(n),error:`Unknown command ${m}`};if(l==="Z"){t&&(t.closed=!0),t=void 0,r=i,o=s,u=void 0,a=void 0,m="";continue}let T=l==="A"?c.arc():c.numbers(M);if(T===void 0)return{contours:hn(n),error:`${m} expects ${M} numbers at ${c.at()}`};let A=O?r:0,N=O?o:0,$=E=>T[E];switch(l){case"M":x&&(t={anchors:[{x:A+$(0),y:N+$(1)}],closed:!1},n.push(t),r=i=A+$(0),o=s=N+$(1),m=O?"l":"L"),u=a=void 0;break;case"L":f(A+$(0),N+$(1)),u=a=void 0;break;case"H":f(A+$(0),o),u=a=void 0;break;case"V":f(r,N+$(0)),u=a=void 0;break;case"C":{let E={x:A+$(2),y:N+$(3)};p({x:A+$(0),y:N+$(1)},E,A+$(4),N+$(5)),u=E,a=void 0;break}case"S":{let E=u?{x:2*r-u.x,y:2*o-u.y}:{x:r,y:o},h={x:A+$(0),y:N+$(1)};p(E,h,A+$(2),N+$(3)),u=h,a=void 0;break}case"Q":case"T":{let E=l==="Q"?{x:A+$(0),y:N+$(1)}:a?{x:2*r-a.x,y:2*o-a.y}:{x:r,y:o},h=l==="Q"?A+$(2):A+$(0),w=l==="Q"?N+$(3):N+$(1),b={x:r+2/3*(E.x-r),y:o+2/3*(E.y-o)},S={x:h+2/3*(E.x-h),y:w+2/3*(E.y-w)};p(b,S,h,w),a=E,u=void 0;break}case"A":{let E=A+$(5),h=N+$(6);for(let[w,b,S]of $o(r,o,$(0),$(1),$(2),$(3)!==0,$(4)!==0,E,h))p(w,b,S.x,S.y);(r!==E||o!==h)&&f(E,h),u=a=void 0;break}}x=!1}return{contours:hn(n)}}function hn(e){return e.map(n=>{let t=[...n.anchors];if(n.closed&&t.length>1){let r=t[0],o=t[t.length-1];Ie(r,o)&&(t.pop(),t[0]={...r,...o.in?{in:o.in}:{}})}return{anchors:t.map(bo),closed:n.closed}})}function bo(e){let n={x:e.x,y:e.y};return e.in&&!Ie(e.in,e)&&(n.in=e.in),e.out&&!Ie(e.out,e)&&(n.out=e.out),n}function Ie(e,n,t=1e-6){return Math.abs(e.x-n.x)<t&&Math.abs(e.y-n.y)<t}function wo(e){let n=0,t=()=>{for(;n<e.length&&/[\s,]/.test(e[n]);)n+=1},r=()=>{t();let i=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/.exec(e.slice(n));if(i)return n+=i[0].length,Number(i[0])},o=()=>{t();let i=e[n];if(!(i!=="0"&&i!=="1"))return n+=1,Number(i)};return{more(){return t(),n<e.length},command(){t();let i=e[n];if(/[a-zA-Z]/.test(i))return n+=1,i},numbers(i){let s=[];for(let u=0;u<i;u+=1){let a=r();if(a===void 0)return;s.push(a)}return s},arc(){let i=this.numbers(3),s=o(),u=o(),a=this.numbers(2);if(!(!i||s===void 0||u===void 0||!a))return[...i,s,u,...a]},at(){return n}}}function $o(e,n,t,r,o,i,s,u,a){let c=Math.abs(t),d=Math.abs(r);if(c===0||d===0||e===u&&n===a)return[];let f=o*Math.PI/180,p=Math.cos(f),m=Math.sin(f),x=(e-u)/2,k=(n-a)/2,l=p*x+m*k,O=-m*x+p*k,M=l*l/(c*c)+O*O/(d*d);M>1&&(c*=Math.sqrt(M),d*=Math.sqrt(M));let T=c*c*d*d-c*c*O*O-d*d*l*l,A=c*c*O*O+d*d*l*l,N=(i===s?-1:1)*Math.sqrt(Math.max(0,T/A)),$=N*c*O/d,E=-N*d*l/c,h=p*$-m*E+(e+u)/2,w=m*$+p*E+(n+a)/2,b=(_,K,ie,se)=>{let xe=_*ie+K*se,Ve=Math.hypot(_,K)*Math.hypot(ie,se),be=Math.acos(Math.min(1,Math.max(-1,xe/Ve)));return _*se-K*ie<0?-be:be},S=b(1,0,(l-$)/c,(O-E)/d),g=b((l-$)/c,(O-E)/d,(-l-$)/c,(-O-E)/d);!s&&g>0&&(g-=2*Math.PI),s&&g<0&&(g+=2*Math.PI);let v=Math.max(1,Math.ceil(Math.abs(g)/(Math.PI/2)-1e-9)),C=g/v,U=4/3*Math.tan(C/4),Ce=_=>({x:h+c*Math.cos(_)*p-d*Math.sin(_)*m,y:w+c*Math.cos(_)*m+d*Math.sin(_)*p}),Bt=_=>({x:-c*Math.sin(_)*p-d*Math.cos(_)*m,y:-c*Math.sin(_)*m+d*Math.cos(_)*p}),Ut=[];for(let _=0;_<v;_+=1){let K=S+_*C,ie=K+C,se=Ce(K),xe=_===v-1?{x:u,y:a}:Ce(ie),Ve=Bt(K),be=Bt(ie);Ut.push([{x:se.x+U*Ve.x,y:se.y+U*Ve.y},{x:xe.x-U*be.x,y:xe.y-U*be.y},xe])}return Ut}function Yn(e){let n=[],t=r=>`${y(r.x)} ${y(r.y)}`;for(let r of e){let{anchors:o}=r,i=o[0];if(!i)continue;n.push(`M${t(i)}`);let s=_e(r);for(let u=0;u<s;u+=1){let a=o[u],c=o[(u+1)%o.length],d=r.closed&&u===o.length-1;!a.out&&!c.in?d||n.push(`L${t(c)}`):n.push(`C${t(a.out??a)} ${t(c.in??c)} ${t(c)}`)}r.closed&&n.push("Z")}return n.join(" ")}function _e(e){let n=e.anchors.length;return n<2?0:e.closed?n:n-1}function mn(e,n){let t=e.anchors[n],r=e.anchors[(n+1)%e.anchors.length];return[{x:t.x,y:t.y},t.out??{x:t.x,y:t.y},r.in??{x:r.x,y:r.y},{x:r.x,y:r.y}]}function qn(e,n){let[t,r,o,i]=e,s=1-n,u=s*s*s,a=3*s*s*n,c=3*s*n*n,d=n*n*n;return{x:u*t.x+a*r.x+c*o.x+d*i.x,y:u*t.y+a*r.y+c*o.y+d*i.y}}function Zn(e,n){return e.map(t=>({closed:t.closed,anchors:t.anchors.map(r=>{let o=n(r);return{x:o.x,y:o.y,...r.in?{in:n(r.in)}:{},...r.out?{out:n(r.out)}:{}}})}))}function Qn(e){let n=1/0,t=1/0,r=-1/0,o=-1/0,i=s=>{n=Math.min(n,s.x),t=Math.min(t,s.y),r=Math.max(r,s.x),o=Math.max(o,s.y)};for(let s of e){for(let a of s.anchors)i(a);let u=_e(s);for(let a=0;a<u;a+=1){let c=mn(s,a);for(let d of vo(c))i(qn(c,d))}}if(n!==1/0)return{x:n,y:t,w:r-n,h:o-t}}function vo(e){let[n,t,r,o]=e,i=[];for(let s of["x","y"]){let u=-n[s]+3*t[s]-3*r[s]+o[s],a=2*(n[s]-2*t[s]+r[s]),c=t[s]-n[s];if(Math.abs(u)<1e-12){Math.abs(a)>1e-12&&i.push(-c/a);continue}let d=a*a-4*u*c;if(d<0)continue;let f=Math.sqrt(d);i.push((-a+f)/(2*u),(-a-f)/(2*u))}return i.filter(s=>s>0&&s<1)}function gn(e){if(e===void 0)return;let n=e.trim().split(/[\s,]+/).map(Number);if(n.length!==4||n.some(s=>!Number.isFinite(s)))return;let[t,r,o,i]=n;return{x:t,y:r,w:o,h:i}}function et(e,n,t){return gn(e)??{x:0,y:0,w:n,h:t}}function nt(e,n){let t=e.w===0?1:n.w/e.w,r=e.h===0?1:n.h/e.h;return o=>({x:n.x+(o.x-e.x)*t,y:n.y+(o.y-e.y)*r})}function tt(e,n=.5){let[t,r,o,i]=e;if(Ie(t,r)&&Ie(o,i))return[t,i];let u=Math.hypot(r.x-t.x,r.y-t.y)+Math.hypot(o.x-r.x,o.y-r.y)+Math.hypot(i.x-o.x,i.y-o.y),a=Math.min(256,Math.max(4,Math.ceil(Math.sqrt(u/n)))),c=[];for(let d=0;d<=a;d+=1)c.push(qn(e,d/a));return c}function yn(e){let n=0;for(let t of e)for(let r=0;r<_e(t);r+=1){let o=tt(mn(t,r),.25);for(let i=1;i<o.length;i+=1){let s=o[i-1],u=o[i];n+=Math.hypot(u.x-s.x,u.y-s.y)}}return n}function ko(e,n,t){let r=0,o=0;for(let i of e){let s=Eo(i);if(s.length!==0){if(t.reach>0){let u=i.closed?s.length:s.length-1;for(let a=0;a<u;a+=1){let c=s[a],d=s[(a+1)%s.length];if(So(n,c,d)<=t.reach)return!0}if(s.length===1&&Math.hypot(n.x-s[0].x,n.y-s[0].y)<=t.reach)return!0}if(t.fill)for(let u=0;u<s.length;u+=1){let a=s[u],c=s[(u+1)%s.length];a.y<=n.y!=c.y<=n.y&&a.x+(n.y-a.y)/(c.y-a.y)*(c.x-a.x)>n.x&&(o+=1,r+=c.y>a.y?1:-1)}}}return t.fill?t.rule==="evenodd"?o%2===1:r!==0:!1}function Eo(e){let n=e.anchors[0];if(!n)return[];let t=[{x:n.x,y:n.y}],r=_e(e);for(let o=0;o<r;o+=1)t.push(...tt(mn(e,o)).slice(1));return e.closed&&t.length>1&&t.pop(),t}function So(e,n,t){let r=t.x-n.x,o=t.y-n.y,i=r*r+o*o,s=i===0?0:Math.max(0,Math.min(1,((e.x-n.x)*r+(e.y-n.y)*o)/i));return Math.hypot(e.x-(n.x+s*r),e.y-(n.y+s*o))}var xn={canvas:[["name","string"],["w","numberValue"],["h","numberValue"],["background","stringValue"]],frame:[["name","string"],["x","numberValue"],["y","numberValue"],["w","numberValue"],["h","numberValue"],["background","stringValue"],["clip","boolean"],["skip","boolean"],["component","boolean"],["blend","blendMode"],["shadow","stringValue"],["hidden","boolean"],["locked","boolean"]],group:[["name","string"],["hidden","boolean"],["locked","boolean"]],instance:[["name","string"],["component","string"],["x","numberValue"],["y","numberValue"],["w","numberValue"],["h","numberValue"],["hidden","boolean"],["locked","boolean"]],ellipse:[["name","string"],["x","numberValue"],["y","numberValue"],["w","numberValue"],["h","numberValue"],["rotation","numberValue"],["fill","stringValue"],["stroke","stringValue"],["strokeWidth","numberValue"],["opacity","numberValue"],["blend","blendMode"],["shadow","stringValue"],["hidden","boolean"],["locked","boolean"]],vector:[["name","string"],["x","numberValue"],["y","numberValue"],["w","numberValue"],["h","numberValue"],["rotation","numberValue"],["view","string"],["d","string"],["fill","stringValue"],["stroke","stringValue"],["strokeWidth","numberValue"],["opacity","numberValue"],["rule","fillRule"],["cap","lineCap"],["join","lineJoin"],["blend","blendMode"],["shadow","stringValue"],["hidden","boolean"],["locked","boolean"]],rect:[["name","string"],["x","numberValue"],["y","numberValue"],["w","numberValue"],["h","numberValue"],["rotation","numberValue"],["fill","stringValue"],["stroke","stringValue"],["strokeWidth","numberValue"],["radius","numberValue"],["opacity","numberValue"],["blend","blendMode"],["shadow","stringValue"],["hidden","boolean"],["locked","boolean"]],image:[["name","string"],["x","numberValue"],["y","numberValue"],["w","numberValue"],["h","numberValue"],["rotation","numberValue"],["src","stringValue"],["fit","imageFit"],["radius","numberValue"],["opacity","numberValue"],["blend","blendMode"],["shadow","stringValue"],["hidden","boolean"],["locked","boolean"]],text:[["name","string"],["x","numberValue"],["y","numberValue"],["w","numberValue"],["h","numberValue"],["rotation","numberValue"],["font","stringValue"],["size","numberValue"],["weight","numberValue"],["lineHeight","numberValue"],["letterSpacing","numberValue"],["align","align"],["valign","valign"],["italic","boolean"],["fill","stringValue"],["opacity","numberValue"],["blend","blendMode"],["shadow","stringValue"],["hidden","boolean"],["locked","boolean"]]},bn=[["font","string"],["size","number"],["weight","number"],["italic","boolean"],["underline","boolean"],["strike","boolean"],["fill","string"],["letterSpacing","number"],["link","string"]];var wn=[["enter","pageEffect"],["duration","number"],["scroll","boolean"],["length","time"],["w","number"],["h","number"],["bpm","number"],["meter","number"]],Pe=[["enter","nodeEffect"],["exit","nodeEffect"],["emphasis","emphasisEffect"],["from","from"],["by","piece"],["stagger","time"],["duration","time"],["hold","time"],["delay","time"],["at","time"],["after","string"],["with","string"],["step","boolean"],["together","boolean"],["on","on"],["ease","ease"],["pad","number"],["go","string"]],$n=[["from","number"],["volume","number"],["fadein","time"],["fadeout","time"],["loop","boolean"]],rt=Object.keys(xn);function vn(e){return rt.includes(e)}function kn(e,n){return xn[e].find(([t])=>t===n)?.[1]}function ot(e){for(let n of rt){if(n==="canvas"||n==="instance")continue;let t=kn(n,e);if(t!==void 0)return t}}var it="override";function L(e,n){if(n==="boolean")return e===""||e==="true"?{value:!0}:e==="false"?{value:!1}:{error:`Expected true or false, got ${e}`};if(e.startsWith('"')){let r=z(e);return r===void 0?{error:`Malformed quoted string ${e}`}:rr(r,n,e)}if(Lo(e)){if(!Po(n))return{error:Ro(e,n)};let r=ur(e).trim();return r===""?{error:"Empty expression"}:{value:q(r)}}return n==="numberValue"&&ir.test(e)?{value:q(e)}:rr(e,n,e)}var ir=/^-?\d+(?:\.\d+)?%$/;function Po(e){return e==="numberValue"||e==="stringValue"}function Ro(e,n){return n==="number"?`Expected a plain number, not an expression, got ${e}`:n==="string"&&/^\$\w+$/.test(e)?`Expected a literal, got ${e} \u2014 name a token without the $: ${e.slice(1)}`:`Expected a literal, not an expression, got ${e} \u2014 quote it if you meant the text`}function sr(e,n){let t=/^(-?\d+(?:\.\d+)?)([A-Za-z]+)$/.exec(e);return t?/^(?:beats?|bars?)$/.test(t[2])?" \u2014 beats and bars count motion times on a page with bpm=; this is milliseconds":t[2]==="s"&&n==="number"?` \u2014 durations are milliseconds: ${Number(t[1])*1e3}`:/^(?:px|pt|deg|ms)$/.test(t[2])?` \u2014 drop the unit: ${t[1]}`:" \u2014 units are not supported: use a number, a percentage like (100%), or an expression":n==="number"?ir.test(e)?" \u2014 a percentage is not allowed here":"":/^-[$@(]/.test(e)?` \u2014 wrap an expression in parentheses: (${e})`:/^-?[A-Za-z_]\w*(?:\.\w+)+$/.test(e)?` \u2014 wrap an expression in parentheses: (${e})`:""}function rr(e,n,t){switch(n){case"numberValue":case"number":{let r=Number(e);return Number.isFinite(r)&&e.trim()!==""?{value:r}:{error:`Expected a number, got ${t}${sr(e,n)}`}}case"align":return we.includes(e)?{value:e}:{error:`Expected one of ${we.join(", ")}, got ${t}`};case"valign":return $e.includes(e)?{value:e}:{error:`Expected one of ${$e.join(", ")}, got ${t}`};case"fontStyle":return e==="normal"||e==="italic"?{value:e}:{error:`Expected normal or italic, got ${t}`};case"imageFit":return ve.includes(e)?{value:e}:{error:`Expected one of ${ve.join(", ")}, got ${t}`};case"fillRule":return J(Be,e,t);case"lineCap":return J(Ue,e,t);case"lineJoin":return J(We,e,t);case"blendMode":return J(Fe,e,t);case"pageEffect":return J(tn,e,t);case"nodeEffect":return J(rn,e,t);case"emphasisEffect":return J(on,e,t);case"ease":return J(sn,e,t);case"piece":return J(un,e,t);case"time":{let r=le(e);if(r)return{value:pe(r.count,r.unit)};let o=Number(e);return Number.isFinite(o)&&e.trim()!==""?{value:o}:{error:`Expected milliseconds or beats, got ${t}${Do(e)}`}}case"on":return nn.includes(e)?{value:e}:e==="downbeat"?{error:`Expected beat or bar, got ${t} \u2014 write on=bar: a bar starts on its downbeat`}:e==="beats"||e==="bars"?{error:`Expected beat or bar, got ${t} \u2014 write on=${e.slice(0,-1)}`}:{error:`Expected beat or bar, got ${t}`};case"from":{if(ne.includes(e))return{value:e};let r=Number(e);return Number.isFinite(r)&&e.trim()!==""?{value:r}:{error:`Expected a number or one of ${ne.join(", ")}, got ${t}`}}default:return{value:e}}}function Do(e){let n=/^(beat|bar|b)[:\s#]?(\d+(?:\.\d+)?)$/.exec(e);if(n){let r=n[1]==="bar"?"bar":"beat",o=Number(n[2]);return` \u2014 write ${pe(Math.max(0,o-1),r)} (counted from the start: ${r} ${o}'s ${r==="bar"?"downbeat":"start"})`}let t=/^(\d+(?:\.\d+)?)\s*(b|bt|beat|bars?|beats?)$/.exec(e);if(t){let r=t[2]?.startsWith("bar")?"bar":"beat";return` \u2014 write ${pe(Number(t[1]),r)} (counted from the start)`}return sr(e,"number")}function J(e,n,t){return e.includes(n)?{value:n}:{error:`Expected one of ${e.join(", ")}, got ${t}`}}function Lo(e){return/^[$@(]/.test(e)}function z(e){try{let n=JSON.parse(e);return typeof n=="string"?n:void 0}catch{return}}function ur(e){if(!e.startsWith("("))return e;let n=0;for(let t=0;t<e.length;t+=1){let r=e[t];if(r==="(")n+=1;else if(r===")"&&(n-=1,n===0))return t===e.length-1?e.slice(1,-1):e}return e}function ar(e){let n=[],t="",r=0,o=!1;for(let i=0;i<e.length;i+=1){let s=e[i];if(o){t+=s,s==="\\"?(t+=e[i+1]??"",i+=1):s==='"'&&(o=!1);continue}if(s==='"'){o=!0,t+=s;continue}if(s==="("?r+=1:s===")"&&(r=Math.max(0,r-1)),r===0&&/\s/.test(s)){t!==""&&n.push(t),t="";continue}t+=s}return t!==""&&n.push(t),n}function En(e,n,t){let r=t===void 0?void 0:D(t);if(r?.value===void 0||!or(e[n]??""))return;let o=n;for(;o<e.length&&or(e[o]??"");)o+=1;let i=[ur(r.value),...e.slice(n,o)].join(" ");return{end:o,message:`${r.key}: an expression with spaces needs parentheses \u2014 write ${r.key}=(${i})`}}function or(e){return!e.includes("=")&&/^(?:[-+*/]|-?\d+(?:\.\d+)?%?|[$@][\w.]*|[A-Za-z_]\w*(?:\.\w+)+|\(.*|.*\))$/.test(e)}function D(e){let n=e.indexOf("=");return n===-1?{key:e,value:void 0}:{key:e.slice(0,n),value:e.slice(n+1)}}function st(e,n){let t,r=0,o,i=[],s=[],u={},a={},c={},d={},f=[],p=!1,m=!1,x,k=(h,w,b)=>{n.push({severity:"warning",code:w,message:`Line ${h}: ${b}`})},l=(h,w,b)=>{e(h.number,"invalid-brand",`${w} ${b} is written twice \u2014 keep one`)},O=h=>{if(t){e(h.number,"invalid-brand",`A document has one brand line; the first is on line ${r}`);return}let w=h.words[1]===void 0?void 0:Un(h.words[1]);if(!w){e(h.number,"invalid-brand","Expected brand <slug>@<version>, e.g. brand ember@3 \u2014 a slug is lower case, digits and dashes");return}let b=h.words.slice(2).includes("strict"),S=G({...h,words:h.words.filter((v,C)=>C<2||v!=="strict")},2,["id","theme"],e),g=S.theme;g!==void 0&&!Fn.includes(g)&&e(h.number,"invalid-brand",`theme= is light or dark, got ${g}`),t={...w,...S.id===void 0?{}:{id:S.id},...g==="dark"||g==="light"?{theme:g}:{},...b?{strict:!0}:{}},r=h.number,x={kind:"brand"}},M=h=>{let w=h.words[0];if(w==="summary"){let b=Sn(h,1);b===void 0?e(h.number,"invalid-brand",'Expected summary "\u2026"'):o=b;return}if(w==="change"){let b=Number(h.words[1]),S=h.words[2]===void 0?void 0:lr(h.words[2]);if(!Number.isSafeInteger(b)||b<1||S===void 0){e(h.number,"invalid-brand",'Expected change <version> "<what changed>" at=<date>');return}let g=G(h,3,["at"],e);i.push({version:b,note:S,...g.at===void 0?{}:{at:g.at}});return}if(w==="source"){let b=h.words[1];if(b===void 0||b.includes("=")){e(h.number,"invalid-brand","Expected source <kind> key=value\u2026, e.g. source site url=\u2026");return}s.push({kind:b,props:G(h,2,void 0,e)});return}if(w==="rule"){N(h);return}if(w==="banned"){let b=Sn(h,1);if(b===void 0){e(h.number,"invalid-brand",'Expected banned "\u2026"');return}(d.voice??={entries:[]}).entries.push({kind:"banned",text:b});return}e(h.number,"invalid-brand",`"${w}" is not a line of the brand block \u2014 it holds summary, change and source, and in a design rule and banned`)},T=h=>{let w=h.words[1];if(w===void 0||w.includes("=")){e(h.number,"invalid-role","Expected role <name> light=<token or colour> dark=\u2026");return}let b=G(h,2,["light","dark"],e),S=b.light;if(S===void 0){e(h.number,"invalid-role",`role ${w} needs light=`);return}if(Object.prototype.hasOwnProperty.call(u,w))return l(h,"role",w);let g=b.dark;u[w]={light:cr(S),...g===void 0?{}:{dark:cr(g)}}},A=h=>{let w=h.words[1];if(w===void 0||w.includes("=")){e(h.number,"invalid-logo","Expected logo <id> asset=<name> min=<px> clear=<fraction>");return}let b=G(h,2,["asset","min","clear"],e),S=b.asset;if(S===void 0){e(h.number,"invalid-logo",`logo ${w} needs asset=`);return}let g={asset:S};for(let v of["min","clear"]){let C=b[v];if(C===void 0)continue;let U=Number(C);if(!Number.isFinite(U)||U<0){e(h.number,"invalid-logo",`logo ${w}: ${v} must be a number, got ${C}`);continue}g[v]=U}if(Object.prototype.hasOwnProperty.call(a,w))return l(h,"logo",w);a[w]=g},N=h=>{let w=h.words[1],b=h.words[2],S=h.words[3],g=S?.startsWith('"')===!0?z(S):void 0;if(w===void 0||w.includes("=")){e(h.number,"invalid-rule",'Expected rule <id> must|should "<what it asks>" check=\u2026');return}if(b===void 0||!Bn.includes(b)){e(h.number,"invalid-rule",`rule ${w}: the second word is must or should`);return}if(g===void 0){e(h.number,"invalid-rule",`rule ${w} needs its words, quoted: rule ${w} ${b} "\u2026"`);return}let{check:v,...C}=G(h,4,void 0,e);if(v!==void 0&&!Je.includes(v)&&k(h.number,"unknown-check",`rule ${w}: this build has no check "${v}", so it is kept as words only \u2014 the checks are ${Je.join(", ")}`),Object.prototype.hasOwnProperty.call(c,w))return l(h,"rule",w);c[w]={level:b,text:g,...v===void 0?{}:{check:v},...Object.keys(C).length===0?{}:{params:C}}},$=(h,w)=>{let b=h.words[0];if(b.startsWith('"')){let S=Sn(h,0);S===void 0?e(h.number,"invalid-guide",`Could not read ${h.text}`):w.push({kind:"line",text:S});return}if(b==="banned"||b==="avoid"){let S=Sn(h,1);S===void 0?e(h.number,"invalid-guide",`Expected ${b} "\u2026"`):w.push({kind:b,text:S});return}if(b==="rewrite"){let S=G(h,1,["from","to"],e),g=S.from,v=S.to;if(g===void 0||v===void 0){e(h.number,"invalid-guide",'Expected rewrite from="\u2026" to="\u2026"');return}w.push({kind:"rewrite",from:g,to:v});return}if(b==="ref"||b==="approved"||b==="rejected"){let S=G(h,1,["asset","note"],e),g=S.asset;if(g===void 0){e(h.number,"invalid-guide",`Expected ${b} asset=<name> note="\u2026"`);return}let v=S.note;w.push({kind:b,asset:g,...v===void 0?{}:{note:v}});return}e(h.number,"invalid-guide",`"${b}" is not a guide line \u2014 a guide holds quoted lines, banned, avoid, rewrite, ref, approved and rejected`)},E=h=>{let w=h.words[0];if(w.includes("=")||w.startsWith('"')){e(h.number,"invalid-review",'Expected <what>.<id> from=\u2026 note="\u2026", e.g. role.muted from=site');return}let b=G(h,1,["from","note"],e);f.push({target:w,...b.from===void 0?{}:{from:b.from},...b.note===void 0?{}:{note:b.note}})};return{take(h){if(h.indent>0)return x?(x.kind==="brand"?M(h):x.kind==="guide"?$(h,x.entries):E(h),!0):!1;x=void 0;let w=h.words[0];if(w!=="brand"&&!Ge(w))return!1;switch(m=!0,w){case"brand":O(h);break;case"role":T(h);break;case"logo":A(h);break;case"rule":N(h);break;case"guide":{let b=h.words[1];if(b===void 0||b.includes("=")||h.words.length>2){e(h.number,"invalid-guide","Expected guide <id> on its own line, e.g. guide voice"),x={kind:"guide",id:"",entries:[]};break}if(Object.prototype.hasOwnProperty.call(d,b)){l(h,"guide",b),x={kind:"guide",id:"",entries:[]};break}let S=[];d[b]={entries:S},x={kind:"guide",id:b,entries:S};break}case"review":h.words.length>1&&e(h.number,"invalid-review","review is a block: its items go on the lines under it"),p=!0,x={kind:"review"};break}return!0},finish(){if(!m)return{header:!1,review:!1};let h=t??He();return{brand:{slug:h.slug,version:h.version,...t?.id===void 0?{}:{id:t.id},...t?.theme===void 0?{}:{theme:t.theme},...t?.strict===!0?{strict:!0}:{},...o===void 0?{}:{summary:o},changes:i,sources:s,roles:u,logos:a,rules:c,guides:d,review:f},header:t!==void 0,review:p}}}}function G(e,n,t,r){let o={};for(let i of e.words.slice(n)){let{key:s,value:u}=D(i);if(u===void 0){r(e.number,"invalid-brand",`A stray word "${i}" \u2014 expected key=value`);continue}if(t!==void 0&&!t.includes(s)){r(e.number,"invalid-brand",`"${s}" is not allowed here; this line takes ${t.join(", ")}`);continue}o[s]=lr(u)}return o}function Sn(e,n){if(e.words.length!==n+1)return;let t=e.words[n];return t.startsWith('"')?z(t):void 0}function lr(e){return e.startsWith('"')?z(e)??e:e}function cr(e){return e.startsWith("$")?e.slice(1):e}var Co=new Set(["exit","delay","step","together","go","at","after","with"]),hr=["at","after","with","together","step"],Vo=new Set(["pad","duration","delay","ease","on",...hr]);function ut(e){if(e==="at"||e==="length")return an;if(e==="w"||e==="h")return te;if(e==="duration"||e==="delay"||e==="stagger"||e==="hold")return Te;if(e==="pad")return te}function at(e,n){let t=e.words[1];if(t===void 0||t.includes("=")){n(e.number,"invalid-motion","Expected motion <page>, e.g. motion intro enter=fade");return}let r={};for(let i of e.words.slice(2)){let{key:s,value:u}=D(i),a=wn.find(([d])=>d===s)?.[1];if(a===void 0){let d=Co.has(s)?` \u2014 ${s} goes on a node's line, under the header`:"";n(e.number,"invalid-motion",`motion ${t} has no "${s}"${d}`,t);continue}let c=L(u??"",a);"error"in c?n(e.number,"invalid-motion",`${s}: ${Jo(s,u)??c.error}`,t):s==="bpm"&&!zo(c.value)?n(e.number,"invalid-motion",`bpm: expected ${20} to ${300} beats a minute, got ${u??""}`,t):s==="meter"&&!Xo(c.value)?n(e.number,"invalid-motion",`meter: expected a whole number of beats in a bar, 1 to ${16}, got ${u??""}`,t):c.value!==!1&&(r[s]=c.value)}let o=ee({...r,lines:[]});for(let[i]of wn){let s=r[i];if(s===void 0||ut(i)===void 0)continue;let u=ft(i,s,o,t);u!==void 0&&(n(e.number,"invalid-motion",u,t),delete r[i])}return{page:t,number:e.number,head:r,lines:[],where:new Map,taken:new Map,numbers:[]}}function ct(e,n,t){if(n.words[0]==="music"&&!(n.words[1]??"").includes("=")){Bo(e,n,t);return}let r=n.words[0]==="camera"&&n.words[1]!==void 0&&!n.words[1].includes("="),o=r?n.words.slice(1):n.words,i=o[0];if(n.indent!==1){t(n.number,"invalid-motion","A motion line sits one level under its page");return}if(i.includes("=")){t(n.number,"invalid-motion",`Expected a node id first, got ${i}`);return}if(i===e.page&&!r){t(n.number,"invalid-motion",`${i} is the page: its transition goes on the header (motion ${i} enter=fade)`,i);return}let s=r?{id:i,camera:!0}:{id:i},u=!0;for(let d of o.slice(1)){let{key:f,value:p}=D(d),m=Pe.find(([l])=>l===f)?.[1];if(m===void 0){t(n.number,"invalid-motion",`A motion line has no "${f}"${Go(f)}`,i),u=!1;continue}if(r&&!Vo.has(f)){t(n.number,"invalid-motion",`A camera line moves the shot and says only pad=, duration=, delay=, ease= and when: not ${f}=`,i),u=!1;continue}let x=L(p??"",m),k="error"in x||ut(f)===void 0?void 0:ft(f,x.value,ee(mr(e)),e.page);"error"in x?(t(n.number,"invalid-motion",`${f}: ${x.error}`,i),u=!1):k!==void 0?(t(n.number,"invalid-motion",`${i}: ${k}`,i),u=!1):f==="on"&&e.head.bpm===void 0?(t(n.number,"invalid-motion",`${i}: on=${String(x.value)} needs a tempo \u2014 motion ${e.page} bpm=120`,i),u=!1):f==="go"&&ge(x.value)===void 0?(t(n.number,"invalid-motion",`go: expected #<page>, back, next, or an https: or mailto: link, got ${p??""}`,i),u=!1):x.value!==!1&&(s[f]=x.value)}s.enter!==void 0&&s.exit!==void 0&&(t(n.number,"invalid-motion",`${i} either enters or exits on one line \u2014 write a second line for the other`,i),u=!1),s.emphasis!==void 0&&(s.enter!==void 0||s.exit!==void 0)&&(t(n.number,"invalid-motion",`${i} either ${s.enter!==void 0?"enters":"exits"} or is stressed on one line \u2014 write a second line for emphasis=`,i),u=!1);let a=hr.filter(d=>s[d]!==void 0);if(s.step===!0&&s.together===!0?(t(n.number,"invalid-motion",`${i} waits for a step or starts together with the line above, not both`,i),u=!1):a.length>1?(t(n.number,"invalid-motion",`${i} says when it starts twice (${a.join(", ")}): keep one`,i),u=!1):s.on!==void 0&&(s.with!==void 0||s.together===!0)&&(t(n.number,"invalid-motion",`${i} starts with another line (${s.with===void 0?"together":"with="}), so on= could only pull it apart: keep one`,i),u=!1),u){let d=Ho(s);d!==void 0&&(t(n.number,"invalid-motion",`${i}: ${d}`,i),u=!1)}if(!u)return;let c=Wo(s);if(!cn(c)){t(n.number,"invalid-motion",`${i} says nothing: give it enter=, exit=, emphasis= or go=`,i);return}if(r){e.where.has(i)||e.where.set(i,n.number),e.lines.push(c),e.numbers.push(n.number);return}for(let d of["enter","exit","emphasis","go"]){if(c[d]===void 0)continue;let f=e.taken.get(`${i} ${d}`);if(f!==void 0){let p=d==="go"?"has a go=":d==="enter"?"enters":d==="exit"?"exits":"has an emphasis=";t(n.number,"invalid-motion",`${i} already ${p} on line ${f}`,i);return}}for(let d of["enter","exit","emphasis","go"])c[d]!==void 0&&e.taken.set(`${i} ${d}`,n.number);e.where.has(i)||e.where.set(i,n.number),e.lines.push(c),e.numbers.push(n.number)}function dt(e){let n={...e.head.enter===void 0?{}:{enter:e.head.enter},...e.head.duration===void 0?{}:{duration:e.head.duration},...e.head.scroll===!0?{scroll:!0}:{},...e.head.length===void 0?{}:{length:e.head.length},...e.head.w===void 0?{}:{w:e.head.w},...e.head.h===void 0?{}:{h:e.head.h},...e.head.bpm===void 0?{}:{bpm:e.head.bpm},...e.head.meter===void 0?{}:{meter:e.head.meter},...e.music===void 0?{}:{music:e.music},lines:e.lines};return Ae(n)?void 0:n}var Fo=new Set(["loop","step","together"]);function Bo(e,n,t){let r=n.words[1];if(n.indent!==1){t(n.number,"invalid-motion","A motion line sits one level under its page");return}if(r===void 0){t(n.number,"invalid-motion","Expected music <asset>, e.g. music bed fadeout=1500");return}if(Fo.has(r)){t(n.number,"invalid-motion",`music names its track first: music <asset> ${r}`);return}if(e.musicLine!==void 0){t(n.number,"invalid-motion",`motion ${e.page} already has music on line ${e.musicLine}: a page has one track`);return}let o={asset:r},i=ee(mr(e)),s=!0,u=c=>{t(n.number,"invalid-motion",`music ${r}: ${c}`),s=!1};for(let c of n.words.slice(2)){let{key:d,value:f}=D(c),p=$n.find(([x])=>x===d)?.[1];if(p===void 0){u(`the music line has no "${d}"${Uo(d)}`);continue}if(d==="from"&&f!==void 0&&/\d(?:beats?|bars?)$/.test(f)){u(`from= is where in the track to begin, in milliseconds, not ${f}`);continue}let m=L(f??"",p);if("error"in m){u(`${d}: ${m.error}`);continue}if(d==="from"&&!pr(m.value,0,Me)){u(`from: expected 0 to ${Me} milliseconds, got ${f??""}`);continue}if(d==="volume"&&!pr(m.value,0,1)){u(`volume: expected 0 to 1, got ${f??""}`);continue}if(d==="fadein"||d==="fadeout"){let x=ft(d,m.value,i,e.page);if(x!==void 0){u(x);continue}}m.value!==!1&&(o[d]=m.value)}if(!s)return;let a={asset:r};for(let[c]of $n)o[c]!==void 0&&(a[c]=o[c]);e.music=a,e.musicLine=n.number}function pr(e,n,t){return typeof e=="number"&&e>=n&&e<=t}function Uo(e){return e==="fade"?" \u2014 write fadein= and fadeout=":e==="fade-in"||e==="fadeIn"||e==="fade_in"?" \u2014 write fadein=":e==="fade-out"||e==="fadeOut"||e==="fade_out"?" \u2014 write fadeout=":e==="start"||e==="offset"||e==="seek"?" \u2014 write from= (where in the track to begin, in milliseconds)":e==="gain"||e==="level"?" \u2014 write volume= (0 to 1)":e==="at"||e==="delay"||e==="after"||e==="with"?": the music starts with the video; from= picks where in the track":": it takes from=, volume=, fadein=, fadeout= and loop"}function Wo(e){let n=e.camera===!0?{id:e.id,camera:!0}:{id:e.id};for(let[t]of Pe)e[t]!==void 0&&(n[t]=e[t]);return n}function mr(e){let{bpm:n,meter:t}=e.head;return{...n===void 0?{}:{bpm:n},...t===void 0?{}:{meter:t},lines:[]}}function ft(e,n,t,r){if(he(n)&&!t)return`${n} needs a tempo \u2014 motion ${r} bpm=120`;let o=typeof n=="number"||he(n)?Oe(n,t):void 0,i=ut(e)??Te;if(o!==void 0&&o>=(e==="w"||e==="h"?16:0)&&o<=i)return;let u=String(n),a=he(n)&&o!==void 0?` (${Math.round(o)} ms)`:"";return e==="w"||e==="h"?`${e}: expected 16 to ${te} pixels, got ${u}`:e==="pad"?`pad: expected 0 to ${te}, got ${u}`:`${e}: expected 0 to ${i} milliseconds, got ${u}${a}`}function zo(e){return typeof e=="number"&&e>=20&&e<=300}function Xo(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=16}function Jo(e,n){if(e==="meter"&&n!==void 0&&/^\d+\/\d+$/.test(n))return`Expected beats in a bar, got ${n} \u2014 meter is beats per bar: meter=${n.split("/")[0]??""}`;if(e==="duration"&&n!==void 0&&/\d(?:beats?|bars?)$/.test(n))return`Expected milliseconds, got ${n} \u2014 the page transition is milliseconds; beats are for the lines`}function Go(e){return e==="emphasise"||e==="emphasize"?" \u2014 write emphasis=pulse":e==="easing"?" \u2014 write ease=":e==="split"?" \u2014 write by=word or by=letter":e==="start"?" \u2014 write at= (milliseconds), after= or with=":""}function Ho(e){let n=e.enter,t=e.exit,r=n??t,o=e.from;if(t==="count")return"count only enters: it runs a number up to its written value";if(o!==void 0)if(r==="count"){if(typeof o!="number")return"from= on count is the number it starts at, e.g. from=0"}else if(r==="wipe"||r==="grow"){if(typeof o=="number")return`from= on ${r} is a side: ${ne.join(", ")}`}else return"from= goes with count (a number), or wipe and grow (a side)";if(e.by!==void 0&&r!==void 0&&!me.includes(r))return`by= splits a text for ${me.join(", ")}, not ${r}`;if(e.by!==void 0&&r===void 0)return"by= goes with enter= or exit=";if(e.stagger!==void 0&&r===void 0)return"stagger= goes with enter= or exit=";if(e.hold!==void 0&&n===void 0)return"hold= goes with enter=: how long to stay before leaving the way it came"}function lt(e){return(n,t,r,o)=>{e.push({severity:"error",code:t,message:`Line ${n}: ${r}`,...o===void 0?{}:{nodeId:o}})}}function pt(e){let n=[],t=e.split(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @getv.design/embed v0.5.
|
|
2
|
-
import{m as l,q as d,r as p,s as g}from"./chunk-
|
|
1
|
+
/*! @getv.design/embed v0.5.2. Free to use under the vDesign Embed Licence. © 2026 vDesign. https://getv.design/docs/licence/ */
|
|
2
|
+
import{m as l,q as d,r as p,s as g}from"./chunk-FMTYD7LD.js";import{a as m}from"./chunk-OE3F27L6.js";var h=Symbol.for(`vdesign.embed.documents@${m}`),y=globalThis[h]??=new WeakMap,v=/^Line (\d+): /;function w(e){let n=v.exec(e.message);return{...n?{line:Number(n[1])}:{},code:e.code,message:e.message,severity:e.severity}}function f(e){if(typeof e!="string")return c(d("").document,new Map,[{code:"not-text",message:`parse() takes .vd text, not ${e===null?"null":typeof e}.`,severity:"error"}]);let n=D(e);if(n.vd===void 0)return c(d("").document,new Map,[{code:"not-vd",message:"This SVG carries no vDesign document: only a .vd.svg exported from vDesign does.",severity:"error"}]);let{head:t,blocks:o}=l(n.vd),r=d(t),s=r.problems.map(w).map(i=>i.line===void 0?i:{...i,line:i.line+n.offset});return c(r.document,o,s)}function D(e){if(!g(e))return{vd:e,offset:0};let n=p(e);if(n===void 0)return{vd:void 0,offset:0};let t=e.indexOf("<vd:document"),o=e.indexOf("</vd:document",t),r=e.indexOf("<![CDATA[",t);if(r===-1||o!==-1&&r>o){let u=e.indexOf(">",t)+1,b=e.slice(0,u).split(`
|
|
3
3
|
`).length-1;return{vd:n,offset:b+(e[u]===`
|
|
4
4
|
`?1:0)}}let s=r+9,i=e.slice(0,s).split(`
|
|
5
5
|
`).length-1;return{vd:n,offset:i+(e[s]===`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @getv.design/embed v0.5.
|
|
2
|
-
import{a as m,b as w,d as g,e as O,f as P,g as S,h as y,i as p}from"./chunk-
|
|
1
|
+
/*! @getv.design/embed v0.5.2. Free to use under the vDesign Embed Licence. © 2026 vDesign. https://getv.design/docs/licence/ */
|
|
2
|
+
import{a as m,b as w,d as g,e as O,f as P,g as S,h as y,i as p}from"./chunk-NAQCHPKZ.js";import{L as R,n as v}from"./chunk-FMTYD7LD.js";import{b as h}from"./chunk-OE3F27L6.js";function E(e){return m(e)}async function L(e,n={}){let t=n.fonts??"approximate";if(!x.includes(t))throw new TypeError(`renderSvg: fonts must be one of ${x.join(", ")}; got ${String(t)}.`);let o=t==="exact"?y(n.fontBase,F()):void 0,{document:i,blocks:a,problems:s}=await O(e),r=n.page===void 0?i:D(i,n.page),u=B(a),f=n.idPrefix,d=[...s],c;if(t==="exact")if(o===void 0)d.push(p([],"no fontBase was given and this build has no default"));else{let{exactSvg:l}=await import("./fonts.js"),b=await l(r,{base:o,resolveAsset:u,...f?{idPrefix:f}:{}});"svg"in b?c=b.svg:d.push(p(b.failures))}return c??=R(r,{ids:!1,resolveAsset:u,...f?{idPrefix:f}:{}}),n.onProblems?.(d),c}function M(e){return typeof e=="string"?w(e).vd:void 0}function C(e){let{document:n,problems:t}=m(e),{document:o}=g(n),{vd:i,offset:a}=typeof e=="string"?w(e):{vd:void 0,offset:0},s=new Map;if(i!==void 0){let r=/^frame\s+(\S+)/;i.split(`
|
|
3
3
|
`).some((u,f)=>{if(u.startsWith("--- payload"))return!0;let d=r.exec(u)?.[1];return d!==void 0&&!s.has(d)&&s.set(d,f+1+a),!1})}return{...o.title===void 0?{}:{title:o.title},pages:P(o).map(r=>({id:r.id,...r.name===void 0?{}:{name:r.name},...s.has(r.id)?{line:s.get(r.id)}:{}})),problems:t}}async function W(e={}){let n=e.fonts??"approximate";if(!x.includes(n))throw new TypeError(`createRenderer: fonts must be one of ${x.join(", ")}; got ${String(n)}.`);let t,o="approximate",i,a;if(n==="exact")if(t=y(e.fontBase,F()),t===void 0)a=p([],"no fontBase was given and this build has no default");else{let s=await import("./fonts.js"),r=await s.exactFontsAt(t).ensureAll();i=s.exactSvgNow,o=r.length<s.BUNDLED_FACE_COUNT?"exact":"approximate",r.length>0&&(a=p(r))}return N({fonts:o,base:t,exactNow:i,failed:a})}function _(){return N({fonts:"approximate",base:void 0,exactNow:void 0,failed:void 0})}function N(e){let{fonts:n,base:t,exactNow:o,failed:i}=e;return{fonts:n,renderSvg(a,s={}){let r=typeof a=="string"?g(m(a).document):g(a),u=s.page===void 0?r.document:D(r.document,s.page),f=B(r.blocks),d=s.idPrefix,c=[...r.problems],l;return n==="exact"&&t!==void 0&&o!==void 0?(l=o(u,{base:t,resolveAsset:f,...d?{idPrefix:d}:{}}),l===void 0&&i&&c.push(i)):i&&c.push(i),l??=R(u,{ids:!1,resolveAsset:f,...d?{idPrefix:d}:{}}),s.onProblems?.(c),l}}}function B(e){return n=>{let t=e.get(n.hash);return t===void 0?void 0:v(n.type,t)}}var x=["approximate","exact"];function F(){let e=import.meta.url;if(typeof e!="string")return h;let t=typeof globalThis.process?.getBuiltinModule=="function",o=/\/dist\/chunks\/[^/]*$/.test(e)?"../../fonts/":"../fonts/";return e.startsWith("file:")&&t?new URL(o,e).href:h}function D(e,n){let t=S(e,n);return{...e,root:{...e.root,children:e.root.children.map(o=>o===t?o:{...o,hidden:!0})}}}export{E as a,L as b,M as c,C as d,W as e,_ as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @getv.design/embed v0.5.
|
|
1
|
+
/*! @getv.design/embed v0.5.2. Free to use under the vDesign Embed Licence. © 2026 vDesign. https://getv.design/docs/licence/ */
|
|
2
2
|
var g=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>()=>{try{return a||b((a={exports:{}}).exports,a),a.exports}catch(c){throw a=0,c}};var l=(b,a,c,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&f(b,d,{get:()=>a[d],enumerable:!(e=h(a,d))||e.enumerable});return b};var n=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?f(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @getv.design/embed v0.5.
|
|
2
|
-
import{f as O}from"./chunk-
|
|
1
|
+
/*! @getv.design/embed v0.5.2. Free to use under the vDesign Embed Licence. © 2026 vDesign. https://getv.design/docs/licence/ */
|
|
2
|
+
import{f as O}from"./chunk-ODPS4XJH.js";import{a as k,d as P,f as S}from"./chunk-NAQCHPKZ.js";import{a as x,o as F}from"./chunk-FMTYD7LD.js";function _(r="vd"){let e=0;return()=>`${r}${++e}-`}var A={bytes:1e6,nodes:5e3};function Z(r){let e=/^\s*([^\s{]+)/.exec(r??"")?.[1]?.toLowerCase();return e==="vd"||e==="vdesign"}function E(r){let e={},s=(r??"").trim().replace(/^\S+/,""),t=/([A-Za-z][\w-]*)(?:=(?:"((?:[^"\\]|\\.)*)"|'([^']*)'|(\S+)))?/g;for(let a of s.matchAll(t)){let i=a[1]?.toLowerCase(),o=a[2]?.replace(/\\(.)/g,"$1")??a[3]??a[4];switch(i){case"page":o!==void 0&&o!==""&&(e.page=/^\d+$/.test(o)?Number(o):o);break;case"src":o&&(e.src=o);break;case"height":{let d=Number(o);Number.isFinite(d)&&d>0&&d<=1e4&&(e.height=d);break}case"mode":(o==="static"||o==="view")&&(e.mode=o);break;case"source":e.source=o===void 0||o==="true";break;case"alt":o!==void 0&&(e.alt=o);break;default:break}}return e}function G(r,e,s={}){let t=typeof e=="string"?E(e):e,a={...A,...s.limits},i=typeof r=="string"?r:"";if(t.src!==void 0){let n;try{n=s.resolveSrc?.(t.src)}catch{n=void 0}if(n===void 0)return l(i,[g("src-unresolved",`Could not read ${t.src}.`)]);i=n}if(i.length>a.bytes)return l(t.src===void 0?i:"",[g("too-large",`This design is over ${a.bytes} characters, the most a fence draws.`)]);let{document:o,problems:d}=k(i),h=P(o).document;if(B(h)>a.nodes)return l(t.src===void 0?i:"",[g("too-large",`This design has over ${a.nodes} shapes, the most a fence draws.`)]);if(S(h).length===0){let n=d.filter(m=>m.severity==="error");return l(t.src===void 0?i:"",[...n,...n.length===0?[g("no-pages","This design has no page to draw.")]:[]])}let R=s.renderer??O(),j=s.idPrefix??z,f,v=[];try{f=R.renderSvg(o,{...t.page===void 0?{}:{page:t.page},idPrefix:j(),onProblems:n=>v.push(...n)})}catch(n){return l(t.src===void 0?i:"",[g("no-such-page",n instanceof Error?n.message:String(n))])}let b=t.mode??s.mode??"static",$=t.alt??h.title??"Design",L=s.output==="img"||s.inlineStyles===!1&&/ style="/.test(f)?`<img class="vd-figure-art" alt="${c($)}" src="data:image/svg+xml;base64,${T(f)}">`:`<div class="vd-figure-art" role="img" aria-label="${c($)}">${N(f).trimEnd()}</div>`,y=["vd-figure"],u=[];for(let[n,m]of s.attributes??[])!/^[a-z][a-z0-9-]*$/i.test(n)||/^on/i.test(n)||n==="style"||(n==="class"?y.push(...m.split(/\s+/).filter(Boolean)):u.push(`${n}="${c(m)}"`));u.unshift(`class="${c(y.join(" "))}"`,`data-vd-mode="${b}"`),t.page!==void 0&&u.push(`data-vd-page="${c(String(t.page))}"`),t.height!==void 0&&u.push(`data-vd-height="${t.height}"`),b==="view"&&u.push(`data-vd-source="${T(i)}"`);let p=[`<figure ${u.join(" ")}>`,L],w=C([...d,...v]);return w.length>0&&p.push(I(w)),t.source&&p.push(`<details class="vd-figure-source"><summary>Source</summary><pre><code class="language-vd">${c(i)}</code></pre></details>`),p.push("</figure>"),`${p.join("")}
|
|
3
3
|
`}function N(r){return r.replace(/<a href="#[^"]*">(<tspan[^>]*>[^<]*<\/tspan>)<\/a>/g,"$1")}function T(r){return F(new TextEncoder().encode(r))}var z=_();function B(r){let e=0;return x(r.root,()=>{e+=1}),e}function l(r,e){let s=e.length>0?I(e):"";return`<pre><code class="language-vd">${c(r)}</code></pre>${s}
|
|
4
4
|
`}function I(r){return`<ul class="vd-problems">${r.map(s=>`<li data-severity="${s.severity}">${c(s.message)}</li>`).join("")}</ul>`}function C(r){let e=new Set;return r.filter(s=>{let t=`${s.code}\0${s.message}`;return e.has(t)?!1:(e.add(t),!0)})}function g(r,e){return{code:r,message:e,severity:"error"}}function c(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}export{_ as a,Z as b,E as c,G as d};
|