@zombie-mermaid/svg-renderer 5.3.0 → 5.4.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 +93 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +747 -0
- package/dist/index.d.ts +747 -0
- package/dist/index.js +5716 -0
- package/dist/index.js.map +1 -0
- package/package.json +5 -5
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@zombie-mermaid/core"),t=require("@zombie-mermaid/mermaid-parser"),n=require("entities");function r(t){return e.f`M ${t.x} ${t.y}`}function i(t){return r(t[0])+t.slice(1).map(t=>e.f` L ${t.x} ${t.y}`).join(``)}function a(t){if(t.length<3)return i(t);let n=t[t.length-1],a=[r(t[0])],o=(t,n,r)=>e.f` C ${(2*t.x+n.x)/3} ${(2*t.y+n.y)/3},`+e.f` ${(t.x+2*n.x)/3} ${(t.y+2*n.y)/3},`+e.f` ${(t.x+4*n.x+r.x)/6} ${(t.y+4*n.y+r.y)/6}`;a.push(e.f` L ${(5*t[0].x+t[1].x)/6}`+e.f` ${(5*t[0].y+t[1].y)/6}`);for(let e=2;e<t.length;e++)a.push(o(t[e-2],t[e-1],t[e]));return a.push(o(t[t.length-2],n,n)),a.push(e.f` L ${n.x} ${n.y}`),a.join(``)}function o(t){if(t.length<3)return i(t);let n=[r(t[0])];for(let r=1;r<t.length-1;r++){let i=t[r-1],a=t[r],o=t[r+1],s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.hypot(o.x-a.x,o.y-a.y);if(s===0||c===0){n.push(e.f` L ${a.x} ${a.y}`);continue}let l=Math.min(12,s/2,c/2),u=a.x-(a.x-i.x)/s*l,d=a.y-(a.y-i.y)/s*l,f=a.x+(o.x-a.x)/c*l,p=a.y+(o.y-a.y)/c*l;n.push(e.f` L ${u} ${d}`),n.push(e.f` Q ${a.x} ${a.y}, ${f} ${p}`)}let a=t[t.length-1];return n.push(e.f` L ${a.x} ${a.y}`),n.join(``)}function s(t,n){let i=[r(t[0])],a=t.length-1;for(let r=0;r<a;r++){let o=t[r],s=t[r+1];if(r===a-1){i.push(e.f` L ${s.x} ${s.y}`);break}if(n===`before`)i.push(e.f` L ${o.x} ${s.y} L ${s.x} ${s.y}`);else if(n===`after`)i.push(e.f` L ${s.x} ${o.y} L ${s.x} ${s.y}`);else{let t=(o.y+s.y)/2;i.push(e.f` L ${o.x} ${t} L ${s.x} ${t} L ${s.x} ${s.y}`)}}return i.join(``)}function c(e,t=`linear`){if(e.length===0)return``;if(e.length===1)return r(e[0]);switch(t){case`basis`:return a(e);case`natural`:return o(e);case`step`:return s(e,`mid`);case`stepBefore`:return s(e,`before`);case`stepAfter`:return s(e,`after`);default:return i(e)}}function l(e){let t=e?.worker?.worker;return typeof t==`object`&&!!t&&`dispatcher`in t}var u=null,d=null,f=null,p=class extends Error{constructor(){super("zombie-mermaid: rendering a flowchart, state, class, ER or architecture diagram needs the optional peer dependency \"elkjs\". Install it (npm i elkjs) and call registerElk(ELK) once at startup with `import ELK from 'elkjs/lib/elk.bundled.js'`. Sequence, pie, xychart, C4 and ASCII output do not need it. A flowchart can also pass `layout: 'simple'` to skip elkjs."),this.name=`ElkNotRegisteredError`}};function m(e){u=e,d=null,f=null}function h(){let e=globalThis.process;if(!e?.versions?.node||typeof e.getBuiltinModule!=`function`)return null;let t=e.getBuiltinModule(`node:module`);if(!t)return null;let n=[`elkjs`,`lib`,`elk.bundled.js`].join(`/`),r=[typeof __filename==`string`?__filename:{}.url,new URL(`file://${g(e)}/`).href];for(let e of r)try{let r=t.createRequire(e)(n),i=typeof r==`function`?r:r.default;if(typeof i==`function`)return i}catch{}return null}function g(e){let t=e.cwd;return typeof t==`function`?t.call(e):`/`}var _=20;function v(e=_){if(!Number.isInteger(e)||e<1)throw Error(`createLayoutCache: maxSize must be a positive integer, got ${e}`);return{map:new Map,maxSize:e}}function y(e){if(Array.isArray(e))return`[${e.map(y).join(`,`)}]`;if(typeof e==`object`&&e){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${y(t[e])}`).join(`,`)}}`}return JSON.stringify(e)}function b(){if(d&&f)return f;let e=u??=h();if(!e)throw new p;let t=[],n=globalThis.setTimeout;globalThis.setTimeout=(e,r)=>r===0?(t.push(e),0):n(e,r);let r=globalThis,i=Object.getOwnPropertyDescriptor(r,`self`),a=`self`in r&&r.document===void 0&&i?.configurable!==!1;a&&Object.defineProperty(r,"self",{value:void 0,configurable:!0,writable:!0});let o;try{o=new e}finally{a&&(i?Object.defineProperty(r,"self",i):delete r.self),globalThis.setTimeout=n}if(!l(o))throw Error(`zombie-mermaid: registerElk() needs the ELK class from 'elkjs/lib/elk.bundled.js' (or 'elkjs/lib/main.js'), whose synchronous worker this renderer drives directly.`);return d=o,t.forEach(e=>e()),f=d.worker.worker,f}function x(e,t){let n=t,r=n?y(e):void 0;if(n&&r!==void 0){let e=n.map.get(r);if(e)return n.map.delete(r),n.map.set(r,e),e}let i=b(),a=e=>{let t,n,r=i.onmessage;return i.onmessage=e=>{e.data.error?n=e.data.error:t=e.data.data},i.dispatcher.saveDispatch({data:{id:0,cmd:`layout`,graph:e}}),i.onmessage=r,{result:t,error:n}},{result:o,error:s}=a(e);if(String(s?.message??s).includes(`Invalid hitboxes`)&&({result:o,error:s}=a({...e,layoutOptions:{...e.layoutOptions,"elk.layered.compaction.postCompaction.strategy":`NONE`}})),s)throw s;if(!o)throw Error(`ELK layout did not return synchronously`);if(n&&r!==void 0&&(n.map.set(r,o),n.map.size>n.maxSize)){let e=n.map.keys().next().value;e!==void 0&&n.map.delete(e)}return o}var S=`JetBrains Mono NL`,C=`@font-face {
|
|
2
|
+
font-family: 'JetBrains Mono NL';
|
|
3
|
+
font-style: normal;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
font-display: swap;
|
|
6
|
+
src: url(data:font/woff2;base64,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) format('woff2');
|
|
7
|
+
unicode-range: U+0020-007E, U+00A0-00FF;
|
|
8
|
+
}`;function w(t,n,r){return(0,e.measureTextWidth)(t,n,r)}function T(e,t){return e.length*t*.6}var E=`'JetBrains Mono'`,D=`${E}, 'SF Mono', 'Fira Code', ui-monospace, monospace`,O={nodeLabel:13,edgeLabel:11,groupHeader:12};function k(e){return{nodeLabel:e?.nodeLabel??O.nodeLabel,edgeLabel:e?.edgeLabel??O.edgeLabel,groupHeader:e?.groupHeader??O.groupHeader}}var A={nodeLabel:500,edgeLabel:400,groupHeader:600},ee=12,j={horizontal:20,vertical:10,diamondExtra:24},M={outerBox:1,innerBox:.75,connector:1},N=`0.35em`,P={width:8,height:5};function F(t,n,r){return(0,e.buildStyleBlock)(t,n?{family:S,faceCss:C}:!1,r)}var I={font:`Inter`,padding:40,nodeSpacing:28,layerSpacing:48,mergeEdges:!0,thoroughness:3,fontSizes:O};function L(e,t){return R(e.edges,t??e.nodes.keys())}function R(e,t){let n=new Map;e.forEach((e,t)=>{if(e.source===e.target)return;let r=n.get(e.source);r?r.push(t):n.set(e.source,[t])});let r=new Set,i=new Set,a=new Set;for(let o of t){if(i.has(o))continue;let t=[{node:o,next:0}];for(i.add(o),a.add(o);t.length>0;){let o=t[t.length-1],s=n.get(o.node)??[];if(o.next>=s.length){a.delete(o.node),t.pop();continue}let c=s[o.next++],l=e[c].target;a.has(l)?r.add(c):i.has(l)||(i.add(l),a.add(l),t.push({node:l,next:0}))}}return r}var z={flowchart:`DOWN`,state:`DOWN`,class:`DOWN`,er:`DOWN`,c4:`DOWN`};function B(e,t){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`BT`:return`UP`;case`TD`:case`TB`:return`DOWN`;default:return t}}function te(e){let t=typeof e==`number`?{top:e,left:e,bottom:e,right:e}:e;return`[top=${t.top},left=${t.left},bottom=${t.bottom},right=${t.right}]`}function ne(e){return{"elk.algorithm":`layered`,"elk.direction":e.direction,"elk.spacing.nodeNode":String(e.nodeSpacing),"elk.layered.spacing.nodeNodeBetweenLayers":String(e.layerSpacing),"elk.padding":te(e.padding),"elk.edgeRouting":`ORTHOGONAL`}}function re(e,t,n){let r={id:e,width:t.width,height:t.height};return n!==void 0&&(r.labels=[{text:n}]),r}var ie={"elk.edgeLabels.inline":`true`,"elk.edgeLabels.placement":`CENTER`};function ae(t,n){let r=(0,e.measureMultilineText)(t,n.fontSize,A.edgeLabel),i={text:t,width:r.width+8,height:r.height+6};return n.layoutOptions&&(i.layoutOptions={...n.layoutOptions}),i}function oe(e){let t={id:e.id,sources:[e.source],targets:[e.target]};return e.label&&(t.labels=[ae(e.label,e.labelStyle)]),t}var se={"state-start":`FIRST`},ce={"elk.layered.cycleBreaking.strategy":`MODEL_ORDER`,"elk.layered.compaction.postCompaction.strategy":`NONE`};function le(e){for(let t of e.nodes.values())if(t.shape===`state-start`||t.shape===`state-end`)return!0;return!1}var V={top:44,left:16,bottom:16,right:16},ue={top:16,left:16,bottom:16,right:16},de=new WeakMap;function fe(e,t){let n=de.get(e);return n||(n=le(e)||ye(e.subgraphs)?new Set:L(e,t?.walkOrder),de.set(e,n)),n}function pe(e,t){for(let n=0;n<e.edges.length;n++){let r=e.edges[n];if(t.has(r.source)||t.has(r.target))return n}return 1/0}function me(e){return B(e,z.flowchart)}function he(e){return{...ne(e),"elk.spacing.edgeEdge":`12`,"elk.layered.spacing.edgeEdgeBetweenLayers":`12`,"elk.layered.spacing.edgeNodeBetweenLayers":`12`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`,"elk.contentAlignment":`H_CENTER V_CENTER`}}function ge(e){return{fontSize:e.fontSizes.edgeLabel,layoutOptions:ie}}function _e(t,n,r,i){let a=(0,e.measureMultilineText)(n,i,A.nodeLabel),o=a.width+j.horizontal*2,s=a.height+j.vertical*2;if(r===`diamond`){let e=Math.max(o,s)+j.diamondExtra;o=e,s=e}if(r===`circle`||r===`doublecircle`){let e=Math.ceil(Math.sqrt(o*o+s*s))+8;o=r===`doublecircle`?e+12:e,s=o}return r===`hexagon`&&(o+=j.horizontal),(r===`trapezoid`||r===`trapezoid-alt`||r===`parallelogram`||r===`parallelogram-alt`)&&(o+=j.horizontal),r===`asymmetric`&&(o+=12),r===`cylinder`&&(s+=14),r===`state-start`||r===`state-end`||n===``&&r===`diamond`?{width:28,height:28}:n===``&&r===`fork-join`?{width:70,height:10}:(o=Math.max(o,60),s=Math.max(s,36),{width:o,height:s})}var ve=` root`;function ye(e){for(let t of e)if(t.direction!==void 0||ye(t.children))return!0;return!1}function be(e,t){for(let n of e.nodeIds)t.add(n);for(let n of e.children)be(n,t)}function xe(e){let t=new Map;function n(e,r){let i=[...r,e.id];t.set(e.id,i);for(let t of e.children)n(t,i)}for(let t of e)n(t,[]);return t}function Se(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;return n}function Ce(e,t,n){let r=t,i=new Set,a=new Set;for(let t of e.subgraphs)a.add(t.id),Te(t,i,a);let o=Ee(e.subgraphs),s=xe(e.subgraphs),c=e=>e?s.get(e)??[]:[],l=new Map;l.set(null,[]);let u=[];for(let t=0;t<e.edges.length;t++){let n=e.edges[t],r=o.get(n.source),i=o.get(n.target);if(r&&r===i){let e=l.get(r)??[];l.set(r,e),e.push({index:t,edge:n})}else!r&&!i?l.get(null).push({index:t,edge:n}):u.push({index:t,edge:n,srcChain:c(r),tgtChain:c(i)})}let d=ye(e.subgraphs),f=[],p=[],m={...he({direction:me(e.direction),nodeSpacing:r.nodeSpacing,layerSpacing:r.layerSpacing,padding:r.padding}),"elk.layered.thoroughness":String(I.thoroughness),"elk.layered.highDegreeNodes.treatment":`true`,"elk.layered.highDegreeNodes.threshold":`8`,"elk.layered.compaction.postCompaction.strategy":e.subgraphs.length===0&&!n?`NONE`:`LEFT_RIGHT_CONSTRAINT_LOCKING`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,...n?.forceNodeOrder?{"elk.layered.crossingMinimization.forceNodeModelOrder":`true`}:{},...le(e)?ce:{},"elk.layered.wrapping.strategy":`OFF`,"elk.hierarchyHandling":d?`SEPARATE`:`INCLUDE_CHILDREN`},h=new Map,g=new Map;function _(e,t){let n=h.get(e)??new Set;h.set(e,n),n.add(t)}function v(e,t){let n=g.get(e)??[];g.set(e,n),n.push(t)}if(d)for(let{index:e,edge:t,srcChain:n,tgtChain:i}of u){let a=Se(n,i),o=t.source;if(n.length>a){for(let r=n.length-1;r>=a;r--){let i=n[r],a=`${i}_out_${e}`;_(i,a);let o=r===n.length-1?t.source:`${n[r+1]}_out_${e}`;v(i,{id:`e${e}_s${r}`,sources:[o],targets:[a]})}o=`${n[a]}_out_${e}`}let s=t.target;if(i.length>a){for(let n=a;n<=i.length-1;n++){let r=i[n],a=`${r}_in_${e}`;_(r,a);let o=n===i.length-1?t.target:`${i[n+1]}_in_${e}`;v(r,{id:`e${e}_t${n}`,sources:[a],targets:[o]})}s=`${i[a]}_in_${e}`}v(a>0?n[a-1]:ve,oe({id:`e${e}`,source:o,target:s,label:t.label,labelStyle:ge(r)}))}for(let[t,o]of e.nodes)if(!i.has(t)&&!a.has(t)){let i=_e(t,o.label,o.shape,r.fontSizes.nodeLabel),a=n?.fixedWidths?.get(t);a!==void 0&&(i.width=a);let s=re(t,i,o.label),c=le(e)?se[o.shape]:void 0;c!==void 0&&(s.layoutOptions={"elk.layered.layering.layerConstraint":c}),f.push(s)}let y=le(e),b=f.length,x=y?e.subgraphs:[...e.subgraphs].reverse();for(let t of x)f.push(we(t,e,r,l,h,g,e.direction));if(y&&e.subgraphs.length>0){let t=f.map((t,n)=>{if(n<b)return pe(e,new Set([t.id]));let r=e.subgraphs[n-b],i=pe(e,new Set([r.id]));if(i!==1/0)return i;let a=new Set;return be(r,a),pe(e,a)}),n=f.map((e,t)=>t).sort((e,n)=>t[e]-t[n]||e-n).map(e=>f[e]);f.splice(0,f.length,...n)}let S=fe(e,n);for(let{index:e,edge:t}of l.get(null)){if(t.source===t.target||n?.detachedEdges?.has(e))continue;let i=oe({id:`e${e}`,source:S.has(e)?t.target:t.source,target:S.has(e)?t.source:t.target,label:t.label,labelStyle:ge(r)});n?.looseEdges?.has(e)&&(i.layoutOptions={...i.layoutOptions,"elk.layered.priority.straightness":`0`}),p.push(i)}if(d)for(let e of g.get(ve)??[])p.push(e);else for(let{index:e,edge:t}of u)p.push(oe({id:`e${e}`,source:S.has(e)?t.target:t.source,target:S.has(e)?t.source:t.target,label:t.label,labelStyle:ge(r)}));return{id:`root`,layoutOptions:m,children:f,edges:p}}function we(t,n,r,i,a,o,s){let c=t.direction!==void 0&&(0,e.subgraphDirectionIsHonored)(t,n)?t.direction:s,l=he({direction:me(c),nodeSpacing:r.nodeSpacing,layerSpacing:r.layerSpacing,padding:t.region?ue:V}),u,d=a.get(t.id);d&&d.size>0&&(u=[...d].map(e=>({id:e})));let f=[];for(let e of t.nodeIds){let t=n.nodes.get(e);if(t){let n=_e(e,t.label,t.shape,r.fontSizes.nodeLabel);f.push(re(e,n,t.label))}}let p=t.children.some(e=>e.region)?t.children:[...t.children].reverse();for(let e of p)f.push(we(e,n,r,i,a,o,c));let m=[],h=i.get(t.id)??[],g=fe(n);for(let{index:e,edge:t}of h)t.source!==t.target&&m.push(oe({id:`e${e}`,source:g.has(e)?t.target:t.source,target:g.has(e)?t.source:t.target,label:t.label,labelStyle:ge(r)}));for(let e of o.get(t.id)??[])m.push(e);return{id:t.id,layoutOptions:l,labels:t.label?[{text:t.label}]:void 0,ports:u,children:f,edges:m}}function Te(e,t,n){for(let n of e.nodeIds)t.add(n);for(let r of e.children)n.add(r.id),Te(r,t,n)}function Ee(e){let t=new Map;function n(e){for(let n of e.nodeIds)t.set(n,e.id);for(let t of e.children)n(t)}for(let t of e)n(t);return t}function De(e,t,n){if(e.length<2||t.shape===`rectangle`||t.shape===`rounded`||t.shape===`stadium`)return e;let r=[...e];if(t.shape===`diamond`){if(n)r[0]=Oe(e[0],e[1],t);else{let n=e.length-1;r[n]=Oe(e[n],e[n-1],t)}}return r}function Oe(e,t,n){let r=n.x+n.width/2,i=n.y+n.height/2,a={x:r,y:n.y},o={x:n.x+n.width,y:i},s={x:r,y:n.y+n.height},c={x:n.x,y:i},l=e.x-t.x,u=e.y-t.y;if(Math.abs(l)<Math.abs(u)){let t=e.x;return u>0?t<=r?Ae(t,c,a)??a:Ae(t,a,o)??a:t<=r?Ae(t,s,c)??s:Ae(t,o,s)??s}{let t=e.y;return l>0?t<=i?ke(t,a,c)??c:ke(t,c,s)??c:t<=i?ke(t,a,o)??o:ke(t,o,s)??o}}function ke(e,t,n){let r=n.y-t.y;if(Math.abs(r)<.001)return null;let i=(e-t.y)/r;return i<0||i>1?null:{x:t.x+i*(n.x-t.x),y:e}}function Ae(e,t,n){let r=n.x-t.x;if(Math.abs(r)<.001)return null;let i=(e-t.x)/r;return i<0||i>1?null:{x:e,y:t.y+i*(n.y-t.y)}}function je(e,t,n){if(e.length===0)return;let r=n===`LR`||n===`RL`,i=new Set;for(let e of t)i.add(`${e.source}:${e.target}`),i.add(`${e.target}:${e.source}`);let a=I.layerSpacing*.6,o=[...e].sort((e,t)=>r?e.x-t.x:e.y-t.y),s=[],c=[o[0]];for(let e=1;e<o.length;e++){let t=(r?o[e].x:o[e].y)-(r?o[e-1].x:o[e-1].y),n=c.some(t=>i.has(`${t.id}:${o[e].id}`));t<=a&&!n?c.push(o[e]):(s.push(c),c=[o[e]])}s.push(c);let l=new Map;for(let e of s){if(e.length<=1)continue;let t=e.map(e=>r?e.x:e.y),n=Math.min(...t),i=Math.max(...t);if(i-n<=1)continue;let a=(n+i)/2;for(let t of e){let e=a-(r?t.x:t.y);Math.abs(e)>.5&&(r?t.x=a:t.y=a,l.set(t.id,e))}}if(l.size!==0)for(let e of t){if(e.points.length<2)continue;let t=l.get(e.source),n=l.get(e.target);if(t!=null){let n=e.points[0];r?(n.x+=t,e.points.length>1&&e.points[1].x===n.x-t&&(e.points[1].x+=t)):(n.y+=t,e.points.length>1&&e.points[1].y===n.y-t&&(e.points[1].y+=t))}if(n!=null){let t=e.points[e.points.length-1];if(r){if(t.x+=n,e.points.length>1){let r=e.points[e.points.length-2];r.x===t.x-n&&(r.x+=n)}}else if(t.y+=n,e.points.length>1){let r=e.points[e.points.length-2];r.y===t.y-n&&(r.y+=n)}}}}var Me=.5;function Ne(e,t,n){for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=Math.min(i.x,a.x),s=Math.max(i.x,a.x),c=Math.min(i.y,a.y),l=Math.max(i.y,a.y);for(let e of t){if(n.has(e.id))continue;let t=e.x+Me,r=e.x+e.width-Me,i=e.y+Me,a=e.y+e.height-Me;if(!(t>=r||i>=a)&&o<r&&s>t&&c<a&&l>i)return!1}}return!0}function Pe(e,t,n){let r=[];for(let i of n)e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height&&(r.push(i),r.push(...Pe(e,t,i.children)));return r}function Fe(e,t,n,r,i){let a=i===`LR`,o=i===`RL`,s=i===`BT`,c=a||o,l=new Set(Pe(t,n,r).map(e=>e.id)),u=Pe(c?e:t,c?n:e,r).find(e=>!l.has(e.id));return u?a?u.x-12:o?u.x+u.width+12:s?u.y+u.height+12:u.y-12:e}var Ie=2;function Le(e,t,n,r,i){for(let a of e){if(t.has(a)||a.source===a.target)continue;let e=a.source===n?a.points[0]:a.target===n?a.points[a.points.length-1]:void 0;if(e&&Math.abs((i?e.x:e.y)-r)<=Ie)return!0}return!1}function Re(e,t,n,r){let i=new Map(t.map(e=>[e.id,e])),a=new Set,o=r===`LR`,s=r===`RL`,c=r===`BT`,l=o||s,u=new Map;for(let t of e){if(t.source===t.target)continue;let e=u.get(t.source)??[];u.set(t.source,e),e.push(t)}for(let[d,f]of u){if(f.length<2)continue;let u=f[0].style;if(f.some(e=>e.label||e.style!==u))continue;let p=i.get(d);if(!p)continue;let m=[];for(let e of f){let t=i.get(e.target);t&&(o?t.x>p.x+p.width:s?t.x+t.width<p.x:c?t.y+t.height<p.y:t.y>p.y+p.height)&&m.push({edge:e,node:t})}if(m.length<2)continue;let h=p.x+p.width/2,g=p.y+p.height/2;if(l){let i=o?p.x+p.width:p.x,s=g;if(Le(e,new Set(m.map(e=>e.edge)),d,i,!0))continue;let c=i+((o?Math.min(...m.map(e=>e.node.x)):Math.max(...m.map(e=>e.node.x+e.node.width)))-i)/2;c=Fe(c,h,g,n,r);let l=[];for(let{edge:e,node:n}of m){let r=o?n.x:n.x+n.width,a=n.y+n.height/2,u=[{x:i,y:s},{x:c,y:s},{x:c,y:a},{x:r,y:a}];Ne(u,t,new Set([d,n.id]))&&l.push({edge:e,points:u})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}else{let i=h,o=c?p.y:p.y+p.height;if(Le(e,new Set(m.map(e=>e.edge)),d,o,!1))continue;let s=o+((c?Math.max(...m.map(e=>e.node.y+e.node.height)):Math.min(...m.map(e=>e.node.y)))-o)/2;s=Fe(s,h,g,n,r);let l=[];for(let{edge:e,node:n}of m){let r=n.x+n.width/2,a=c?n.y+n.height:n.y,u=[{x:i,y:o},{x:i,y:s},{x:r,y:s},{x:r,y:a}];Ne(u,t,new Set([d,n.id]))&&l.push({edge:e,points:u})}if(l.length<2)continue;for(let{edge:e,points:t}of l)e.points=t,a.add(e)}}let d=new Map;for(let t of e){if(a.has(t)||t.source===t.target)continue;let e=d.get(t.target)??[];d.set(t.target,e),e.push(t)}for(let[a,u]of d){if(u.length<2)continue;let d=u[0].style;if(u.some(e=>e.label||e.style!==d))continue;let f=i.get(a);if(!f)continue;let p=[];for(let e of u){let t=i.get(e.source);t&&(o?t.x+t.width<f.x:s?t.x>f.x+f.width:c?t.y>f.y+f.height:t.y+t.height<f.y)&&p.push({edge:e,node:t})}if(p.length<2)continue;let m=f.x+f.width/2,h=f.y+f.height/2;if(l){let i=o?f.x:f.x+f.width,s=h;if(Le(e,new Set(p.map(e=>e.edge)),a,i,!0))continue;let c=o?Math.max(...p.map(e=>e.node.x+e.node.width)):Math.min(...p.map(e=>e.node.x)),l=c+(i-c)/2;l=Fe(l,m,h,n,r);let u=[];for(let{edge:e,node:n}of p){let r=o?n.x+n.width:n.x,c=n.y+n.height/2,d=[{x:r,y:c},{x:l,y:c},{x:l,y:s},{x:i,y:s}];Ne(d,t,new Set([n.id,a]))&&u.push({edge:e,points:d})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t}else{let i=m,o=c?f.y+f.height:f.y;if(Le(e,new Set(p.map(e=>e.edge)),a,o,!1))continue;let s=c?Math.min(...p.map(e=>e.node.y)):Math.max(...p.map(e=>e.node.y+e.node.height)),l=s+(o-s)/2;l=Fe(l,m,h,n,r);let u=[];for(let{edge:e,node:n}of p){let r=n.x+n.width/2,s=[{x:r,y:c?n.y:n.y+n.height},{x:r,y:l},{x:i,y:l},{x:i,y:o}];Ne(s,t,new Set([n.id,a]))&&u.push({edge:e,points:s})}if(u.length<2)continue;for(let{edge:e,points:t}of u)e.points=t}}}var ze=1.5,Be=.01;function Ve(e){let t=e.map(e=>({...e})),n=0;for(;n+3<t.length;){let[e,r,i,a]=[t[n],t[n+1],t[n+2],t[n+3]],o=Math.abs(e.x-r.x)<Be&&Math.abs(i.x-a.x)<Be&&Math.abs(r.y-i.y)<Be&&Math.abs(r.x-i.x)<=ze&&Math.abs(r.x-i.x)>=Be,s=Math.abs(e.y-r.y)<Be&&Math.abs(i.y-a.y)<Be&&Math.abs(r.x-i.x)<Be&&Math.abs(r.y-i.y)<=ze&&Math.abs(r.y-i.y)>=Be;if(o){let r=(e.x+a.x)/2;t.splice(n,4,{x:r,y:e.y},{x:r,y:a.y})}else if(s){let r=(e.y+a.y)/2;t.splice(n,4,{x:e.x,y:r},{x:a.x,y:r})}else n++}return t}function He(e,t=0,n=0){let r=[];if(!e.sections||e.sections.length===0)return r;let i=e.sections[0];if(r.push({x:i.startPoint.x+t,y:i.startPoint.y+n}),i.bendPoints)for(let e of i.bendPoints)r.push({x:e.x+t,y:e.y+n});return r.push({x:i.endPoint.x+t,y:i.endPoint.y+n}),r}function Ue(e,t=0,n=0){if(!e.labels||e.labels.length===0)return;let r=e.labels[0];if(r.x!=null&&r.y!=null)return{x:r.x+(r.width??0)/2+t,y:r.y+(r.height??0)/2+n}}var We=16,Ge=28,Ke=18,qe=28,Je=10;function Ye(e,t){let n=e.x+e.width,r=e.y+e.height/2,i=Math.min(qe,e.height*.6)/2,a=Ge+t*Ke,o=[];for(let e=0;e<=We;e++){let t=Math.PI*e/We;o.push({x:n+a*Math.sin(t),y:r-i*Math.cos(t)})}return{points:o,labelPosition:{x:n+a+Je,y:r}}}function Xe(e,t,n){let r=new Map;for(let i=0;i<e.edges.length;i++){let a=e.edges[i];if(a.source!==a.target)continue;let o=t.get(a.source);if(!o)continue;let s=r.get(o.id)??0;r.set(o.id,s+1);let{points:c,labelPosition:l}=Ye(o,s);n.push({source:a.source,target:a.target,label:a.label,style:a.style,hasArrowStart:a.hasArrowStart,hasArrowEnd:a.hasArrowEnd,points:c,labelPosition:a.label?l:void 0,inlineStyle:ct(i,e),id:a.id,animate:a.animate})}}function Ze(e){let t=[];for(let n of e)t.push({x:n.x,y:n.y,right:n.x+n.width,bottom:n.y+n.height}),t.push(...Ze(n.children));return t}function Qe(e,t,n=!1){let r=[],i=[],a=[],o=new Set;for(let e of t.subgraphs)st(e,o);$e(e,t,o,r,a,0,0);let s=Ze(a);nt(e,t,i,0,0,s.length>0?{leftX:Math.min(...s.map(e=>e.x))-20,rightX:Math.max(...s.map(e=>e.right))+20}:void 0),je(r,i,t.direction);let c=new Map(r.map(e=>[e.id,e]));Xe(t,c,i),n&&Re(i,r,a,t.direction);for(let e of i){e.points=Ve(e.points);let t=c.get(e.source),n=c.get(e.target);t&&(e.points=De(e.points,t,!0)),n&&(e.points=De(e.points,n,!1))}let l=e.width??800,u=e.height??600,d=P.width,f=I.padding;for(let e of i){for(let t of e.points)l=Math.max(l,t.x+d+f),u=Math.max(u,t.y+d+f);e.labelPosition&&(l=Math.max(l,e.labelPosition.x+60+f),u=Math.max(u,e.labelPosition.y+20+f))}return{width:l,height:u,nodes:r,edges:i,groups:a}}function $e(t,n,r,i,a,o,s){if(t.children)for(let c of t.children){let t=(c.x??0)+o,l=(c.y??0)+s,u=c.width??0,d=c.height??0;if(r.has(c.id)){let e=[];$e(c,n,r,i,e,t,l);let o=ot(n.subgraphs,c.id);a.push({id:c.id,label:o?.label??``,x:t,y:l,width:u,height:d,children:e,...o?.region?{region:!0}:{}})}else{let o=n.nodes.get(c.id);if(o){let r=(0,e.resolveNodeStyle)(c.id,n),a=n.classAssignments.get(c.id);i.push({id:c.id,label:o.label,shape:o.shape,x:t,y:l,width:u,height:d,inlineStyle:r,className:a,interaction:n.interactions.get(c.id)})}c.children&&c.children.length>0&&$e(c,n,r,i,a,t,l)}}}function et(e){let t=/^e(\d+)$/.exec(e);if(t)return{edgeIndex:parseInt(t[1],10),role:`bridge`};let n=/^e(\d+)_([st])(\d+)$/.exec(e);if(n)return{edgeIndex:parseInt(n[1],10),role:n[2]===`s`?`source`:`target`,level:parseInt(n[3],10)}}function tt(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}let n=t/2;for(let t=1;t<e.length;t++){let r=e[t].x-e[t-1].x,i=e[t].y-e[t-1].y,a=Math.sqrt(r*r+i*i);if(n<=a){let o=n/a;return{x:e[t-1].x+o*r,y:e[t-1].y+o*i}}n-=a}return e[e.length-1]}function nt(e,t,n,r,i,a){let o=new Map;rt(e,o,0,0);let s=new Map;at(e,s,0,0,o);let c=0;for(let[e,r]of s){let i=t.edges[e];if(!i)continue;let o=[],s=e=>{!e||e.points.length===0||(o.length>0?o.push(...e.points.slice(1)):o.push(...e.points))},l=[...r.sourceHops.keys()].sort((e,t)=>t-e);for(let e of l)s(r.sourceHops.get(e));s(r.bridge);let u=[...r.targetHops.keys()].sort((e,t)=>e-t);for(let e of u)s(r.targetHops.get(e));let d;i.label&&o.length>=2&&(d=r.bridge?.labelPosition??tt(o));let f=it(o,a,c);f!==o&&c++,i.label&&f!==o&&f.length>=2&&(d=tt(f)),n.push({source:i.source,target:i.target,label:i.label,style:i.style,hasArrowStart:i.hasArrowStart,hasArrowEnd:i.hasArrowEnd,points:fe(t).has(e)?[...f].reverse():f,labelPosition:d,inlineStyle:ct(e,t),id:i.id,animate:i.animate})}}function rt(e,t,n,r){t.set(e.id,{x:n,y:r});for(let i of e.children??[]){let e=i.x??0,a=i.y??0;rt(i,t,n+e,r+a)}}function it(e,t,n=0){if(e.length<2)return e;let r=!1;for(let t=1;t<e.length;t++){let n=Math.abs(e[t].x-e[t-1].x),i=Math.abs(e[t].y-e[t-1].y);if(n>1&&i>1){r=!0;break}}if(!r)return e;let i=[e[0]];for(let r=1;r<e.length;r++){let a=i[i.length-1],o=e[r],s=Math.abs(o.x-a.x),c=Math.abs(o.y-a.y);if(s>1&&c>1){if(t){let e=n%2==0,r=Math.floor(n/2)*12,s=e?t.rightX+r:t.leftX-r;i.push({x:s,y:a.y}),i.push({x:s,y:o.y})}else{let e=(a.y+o.y)/2;i.push({x:a.x,y:e}),i.push({x:o.x,y:e})}}i.push(o)}return i}function at(e,t,n,r,i){if(e.edges)for(let a of e.edges){let e=et(a.id);if(!e)continue;let{edgeIndex:o}=e,s=a.container,c=s?i.get(s):void 0,l=c?.x??n,u=c?.y??r,d=He(a,l,u),f=Ue(a,l,u),p=t.get(o)??{sourceHops:new Map,targetHops:new Map};t.set(o,p);let m={edgeIndex:o,points:d,labelPosition:f};e.role===`bridge`?p.bridge=m:e.role===`source`?p.sourceHops.set(e.level,m):p.targetHops.set(e.level,m)}if(e.children)for(let a of e.children)at(a,t,n+(a.x??0),r+(a.y??0),i)}function ot(e,t){for(let n of e){if(n.id===t)return n;let e=ot(n.children,t);if(e)return e}}function st(e,t){t.add(e.id);for(let n of e.children)st(n,t)}function ct(t,n){let r,i=n.linkStyles.get(`default`);i&&(r={...i});let a=n.linkStyles.get(t);return a&&(r=r?{...r,...a}:{...a}),r&&(0,e.dropInvalidColors)(r)}var lt=10,ut=14,dt=14,ft=10,pt=24,mt=400,ht=new Set([`rectangle`,`rounded`,`subroutine`]);function gt(e){let t=e===`TD`||e===`TB`||e===`BT`,n=e===`BT`||e===`RL`?-1:1;return{span:e=>{let[r,i]=t?[e.y,e.y+e.height]:[e.x,e.x+e.width],a=n*r,o=n*i;return{a0:Math.min(a,o),a1:Math.max(a,o),c0:t?e.x:e.y,c1:t?e.x+e.width:e.y+e.height}},toPoint:({a:e,c:r})=>t?{x:r,y:n*e}:{x:n*e,y:r}}}function _t(e,t,n){let r=Math.min(e.a,t.a),i=Math.max(e.a,t.a),a=Math.min(e.c,t.c),o=Math.max(e.c,t.c);return i>n.a0&&r<n.a1&&o>n.c0&&a<n.c1}var vt=(e,t)=>({a0:e.a0-t,a1:e.a1+t,c0:e.c0-t,c1:e.c1+t});function yt(e,t){let n=e.span({x:t.x,y:t.y,width:0,height:0});return{a:n.a0,c:n.c0}}function bt(e,t,n){let r=e.c===t.c;for(let i=1;i<n.length;i++){let a=n[i-1],o=n[i];if(a.c===o.c===r){if(r){let n=Math.abs(e.c-a.c),r=Math.min(Math.max(e.a,t.a),Math.max(a.a,o.a))-Math.max(Math.min(e.a,t.a),Math.min(a.a,o.a));if(n<ut&&r>0)return!0}else{let n=Math.abs(e.a-a.a),r=Math.min(Math.max(e.c,t.c),Math.max(a.c,o.c))-Math.max(Math.min(e.c,t.c),Math.min(a.c,o.c));if(n<ut&&r>0)return!0}}}return!1}function xt(e){let t=[];for(let n of e){let e=t[t.length-1];e&&e.a===n.a&&e.c===n.c||t.push(n)}for(let e=t.length-2;e>0;e--){let n=t[e-1],r=t[e],i=t[e+1];(n.a===r.a&&r.a===i.a||n.c===r.c&&r.c===i.c)&&t.splice(e,1)}return t}var St=e=>{let t=0;for(let n=1;n<e.length;n++)t+=Math.abs(e[n].a-e[n-1].a)+Math.abs(e[n].c-e[n-1].c);return t};function Ct(e,t,n,r,i,a=[]){let o=gt(i),s=o.span(e),c=o.span(t),l=s.a1<=c.a0,u=c.a1<=s.a0;if(!l&&!u)return;let d=o.span(r),f={a0:d.a0+ft,a1:d.a1-ft,c0:d.c0+ft,c1:d.c1-ft},p=a.map(e=>e.map(e=>yt(o,e))),m=n.map(e=>vt(o.span(e),lt)),h=e=>(e.c0+e.c1)/2,g=e=>(e.a0+e.a1)/2,_=e=>ht.has(e.shape),v=e=>{for(let t of e)if(t.a<f.a0||t.a>f.a1||t.c<f.c0||t.c>f.c1)return!1;for(let t=1;t<e.length;t++){let n=e[t-1],r=e[t];if(n.a!==r.a&&n.c!==r.c||m.some(e=>_t(n,r,e))||_t(n,r,s)||_t(n,r,c)||p.some(e=>bt(n,r,e)))return!1}return!0},y=new Set([h(s),h(c),f.c0,f.c1]);for(let e of m)y.add(e.c0-1),y.add(e.c1+1);for(let e of[s,c])y.add(e.c0-lt),y.add(e.c1+lt);let b=(e,t,n)=>_(e)?n>=t.c0+4&&n<=t.c1-4:Math.abs(n-h(t))<.5,x=[];if(l){let n=(c.a0-s.a1)/2,r=s.a1+Math.min(dt,n),i=c.a0-Math.min(dt,n);for(let n of y){b(e,s,n)&&b(t,c,n)&&x.push([{a:s.a1,c:n},{a:c.a0,c:n}]),x.push([{a:s.a1,c:h(s)},{a:r,c:h(s)},{a:r,c:n},{a:i,c:n},{a:i,c:h(c)},{a:c.a0,c:h(c)}]),b(t,c,n)&&x.push([{a:s.a1,c:h(s)},{a:r,c:h(s)},{a:r,c:n},{a:c.a0,c:n}]),b(e,s,n)&&x.push([{a:s.a1,c:n},{a:i,c:n},{a:i,c:h(c)},{a:c.a0,c:h(c)}]);let a=n>=s.c1?s.c1:n<=s.c0?s.c0:void 0;if(a!==void 0){let e=b(t,c,n)?[{a:c.a0,c:n}]:[{a:i,c:n},{a:i,c:h(c)},{a:c.a0,c:h(c)}];x.push([{a:g(s),c:a},{a:g(s),c:n},...e])}}}else for(let t of y){let n=t>=c.c1?c.c1:t<=c.c0?c.c0:void 0;if(n===void 0)continue;b(e,s,t)&&x.push([{a:s.a0,c:t},{a:g(c),c:t},{a:g(c),c:n}]);let r=n===c.c1?s.c1:s.c0;x.push([{a:g(s),c:r},{a:g(s),c:t},{a:g(c),c:t},{a:g(c),c:n}])}let S,C=1/0;for(let t of x){let n=xt(t);if(n.length<2||!v(n))continue;let r=e.shape===`diamond`&&n[0].a===s.a1?mt:0,i=St(n)+pt*(n.length-2)+r;i<C&&(S=n,C=i)}return S?.map(o.toPoint)}function wt(e){let t={x:e[0].x,y:e[0].y},n=-1;for(let r=1;r<e.length;r++){let i=e[r-1],a=e[r],o=Math.abs(a.x-i.x)+Math.abs(a.y-i.y);o>n&&(n=o,t={x:(i.x+a.x)/2,y:(i.y+a.y)/2})}return t}var Tt=`__zm_spine__`,Et=8,Dt=6,Ot=12,kt=4,At=4,jt=.25,Mt=.02,Nt=40,Pt=e=>e===`TD`||e===`TB`||e===`BT`,Ft=e=>e.startsWith(Tt);function It(e){return e.flatMap(e=>[e,...It(e.children)])}function H(e){let t=new Set(e.nodeIds);for(let n of e.children)for(let e of H(n))t.add(e);return t}function Lt(e){if(e.subgraphs.length===0||le(e)||ye(e.subgraphs))return!1;for(let t of e.nodes.keys())if(Ft(t))return!1;for(let t of e.edges)if(!e.nodes.has(t.source)||!e.nodes.has(t.target))return!1;let t=It(e.subgraphs);return!t.some(t=>e.nodes.has(t.id))&&t.every(t=>[...H(t)].some(t=>e.nodes.has(t)))}function Rt(e,t){let n=Pt(t),r=e=>n?[e.y,e.y+e.height]:[e.x,e.x+e.width],i=[...e].sort((e,t)=>{let[n,i]=r(e),[a,o]=r(t);return(n+i)/2-(a+o)/2}),a=[];for(let e of i){let[t,n]=r(e),i=a[a.length-1];i&&t<i.end?(i.end=Math.min(i.end,n),i.ids.push(e.id)):a.push({end:n,ids:[e.id]})}(t===`BT`||t===`RL`)&&a.reverse();let o=new Map;return a.forEach((e,t)=>e.ids.forEach(e=>o.set(e,t))),o}function zt(e,t,n){let r={ghosts:[],edges:[]};for(let i of e){let e=[...H(i)].filter(e=>t.has(e));if(e.length===0)continue;let a=e.map(e=>t.get(e)),o=Math.min(...a),s=Math.max(...a),c=new Map;for(let a=o;a<=s;a++){let o=e.filter(e=>t.get(e)===a).sort((e,t)=>n(e)-n(t));if(o.length>0)c.set(a,o[0]);else{let e=`${Tt}${i.id}__${a}`;r.ghosts.push({id:e,subgraph:i.id}),c.set(a,e)}}for(let e=o;e<s;e++){let t=c.get(e),n=c.get(e+1);!Ft(t)&&!Ft(n)||r.edges.push({source:t,target:n,style:`invisible`,hasArrowStart:!1,hasArrowEnd:!1})}}return r}function Bt(e,t,n,r=()=>!1,i=()=>!1){let a=e=>{let n=[...H(e)].filter(e=>t.has(e)).map(e=>t.get(e));return n.length>0?[Math.min(...n),Math.max(...n)]:void 0},o=e=>{let t=[...H(e)].filter(e=>n.has(e)).map(e=>n.get(e));return t.reduce((e,t)=>e+t,0)/t.length},s=e.map(e=>({sg:e,at:a(e)})).filter(e=>!!e.at).sort((e,t)=>e.at[0]-t.at[0]),c=[],l=-1/0;for(let{sg:e,at:t}of s){let n=c[c.length-1];n&&t[0]<=l?(n.push(e),l=Math.max(l,t[1])):(c.push([e]),l=t[1])}for(let t of c){if(t.length<2||t.some((e,n)=>t.slice(n+1).some(t=>r(e,t))))continue;let a=t.some(e=>e.region)||t.some((e,n)=>t.slice(n+1).some(t=>i(e,t)))?-1:1,s=[...t].sort((t,n)=>a*(e.indexOf(n)-e.indexOf(t))),c=t.map(o).sort((e,t)=>e-t),l=s.map((e,t)=>c[t]-o(e));s.forEach((e,t)=>{for(let r of H(e))n.has(r)&&n.set(r,n.get(r)+l[t])})}for(let a of e)Bt(a.children,t,n,r,i)}function Vt(e,t,n,r,i){let a=new Map(t);for(let t of r){let r=H(t);for(let e of i.get(t.id)??[])r.add(e);let o=[...r].filter(e=>a.has(e)),s=o.filter(e=>n.has(e));if(s.length===0)continue;let c=Math.min(...s.map(e=>n.get(e))),l=Math.max(...s.map(e=>n.get(e))),u=o.map(e=>a.get(e)),d=Math.min(...u),f=Math.max(...u),p=(d+f)/2,m=0;for(let t of e){if(r.has(t)||Ft(t))continue;let e=n.get(t);if(e===void 0||e<c||e>l)continue;m++;let i=a.get(t);a.set(t,i<=p?Math.min(i,d)-1-m*.001:Math.max(i,f)+1+m*.001)}}let o=new Map(e.map((e,t)=>[e,t]));return[...e].sort((e,t)=>a.get(e)-a.get(t)||o.get(e)-o.get(t))}var Ht=(e,t)=>t>=Math.min(...e)&&t<=Math.max(...e);function Ut(t,n,r){let i=t=>{let a=t.children.map(i),o=[...[...H(t)].flatMap(e=>{let t=n.get(e);return t?[t]:[]}),...a],s=t.region?ue:V,c=Math.min(...o.map(e=>e.x))-s.left,l=Math.min(...o.map(e=>e.y))-s.top,u=Math.max(...o.map(e=>e.x+e.width))+s.right,d=Math.max(...o.map(e=>e.y+e.height))+s.bottom,f=t.region?0:(0,e.measureMultilineText)(t.label,r.groupHeader,A.groupHeader).width+24;return{id:t.id,label:t.label,x:c,y:l,width:Math.max(u-c,f),height:d-l,children:a,...t.region?{region:!0}:{}}};return t.map(i)}var Wt=e=>e.flatMap(e=>[e,...Wt(e.children)]);function Gt(e,t,n,r,i,a){let o=Pt(r),s=new Map(It(t).map(e=>[e.id,H(e)])),c=new Map,l=!1,u=[],d=e=>o?[e.x,e.x+e.width]:[e.y,e.y+e.height],f=e=>o?[e.y,e.y+e.height]:[e.x,e.x+e.width],p=([e,t],[n,r])=>Math.max(0,Math.min(t,r)-Math.max(e,n)),m=e=>({x:e.x-Nt,y:e.y-Nt,width:e.width+80,height:e.height+80}),h=(e,t)=>p(f(e),f(t))>0?p(d(e),d(t)):0,g=Wt(e),_=new Map(g.map(e=>[e,m(e)])),v=(e,t,n,r)=>{let i=p(d(e),d(t)),a=p(f(e),f(t));if(i<=0||a<=0)return;let s=i<=a,c=s===o,l=e=>c?e.x:e.y,m=e=>c?e.x+e.width:e.y+e.height,h=e=>(l(e)+m(e))/2,g=h(n)<=h(r)?n:r;u.push({axis:c?`x`:`y`,amount:s?i:a,after:m(g)})};for(let e of g){let t=s.get(e.id),r=[...t].filter(e=>a.has(e)).map(e=>a.get(e)),o=new Set(r);for(let[s,u]of n){if(t.has(s))continue;if(o.has(a.get(s))||!Ht(r,a.get(s))){v(_.get(e),u,e,u);continue}let n=h(_.get(e),u);n<=0||(i.has(e.id)?c.set(e.id,Math.max(c.get(e.id)??0,n)):l=!0)}}let y=(e,t)=>Wt(e.children).includes(t);for(let e=0;e<g.length;e++)for(let t=e+1;t<g.length;t++){let n=g[e],r=g[t];y(n,r)||y(r,n)||v(_.get(n),r,n,r)}return{penetration:c,stuck:l,requests:u}}function Kt(e,t,n){let r=[...e.nodes.keys()],i={...e,subgraphs:[]},a=t(i),o=Rt(a.nodes,e.direction),s=Pt(e.direction),c=new Map(a.nodes.map(e=>[e.id,e])),l=e=>{let t=c.get(e);return s?t.x:t.y},u=It(e.subgraphs),d=zt(u,o,l),f=new Map;for(let e of d.ghosts)f.set(e.subgraph,[...f.get(e.subgraph)??[],e.id]);let p=new Map(a.nodes.map(e=>[e.id,l(e.id)]));Bt(e.subgraphs,o,p,(t,n)=>{let r=H(t),i=H(n),a=(t,n)=>e.edges.some(e=>t.has(e.source)&&n.has(e.target));return a(r,i)&&a(i,r)},(t,n)=>{let r=H(t),i=H(n),a=(t,n)=>e.edges.some(e=>e.source===t&&n.has(e.target)||e.target===t&&n.has(e.source));return[...e.nodes.keys()].some(e=>r.has(e)||i.has(e)?r.has(e)&&a(e,i)||i.has(e)&&a(e,r):a(e,r)&&a(e,i))});for(let e of d.ghosts){let t=[...H(u.find(t=>t.id===e.subgraph))].filter(e=>p.has(e)).map(e=>p.get(e));p.set(e.id,t.reduce((e,t)=>e+t,0)/t.length)}let m=new Map(e.nodes);for(let e of d.ghosts)m.set(e.id,{id:e.id,label:` `,shape:`rectangle`});let h=Vt([...m.keys()],p,o,u,f),g={...i,nodes:new Map(h.map(e=>[e,m.get(e)])),edges:[...e.edges,...d.edges]},_=new Set(d.edges.map((t,n)=>e.edges.length+n)),v=i=>{let a=new Map,s=new Map;for(let c=0;;c++){let l=new Map(d.ghosts.map(e=>[e.id,Et+(a.get(e.subgraph)??0)])),p=t(g,{fixedWidths:l,looseEdges:_,detachedEdges:i,walkOrder:r,forceNodeOrder:!0}),m=new Map(p.nodes.filter(e=>!Ft(e.id)).map(e=>[e.id,e])),h=Ut(e.subgraphs,m,n),v=Gt(h,e.subgraphs,m,e.direction,new Set(f.keys()),o),{penetration:y,stuck:b}=v;if(b)return;if(y.size===0){for(let t=0;v.requests.length>0;t++){if(t===Ot)return;Yt(v.requests.reduce((e,t)=>t.amount>e.amount?t:e),[...m.values()],p.edges),h=Ut(e.subgraphs,m,n),v=Gt(h,e.subgraphs,m,e.direction,new Set(f.keys()),o)}let t=Jt(e,i,m,h,u);return t&&Qt(p,[...m.values()],h,t,e.direction)}if(c===Dt)return;for(let[e,t]of y){let n=a.get(e)??0,r=s.get(e),i=r?(r.overlap-t)/(n-r.width):0,o=i>Mt?i:jt;s.set(e,{width:n,overlap:t}),a.set(e,n+t/o+At)}}},y=qt(e,d,o,u);return(y.size>0?v(y):void 0)??v(new Set)}function qt(e,t,n,r){let i=r.map(e=>{let t=H(e);return{inside:t,layers:new Set([...t].filter(e=>n.has(e)).map(e=>n.get(e)))}}),a=e=>{let t=n.get(e.source),r=n.get(e.target);return t===void 0||r===void 0||e.source===e.target?!1:i.some(({inside:n,layers:i})=>n.has(e.source)&&n.has(e.target)&&Array.from({length:Math.max(0,Math.abs(r-t)-1)},(e,n)=>Math.min(t,r)+1+n).some(e=>!i.has(e)))},o=new Set;e.edges.forEach((e,t)=>{a(e)&&o.add(t)});let s=new Map,c=e=>{e.source!==e.target&&(s.set(e.source,(s.get(e.source)??0)+1),s.set(e.target,(s.get(e.target)??0)+1))};e.edges.forEach((e,t)=>{o.has(t)||c(e)}),t.edges.forEach(c);for(let t of[...o]){let n=e.edges[t];(!s.get(n.source)||!s.get(n.target))&&o.delete(t)}return o}function Jt(e,t,n,r,i){let a=new Map(Wt(r).map(e=>[e.id,e])),o=[];for(let r of t){let t=e.edges[r],s=n.get(t.source),c=n.get(t.target),l=i.filter(e=>{let n=H(e);return n.has(t.source)&&n.has(t.target)}).sort((e,t)=>H(e).size-H(t).size)[0],u=l&&a.get(l.id);if(!s||!c||!u)return;let d=Ct(s,c,[...n.values()].filter(e=>e!==s&&e!==c),u,e.direction,o.map(e=>e.points));if(!d)return;o.push({source:t.source,target:t.target,label:t.label,style:t.style,hasArrowStart:t.hasArrowStart,hasArrowEnd:t.hasArrowEnd,points:d,labelPosition:t.label?wt(d):void 0,inlineStyle:ct(r,e),id:t.id,animate:t.animate})}return o}function Yt(e,t,n){let{axis:r,amount:i,after:a}=e,o=i+kt,s=t.filter(e=>e[r]>=a),c=Math.min(...s.map(e=>e[r]));for(let e of s)e[r]+=o;let l=e=>{e[r]>=c&&(e[r]+=o)};for(let e of n)e.points.forEach(l),e.labelPosition&&l(e.labelPosition)}var Xt=8;function Zt(e,t,n,r){let i=Pt(r)?`y`:`x`,a=i===`x`?`y`:`x`,o=i===`x`?`width`:`height`,s=i===`x`?`height`:`width`;for(let{points:r}of e)for(let e=1;e<r.length-1;){let c=e;for(;c+1<r.length-1&&r[c+1][i]===r[e][i];)c++;let l=r.slice(e,c+1),u=l[0],d=Math.min(...l.map(e=>e[a])),f=Math.max(...l.map(e=>e[a])),p=r[e-1][i],m=r[c+1][i],h=n.flatMap(e=>[e[i],e[i]+e[o]].map(t=>({g:e,s:t}))).find(({g:e,s:t})=>Math.abs(u[i]-t)<Xt&&f>e[a]&&d<e[a]+e[s]);if(h){let e=h.s+(u[i]>=h.s?Xt:-8),n=(e-p)*(m-e)>0,r=t.every(t=>t[i]+t[o]<=e||t[i]>=e||t[a]+t[s]<=d||t[a]>=f);if(n&&r)for(let t of l)t[i]=e}e=c+1}}function Qt(e,t,n,r,i){let a=[...e.edges.filter(e=>!Ft(e.source)&&!Ft(e.target)),...r],o=Wt(n);Zt(a,t,o,i);let s=[...t.map(e=>e.x),...o.map(e=>e.x),...a.flatMap(e=>e.points.map(e=>e.x))],c=[...t.map(e=>e.y),...o.map(e=>e.y),...a.flatMap(e=>e.points.map(e=>e.y))],l=I.padding-Math.min(...s),u=I.padding-Math.min(...c);for(let e of t)e.x+=l,e.y+=u;for(let e of o)e.x+=l,e.y+=u;for(let e of a){for(let t of e.points)t.x+=l,t.y+=u;e.labelPosition&&(e.labelPosition.x+=l,e.labelPosition.y+=u)}let d=0,f=0;for(let e of t)d=Math.max(d,e.x+e.width+I.padding),f=Math.max(f,e.y+e.height+I.padding);for(let e of o)d=Math.max(d,e.x+e.width+I.padding),f=Math.max(f,e.y+e.height+I.padding);for(let e of a){for(let t of e.points)d=Math.max(d,t.x+P.width+I.padding),f=Math.max(f,t.y+P.width+I.padding);e.labelPosition&&(d=Math.max(d,e.labelPosition.x+60+I.padding),f=Math.max(f,e.labelPosition.y+20+I.padding))}return{...e,nodes:t,edges:a,groups:n,width:d,height:f}}var $t=12,en=8,tn=4;function nn(e,t,n){let r=e.map(e=>({axis:e.axis,cross:e.cross,after:e.after??0,rank:0,real:!0})),i=e.map(()=>[]),a=e.map(()=>[]),o=t.flatMap((e,t)=>e.from===e.to?[]:[t]),s=R(o.map(e=>({source:String(t[e].from),target:String(t[e].to)})),e.map((e,t)=>String(t))),c=o.map((e,n)=>{let r=t[e];return s.has(n)?{index:e,u:r.to,v:r.from,reversed:!0}:{index:e,u:r.from,v:r.to,reversed:!1}}),l=e.map(()=>[]),u=e.map(()=>0);for(let e of c)l[e.u].push(e.v),u[e.v]++;let d=u.flatMap((e,t)=>e===0?[t]:[]);for(let e=0;e<d.length;e++){let t=d[e];for(let e of l[t])r[e].rank=Math.max(r[e].rank,r[t].rank+2),--u[e]===0&&d.push(e)}let f=c.map(e=>{let n=(r[e.v].rank-r[e.u].rank)/2,o=r[e.u].rank+2*Math.floor(n/2)+1,s=t[e.index].label,c=[e.u];for(let t=r[e.u].rank+1;t<r[e.v].rank;t++){let e=r.length,n=t===o&&s!==void 0;r.push({axis:n?s.axis:0,cross:n?s.cross:0,after:0,rank:t,real:!1}),i.push([]),a.push([]),c.push(e)}c.push(e.v);for(let e=1;e<c.length;e++)a[c[e-1]].push(c[e]),i[c[e]].push(c[e-1]);return{chain:c,labelRank:o}}),p=r.map((e,t)=>t),m=e=>{let t=e;for(;p[t]!==t;)t=p[t]=p[p[t]];return t};for(let{chain:e}of f)for(let t of e)p[m(t)]=m(e[0]);let h=new Map;r.forEach((e,t)=>{let n=m(t);h.set(n,[...h.get(n)??[],t])});let g=r.map(()=>0),_=[],v=[];for(let e of h.values()){let t=rn(e,r,i,a,n),o=1/0,s=-1/0;for(let n of e)g[n]=t.get(n),o=Math.min(o,g[n]-r[n].cross/2),s=Math.max(s,g[n]+r[n].cross/2+r[n].after);_.push({min:o,max:s}),v.push(e)}let y=0;v.forEach((e,t)=>{let r=y-_[t].min;for(let t of e)g[t]=g[t]+r;y+=_[t].max-_[t].min+n.nodeSep});let b=Math.max(0,y-n.nodeSep),x=r.reduce((e,t)=>Math.max(e,t.rank),0),S=Array(x+1).fill(0);for(let e of r)S[e.rank]=Math.max(S[e.rank],e.axis);let C=Array(x+1).fill(0);for(let e=1;e<=x;e++)C[e]=C[e-1]+S[e-1]+n.rankSep/2;let w=e=>C[r[e].rank]+S[r[e].rank]/2,T=t.map(()=>[]),E=t.map(()=>void 0);return c.forEach((e,n)=>{let{chain:i,labelRank:a}=f[n],o=i.slice(1,-1),s=o.map(e=>({axis:w(e),cross:g[e]}));if(T[e.index]=e.reversed?s.reverse():s,t[e.index].label){let t=o.find(e=>r[e].rank===a);E[e.index]={axis:w(t),cross:g[t]}}}),{nodes:e.map((e,t)=>({axis:C[r[t].rank]+(S[r[t].rank]-e.axis)/2,cross:g[t]-e.cross/2})),paths:T,labels:E,axisSize:C[x]+S[x],crossSize:b}}function rn(e,t,n,r,i){let a=[],o=new Set,s=[...e].sort((e,n)=>t[e].rank-t[n].rank||e-n);for(let e of s){if(o.has(e))continue;let n=[{s:e,next:0}];for(o.add(e),(a[t[e].rank]??=[]).push(e);n.length>0;){let e=n[n.length-1],i=r[e.s][e.next++];i===void 0?n.pop():o.has(i)||(o.add(i),(a[t[i].rank]??=[]).push(i),n.push({s:i,next:0}))}}let c=a.filter(e=>e!==void 0),l=new Map,u=()=>c.forEach(e=>e.forEach((e,t)=>l.set(e,t))),d=()=>{let e=0;for(let t=0;t+1<c.length;t++){let n=c[t].flatMap(e=>r[e].map(t=>[l.get(e),l.get(t)]));for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let[i,a]=n[t],[o,s]=n[r];(i-o)*(a-s)<0&&e++}}return e};u();let f=c.map(e=>[...e]),p=d();for(let e=0;e<en&&p>0;e++){let t=e%2==0,i=c.map((e,t)=>t);t||i.reverse();for(let e of i){let i=t?n:r,a=e=>{let t=i[e];return t.length===0?l.get(e):t.reduce((e,t)=>e+l.get(t),0)/t.length},o=new Map(c[e].map(e=>[e,a(e)]));c[e].sort((e,t)=>o.get(e)-o.get(t)||l.get(e)-l.get(t)),c[e].forEach((e,t)=>l.set(e,t))}let a=d();a<p&&(p=a,f=c.map(e=>[...e]))}f.forEach((e,t)=>c[t]=e);let m=new Map,h=(e,n)=>(t[e].cross+t[n].cross)/2+t[e].after+(t[e].real&&t[n].real?i.nodeSep:Math.min(i.nodeSep,$t)),g=(e,t)=>{let n=e.slice(1).map((t,n)=>h(e[n],t)),r=[0];n.forEach((e,t)=>r.push(r[t]+e)),an(e.map((e,n)=>{let i=(t[e]??[]).filter(e=>m.has(e));return(i.length===0?m.get(e)??0:i.reduce((e,t)=>e+m.get(t),0)/i.length)-r[n]})).forEach((t,n)=>m.set(e[n],t+r[n]))};for(let e of c)g(e,[]);for(let e=0;e<tn;e++){for(let e=1;e<c.length;e++)g(c[e],n);for(let e=c.length-2;e>=0;e--)g(c[e],r)}return m}function an(e){let t=[];for(let n of e)for(t.push({sum:n,count:1});t.length>1;){let e=t[t.length-1],n=t[t.length-2];if(n.sum/n.count<=e.sum/e.count)break;t.splice(-2,2,{sum:n.sum+e.sum,count:n.count+e.count})}return t.flatMap(e=>Array(e.count).fill(e.sum/e.count))}var on=28,sn=18,cn=10,ln=32;function un(t,n={}){let r={...I,...n,fontSizes:k(n.fontSizes)},i=t.direction===`TB`||t.direction===`TD`||t.direction===`BT`,a=t.direction===`BT`||t.direction===`RL`,o=new Map,s=new Map,c=(e,t)=>{o.set(e.id,e),t!==void 0&&s.set(e.id,t);for(let t of e.nodeIds)s.has(t)||s.set(t,e.id);for(let t of e.children)c(t,e.id)};t.subgraphs.forEach(e=>c(e));let l=[...t.nodes.keys()].filter(e=>!o.has(e)),u=new Map(l.map((e,t)=>[e,t])),d=e=>Math.min(...e.nodeIds.map(e=>u.get(e)??1/0),...e.children.map(d)),f=e=>{let t=o.get(e);return t?d(t):u.get(e)??1/0},p=e=>[...l.filter(t=>s.get(t)===e),...(e===void 0?t.subgraphs:o.get(e).children).map(e=>e.id)].map((e,t)=>({id:e,i:t})).sort((e,t)=>f(e.id)-f(t.id)||e.i-t.i).map(e=>e.id),m=e=>{let t=[e];for(let n=s.get(e);n!==void 0;n=s.get(n))t.unshift(n);return t},h=n=>{let a=t.edges[n].label;if(!a)return;let o=(0,e.measureMultilineText)(a,r.fontSizes.edgeLabel,A.edgeLabel),s=o.width+8,c=o.height+6;return i?{axis:c,cross:s}:{axis:s,cross:c}},g=new Map,_=new Map;t.edges.forEach((e,t)=>{if(e.source===e.target){_.set(e.source,[..._.get(e.source)??[],t]);return}let n=m(e.source),r=m(e.target),i=0;for(;n[i]!==void 0&&n[i]===r[i];)i++;if(i>=n.length||i>=r.length)return;let a=i===0?``:n[i-1];g.set(a,[...g.get(a)??[],{index:t,from:n[i],to:r[i]}])});let v=i?a?{axisStart:V.bottom,axisEnd:V.top,crossStart:V.left,crossEnd:V.right}:{axisStart:V.top,axisEnd:V.bottom,crossStart:V.left,crossEnd:V.right}:{axisStart:a?V.right:V.left,axisEnd:a?V.left:V.right,crossStart:V.top,crossEnd:V.bottom},y=(e,t)=>i?{aSize:t,cSize:e}:{aSize:e,cSize:t},b=new Map;for(let e of l){let n=t.nodes.get(e),i=_e(e,n.label,n.shape,r.fontSizes.nodeLabel);b.set(e,y(i.width,i.height))}let x=e=>{let t=_.get(e);if(!i||!t)return 0;let n=Math.max(0,...t.map(e=>(h(e)?.cross??-10)+cn));return on+(t.length-1)*sn+n},S=t=>{let n=p(t),a=new Map,s=new Map,c=new Map;for(let t of n){let n=o.get(t);if(!n){s.set(t,b.get(t));continue}let l=S(t);a.set(t,l);let u=(0,e.measureMultilineText)(n.label,r.fontSizes.groupHeader,A.groupHeader).width,d=l.axisSize+v.axisStart+v.axisEnd,f=l.crossSize+v.crossStart+v.crossEnd,p=i?0:u+ln,m=i?u+ln:0,h=Math.max(0,p-d),g=Math.max(0,m-f);d+=h,f+=g,s.set(t,{aSize:d,cSize:f}),c.set(t,{axis:v.axisStart+h/2,cross:v.crossStart+g/2})}let l=new Map(n.map((e,t)=>[e,t])),u=g.get(t??``)??[],d=nn(n.map(e=>({axis:s.get(e).aSize,cross:s.get(e).cSize,after:x(e)})),u.map(e=>({from:l.get(e.from),to:l.get(e.to),label:h(e.index)})),{nodeSep:r.nodeSpacing,rankSep:r.layerSpacing}),f=new Map;return u.forEach((e,t)=>f.set(e.index,{mids:d.paths[t],label:d.labels[t]})),{members:n,at:new Map(n.map((e,t)=>[e,d.nodes[t]])),sizes:s,inset:{axis:0,cross:0},axisSize:d.axisSize,crossSize:d.crossSize,routes:f,inner:new Map([...a].map(([e,t])=>[e,{...t,inset:c.get(e)}]))}},C=S(void 0),w=new Map,T=new Map,E=(e,t,n)=>{for(let[r,i]of e.routes)T.set(r,{mids:i.mids.map(e=>({axis:e.axis+t,cross:e.cross+n})),label:i.label&&{axis:i.label.axis+t,cross:i.label.cross+n}});let r=[];for(let i of e.members){let a=e.at.get(i),s=e.sizes.get(i),c={axis:t+a.axis,cross:n+a.cross,...s};w.set(i,c);let l=e.inner.get(i);if(l){let e=o.get(i),t=E(l,c.axis+l.inset.axis,c.cross+l.inset.cross);r.push({id:i,label:e.label,x:0,y:0,width:0,height:0,children:t,...e.region?{region:!0}:{}})}}return r},D=E(C,0,0),O=r.padding,ee=C.axisSize,j=e=>{let t=a?ee-e.axis:e.axis;return i?{x:e.cross+O,y:t+O}:{x:t+O,y:e.cross+O}},M=e=>{let t=a?ee-e.axis-e.aSize:e.axis;return i?{x:e.cross+O,y:t+O,width:e.cSize,height:e.aSize}:{x:t+O,y:e.cross+O,width:e.aSize,height:e.cSize}},N=e=>{for(let t of e)Object.assign(t,M(w.get(t.id))),N(t.children)};N(D);let F=l.map(n=>{let r=t.nodes.get(n);return{id:n,label:r.label,shape:r.shape,...M(w.get(n)),inlineStyle:(0,e.resolveNodeStyle)(n,t),className:t.classAssignments.get(n),interaction:t.interactions.get(n)}}),L=new Map(F.map(e=>[e.id,e])),R=[];t.edges.forEach((e,n)=>{let r=T.get(n);if(!r)return;let i=w.get(e.source),a=w.get(e.target),o=i.axis>a.axis,[s,c]=o?[a,i]:[i,a],l=[{axis:s.axis+s.aSize,cross:s.cross+s.cSize/2},...o?[...r.mids].reverse():r.mids,{axis:c.axis,cross:c.cross+c.cSize/2}],u=[l[0]];for(let e of l.slice(1)){let t=u[u.length-1];if(t.cross!==e.cross){let n=(t.axis+e.axis)/2;u.push({axis:n,cross:t.cross},{axis:n,cross:e.cross})}u.push(e)}let d=Ve(dn(u.map(j)));o&&d.reverse();let f=L.get(e.source),p=L.get(e.target);f&&(d=De(d,f,!0)),p&&(d=De(d,p,!1)),R.push({source:e.source,target:e.target,label:e.label,style:e.style,hasArrowStart:e.hasArrowStart,hasArrowEnd:e.hasArrowEnd,points:d,labelPosition:r.label&&j(r.label),inlineStyle:ct(n,t),id:e.id,animate:e.animate})}),Xe(t,L,R);let z=(i?C.crossSize:C.axisSize)+O*2,B=(i?C.axisSize:C.crossSize)+O*2;for(let e of R){for(let t of e.points)z=Math.max(z,t.x+P.width+O),B=Math.max(B,t.y+P.width+O);e.labelPosition&&(z=Math.max(z,e.labelPosition.x+60+O),B=Math.max(B,e.labelPosition.y+20+O))}return{width:z,height:B,nodes:F,edges:R,groups:D}}function dn(e){return e.filter((t,n)=>{let r=e[n-1],i=e[n+1];return!r||!i||!(r.x===t.x&&t.x===i.x||r.y===t.y&&t.y===i.y)})}function fn(e,t={}){return pn(e,t)}function pn(e,t,n){let r={...I,...t,fontSizes:k(t.fontSizes)};return Qe(x(Ce(e,r,n),t.layoutCache),e,r.mergeEdges)}function mn(t,n={}){let r=(0,e.withoutOwnClusterEdges)(t);if(n.layout===`simple`&&!le(r))return un(r,n);if(n.layout!==void 0&&n.layout!==`elk`&&n.layout!==`simple`)throw Error(`zombie-mermaid: unknown layout ${JSON.stringify(n.layout)}; use 'elk' or 'simple'.`);if(Lt(r)){let e=Kt(r,(e,t)=>pn(e,n,t),k(n.fontSizes));if(e)return e}return fn(r,n)}function hn(e,t={}){return Ce(e,{...I,...t,fontSizes:k(t.fontSizes)})}var gn=12,_n=2;function vn(e){return e.flatMap(e=>[e,...vn(e.children)])}function yn(t,n){let r=n.groupHeader+16;return vn(t).filter(e=>e.label!==``).map(t=>{let i=(0,e.measureMultilineText)(t.label,n.groupHeader,A.groupHeader);return{x:t.x+gn-_n,y:t.y+r/2-i.height/2-_n,width:i.width+4,height:i.height+4}})}function bn(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=[-r,r,-i,i],o=[e.x-n.x,n.x+n.width-e.x,e.y-n.y,n.y+n.height-e.y],s=0,c=1;for(let e=0;e<4;e++){let t=a[e],n=o[e];if(t===0){if(n<0)return!1}else{let e=n/t;if(t<0?s=Math.max(s,e):c=Math.min(c,e),s>c)return!1}}return!0}function xn(e){return{x:e.x+_n,y:e.y+_n,width:e.width-4,height:e.height-4}}function Sn(e,t){let n=e.points,r=t.map(xn);for(let e=0;e+1<n.length;e++)if(r.some(t=>bn(n[e],n[e+1],t)))return!0;return!1}function Cn(e){let t=2166136261;for(let n of e.map(e=>`${e.x},${e.y},${e.width},${e.height}`).join(`;`))t=Math.imul(t^n.charCodeAt(0),16777619);return(t>>>0).toString(36)}function wn(e,t,n){let r=`zm-title-gap-${Cn(e)}`;return{id:r,markup:` <mask id="${r}" maskUnits="userSpaceOnUse" x="0" y="0" width="${t}" height="${n}">\n <rect x="0" y="0" width="${t}" height="${n}" fill="#fff" />\n${e.map(e=>` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" fill="#000" />`).join(`
|
|
9
|
+
`)}\n </mask>`}}function Tn(t,n,r=`Inter`,i=!1,a=O,o=`linear`,s,c=!0,l=!0,u,d,f={}){let p=[],m=l&&t.nodes.some(t=>!!(0,e.safeHref)(t.interaction?.href));p.push(Sr((0,e.svgOpenTag)(t.width,t.height,n,i,u,d,m,f.styleAttribute,f.description),s)),p.push((0,e.buildStyleBlock)(r,!1,f.nonce)),c&&t.edges.some(e=>e.animate)&&p.push(En(f.nonce)),p.push(`<defs>`),p.push(Dn());let h=new Set;for(let e of t.edges)e.inlineStyle?.stroke&&h.add(e.inlineStyle.stroke);for(let e of h)p.push(On(e));let g=yn(t.groups,a),_=new Set(t.edges.filter(e=>Sn(e,g))),v;if(_.size>0){let e=wn(g,t.width,t.height);v=e.id,p.push(e.markup)}p.push(`</defs>`);for(let e of t.groups)p.push(jn(e,r,a));for(let e of t.edges)p.push(Mn(e,o,c,_.has(e)?v:void 0));for(let e of t.edges)e.label&&p.push(Pn(e,r,a));for(let e of t.nodes)p.push(Rn(e,r,a,l));return p.push(`</svg>`),p.join(`
|
|
10
|
+
`)}function En(t){return[(0,e.styleOpenTag)(t),` @keyframes zm-edge-dash { to { stroke-dashoffset: -28; } }`,` .edge-animated { animation: zm-edge-dash 1s linear infinite; }`,` @media (prefers-reduced-motion: reduce) {`,` .edge-animated { animation: none; }`,` }`,`</style>`].join(`
|
|
11
|
+
`)}function Dn(){return kn(`var(--_arrow)`,``)}function On(t){return kn((0,e.escapeAttr)(t),e.f`-${An(t)}`)}function kn(t,n){let r=P.width,i=P.height,a=r-1,o=e.f`fill="${t}" stroke="${t}" stroke-width="0.75" stroke-linejoin="round"`,s=e.f`<polygon points="0 0, ${r} ${i/2}, 0 ${i}" ${o} />`,c=(t,n)=>e.f` <marker id="${t}" markerWidth="${r}" markerHeight="${i}" refX="${a}" refY="${i/2}" orient="${n}">`+e.f`\n ${s}`+`
|
|
12
|
+
</marker>`;return c(e.f`arrowhead${n}`,`auto`)+`
|
|
13
|
+
`+c(e.f`arrowhead-start${n}`,`auto-start-reverse`)}function An(e){return e.replace(/[^a-zA-Z0-9]/g,e=>e.charCodeAt(0).toString(16))}function jn(t,n,r){let i=r.groupHeader+16,a=[];if(t.region){a.push(e.f`<g class="subgraph subgraph-region" data-id="${(0,e.escapeAttr)(t.id)}">`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${M.outerBox}" stroke-dasharray="6 4" />`);for(let e of t.children)a.push(jn(e,n,r));return a.push(`</g>`),a.join(`
|
|
14
|
+
`)}a.push(e.f`<g class="subgraph" data-id="${(0,e.escapeAttr)(t.id)}" data-label="${(0,e.escapeAttr)(t.label)}">`),a.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${M.outerBox}" />`),a.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${i}" `+e.f`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${M.outerBox}" />`),a.push(` `+(0,e.renderMultilineText)(t.label,t.x+12,t.y+i/2,r.groupHeader,e.f`font-size="${r.groupHeader}" font-weight="${A.groupHeader}" fill="var(--_text-sec)"`));for(let e of t.children)a.push(jn(e,n,r));return a.push(`</g>`),a.join(`
|
|
15
|
+
`)}function Mn(t,n,r=!0,i){if(t.points.length<2)return``;let a=r&&(t.animate??!1),o=n!==`linear`,s=t.style===`invisible`,l=t.style===`dotted`?` stroke-dasharray="4 4"`:``,u=t.style===`thick`?M.connector*2:M.connector,d=s?`none`:(0,e.escapeAttr)(t.inlineStyle?.stroke??`var(--_line)`),f=(0,e.escapeAttr)(t.inlineStyle?.[`stroke-width`]??String(u)),p=t.inlineStyle?.stroke?e.f`-${An(t.inlineStyle.stroke)}`:``,m=``;s||(t.hasArrowEnd&&(m+=e.f` marker-end="url(#arrowhead${p})"`),t.hasArrowStart&&(m+=e.f` marker-start="url(#arrowhead-start${p})"`));let h=[e.f`class="edge${a?` edge-animated`:``}"`,e.f`data-from="${(0,e.escapeAttr)(t.source)}"`,e.f`data-to="${(0,e.escapeAttr)(t.target)}"`,e.f`data-style="${t.style}"`,e.f`data-arrow-start="${t.hasArrowStart}"`,e.f`data-arrow-end="${t.hasArrowEnd}"`];t.label&&h.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.id&&h.push(e.f`data-id="${(0,e.escapeAttr)(t.id)}"`);let g=a&&!l?` stroke-dasharray="8 6"`:``,_=o?e.f`d="${c(t.points,n)}"`:e.f`points="${Nn(t.points)}"`;return e.f`<${o?`path`:`polyline`} ${h.join(` `)} ${_} `+e.f`fill="none" stroke="${d}" `+e.f`stroke-width="${f}"${l}${g}${m}`+(i?e.f` mask="url(#${i})"`:``)+` />`}function Nn(t){return t.map(t=>e.f`${t.x},${t.y}`).join(` `)}function Pn(t,n,r){if(!t.label)return``;let i=t.label,a=t.labelPosition??In(t.points),o=(0,e.measureMultilineText)(i,r.edgeLabel,A.edgeLabel),s=(0,e.renderMultilineTextWithBackground)(i,a.x,a.y,o.width,o.height,r.edgeLabel,8,e.f`text-anchor="middle" font-size="${r.edgeLabel}" font-weight="${A.edgeLabel}" fill="var(--_text-sec)"`,`rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1"`);return e.f`<g class="edge-label" data-from="${(0,e.escapeAttr)(t.source)}" data-to="${(0,e.escapeAttr)(t.target)}" data-label="${(0,e.escapeAttr)(i)}">\n`+e.f` ${s.replace(/\n/g,`
|
|
16
|
+
`)}\n`+`</g>`}function Fn(t,n){let r=t[n];if(!r)throw Error(e.f`edgeMidpoint: missing point at index ${n}`);return r}function In(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++)t+=Ln(Fn(e,n-1),Fn(e,n));let n=t/2;for(let t=1;t<e.length;t++){let r=Fn(e,t-1),i=Fn(e,t),a=Ln(r,i);if(n<=a){let e=n/a;return{x:r.x+e*(i.x-r.x),y:r.y+e*(i.y-r.y)}}n-=a}return e[e.length-1]}function Ln(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Rn(t,n,r,i=!0){let a=zn(t),o=br(t,n,r),s=[],c=(0,e.sanitizeClassName)(t.className),l=c?e.f`node ${c}`:`node`,u=t.interaction,d=[e.f`class="${l}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`,e.f`data-shape="${t.shape}"`];s.push(e.f`<g ${d.join(` `)}>`);let f=i?(0,e.safeHref)(u?.href):void 0,p=f?` `:` `;if(f){let t=u?.target?e.f` target="${(0,e.escapeAttr)(u.target)}"`:``;s.push(e.f` <a href="${(0,e.escapeAttr)(f)}"${t}>`)}return i&&u?.tooltip&&s.push(e.f`${p}<title>${(0,e.escapeXml)(u.tooltip)}</title>`),s.push(e.f`${p}${a.replace(/\n/g,e.f`\n${p}`)}`),o&&s.push(e.f`${p}${o.replace(/\n/g,e.f`\n${p}`)}`),f&&s.push(` </a>`),s.push(`</g>`),s.join(`
|
|
17
|
+
`)}function zn(t){let{x:n,y:r,width:i,height:a,shape:o,inlineStyle:s}=t,c=(0,e.escapeAttr)(s?.fill??`var(--_node-fill)`),l=(0,e.escapeAttr)(s?.stroke??`var(--_node-stroke)`),u=(0,e.escapeAttr)(s?.[`stroke-width`]??String(M.innerBox));switch(o){case`diamond`:return Wn(n,r,i,a,c,l,u);case`rounded`:return Vn(n,r,i,a,c,l,u);case`stadium`:return Hn(n,r,i,a,c,l,u);case`circle`:return Un(n,r,i,a,c,l,u);case`subroutine`:return Gn(n,r,i,a,c,l,u);case`doublecircle`:return Kn(n,r,i,a,c,l,u);case`hexagon`:return qn(n,r,i,a,c,l,u);case`cylinder`:return Jn(n,r,i,a,c,l,u);case`asymmetric`:return Yn(n,r,i,a,c,l,u);case`trapezoid`:return Xn(n,r,i,a,c,l,u);case`trapezoid-alt`:return Zn(n,r,i,a,c,l,u);case`parallelogram`:return Qn(n,r,i,a,c,l,u);case`parallelogram-alt`:return $n(n,r,i,a,c,l,u);case`state-start`:return vr(n,r,i,a);case`state-end`:return yr(n,r,i,a);case`document`:return er(n,r,i,a,c,l,u);case`stacked-document`:return tr(n,r,i,a,c,l,u,!0);case`stacked-process`:return tr(n,r,i,a,c,l,u,!1);case`card`:return nr(n,r,i,a,c,l,u);case`lined-process`:return rr(n,r,i,a,c,l,u);case`divided-process`:return ir(n,r,i,a,c,l,u);case`window-pane`:return ar(n,r,i,a,c,l,u);case`triangle`:return or(n,r,i,a,c,l,u,!1);case`flipped-triangle`:return or(n,r,i,a,c,l,u,!0);case`filled-circle`:return sr(n,r,i,a,l);case`crossed-circle`:return cr(n,r,i,a,c,l,u);case`fork-join`:return lr(n,r,i,a,l);case`note`:return ur(n,r,i,a,(0,e.escapeAttr)(s?.fill??`var(--bg)`),l,u);case`notched-pentagon`:return dr(n,r,i,a,c,l,u);case`sloped-rectangle`:return fr(n,r,i,a,c,l,u);case`flag`:return pr(n,r,i,a,c,l,u);case`bow-tie-rectangle`:return mr(n,r,i,a,c,l,u);case`half-rounded-rectangle`:return hr(n,r,i,a,c,l,u);case`brace`:return gr(n,r,i,a,c,l,u,`left`);case`brace-right`:return gr(n,r,i,a,c,l,u,`right`);case`braces`:return gr(n,r,i,a,c,l,u,`both`);case`bolt`:return _r(n,r,i,a,c,l,u);case`text`:case`anchor`:return``;default:return Bn(n,r,i,a,c,l,u)}}function Bn(t,n,r,i,a,o,s){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="0" ry="0" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Vn(t,n,r,i,a,o,s){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="6" ry="6" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Hn(t,n,r,i,a,o,s){let c=i/2;return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="${c}" ry="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Un(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2;return e.f`<circle cx="${c}" cy="${l}" r="${u}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Wn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=r/2,d=i/2,f=[e.f`${c},${l-d}`,e.f`${c+u},${l}`,e.f`${c},${l+d}`,e.f`${c-u},${l}`].join(` `);return e.f`<polygon points="${f}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Gn(t,n,r,i,a,o,s){return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" `+e.f`rx="0" ry="0" fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+8}" y1="${n}" x2="${t+8}" y2="${n+i}" `+e.f`stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+r-8}" y1="${n}" x2="${t+r-8}" y2="${n+i}" `+e.f`stroke="${o}" stroke-width="${s}" />`}function Kn(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2,d=u-5;return e.f`<circle cx="${c}" cy="${l}" r="${u}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<circle cx="${c}" cy="${l}" r="${d}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function qn(t,n,r,i,a,o,s){let c=i/4,l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i/2}`,e.f`${t+r-c},${n+i}`,e.f`${t+c},${n+i}`,e.f`${t},${n+i/2}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Jn(t,n,r,i,a,o,s){let c=t+r/2,l=n+7,u=i-14;return e.f`<rect x="${t}" y="${l}" width="${r}" height="${u}" `+e.f`fill="${a}" stroke="none" />`+e.f`\n<line x1="${t}" y1="${l}" x2="${t}" y2="${l+u}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<line x1="${t+r}" y1="${l}" x2="${t+r}" y2="${l+u}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<ellipse cx="${c}" cy="${n+i-7}" rx="${r/2}" ry="${7}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`+e.f`\n<ellipse cx="${c}" cy="${l}" rx="${r/2}" ry="${7}" `+e.f`fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Yn(t,n,r,i,a,o,s){let c=[e.f`${t+12},${n}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t+12},${n+i}`,e.f`${t},${n+i/2}`].join(` `);return e.f`<polygon points="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Xn(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Zn(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r-c},${n+i}`,e.f`${t+c},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function Qn(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t+c},${n}`,e.f`${t+r},${n}`,e.f`${t+r-c},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function $n(t,n,r,i,a,o,s){let c=r*.15,l=[e.f`${t},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+i}`,e.f`${t+c},${n+i}`].join(` `);return e.f`<polygon points="${l}" fill="${a}" stroke="${o}" stroke-width="${s}" />`}function U(t,n,r){return e.f`fill="${t}" stroke="${n}" stroke-width="${r}"`}function er(t,n,r,i,a,o,s){let c=Math.min(10,i*.16),l=n+i-c,u=e.f`M ${t} ${n} L ${t+r} ${n} L ${t+r} ${l} `+e.f`C ${t+r*.75} ${l+c*1.8} ${t+r*.25} ${l-c*.8} ${t} ${l} Z`;return e.f`<path d="${u}" ${U(a,o,s)} />`}function tr(t,n,r,i,a,o,s,c){let l=r-10,u=i-10,d=[];for(let r=2;r>=1;r--)d.push(e.f`<rect x="${t+5*r}" y="${n+5*(2-r)}" width="${l}" height="${u}" `+e.f`${U(a,o,s)} />`);return d.push(c?er(t,n+10,l,u,a,o,s):e.f`<rect x="${t}" y="${n+10}" width="${l}" height="${u}" ${U(a,o,s)} />`),d.join(`
|
|
18
|
+
`)}function nr(t,n,r,i,a,o,s){let c=Math.min(14,r*.12,i*.3),l=[e.f`${t+c},${n}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t},${n+c}`].join(` `);return e.f`<polygon points="${l}" ${U(a,o,s)} />`}function rr(t,n,r,i,a,o,s){let c=Math.min(12,r*.12);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${U(a,o,s)} />\n`+e.f`<line x1="${t+c}" y1="${n}" x2="${t+c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />`}function ir(t,n,r,i,a,o,s){let c=n+Math.min(16,i*.3);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${U(a,o,s)} />\n`+e.f`<line x1="${t}" y1="${c}" x2="${t+r}" y2="${c}" stroke="${o}" stroke-width="${s}" />`}function ar(t,n,r,i,a,o,s){let c=t+Math.min(16,r*.16),l=n+Math.min(14,i*.28);return e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" ${U(a,o,s)} />\n`+e.f`<line x1="${c}" y1="${n}" x2="${c}" y2="${n+i}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<line x1="${t}" y1="${l}" x2="${t+r}" y2="${l}" stroke="${o}" stroke-width="${s}" />`}function or(t,n,r,i,a,o,s,c){let l=c?[e.f`${t},${n}`,e.f`${t+r},${n}`,e.f`${t+r/2},${n+i}`]:[e.f`${t+r/2},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`];return e.f`<polygon points="${l.join(` `)}" ${U(a,o,s)} />`}function sr(t,n,r,i,a){let o=Math.min(r,i)/2-2;return e.f`<circle cx="${t+r/2}" cy="${n+i/2}" r="${o}" fill="${a}" stroke="${a}" />`}function cr(t,n,r,i,a,o,s){let c=t+r/2,l=n+i/2,u=Math.min(r,i)/2-2,d=u/Math.SQRT2;return e.f`<circle cx="${c}" cy="${l}" r="${u}" ${U(a,o,s)} />\n`+e.f`<line x1="${c-d}" y1="${l-d}" x2="${c+d}" y2="${l+d}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<line x1="${c+d}" y1="${l-d}" x2="${c-d}" y2="${l+d}" stroke="${o}" stroke-width="${s}" />`}function lr(t,n,r,i,a){let o=Math.min(8,i);return e.f`<rect x="${t}" y="${n+(i-o)/2}" width="${r}" height="${o}" fill="${a}" stroke="${a}" />`}function ur(t,n,r,i,a,o,s){let c=[e.f`${t},${n}`,e.f`${t+r-6},${n}`,e.f`${t+r},${n+6}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${c}" fill="${a}" stroke="${o}" stroke-width="${s}" />\n`+e.f`<polygon points="${t+r-6},${n} ${t+r},${n+6} ${t+r-6},${n+6}" fill="var(--_inner-stroke)" stroke="${o}" stroke-width="${s}" />`}function dr(t,n,r,i,a,o,s){let c=Math.min(14,r*.12,i*.3),l=[e.f`${t+c},${n}`,e.f`${t+r-c},${n}`,e.f`${t+r},${n+c}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`,e.f`${t},${n+c}`].join(` `);return e.f`<polygon points="${l}" ${U(a,o,s)} />`}function fr(t,n,r,i,a,o,s){let c=Math.min(12,i*.3),l=[e.f`${t},${n+c}`,e.f`${t+r},${n}`,e.f`${t+r},${n+i}`,e.f`${t},${n+i}`].join(` `);return e.f`<polygon points="${l}" ${U(a,o,s)} />`}function pr(t,n,r,i,a,o,s){let c=Math.min(8,i*.14),l=e.f`M ${t} ${n+c} `+e.f`C ${t+r*.25} ${n-c} ${t+r*.75} ${n+c*2} ${t+r} ${n+c} `+e.f`L ${t+r} ${n+i-c} `+e.f`C ${t+r*.75} ${n+i+c} ${t+r*.25} ${n+i-c*2} ${t} ${n+i-c} Z`;return e.f`<path d="${l}" ${U(a,o,s)} />`}function mr(t,n,r,i,a,o,s){let c=Math.min(14,r*.12),l=e.f`M ${t+c} ${n} L ${t+r} ${n} `+e.f`Q ${t+r-c*1.4} ${n+i/2} ${t+r} ${n+i} `+e.f`L ${t+c} ${n+i} `+e.f`Q ${t+c*1.4} ${n+i/2} ${t+c} ${n} Z`;return e.f`<path d="${l}" ${U(a,o,s)} />`}function hr(t,n,r,i,a,o,s){let c=i/2,l=Math.max(0,r-c),u=e.f`M ${t} ${n} L ${t+l} ${n} `+e.f`A ${c} ${c} 0 0 1 ${t+l} ${n+i} `+e.f`L ${t} ${n+i} Z`;return e.f`<path d="${u}" ${U(a,o,s)} />`}function gr(t,n,r,i,a,o,s,c){let l=Math.min(10,r*.12),u=[e.f`<rect x="${t}" y="${n}" width="${r}" height="${i}" fill="none" stroke="none" />`],d=e.f`M ${t+l} ${n} Q ${t} ${n} ${t} ${n+i*.25} `+e.f`Q ${t} ${n+i/2} ${t-l*.4} ${n+i/2} `+e.f`Q ${t} ${n+i/2} ${t} ${n+i*.75} `+e.f`Q ${t} ${n+i} ${t+l} ${n+i}`,f=e.f`M ${t+r-l} ${n} Q ${t+r} ${n} ${t+r} ${n+i*.25} `+e.f`Q ${t+r} ${n+i/2} ${t+r+l*.4} ${n+i/2} `+e.f`Q ${t+r} ${n+i/2} ${t+r} ${n+i*.75} `+e.f`Q ${t+r} ${n+i} ${t+r-l} ${n+i}`;return(c===`left`||c===`both`)&&u.push(e.f`<path d="${d}" fill="none" stroke="${o}" stroke-width="${s}" />`),(c===`right`||c===`both`)&&u.push(e.f`<path d="${f}" fill="none" stroke="${o}" stroke-width="${s}" />`),u.join(`
|
|
19
|
+
`)}function _r(t,n,r,i,a,o,s){let c=[e.f`${t+r*.42},${n}`,e.f`${t+r},${n}`,e.f`${t+r*.62},${n+i*.42}`,e.f`${t+r},${n+i*.42}`,e.f`${t+r*.3},${n+i}`,e.f`${t+r*.5},${n+i*.55}`,e.f`${t},${n+i*.55}`].join(` `);return e.f`<polygon points="${c}" ${U(a,o,s)} />`}function vr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2-2;return e.f`<circle cx="${a}" cy="${o}" r="${s}" fill="var(--_text)" stroke="none" />`}function yr(t,n,r,i){let a=t+r/2,o=n+i/2,s=Math.min(r,i)/2-2,c=s-4;return e.f`<circle cx="${a}" cy="${o}" r="${s}" `+e.f`fill="none" stroke="var(--_text)" stroke-width="${M.innerBox*2}" />`+e.f`\n<circle cx="${a}" cy="${o}" r="${c}" fill="var(--_text)" stroke="none" />`}function br(t,n,r){if((t.shape===`state-start`||t.shape===`state-end`)&&!t.label)return``;let i=t.x+t.width/2,a=t.y+t.height/2,o=(0,e.escapeAttr)(t.inlineStyle?.color??(0,e.getReadableTextColor)(t.inlineStyle?.fill,`var(--_text)`)),s=e.f`text-anchor="middle" font-size="${r.nodeLabel}" font-weight="${A.nodeLabel}" fill="${o}"`,c=t.inlineStyle?.[`font-family`];return c&&(s+=e.f` style="font-family: ${(0,e.escapeAttr)(c)};"`),(0,e.renderMultilineText)(t.label,i,a,r.nodeLabel,s)}function xr(t){return(0,e.escapeAttr)(t).replace(/\r/g,` `).replace(/\n/g,` `).replace(/\t/g,`	`)}function Sr(t,n){return n===void 0?t:t.replace(`<svg `,e.f`<svg data-src="${xr(n)}" `)}var Cr=class{raw=new Map;resolved=new Map;inProgress=new Set;declare(e,t){this.raw.set(e,t),this.resolved.delete(e)}lookup(e){if(this.resolved.has(e))return this.resolved.get(e);let t=this.raw.get(e);if(t===void 0||this.inProgress.has(e))return;this.inProgress.add(e);let n=Ar(t,this).trim();this.inProgress.delete(e);let r=!/\bvar\(|\bcolor-mix\(/.test(n);return this.resolved.set(e,r?n:void 0),r?n:void 0}};function wr(e,t){let n=0;for(let r=t;r<e.length;r++){let t=e[r];if(t===`(`)n++;else if(t===`)`&&(n--,n===0))return r}return-1}function Tr(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}var Er=`(?<![\\w-])(var|color-mix)\\(`;function Dr(e,t){let[n,...r]=Tr(e),i=(n??``).trim(),a=t.lookup(i);return a===void 0?r.length>0?r.join(`,`).trim():null:a}function Or(e){let t=e.trim().split(/\s+/),n,r;for(let e of t)if(/^[\d.]+%$/.test(e)){if(r!==void 0)return null;r=Number(e.slice(0,-1))}else{if(n!==void 0)return null;n=e}return n===void 0?null:{color:n,pct:r}}function kr(t){let n=Tr(t);if(n.length!==3)return null;let[r,i,a]=n;if(r===void 0||i===void 0||a===void 0||!/^\s*in\s+srgb\s*$/i.test(r))return null;let o=Or(i),s=Or(a);if(!o||!s)return null;let c=(0,e.parseCssColor)(o.color),l=(0,e.parseCssColor)(s.color);if(!c||!l)return null;let u=(0,e.mixSrgb)(c,l,o.pct,s.pct);return u?(0,e.formatCssColor)(u):null}function Ar(e,t){let n=``,r=0,i=new RegExp(Er,`g`),a;for(;(a=i.exec(e))!==null;){let o=a[1];if(o===void 0)continue;let s=a.index,c=s+o.length,l=wr(e,c);if(l===-1)break;let u=Ar(e.slice(c+1,l),t),d=o===`var`?Dr(u,t):kr(u);n+=e.slice(r,s),n+=d??`${o}(${u})`,r=l+1,i.lastIndex=r}return n+e.slice(r)}function jr(e,t){let n=new Cr;for(let[e,r]of Object.entries(t))n.declare(e,r);return Ar(e,n)}var Mr=/(--[\w-]+)\s*:\s*([^;{}]+)/g,Nr=/(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g,Pr=new Set([`data-src`]);function Fr(e,t){Mr.lastIndex=0;let n;for(;(n=Mr.exec(e))!==null;){let[,e,r]=n;e!==void 0&&r!==void 0&&t.declare(e,r.trim())}}function Ir(e,t){return e.replace(Nr,(e,n,r,i,a)=>{if(Pr.has(r))return e;let o=a[0]??`"`;return`${n}${r}${i}${o}${Ar(a.slice(1,-1),t)}${o}`})}function Lr(e,t){let n=new Cr;n.declare(`--bg`,t.bg),n.declare(`--fg`,t.fg),t.line&&n.declare(`--line`,t.line),t.accent&&n.declare(`--accent`,t.accent),t.muted&&n.declare(`--muted`,t.muted),t.surface&&n.declare(`--surface`,t.surface),t.border&&n.declare(`--border`,t.border);for(let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)){let e=t[1];e!==void 0&&Fr(e,n)}for(let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)){let e=t[1];e!==void 0&&Fr(e.slice(1,-1),n)}let r=``,i=0;for(;i<e.length;){let t=e.indexOf(`<`,i);if(t===-1)break;if(r+=e.slice(i,t),e.startsWith(`<style`,t)){let a=e.indexOf(`>`,t),o=e.indexOf(`</style>`,t);if(a===-1||o===-1)break;r+=e.slice(t,a+1),r+=Ar(e.slice(a+1,o),n),r+=`</style>`,i=o+8;continue}let a=-1,o=null;for(let n=t+1;n<e.length;n++){let t=e[n];if(o!==null)t===o&&(o=null);else if(t===`"`||t===`'`)o=t;else if(t===`>`){a=n;break}}if(a===-1)break;let s=e.slice(t,a+1);r+=s.startsWith(`<!`)||s.startsWith(`<?`)||s.startsWith(`</`)?s:Ir(s,n),i=a+1}return r+e.slice(i)}var W={padding:40,boxPadX:8,headerBaseHeight:32,annotationHeight:16,memberRowHeight:20,sectionPadY:8,emptySectionHeight:8,minWidth:120,memberFontSize:11,memberFontWeight:400,nodeSpacing:40,layerSpacing:60,notePadX:10,notePadY:6,namespaceTitleHeight:28,namespacePad:16,namespaceTitleFontSize:12};function Rr(e){return`note ${e}`}function zr(e){return`${e} link`}function Br(e){return`namespace ${e}`}function Vr(e){let t=new Set(e.classes.map(e=>e.id)),n=new Set,r=[];for(let[i,a]of e.namespaces.entries()){let e=[];for(let r of a.classIds)!t.has(r)||n.has(r)||(n.add(r),e.push(r));e.length>0&&r.push({id:Br(i),name:a.name,classIds:e})}return r}function Hr(e){return R(e.relationships.map(e=>({source:e.from,target:e.to})),e.classes.map(e=>e.id))}function Ur(t,n){let r=new Map,i=new Map,a=k(n.fontSizes);for(let e of t.classes){let t=e.annotation?W.headerBaseHeight+W.annotationHeight:W.headerBaseHeight,n=e.attributes.length>0?e.attributes.length*W.memberRowHeight+W.sectionPadY:W.emptySectionHeight,i=e.methods.length>0?e.methods.length*W.memberRowHeight+W.sectionPadY:W.emptySectionHeight,o=w(e.label,a.nodeLabel,A.nodeLabel),s=qr(e.attributes),c=qr(e.methods),l=Math.max(W.minWidth,o+W.boxPadX*2,s+W.boxPadX*2,c+W.boxPadX*2),u=t+n+i;r.set(e.id,{width:l,height:u,headerHeight:t,attrHeight:n,methodHeight:i})}let o=Vr(t),s=new Map;for(let e of o)for(let t of e.classIds)s.set(t,e.id);let c=new Map,l=[];for(let e of o){let t=w(e.name,W.namespaceTitleFontSize,A.groupHeader)+W.namespacePad*2,n={id:e.id,children:[],layoutOptions:{"elk.padding":te({top:W.namespaceTitleHeight+W.namespacePad/2,left:W.namespacePad,bottom:W.namespacePad,right:W.namespacePad}),"elk.nodeSize.constraints":`MINIMUM_SIZE`,"elk.nodeSize.minimum":`(${Math.ceil(t)}, 0)`}};c.set(e.id,n),l.push(n)}for(let[e,t]of r){let n=re(e,t),r=c.get(s.get(e)??``);r?.children?r.children.push(n):l.push(n)}let u={fontSize:a.edgeLabel},d=Hr(t),f=[];for(let[e,n]of t.relationships.entries()){let t=d.has(e);f.push(oe({id:`e${e}`,source:t?n.to:n.from,target:t?n.from:n.to,label:n.label,labelStyle:u}))}let p=new Set(r.keys());for(let[n,r]of t.notes.entries()){let t=Rr(n),o=(0,e.measureMultilineText)(r.text,a.edgeLabel,A.edgeLabel),s={width:o.width+W.notePadX*2,height:o.height+W.notePadY*2};i.set(t,s),l.push(re(t,s)),r.forClass!==void 0&&p.has(r.forClass)&&f.push(oe({id:zr(t),source:t,target:r.forClass,labelStyle:u}))}return{elkGraph:{id:`root`,layoutOptions:{...ne({direction:B(void 0,z.class),nodeSpacing:W.nodeSpacing,layerSpacing:W.layerSpacing,padding:W.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.separateConnectedComponents":`false`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:l,edges:f},classSizes:r,noteSizes:i,namespaces:o}}function Wr(t,n,r,i,a){let o=new Map;for(let e of n.classes)o.set(e.id,e);let s=new Set(a.map(e=>e.id)),c=new Map,l=[];for(let e of t.children??[])if(s.has(e.id)){let t=e.x??0,n=e.y??0;c.set(e.id,{x:t,y:n});for(let r of e.children??[])l.push({...r,x:(r.x??0)+t,y:(r.y??0)+n})}else l.push(e);let u=e=>{let t=e.container;return t&&c.get(t)||{x:0,y:0}},d=[];for(let e of a){let n=(t.children??[]).find(t=>t.id===e.id);n&&d.push({name:e.name,classIds:e.classIds,x:n.x??0,y:n.y??0,width:n.width??0,height:n.height??0})}let f=[];for(let t of l){let i=o.get(t.id);if(i){let a=r.get(i.id);if(!a)throw Error(`Missing computed size for class "${i.id}"`);f.push({id:i.id,label:i.label,annotation:i.annotation,attributes:i.attributes,methods:i.methods,x:t.x??0,y:t.y??0,width:t.width??a.width,height:t.height??a.height,headerHeight:a.headerHeight,attrHeight:a.attrHeight,methodHeight:a.methodHeight,interaction:n.interactions.get(i.id),inlineStyle:(0,e.resolveNodeStyle)(i.id,n),className:n.classAssignments.get(i.id)})}}let p=[],m=Hr(n),h=t.edges??[];for(let[e,t]of n.relationships.entries()){let n=h[e];if(!n)throw Error(`Missing ELK edge for relationship ${e}`);let r=u(n),i=He(n,r.x,r.y),a=m.has(e)?i.reverse():i,o=Ue(n,r.x,r.y);p.push({from:t.from,to:t.to,type:t.type,markerAt:t.markerAt,label:t.label,fromCardinality:t.fromCardinality,toCardinality:t.toCardinality,points:a,labelPosition:o})}let g=new Map;for(let e of h.slice(n.relationships.length))g.set(e.id,e);let _=new Map;for(let e of l)_.set(e.id,e);let v=[];for(let[e,t]of n.notes.entries()){let n=Rr(e),r=_.get(n),a=i.get(n);if(!r||!a)throw Error(`Missing layout for note ${e}`);let o=g.get(zr(n));v.push({id:n,text:t.text,...o&&t.forClass!==void 0?{forClass:t.forClass}:{},x:r.x??0,y:r.y??0,width:r.width??a.width,height:r.height??a.height,...o?{linkPoints:He(o,u(o).x,u(o).y)}:{}})}return{width:t.width??600,height:t.height??400,classes:f,relationships:p,notes:v,namespaces:d}}function Gr(e,t={}){if(e.classes.length===0&&e.notes.length===0)return{width:0,height:0,classes:[],relationships:[],notes:[],namespaces:[]};let{elkGraph:n,classSizes:r,noteSizes:i,namespaces:a}=Ur(e,t);return Wr(x(n,t.layoutCache),e,r,i,a)}function Kr(e){return e.length*Math.ceil(T(`M`,W.memberFontSize))}function qr(e){if(e.length===0)return 0;let n=0;for(let r of e){let e=Kr((0,t.formatClassMember)(r));e>n&&(n=e)}return n}var Jr={memberSize:11,memberWeight:400,annotationSize:10,annotationWeight:500};function Yr(t,n,r=`Inter`,i=!1,a=O,o,s,c,l=!0,u={}){let d=[],f=l&&t.classes.some(t=>!!(0,e.safeHref)(t.interaction?.href));d.push(Sr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,f,u.styleAttribute,u.description),o)),d.push(F(r,!0,u.nonce)),d.push(`<defs>`),d.push(Zr()),d.push(`</defs>`);for(let e of t.namespaces)d.push(Xr(e));for(let e of t.relationships)d.push(ii(e));for(let e of t.notes)d.push(ri(e));for(let e of t.classes)d.push(Qr(e,a,l));for(let e of t.notes)d.push(ni(e,a));for(let e of t.relationships)d.push(si(e,a));return d.push(`</svg>`),d.join(`
|
|
20
|
+
`)}function Xr(t){let{x:n,y:r,width:i,height:a}=t,o=W.namespaceTitleHeight,s=M.outerBox;return[e.f`<g class="class-namespace" data-id="${(0,e.escapeAttr)(t.name)}" data-label="${(0,e.escapeAttr)(t.name)}">`,e.f` <rect x="${n}" y="${r}" width="${i}" height="${a}" rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,e.f` <rect x="${n}" y="${r}" width="${i}" height="${o}" rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${s}" />`,e.f` <text x="${n+W.namespacePad}" y="${r+o/2}" dy="${N}" font-size="${W.namespaceTitleFontSize}" font-weight="${A.groupHeader}" fill="var(--_text-sec)">${ui(t.name)}</text>`,`</g>`].join(`
|
|
21
|
+
`)}function Zr(){return` <marker id="cls-inherit" markerWidth="12" markerHeight="10" refX="12" refY="5" orient="auto-start-reverse">
|
|
22
|
+
<polygon points="0 0, 12 5, 0 10" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
|
|
23
|
+
</marker>
|
|
24
|
+
<marker id="cls-composition" markerWidth="18" markerHeight="14" refX="16.5" refY="7" orient="auto-start-reverse">
|
|
25
|
+
<polygon points="9 1.5, 16.5 7, 9 12.5, 1.5 7" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="1" />
|
|
26
|
+
</marker>
|
|
27
|
+
<marker id="cls-aggregation" markerWidth="18" markerHeight="14" refX="16.5" refY="7" orient="auto-start-reverse">
|
|
28
|
+
<polygon points="9 1.5, 16.5 7, 9 12.5, 1.5 7" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="1.5" />
|
|
29
|
+
</marker>
|
|
30
|
+
<marker id="cls-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto-start-reverse">
|
|
31
|
+
<polyline points="0 0, 8 3, 0 6" fill="none" stroke="var(--_arrow)" stroke-width="1.5" />
|
|
32
|
+
</marker>`}function Qr(t,n,r=!0){let{x:i,y:a,width:o,height:s,headerHeight:c,attrHeight:l,inlineStyle:u}=t,d=[],f=t.interaction,p=(0,e.escapeAttr)(u?.fill??`var(--_node-fill)`),m=(0,e.escapeAttr)(u?.stroke??`var(--_node-stroke)`),h=(0,e.escapeAttr)(u?.[`stroke-width`]??String(M.outerBox)),g=u?.fill?p:`var(--_group-hdr)`,_=u?.color?(0,e.escapeAttr)(u.color):u?.fill?(0,e.escapeAttr)((0,e.getReadableTextColor)(u.fill,`var(--_text)`)):void 0,v=t.annotation?e.f` data-annotation="${(0,e.escapeAttr)(t.annotation)}"`:``,y=(0,e.sanitizeClassName)(t.className),b=[e.f`class="${y?e.f`class-node ${y}`:`class-node`}"`,e.f`data-id="${(0,e.escapeAttr)(t.id)}"`,e.f`data-label="${(0,e.escapeAttr)(t.label)}"`];d.push(e.f`<g ${b.join(` `)}${v}>`);let x=r?(0,e.safeHref)(f?.href):void 0;if(x){let t=f?.target?e.f` target="${(0,e.escapeAttr)(f.target)}"`:``;d.push(e.f` <a href="${(0,e.escapeAttr)(x)}"${t}>`)}r&&f?.tooltip&&d.push(e.f` <title>${ui(f.tooltip)}</title>`),d.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" `+e.f`rx="0" ry="0" fill="${p}" stroke="${m}" stroke-width="${h}" />`),d.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${c}" `+e.f`rx="0" ry="0" fill="${g}" stroke="${m}" stroke-width="${h}" />`);let S=a+c/2;if(t.annotation){let n=a+12;d.push(e.f` <text x="${i+o/2}" y="${n}" text-anchor="middle" dy="${N}" `+e.f`font-size="${Jr.annotationSize}" font-weight="${Jr.annotationWeight}" `+e.f`font-style="italic" fill="${_??`var(--_text-muted)`}"><<${ui(t.annotation)}>></text>`),S=a+c/2+6}d.push(` `+(0,e.renderMultilineText)(t.label,i+o/2,S,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="700" fill="${_??`var(--_text)`}"`));let C=a+c;d.push(e.f` <line x1="${i}" y1="${C}" x2="${i+o}" y2="${C}" `+e.f`stroke="${m}" stroke-width="${M.innerBox}" />`);for(let e=0;e<t.attributes.length;e++){let n=t.attributes[e],r=C+4+e*20+10;d.push(` `+ei(n,i+W.boxPadX,r,_))}let w=C+l;d.push(e.f` <line x1="${i}" y1="${w}" x2="${i+o}" y2="${w}" `+e.f`stroke="${m}" stroke-width="${M.innerBox}" />`);for(let e=0;e<t.methods.length;e++){let n=t.methods[e],r=w+4+e*20+10;d.push(` `+ei(n,i+W.boxPadX,r,_))}return x&&d.push(` </a>`),d.push(`</g>`),d.join(`
|
|
33
|
+
`)}var $r=700;function ei(t,n,r,i){let a=t.isAbstract?` font-style="italic"`:``,o=t.isStatic?` text-decoration="underline"`:``,s=i??`var(--_text-faint)`,c=i??`var(--_text-sec)`,l=i??`var(--_text-muted)`,u=[];t.visibility&&u.push(e.f`<tspan fill="${c}" font-weight="${$r}">${ui(t.visibility)}</tspan><tspan fill="${s}"> </tspan>`);let d=t.isMethod?e.f`${t.name}(${t.params||``})`:t.name;return u.push(e.f`<tspan fill="${c}">${ui(d)}</tspan>`),t.type&&(u.push(e.f`<tspan fill="${s}">: </tspan>`),u.push(e.f`<tspan fill="${l}">${ui(t.type)}</tspan>`)),e.f`<text x="${n}" y="${r}" class="mono" dy="${N}" `+e.f`font-size="${Jr.memberSize}" font-weight="${Jr.memberWeight}"${a}${o}>`+e.f`${u.join(``)}</text>`}var ti=6;function ni(t,n){let{x:r,y:i,width:a,height:o}=t,s=t.forClass===void 0?``:e.f` data-for="${(0,e.escapeAttr)(t.forClass)}"`,c=[e.f`${r},${i}`,e.f`${r+a-ti},${i}`,e.f`${r+a},${i+ti}`,e.f`${r+a},${i+o}`,e.f`${r},${i+o}`].join(` `),l=e.f`${r+a-ti},${i} ${r+a},${i+ti} `+e.f`${r+a-ti},${i+ti}`;return e.f`<g class="class-note"${s}>`+e.f`\n <polygon points="${c}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${M.innerBox}" />`+e.f`\n <polygon points="${l}" `+e.f`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${M.innerBox}" />`+e.f`\n ${(0,e.renderMultilineText)(t.text,r+a/2,i+o/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${A.edgeLabel}" fill="var(--_text-muted)"`)}`+`
|
|
34
|
+
</g>`}function ri(t){if(!t.linkPoints||t.linkPoints.length<2)return``;let n=t.linkPoints.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.forClass===void 0?``:e.f` data-for="${(0,e.escapeAttr)(t.forClass)}"`;return e.f`<polyline class="class-note-link"${r} points="${n}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${M.connector}" stroke-dasharray="2 3" />`}function ii(t){if(t.points.length<2)return``;let n=t.points.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.type===`dependency`||t.type===`realization`?` stroke-dasharray="6 4"`:``,i=ai(t.type,t.markerAt),a=[`class="class-relationship"`,e.f`data-from="${(0,e.escapeAttr)(t.from)}"`,e.f`data-to="${(0,e.escapeAttr)(t.to)}"`,e.f`data-type="${t.type}"`,e.f`data-marker-at="${t.markerAt}"`];return t.label&&a.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.fromCardinality&&a.push(e.f`data-from-cardinality="${(0,e.escapeAttr)(t.fromCardinality)}"`),t.toCardinality&&a.push(e.f`data-to-cardinality="${(0,e.escapeAttr)(t.toCardinality)}"`),e.f`<polyline ${a.join(` `)} points="${n}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${M.connector}"${r}${i} />`}function ai(t,n){let r=oi(t);return r?n===`from`?e.f` marker-start="url(#${r})"`:e.f` marker-end="url(#${r})"`:``}function oi(e){switch(e){case`inheritance`:case`realization`:return`cls-inherit`;case`composition`:return`cls-composition`;case`aggregation`:return`cls-aggregation`;case`association`:case`dependency`:return`cls-arrow`;default:return null}}function si(t,n){if(!t.label&&!t.fromCardinality&&!t.toCardinality||t.points.length<2)return``;let r=[];if(t.label){let i=t.labelPosition??ci(t.points);r.push((0,e.renderMultilineText)(t.label,i.x,i.y-8,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${A.edgeLabel}" fill="var(--_text-muted)"`))}if(t.fromCardinality&&t.points.length>=2){let i=t.points[0],a=t.points[1],o=li(i,a);r.push((0,e.renderMultilineText)(t.fromCardinality,i.x+o.x,i.y+o.y,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${A.edgeLabel}" fill="var(--_text-muted)"`))}if(t.toCardinality&&t.points.length>=2){let i=t.points[t.points.length-1],a=t.points[t.points.length-2],o=li(i,a);r.push((0,e.renderMultilineText)(t.toCardinality,i.x+o.x,i.y+o.y,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${A.edgeLabel}" fill="var(--_text-muted)"`))}return r.join(`
|
|
35
|
+
`)}function ci(e){return e.length===0?{x:0,y:0}:e[Math.floor(e.length/2)]}function li(e,t){let n=t.x-e.x,r=t.y-e.y;return Math.abs(n)>Math.abs(r)?{x:n>0?14:-14,y:-10}:{x:-14,y:r>0?14:-14}}var ui=e.escapeXml,di={padding:40,boxPadX:14,headerHeight:34,rowHeight:22,minWidth:140,attrFontSize:11,attrFontWeight:400,nodeSpacing:70,layerSpacing:90};function fi(e){return e.length*Math.ceil(T(`M`,di.attrFontSize))}function pi(e,t){let n=new Map,r=k(t.fontSizes);for(let t of e.entities){let e=w(t.label,r.nodeLabel,A.nodeLabel),i=0;for(let e of t.attributes){let t=fi(`${e.type} ${e.name}${e.keys.length>0?` `+e.keys.join(`,`):``}`);t>i&&(i=t)}let a=Math.max(di.minWidth,e+di.boxPadX*2,i+di.boxPadX*2),o=di.headerHeight+Math.max(t.attributes.length,1)*di.rowHeight;n.set(t.id,{width:a,height:o})}let i=[];for(let[e,t]of n)i.push(re(e,t));let a={fontSize:r.edgeLabel},o=[];for(let[t,n]of e.relationships.entries())o.push(oe({id:`e${t}`,source:n.entity1,target:n.entity2,label:n.label,labelStyle:a}));return{elkGraph:{id:`root`,layoutOptions:{...ne({direction:B(e.direction,z.er),nodeSpacing:di.nodeSpacing,layerSpacing:di.layerSpacing,padding:di.padding}),"elk.edgeLabels.placement":`CENTER`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.separateConnectedComponents":`false`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},children:i,edges:o},entitySizes:n}}function mi(e,t,n){let r=new Map;for(let e of t.entities)r.set(e.id,e);let i=[];for(let t of e.children??[]){let e=r.get(t.id);if(e){let r=n.get(e.id);if(!r)throw Error(`Missing computed size for entity "${e.id}"`);i.push({id:e.id,label:e.label,attributes:e.attributes,x:t.x??0,y:t.y??0,width:t.width??r.width,height:t.height??r.height,headerHeight:di.headerHeight,rowHeight:di.rowHeight})}}let a=[];for(let[n,r]of(e.edges??[]).entries()){let e=t.relationships[n],i=He(r);a.push({entity1:e.entity1,entity2:e.entity2,cardinality1:e.cardinality1,cardinality2:e.cardinality2,label:e.label,identifying:e.identifying,points:i})}return{width:e.width??600,height:e.height??400,entities:i,relationships:a}}function hi(e,t={}){if(e.entities.length===0)return{width:0,height:0,entities:[],relationships:[]};let{elkGraph:n,entitySizes:r}=pi(e,t);return mi(x(n,t.layoutCache),e,r)}var gi=70,_i={attrSize:11,attrWeight:400,keySize:9,keyWeight:600};function vi(t,n,r=`Inter`,i=!1,a=O,o,s,c,l={}){let u=[];u.push(Sr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push(F(r,!0,l.nonce)),u.push(`<defs>`),u.push(`</defs>`);for(let e of t.relationships)u.push(xi(e));for(let e of t.entities)u.push(yi(e,a));for(let e of t.relationships)u.push(Ci(e));for(let e of t.relationships)u.push(Si(e,a));return u.push(`</svg>`),u.join(`
|
|
36
|
+
`)}function yi(t,n){let{id:r,x:i,y:a,width:o,height:s,headerHeight:c,rowHeight:l,label:u,attributes:d}=t,f=[];f.push(e.f`<g class="entity" data-id="${(0,e.escapeAttr)(r)}" data-label="${(0,e.escapeAttr)(u)}">`),f.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" `+e.f`rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${M.outerBox}" />`),f.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${c}" `+e.f`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${M.outerBox}" />`),f.push(` `+(0,e.renderMultilineText)(u,i+o/2,a+c/2,n.nodeLabel,e.f`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="700" fill="var(--_text)"`));let p=a+c;f.push(e.f` <line x1="${i}" y1="${p}" x2="${i+o}" y2="${p}" `+e.f`stroke="var(--_node-stroke)" stroke-width="${M.innerBox}" />`);for(let e=0;e<d.length;e++){let t=d[e],n=p+e*l+l/2;f.push(` `+bi(t,i,n,o).replace(/\n/g,`
|
|
37
|
+
`))}return d.length===0&&f.push(e.f` <text x="${i+o/2}" y="${p+l/2}" text-anchor="middle" dy="${N}" `+e.f`font-size="${_i.attrSize}" fill="var(--_text-muted)" font-style="italic">(no attributes)</text>`),f.push(`</g>`),f.join(`
|
|
38
|
+
`)}function bi(t,n,r,i){let a=[],o=t.comment&&t.comment.length>0;if(t.comment&&t.comment.length>0){let n=t.comment.replace(/<br\s*\/?>/gi,`
|
|
39
|
+
`);a.push(e.f`<g><title>${Ei(n)}</title>`)}let s=0;t.keys.length>0&&(s=w(t.keys.join(`,`),_i.keySize,_i.keyWeight)+8,a.push(e.f`<rect x="${n+6}" y="${r-7}" width="${s}" height="14" rx="2" ry="2" `+`fill="var(--_key-badge)" />`),a.push(e.f`<text x="${n+6+s/2}" y="${r}" text-anchor="middle" dy="${N}" `+e.f`font-size="${_i.keySize}" font-weight="${_i.keyWeight}" fill="var(--_text-sec)">${t.keys.join(`,`)}</text>`));let c=n+8+(s>0?s+6:0);a.push(e.f`<text x="${c}" y="${r}" class="mono" dy="${N}" `+e.f`font-size="${_i.attrSize}" font-weight="${_i.attrWeight}">`+e.f`<tspan fill="var(--_text-muted)">${Ei(t.type)}</tspan></text>`);let l=n+i-8;return a.push(e.f`<text x="${l}" y="${r}" class="mono" text-anchor="end" dy="${N}" `+e.f`font-size="${_i.attrSize}" font-weight="${_i.attrWeight}">`+e.f`<tspan fill="var(--_text-sec)">${Ei(t.name)}</tspan></text>`),o&&a.push(`</g>`),a.join(`
|
|
40
|
+
`)}function xi(t){if(t.points.length<2)return``;let n=t.points.map(t=>e.f`${t.x},${t.y}`).join(` `),r=t.identifying?``:` stroke-dasharray="6 4"`,i=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``,a=[`class="er-relationship"`,e.f`data-entity1="${(0,e.escapeAttr)(t.entity1)}"`,e.f`data-entity2="${(0,e.escapeAttr)(t.entity2)}"`,e.f`data-cardinality1="${t.cardinality1}"`,e.f`data-cardinality2="${t.cardinality2}"`,e.f`data-identifying="${t.identifying}"`];return e.f`<polyline ${a.join(` `)}${i} points="${n}" fill="none" stroke="var(--_line)" `+e.f`stroke-width="${M.connector}"${r} />`}function Si(t,n){if(!t.label||t.points.length<2)return``;let r=Ti(t.points),i=(0,e.measureMultilineText)(t.label,n.edgeLabel,A.edgeLabel),a=i.width+8,o=i.height+6;return e.f`<rect x="${r.x-a/2}" y="${r.y-o/2}" width="${a}" height="${o}" rx="2" ry="2" `+`fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="0.5" />`+e.f`\n${(0,e.renderMultilineText)(t.label,r.x,r.y,n.edgeLabel,e.f`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${A.edgeLabel}" fill="color-mix(in srgb, var(--fg) ${gi}%, var(--bg))"`)}`}function Ci(e){if(e.points.length<2)return``;let t=[],n=e.points[0],r=e.points[1];t.push(wi(n,r,e.cardinality1));let i=e.points[e.points.length-1],a=e.points[e.points.length-2];return t.push(wi(i,a,e.cardinality2)),t.join(`
|
|
41
|
+
`)}function wi(t,n,r){let i=[],a=M.connector+.25,o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);if(c===0)return``;let l=o/c,u=s/c,d=-u,f=l,p=t.x-l*4,m=t.y-u*4,h=t.x-l*16,g=t.y-u*16,_=r===`one`||r===`zero-one`,v=r===`many`||r===`zero-many`,y=r===`zero-one`||r===`zero-many`;if(_){i.push(e.f`<line x1="${p+d*6}" y1="${m+f*6}" `+e.f`x2="${p-d*6}" y2="${m-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`);let t=p-l*4,n=m-u*4;i.push(e.f`<line x1="${t+d*6}" y1="${n+f*6}" `+e.f`x2="${t-d*6}" y2="${n-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(v){let t=p,n=m;i.push(e.f`<line x1="${t+d*7}" y1="${n+f*7}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`),i.push(e.f`<line x1="${t}" y1="${n}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`),i.push(e.f`<line x1="${t-d*7}" y1="${n-f*7}" `+e.f`x2="${h}" y2="${g}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(r===`many`){let n=t.x-l*20,r=t.y-u*20;i.push(e.f`<line x1="${n+d*6}" y1="${r+f*6}" `+e.f`x2="${n-d*6}" y2="${r-f*6}" `+e.f`stroke="var(--_line)" stroke-width="${a}" />`)}if(y){let n=v?20:12,r=t.x-l*n,o=t.y-u*n;i.push(e.f`<circle cx="${r}" cy="${o}" r="4" `+e.f`fill="var(--bg)" stroke="var(--_line)" stroke-width="${a}" />`)}return i.join(`
|
|
42
|
+
`)}function Ti(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];let t=0;for(let n=1;n<e.length;n++){let r=e[n].x-e[n-1].x,i=e[n].y-e[n-1].y;t+=Math.sqrt(r*r+i*i)}if(t===0)return e[0];let n=t/2,r=0;for(let t=1;t<e.length;t++){let i=e[t].x-e[t-1].x,a=e[t].y-e[t-1].y,o=Math.sqrt(i*i+a*a);if(r+o>=n){let s=o>0?(n-r)/o:0;return{x:e[t-1].x+i*s,y:e[t-1].y+a*s}}r+=o}return e[e.length-1]}var Ei=e.escapeXml,Di={padding:30,actorGap:140,actorHeight:40,actorPadX:16,headerGap:20,messageRowHeight:40,selfMessageHeight:30,activationWidth:10,blockPadX:10,blockPadTop:40,blockPadBottom:8,blockHeaderExtra:28,dividerExtra:24,noteWidth:60,notePadX:12,notePadY:6,noteGap:10,noteOffsetAfterMessage:8,noteStackGap:4,boxPad:10};function Oi(e){return e+8}var ki=14,Ai=4;function ji(t,n,r){return 14+(0,e.measureMultilineText)(t,n,r).height/2}function Mi(e){return{...Di,actorHeight:e?.actorHeight??Di.actorHeight,headerGap:e?.headerGap??Di.headerGap,messageRowHeight:e?.messageRowHeight??Di.messageRowHeight,noteOffsetAfterMessage:e?.noteOffsetAfterMessage??Di.noteOffsetAfterMessage,noteStackGap:e?.noteStackGap??Di.noteStackGap}}function Ni(e,t={}){if(e.actors.length===0)return{width:0,height:0,actors:[],lifelines:[],messages:[],activations:[],blocks:[],notes:[],boxes:[]};let n=Mi(t.sequence),r=k(t.fontSizes),i=e.actors.map(e=>{let t=w(e.label,r.nodeLabel,A.nodeLabel);return Math.max(t+n.actorPadX*2,80)}),a=[],o=n.padding+i[0]/2;for(let t=0;t<e.actors.length;t++){if(t>0){let e=Math.max(n.actorGap,(i[t-1]+i[t])/2+40);o+=e}a.push(o)}let s=new Map;for(let t=0;t<e.actors.length;t++)s.set(e.actors[t].id,t);let c=e.boxes.filter(e=>e.actorIds.length>0),l=c.some(e=>e.label!==``),u=c.length===0?0:n.boxPad+(l?Oi(r.edgeLabel):0),d=n.padding+u,f=e.actors.map((e,t)=>({id:e.id,label:e.label,type:e.type,x:a[t],y:d,width:i[t],height:n.actorHeight})),p=c.map(e=>{let t=e.actorIds.map(e=>s.get(e)??0),r=Math.min(...t),o=Math.max(...t),c=a[r]-i[r]/2-n.boxPad,l=a[o]+i[o]/2+n.boxPad,u={label:e.label,x:c,y:n.padding,width:l-c,height:0};return e.color!==void 0&&(u.color=e.color),u}),m=e.actors.map(e=>e.type===`actor`?ji(e.label,r.nodeLabel,A.nodeLabel):0),h=Math.max(0,...e.actors.map((e,t)=>e.createdAt===void 0?m[t]:0)),g=r.edgeLabel+12,_=d+n.actorHeight+Math.max(n.headerGap,h>0?h+Ai+g:0),v=[],y=new Map;for(let t of e.blocks){let e=y.get(t.startIndex)??0;y.set(t.startIndex,Math.max(e,n.blockHeaderExtra));for(let e of t.dividers){let t=y.get(e.index)??0;y.set(e.index,Math.max(t,n.dividerExtra))}}let b=new Map;for(let t of e.notes){let e=b.get(t.afterIndex)??[];e.push(t),b.set(t.afterIndex,e)}let x=[],S=b.get(-1);if(S&&S.length>0){let e=_;for(let t of S){let o=Math.max(n.noteWidth,w(t.text,r.edgeLabel,A.edgeLabel)+n.notePadX*2),c=r.edgeLabel+n.notePadY*2,l=s.get(t.actorIds[0]??``)??0,u;if(t.position===`left`)u=a[l]-i[l]/2-o-n.noteGap;else if(t.position===`right`)u=a[l]+i[l]/2+n.noteGap;else if(t.actorIds.length>1){let e=s.get(t.actorIds[t.actorIds.length-1]??``)??l;u=(a[l]+a[e])/2-o/2}else u=a[l]-o/2;x.push({text:t.text,x:u,y:e,width:o,height:c,position:t.position,actors:t.actorIds}),e+=c+n.noteStackGap}_=Math.max(_,e+n.messageRowHeight/2)}let C=new Map,T=[],E=n.activationWidth/2;function D(e,t){let n=C.get(e)??[];C.set(e,n);let r=n.length;n.push({startY:t,depth:r})}function O(e,t){let r=C.get(e);if(!r||r.length===0)return;let{startY:i,depth:o}=r.pop(),c=s.get(e)??0,l=o*E;T.push({actorId:e,x:a[c]-n.activationWidth/2+l,topY:i,bottomY:t,width:n.activationWidth,depth:o})}let ee=new Map;for(let t of e.activations){let e=ee.get(t.afterIndex)??[];e.push(t),ee.set(t.afterIndex,e)}function j(e,t){for(let n of ee.get(e)??[])n.kind===`start`?D(n.actorId,t):O(n.actorId,t)}j(-1,_);for(let t=0;t<e.messages.length;t++){let o=e.messages[t],c=s.get(o.from)??0,l=s.get(o.to)??0,u=o.from===o.to,d=y.get(t)??0;d>0&&(_+=d);let f=a[c],p=a[l],m=!u&&e.actors[l].createdAt===t;if(m){let e=i[l]/2;p+=f<p?-e:e}v.push({from:o.from,to:o.to,label:o.label,lineStyle:o.lineStyle,arrowHead:o.arrowHead,x1:f,x2:p,y:_,isSelf:u,bidirectional:o.bidirectional??!1,seqNumber:o.seqNumber}),o.activate&&D(o.to,_),o.deactivate&&O(o.from,_),j(t,_),_+=u?n.selfMessageHeight+n.messageRowHeight:n.messageRowHeight,m&&(_+=n.actorHeight/2);let h=b.get(t);if(h&&h.length>0){let e=u?n.selfMessageHeight:0,o=v[t].y+e+n.noteOffsetAfterMessage;for(let e of h){let t=Math.max(n.noteWidth,w(e.text,r.edgeLabel,A.edgeLabel)+n.notePadX*2),c=r.edgeLabel+n.notePadY*2,l=s.get(e.actorIds[0]??``)??0,u;if(e.position===`left`)u=a[l]-i[l]/2-t-n.noteGap;else if(e.position===`right`)u=a[l]+i[l]/2+n.noteGap;else if(e.actorIds.length>1){let n=s.get(e.actorIds[e.actorIds.length-1]??``)??l;u=(a[l]+a[n])/2-t/2}else u=a[l]-t/2;x.push({text:e.text,x:u,y:o,width:t,height:c,position:e.position,actors:e.actorIds}),o+=c+n.noteStackGap}_=Math.max(_,o+n.messageRowHeight/2)}}for(let[e,t]of C)for(let{startY:r,depth:i}of t){let t=s.get(e)??0,o=i*E;T.push({actorId:e,x:a[t]-n.activationWidth/2+o,topY:r,bottomY:_-n.messageRowHeight/2,width:n.activationWidth,depth:i})}T.sort((e,t)=>e.depth-t.depth);let M=e.blocks.map(t=>{let o=v[t.startIndex],c=v[t.endIndex],l=(o?.y??_)-n.blockPadTop,u=(c?.y??_)+n.blockPadBottom+12,d=new Set;for(let n=t.startIndex;n<=t.endIndex;n++){let t=e.messages[n];t&&(d.add(s.get(t.from)??0),d.add(s.get(t.to)??0))}if(d.size===0)for(let t=0;t<e.actors.length;t++)d.add(t);let f=Math.min(...d),p=Math.max(...d),m=a[f]-i[f]/2-n.blockPadX,h=a[p]+i[p]/2+n.blockPadX,g=t.dividers.map(e=>{let t=v[e.index],n=t?.y??_,i=28;if(e.label&&t?.label){let n=w(`[${e.label}]`,r.edgeLabel,A.edgeLabel),a=m+8,o=a+n,s=w(t.label,r.edgeLabel,A.edgeLabel),c=t.isSelf?t.x1+36:(t.x1+t.x2)/2-s/2,l=c+s;o>c&&a<l&&(i=36)}return{y:n-i,label:e.label}});return{type:t.type,label:t.label,x:m,y:l,width:h-m,height:u-l,dividers:g}}),N=x,P=_+n.padding,F=n.padding,I=0;for(let e of f)F=Math.min(F,e.x-e.width/2),I=Math.max(I,e.x+e.width/2);for(let e of M)F=Math.min(F,e.x),I=Math.max(I,e.x+e.width);for(let e of N)F=Math.min(F,e.x),I=Math.max(I,e.x+e.width);for(let e of p)F=Math.min(F,e.x),I=Math.max(I,e.x+e.width);for(let e of v)if(e.isSelf&&e.label){let t=e.x1+30+8,n=w(e.label,r.edgeLabel,A.edgeLabel);I=Math.max(I,t+n+8)}let L=F<n.padding?n.padding-F:0;if(L>0){for(let e of f)e.x+=L;for(let e of v)e.x1+=L,e.x2+=L;for(let e of T)e.x+=L;for(let e of M)e.x+=L;for(let e of N)e.x+=L;for(let e of p)e.x+=L;for(let e=0;e<a.length;e++)a[e]+=L}for(let t=0;t<e.actors.length;t++){let r=e.actors[t].createdAt;r!==void 0&&(f[t].y=(v[r]?.y??_)-n.actorHeight/2)}let R=e.actors.map((e,t)=>{let r=e.destroyedAt,i={actorId:e.id,x:a[t],topY:f[t].y+n.actorHeight+(m[t]>0?m[t]+Ai:0),bottomY:r===void 0?P-n.padding:v[r]?.y??_};return r!==void 0&&(i.destroyed=!0),i});for(let e of p)e.height=P-n.padding+n.boxPad-e.y;let z=I+L+n.padding;return{width:Math.max(z,200),height:Math.max(P,100),actors:f,lifelines:R,messages:v,activations:T,blocks:M,notes:N,boxes:p}}function Pi(t,n,r=`Inter`,i=!1,a=O,o,s,c,l={}){let u=[];u.push(Sr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description),o)),u.push((0,e.buildStyleBlock)(r,!1,l.nonce)),u.push(`<defs>`),u.push(Fi()),u.push(`</defs>`);for(let e of t.boxes)u.push($i(e,a));for(let e of t.blocks)u.push(ea(e,a));let d=Gi(t,a);for(let e of t.lifelines)u.push(qi(e,d));for(let e of t.activations)u.push(Yi(e));for(let e of t.messages)u.push(Xi(e,a));for(let e of t.notes)u.push(ta(e,a));for(let e of t.actors)u.push(Ii(e,a));return u.push(`</svg>`),u.join(`
|
|
43
|
+
`)}function Fi(){let t=P.width,n=P.height;return e.f` <marker id="seq-arrow" markerWidth="${t}" markerHeight="${n}" refX="${t}" refY="${n/2}" orient="auto-start-reverse">`+e.f`\n <polygon points="0 0, ${t} ${n/2}, 0 ${n}" fill="var(--_arrow)" />`+`
|
|
44
|
+
</marker>`+e.f`\n <marker id="seq-arrow-open" markerWidth="${t}" markerHeight="${n}" refX="${t}" refY="${n/2}" orient="auto-start-reverse">`+e.f`\n <polyline points="0 0, ${t} ${n/2}, 0 ${n}" fill="none" stroke="var(--_arrow)" stroke-width="1" />`+`
|
|
45
|
+
</marker>`}function Ii(t,n){let{id:r,x:i,y:a,width:o,height:s,label:c,type:l}=t,u=[];if(u.push(e.f`<g class="actor" data-id="${(0,e.escapeAttr)(r)}" data-label="${(0,e.escapeAttr)(c)}" data-type="${l}">`),l===`actor`){let t=s/24*.9,r=i-12*t,o=a+(s-24*t)/2,l=M.outerBox/t,d=`var(--_line)`;u.push(e.f` <g transform="translate(${r},${o}) scale(${t})">`+e.f`\n <path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" fill="none" stroke="${d}" stroke-width="${l}" />`+e.f`\n <path d="M15 10C15 11.6569 13.6569 13 12 13C10.3431 13 9 11.6569 9 10C9 8.34315 10.3431 7 12 7C13.6569 7 15 8.34315 15 10Z" fill="none" stroke="${d}" stroke-width="${l}" />`+e.f`\n <path d="M5.62842 18.3563C7.08963 17.0398 9.39997 16 12 16C14.6 16 16.9104 17.0398 18.3716 18.3563" fill="none" stroke="${d}" stroke-width="${l}" />`+`
|
|
46
|
+
</g>`),u.push(` `+(0,e.renderMultilineText)(c,i,a+s+14,n.nodeLabel,e.f`font-size="${n.nodeLabel}" text-anchor="middle" font-weight="${A.nodeLabel}" fill="var(--_text)"`))}else{let t=i-o/2;u.push(e.f` <rect x="${t}" y="${a}" width="${o}" height="${s}" rx="4" ry="4" `+e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${M.outerBox}" />`),u.push(` `+(0,e.renderMultilineText)(c,i,a+s/2,n.nodeLabel,e.f`font-size="${n.nodeLabel}" text-anchor="middle" font-weight="${A.nodeLabel}" fill="var(--_text)"`))}return u.push(`</g>`),u.join(`
|
|
47
|
+
`)}var Li=30,Ri=20,zi=8,Bi=10,Vi=18,Hi=3,Ui=2,Wi=3;function Gi(t,n){let r=[],i=t=>(0,e.measureMultilineText)(t,n.edgeLabel,A.edgeLabel),a=(e,t,n)=>{let a=i(e);r.push({x0:t-a.width/2,x1:t+a.width/2,y0:n-a.height/2,y1:n+a.height/2})},o=(e,t,n)=>{let a=i(e);r.push({x0:t,x1:t+a.width,y0:n-a.height/2,y1:n+a.height/2})};for(let e of t.messages)e.label&&(e.isSelf?o(e.label,e.x1+Li+zi,e.y+Ri/2):a(e.label,(e.x1+e.x2)/2,e.y-Bi));for(let e of t.blocks){let t=w(`${e.type}${e.label?` [${e.label}]`:``}`.split(`
|
|
48
|
+
`)[0]??``,n.edgeLabel,A.groupHeader)+16;r.push({x0:e.x,x1:e.x+t,y0:e.y,y1:e.y+Vi});for(let t of e.dividers)t.label&&o(`[${t.label}]`,e.x+8,t.y+14)}return r}function Ki(e,t){let n=t.filter(t=>e.x>t.x0-Hi&&e.x<t.x1+Hi&&t.y1+Ui>e.topY&&t.y0-Ui<e.bottomY).map(e=>[e.y0-Ui,e.y1+Ui]).sort((e,t)=>e[0]-t[0]),r=[],i=e.topY;for(let[e,t]of n)e-i>=Wi&&r.push([i,e]),i=Math.max(i,t);return e.bottomY-i>=Wi&&r.push([i,e.bottomY]),r.length>0?r:[[e.topY,e.bottomY]]}function qi(t,n){let r=Ki(t,n).map(([n,r])=>e.f`<line class="lifeline" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x1="${t.x}" y1="${n}" x2="${t.x}" y2="${r}" `+`stroke="var(--_line)" stroke-width="0.75" stroke-dasharray="6 4" />`).join(`
|
|
49
|
+
`);if(!t.destroyed)return r;let{x:i,bottomY:a}=t,o=Ji;return r+e.f`\n<path class="destroy" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`d="M${i-o} ${a-o} L${i+o} ${a+o} M${i+o} ${a-o} L${i-o} ${a+o}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${M.outerBox}" stroke-linecap="round" />`}var Ji=8;function Yi(t){return e.f`<rect class="activation" data-actor="${(0,e.escapeAttr)(t.actorId)}" `+e.f`x="${t.x}" y="${t.topY}" width="${t.width}" height="${t.bottomY-t.topY}" `+e.f`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${M.innerBox}" />`}function Xi(t,n){let r=[],i=t.lineStyle===`dashed`?` stroke-dasharray="6 4"`:``,a=t.arrowHead===`filled`?`seq-arrow`:`seq-arrow-open`,o=t.bidirectional?e.f` marker-start="url(#${a})"`:``;if(r.push(e.f`<g class="message" data-from="${(0,e.escapeAttr)(t.from)}" data-to="${(0,e.escapeAttr)(t.to)}" `+e.f`data-label="${(0,e.escapeAttr)(t.label)}" data-line-style="${t.lineStyle}" `+e.f`data-arrow-head="${t.arrowHead}" data-self="${t.isSelf}" data-bidirectional="${t.bidirectional}">`),t.isSelf){let s=Li,c=Ri,l=zi;r.push(e.f` <polyline points="${t.x1},${t.y} ${t.x1+s},${t.y} ${t.x1+s},${t.y+c} ${t.x2},${t.y+c}" `+e.f`fill="none" stroke="var(--_line)" stroke-width="${M.connector}"${i} marker-end="url(#${a})"${o} />`),r.push(` `+(0,e.renderMultilineText)(t.label,t.x1+s+l,t.y+c/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="start" font-weight="${A.edgeLabel}" fill="var(--_text-muted)"`))}else{r.push(e.f` <line x1="${t.x1}" y1="${t.y}" x2="${t.x2}" y2="${t.y}" `+e.f`stroke="var(--_line)" stroke-width="${M.connector}"${i} marker-end="url(#${a})"${o} />`);let s=(t.x1+t.x2)/2;r.push(` `+(0,e.renderMultilineText)(t.label,s,t.y-Bi,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${A.edgeLabel}" fill="var(--_text-muted)"`))}return t.seqNumber!==void 0&&r.push(` `+Zi(t,n)),r.push(`</g>`),r.join(`
|
|
50
|
+
`)}function Zi(t,n){let r=Math.max(n.edgeLabel-2,8),i=t.bidirectional?t.x1+Math.sign(t.x2-t.x1)*(8+P.width):t.x1;return`<g class="seq-number">`+e.f`<circle cx="${i}" cy="${t.y}" r="${8}" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${M.innerBox}" />`+(0,e.renderMultilineText)(String(t.seqNumber),i,t.y,r,e.f`font-size="${r}" text-anchor="middle" font-weight="${A.edgeLabel}" fill="var(--_arrow)"`)+`</g>`}var Qi=35;function $i(t,n){let r=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``,i=t.color===void 0?``:e.f` data-color="${(0,e.escapeAttr)(t.color)}"`,a=t.color===void 0?`none`:e.f`color-mix(in srgb, ${(0,e.escapeAttr)(t.color)} ${Qi}%, var(--bg))`,o=[e.f`<g class="participant-box"${r}${i}>`,e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" rx="4" ry="4" `+e.f`fill="${a}" stroke="var(--_node-stroke)" stroke-width="${M.innerBox}" />`];return t.label&&o.push(` `+(0,e.renderMultilineText)(t.label,t.x+t.width/2,t.y+Oi(n.edgeLabel)/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${A.groupHeader}" fill="var(--_text-sec)"`)),o.push(`</g>`),o.join(`
|
|
51
|
+
`)}function ea(t,n){let r=[],i=t.label?e.f` data-label="${(0,e.escapeAttr)(t.label)}"`:``;r.push(e.f`<g class="block" data-type="${(0,e.escapeAttr)(t.type)}"${i}>`),r.push(e.f` <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" `+e.f`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${M.outerBox}" />`);let a=e.f`${t.type}${t.label?e.f` [${t.label}]`:``}`,o=a.split(`
|
|
52
|
+
`)[0],s=w(o,n.edgeLabel,A.groupHeader)+16,c=Vi;r.push(e.f` <rect x="${t.x}" y="${t.y}" width="${s}" height="${c}" `+e.f`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${M.outerBox}" />`),r.push(` `+(0,e.renderMultilineText)(a,t.x+6,t.y+c/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" font-weight="${A.groupHeader}" fill="var(--_text-sec)"`));for(let i of t.dividers)r.push(e.f` <line x1="${t.x}" y1="${i.y}" x2="${t.x+t.width}" y2="${i.y}" `+`stroke="var(--_line)" stroke-width="0.75" stroke-dasharray="6 4" />`),i.label&&r.push(` `+(0,e.renderMultilineText)(e.f`[${i.label}]`,t.x+8,i.y+14,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="start" font-weight="${A.edgeLabel}" fill="var(--_text-muted)"`));return r.push(`</g>`),r.join(`
|
|
53
|
+
`)}function ta(t,n){let{x:r,y:i,width:a,height:o}=t,s=t.actors&&t.actors.length>0?e.f` data-actors="${t.actors.map(e.escapeAttr).join(`,`)}"`:``,c=t.position?e.f` data-position="${(0,e.escapeAttr)(t.position)}"`:``,l=[e.f`${r},${i}`,e.f`${r+a-6},${i}`,e.f`${r+a},${i+6}`,e.f`${r+a},${i+o}`,e.f`${r},${i+o}`].join(` `);return e.f`<g class="note"${c}${s}>`+e.f`\n <polygon points="${l}" `+e.f`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${M.innerBox}" />`+e.f`\n <polygon points="${r+a-6},${i} ${r+a},${i+6} ${r+a-6},${i+6}" `+e.f`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${M.innerBox}" />`+e.f`\n ${(0,e.renderMultilineText)(t.text,r+a/2,i+o/2,n.edgeLabel,e.f`font-size="${n.edgeLabel}" text-anchor="middle" font-weight="${A.edgeLabel}" fill="var(--_text-muted)"`)}`+`
|
|
54
|
+
</g>`}var G={plotWidth:600,plotHeight:340,padding:22,titleFontSize:18,titleFontWeight:600,titleHeight:42,axisLabelFontSize:14,axisLabelFontWeight:400,axisTitleFontSize:15,axisTitleFontWeight:500,xLabelHeight:38,yLabelWidth:58,yLabelGap:18,axisTitlePad:30,tickLength:4,barPadRatio:.2,barGroupGap:0,maxBarWidth:40,legendFontSize:14,legendFontWeight:400,legendHeight:28,legendSwatchW:14,legendSwatchH:14,legendGap:6,legendItemGap:16};function na(e,t={}){return e.horizontal?ia(e):ra(e)}function ra(t){let n=!!t.title,r=!!t.xAxis.title,i=!!t.yAxis.title,a=t.series.length>1,o=t.yAxis.range;if(!o)throw Error(`XY chart: y-axis range was not set by the parser`);let s=(0,e.niceTickValues)(o.min,o.max),c=fa(s),l=Math.max(...c.map(e=>w(e,G.axisLabelFontSize,G.axisLabelFontWeight)),G.yLabelWidth),u=G.padding+(n?G.titleHeight:0)+(a?G.legendHeight:0),d=G.padding+G.xLabelHeight+(r?G.axisTitlePad:0),f=G.padding+l+G.yLabelGap+(i?G.axisTitlePad:0),p=G.padding,m=G.plotWidth,h=G.plotHeight,g=f+m+p,_=u+h+d,v={x:f,y:u,width:m,height:h},y=aa(t),b=e=>f+(e+.5)*(m/y),x=m/y,S=e=>{let t=(e-o.min)/(o.max-o.min||1);return u+h-t*h},C=la(t,b,u+h,x),T=s.map((e,t)=>({label:c[t],x:f,y:S(e),tx:f-G.tickLength,ty:S(e),labelX:f-G.yLabelGap,labelY:S(e),textAnchor:`end`})),E=s.map(e=>({x1:f,y1:S(e),x2:f+m,y2:S(e)})),D=oa(t,y),O=t.series.map((e,t)=>t),k=ua(t,b,S,x,o.min,D,O),A=da(t,b,S,D,O),ee=G.padding+(n?G.titleHeight:0)+G.legendHeight/2,j=a?ma(t,g/2,ee,O):[],M={x1:f,y1:u+h,x2:f+m,y2:u+h},N={x1:f,y1:u,x2:f,y2:u+h},P={ticks:C,line:M,...t.xAxis.title?{title:{text:t.xAxis.title,x:f+m/2,y:_-G.padding}}:{}},F={ticks:T,line:N,...t.yAxis.title?{title:{text:t.yAxis.title,x:G.padding+4,y:u+h/2,rotate:-90}}:{}};return{width:g,height:_,title:t.title?{text:t.title,x:g/2,y:G.padding+G.titleFontSize}:void 0,xAxis:P,yAxis:F,plotArea:v,bars:k,lines:A,gridLines:E,legend:j}}function ia(t){let n=!!t.title,r=!!t.xAxis.title,i=!!t.yAxis.title,a=t.series.length>1,o=t.yAxis.range;if(!o)throw Error(`XY chart: y-axis range was not set by the parser`);let s=(0,e.niceTickValues)(o.min,o.max),c=fa(s),l=aa(t),u=oa(t,l),d=Math.max(...u.map(e=>w(e,G.axisLabelFontSize,G.axisLabelFontWeight)),40),f=G.padding+(n?G.titleHeight:0)+(a?G.legendHeight:0),p=G.padding+G.xLabelHeight+(i?G.axisTitlePad:0),m=G.padding+d+G.yLabelGap+(r?G.axisTitlePad:0),h=G.padding,g=G.plotWidth,_=G.plotHeight,v=m+g+h,y=f+_+p,b={x:m,y:f,width:g,height:_},x=e=>{let t=(e-o.min)/(o.max-o.min||1);return m+t*g},S=_/l,C=e=>f+(e+.5)*S,T=s.map((e,t)=>({label:c[t],x:x(e),y:f+_,tx:x(e),ty:f+_+G.tickLength,labelX:x(e),labelY:f+_+18,textAnchor:`middle`})),E=u.map((e,t)=>({label:e,x:m,y:C(t),tx:m-G.tickLength,ty:C(t),labelX:m-G.yLabelGap,labelY:C(t),textAnchor:`end`})),D=s.map(e=>({x1:x(e),y1:f,x2:x(e),y2:f+_})),O=t.series.map((e,t)=>t),k=t.series.filter(e=>e.type===`bar`).length,A=[];if(k>0){let e=S*(1-G.barPadRatio),n=k>1?(e-(k-1)*G.barGroupGap)/k:e,r=Math.min(n,G.maxBarWidth),i=k>1?r*k+G.barGroupGap*(k-1):r,a=0,s=0;for(let e of t.series){if(e.type!==`bar`){s++;continue}for(let t=0;t<e.data.length;t++){let n=C(t)-i/2+a*(r+G.barGroupGap),c=x(Math.max(e.data[t],o.min)),l=x(Math.max(0,o.min));A.push({x:Math.min(l,c),y:n,width:Math.abs(c-l),height:r,value:e.data[t],label:u[t],seriesIndex:a,colorIndex:O[s]})}a++,s++}}let ee=[],j=0,M=0;for(let e of t.series){if(e.type!==`line`){M++;continue}let t=e.data.map((e,t)=>({x:x(e),y:C(t),value:e,label:u[t]}));ee.push({points:t,seriesIndex:j,colorIndex:O[M]}),j++,M++}let N={x1:m,y1:f+_,x2:m+g,y2:f+_},P={x1:m,y1:f,x2:m,y2:f+_},F={ticks:T,line:N,...t.yAxis.title?{title:{text:t.yAxis.title,x:m+g/2,y:y-G.padding}}:{}},I={ticks:E,line:P,...t.xAxis.title?{title:{text:t.xAxis.title,x:G.padding+4,y:f+_/2,rotate:-90}}:{}},L=t.title?{text:t.title,x:v/2,y:G.padding+G.titleFontSize}:void 0,R=G.padding+(n?G.titleHeight:0)+G.legendHeight/2;return{width:v,height:y,horizontal:!0,title:L,xAxis:F,yAxis:I,plotArea:b,bars:A,lines:ee,gridLines:D,legend:a?ma(t,v/2,R,O):[]}}function aa(e){if(e.xAxis.categories)return e.xAxis.categories.length;for(let t of e.series)if(t.data.length>0)return t.data.length;return 1}function oa(e,t){if(e.xAxis.categories)return e.xAxis.categories;if(e.xAxis.range){let{min:n,max:r}=e.xAxis.range,i=t>1?(r-n)/(t-1):0;return Array.from({length:t},(e,t)=>pa(n+i*t))}return Array.from({length:t},(e,t)=>String(t+1))}var sa=8;function ca(e,t){let n=e.map(e=>w(e,G.axisLabelFontSize,G.axisLabelFontWeight));for(let r=1;r<e.length;r++){let i=!0;for(let a=0;a+r<e.length;a+=r)if(r*t-(n[a]+n[a+r])/2<sa){i=!1;break}if(i)return r}return Math.max(1,e.length)}function la(e,t,n,r){let i=oa(e,aa(e)),a=ca(i,r);return i.map((e,r)=>({label:r%a===0?e:``,x:t(r),y:n,tx:t(r),ty:n+G.tickLength,labelX:t(r),labelY:n+18,textAnchor:`middle`}))}function ua(e,t,n,r,i,a,o){let s=e.series.filter(e=>e.type===`bar`).length;if(s===0)return[];let c=r*(1-G.barPadRatio),l=s>1?(c-(s-1)*G.barGroupGap)/s:c,u=Math.min(l,G.maxBarWidth),d=s>1?u*s+G.barGroupGap*(s-1):u,f=[],p=0,m=0;for(let r of e.series){if(r.type!==`bar`){m++;continue}for(let e=0;e<r.data.length;e++){let s=t(e)-d/2+p*(u+G.barGroupGap),c=n(r.data[e]),l=n(Math.max(0,i));f.push({x:s,y:Math.min(c,l),width:u,height:Math.abs(l-c),value:r.data[e],label:a[e],seriesIndex:p,colorIndex:o[m]})}p++,m++}return f}function da(e,t,n,r,i){let a=[],o=0,s=0;for(let c of e.series){if(c.type!==`line`){s++;continue}let e=c.data.map((e,i)=>({x:t(i),y:n(e),value:e,label:r[i]}));a.push({points:e,seriesIndex:o,colorIndex:i[s]}),o++,s++}return a}function fa(e){let t=e.length>1?Math.abs(e[1]-e[0]):0,n=t>0&&t<1?Math.ceil(-Math.log10(t)-1e-9):0;return e.map(e=>String(Number.isInteger(e)&&n===0?e:Number(e.toFixed(n))))}function pa(e){return Number.isInteger(e)?String(e):e.toFixed(+(Math.abs(e)<10))}function ma(e,t,n,r){let i=[],a=0,o=0;for(let t=0;t<e.series.length;t++){let s=e.series[t],c=s.type===`bar`?`Bar ${a+1}`:`Line ${o+1}`;i.push({label:c,x:0,y:n,type:s.type,seriesIndex:s.type===`bar`?a:o,colorIndex:r[t]}),s.type===`bar`?a++:o++}let s=i.map(e=>{let t=w(e.label,G.legendFontSize,G.legendFontWeight);return G.legendSwatchW+G.legendGap+t}),c=t-(s.reduce((e,t)=>e+t,0)+(i.length-1)*G.legendItemGap)/2;for(let e=0;e<i.length;e++)i[e].x=c,c+=s[e]+G.legendItemGap;return i}var K={titleSize:18,titleWeight:600,axisTitleSize:15,axisTitleWeight:500,labelSize:14,labelWeight:400,legendSize:14,legendWeight:400,dotRadius:5,lineWidth:2.5,barRadius:8},q={fontSize:15,fontWeight:500,height:32,padX:14,offsetY:12,rx:8,minY:4,pointerSize:6};function ha(t,n,r=`Inter`,i=!1,a=!1,o,s,c,l={}){let u=[],d=Math.max(0,...t.bars.map(e=>e.colorIndex),...t.lines.map(e=>e.colorIndex)),f=Sr((0,e.svgOpenTag)(t.width,t.height,n,i,s,c,void 0,l.styleAttribute,l.description).replace(`<svg `,`<svg data-xychart-colors="${d}" `),o);u.push(f),u.push((0,e.buildStyleBlock)(r,!1,l.nonce));let p=Math.max(...t.lines.map(e=>e.points.length),0),m=p>0&&p<=12,{style:h,defs:g}=ga(t,a,m,n.accent,n.bg,l.nonce);u.push(h),g&&u.push(g);let{plotArea:_}=t,v=t.xAxis.ticks.map(e=>e.x),y=t.horizontal?t.yAxis.ticks.map(e=>e.y):t.gridLines.map(e=>e.y1),b=v.length>1?Math.abs(v[1]-v[0]):_.width/6,x=y.length>1?Math.abs(y[1]-y[0]):_.height/6,S=b/Math.max(1,Math.round(b/20)),C=x/Math.max(1,Math.round(x/20)),w=v[0]??_.x,T=y[0]??_.y,E=w-Math.ceil((w-_.x)/S)*S,D=T-Math.ceil((T-_.y)/C)*C;for(let e=D;e<=_.y+_.height+.5;e+=C)for(let t=E;t<=_.x+_.width+.5;t+=S)u.push(`<circle cx="${J(t)}" cy="${J(e)}" r="1.5" class="xychart-grid"/>`);let O=[];for(let e of t.bars){let n=` data-value="${e.value}"${e.label?` data-label="${Y(e.label)}"`:``}`,r=t.horizontal?va(e.x,e.y,e.width,e.height,K.barRadius):_a(e.x,e.y,e.width,e.height,K.barRadius);if(u.push(`<path d="${r}" class="xychart-bar xychart-color-${e.colorIndex}"${n}/>`),a){let t=Sa(e.value),n=e.label?`${e.label}: ${t}`:t,r=xa(e.x+e.width/2,e.y,t);O.push(`<g class="xychart-bar-group"><rect x="${J(e.x)}" y="${J(e.y)}" width="${J(e.width)}" height="${J(e.height)}" fill="transparent"/><title>${Y(n)}</title>`+r+`</g>`)}}for(let e of t.lines){if(e.points.length===0)continue;let t=ya(e.points);u.push(`<path d="${t}" class="xychart-line-shadow xychart-color-${e.colorIndex}" transform="translate(0,2)"/>`),u.push(`<path d="${t}" class="xychart-line xychart-color-${e.colorIndex}"/>`)}let k=[];if(a||m){let e=new Map;for(let n of t.legend)n.type===`line`&&e.set(n.seriesIndex,n.label);let n=new Map;for(let e of t.lines)for(let t of e.points){let r=J(t.x),i=n.get(r)??[];n.set(r,i),i.push({x:t.x,y:t.y,value:t.value,label:t.label,seriesIndex:e.seriesIndex,colorIndex:e.colorIndex})}for(let t of n.values()){let n=t[0].x,r=t[0].label||``;if(a&&t.length>1){let i=Math.min(...t.map(e=>e.y)),a=Math.max(...t.map(e=>e.y)),o=K.dotRadius*3,s=`<rect x="${J(n-o)}" y="${J(i-o)}" width="${J(o*2)}" height="${J(a-i+o*2)}" fill="transparent" class="xychart-hit"/>`,c=t.map(t=>({text:Sa(t.value),legendLabel:e.get(t.seriesIndex)||`Line ${t.seriesIndex+1}`})),l=ba(n,i-K.dotRadius,r,c),u=c.map(e=>e.text),d=r?`${r}: ${u.join(` · `)}`:u.join(` · `),f=`<g class="xychart-dot-group">${s}`;for(let e of t){let t=` data-value="${e.value}"${e.label?` data-label="${Y(e.label)}"`:``}`;f+=`<circle cx="${J(e.x)}" cy="${J(e.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${t}/>`}f+=`<title>${Y(d)}</title>${l}</g>`,k.push(f)}else if(a){let e=t[0],r=` data-value="${e.value}"${e.label?` data-label="${Y(e.label)}"`:``}`,i=Sa(e.value),a=e.label?`${e.label}: ${i}`:i,o=xa(n,e.y-K.dotRadius,i),s=m?`<circle cx="${J(n)}" cy="${J(e.y)}" r="${K.dotRadius*3}" fill="transparent" class="xychart-hit"/>`:``;k.push(`<g class="xychart-dot-group">${s}<circle cx="${J(e.x)}" cy="${J(e.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${r}/><title>${Y(a)}</title>${o}</g>`)}else for(let e of t){let t=` data-value="${e.value}"${e.label?` data-label="${Y(e.label)}"`:``}`;u.push(`<circle cx="${J(e.x)}" cy="${J(e.y)}" r="${K.dotRadius}" class="xychart-dot xychart-color-${e.colorIndex}"${t}/>`)}}}for(let e of t.xAxis.ticks)e.label!==``&&u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${K.labelSize}" font-weight="${K.labelWeight}" dy="${N}" class="xychart-label">${Y(e.label)}</text>`);for(let e of t.yAxis.ticks)u.push(`<text x="${e.labelX}" y="${e.labelY}" text-anchor="${e.textAnchor}" font-size="${K.labelSize}" font-weight="${K.labelWeight}" dy="${N}" class="xychart-label">${Y(e.label)}</text>`);if(t.xAxis.title){let e=t.xAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${K.axisTitleSize}" font-weight="${K.axisTitleWeight}" dy="${N}" class="xychart-axis-title">${Y(e.text)}</text>`)}if(t.yAxis.title){let e=t.yAxis.title,n=e.rotate?` transform="rotate(${e.rotate},${e.x},${e.y})"`:``;u.push(`<text x="${e.x}" y="${e.y}" text-anchor="middle"${n} font-size="${K.axisTitleSize}" font-weight="${K.axisTitleWeight}" dy="${N}" class="xychart-axis-title">${Y(e.text)}</text>`)}t.title&&u.push(`<text x="${t.title.x}" y="${t.title.y}" text-anchor="middle" font-size="${K.titleSize}" font-weight="${K.titleWeight}" dy="${N}" class="xychart-title">${Y(t.title.text)}</text>`);for(let e of t.legend){if(e.type===`bar`)u.push(`<rect x="${e.x}" y="${e.y-7}" width="14" height="14" rx="3" class="xychart-bar xychart-color-${e.colorIndex}"/>`);else{let t=e.y;u.push(`<line x1="${e.x}" y1="${t}" x2="${e.x+14}" y2="${t}" stroke-width="${K.lineWidth}" stroke-linecap="round" class="xychart-legend-line xychart-color-${e.colorIndex}"/>`)}u.push(`<text x="${e.x+14+6}" y="${e.y}" text-anchor="start" font-size="${K.legendSize}" font-weight="${K.legendWeight}" dy="${N}" class="xychart-label">${Y(e.label)}</text>`)}for(let e of O)u.push(e);for(let e of k)u.push(e);return u.push(`</svg>`),u.join(`
|
|
55
|
+
`)}function ga(n,r,i,a,o,s){let c=a??t.CHART_ACCENT_FALLBACK,l=new Set;for(let e of n.bars)l.add(e.colorIndex);for(let e of n.lines)l.add(e.colorIndex);let u=[];for(let e of[...l].sort((e,t)=>e-t)){let n=e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,c,o);u.push(` --xychart-color-${e}: ${n};`),u.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`)}let d=[];for(let e of[...l].sort((e,t)=>e-t)){let t=`var(--xychart-color-${e})`;d.push(` .xychart-bar.xychart-color-${e} { stroke: ${t}; fill: var(--xychart-bar-fill-${e}); }`),d.push(` path.xychart-color-${e}, line.xychart-color-${e} { stroke: ${t}; }`),d.push(` circle.xychart-color-${e} { fill: ${t}; }`)}let f=r?`
|
|
56
|
+
.xychart-tip { opacity: 0; pointer-events: none; }
|
|
57
|
+
.xychart-tip-bg { fill: var(--_text); filter: drop-shadow(0 1px 3px color-mix(in srgb, var(--fg) 20%, transparent)); }
|
|
58
|
+
.xychart-tip-text { fill: var(--bg); font-size: ${q.fontSize}px; font-weight: ${q.fontWeight}; }
|
|
59
|
+
.xychart-tip-ptr { fill: var(--_text); }
|
|
60
|
+
.xychart-bar-group:hover .xychart-tip,
|
|
61
|
+
.xychart-dot-group:hover .xychart-tip { opacity: 1; }`:``,p=u.length>0?`\n svg {\n${u.join(`
|
|
62
|
+
`)}\n }`:``;return{style:`${(0,e.styleOpenTag)(s)}
|
|
63
|
+
.xychart-grid { fill: var(--_inner-stroke); stroke: none; opacity: 0.65; }
|
|
64
|
+
.xychart-bar { stroke-width: 1.5; }
|
|
65
|
+
.xychart-line { fill: none; stroke-width: ${K.lineWidth}; stroke-linecap: round; stroke-linejoin: round; }
|
|
66
|
+
.xychart-line-shadow { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.12; }
|
|
67
|
+
.xychart-dot { stroke: var(--bg); stroke-width: 2; }
|
|
68
|
+
.xychart-label { fill: var(--_text-muted); }
|
|
69
|
+
.xychart-axis-title { fill: var(--_text-sec); }
|
|
70
|
+
.xychart-title { fill: var(--_text); }${p}
|
|
71
|
+
${d.join(`
|
|
72
|
+
`)}${f}
|
|
73
|
+
</style>`,defs:``}}function _a(e,t,n,r,i){let a=Math.min(i,n/2,r/2);return a<=0?`M${J(e)},${J(t)} h${J(n)} v${J(r)} h${J(-n)} Z`:[`M${J(e)},${J(t+a)}`,`Q${J(e)},${J(t)} ${J(e+a)},${J(t)}`,`L${J(e+n-a)},${J(t)}`,`Q${J(e+n)},${J(t)} ${J(e+n)},${J(t+a)}`,`L${J(e+n)},${J(t+r-a)}`,`Q${J(e+n)},${J(t+r)} ${J(e+n-a)},${J(t+r)}`,`L${J(e+a)},${J(t+r)}`,`Q${J(e)},${J(t+r)} ${J(e)},${J(t+r-a)}`,`Z`].join(` `)}function va(e,t,n,r,i){let a=Math.min(i,n/2,r/2);return a<=0?`M${J(e)},${J(t)} h${J(n)} v${J(r)} h${J(-n)} Z`:[`M${J(e+a)},${J(t)}`,`L${J(e+n-a)},${J(t)}`,`Q${J(e+n)},${J(t)} ${J(e+n)},${J(t+a)}`,`L${J(e+n)},${J(t+r-a)}`,`Q${J(e+n)},${J(t+r)} ${J(e+n-a)},${J(t+r)}`,`L${J(e+a)},${J(t+r)}`,`Q${J(e)},${J(t+r)} ${J(e)},${J(t+r-a)}`,`L${J(e)},${J(t+a)}`,`Q${J(e)},${J(t)} ${J(e+a)},${J(t)}`,`Z`].join(` `)}function ya(e){if(e.length===0)return``;if(e.length===1)return`M${J(e[0].x)},${J(e[0].y)}`;if(e.length===2)return`M${J(e[0].x)},${J(e[0].y)} L${J(e[1].x)},${J(e[1].y)}`;let t=e.length,n=[],r=[];for(let i=0;i<t-1;i++)n.push(e[i+1].x-e[i].x),r.push(n[i]===0?0:(e[i+1].y-e[i].y)/n[i]);let i=Array(t).fill(0);for(let e=1;e<t-1;e++){let t=r[e-1],a=r[e];if(t*a<=0)continue;let o=2*n[e]+n[e-1],s=n[e]+2*n[e-1];i[e]=(o+s)/(o/t+s/a)}let a=(e,t,n,r)=>{let i=((2*e+t)*n-e*r)/(e+t);return i*n<=0?i=0:n*r<=0&&Math.abs(i)>3*Math.abs(n)&&(i=3*n),i};i[0]=a(n[0],n[1],r[0],r[1]),i[t-1]=a(n[t-2],n[t-3],r[t-2],r[t-3]);let o=`M${J(e[0].x)},${J(e[0].y)}`;for(let r=0;r<t-1;r++){let t=n[r]/3,a=e[r].x+t,s=e[r].y+i[r]*t,c=e[r+1].x-t,l=e[r+1].y-i[r+1]*t;o+=` C${J(a)},${J(s)} ${J(c)},${J(l)} ${J(e[r+1].x)},${J(e[r+1].y)}`}return o}function ba(e,t,n,r){let i=w(n,q.fontSize,600),a=Math.max(...r.map(e=>{let t=w(e.legendLabel,q.fontSize,q.fontWeight),n=w(e.text,q.fontSize,q.fontWeight);return t+10+n})),o=Math.max(i,a)+q.padX*2,s=26+r.length*20+6,c=Math.max(q.minY,t-q.offsetY-s-q.pointerSize),l=e-o/2,u=e,d=c+s,f=q.pointerSize,p=`<polygon points="${J(u-f)},${J(d)} ${J(u+f)},${J(d)} ${J(u)},${J(d+f)}" class="xychart-tip xychart-tip-ptr"/>`,m=`<rect x="${J(l)}" y="${J(c)}" width="${J(o)}" height="${s}" rx="${q.rx}" class="xychart-tip xychart-tip-bg"/>`;m+=p;let h=c+6+10;m+=`<text x="${J(e)}" y="${J(h)}" text-anchor="middle" font-weight="600" font-size="${q.fontSize}" dy="${N}" class="xychart-tip xychart-tip-text">${Y(n)}</text>`;let g=l+q.padX,_=l+o-q.padX;for(let e of r)h+=20,m+=`<text x="${J(g)}" y="${J(h)}" text-anchor="start" font-size="${q.fontSize}" font-weight="${q.fontWeight}" dy="${N}" class="xychart-tip xychart-tip-text">${Y(e.legendLabel)}</text>`,m+=`<text x="${J(_)}" y="${J(h)}" text-anchor="end" font-size="${q.fontSize}" font-weight="${q.fontWeight}" dy="${N}" class="xychart-tip xychart-tip-text">${Y(e.text)}</text>`;return m}function xa(e,t,n){let r=w(n,q.fontSize,q.fontWeight)+q.padX*2,i=q.height,a=Math.max(q.minY,t-q.offsetY-i-q.pointerSize),o=e-r/2,s=e,c=a+i/2,l=e,u=a+i,d=q.pointerSize,f=`<polygon points="${J(l-d)},${J(u)} ${J(l+d)},${J(u)} ${J(l)},${J(u+d)}" class="xychart-tip xychart-tip-ptr"/>`;return`<rect x="${J(o)}" y="${J(a)}" width="${J(r)}" height="${i}" rx="${q.rx}" class="xychart-tip xychart-tip-bg"/>`+f+`<text x="${J(s)}" y="${J(c)}" text-anchor="middle" dy="${N}" class="xychart-tip xychart-tip-text">${Y(n)}</text>`}function Sa(e){return Number.isInteger(e)?e.toLocaleString(`en-US`):e.toFixed(+(Math.abs(e)<10))}function J(e){return String(Math.round(e*10)/10)}function Y(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var X={height:450,margin:40,legendRectSize:18,legendSpacing:4,textPosition:.75,outerStrokeWidth:2,titleFontSize:25,sectionFontSize:17,legendFontSize:17,fontWeight:400,paletteSize:12,highlightScale:1.05,minPercent:1},Ca=Math.PI*2;function Z(e){return String(Math.round(e*100)/100)}function wa(e,t,n,r){return{x:e+n*Math.sin(r),y:t-n*Math.cos(r)}}function Ta(e,t,n,r,i,a=0){if(i-r>=Ca-1e-9){let r=(n,r)=>`M${Z(e)},${Z(t-n)}A${Z(n)},${Z(n)},0,1,${r},${Z(e)},${Z(t+n)}A${Z(n)},${Z(n)},0,1,${r},${Z(e)},${Z(t-n)}`;return r(n,1)+(a>0?r(a,0):``)+`Z`}let o=wa(e,t,n,r),s=wa(e,t,n,i),c=+(i-r>Math.PI),l=`M${Z(o.x)},${Z(o.y)}A${Z(n)},${Z(n)},0,${c},1,${Z(s.x)},${Z(s.y)}`;if(a<=0)return`${l}L${Z(e)},${Z(t)}Z`;let u=wa(e,t,a,i),d=wa(e,t,a,r);return`${l}L${Z(u.x)},${Z(u.y)}A${Z(a)},${Z(a)},0,${c},0,${Z(d.x)},${Z(d.y)}Z`}function Ea(e,t,n){return n?`${e} [${String(t)}]`:e}function Da(e,t={}){let n=X.height,r=n,i=Math.min(r,n)/2-X.margin,a=r/2,o=n/2,s=e.slices.reduce((e,t)=>e+t.value,0),c=e.slices.map((e,t)=>({slice:e,colorIndex:t%X.paletteSize})).filter(({slice:e})=>e.value/s*100>=X.minPercent),l=c.reduce((e,t)=>e+t.slice.value,0),u=X.legendRectSize+X.legendSpacing,d=e.slices.length,f=d>0?e.legendPosition??`right`:`right`,p=e.slices.map(t=>Ea(t.label,t.value,e.showData)),m=Math.max(0,...p.map(e=>w(e,X.legendFontSize,X.fontWeight))),h=X.legendRectSize+X.legendSpacing,g=u*d,_=f===`left`?m+h:0,v=f===`top`?g+u:0,y=a-m/2-h,b=o-g/2,x={right:{x:a+12*X.legendRectSize,y:b},left:{x:a-i-h,y:b},center:{x:y,y:b},top:{x:y,y:o-i},bottom:{x:y,y:o+i+u}}[f],S=h+m,C=d>0&&(f===`left`||f===`right`)?r+X.margin+S:r+X.margin,T=f===`top`||f===`bottom`?n+g:n,E=e.title??``,D=E.length>0?w(E,X.titleFontSize,X.fontWeight):0,O=a-D/2,k=a+D/2,A=x.x,ee=x.x+S,j=x.y,M=x.y+g-u+X.legendRectSize,N=Math.min(0,O,d>0?A:0),P=Math.max(C,k,d>0?ee:0),F=d>0?Math.min(0,j):0,I=d>0?Math.max(T,M):n,L=-N,R=-F,z=a+_+L,B=o+v+R,te=[],ne=0,re=e.donutHole??0,ie=re>0&&re<=.9?re*i:0,ae=i*(e.textPosition??X.textPosition);for(let{slice:t,colorIndex:n}of c){let r=ne,a=ne+t.value/l*Ca;ne=a;let o=wa(z,B,ae,(r+a)/2),c=e.highlightSlice!==void 0&&e.highlightSlice!==`hover`&&e.highlightSlice!==``&&e.highlightSlice===t.label,u=c?X.highlightScale:1;te.push({label:t.label,value:t.value,colorIndex:n,startAngle:r,endAngle:a,path:Ta(z,B,i*u,r,a,ie*u),percentText:`${(t.value/s*100).toFixed(0)}%`,labelX:o.x,labelY:o.y,...c?{highlighted:c}:{}})}let oe=p.map((e,t)=>{let n=x.x+L,r=x.y+t*u+R;return{text:e,colorIndex:t%X.paletteSize,x:n,y:r,size:X.legendRectSize,textX:n+X.legendRectSize+X.legendSpacing,textY:r+X.legendRectSize-X.legendSpacing}});return{width:Math.ceil(P-N),height:Math.ceil(I-F),cx:z,cy:B,radius:i,outerRadius:i+X.outerStrokeWidth/2,title:E.length>0?{text:E,x:a+L,y:o+R-(n-50)/2}:void 0,slices:te,legend:oe,accTitle:e.accTitle,accDescr:e.accDescr}}function Q(e){return String(Math.round(e*100)/100)}function Oa(e,n,r){return e===0?`var(--accent, ${t.CHART_ACCENT_FALLBACK})`:(0,t.getSeriesColor)(e,n??t.CHART_ACCENT_FALLBACK,r)}function ka(t,n,r){let i=new Set;for(let e of t.slices)i.add(e.colorIndex);for(let e of t.legend)i.add(e.colorIndex);let a=[...i].sort((e,t)=>e-t),o=a.map(e=>` --pie-color-${e}: ${Oa(e,n.accent,n.bg)};`),s=a.map(e=>` .pie-color-${e} { fill: var(--pie-color-${e}); }\n rect.pie-color-${e} { stroke: var(--pie-color-${e}); }`),c=t.slices.some(e=>e.highlighted)?`
|
|
74
|
+
.pie-slice.pie-highlight { opacity: 1; }`:``,l=o.length>0?`\n svg {\n${o.join(`
|
|
75
|
+
`)}\n }`:``;return`${(0,e.styleOpenTag)(r)}
|
|
76
|
+
.pie-outer { fill: none; stroke: var(--fg); stroke-width: ${X.outerStrokeWidth}px; }
|
|
77
|
+
.pie-slice { stroke: var(--fg); stroke-width: 2px; opacity: 0.7; }${c}
|
|
78
|
+
.pie-slice-label { fill: var(--_text); font-size: ${X.sectionFontSize}px; font-weight: ${X.fontWeight}; }
|
|
79
|
+
.pie-title { fill: var(--_text); font-size: ${X.titleFontSize}px; font-weight: ${X.fontWeight}; }
|
|
80
|
+
.pie-legend-text { fill: var(--_text); font-size: ${X.legendFontSize}px; font-weight: ${X.fontWeight}; }${l}
|
|
81
|
+
${s.join(`
|
|
82
|
+
`)}
|
|
83
|
+
</style>`}function Aa(t,n,r=`Inter`,i=!1,a,o,s,c={}){let l=[];l.push(Sr((0,e.svgOpenTag)(t.width,t.height,n,i,o??t.accTitle,s,void 0,c.styleAttribute,t.accDescr),a)),l.push((0,e.buildStyleBlock)(r,!1,c.nonce)),l.push(ka(t,n,c.nonce)),l.push(`<circle cx="${Q(t.cx)}" cy="${Q(t.cy)}" r="${Q(t.outerRadius)}" class="pie-outer"/>`);for(let n of t.slices)l.push(`<path d="${n.path}" class="pie-slice${n.highlighted?` pie-highlight`:``} pie-color-${n.colorIndex}" data-label="${(0,e.escapeAttr)(n.label)}" data-value="${n.value}"/>`);for(let n of t.slices)l.push(`<text x="${Q(n.labelX)}" y="${Q(n.labelY)}" text-anchor="middle" class="pie-slice-label">${(0,e.escapeXml)(n.percentText)}</text>`);t.title&&l.push(`<text x="${Q(t.title.x)}" y="${Q(t.title.y)}" text-anchor="middle" class="pie-title">${(0,e.escapeXml)(t.title.text)}</text>`);for(let n of t.legend)l.push(`<g class="pie-legend"><rect x="${Q(n.x)}" y="${Q(n.y)}" width="${n.size}" height="${n.size}" class="pie-legend-swatch pie-color-${n.colorIndex}"/><text x="${Q(n.textX)}" y="${Q(n.textY)}" class="pie-legend-text">${(0,e.escapeXml)(n.text)}</text></g>`);return l.push(`</svg>`),l.join(`
|
|
84
|
+
`)}var ja=2048,Ma=[569,569,727,1139,1139,1821,1366,391,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,569,569,1196,1196,1196,1139,2079,1366,1366,1479,1479,1366,1251,1593,1479,569,1024,1366,1139,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,569,569,569,961,1139,682,1139,1139,1024,1139,1139,569,1139,1139,455,455,1024,455,1706,1139,1139,1139,1139,682,1024,569,1139,1024,1479,1024,1024,1024,684,532,684,1196],Na=[569,682,971,1139,1139,1821,1479,487,682,682,797,1196,569,682,569,569,1139,1139,1139,1139,1139,1139,1139,1139,1139,1139,682,682,1196,1196,1196,1251,1992,1479,1479,1479,1479,1366,1251,1593,1479,569,1139,1479,1251,1706,1479,1593,1366,1593,1479,1366,1251,1479,1366,1933,1366,1366,1251,682,569,682,1196,1139,682,1139,1251,1139,1251,1139,682,1251,1251,569,569,1139,569,1821,1251,1251,1251,1251,797,1139,682,1251,1139,1593,1139,1139,1024,801,573,801,1196];function Pa(e,t){let n=e.codePointAt(0);if(!(n<32||n>126))return(t?Na:Ma)[n-32]/ja}var $={width:216,diagramMarginX:50,diagramMarginY:10,shapeMargin:50,shapePadding:20,shapeInRow:4,boundaryInRow:2,nextLinePaddingX:0,screenWidth:1440,nameSize:14,typeSize:10.5,descrSize:11.5,messageSize:12,boundarySize:14,nameLine:15.35,typeLine:15.72,descrLine:17.1,descrExtraLine:12.48,textScale:.922,boundaryLabelHeight:18,boundaryTypeHeight:16.1,boundaryDescrHeight:14.4,rootHeadingHeight:47,titleExtra:60,cornerRadius:12,strokeWidth:2,personRx:.177,personRxMaxOfHeight:.45,personHeadRatio:.23,personHeadMin:16,personHeadMax:56,personHeadOverlap:.27,dbTrim:3.91,queueExtra:10},Fa=$.width-2*$.shapePadding;function Ia(e,t,n){let r=[];for(let i of e.split(`
|
|
85
|
+
`)){let e=``;for(let a of i.split(/\s+/).filter(Boolean)){let i=e?`${e} ${a}`:a;e&&Ha(i,n,400)>t?(r.push(e),e=a):e=i}r.push(e)}return r}function La(e,t){let n=Math.min(Math.max(e*$.personHeadRatio,$.personHeadMin),$.personHeadMax),r=n*(2-$.personHeadOverlap),i=t===void 0?1/0:t-r;return{rx:Math.min(e*$.personRx,i*$.personRxMaxOfHeight),headRadius:n,pillTop:r}}function Ra(e,t){return e*$.nameLine+$.typeLine+za(t)}function za(e){return e===0?0:$.descrLine+(e-1)*$.descrExtraLine}function Ba(e){let t=e/2;return{rx:t,ry:t/(2.5+e/50)}}function Va(e){let t=e/2;return{rx:t/(2.5+e/50),ry:t}}function Ha(e,t,n){let r=0;for(let i of e){let e=Pa(i,n>=600);r+=e===void 0?w(i,t,n)*$.textScale:e*t}return r}function Ua(e,t,n,r){let i=Ra(t,n),a=i+2*$.shapePadding,o=Math.max($.width,r+2*$.shapePadding);if(e.kind===`person`)return{width:o,height:La(o).pillTop+a,textHeight:i};if(e.shape===`db`){let{ry:e}=Ba(o);return{width:o,height:a+2*e-$.dbTrim,textHeight:i}}if(e.shape===`queue`){let e=i+$.queueExtra,{rx:t}=Va(e);return{width:o+3*t,height:e,textHeight:i}}return{width:o,height:a,textHeight:i}}function Wa(e){let t=`#ffffff`;if(e.external)switch(e.kind){case`person`:return{fill:`#686868`,stroke:`#8a8a8a`,text:t};case`system`:return{fill:`#999999`,stroke:`#8a8a8a`,text:t};case`container`:return{fill:`#b3b3b3`,stroke:`#a6a6a6`,text:t};case`component`:return{fill:`#cccccc`,stroke:`#bfbfbf`,text:t}}switch(e.kind){case`person`:return{fill:`#08427b`,stroke:`#073b6f`,text:t};case`system`:return{fill:`#1168bd`,stroke:`#3c7fc0`,text:t};case`container`:return{fill:`#438dd5`,stroke:`#3c7fc0`,text:t};case`component`:return{fill:`#85bbf0`,stroke:`#78a8d8`,text:t}}}var Ga=$.messageSize+5;function Ka(e){return e.labelLines??(0,t.c4RelLabelLines)(e)}function qa(e){let t=e.labelPosition;return t?Ka(e).map((n,r,i)=>({cx:e.technology!==void 0&&r===i.length-1&&e.technologyX!==void 0?e.technologyX:t.x,cy:t.y+r*Ga,w:Ha(n,$.messageSize,400),h:$.messageSize})):[]}function Ja(){return{next:{cnt:0}}}function Ya(e,t,n,r,i){e.next.startx=e.startx=t,e.next.stopx=e.stopx=n,e.next.starty=e.starty=r,e.next.stopy=e.stopy=i}function Xa(e,t,n,r){let i=e[t];e[t]=i===void 0?n:r(n,i)}function Za(e,t){e.next.cnt+=1;let n=$.shapeMargin,r=e.next.startx===e.next.stopx?e.next.stopx+n:e.next.stopx+n*2,i=r+t.width,a=e.next.starty+n*2,o=a+t.height;(r>=e.widthLimit||i>=e.widthLimit||e.next.cnt>$.shapeInRow)&&(r=e.next.startx+n+$.nextLinePaddingX,a=e.next.stopy+n*2,e.next.stopx=i=r+t.width,e.next.starty=e.next.stopy,e.next.stopy=o=a+t.height,e.next.cnt=1),t.x=r,t.y=a,Xa(e,`startx`,r,Math.min),Xa(e,`starty`,a,Math.min),Xa(e,`stopx`,i,Math.max),Xa(e,`stopy`,o,Math.max),Xa(e.next,`startx`,r,Math.min),Xa(e.next,`starty`,a,Math.min),Xa(e.next,`stopx`,i,Math.max),Xa(e.next,`stopy`,o,Math.max)}function Qa(e){let n=Ia(e.label,Fa,$.nameSize),r=e.description?Ia(e.description,Fa,$.descrSize):[],i=Math.max(...n.map(e=>Ha(e,$.nameSize,700)),Ha((0,t.c4TypeLine)(e),$.typeSize,400),...r.map(e=>Ha(e,$.descrSize,400)));return{el:e,nameLines:n,descriptionLines:r,x:0,y:0,...Ua(e,n.length,r.length,i)}}function $a(e){let t=new Set,n=new Map(e.elements.map(e=>[e.alias,e])),r=e=>{let i=e.elementAliases.flatMap(e=>{t.add(e);let r=n.get(e);return r?[r]:[]});return{alias:e.alias,boundary:e,elements:i,children:e.children.map(r)}},i=e.boundaries.map(r);return{alias:`global`,elements:e.elements.filter(e=>!t.has(e.alias)),children:i}}function eo(e){let n=new Map,r=[],i=$.diagramMarginX,a=$.diagramMarginY,o=(e,t)=>{for(let r of t){let t=Qa(r);n.set(r.alias,t),Za(e,t)}e.stopx+=$.shapeMargin,e.stopy+=$.shapeMargin},s=(e,n,c)=>{let l=Ja();l.widthLimit=e.widthLimit/Math.min($.boundaryInRow,n.length);for(let[u,d]of n.entries()){let n=d.boundary,f=0,p=f+8;f=p+$.boundaryLabelHeight;let m;n&&(0,t.c4BoundaryTypeLine)(n)&&(m=f+5,f=m+$.boundaryTypeHeight);let h;if(n?.description&&(h=f+20,f=h+$.boundaryDescrHeight),n||(f=$.rootHeadingHeight),u===0||u%$.boundaryInRow===0){let t=e.startx+$.diagramMarginX,n=e.stopy+$.diagramMarginY+f;Ya(l,t,t,n,n)}else{let e=l.stopx===l.startx?l.startx:l.stopx+$.diagramMarginX;Ya(l,e,e,l.starty,l.starty)}if(d.elements.length>0&&o(l,d.elements),d.children.length>0&&s(l,d.children,c+1),n){let e=l.stopx-l.startx,t=l.stopy-l.starty;e===0&&(e=$.width,l.stopx=l.startx+e),t===0&&(t=f+$.shapeMargin),r.push({alias:n.alias,label:n.label,...n.type?{type:n.type}:{},...n.description?{description:n.description}:{},x:l.startx,y:l.starty,width:e,height:t,depth:c,labelY:p,...m===void 0?{}:{typeY:m},...h===void 0?{}:{descrY:h}})}e.stopy=Math.max(l.stopy+$.shapeMargin,e.stopy),e.stopx=Math.max(l.stopx+$.shapeMargin,e.stopx),i=Math.max(i,e.stopx),a=Math.max(a,e.stopy)}},c=Ja();return Ya(c,$.diagramMarginX,$.diagramMarginX,$.diagramMarginY,$.diagramMarginY),c.widthLimit=$.screenWidth,s(c,[e],-1),{elements:n,boundaries:r,maxX:i,maxY:a}}function to(e,t){let n=e.x+e.width/2,r=e.y+e.height/2,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(i===0&&a===0)return{x:n,y:r};let c,l;if(Math.abs(a)*o>Math.abs(i)*s){let e=a<0?-s:s;c=e*i/a,l=e}else{let e=i<0?-o:o;c=e,l=e*a/i}return{x:n+c,y:r+l}}function no(e,t){let n=La(e.width,e.height),r=e.x+e.width/2,i=e.y+e.height/2,a=e.width,o=e.height,s=-o/2+n.headRadius,c=-o/2+n.pillTop,l=n.rx,u=(e,t,n,r,i,a)=>Array.from({length:r},(o,s)=>{let c=(i+s*(a-i)/(r-1))*Math.PI/180;return{x:e-n*Math.cos(c),y:t-n*Math.sin(c)}}),d=Math.asin(Math.min(1,(c-s)/n.headRadius))*180/Math.PI,f=[...u(0,s,n.headRadius,24,180+d,-d),...u(-a/2+l,c+l,l,12,90,0),...u(-a/2+l,o/2-l,l,12,360,270),...u(a/2-l,o/2-l,l,12,270,180),...u(a/2-l,c+l,l,12,180,90)];return io({x:r,y:i},t,f.map(e=>({x:r+e.x,y:i+e.y})))}function ro(e,t,n,r){let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o;if(s!==0&&c!==0&&s*c>0)return;let l=r.y-n.y,u=n.x-r.x,d=r.x*n.y-n.x*r.y,f=l*e.x+u*e.y+d,p=l*t.x+u*t.y+d;if(f!==0&&p!==0&&f*p>0)return;let m=i*u-l*a;if(m===0)return;let h=Math.abs(m/2),g=a*d-u*o,_=g<0?(g-h)/m:(g+h)/m;return g=l*o-i*d,{x:_,y:g<0?(g-h)/m:(g+h)/m}}function io(e,t,n){let r,i=1/0;return n.forEach((a,o)=>{let s=ro(e,t,a,n[(o+1)%n.length]);if(!s)return;let c=Math.hypot(s.x-t.x,s.y-t.y);c<i&&(r=s,i=c)}),r??e}var ao=1e-6;function oo(e,t){let n=to(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=Ba(e.width),s=n.x-r,c=Math.abs(s)<e.width/2-ao||Math.abs(Math.abs(s)-e.width/2)<=ao&&Math.abs(n.y-i)>e.height/2-o;if(a===0||!c)return n;let l=o*o*(1-s*s/(a*a)),u=o-(l>0?Math.sqrt(l):l);return t.y-i>0&&(u=-u),{x:n.x,y:n.y+u}}function so(e,t){let n=to(e,t),r=e.x+e.width/2,i=e.y+e.height/2,{rx:a,ry:o}=Va(e.height),s=n.y-i,c=Math.abs(s)<e.height/2-ao||Math.abs(Math.abs(s)-e.height/2)<=ao&&Math.abs(n.x-r)>e.width/2-a;if(o===0||!c)return n;let l=a*a*(1-s*s/(o*o)),u=a-Math.sqrt(Math.abs(l));return t.x-r>0&&(u=-u),{x:n.x+u,y:n.y}}function co(e,t){let n=e.el;return n?.kind===`person`?no(e,t):n?.shape===`db`?oo(e,t):n?.shape===`queue`?so(e,t):to(e,t)}var lo=e=>({x:e.x+e.width/2,y:e.y+e.height/2});function uo(e,n,r,i){let a=r.get(e.from),o=r.get(e.to),s=co(a,lo(o)),c=co(o,lo(a)),l=c.x-s.x,u=c.y-s.y,d=e=>({x:e.x,y:e.y+i}),f={...e,points:[d(s),d(c)]};if(n>0&&(f.curve=d({x:s.x+l/2-l/4,y:s.y+u/2})),(0,t.c4RelLabelLines)(e).length>0){let n={x:Math.min(s.x,c.x)+Math.abs(l)/2,y:Math.min(s.y,c.y)+Math.abs(u)/2},r=(0,t.c4RelLabelLines)(e)[0],i=e.label!==``||e.index!==void 0?Ha(r??``,$.messageSize,400):0;if(f.labelPosition=d({x:n.x+i/2,y:n.y}),e.technology){let t=Ha(`[${e.technology}]`,$.messageSize,400);f.technologyX=n.x+Math.max(i,t)/2}}return f}var fo=2,po=6,mo=2,ho=[0,14,-14,28,-28],go=[.75,.55,.4],_o=1e3,vo=100,yo=10,bo=2,xo=5,So=4,Co=e=>({x0:e.cx-e.w/2,x1:e.cx+e.w/2,y0:e.cy-e.h/2,y1:e.cy+e.h/2}),wo=(e,t)=>e.x0<t.x1+fo&&e.x1>t.x0-fo&&e.y0<t.y1+fo&&e.y1>t.y0-fo;function To(e){let t=e.points[0],n=e.points[e.points.length-1],r=e.curve,i=Math.hypot(n.x-t.x,n.y-t.y),a=Math.max(1,Math.ceil(i/So));return Array.from({length:a+1},(e,i)=>{let o=i/a;if(!r)return{x:t.x+(n.x-t.x)*o,y:t.y+(n.y-t.y)*o};let s=1-o;return{x:s*s*t.x+2*s*o*r.x+o*o*n.x,y:s*s*t.y+2*s*o*r.y+o*o*n.y}})}function Eo(e){return e.flatMap(e=>{let n=(e,t,n,r,i)=>({x0:e-i,x1:t+i,y0:n-i,y1:r+i,weight:vo}),r=(t,r,i,a)=>{let o=Ha(t,i,a),s=e.x+e.width/2;return n(s-o/2,s+o/2,e.y+r-i/2,e.y+r+i/2,xo)},i=(0,t.c4BoundaryTypeLine)({...e,elementAliases:[],children:[]});return[n(e.x,e.x+e.width,e.y,e.y,bo),n(e.x,e.x+e.width,e.y+e.height,e.y+e.height,bo),n(e.x,e.x,e.y,e.y+e.height,bo),n(e.x+e.width,e.x+e.width,e.y,e.y+e.height,bo),r(e.label,e.labelY,$.boundarySize+2,700),...i?[r(i,e.typeY,$.boundarySize,400)]:[],...e.description?[r(e.description,e.descrY,$.boundarySize-2,400)]:[]]})}function Do(e,t){return qa({...e,labelLines:t.lines,labelPosition:t.position,...t.technologyX===void 0?{}:{technologyX:t.technologyX}}).map(Co)}function Oo(e,n,r,i){let a=e.points[0],o=e.points[e.points.length-1],s=e.labelPosition;if(!s||!a||!o)return;let c=o.x-a.x,l=o.y-a.y,u=Math.hypot(c,l),d=(0,t.c4RelLabelLines)(e),f=e.label!==``||e.index!==void 0,p=f?Ha(d[0],$.messageSize,400):0,m=s.x-p/2,h=[{variant:{lines:d,position:s,...e.technologyX===void 0?{}:{technologyX:e.technologyX}},cost:0}];if(f){let t=e.technology?[`[${e.technology}]`]:[],n=new Set([d.join(`
|
|
86
|
+
`)]);go.forEach((e,r)=>{let i=Ia(d[0],p*e,$.messageSize),a=[...i,...t].join(`
|
|
87
|
+
`);if(n.has(a))return;n.add(a);let o=Math.max(...i.map(e=>Ha(e,$.messageSize,400)));h.push({variant:{lines:[...i,...t],position:{x:m+o/2,y:s.y}},cost:25*(r+1)})})}let g=u===0?0:c/u,_=u===0?0:l/u,v=u/2+Math.max(...ho)+fo,y=h.flatMap(t=>Do(e,t.variant)),b={x0:Math.min(...y.map(e=>e.x0))-v,x1:Math.max(...y.map(e=>e.x1))+v,y0:Math.min(...y.map(e=>e.y0))-v,y1:Math.max(...y.map(e=>e.y1))+v},x=e=>e.x0<b.x1&&e.x1>b.x0&&e.y0<b.y1&&e.y1>b.y0,S=[...n,...i].filter(x),C=Math.max(mo,u/200),w=r.filter(e=>x({x0:Math.min(...e.map(e=>e.x)),x1:Math.max(...e.map(e=>e.x)),y0:Math.min(...e.map(e=>e.y)),y1:Math.max(...e.map(e=>e.y))})),T=w.map(e=>({x0:Math.min(...e.map(e=>e.x)),x1:Math.max(...e.map(e=>e.x)),y0:Math.min(...e.map(e=>e.y)),y1:Math.max(...e.map(e=>e.y))})),E,D=e=>E?.penalty===0&&e>=E.cost;for(let{variant:t,cost:n}of h){let r=Do(e,t);for(let e of ho)if(!D(n+2*Math.abs(e)))for(let i=0;i<=u/2&&!D(n+2*Math.abs(e)+i);i+=C)for(let a of i===0?[1]:[1,-1]){let o=a*i,s={x:o*g-e*_,y:o*_+e*g},c=r.map(e=>({x0:e.x0+s.x,x1:e.x1+s.x,y0:e.y0+s.y,y1:e.y1+s.y})),l=0,u=E?.penalty??1/0;for(let e of c){if(l>u)break;for(let t of S)if(wo(e,t)&&(l+=t.weight),l>u)break;if(l>u)break;for(let[t,n]of w.entries()){let r=T[t];r.x1<=e.x0||r.x0>=e.x1||r.y1<=e.y0||r.y0>=e.y1||n.some(t=>t.x>e.x0&&t.x<e.x1&&t.y>e.y0&&t.y<e.y1)&&(l+=yo)}}let d=n+i+2*Math.abs(e);(!E||l<E.penalty||l===E.penalty&&d<E.cost)&&(E={v:t,at:s,penalty:l,cost:d})}}let{v:O,at:k}=E;e.labelPosition={x:O.position.x+k.x,y:O.position.y+k.y},O.lines!==d&&(e.labelLines=O.lines),O.technologyX===void 0?delete e.technologyX:e.technologyX=O.technologyX+k.x,i.push(...qa(e).map(e=>({...Co(e),weight:vo})))}function ko(e,t={}){if(e.elements.length===0&&e.boundaries.length===0){let t={variant:e.variant,width:0,height:0,elements:[],boundaries:[],relationships:[]};return e.title&&(t.title=e.title),t}let n=eo($a(e)),r=e.title?$.titleExtra:0,i=$.diagramMarginY+r,a=e.elements.flatMap(e=>{let t=n.elements.get(e.alias);return t?[{...e,x:t.x,y:t.y+i,width:t.width,height:t.height,nameLines:t.nameLines,descriptionLines:t.descriptionLines}]:[]}),o=[...n.boundaries].sort((e,t)=>e.depth-t.depth).map(e=>({...e,y:e.y+i})),s=new Map;for(let e of n.elements.values())s.set(e.el.alias,e);for(let e of n.boundaries)s.set(e.alias,e);let c=e.relationships.map((e,t)=>uo(e,t,s,i)),l=[...a.map(e=>({x0:e.x-po,x1:e.x+e.width+po,y0:e.y-po,y1:e.y+e.height+po,weight:_o})),...Eo(o)],u=c.map(To),d=[];c.forEach((e,t)=>Oo(e,l,u.filter((e,n)=>n!==t),d));let f=n.maxX+$.diagramMarginX,p=n.maxY+$.diagramMarginY+r,m={variant:e.variant,width:f,height:p,elements:a,boundaries:o,relationships:c};return e.title&&(m.title=e.title,m.titlePosition={x:(n.maxX-$.diagramMarginX)/2-4*$.diagramMarginX,y:$.diagramMarginY+$.diagramMarginY+i}),m}function Ao(t,n,r=`Inter`,i=!1,a=O,o,s,c,l={}){let u=[];u.push(Sr((0,e.svgOpenTag)(t.width,t.height,n,i,s??t.title,c,void 0,l.styleAttribute,l.description),o)),u.push((0,e.buildStyleBlock)(r,!1,l.nonce)),t.title&&t.titlePosition&&u.push(e.f`<text class="c4-title" x="${t.titlePosition.x}" y="${t.titlePosition.y}" dy="${N}" `+e.f`font-size="16" fill="var(--_text)">${(0,e.escapeXml)(t.title)}</text>`);for(let e of t.boundaries)u.push(Mo(e));for(let e of t.elements)u.push(No(e));for(let e of t.relationships)u.push(Vo(e));for(let e of t.relationships)u.push(Ho(e));return u.push(`</svg>`),u.filter(Boolean).join(`
|
|
88
|
+
`)}function jo(t,n,r,i,a){return e.f` <text x="${n}" y="${r}" text-anchor="middle" dy="${N}" font-size="${i}" `+e.f`${a}>${(0,e.escapeXml)(t)}</text>`}function Mo(n){let r=[];r.push(e.f`<g class="c4-boundary" data-id="${(0,e.escapeAttr)(n.alias)}" data-label="${(0,e.escapeAttr)(n.label)}" data-depth="${n.depth}">`),r.push(e.f` <rect x="${n.x}" y="${n.y}" width="${n.width}" height="${n.height}" rx="2.5" ry="2.5" `+`fill="none" stroke="var(--_text)" stroke-width="1" stroke-dasharray="7,7" />`);let i=n.x+n.width/2;r.push(jo(n.label,i,n.y+(n.labelY??8),$.boundarySize+2,`font-weight="700" fill="var(--_text)"`));let a=(0,t.c4BoundaryTypeLine)({alias:n.alias,label:n.label,...n.type?{type:n.type}:{},elementAliases:[],children:[]});return a&&n.typeY!==void 0&&r.push(jo(a,i,n.y+n.typeY,$.boundarySize,`fill="var(--_text)"`)),n.description&&n.descrY!==void 0&&r.push(jo(n.description,i,n.y+n.descrY,$.boundarySize-2,`fill="var(--_text)"`)),r.push(`</g>`),r.join(`
|
|
89
|
+
`)}function No(n){let r=Wa(n),{x:i,y:a,width:o,height:s}=n,c=i+o/2,l=Ra(n.nameLines.length,n.descriptionLines.length),u=[];u.push(e.f`<g class="c4-element" data-id="${(0,e.escapeAttr)(n.alias)}" data-kind="${n.kind}" data-shape="${n.shape}" `+e.f`data-external="${n.external}" data-label="${(0,e.escapeAttr)(n.label)}">`);let d,f=c;if(n.kind===`person`)u.push(...Fo(n,r)),d=a+La(o).pillTop+$.shapePadding;else if(n.shape===`db`){u.push(...Io(n,r));let{ry:e}=Ba(o);d=a+(2*e+s)/2-l/2}else if(n.shape===`queue`){u.push(...Lo(n,r));let{rx:e}=Va(s);f=c-e,d=a+s/2-l/2}else u.push(e.f` <rect x="${i}" y="${a}" width="${o}" height="${s}" rx="${$.cornerRadius}" ry="${$.cornerRadius}" `+e.f`fill="${r.fill}" stroke="${r.stroke}" stroke-width="${$.strokeWidth}" />`),d=a+$.shapePadding;let p=d;for(let t of n.nameLines)u.push(jo(t,f,p+$.nameLine/2,$.nameSize,e.f`font-weight="700" fill="${r.text}"`)),p+=$.nameLine;return u.push(jo((0,t.c4TypeLine)(n),f,p+$.typeLine/2,$.typeSize,e.f`fill="${r.text}"`)),p+=$.typeLine,n.descriptionLines.forEach((t,n)=>{u.push(jo(t,f,p+$.descrLine/2+n*$.descrExtraLine,$.descrSize,e.f`fill="${r.text}"`))}),p+=za(n.descriptionLines.length),u.push(`</g>`),u.join(`
|
|
90
|
+
`)}function Po(t){let{x:n,y:r,width:i,height:a}=t,{rx:o,headRadius:s,pillTop:c}=La(i,a),l=n+i/2,u=r+c,d=r+a,f=Math.sqrt(Math.max(0,s*s-(u-(r+s))**2));return e.f`M ${n+o} ${u} H ${l-f} A ${s} ${s} 0 1 1 ${l+f} ${u} `+e.f`H ${n+i-o} A ${o} ${o} 0 0 1 ${n+i} ${u+o} V ${d-o} `+e.f`A ${o} ${o} 0 0 1 ${n+i-o} ${d} H ${n+o} `+e.f`A ${o} ${o} 0 0 1 ${n} ${d-o} V ${u+o} `+e.f`A ${o} ${o} 0 0 1 ${n+o} ${u} Z`}function Fo(t,n){return[e.f` <path class="c4-person-shape" d="${Po(t)}" fill="${n.fill}" stroke="${n.stroke}" stroke-width="${$.strokeWidth}" />`]}function Io(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=Ba(a),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${$.strokeWidth}"`;return[e.f` <path d="M ${r} ${i+c} L ${r} ${i+o-c} A ${s} ${c} 0 0 0 ${r+a} ${i+o-c} L ${r+a} ${i+c} Z" ${l} />`,e.f` <ellipse cx="${r+s}" cy="${i+c}" rx="${s}" ry="${c}" ${l} />`]}function Lo(t,n){let{x:r,y:i,width:a,height:o}=t,{rx:s,ry:c}=Va(o),l=e.f`fill="${n.fill}" stroke="${n.stroke}" stroke-width="${$.strokeWidth}"`;return[e.f` <path d="M ${r+a-s} ${i} H ${r+s} A ${s} ${c} 0 0 0 ${r+s} ${i+o} H ${r+a-s} Z" ${l} />`,e.f` <ellipse cx="${r+a-s}" cy="${i+c}" rx="${s}" ry="${c}" ${l} />`]}function Ro(t,n){let r=t.x-n.x,i=t.y-n.y,a=Math.hypot(r,i);if(a===0)return``;let o=r/a,s=i/a,c=t.x-o*10,l=t.y-s*10;return e.f`<polygon class="c4-arrowhead" points="${t.x},${t.y} ${c-s*5},${l+o*5} ${c+s*5},${l-o*5}" `+`fill="var(--_text)" />`}var zo=3,Bo=1;function Vo(t){let[n,r]=[t.points[0],t.points[t.points.length-1]];if(!n||!r||n===r)return``;let i=[`class="c4-relationship"`,e.f`data-from="${(0,e.escapeAttr)(t.from)}"`,e.f`data-to="${(0,e.escapeAttr)(t.to)}"`];t.label&&i.push(e.f`data-label="${(0,e.escapeAttr)(t.label)}"`),t.technology&&i.push(e.f`data-technology="${(0,e.escapeAttr)(t.technology)}"`);let a=t.curve?e.f`M ${n.x},${n.y} Q ${t.curve.x},${t.curve.y} ${r.x},${r.y}`:e.f`M ${n.x},${n.y} L ${r.x},${r.y}`,o=e.f`<path ${i.join(` `)} d="${a}" fill="none" stroke="var(--_text)" stroke-width="1" />`,s=t.curve??n,c=t.curve??r,l=Ro(r,s),u=Ro(n,c);return[o,...t.bidirectional?[l,u]:[t.reversed?u:l]].filter(Boolean).join(`
|
|
91
|
+
`)}function Ho(t){let n=Ka(t),r=qa(t);if(r.length===0)return``;let i=[e.f`<g class="c4-relationship-label" data-from="${(0,e.escapeAttr)(t.from)}" data-to="${(0,e.escapeAttr)(t.to)}">`],a=Math.min(...r.map(e=>e.cx-e.w/2))-zo,o=Math.max(...r.map(e=>e.cx+e.w/2))+zo,s=r[0].cy-r[0].h/2-Bo,c=r[r.length-1],l=c.cy+c.h/2+Bo;return i.push(e.f` <rect class="c4-label-plate" x="${a}" y="${s}" width="${o-a}" height="${l-s}" rx="2" ry="2" fill="var(--bg)" />`),n.forEach((e,a)=>{let o=t.technology!==void 0&&a===n.length-1,s=r[a];i.push(jo(e,s.cx,s.cy,$.messageSize,o?`font-style="italic" fill="var(--_text)"`:`fill="var(--_text)"`))}),i.push(`</g>`),i.join(`
|
|
92
|
+
`)}var Uo={type:`xychart`,parse:t.parseXYChart,layoutForSvg:na,renderSvg(e,t,n){let r=n.interactivity===void 0?n.interactive??!1:n.interactivity===`full`;return ha(e,t.colors,t.font,t.transparent,r,t.embedSource,t.title,t.decorative,t.emit)}},Wo={type:`sequence`,parse:t.parseSequenceDiagram,layoutForSvg:Ni,renderSvg(e,t){return Pi(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}};function Go(e){return(e.interactivity??`static`)!==`none`}function Ko(e){return(e.interactivity??`static`)===`full`}var qo={type:`class`,parse:t.parseClassDiagram,layoutForSvg:Gr,renderSvg(e,t,n){return Yr(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,Go(n),t.emit)}},Jo={type:`er`,parse:t.parseErDiagram,layoutForSvg(t,n){return hi((0,e.withDirectionOverride)(t,n.direction),n)},renderSvg(e,t){return vi(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},Yo={type:`flowchart`,parse:(e,n)=>(0,t.parseMermaid)(n),layoutForSvg(t,n){return{graph:mn((0,e.withDirectionOverride)(t,n.direction),n),curve:n.curve??t.initConfig?.curve??`linear`}},renderSvg(e,t,n){return Tn(e.graph,t.colors,t.font,t.transparent,t.fontSizes,e.curve,t.embedSource,Ko(n),Go(n),t.title,t.decorative,t.emit)}},Xo={type:`c4`,parse:t.parseC4Diagram,layoutForSvg(e,t){return ko(e,t)},renderSvg(e,t){return Ao(e,t.colors,t.font,t.transparent,t.fontSizes,t.embedSource,t.title,t.decorative,t.emit)}},Zo={xychart:Uo,er:Jo,sequence:Wo,class:qo,flowchart:Yo,architecture:{type:`architecture`,parse:t.parseArchitecture,layoutForSvg(n,r){return{graph:fn((0,e.withDirectionOverride)((0,t.architectureToGraph)(n),r.direction),r),curve:r.curve??`linear`}},renderSvg:Yo.renderSvg},c4:Xo,pie:{type:`pie`,parse:(e,n)=>(0,t.parsePieChart)(n),layoutForSvg:Da,renderSvg(e,t){return Aa(e,t.colors,t.font,t.transparent,t.embedSource,t.title,t.decorative,t.emit)}}};function Qo(t){return{bg:t.bg??e.DEFAULTS.bg,fg:t.fg??e.DEFAULTS.fg,line:t.line,accent:t.accent,muted:t.muted??(t.bg||t.fg?void 0:e.DEFAULTS.muted),surface:t.surface,border:t.border}}function $o(t={}){return(0,e.themeStyleDeclarations)(Qo(t),t.transparent)}function es(e){return{nonce:e.nonce,styleAttribute:e.styleAttribute}}function ts(e,t={}){let n=ns(is(e,t));return t.resolveColors?Lr(n,Qo(t)):n}function ns(e){let t=new Set(Array.from(e.matchAll(/\sid="([^"]+)"/g),e=>e[1]??``));if(t.size===0)return e;let n=2166136261;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);let r=`zm${(n>>>0).toString(36)}-`,i=e=>t.has(e)&&!e.startsWith(`zm-`)?r+e:e;return e.replace(/(\sid=")([^"]+)"/g,(e,t,n)=>`${t}${i(n)}"`).replace(/url\(#([^)]+)\)/g,(e,t)=>`url(#${i(t)})`).replace(/(href=")#([^"]+)"/g,(e,t,n)=>`${t}#${i(n)}"`)}function rs(t){let r=(0,e.extractAccessibility)((0,n.decodeXML)(t)).text;Zo[(0,e.detectDiagramType)(r)].parse((0,e.splitStatements)(r),r)}function is(t,r){(0,e.checkLimit)(`maxInputLength`,t.length,r.limits);let i=(0,e.extractAccessibility)((0,n.decodeXML)(t)),a=i.text,o=Qo(r),s=r.font??`Inter`;(0,e.setMonospaceMetrics)((0,e.isMonospaceFont)(s));let c=r.transparent??!1,l=k(r.fontSizes),u=(0,e.detectDiagramType)(a),d=r.embedSource?t:void 0,f=r.title??i.accTitle,p=r.decorative,m={...es(r),description:i.accDescr},h=(0,e.splitStatements)(a),g=Zo[u],_=g.parse(h,a),v=_;v.nodes instanceof Map&&Array.isArray(v.edges)&&(0,e.checkGraphSize)(v.nodes.size,v.edges.length,r.limits);let y=g.layoutForSvg(_,r),b={colors:o,font:s,transparent:c,fontSizes:l,embedSource:d,title:f,decorative:p,emit:m};return g.renderSvg(y,b,r)}async function as(e,t={}){return ts(e,t)}var os=ts,ss=as;exports.ACTOR_LABEL_OFFSET=ki,exports.ARROW_HEAD=P,exports.CLS=W,exports.ELK_DIRECTION_FALLBACK=z,exports.ElkNotRegisteredError=p,exports.FONT_SIZES=O,exports.FONT_WEIGHTS=A,exports.GROUP_HEADER_CONTENT_PAD=ee,exports.INLINE_CENTERED_EDGE_LABEL=ie,exports.MONO_FONT=E,exports.MONO_FONT_STACK=D,exports.NODE_PADDING=j,exports.PIE=X,exports.STROKE_WIDTHS=M,exports.TEXT_BASELINE_SHIFT=N,exports.baseElkLayoutOptions=ne,exports.boxLabelHeight=Oi,exports.buildElkEdge=oe,exports.buildElkEdgeLabel=ae,exports.buildElkLeafNode=re,exports.buildSvgStyleBlock=F,exports.classBackEdges=Hr,exports.classNoteId=Rr,exports.clipEdgeToShape=De,exports.convertToElkFormat=hn,exports.createLayoutCache=v,exports.directionToElk=B,exports.elkLayoutSync=x,exports.elkPadding=te,exports.estimateMonoTextWidth=T,exports.estimateTextWidth=w,exports.evaluateCssColorValue=jr,exports.extractEdgeLabelPosition=Ue,exports.extractEdgePoints=He,exports.formatTickLabels=fa,exports.layoutClassDiagramSync=Gr,exports.layoutErDiagramSync=hi,exports.layoutFlowchartSync=mn,exports.layoutGraphSync=fn,exports.layoutPieChart=Da,exports.layoutSequenceDiagram=Ni,exports.layoutXYChart=na,Object.defineProperty(exports,"niceTickValues",{enumerable:!0,get:function(){return e.niceTickValues}}),exports.pieColorValue=Oa,exports.pointsToPath=c,exports.registerElk=m,exports.renderClassSvg=Yr,exports.renderErSvg=vi,exports.renderMermaid=ss,exports.renderMermaidSVG=ts,exports.renderMermaidSVGAsync=as,exports.renderMermaidSync=os,exports.renderPieSvg=Aa,exports.renderSequenceSvg=Pi,exports.renderSvg=Tn,exports.renderXYChartSvg=ha,exports.resolveCssColors=Lr,exports.resolveFontSizes=k,exports.smoothCurvePath=ya,exports.themeCssVariables=$o,exports.validateMermaid=rs,exports.withDataSrc=Sr,exports.xLabelStep=ca;
|
|
93
|
+
//# sourceMappingURL=index.cjs.map
|