@zombie-mermaid/core 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,t){let n=e.match(/^click\s+([\w\p{L}-]+)\s+(.*)$/iu);if(!n)return;let r=n[1],i=n[2].trim(),a={...t.get(r)},o=i.match(/^(?:call|callback)\s+(.+?)\s*$/i);if(o){let e=o[1].match(/^(.*?\))\s+"([^"]*)"\s*$/);e?(a.callback=e[1].trim(),a.tooltip=e[2]):a.callback=o[1].trim(),t.set(r,a);return}i=i.replace(/^href\s+/i,``);let s=[...i.matchAll(/"([^"]*)"/g)].map(e=>e[1]);s.length>0&&(a.href=s[0]),s.length>1&&(a.tooltip=s[1]);let c=i.match(/(_blank|_self|_parent|_top)\s*$/i);c&&(a.target=c[1].toLowerCase()),(a.href!==void 0||a.tooltip!==void 0)&&t.set(r,a)}function t(e){if(!e||/[\x00-\x1F\x7F]/.test(e))return;let t=e.trim();if(/^[./#?]/.test(t))return t;let n=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/)?.[1];return n===void 0||/^(https?|mailto)$/i.test(n)?t:void 0}function n(e,t){t.set(e.id,e);for(let r of e.children)n(r,t)}function r(e,t){let n=(e,n)=>{let r=t.get(e);if(!r)return!1;let a=new Set;return i(r,a),a.has(n)};return n(e.target,e.source)||n(e.source,e.target)}function i(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)t.add(n.id),i(n,t)}function a(e){if(e.subgraphs.length===0)return e;let t=new Map;for(let r of e.subgraphs)n(r,t);let i=e.edges.filter(e=>!r(e,t));if(i.length===e.edges.length)return e;let a=new Set;for(let e of i)a.add(e.source),a.add(e.target);let o=new Map(e.nodes);for(let e of t.keys())a.has(e)||o.delete(e);return{...e,nodes:o,edges:i}}var o=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,s=/^rgba?\(\s*([\d.]+%?)\s*[, ]\s*([\d.]+%?)\s*[, ]\s*([\d.]+%?)\s*(?:[,/]\s*([\d.]+%?)\s*)?\)$/i;function c(e){let t=l(e);return t?[t.r,t.g,t.b]:null}function l(e){let t=o.exec(e.trim());if(!t)return null;let n=t[1];if(n===void 0)return null;let r=n;return(r.length===3||r.length===4)&&(r=r.split(``).map(e=>e+e).join(``)),{r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16),a:r.length===8?parseInt(r.slice(6,8),16)/255:1}}function u(e){return e.endsWith(`%`)?Number(e.slice(0,-1))/100*255:Number(e)}function ee(e){return e===void 0?1:e.endsWith(`%`)?Number(e.slice(0,-1))/100:Number(e)}function d(e){let t=e.trim();if(t.toLowerCase()===`transparent`)return{r:0,g:0,b:0,a:0};let n=l(t);if(n)return n;let r=s.exec(t);if(r){let[,e,t,n,i]=r;if(e===void 0||t===void 0||n===void 0)return null;let a={r:u(e),g:u(t),b:u(n),a:ee(i)};return[a.r,a.g,a.b,a.a].some(e=>Number.isNaN(e))?null:a}return null}function f(e,t,n,r){let i,a;n===void 0&&r===void 0?(i=50,a=50):n===void 0?(a=r??50,i=100-a):r===void 0?(i=n,a=100-i):(i=n,a=r);let o=i+a;if(o===0)return null;let s=o<100?o/100:1;i/=o,a/=o;let c=e.a*i+t.a*a,l=(n,r)=>c===0?0:(n*e.a*i+r*t.a*a)/c;return{r:l(e.r,t.r),g:l(e.g,t.g),b:l(e.b,t.b),a:c*s}}function te(e,t,n){let r=d(e),i=d(t);if(!r||!i)return e;let a=f(r,i,n,100-n);return a?m(a):e}var p=e=>Math.min(255,Math.max(0,Math.round(e)));function m(e){let t=p(e.r),n=p(e.g),r=p(e.b),i=Math.min(1,Math.max(0,e.a));return i>=1?`#`+[t,n,r].map(e=>e.toString(16).padStart(2,`0`)).join(``):`rgba(${t}, ${n}, ${r}, ${Number(i.toFixed(3))})`}var h=/^[&#](?:#?[0-9]+|#?[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/,g=new Set([`&`,`#`]);function _(e){let t=null;for(let n=0;n<e.length;n++){let r=e[n];if(t!==null){r===t&&(t=null);continue}if(r===`"`||r===`'`){t=r;continue}if(g.has(r)){let t=h.exec(e.slice(n));if(t){n+=t[0].length-1;continue}}if(r===`%`&&e[n+1]===`%`)return n}return-1}function ne(e){let t=[],n=``,r=null;for(let i=0;i<e.length;i++){let a=e[i];if(r!==null){n+=a,a===r&&(r=null);continue}if(a===`"`||a===`'`){r=a,n+=a;continue}if(g.has(a)){let t=h.exec(e.slice(i));if(t){n+=t[0],i+=t[0].length-1;continue}}if(a===`;`){t.push(n),n=``;continue}n+=a}return t.push(n),t}function v(e){let t=[],n=e.split(`
2
- `);for(let e=0;e<n.length;e++){let r=n[e].trim(),i=e+1,a=_(r);if(a!==-1&&(r=r.slice(0,a).trim()),r.length===0)continue;let o=[];for(let e of ne(r)){let t=e.trim();t.length!==0&&o.push({text:t,line:i})}o.length>0&&t.push(o)}return t}function y(e){return v(e).flat()}var re=[`flowchart`,`sequence`,`class`,`er`,`xychart`,`architecture`,`c4`];function b(e){let t=y(e)[0]?.text.toLowerCase()??``;return/^xychart(?:-beta)?(?:\s|$)/.test(t)?`xychart`:/^architecture(?:-beta)?\s*$/.test(t)?`architecture`:/^c4(?:context|container|component|dynamic|deployment)\s*$/.test(t)?`c4`:/^sequencediagram\s*$/.test(t)?`sequence`:/^classdiagram\s*$/.test(t)?`class`:/^erdiagram\s*$/.test(t)?`er`:`flowchart`}function x(e){return e===`TD`||e===`TB`||e===`LR`||e===`BT`||e===`RL`}function S(e){let t=e?.toUpperCase();if(t===void 0||!x(t))throw Error(`Invalid direction: "${e}"`);return t}function C(e,t){return t===void 0||!x(t)?e:{...e,direction:t}}var ie=new Set([`linear`,`basis`,`natural`,`step`,`stepBefore`,`stepAfter`]),w={theme:"colors come from the caller's bg/fg render options, which are usually CSS variables so a diagram inherits the host page's light/dark. A diagram-supplied theme would hard-code colors that fight it. Mermaid's theme names (default/dark/forest/neutral) also have no equivalent in this renderer's palettes — pass `bg`/`fg`, or a THEMES entry, instead",securitylevel:`this renderer emits static SVG and never executes diagram-supplied script, so there is no sandbox to configure`,defaultrenderer:`ELK is the only layout engine; dagre/elk selection has no effect`,fontfamily:"use the `font` render option instead",htmllabels:`labels are always rendered as SVG text; there is no HTML label mode`,maxtextsize:`no text-size limit is enforced`,startonload:`not a browser auto-render integration`},T=/^\s*%%\{\s*(?:init|initialize)\s*:\s*([\s\S]*?)\}%%/i;function ae(e){return T.test(e)}function oe(e){let t=``,n=null;for(let r=0;r<e.length;r++){let i=e[r];if(n!==null){if(i===`\\`&&r+1<e.length){let n=e[r+1];t+=n===`'`?`'`:`\\${n}`,r++}else i===n?(n=null,t+=`"`):t+=i===`"`?`\\"`:i;continue}if(i===`"`||i===`'`){n=i,t+=`"`;continue}if(/[A-Za-z_$]/.test(i)){let n=r;for(;n<e.length&&/[\w$-]/.test(e[n]);)n++;let i=e.slice(r,n),a=n;for(;a<e.length&&/\s/.test(e[a]);)a++;if(e[a]===`:`){t+=`"${i}"`,r=n-1;continue}t+=/^(true|false|null)$/i.test(i)?i.toLowerCase():`"${i}"`,r=n-1;continue}t+=i}return t}function E(e){let t=e.match(T);if(!t)return;let n;try{n=JSON.parse(oe(t[1]))}catch{return}if(typeof n!=`object`||!n)return;let r={ignored:[]},i={...n};for(let[e,t]of Object.entries(i)){let n=e.toLowerCase();if(n===`theme`&&typeof t==`string`){r.theme=t,r.ignored.push(e);continue}if(n===`flowchart`&&typeof t==`object`&&t){let e={...t};for(let[t,n]of Object.entries(e)){if(t.toLowerCase()===`curve`&&typeof n==`string`){ie.has(n)&&(r.curve=n);continue}t.toLowerCase()in w&&r.ignored.push(t)}continue}n in w&&r.ignored.push(e)}return r}function se(e){let t={ignored:[]};for(let n of e){let e=E(n);e&&(e.theme!==void 0&&(t.theme=e.theme),e.curve!==void 0&&(t.curve=e.curve),t.ignored.push(...e.ignored))}return t}function ce(e,t){return t.curve===void 0||e.curve!==void 0?e:{...e,curve:t.curve}}function le(e){return[...new Set(e.ignored)].map(e=>`${e}: ${w[e.toLowerCase()]??`not supported`}`)}var D={" ":.521,"!":.533,'"':.863,"#":1.173,$:1.188,"%":1.818,"&":1.193,"'":.555,"(":.675,")":.675,"*":.928,"+":1.225,",":.534,"-":.852,".":.534,"/":.667,0:1.168,1:.753,2:1.129,3:1.144,4:1.196,5:1.099,6:1.148,7:1.048,8:1.146,9:1.148,":":.534,";":.559,"<":1.225,"=":1.225,">":1.225,"?":.947,"@":1.789,A:1.278,B:1.212,C:1.353,D:1.336,E:1.113,F:1.093,G:1.382,H:1.376,I:.497,J:1.057,K:1.244,L:1.047,M:1.673,N:1.395,O:1.416,P:1.183,Q:1.416,R:1.192,S:1.188,T:1.195,U:1.378,V:1.278,W:1.825,X:1.263,Y:1.257,Z:1.165,"[":.675,"\\":.667,"]":.675,"^":.873,_:.845,"`":.598,a:1.04,b:1.134,c:1.058,d:1.134,e:1.08,f:.685,g:1.136,h:1.095,i:.448,j:.448,k:1.016,l:.448,m:1.622,n:1.094,o:1.11,p:1.134,q:1.134,r:.697,s:.977,t:.606,u:1.095,v:1.041,w:1.515,x:1.011,y:1.041,z:1.023,"{":.789,"|":.616,"}":.789,"~":1.225};function ue(e){return Object.hasOwn(D,e)}var de=new Set([`i`,`l`,`t`,`f`,`j`,`I`,`1`,`!`,`|`,`.`,`,`,`:`,`;`,`'`]),fe=new Set([`W`,`M`,`w`,`m`,`@`,`%`]),pe=new Set([`W`,`M`]),me=new Set([`(`,`)`,`[`,`]`,`{`,`}`,`/`,`\\`,`-`,`"`,"`"]);function he(e){return e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071}function O(e){return e>=4352&&e<=4447||e>=11904&&e<=12031||e>=12032&&e<=12255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12544&&e<=12591||e>=12592&&e<=12687||e>=12688&&e<=12799||e>=12800&&e<=13311||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072}var k=/\p{Emoji_Presentation}/u,A=/\p{Extended_Pictographic}/u;function j(e){return e>=9632&&e<=9727}function M(e){return e>=8596&&e<=8601||e===8617||e===8618}function N(e){if(k.test(e))return!0;let t=e.codePointAt(0);return t!==void 0&&j(t)||t!==void 0&&M(t)?!1:A.test(e)}function P(e){let t=e.codePointAt(0);return t===void 0?!1:O(t)||N(e)}function F(e){let t=e.codePointAt(0);if(t===void 0)return 0;if(Object.hasOwn(D,e)){let t=D[e];if(t!==void 0)return t}if(he(t))return 0;if(O(t)||N(e))return 2;let n=e.normalize(`NFD`)[0];if(n!==void 0&&n!==e){let e=D[n];if(e!==void 0)return e}return e===` `?.3:pe.has(e)?1.5:fe.has(e)?1.2:de.has(e)?.4:me.has(e)?.5:e===`r`?.8:t>=65&&t<=90?1.2:1}var I=.6,L=!1;function R(e){return/mono|consol|menlo|courier|\bcode\b/i.test(e)}function ge(e){L=e}function z(e,t,n){let r=t*.15;if(L){let n=0;for(let t of e)n+=1;return n*t*I+r}let i=n>=600?.6:n>=500?.57:.54,a=0;for(let t of e)a+=F(t);return a*t*i+r}var B=1.3;function _e(e,t,n){let r=e.split(`
3
- `),i=t*B,a=0;for(let e of r){let r=z(e.replace(/<\/?(?:b|strong|i|em|u|s|del)\s*>/gi,``),t,n);r>a&&(a=r)}return{width:a,height:r.length*i,lines:r,lineHeight:i}}function ve(e){return Number.isFinite(e)?Number(e.toFixed(2)):0}function V(e,...t){let n=e[0]??``;for(let r=0;r<t.length;r++){let i=t[r];n+=String(typeof i==`number`?ve(i):i),n+=e[r+1]??``}return n}function ye(e){let t=e.startsWith(`"`)&&e.endsWith(`"`)?e.slice(1,-1):e;return(t.length>=2&&t.startsWith("`")&&t.endsWith("`")?t.slice(1,-1):t).replace(/<br\s*\/?>/gi,`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,t){let n=e.match(/^click\s+([\w\p{L}-]+)\s+(.*)$/iu);if(!n)return;let r=n[1],i=n[2].trim(),a={...t.get(r)},o=i.match(/^(?:call|callback)\s+(.+?)\s*$/i);if(o){let e=o[1].match(/^(.*?\))\s+"([^"]*)"\s*$/);e?(a.callback=e[1].trim(),a.tooltip=e[2]):a.callback=o[1].trim(),t.set(r,a);return}i=i.replace(/^href\s+/i,``);let s=[...i.matchAll(/"([^"]*)"/g)].map(e=>e[1]);s.length>0&&(a.href=s[0]),s.length>1&&(a.tooltip=s[1]);let c=i.match(/(_blank|_self|_parent|_top)\s*$/i);c&&(a.target=c[1].toLowerCase()),(a.href!==void 0||a.tooltip!==void 0)&&t.set(r,a)}function t(e){if(!e||/[\x00-\x1F\x7F]/.test(e))return;let t=e.trim();if(/^[./#?]/.test(t))return t;let n=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/)?.[1];return n===void 0||/^(https?|mailto)$/i.test(n)?t:void 0}function n(e,t){t.set(e.id,e);for(let r of e.children)n(r,t)}function r(e,t){let n=(e,n)=>{let r=t.get(e);if(!r)return!1;let a=new Set;return i(r,a),a.has(n)};return n(e.target,e.source)||n(e.source,e.target)}function i(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)t.add(n.id),i(n,t)}function a(e){if(e.subgraphs.length===0)return e;let t=new Map;for(let r of e.subgraphs)n(r,t);let i=e.edges.filter(e=>!r(e,t));if(i.length===e.edges.length)return e;let a=new Set;for(let e of i)a.add(e.source),a.add(e.target);let o=new Map(e.nodes);for(let e of t.keys())a.has(e)||o.delete(e);return{...e,nodes:o,edges:i}}var o=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,s=/^rgba?\(\s*([\d.]+%?)\s*[, ]\s*([\d.]+%?)\s*[, ]\s*([\d.]+%?)\s*(?:[,/]\s*([\d.]+%?)\s*)?\)$/i;function c(e){let t=l(e);return t?[t.r,t.g,t.b]:null}function l(e){let t=o.exec(e.trim());if(!t)return null;let n=t[1];if(n===void 0)return null;let r=n;return(r.length===3||r.length===4)&&(r=r.split(``).map(e=>e+e).join(``)),{r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16),a:r.length===8?parseInt(r.slice(6,8),16)/255:1}}function u(e){return e.endsWith(`%`)?Number(e.slice(0,-1))/100*255:Number(e)}function d(e){return e===void 0?1:e.endsWith(`%`)?Number(e.slice(0,-1))/100:Number(e)}function f(e){let t=e.trim();if(t.toLowerCase()===`transparent`)return{r:0,g:0,b:0,a:0};let n=l(t);if(n)return n;let r=s.exec(t);if(r){let[,e,t,n,i]=r;if(e===void 0||t===void 0||n===void 0)return null;let a={r:u(e),g:u(t),b:u(n),a:d(i)};return[a.r,a.g,a.b,a.a].some(e=>Number.isNaN(e))?null:a}return null}function p(e,t,n,r){let i,a;n===void 0&&r===void 0?(i=50,a=50):n===void 0?(a=r??50,i=100-a):r===void 0?(i=n,a=100-i):(i=n,a=r);let o=i+a;if(o===0)return null;let s=o<100?o/100:1;i/=o,a/=o;let c=e.a*i+t.a*a,l=(n,r)=>c===0?0:(n*e.a*i+r*t.a*a)/c;return{r:l(e.r,t.r),g:l(e.g,t.g),b:l(e.b,t.b),a:c*s}}function ee(e,t,n){let r=f(e),i=f(t);if(!r||!i)return e;let a=p(r,i,n,100-n);return a?h(a):e}var m=e=>Math.min(255,Math.max(0,Math.round(e)));function h(e){let t=m(e.r),n=m(e.g),r=m(e.b),i=Math.min(1,Math.max(0,e.a));return i>=1?`#`+[t,n,r].map(e=>e.toString(16).padStart(2,`0`)).join(``):`rgba(${t}, ${n}, ${r}, ${Number(i.toFixed(3))})`}var g=/^[&#](?:#?[0-9]+|#?[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/,_=new Set([`&`,`#`]);function te(e){let t=null;for(let n=0;n<e.length;n++){let r=e[n];if(t!==null){r===t&&(t=null);continue}if(r===`"`||r===`'`){t=r;continue}if(_.has(r)){let t=g.exec(e.slice(n));if(t){n+=t[0].length-1;continue}}if(r===`%`&&e[n+1]===`%`)return n}return-1}function ne(e){let t=[],n=``,r=null;for(let i=0;i<e.length;i++){let a=e[i];if(r!==null){n+=a,a===r&&(r=null);continue}if(a===`"`||a===`'`){r=a,n+=a;continue}if(_.has(a)){let t=g.exec(e.slice(i));if(t){n+=t[0],i+=t[0].length-1;continue}}if(a===`;`){t.push(n),n=``;continue}n+=a}return t.push(n),t}function v(e){let t=[],n=e.split(`
2
+ `);for(let e=0;e<n.length;e++){let r=n[e].trim(),i=e+1,a=te(r);if(a!==-1&&(r=r.slice(0,a).trim()),r.length===0)continue;let o=[];for(let e of ne(r)){let t=e.trim();t.length!==0&&o.push({text:t,line:i})}o.length>0&&t.push(o)}return t}function y(e){return v(e).flat()}var re=[`flowchart`,`sequence`,`class`,`er`,`xychart`,`architecture`,`c4`,`pie`];function ie(e){let t=y(e)[0]?.text??``,n=t.toLowerCase();return/^pie(?:\s|$)/.test(t)?`pie`:/^xychart(?:-beta)?(?:\s|$)/.test(n)?`xychart`:/^architecture(?:-beta)?\s*$/.test(n)?`architecture`:/^c4(?:context|container|component|dynamic|deployment)\s*$/.test(n)?`c4`:/^sequencediagram\s*$/.test(n)?`sequence`:/^classdiagram\s*$/.test(n)?`class`:/^erdiagram\s*$/.test(n)?`er`:`flowchart`}function b(e){return e===`TD`||e===`TB`||e===`LR`||e===`BT`||e===`RL`}function x(e){let t=e?.toUpperCase();if(t===void 0||!b(t))throw Error(`Invalid direction: "${e}"`);return t}function S(e,t){return t===void 0||!b(t)?e:{...e,direction:t}}var C=new Set([`linear`,`basis`,`natural`,`step`,`stepBefore`,`stepAfter`]),w={theme:"colors come from the caller's bg/fg render options, which are usually CSS variables so a diagram inherits the host page's light/dark. A diagram-supplied theme would hard-code colors that fight it. Mermaid's theme names (default/dark/forest/neutral) also have no equivalent in this renderer's palettes — pass `bg`/`fg`, or a THEMES entry, instead",securitylevel:`this renderer emits static SVG and never executes diagram-supplied script, so there is no sandbox to configure`,defaultrenderer:`ELK is the only layout engine; dagre/elk selection has no effect`,fontfamily:"use the `font` render option instead",htmllabels:`labels are always rendered as SVG text; there is no HTML label mode`,maxtextsize:`no text-size limit is enforced`,startonload:`not a browser auto-render integration`},T=/^\s*%%\{\s*(?:init|initialize)\s*:\s*([\s\S]*?)\}%%/i;function ae(e){return T.test(e)}function oe(e){let t=``,n=null;for(let r=0;r<e.length;r++){let i=e[r];if(n!==null){if(i===`\\`&&r+1<e.length){let n=e[r+1];t+=n===`'`?`'`:`\\${n}`,r++}else i===n?(n=null,t+=`"`):t+=i===`"`?`\\"`:i;continue}if(i===`"`||i===`'`){n=i,t+=`"`;continue}if(/[A-Za-z_$]/.test(i)){let n=r;for(;n<e.length&&/[\w$-]/.test(e[n]);)n++;let i=e.slice(r,n),a=n;for(;a<e.length&&/\s/.test(e[a]);)a++;if(e[a]===`:`){t+=`"${i}"`,r=n-1;continue}t+=/^(true|false|null)$/i.test(i)?i.toLowerCase():`"${i}"`,r=n-1;continue}t+=i}return t}function E(e){let t=e.match(T);if(!t)return;let n;try{n=JSON.parse(oe(t[1]))}catch{return}if(typeof n!=`object`||!n)return;let r={ignored:[]},i={...n};for(let[e,t]of Object.entries(i)){let n=e.toLowerCase();if(n===`theme`&&typeof t==`string`){r.theme=t,r.ignored.push(e);continue}if(n===`flowchart`&&typeof t==`object`&&t){let e={...t};for(let[t,n]of Object.entries(e)){if(t.toLowerCase()===`curve`&&typeof n==`string`){C.has(n)&&(r.curve=n);continue}t.toLowerCase()in w&&r.ignored.push(t)}continue}n in w&&r.ignored.push(e)}return r}function se(e){let t={ignored:[]};for(let n of e){let e=E(n);e&&(e.theme!==void 0&&(t.theme=e.theme),e.curve!==void 0&&(t.curve=e.curve),t.ignored.push(...e.ignored))}return t}function ce(e,t){return t.curve===void 0||e.curve!==void 0?e:{...e,curve:t.curve}}function le(e){return[...new Set(e.ignored)].map(e=>`${e}: ${w[e.toLowerCase()]??`not supported`}`)}var D={" ":.521,"!":.533,'"':.863,"#":1.173,$:1.188,"%":1.818,"&":1.193,"'":.555,"(":.675,")":.675,"*":.928,"+":1.225,",":.534,"-":.852,".":.534,"/":.667,0:1.168,1:.753,2:1.129,3:1.144,4:1.196,5:1.099,6:1.148,7:1.048,8:1.146,9:1.148,":":.534,";":.559,"<":1.225,"=":1.225,">":1.225,"?":.947,"@":1.789,A:1.278,B:1.212,C:1.353,D:1.336,E:1.113,F:1.093,G:1.382,H:1.376,I:.497,J:1.057,K:1.244,L:1.047,M:1.673,N:1.395,O:1.416,P:1.183,Q:1.416,R:1.192,S:1.188,T:1.195,U:1.378,V:1.278,W:1.825,X:1.263,Y:1.257,Z:1.165,"[":.675,"\\":.667,"]":.675,"^":.873,_:.845,"`":.598,a:1.04,b:1.134,c:1.058,d:1.134,e:1.08,f:.685,g:1.136,h:1.095,i:.448,j:.448,k:1.016,l:.448,m:1.622,n:1.094,o:1.11,p:1.134,q:1.134,r:.697,s:.977,t:.606,u:1.095,v:1.041,w:1.515,x:1.011,y:1.041,z:1.023,"{":.789,"|":.616,"}":.789,"~":1.225};function ue(e){return Object.hasOwn(D,e)}var de=new Set([`i`,`l`,`t`,`f`,`j`,`I`,`1`,`!`,`|`,`.`,`,`,`:`,`;`,`'`]),fe=new Set([`W`,`M`,`w`,`m`,`@`,`%`]),pe=new Set([`W`,`M`]),me=new Set([`(`,`)`,`[`,`]`,`{`,`}`,`/`,`\\`,`-`,`"`,"`"]);function he(e){return e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071}function O(e){return e>=4352&&e<=4447||e>=11904&&e<=12031||e>=12032&&e<=12255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12544&&e<=12591||e>=12592&&e<=12687||e>=12688&&e<=12799||e>=12800&&e<=13311||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072}var ge=/\p{Emoji_Presentation}/u,_e=/\p{Extended_Pictographic}/u;function ve(e){return e>=9632&&e<=9727}function k(e){return e>=8596&&e<=8601||e===8617||e===8618}function A(e){if(ge.test(e))return!0;let t=e.codePointAt(0);return t!==void 0&&ve(t)||t!==void 0&&k(t)?!1:_e.test(e)}function j(e){let t=e.codePointAt(0);return t===void 0?!1:O(t)||A(e)}function M(e){let t=e.codePointAt(0);if(t===void 0)return 0;if(Object.hasOwn(D,e)){let t=D[e];if(t!==void 0)return t}if(he(t))return 0;if(O(t)||A(e))return 2;let n=e.normalize(`NFD`)[0];if(n!==void 0&&n!==e){let e=D[n];if(e!==void 0)return e}return e===` `?.3:pe.has(e)?1.5:fe.has(e)?1.2:de.has(e)?.4:me.has(e)?.5:e===`r`?.8:t>=65&&t<=90?1.2:1}var N=.6,P=!1;function F(e){return/mono|consol|menlo|courier|\bcode\b/i.test(e)}function ye(e){P=e}function I(e,t,n){let r=t*.15;if(P){let n=0;for(let t of e)n+=1;return n*t*N+r}let i=n>=600?.6:n>=500?.57:.54,a=0;for(let t of e)a+=M(t);return a*t*i+r}var L=1.3;function be(e,t,n){let r=e.split(`
3
+ `),i=t*L,a=0;for(let e of r){let r=I(e.replace(/<\/?(?:b|strong|i|em|u|s|del)\s*>/gi,``),t,n);r>a&&(a=r)}return{width:a,height:r.length*i,lines:r,lineHeight:i}}function xe(e){return Number.isFinite(e)?Number(e.toFixed(2)):0}function R(e,...t){let n=e[0]??``;for(let r=0;r<t.length;r++){let i=t[r];n+=String(typeof i==`number`?xe(i):i),n+=e[r+1]??``}return n}function Se(e){let t=e.startsWith(`"`)&&e.endsWith(`"`)?e.slice(1,-1):e;return V((t.length>=2&&t.startsWith("`")&&t.endsWith("`")?t.slice(1,-1):t).replace(/<br\s*\/?>/gi,`
4
4
  `).replace(/\\n/g,`
5
- `).replace(/<\/?(?:sub|sup|small|mark)\s*>/gi,``).replace(/\*\*(.+?)\*\*/g,`<b>$1</b>`).replace(/(?<!\*)\*([^\s*](?:[^*]*[^\s*])?)\*(?!\*)/g,`<i>$1</i>`).replace(/~~(.+?)~~/g,`<s>$1</s>`)}function be(e){return e.replace(/<\/?(?:b|strong|i|em|u|s|del)\s*>/gi,``)}function H(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function U(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}var W=/<(\/)?(?:(b|strong)|(i|em)|(u)|(s|del))\s*>/gi;function xe(e){let t=[],n=!1,r=!1,i=!1,a=!1,o=0;W.lastIndex=0;let s;for(;(s=W.exec(e))!==null;){s.index>o&&t.push({text:e.slice(o,s.index),bold:n,italic:r,underline:i,strikethrough:a}),o=s.index+s[0].length;let c=!!s[1];s[2]?n=!c:s[3]?r=!c:s[4]?i=!c:s[5]&&(a=!c)}return o<e.length&&t.push({text:e.slice(o),bold:n,italic:r,underline:i,strikethrough:a}),t}var Se=/<\/?(?:b|strong|i|em|u|s|del)\s*>/i;function G(e){if(!Se.test(e))return H(e);let t=xe(e);return t.length===0?``:t.every(e=>!e.bold&&!e.italic&&!e.underline&&!e.strikethrough)?t.map(e=>H(e.text)).join(``):t.map(e=>{let t=H(e.text);if(!e.bold&&!e.italic&&!e.underline&&!e.strikethrough)return t;let n=[];e.bold&&n.push(`font-weight="bold"`),e.italic&&n.push(`font-style="italic"`);let r=[];return e.underline&&r.push(`underline`),e.strikethrough&&r.push(`line-through`),r.length&&n.push(`text-decoration="${r.join(` `)}"`),`<tspan ${n.join(` `)}>${t}</tspan>`}).join(``)}function K(e,t,n,r,i,a=.35){let o=e.split(`
6
- `);if(o.length===1)return V`<text x="${t}" y="${n}" ${i} dy="${r*a}">${G(e)}</text>`;let s=r*B,c=-((o.length-1)/2)*s+r*a;return V`<text x="${t}" y="${n}" ${i}>${o.map((e,n)=>V`<tspan x="${t}" dy="${n===0?c:s}">${G(e)}</tspan>`).join(``)}</text>`}function Ce(e,t,n,r,i,a,o,s,c){let l=r+o*2,u=i+o*2;return`${V`<rect x="${t-l/2}" y="${n-u/2}" `+V`width="${l}" height="${u}" ${c} />`}\n${K(e,t,n,a,s)}`}function q(e){let t=e.replace(/;\s*$/,``),n={};for(let e of t.split(`,`)){let t=e.indexOf(`:`);if(t>0){let r=e.slice(0,t).trim(),i=e.slice(t+1).trim();r&&i&&(n[r]=i)}}return n}function we(e,t){let n=e.match(/^classDef\s+([\w,-]+)\s+(.+)$/);if(!n)return!1;let r=q(n[2]);for(let e of n[1].split(`,`)){let n=e.trim();n&&t.classDefs.set(n,r)}return!0}function Te(e,t){let n=e.match(/^class\s+([\w-]+(?:\s*,\s*[\w-]+)*)\s+([\w-]+)\s*;?\s*$/);if(!n)return!1;let r=n[2];for(let e of n[1].split(`,`))t.classAssignments.set(e.trim(),r);return!0}function Ee(e,t){let n=e.match(/^cssClass\s+"([^"]*)"\s+([\w-]+)\s*;?\s*$/);if(!n)return!1;let r=n[2];for(let e of n[1].split(`,`)){let n=e.trim();n&&t.classAssignments.set(n,r)}return!0}function De(e,t){let n=e.match(/^style\s+([\w,-]+)\s+(.+)$/);if(!n)return!1;let r=q(n[2]);for(let e of n[1].split(`,`).map(e=>e.trim()))t.nodeStyles.set(e,{...t.nodeStyles.get(e),...r});return!0}function Oe(e){let t=e.match(/^(.+?):::([\w][\w-]*)$/);return t?{id:t[1],className:t[2]}:{id:e}}function ke(e,t){let n,r=t.classDefs.get(`default`);r&&(n={...r});let i=t.classAssignments.get(e);if(i){let e=t.classDefs.get(i);e&&(n=n?{...n,...e}:{...e})}let a=t.nodeStyles.get(e);return a&&(n=n?{...n,...a}:{...a}),n}function Ae(e){if(e)return/^-?[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e)?e:void 0}var je={bg:`#FFFFFF`,fg:`#27272A`},J={text:100,textSec:60,textMuted:40,textFaint:25,line:50,arrow:85,nodeFill:3,nodeStroke:20,groupHeader:5,innerStroke:12,keyBadge:10},Me={"zinc-light":{bg:`#FFFFFF`,fg:`#27272A`},"zinc-dark":{bg:`#18181B`,fg:`#FAFAFA`},"tokyo-night":{bg:`#1a1b26`,fg:`#a9b1d6`,line:`#3d59a1`,accent:`#7aa2f7`,muted:`#565f89`},"tokyo-night-storm":{bg:`#24283b`,fg:`#a9b1d6`,line:`#3d59a1`,accent:`#7aa2f7`,muted:`#565f89`},"tokyo-night-light":{bg:`#d5d6db`,fg:`#343b58`,line:`#34548a`,accent:`#34548a`,muted:`#9699a3`},"catppuccin-mocha":{bg:`#1e1e2e`,fg:`#cdd6f4`,line:`#585b70`,accent:`#cba6f7`,muted:`#6c7086`},"catppuccin-latte":{bg:`#eff1f5`,fg:`#4c4f69`,line:`#9ca0b0`,accent:`#8839ef`,muted:`#9ca0b0`},nord:{bg:`#2e3440`,fg:`#d8dee9`,line:`#4c566a`,accent:`#88c0d0`,muted:`#616e88`},"nord-light":{bg:`#eceff4`,fg:`#2e3440`,line:`#aab1c0`,accent:`#5e81ac`,muted:`#7b88a1`},dracula:{bg:`#282a36`,fg:`#f8f8f2`,line:`#6272a4`,accent:`#bd93f9`,muted:`#6272a4`},"github-light":{bg:`#ffffff`,fg:`#1f2328`,line:`#d1d9e0`,accent:`#0969da`,muted:`#59636e`},"github-dark":{bg:`#0d1117`,fg:`#e6edf3`,line:`#3d444d`,accent:`#4493f8`,muted:`#9198a1`},"solarized-light":{bg:`#fdf6e3`,fg:`#657b83`,line:`#93a1a1`,accent:`#268bd2`,muted:`#93a1a1`},"solarized-dark":{bg:`#002b36`,fg:`#839496`,line:`#586e75`,accent:`#268bd2`,muted:`#586e75`},"one-dark":{bg:`#282c34`,fg:`#abb2bf`,line:`#4b5263`,accent:`#c678dd`,muted:`#5c6370`}};function Ne(e){let t=e.colors??{},n=e.type===`dark`,r=t=>e.tokenColors?.find(e=>Array.isArray(e.scope)?e.scope.includes(t):e.scope===t)?.settings?.foreground;return{bg:t[`editor.background`]??(n?`#1e1e1e`:`#ffffff`),fg:t[`editor.foreground`]??(n?`#d4d4d4`:`#333333`),line:t[`editorLineNumber.foreground`]??void 0,accent:t.focusBorder??r(`keyword`)??void 0,muted:r(`comment`)??t[`editorLineNumber.foreground`]??void 0,surface:t[`editor.selectionBackground`]??void 0,border:t[`editorWidget.border`]??void 0}}var Pe=/[<>{};]/;function Fe(e){let t=e.trim();if(!t.startsWith(`var(`)||!t.endsWith(`)`)||Pe.test(t))return!1;let n=0;for(let e of t)if(e===`(`)n++;else if(e===`)`&&(n--,n<0))return!1;return n===0}var Ie=new Set([`sans-serif`,`serif`,`monospace`,`system-ui`,`ui-sans-serif`,`ui-serif`,`ui-monospace`,`ui-rounded`,`cursive`,`fantasy`,`math`,`emoji`,`fangsong`]);function Le(e){let t=e.trim();return t.includes(`,`)?!0:Ie.has(t.toLowerCase())}function Y(e){return e===void 0||e.trim()===``?`<style>`:`<style nonce="${U(e)}">`}function X(e,t,n){let r=Fe(e),i=r?e.trim():e.replace(/[<>{};'"]/g,``),a=r||Le(e)?[]:[`@import url('https://fonts.googleapis.com/css2?family=${encodeURIComponent(i)}:wght@400;500;600;700&amp;display=swap');`],o=`
5
+ `).replace(/<\/?(?:sub|sup|small|mark)\s*>/gi,``).replace(/\*\*(.+?)\*\*/g,`<b>$1</b>`).replace(/(?<!\*)\*([^\s*](?:[^*]*[^\s*])?)\*(?!\*)/g,`<i>$1</i>`).replace(/~~(.+?)~~/g,`<s>$1</s>`))}var Ce=1114111,z={quot:`"`,amp:`&`,lt:`<`,gt:`>`,apos:`'`,nbsp:`\xA0`};function B(e){return Number.isInteger(e)&&e>0&&e<=Ce&&!(e>=55296&&e<=57343)?String.fromCodePoint(e):void 0}function V(e){return e.replace(/#([xX][0-9a-fA-F]+|[0-9]+|[a-zA-Z]+);/g,(e,t)=>/^x/i.test(t)?B(parseInt(t.slice(1),16))??e:/^[0-9]+$/.test(t)?B(parseInt(t,10))??e:z[t.toLowerCase()]??e)}function we(e){return e.replace(/&(#[xX][0-9a-fA-F]+|#[0-9]+|quot|amp|lt|gt|apos);/g,(e,t)=>/^#x/i.test(t)?B(parseInt(t.slice(2),16))??e:t.startsWith(`#`)?B(parseInt(t.slice(1),10))??e:z[t]??e)}function Te(e){return e.replace(/<\/?(?:b|strong|i|em|u|s|del)\s*>/gi,``)}function H(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function U(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}var W=/<(\/)?(?:(b|strong)|(i|em)|(u)|(s|del))\s*>/gi;function Ee(e){let t=[],n=!1,r=!1,i=!1,a=!1,o=0;W.lastIndex=0;let s;for(;(s=W.exec(e))!==null;){s.index>o&&t.push({text:e.slice(o,s.index),bold:n,italic:r,underline:i,strikethrough:a}),o=s.index+s[0].length;let c=!!s[1];s[2]?n=!c:s[3]?r=!c:s[4]?i=!c:s[5]&&(a=!c)}return o<e.length&&t.push({text:e.slice(o),bold:n,italic:r,underline:i,strikethrough:a}),t}var De=/<\/?(?:b|strong|i|em|u|s|del)\s*>/i;function G(e){if(!De.test(e))return H(e);let t=Ee(e);return t.length===0?``:t.every(e=>!e.bold&&!e.italic&&!e.underline&&!e.strikethrough)?t.map(e=>H(e.text)).join(``):t.map(e=>{let t=H(e.text);if(!e.bold&&!e.italic&&!e.underline&&!e.strikethrough)return t;let n=[];e.bold&&n.push(`font-weight="bold"`),e.italic&&n.push(`font-style="italic"`);let r=[];return e.underline&&r.push(`underline`),e.strikethrough&&r.push(`line-through`),r.length&&n.push(`text-decoration="${r.join(` `)}"`),`<tspan ${n.join(` `)}>${t}</tspan>`}).join(``)}function K(e,t,n,r,i,a=.35){let o=e.split(`
6
+ `);if(o.length===1)return R`<text x="${t}" y="${n}" ${i} dy="${r*a}">${G(e)}</text>`;let s=r*L,c=-((o.length-1)/2)*s+r*a;return R`<text x="${t}" y="${n}" ${i}>${o.map((e,n)=>R`<tspan x="${t}" dy="${n===0?c:s}">${G(e)}</tspan>`).join(``)}</text>`}function Oe(e,t,n,r,i,a,o,s,c){let l=r+o*2,u=i+o*2;return`${R`<rect x="${t-l/2}" y="${n-u/2}" `+R`width="${l}" height="${u}" ${c} />`}\n${K(e,t,n,a,s)}`}function q(e){let t=e.replace(/;\s*$/,``),n={};for(let e of t.split(`,`)){let t=e.indexOf(`:`);if(t>0){let r=e.slice(0,t).trim(),i=e.slice(t+1).trim();r&&i&&(n[r]=i)}}return n}function ke(e,t){let n=e.match(/^classDef\s+([\w,-]+)\s+(.+)$/);if(!n)return!1;let r=q(n[2]);for(let e of n[1].split(`,`)){let n=e.trim();n&&t.classDefs.set(n,r)}return!0}function Ae(e,t){let n=e.match(/^class\s+([\w-]+(?:\s*,\s*[\w-]+)*)\s+([\w-]+)\s*;?\s*$/);if(!n)return!1;let r=n[2];for(let e of n[1].split(`,`))t.classAssignments.set(e.trim(),r);return!0}function je(e,t){let n=e.match(/^cssClass\s+"([^"]*)"\s+([\w-]+)\s*;?\s*$/);if(!n)return!1;let r=n[2];for(let e of n[1].split(`,`)){let n=e.trim();n&&t.classAssignments.set(n,r)}return!0}function Me(e,t){let n=e.match(/^style\s+([\w,-]+)\s+(.+)$/);if(!n)return!1;let r=q(n[2]);for(let e of n[1].split(`,`).map(e=>e.trim()))t.nodeStyles.set(e,{...t.nodeStyles.get(e),...r});return!0}function Ne(e){let t=e.match(/^(.+?):::([\w][\w-]*)$/);return t?{id:t[1],className:t[2]}:{id:e}}function Pe(e,t){let n,r=t.classDefs.get(`default`);r&&(n={...r});let i=t.classAssignments.get(e);if(i){let e=t.classDefs.get(i);e&&(n=n?{...n,...e}:{...e})}let a=t.nodeStyles.get(e);return a&&(n=n?{...n,...a}:{...a}),n}function Fe(e){if(e)return/^-?[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e)?e:void 0}var Ie={bg:`#FFFFFF`,fg:`#27272A`},J={text:100,textSec:60,textMuted:40,textFaint:25,line:50,arrow:85,nodeFill:3,nodeStroke:20,groupHeader:5,innerStroke:12,keyBadge:10},Le={"zinc-light":{bg:`#FFFFFF`,fg:`#27272A`},"zinc-dark":{bg:`#18181B`,fg:`#FAFAFA`},"tokyo-night":{bg:`#1a1b26`,fg:`#a9b1d6`,line:`#3d59a1`,accent:`#7aa2f7`,muted:`#565f89`},"tokyo-night-storm":{bg:`#24283b`,fg:`#a9b1d6`,line:`#3d59a1`,accent:`#7aa2f7`,muted:`#565f89`},"tokyo-night-light":{bg:`#d5d6db`,fg:`#343b58`,line:`#34548a`,accent:`#34548a`,muted:`#9699a3`},"catppuccin-mocha":{bg:`#1e1e2e`,fg:`#cdd6f4`,line:`#585b70`,accent:`#cba6f7`,muted:`#6c7086`},"catppuccin-latte":{bg:`#eff1f5`,fg:`#4c4f69`,line:`#9ca0b0`,accent:`#8839ef`,muted:`#9ca0b0`},nord:{bg:`#2e3440`,fg:`#d8dee9`,line:`#4c566a`,accent:`#88c0d0`,muted:`#616e88`},"nord-light":{bg:`#eceff4`,fg:`#2e3440`,line:`#aab1c0`,accent:`#5e81ac`,muted:`#7b88a1`},dracula:{bg:`#282a36`,fg:`#f8f8f2`,line:`#6272a4`,accent:`#bd93f9`,muted:`#6272a4`},"github-light":{bg:`#ffffff`,fg:`#1f2328`,line:`#d1d9e0`,accent:`#0969da`,muted:`#59636e`},"github-dark":{bg:`#0d1117`,fg:`#e6edf3`,line:`#3d444d`,accent:`#4493f8`,muted:`#9198a1`},"solarized-light":{bg:`#fdf6e3`,fg:`#657b83`,line:`#93a1a1`,accent:`#268bd2`,muted:`#93a1a1`},"solarized-dark":{bg:`#002b36`,fg:`#839496`,line:`#586e75`,accent:`#268bd2`,muted:`#586e75`},"one-dark":{bg:`#282c34`,fg:`#abb2bf`,line:`#4b5263`,accent:`#c678dd`,muted:`#5c6370`}};function Re(e){let t=e.colors??{},n=e.type===`dark`,r=t=>e.tokenColors?.find(e=>Array.isArray(e.scope)?e.scope.includes(t):e.scope===t)?.settings?.foreground;return{bg:t[`editor.background`]??(n?`#1e1e1e`:`#ffffff`),fg:t[`editor.foreground`]??(n?`#d4d4d4`:`#333333`),line:t[`editorLineNumber.foreground`]??void 0,accent:t.focusBorder??r(`keyword`)??void 0,muted:r(`comment`)??t[`editorLineNumber.foreground`]??void 0,surface:t[`editor.selectionBackground`]??void 0,border:t[`editorWidget.border`]??void 0}}var Y=/[<>{};]/;function ze(e){let t=e.trim();if(!t.startsWith(`var(`)||!t.endsWith(`)`)||Y.test(t))return!1;let n=0;for(let e of t)if(e===`(`)n++;else if(e===`)`&&(n--,n<0))return!1;return n===0}var Be=new Set([`sans-serif`,`serif`,`monospace`,`system-ui`,`ui-sans-serif`,`ui-serif`,`ui-monospace`,`ui-rounded`,`cursive`,`fantasy`,`math`,`emoji`,`fangsong`]);function Ve(e){let t=e.trim();return t.includes(`,`)?!0:Be.has(t.toLowerCase())}function X(e){return e===void 0||e.trim()===``?`<style>`:`<style nonce="${U(e)}">`}function He(e,t,n){let r=ze(e),i=r?e.trim():e.replace(/[<>{};'"]/g,``),a=r||Ve(e)?[]:[`@import url('https://fonts.googleapis.com/css2?family=${encodeURIComponent(i)}:wght@400;500;600;700&amp;display=swap');`],o=`
7
7
  /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
8
8
  --_text: var(--fg);
9
9
  --_text-sec: var(--muted, color-mix(in srgb, var(--fg) ${J.textSec}%, var(--bg)));
@@ -16,7 +16,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,
16
16
  --_group-fill: var(--bg);
17
17
  --_group-hdr: color-mix(in srgb, var(--fg) ${J.groupHeader}%, var(--bg));
18
18
  --_inner-stroke: color-mix(in srgb, var(--fg) ${J.innerStroke}%, var(--bg));
19
- --_key-badge: color-mix(in srgb, var(--fg) ${J.keyBadge}%, var(--bg));`;return[Y(n),...a.length>0?[` ${a.join(`
19
+ --_key-badge: color-mix(in srgb, var(--fg) ${J.keyBadge}%, var(--bg));`;return[X(n),...a.length>0?[` ${a.join(`
20
20
  `)}`]:[],...t?[` ${t.faceCss}`]:[],` text { font-family: ${r?i:`'${i}'`}, system-ui, sans-serif; }`,...t?[` .mono { font-family: '${t.family}', 'SF Mono', 'Fira Code', ui-monospace, monospace; }`]:[],` svg {${o}`,` }`,`</style>`].join(`
21
- `)}function Re(e,t,n){return(.299*e+.587*t+.114*n)/255}function ze(e,t){if(!e)return t;let n=c(e);return n?Re(...n)>.5?`#000000`:`#FFFFFF`:t}var Z=0;function Q(){return Z+=1,`zm-title-${Z}`}function Be(){Z=0}function $(e,t){return`${[`--bg:${e.bg}`,`--fg:${e.fg}`,e.line?`--line:${e.line}`:``,e.accent?`--accent:${e.accent}`:``,e.muted?`--muted:${e.muted}`:``,e.surface?`--surface:${e.surface}`:``,e.border?`--border:${e.border}`:``].filter(Boolean).join(`;`)}${t?``:`;background:var(--bg)`}`}function Ve(e,t,n,r,i,a,o,s=!0){let c=s?` style="${$(n,r)}"`:``,l=``,u=``;if(o){if(i){let e=Q();l=` aria-labelledby="${e}"`,u=`\n <title id="${e}">${H(i)}</title>`}}else if(a)l=` aria-hidden="true"`;else if(l=` role="img"`,i){let e=Q();l+=` aria-labelledby="${e}"`,u=`\n <title id="${e}">${H(i)}</title>`}return V`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e} ${t}" `+V`width="${e}" height="${t}"${l}${c}>`+u}exports.DEFAULTS=je,exports.DIAGRAM_TYPES=re,exports.LINE_HEIGHT_RATIO=B,exports.MIX=J,exports.THEMES=Me,exports.__resetSvgTitleIdCounterForTests=Be,exports.applyClickStatement=e,exports.applyInitConfig=ce,exports.buildStyleBlock=X,exports.describeIgnored=le,exports.detectDiagramType=b,exports.escapeAttr=U,exports.escapeXml=H,exports.extractInitConfig=se,exports.f=V,exports.formatCssColor=m,exports.fromShikiTheme=Ne,exports.getCharWidth=F,exports.getReadableTextColor=ze,exports.hasMeasuredAdvance=ue,exports.isDirection=x,exports.isEdgeWithinOwnCluster=r,exports.isInitDirective=ae,exports.isMonospaceFont=R,exports.isWideChar=P,exports.measureMultilineText=_e,exports.measureTextWidth=z,exports.mixHexColors=te,exports.mixSrgb=f,exports.normalizeBrTags=ye,exports.parseCssColor=d,exports.parseHexColor=c,exports.parseHexRgba=l,exports.parseInitDirective=E,exports.parseStyleProps=q,exports.renderMultilineText=K,exports.renderMultilineTextWithBackground=Ce,exports.resolveNodeStyle=ke,exports.safeHref=t,exports.sanitizeClassName=Ae,exports.setMonospaceMetrics=ge,exports.splitClassShorthand=Oe,exports.splitStatements=y,exports.splitStatementsByLine=v,exports.stripFormattingTags=be,exports.styleOpenTag=Y,exports.svgOpenTag=Ve,exports.themeStyleDeclarations=$,exports.toDirection=S,exports.tryApplyClassAssignment=Te,exports.tryApplyClassDef=we,exports.tryApplyCssClass=Ee,exports.tryApplyStyleStatement=De,exports.withDirectionOverride=C,exports.withoutOwnClusterEdges=a;
21
+ `)}function Ue(e,t,n){return(.299*e+.587*t+.114*n)/255}function We(e,t){if(!e)return t;let n=c(e);return n?Ue(...n)>.5?`#000000`:`#FFFFFF`:t}var Z=0;function Ge(){return Z+=1,`zm-title-${Z}`}var Q=0;function Ke(){return Q+=1,`zm-desc-${Q}`}function qe(){Z=0,Q=0}function $(e,t){return`${[`--bg:${e.bg}`,`--fg:${e.fg}`,e.line?`--line:${e.line}`:``,e.accent?`--accent:${e.accent}`:``,e.muted?`--muted:${e.muted}`:``,e.surface?`--surface:${e.surface}`:``,e.border?`--border:${e.border}`:``].filter(Boolean).join(`;`)}${t?``:`;background:var(--bg)`}`}function Je(e,t,n,r,i,a,o,s=!0,c){let l=s?` style="${$(n,r)}"`:``,u=``,d=``,f=o||!a;if(!o&&a?u=` aria-hidden="true"`:o||(u=` role="img"`),f&&i){let e=Ge();u+=` aria-labelledby="${e}"`,d=`\n <title id="${e}">${H(i)}</title>`}if(f&&c){let e=Ke();u+=` aria-describedby="${e}"`,d+=`\n <desc id="${e}">${H(c)}</desc>`}return R`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e} ${t}" `+R`width="${e}" height="${t}"${u}${l}>`+d}exports.DEFAULTS=Ie,exports.DIAGRAM_TYPES=re,exports.LINE_HEIGHT_RATIO=L,exports.MIX=J,exports.THEMES=Le,exports.__resetSvgTitleIdCounterForTests=qe,exports.applyClickStatement=e,exports.applyInitConfig=ce,exports.buildStyleBlock=He,exports.decodeMermaidEntities=V,exports.decodeXmlEntitiesInLabel=we,exports.describeIgnored=le,exports.detectDiagramType=ie,exports.escapeAttr=U,exports.escapeXml=H,exports.extractInitConfig=se,exports.f=R,exports.formatCssColor=h,exports.fromShikiTheme=Re,exports.getCharWidth=M,exports.getReadableTextColor=We,exports.hasMeasuredAdvance=ue,exports.isDirection=b,exports.isEdgeWithinOwnCluster=r,exports.isInitDirective=ae,exports.isMonospaceFont=F,exports.isWideChar=j,exports.measureMultilineText=be,exports.measureTextWidth=I,exports.mixHexColors=ee,exports.mixSrgb=p,exports.normalizeBrTags=Se,exports.parseCssColor=f,exports.parseHexColor=c,exports.parseHexRgba=l,exports.parseInitDirective=E,exports.parseStyleProps=q,exports.renderMultilineText=K,exports.renderMultilineTextWithBackground=Oe,exports.resolveNodeStyle=Pe,exports.safeHref=t,exports.sanitizeClassName=Fe,exports.setMonospaceMetrics=ye,exports.splitClassShorthand=Ne,exports.splitStatements=y,exports.splitStatementsByLine=v,exports.stripFormattingTags=Te,exports.styleOpenTag=X,exports.svgOpenTag=Je,exports.themeStyleDeclarations=$,exports.toDirection=x,exports.tryApplyClassAssignment=Ae,exports.tryApplyClassDef=ke,exports.tryApplyCssClass=je,exports.tryApplyStyleStatement=Me,exports.withDirectionOverride=S,exports.withoutOwnClusterEdges=a;
22
22
  //# sourceMappingURL=index.cjs.map