agentic-mermaid 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/agent-core.d.ts +7 -7
- package/dist/agent-core.js +1 -1
- package/dist/agent.d.ts +7 -7
- package/dist/agent.js +1 -1
- package/dist/agentic-mermaid-mcp.js +1 -1
- package/dist/am.js +1 -1
- package/dist/browser-lazy/chunks/{agentic-producer-core-CC6OOLDW.js → agentic-producer-core-ECZ3CMZM.js} +1 -1
- package/dist/browser-lazy/chunks/{architecture-QUFVKYJR.js → architecture-H5LTMKQW.js} +6 -6
- package/dist/browser-lazy/chunks/{block-6J3Q63BO.js → block-566X6FNV.js} +5 -5
- package/dist/browser-lazy/chunks/{builtin-backends-7SOZZHPF.js → builtin-backends-VAFEZXKY.js} +6 -6
- package/dist/browser-lazy/chunks/{c4-SQVBZAKJ.js → c4-ZXFDLBFK.js} +5 -5
- package/dist/browser-lazy/chunks/{chunk-5X6MJX3H.js → chunk-2JQXRKBC.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-E2WMJZNM.js → chunk-37FZNMPR.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-TYZOZXUJ.js → chunk-3JTYTXA6.js} +6 -6
- package/dist/browser-lazy/chunks/{chunk-PQGPS2YV.js → chunk-4NILRBC7.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-AMJLVPUB.js → chunk-5LKPDHPC.js} +2 -2
- package/dist/browser-lazy/chunks/{chunk-BY2CPG6B.js → chunk-62MR3LWJ.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-J7FFAFQF.js → chunk-64JFHCJC.js} +1 -1
- package/dist/browser-lazy/chunks/chunk-6GPDLZFQ.js +1 -0
- package/dist/browser-lazy/chunks/{chunk-VWVZGQE2.js → chunk-6UOOATQR.js} +1 -1
- package/dist/browser-lazy/chunks/chunk-7TTFBJYA.js +1 -0
- package/dist/browser-lazy/chunks/chunk-7UFOFWBA.js +20 -0
- package/dist/browser-lazy/chunks/{chunk-5B2Z7575.js → chunk-A7V5VDKN.js} +1 -1
- package/dist/browser-lazy/chunks/chunk-CPO5P4L2.js +1 -0
- package/dist/browser-lazy/chunks/chunk-EIYLJ4FI.js +20 -0
- package/dist/browser-lazy/chunks/{chunk-X2UYKWKM.js → chunk-G4JBA7HU.js} +3 -3
- package/dist/browser-lazy/chunks/{chunk-2UIA2IME.js → chunk-IUI4DYC3.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-QA6GJQ4X.js → chunk-J57YRC2M.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-BU5LHXNJ.js → chunk-LBXXKLIR.js} +3 -3
- package/dist/browser-lazy/chunks/chunk-NKW2ZNCD.js +1 -0
- package/dist/browser-lazy/chunks/{chunk-ICC7HBJX.js → chunk-O34YYEQV.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-UL6NDWLL.js → chunk-OBI5U5XU.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-YCEICNM6.js → chunk-OFOS57WQ.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-OZ443IVJ.js → chunk-PSZEE64O.js} +7 -7
- package/dist/browser-lazy/chunks/{chunk-SZELX2EJ.js → chunk-PXTLV57R.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-HLWUNUCM.js → chunk-QVSZOF5M.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-2GPK4VFF.js → chunk-TT5GR5EJ.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-DF6765YX.js → chunk-V6I2VGNQ.js} +5 -5
- package/dist/browser-lazy/chunks/{chunk-CN7WTBWB.js → chunk-VRZKI33U.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-2SH76OTH.js → chunk-XHU3A432.js} +1 -1
- package/dist/browser-lazy/chunks/{chunk-NO7ZIVRU.js → chunk-YVNJDVQO.js} +1 -1
- package/dist/browser-lazy/chunks/chunk-Z7UHFVKN.js +6 -0
- package/dist/browser-lazy/chunks/{class-5QA4SCTS.js → class-XIFNVBFE.js} +8 -8
- package/dist/{zenuml/chunks/decode-BWERFDGK.js → browser-lazy/chunks/decode-5MFOG3AZ.js} +1 -1
- package/dist/browser-lazy/chunks/{elk.bundled-L4CADV5W.js → elk.bundled-RYWHIS5N.js} +8 -8
- package/dist/browser-lazy/chunks/er-VEUYJBGG.js +11 -0
- package/dist/browser-lazy/chunks/{eventmodeling-2BPLHWRN.js → eventmodeling-G7DITZX7.js} +10 -10
- package/dist/browser-lazy/chunks/{flowchart-NEIMZTB5.js → flowchart-SSFIU4EU.js} +1 -1
- package/dist/browser-lazy/chunks/{forest-implementation-AEP24AIP.js → forest-implementation-RWFF7XDV.js} +1 -1
- package/dist/browser-lazy/chunks/{gantt-RDPIFYAF.js → gantt-HQNVDX2B.js} +6 -6
- package/dist/browser-lazy/chunks/{gitgraph-N4Y5RYB7.js → gitgraph-Z5MN6M6L.js} +4 -4
- package/dist/browser-lazy/chunks/{ishikawa-LD3YBDJN.js → ishikawa-UEERNFQV.js} +2 -2
- package/dist/browser-lazy/chunks/{journey-6YQR5DJX.js → journey-3BEWWGB5.js} +6 -6
- package/dist/browser-lazy/chunks/{kanban-PLMJ7NBW.js → kanban-2WFNCWLB.js} +10 -10
- package/dist/browser-lazy/chunks/{mermaid-yaml-runtime-QVYX4EWK.js → mermaid-yaml-runtime-IK4ET4BT.js} +8 -8
- package/dist/browser-lazy/chunks/{mindmap-K2UBFO3Y.js → mindmap-R2C6SNYR.js} +4 -4
- package/dist/browser-lazy/chunks/{packet-CUW4QY6Y.js → packet-GMVCI5YZ.js} +3 -3
- package/dist/browser-lazy/chunks/{pie-7F7UUCG3.js → pie-WER45DKC.js} +7 -7
- package/dist/browser-lazy/chunks/{quadrant-TOONO2WC.js → quadrant-NCUPSFKN.js} +4 -4
- package/dist/browser-lazy/chunks/{radar-J6JVWVAX.js → radar-WLYS4YC5.js} +8 -8
- package/dist/browser-lazy/chunks/render-core-42UVWIPF.js +3 -0
- package/dist/browser-lazy/chunks/{requirement-CMAKDJPO.js → requirement-AK3NWMJ6.js} +7 -7
- package/dist/browser-lazy/chunks/{sankey-AWXQEP3F.js → sankey-C2DY6WVU.js} +4 -4
- package/dist/browser-lazy/chunks/{sequence-Q2RJRB4L.js → sequence-D4WJB44W.js} +1 -1
- package/dist/browser-lazy/chunks/{state-WRBFQEDX.js → state-YUQVESE7.js} +2 -2
- package/dist/browser-lazy/chunks/{timeline-D2KILFXM.js → timeline-BMBJJXWR.js} +4 -4
- package/dist/browser-lazy/chunks/{treemap-N3VYX5D4.js → treemap-B66XBZZ6.js} +3 -3
- package/dist/browser-lazy/chunks/{xychart-G73OGK66.js → xychart-HAVFROGT.js} +6 -6
- package/dist/browser-lazy/chunks/{zenuml-H4BXNYXR.js → zenuml-62RLYFWP.js} +7 -7
- package/dist/browser-lazy/index.js +1 -1
- package/dist/browser.global.js +507 -507
- package/dist/{chunk-DQDKA5ND.js → chunk-2DNGDTJD.js} +2 -2
- package/dist/{chunk-GVCHLSHH.js → chunk-4F2UGYTM.js} +2 -2
- package/dist/{chunk-H3NCS2XZ.js → chunk-7XYB2LNC.js} +2 -2
- package/dist/chunk-DOFB572I.js +58 -0
- package/dist/chunk-EHJI3QYE.js +52 -0
- package/dist/{chunk-UA234O4M.js → chunk-HINRNKPO.js} +2 -2
- package/dist/{chunk-JZOJ4YGS.js → chunk-KXMANAST.js} +33 -33
- package/dist/{chunk-7CRDX2QR.js → chunk-U4MT3RRE.js} +2 -2
- package/dist/{chunk-NKNFOREZ.js → chunk-WYIB6BUR.js} +2 -2
- package/dist/{cli-YGGTJZH7.js → cli-ZYIDBYNS.js} +2 -2
- package/dist/{index-EeXqJXr5.d.ts → index-Bvhprdxz.d.ts} +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/{mcp-cli-63DYXTVD.js → mcp-cli-YVDCORWA.js} +2 -2
- package/dist/{paint-certification-6rwQjIv_.d.ts → paint-certification-BoLyr006.d.ts} +2 -2
- package/dist/{server-5NEOHOFS.js → server-4JGAVXR3.js} +2 -2
- package/dist/{svg-styles-BdnoM7AT.d.ts → svg-styles-BnCoXyYe.d.ts} +1 -1
- package/dist/svg-styles.d.ts +1 -1
- package/dist/svg-styles.js +1 -1
- package/dist/svg.d.ts +4 -4
- package/dist/svg.js +1 -1
- package/dist/{types-BcS52Mjt.d.ts → types-CLVJCaH2.d.ts} +1 -1
- package/dist/zenuml/chunks/{appearance-UOQ5KA6O.js → appearance-5RM5MVM2.js} +1 -1
- package/dist/zenuml/chunks/{builtin-backends-KDKE7YHO.js → builtin-backends-UTNWL4N3.js} +11 -11
- package/dist/zenuml/chunks/{chunk-QWX77U7G.js → chunk-3A6S6GNB.js} +2 -2
- package/dist/zenuml/chunks/{chunk-OXQWRSBM.js → chunk-55WS466K.js} +11 -11
- package/dist/zenuml/chunks/chunk-6J4BGPB2.js +29 -0
- package/dist/zenuml/chunks/chunk-CNLL4BGF.js +1 -0
- package/dist/zenuml/chunks/{chunk-RZ6XK5CD.js → chunk-IARQ24W3.js} +13 -13
- package/dist/zenuml/chunks/{chunk-42DXZ5C6.js → chunk-ZNZRIISS.js} +2 -2
- package/dist/{browser-lazy/chunks/decode-63UIZGD2.js → zenuml/chunks/decode-LDNNXEAO.js} +1 -1
- package/dist/zenuml/chunks/{mermaid-yaml-runtime-KZVU74WU.js → mermaid-yaml-runtime-A5CNJ3IE.js} +8 -8
- package/dist/zenuml/chunks/render-core-ECIWU5ZS.js +3 -0
- package/dist/zenuml/chunks/{zenuml-EA2ZFRUX.js → zenuml-N3LZMB2G.js} +8 -8
- package/dist/zenuml.d.ts +2 -2
- package/dist/zenuml.js +1 -1
- package/docs/MCP-DIRECTORY-LISTINGS.md +81 -12
- package/docs/api.md +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/dist/browser-lazy/chunks/chunk-4LHYF3BS.js +0 -1
- package/dist/browser-lazy/chunks/chunk-FAIMVOX5.js +0 -6
- package/dist/browser-lazy/chunks/chunk-GVOEAY52.js +0 -1
- package/dist/browser-lazy/chunks/chunk-J35HAQQF.js +0 -20
- package/dist/browser-lazy/chunks/chunk-RIVTHZAQ.js +0 -1
- package/dist/browser-lazy/chunks/chunk-Z3FDIVLN.js +0 -20
- package/dist/browser-lazy/chunks/er-7ZSKGN7Y.js +0 -11
- package/dist/browser-lazy/chunks/render-core-BZOM3K7D.js +0 -3
- package/dist/chunk-EHCMJUMD.js +0 -52
- package/dist/chunk-OMY6NRQD.js +0 -58
- package/dist/zenuml/chunks/chunk-7TVYPTDW.js +0 -1
- package/dist/zenuml/chunks/chunk-RLJEI7YN.js +0 -29
- package/dist/zenuml/chunks/render-core-V5RQ737O.js +0 -3
- /package/dist/browser-lazy/chunks/{chunk-5FQ534HP.js → chunk-BMZ24VPS.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-2I4UPL7Q.js → chunk-D6MQ7QSU.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-CQE4HQEW.js → chunk-HJVO5VC3.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-LH7HUDKW.js → chunk-L4UC3KGS.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-NMQQMRIR.js → chunk-MFTQWHUB.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-N5ELX7LR.js → chunk-PJJSDGLB.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-CSFUKSU6.js → chunk-QCU5G5PZ.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-VQYYGAXP.js → chunk-TLFX3U6S.js} +0 -0
- /package/dist/browser-lazy/chunks/{chunk-5UVGUSD6.js → chunk-YHMTSXIR.js} +0 -0
- /package/dist/zenuml/chunks/{chunk-EVPSMEKN.js → chunk-GC7IPQ5P.js} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{a as e}from"./chunk-YHMTSXIR.js";import{c as t}from"./chunk-QCU5G5PZ.js";var r,n,i=0;function o(e,t){if(!r)return t();let o=n,a=i;n=e,i++;let s=performance.now();try{return t()}finally{let t=performance.now()-s;n=o,i=a,r(Object.freeze({stage:e,ms:t,depth:a,...o?{parent:o}:{}}))}}var a=new WeakMap;function s(e){return Object.freeze({...e,attempts:Object.freeze(e.attempts.map(e=>Object.freeze({...e})))})}function l(e,t){let r=a.get(e)??[],n=s(t);r.some(e=>JSON.stringify(e)===JSON.stringify(n))||a.set(e,Object.freeze([...r,n]))}function d(e){return a.get(e)??Object.freeze([])}function u(e,t){let r=a.get(e);r&&a.set(t,r)}var c=class extends Error{constructor(e){super(`No certified layout after ${e.length} bounded attempts: ${e.map(e=>`${e.strategy}: ${e.violations.join("; ")}`).join(" | ")}`),this.attempts=e,this.name="LayoutCertificationError"}attempts;code="LAYOUT_CERTIFICATION_FAILED"},f=class extends Error{constructor(e,t){super(`${e} has not loaded`),this.dependency=e,this.load=t}dependency;load};function h(e){let t=new Set;for(;e instanceof Error&&!t.has(e);){if(e instanceof f)return e;t.add(e),e=e.cause}}function p(e){let t=new Set(e),r=new Map;return(e,n=e)=>{let i="string"==typeof n?n:[...n];if("string"!=typeof i&&i.some(e=>"number"==typeof e&&!Number.isFinite(e)))throw TypeError("Generated identity key numeric components must be finite");let o=JSON.stringify(i),a=r.get(o);if(void 0!==a)return a;let s=e,l=1;for(;t.has(s);)s=`${e}#${l++}`;return t.add(s),r.set(o,s),s}}var m=48;function g(e,t=m){return t+(e-1)*(t+40)}function y(e){let t=0x811c9dc5;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,0x1000193);return t>>>0}function b(...e){return y(e.join("|")).toString(36)}function x(e){let t=e>>>0;return()=>{t|=0;let e=Math.imul((t=t+0x6d2b79f5|0)^t>>>15,1|t);return(((e=e+Math.imul(e^e>>>7,61|e)^e)^e>>>14)>>>0)/0x100000000}}function k(e,t,r){return y(`${e>>>0}|${t}|${r}`)}var v,w=class extends Error{constructor(e){super(`Agentic graph layout does not support this input: ${e}`),this.reason=e,this.name="GraphLayoutUnsupportedError"}reason;code="GRAPH_LAYOUT_UNSUPPORTED"};function $(e,t){let r=v;v=e;try{return t()}finally{v=r}}function M(e,t,r,n=!1,i){let o=e.graphLayout;if(!o)return r();let a=[],l,d=o.backend,u;if("agentic"===o.backend)try{l=t()}catch(t){let e=t instanceof w;if(!e&&!(n&&t instanceof c)||"elk"!==o.fallback)throw t;u=e?t.reason:"candidate failed mandatory geometry certification",a.push({backend:"agentic",outcome:e?"unsupported":"candidate-rejected",reason:u}),l=r(),d="elk"}else l=r();a.push({backend:d,outcome:"selected"});let f={requested:o.backend,fallback:o.fallback??"none",selected:d,attempts:a,implementation:"agentic"===d?"agentic-layered@28":"elk-layered@1",...u?{reason:u}:{}};return i?.(l,f),v?.(s(f)),l}function z(e){switch(e){case"LR":return"RIGHT";case"RL":return"LEFT";case"BT":return"UP";default:return"DOWN"}}var S="0.5.4",j=Object.freeze(["svg","png","ascii","unicode","html","layout"]),E=/^[a-z][a-z0-9.-]*:[a-z0-9][a-z0-9._/-]*$/,T=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,O=new Set(["required","preferred","optional"]);function C(e){return E.test(e)}function W(e){if("string"!=typeof e)return;let t=e.match(T);if(!t)return;let r=t[4];if(!r?.split(".").some(e=>/^\d+$/.test(e)&&e.length>1&&e.startsWith("0")))return{major:t[1],minor:t[2],patch:t[3],...r?{prerelease:r}:{}}}function F(e,t){return e.length!==t.length?e.length<t.length?-1:1:e===t?0:e<t?-1:1}function N(e){if("string"!=typeof e)return!1;let t=e.trim();if("*"===t||/^(0|[1-9]\d*)\.(?:x|\*)$/i.test(t))return!0;let r=t.match(/^(\^|~|>=)?(.+)$/),n=W(r?.[2]??"");return!!r&&!!n&&(!n.prerelease||void 0===r[1])}function I(e,t){let r=W(e);if(!r||"string"!=typeof t)return!1;let n=t.trim();if("*"===n)return void 0===r.prerelease;let i=n.match(/^(0|[1-9]\d*)\.(?:x|\*)$/i);if(i)return void 0===r.prerelease&&r.major===i[1];let o=n.match(/^(\^|~|>=)?(.+)$/),a=W(o?.[2]??"");if(!o||!a)return!1;let s=F(r.major,a.major)||F(r.minor,a.minor)||F(r.patch,a.patch);if(r.prerelease||a.prerelease)return void 0===o[1]&&0===s&&r.prerelease===a.prerelease;switch(o[1]){case">=":return s>=0;case"~":return s>=0&&r.major===a.major&&r.minor===a.minor;case"^":return!(s<0)&&("0"!==a.major?r.major===a.major:"0"!==a.minor?"0"===r.major&&r.minor===a.minor:"0"===r.major&&"0"===r.minor&&r.patch===a.patch);default:return 0===s}}var A=Object.freeze([{id:"core:render-request",version:"1.0.0"},{id:"core:family-descriptor",version:"1.0.0"}].map(e=>Object.freeze(e)));function L(e,t){var r,n,i;let o;return r=t.offers,n=t.requirements,i=t.outputAvailable,o={id:`output:${e}`,version:"1.0.0"},function(e,t){if(!Array.isArray(e))throw TypeError("Capability offers must be an array");if(!Array.isArray(t))throw TypeError("Capability requirements must be an array");let r=new Map;for(let[t,n]of e.entries()){if(!n||"object"!=typeof n||Array.isArray(n))throw TypeError(`Capability offer at index ${t} must be an object`);if("string"!=typeof n.id)throw Error(`Invalid capability id "${String(n.id)}"`);if(!C(n.id))throw Error(`Invalid capability id "${n.id}"`);if("string"!=typeof n.version)throw Error(`Capability "${n.id}" has invalid semantic version "${String(n.version)}"`);if(!W(n.version))throw Error(`Capability "${n.id}" has invalid semantic version "${n.version}"`);if(r.has(n.id))throw Error(`Duplicate capability offer "${n.id}"`);r.set(n.id,n.version)}let n=new Set,i=t.map((e,t)=>{if(!e||"object"!=typeof e||Array.isArray(e))throw TypeError(`Capability requirement at index ${t} must be an object`);if("string"!=typeof e.id)throw Error(`Invalid capability id "${String(e.id)}"`);if(!C(e.id))throw Error(`Invalid capability id "${e.id}"`);if(!O.has(e.level))throw Error(`Capability "${e.id}" has invalid requirement level "${String(e.level)}"`);if(!N(e.range))throw Error(`Capability "${e.id}" has invalid semantic-version range "${String(e.range)}"`);if(n.has(e.id))throw Error(`Duplicate capability requirement "${e.id}"`);n.add(e.id);let i=r.get(e.id),o=void 0===i?"unsupported":I(i,e.range)?"selected":"incompatible";return Object.freeze({id:e.id,range:e.range,level:e.level,status:o,...void 0!==i?{version:i}:{}})});return Object.freeze({version:1,accepted:i.every(e=>"required"!==e.level||"selected"===e.status),resolutions:Object.freeze(i)})}([...A,...r,...j.includes(e)&&i?[o]:[]],[{id:"core:render-request",range:"^1.0.0",level:"required"},...n,{id:`output:${e}`,range:"^1.0.0",level:"required"}])}var P=Object.freeze({core:S,scene:"2.0.0"}),q=/^[a-z][a-z0-9-]*$/,B=/^[a-z0-9][a-z0-9._/-]*$/,H=new WeakSet,R=new WeakMap;function D(e,t){if(!q.test(e))throw Error(`Invalid extension kind "${e}"`);if(!B.test(t))throw Error(`Invalid ${e} extension local id "${t}"`);return`${e}:${t}`}function G(e){let t=e.indexOf(":");if(t<=0||t===e.length-1||-1!==e.indexOf(":",t+1))return;let r=e.slice(0,t),n=e.slice(t+1);if(!(!q.test(r)||!B.test(n)))return{kind:r,localId:n}}function Z(e){let t=e.id,r=e.kind,n=e.version,i=e.compatibility,o=e.provenance,a=Object.freeze({...i??{}}),s=Object.freeze({...o}),l=G(t);if(!l||l.kind!==r)throw Error(`Extension id "${t}" must use the "${r}:" namespace`);if(!W(n))throw Error(`Extension "${t}" requires a semantic version (received "${n}")`);if(0===s.owner.trim().length)throw Error(`Extension "${t}" requires a provenance owner`);if(0===s.source.trim().length)throw Error(`Extension "${t}" requires a provenance source`);let d=Object.freeze({id:t,kind:r,version:n,compatibility:a,provenance:s}),u=function(e){let t=[];for(let[r,n]of Object.entries(e.compatibility)){if(void 0===n)continue;let e=P[r];if(!N(n)){t.push(Object.freeze({contract:r,range:n,status:"invalid",diagnostic:`Compatibility requirement "${r}" has invalid semantic-version range "${n}".`}));continue}if(void 0!==e){let i=I(e,n);t.push(Object.freeze({contract:r,range:n,status:i?"compatible":"incompatible",version:e,...i?{}:{diagnostic:`Compatibility requirement "${r}" range "${n}" does not include host version ${e}.`}}));continue}if(!C(r)){t.push(Object.freeze({contract:r,range:n,status:"invalid",diagnostic:`Unknown compatibility requirement "${r}" must use a namespace.`}));continue}t.push(Object.freeze({contract:r,range:n,status:"deferred"}))}return Object.freeze({accepted:t.every(e=>"compatible"===e.status||"deferred"===e.status),resolutions:Object.freeze(t)})}(d);if(!u.accepted)throw Error(`Extension "${t}" has incompatible requirements: ${u.resolutions.filter(e=>"incompatible"===e.status||"invalid"===e.status).map(e=>e.diagnostic).join("; ")}`);return H.add(d),d}var _=class extends Error{constructor(e,t){super(`Cannot register ${e.kind} "${e.id}" for owner "${e.provenance.owner}": already registered by "${t.provenance.owner}" at version ${t.version}`),this.incoming=e,this.existing=t,this.name="ExtensionCollisionError"}incoming;existing;code="EXTENSION_ID_COLLISION"};function J(e,t){let r=function(e,t){let r=R.get(e);if(r)throw r.reentrantAttempted=!0,Error(`Extension registry mutation is forbidden while ${r.operation} is in progress`);let n={operation:t,reentrantAttempted:!1};return R.set(e,n),n}(e,"extension registration");try{let n=Object.freeze({identity:t.identity,value:t.value});if(!H.has(n.identity))throw TypeError("Extension registration identity must be created by createExtensionIdentity()");let i=n.identity.id,o=e.get(i);if(o)throw new _(n.identity,o.identity);(function(e){if(e.reentrantAttempted)throw Error(`Extension registry mutation is forbidden after a reentrant attempt during ${e.operation}`)})(r),e.set(i,n)}finally{R.get(e)===r&&R.delete(e)}}var U=Object.freeze({fontFamily:{kind:"font"},fontSize:{kind:"number",minimum:1,maximum:256,expected:"between 1 and 256"},fontWeight:{kind:"number",minimum:1,maximum:1e3,expected:"between 1 and 1000"},letterSpacing:{kind:"number",minimum:-2,maximum:4,expected:"between -2 and 4"},textTransform:{kind:"enum",values:["uppercase","lowercase","capitalize"]},textColor:{kind:"color"},paddingX:{kind:"number",minimum:0,maximum:256,expected:"between 0 and 256"},paddingY:{kind:"number",minimum:0,maximum:256,expected:"between 0 and 256"},cornerRadius:{kind:"number",minimum:0,maximum:256,expected:"between 0 and 256"},lineWidth:{kind:"number",exclusiveMinimum:0,maximum:20,expected:"greater than 0 and at most 20"},bendRadius:{kind:"number",minimum:0,maximum:256,expected:"between 0 and 256"},fillColor:{kind:"color"},borderColor:{kind:"color"},strokeColor:{kind:"color"},headerFillColor:{kind:"color"},cue:{kind:"enum",values:["none","outline","double-line","pattern"]}}),V=Object.freeze(["fontSize","fontWeight","letterSpacing","textTransform","textColor","paddingX","paddingY","cornerRadius","lineWidth","fillColor","borderColor"]),X=Object.freeze(["fontSize","fontWeight","letterSpacing","textTransform","textColor","lineWidth","bendRadius","strokeColor"]),Y=Object.freeze([...V,"fontFamily","headerFillColor"]),Q=Object.freeze(["fontSize","fontWeight","letterSpacing","textTransform","textColor"]),K=Object.freeze(["fontFamily","fontSize","fontWeight","letterSpacing","textTransform","textColor","fillColor","borderColor","strokeColor","lineWidth","cue"]),ee=Object.freeze(["fillColor","borderColor","strokeColor","lineWidth","cue"]),et=Object.freeze(["fillColor","borderColor","strokeColor","lineWidth","textColor"]),er=Object.freeze(["fillColor","borderColor","strokeColor","lineWidth"]),en=Object.freeze(["borderColor","strokeColor","lineWidth"]),ei=Object.freeze([...er,"cue"]);function eo(e,t){return Object.freeze({properties:e,...t?{bindingFamilies:Object.freeze([...t])}:{}})}var ea=Object.freeze({node:eo(V),edge:eo(X),group:eo(Y),"group-header":eo(K,["journey"]),label:eo(Q),actor:eo(V,["sequence"]),relationship:eo(X,["er"]),"pie-slice":eo(ee,["pie","radar"]),legend:eo(et,["radar"]),bar:eo(er,["xychart","sankey","treemap"]),series:eo(en,["xychart"]),point:eo(er,["radar","xychart"]),task:eo(ei,["gantt"]),milestone:eo(ei,["gantt"])}),es=Object.freeze(Object.keys(ea)),el=Object.freeze(es.filter(e=>"bindingFamilies"in ea[e])),ed=Object.freeze([...new Set(el.flatMap(e=>ea[e].properties))]),eu=["shape","connector","text","group","document"],ec=["shape"],ef=["connector"],eh=["text"],ep=["shape","group"],em=["connector","group"],eg=["text","group"];function ey(e,t,r,n={}){let i=ea[e];return Object.freeze({applicableKinds:t,styleFallback:r,styleConsumption:i?"exact":"fallback-only",styleExtras:Object.freeze([]),...i?{styleProperties:i.properties}:{},styleBindingFamilies:Object.freeze([...i?.bindingFamilies??[]]),domIdentity:!1,relation:!1,sketch:"none",textHalo:!1,...n})}var eb=Object.freeze({node:ey("node",ep,"node",{domIdentity:!0,sketch:"shape"}),edge:ey("edge",ef,"edge",{domIdentity:!0,relation:!0,sketch:"connector"}),"edge-label":ey("edge-label",eg,"label"),group:ey("group",ep,"group",{domIdentity:!0,sketch:"shape"}),"group-header":ey("group-header",eu,"group",{sketch:"shape",textHalo:!0}),label:ey("label",eh,"label",{textHalo:!0}),actor:ey("actor",ep,"node",{domIdentity:!0,sketch:"shape"}),lifeline:ey("lifeline",em,"edge",{sketch:"connector"}),activation:ey("activation",ep,"node",{domIdentity:!0,sketch:"shape"}),message:ey("message",em,"edge",{domIdentity:!0,relation:!0,sketch:"connector"}),block:ey("block",eu,"group",{domIdentity:!0,sketch:"shape"}),note:ey("note",ep,"group",{domIdentity:!0,sketch:"shape"}),"class-box":ey("class-box",ep,"node",{domIdentity:!0,sketch:"shape"}),member:ey("member",eh,"label",{domIdentity:!0,textHalo:!0}),entity:ey("entity",ep,"node",{domIdentity:!0,sketch:"shape"}),attribute:ey("attribute",eg,"label",{domIdentity:!0,textHalo:!0}),relationship:ey("relationship",ef,"edge",{domIdentity:!0,relation:!0,sketch:"connector"}),cardinality:ey("cardinality",["shape","text"],"label",{domIdentity:!0,textHalo:!0}),"pie-slice":ey("pie-slice",ec,"node",{domIdentity:!0,sketch:"shape"}),legend:ey("legend",["shape","text","group"],"group",{textHalo:!0}),bar:ey("bar",ec,"node",{domIdentity:!0,sketch:"shape"}),series:ey("series",ef,"edge",{domIdentity:!0,sketch:"connector"}),point:ey("point",ec,"node",{domIdentity:!0}),axis:ey("axis",eu,"label",{textHalo:!0}),grid:ey("grid",eu,"edge"),plate:ey("plate",ec,"node",{domIdentity:!0,sketch:"shape"}),section:ey("section",eu,"group",{domIdentity:!0,sketch:"shape",textHalo:!0}),task:ey("task",eu,"node",{domIdentity:!0,sketch:"shape"}),milestone:ey("milestone",ec,"node",{domIdentity:!0,sketch:"shape"}),"marker-line":ey("marker-line",eu,"edge"),rail:ey("rail",eu,"edge",{sketch:"connector"}),period:ey("period",ep,"group",{domIdentity:!0,sketch:"shape"}),event:ey("event",ep,"group",{domIdentity:!0,sketch:"shape"}),score:ey("score",eu,"node"),"actor-pill":ey("actor-pill",ec,"node",{sketch:"shape"}),service:ey("service",ep,"node",{domIdentity:!0,sketch:"shape"}),junction:ey("junction",ep,"node",{domIdentity:!0}),icon:ey("icon",["shape","text","group","document"],"node",{textHalo:!0}),title:ey("title",eu,"label",{domIdentity:!0,textHalo:!0}),defs:ey("defs",["document"],"label"),prelude:ey("prelude",["document"],"label"),chrome:ey("chrome",eu,"label")}),ex=Object.freeze({applicableKinds:eu,styleFallback:"label",styleConsumption:"fallback-only",styleExtras:Object.freeze([]),styleBindingFamilies:Object.freeze([]),domIdentity:!0,relation:!1,sketch:"none",textHalo:!1}),ek=Object.freeze(Object.entries(eb).map(([e,t])=>Object.freeze({identity:Z({id:`role:${e}`,kind:"role",version:"1.0.0",compatibility:{core:S,scene:"^2.0.0"},provenance:{owner:"agentic-mermaid",source:"built-in",reference:"src/scene/roles.ts"}}),role:e,traits:t,style:Object.freeze({fallbackRole:t.styleFallback,applicableProperties:t.styleProperties??Object.freeze([])})})));function ev(e){let t;return((t=eb[e])?{traits:t,source:"builtin"}:{traits:ex,source:"namespaced-safe"}).traits}function ew(e,t,r={},n={}){let i=ek.find(e=>e.role===t),o=e?.roles,a=!1===n.includeFallback?void 0:i?o?.[i.style.fallbackRole]:void 0,s=o?.[t],l=a||s?{...a,...s}:void 0,d=new Set(i?.style.applicableProperties??[]);for(let n of e?.bindings??[]){if(void 0!==n.role&&n.role!==t||!function(e,t){let r=t[e.channel];return Array.isArray(r)?r.includes(e.value):String(r??"")===e.value}(n,r))continue;let i=e?.semanticSlots?.[n.slot];if(!i)continue;let o=Object.fromEntries(Object.entries(i).filter(([e])=>d.has(e)));l={...l,...o}}return l?Object.freeze(l):void 0}var e$=Object.freeze({id:"agentic-mermaid:inter-estimate",version:"4.0.0"});function eM(e,t){let r=function(e){if(void 0===e)return;if("object"!=typeof e||null===e)throw TypeError("textMeasurement must be an object with id, version, and measure");let{id:t,version:r,measure:n}=e;if("string"!=typeof t||t.length>160||!/^[A-Za-z][A-Za-z0-9._:/-]*$/.test(t))throw TypeError("textMeasurement.id must be a stable name of at most 160 characters");if(t===e$.id)throw TypeError("textMeasurement.id is reserved for the deterministic default");if("string"!=typeof r||r.length>80||!W(r))throw TypeError("textMeasurement.version must be a semantic version");if("function"!=typeof n)throw TypeError("textMeasurement.measure must be a function");return Object.freeze({id:t,version:r,measure:n})}(e);if(!r)return;let n=Object.freeze({id:r.id,version:r.version}),i=new Map;return Object.freeze({identity:n,width(e){let o=e.fontFamily??(e.monospace?"JetBrains Mono":t),a=JSON.stringify([e.text,o,e.fontSize,e.fontWeight,e.fontStyle,e.monospace]),s=i.get(a);if(void 0!==s)return s;let l=ez(void 0,()=>r.measure(Object.freeze({...e,fontFamily:o})));if("number"!=typeof l||!Number.isFinite(l)||l<0||l>1e6)throw RangeError(`Text measurement profile ${n.id}@${n.version} must return a finite width between 0 and 1000000 pixels`);return i.size<2e4&&i.set(a,l),l}})}function ez(e,t){let r=eE;eE=e;try{return t()}finally{eE=r}}function eS(){return void 0!==eE}function ej(e){return eE?.width(e)}var eE,eT,eO=["text-spans","indexed-layout","position-cache"],eC=globalThis,eW=eC.process?.env?.AGENTIC_MERMAID_EXPERIMENTS??eC.AGENTIC_MERMAID_EXPERIMENTS,eF=new Set("string"==typeof eW?eW.split(",").map(e=>e.trim()).filter(Boolean):eO);function eN(e){return(eT??eF).has(e)}var eI=class{#e=new Map;#t=0;#r;#n;#i;constructor(e,t,r){this.#r=e,this.#n=t,this.#i=r}get(e){let t=this.#e.get(e);if(t)return this.#e.delete(e),this.#e.set(e,t),t.value}canFit(e,t){let r=this.#e.get(e);return Number.isFinite(t)&&t>=0&&this.#e.size+ +!r<=this.#r&&this.#t-(r?.weight??0)+t<=this.#n}leastRecentlyUsed(){let e=this.#e.values().next();return e.done?void 0:e.value.value}delete(e){let t=this.#e.get(e);return!!t&&(this.#e.delete(e),this.#t-=t.weight,this.#i?.(e,t.value),!0)}set(e,t,r){if(!(!Number.isFinite(r)||r<0||r>this.#n))for(this.delete(e),this.#e.set(e,{value:t,weight:r}),this.#t+=r;this.#e.size>this.#r||this.#t>this.#n;){let e=this.#e.keys().next().value;this.delete(e)}}clear(){if(this.#i)for(let e of this.#e.keys())this.delete(e);else this.#e.clear(),this.#t=0}},eA="<\\/?(?:b|strong|i|em|u|s|del)\\s*>",eL=/<(\/)?(?:(b|strong)|(i|em)|(u)|(s|del))\s*>/gi,eP=RegExp(eA,"i");function eq(e){let t,r=[],n=!1,i=!1,o=!1,a=!1,s=0;for(eL.lastIndex=0;null!==(t=eL.exec(e));){t.index>s&&r.push({text:e.slice(s,t.index),bold:n,italic:i,underline:o,strikethrough:a}),s=t.index+t[0].length;let l=!!t[1];t[2]?n=!l:t[3]?i=!l:t[4]?o=!l:t[5]&&(a=!l)}return s<e.length&&r.push({text:e.slice(s),bold:n,italic:i,underline:o,strikethrough:a}),r}var eB=new Intl.Segmenter(void 0,{granularity:"grapheme"}),eH=/^[\x20-\x7e]*$/;function eR(e){return eH.test(e)?e.split(""):Array.from(eB.segment(e),e=>e.segment)}function eD(e=()=>!1){let t=new WeakSet,r=r=>t.has(r)||e(r);return{has:r,freeze:e=>(Object.freeze(e),Reflect.ownKeys(e).every(t=>{let n=Object.getOwnPropertyDescriptor(e,t),i=n.value;return"value"in n&&(null===i||"object"!=typeof i&&"function"!=typeof i||r(i))})&&t.add(e),e)}}function eG(e,t=!1){if(!/[\u0000-\u001f\u007f-\u009f]/.test(e))return e;let r="";for(let n of e){let e=n.codePointAt(0),i=e<=31||e>=127&&e<=159;" "===n?r+=" ":!i||t&&(n===`
|
|
2
|
+
`||"\r"===n)?r+=n:r+="?"}return r}function eZ(e){return e.split(`
|
|
3
|
+
`).map(e=>eG(e)).join(`
|
|
4
|
+
`)}var e_=new eI(512,4194304),eJ=new WeakSet,eU=eD();function eV(e){return eJ.add(e),e}function eX(e){return eJ.has(e)?e:eV(eU.freeze({source:e.source,display:e.display,...e.transform?{transform:e.transform}:{},lineStarts:eU.freeze([...e.lineStarts]),lines:eU.freeze(e.lines.map(e=>eU.freeze(e.map(e=>eU.freeze({...e,...e.clusters?{clusters:eU.freeze(e.clusters.map(e=>eU.freeze({...e})))}:{}})))))}))}function eY(e,t){return t?.value===e?t.prepared:e}function eQ(e){return e.lines.map(e=>e.map(e=>e.text).join("")).join(`
|
|
5
|
+
`)}function eK(e,t,r){if((e=eX(e)).transform)throw TypeError("Display tokens must be decoded before text transforms");let n=new RegExp(t.source,t.flags.includes("g")?t.flags:t.flags+"g"),i=e.lines.map(e=>eU.freeze(e.map(e=>{let t=[],i=[];for(let r of e.clusters??[{text:e.text,sourceStart:e.sourceStart,sourceEnd:e.sourceEnd}])for(let e=0;e<r.text.length;e++)t.push(r.sourceStart),i.push(r.sourceEnd);let o=[],a=(r,n,a,s)=>{let l=n;for(let d of eR(r))o.push(eU.freeze({text:eG(d),sourceStart:t[s?n:l]??e.sourceStart,sourceEnd:i[s?a-1:l+d.length-1]??e.sourceEnd})),l+=d.length},s=0;for(let t of e.text.matchAll(n)){if(0===t[0].length)throw TypeError("Display token patterns must not match empty text");a(e.text.slice(s,t.index),s,t.index,!1),a(r(t[0]),t.index,t.index+t[0].length,!0),s=t.index+t[0].length}return a(e.text.slice(s),s,e.text.length,!1),eU.freeze({...e,text:o.map(e=>e.text).join(""),clusters:eU.freeze(o)})})));return eV(eU.freeze({...e,lines:eU.freeze(i)}))}function e0(e){let t=[[]],r=[0],n="",i="literal";for(let o of e){let e=e1(o,"literal");if(e.transform)throw TypeError("Display text must be combined before text transforms");"formatted"===e.display&&(i="formatted");let a=n.length;for(let[n,i]of e.lines.entries())for(let o of(n>0&&(t.push([]),r.push(a+e.lineStarts[n])),i))t.at(-1).push(eU.freeze({...o,sourceStart:a+o.sourceStart,sourceEnd:a+o.sourceEnd,...o.clusters?{clusters:eU.freeze(o.clusters.map(e=>eU.freeze({...e,sourceStart:a+e.sourceStart,sourceEnd:a+e.sourceEnd})))}:{}}));n+=e.source}return eV(eU.freeze({source:n,display:i,lines:eU.freeze(t.map(e=>eU.freeze(e))),lineStarts:eU.freeze(r)}))}function e1(e,t="formatted",r){if("string"!=typeof e){if(e=eX(e),!r||e.transform===r)return e;if(e.transform)throw TypeError("A prepared display transform cannot be replaced without its original runs");return e2(e,r)}let n=eN("text-spans")&&e.length<=16384?JSON.stringify([e,t,r]):void 0;if(void 0!==n){let e=e_.get(n);if(e)return e}let i=0,o=[],a=eU.freeze([]),s=e.split(`
|
|
6
|
+
`).map(e=>{let r;if(o.push(i),""===e)return i++,a;if("literal"===t)r=[{text:e,bold:!1,italic:!1,underline:!1,strikethrough:!1,sourceStart:i,sourceEnd:i+e.length}];else{let t=RegExp(eA,"gi"),n=[],o=0;for(let r of e.matchAll(t))r.index>o&&n.push({start:o,end:r.index}),o=r.index+r[0].length;o<e.length&&n.push({start:o,end:e.length}),r=eq(e).map((e,t)=>({...e,sourceStart:i+n[t].start,sourceEnd:i+n[t].end}))}return r=r.map(e=>{let t=e.sourceStart,r=eR(e.text).map(e=>{let r=eU.freeze({text:eG(e),sourceStart:t,sourceEnd:t+e.length});return t+=e.length,r});return eU.freeze({...e,text:r.map(e=>e.text).join(""),clusters:eU.freeze(r)})}),i+=e.length+1,eU.freeze(r)}),l=eV(eU.freeze({source:e,display:t,lines:eU.freeze(s),lineStarts:eU.freeze(o)})),d=r?e2(l,r):l;return void 0!==n&&e_.set(n,d,2*n.length+96*e.length+256),d}function e2(e,t){let r=e.lines.map(e=>{let r=e.map(e=>e.text).join(""),n="uppercase"===t?r.toUpperCase():"lowercase"===t?r.toLowerCase():"capitalize"===t?r.replace(/(?<![\p{L}\p{M}\p{N}\p{Pc}])\p{L}/gu,e=>e.toUpperCase()):r,i="capitalize"===t?new Set([...r.matchAll(/(?<![\p{L}\p{M}\p{N}\p{Pc}])\p{L}/gu)].map(e=>e.index)):void 0,o=0,a=0;return eU.freeze(e.map(e=>{let r=a,s=(e.clusters??[{text:e.text,sourceStart:e.sourceStart,sourceEnd:e.sourceEnd}]).map(e=>{let r="uppercase"===t||i?.has(o)?e.text.toUpperCase().length:"lowercase"===t?e.text.toLowerCase().length:e.text.length,s=n.slice(a,a+r);return o+=e.text.length,a+=r,eU.freeze({...e,text:s})});return eU.freeze({...e,text:n.slice(r,a),clusters:eU.freeze(s)})}))});return eV(eU.freeze({...e,transform:t,lines:eU.freeze(r)}))}var e5=[[11904,12031],[12032,12255],[12288,12351],[12352,12447],[12448,12543],[12544,12591],[12688,12799],[12800,13311],[13312,19903],[19968,40959],[63744,64255],[131072,196607]],e3=[[4352,4447],[12592,12687],[44032,55215]],e6=[[9001,9002],[65040,65049],[65072,65135],[65280,65376],[65504,65510]],e4=[[127744,129791]],e8=[[768,879],[6832,6911],[7616,7679],[8400,8447],[65056,65071]],e9=new Set([8203,8204,8205,65279]);function e7(e,t){for(let[r,n]of t)if(e>=r&&e<=n)return!0;return!1}var te=new Set(["i","l","t","f","j","I","1","!","|",".",",",":",";","'"]),tt=new Set(["W","M","w","m","@","%"]),tr=new Set(["W","M"]),tn=new Set(["(",")","[","]","{","}","/","\\","-",'"',"`"]);function ti(e){return e7(e,e8)||e9.has(e)||65038===e||65039===e}function to(e){return e7(e,e5)||e7(e,e3)||e7(e,e6)||e7(e,e4)}var ta=/\p{Emoji_Presentation}|\p{Extended_Pictographic}/u;function ts(e){let t=e.codePointAt(0);return void 0===t||ti(t)?0:to(t)||ta.test(e)?2:" "===e?.3:tr.has(e)?1.5:tt.has(e)?1.2:te.has(e)?.4:tn.has(e)?.5:"r"===e?.8:t>=65&&t<=90?1.2:1}var tl={version:4,unit:"px",fontCalibration:"Inter-compatible proportional estimate",monospaceCalibration:"0.6em-per-cell",wideCodepoints:"src/shared/unicode-ranges.ts",emojiDetection:"Emoji_Presentation-or-Extended_Pictographic",ambiguousWidth:"single-cell",paintedAdvanceProjection:"prepared-positions-or-svg-textLength-spacingAndGlyphs",naturalAdvanceExemptions:"prepared-non-ascii-shaping-runs"};function td(e){var t;let r=(t=e.fontWeight)>=600?.6:t>=500?.57:.54,n=0,i=0;for(let t of e.text)n+=ts(t),i++;let o=.15*e.fontSize;return{contract:tl,width:ej({...e,fontStyle:e.fontStyle??"normal",monospace:!1})??n*e.fontSize*r+o,charWidthUnits:n,codePointCount:i,fontSize:e.fontSize,fontWeight:e.fontWeight,baseRatio:r,minPadding:o}}function tu(e,t,r,n="normal",i){return td({text:e,fontSize:t,fontWeight:r,fontStyle:n,fontFamily:i}).width}function tc(e,t,r,n="normal",i){let o=td({text:e,fontSize:t,fontWeight:r,fontStyle:n,fontFamily:i});if(eS())return o.width;let a=0;for(let t of e)tr.has(t)&&(a+=1.85-1.5);return o.width+a*t*o.baseRatio}function tf(e,t,r=0,n=400,i="normal",o){let a=eR(e),s=Math.max(0,a.length-1)*r,l=ej({text:e,fontSize:t,fontWeight:n,fontStyle:i,fontFamily:o,monospace:!0});if(void 0!==l)return Math.max(0,l+s);let d=0;for(let e of a){let t=0;for(let r of e){let e=r.codePointAt(0);void 0===e||ti(e)||(t=Math.max(t,to(e)||ta.test(r)?2:1))}d+=t}return Math.max(0,d*t*.6+s)}function th(e,t,r,n=0,i="normal",o){let a=eP.test(e)?eq(e):[{text:e,bold:!1}],s=a.map(e=>e.text).join(""),l=0===n?0:Math.max(0,eR(s).length-1)*n;return Math.max(0,a.reduce((e,n)=>e+tu(n.text,t,n.bold?Math.max(700,r):r,"italic"in n&&n.italic||"italic"===i?"italic":"normal",o),0)+l)}var tp=1.3;function tm(e,t,r,n=0){if("string"!=typeof e){let i=e.lines.map(e=>e.map(e=>e.text).join("")),o=e.lines.reduce((e,o,a)=>{let s=0===n?0:Math.max(0,eR(i[a]).length-1)*n;return Math.max(e,o.reduce((e,n)=>e+tu(n.text,t,n.bold?Math.max(700,r):r),0)+s)},0),a=t*tp;return{width:o,height:i.length*a,lines:i,lineHeight:a}}let i=e.split(`
|
|
7
|
+
`),o=t*tp,a=0;for(let e of i){let i=th(e,t,r,n);i>a&&(a=i)}return{width:a,height:i.length*o,lines:i,lineHeight:o}}function tg(e,t=!0){return ty(tb(e,t))}function ty(e){return e.replace(/\*\*(.+?)\*\*/g,"<b>$1</b>").replace(/(?<!\*)\*([^\s*](?:[^*]*[^\s*])?)\*(?!\*)/g,"<i>$1</i>").replace(/~~(.+?)~~/g,"<s>$1</s>")}function tb(e,t=!0){let r=tk(e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e);return(t?r.replace(/\\n/g,`
|
|
8
|
+
`):r).replace(/<\/?(?:sub|sup|small|mark)\s*>/gi,"")}var tx=/<br\s*\/?>/gi;function tk(e){return e.replace(tx,`
|
|
9
|
+
`)}function tv(e,t="formatted"){return e1(e,t).lines.map(e=>e.map(e=>e.text).join("")).join(`
|
|
10
|
+
`)}var tw=/[&<>"']/,t$=/[&<>"'\t\n\r]/;function tM(e){return"string"!=typeof e||tw.test(e)?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function tz(e){return"string"!=typeof e||t$.test(e)?tM(e).replace(/[\t\n\r]/g,e=>" "===e?"	":e===`
|
|
11
|
+
`?" ":" "):e}function tS(e){return tz(eZ(e))}function tj(e,t=400){let r=[];e.bold&&r.push(`font-weight="${t>700?t:"bold"}"`),e.italic&&r.push('font-style="italic"');let n=[];return e.underline&&n.push("underline"),e.strikethrough&&n.push("line-through"),n.length&&r.push(`text-decoration="${n.join(" ")}"`),r}function tE(e,t=400){return 0===e.length?"":e.every(e=>!e.bold&&!e.italic&&!e.underline&&!e.strikethrough)?e.map(e=>tM(e.text)).join(""):e.map(e=>{let r=tM(e.text);return e.bold||e.italic||e.underline||e.strikethrough?`<tspan ${tj(e,t).join(" ")}>${r}</tspan>`:r}).join("")}function tT(e,t,r,n,i){let o=e.lineBlocks[t];if(/[^\x20-\x7e]/u.test(o.runs.map(e=>e.text).join(""))){let t="start"===n?r+o.width/2:"end"===n?r-o.width/2:r;return`<tspan x="${tL(t)}"${void 0===i?"":` y="${tL(i)}"`} text-anchor="middle" data-text-fragment="true">${tE(o.runs,e.fontWeight)}</tspan>`}if(0===e.letterSpacing&&!o.fragments)return tE(o.runs,e.fontWeight);if(!o.fragments)throw TypeError("Tracked text requires retained fragment allocations");let a=("middle"===n?r-o.width/2:"end"===n?r-o.width:r)+o.originX;return o.fragments.map(t=>{let r=tj(o.runs[t.runIndex],e.fontWeight),n=/^ | $/.test(t.text)?' xml:space="preserve"':"";return`<tspan x="${tL(a+t.x)}" text-anchor="start" letter-spacing="0" data-text-fragment="true" textLength="${tL(Math.max(0,t.width))}" lengthAdjust="spacingAndGlyphs"${n}${r.length?` ${r.join(" ")}`:""}>${tM(t.text)}</tspan>`}).join("")}function tO(e,t,r,n,i,o=.35,a=!1){let s="string"==typeof e?void 0:e,l=s?s.text:e,d=s?s.lines:l.split(`
|
|
12
|
+
`),u=s?.prepared.display??(a?"literal":"formatted"),c=i.match(/\btext-anchor="([^"]*)"/)?.[1]??"start",f=s&&/[^\x20-\x7e]/u.test(s.lineBlocks.map(e=>e.runs.map(e=>e.text).join("")).join("")),h=s&&(0!==s.letterSpacing||f),p=(e,r)=>s?tT(s,r,t,c):function(e,t="formatted"){return"literal"!==t&&eP.test(e)?tE(e1(e,t).lines[0]):tM(e)}(e,u);"literal"===u&&eP.test(l)&&!i.includes("data-literal-text=")&&(i+=' data-literal-text="true"');let m=s?s.lineBlocks.map(e=>e.runs.map(e=>e.text).join("")).join(`
|
|
13
|
+
`):tv(l,u);/(?:^ | $| {2}|\t)/m.test(m)&&!i.includes("xml:space=")&&(i+=' xml:space="preserve"'),s&&(i+=' data-prepared-text="true"');let g=e=>!s||h||s.lineBlocks[e].fragments?"":` textLength="${tL(s.lineBlocks[e].width)}" lengthAdjust="spacingAndGlyphs" data-font-metrics="deterministic-fit"`;if(1===d.length){let e=n*o;return f?`<text x="${tL(t)}" y="${tL(r)}" ${i}>${tT(s,0,t,c,r+e)}</text>`:`<text x="${tL(t)}" y="${tL(r)}" ${i} dy="${tL(e)}"${g(0)}>${p(l,0)}</text>`}let y=s?.lineHeight??n*tp,b=-((d.length-1)/2)*y+n*o,x=d.map((e,n)=>{let i=f?`y="${tL(r+b+n*y)}"`:`dy="${tL(0===n?b:y)}"`;return`<tspan x="${tL(t)}" ${i}${g(n)}>${p(e,n)}</tspan>`}).join("");return`<text x="${tL(t)}" y="${tL(r)}" ${i}>${x}</text>`}var tC=/[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g,tW=/\.\d{12}/,tF=/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?(?:%|px|pt|pc|em|ex|rem|cm|mm|in)?$/,tN=new Set(["x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","dx","dy","width","height","refX","refY","markerWidth","markerHeight","stroke-width","stroke-dashoffset","stroke-miterlimit","pathLength","font-size","font-weight","letter-spacing","textLength","opacity","fill-opacity","stroke-opacity","stop-opacity","offset"]),tI=new Map,tA=new Map;function tL(e){let t=tI.get(e);if(void 0!==t)return t;let r=String(e),n=r.length>=14&&tW.test(r)&&Number.isFinite(e)?String(Number(e.toPrecision(12))):r;return tI.size>=1024&&tI.clear(),tI.set(e,n),n}function tP(e,t){if(t.length<13||!tW.test(t))return t;let r=t.length<=512?`${e}\0${t}`:void 0,n=void 0===r?void 0:tA.get(r);if(void 0!==n)return n;if(!(tN.has(e)&&tF.test(t)||("viewBox"===e||"points"===e||"stroke-dasharray"===e)&&/^[-+\d.eE,\s]+$/.test(t)||"d"===e&&/^[MmZzLlHhVvCcSsQqTtAa\d.eE,+\s-]+$/.test(t)||("transform"===e||"gradientTransform"===e||"patternTransform"===e)&&/^(?:(?:matrix|translate|scale|rotate|skewX|skewY)\s*\([-+\d.eE,\s]+\)\s*)+$/.test(t)))return t;let i=t.replace(tC,(e,r)=>{if(!tW.test(e))return e;let n=Number(e);if(!Number.isFinite(n))return e;let i=tL(n);return e.startsWith(".")&&r>0&&/[\d.]/.test(t[r-1])?` ${i}`:i});return void 0!==r&&(tA.size>=256&&tA.clear(),tA.set(r,i)),i}function tq(e){return!e.includes("->")&&!/[#:"\[\],\u0000-\u001f]/.test(e)}function tB(e,t,r=""){let n=tq(e)&&tq(t)?`${e}->${t}`:`relation:${JSON.stringify([e,t])}`;return r?`${r}:${n}`:n}function tH(e,...t){let r=t.map(String);return tq(e)&&r.every(tq)?[e,...r].join(":"):`part:${JSON.stringify([e,...r])}`}function tR(e,t,...r){let n=r.map(String);return tq(t)&&n.every(tq)?[e,t,...n].join(":"):`${e}:${JSON.stringify([t,...n])}`}function tD(e){return ev(e).domIdentity}function tG(e,t){if(!tD(t.role))return e;let r=e.match(/^\s*<([A-Za-z][\w:-]*)\b[^>]*>/)?.[0];if(!r||r.startsWith("<style")||r.startsWith("<defs")||r.startsWith("<svg"))return e;let n=(e,t,r)=>{let n=tz(r),i=RegExp(`\\s${t}="[^"]*"`);if(i.test(e))return e.replace(i,` ${t}="${n}"`);let o=e.endsWith("/>")?"/>":">";return`${e.slice(0,-o.length).trimEnd()} ${t}="${n}"${"/>"===o?" /":""}>`},i=n(n(r,"data-id",t.id),"data-role",t.role);return void 0!==t.from&&(i=n(i,"data-from",t.from)),void 0!==t.to&&(i=n(i,"data-to",t.to)),i===r?e:e.replace(r,i)}function tZ(e,t,r=0){return Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r}function t_(e,t){let r=t.x-e.x,n=t.y-e.y,i=Math.hypot(r,n);return Number.isFinite(i)&&i>0?{x:r/i,y:n/i}:void 0}function tJ(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function tU(e,t){return Math.hypot(t.x-e.x,t.y-e.y)}function tV(e,t,r){let n=tU(t,r);return 0===n?tU(e,t):Math.abs((r.x-t.x)*(t.y-e.y)-(t.x-e.x)*(r.y-t.y))/n}function tX(e,t,r,n,i=.5,o=12){if(!Number.isFinite(i)||i<=0)throw TypeError("Cubic flattening tolerance must be positive and finite");if(!Number.isSafeInteger(o)||o<0)throw TypeError("Cubic flattening maxDepth must be a non-negative safe integer");for(let i of[e,t,r,n])if(!Number.isFinite(i.x)||!Number.isFinite(i.y))throw TypeError("Cubic flattening points must be finite");let a=[{...e}],s=(e,t,r,n,l)=>{let d=tU(e,n),u=tU(e,t)+tU(t,r)+tU(r,n)-d;if(Math.max(tV(t,e,n),tV(r,e,n))<=i&&u<=i||l>=o)return void a.push({...n});let c=tJ(e,t),f=tJ(t,r),h=tJ(r,n),p=tJ(c,f),m=tJ(f,h),g=tJ(p,m);s(e,c,p,g,l+1),s(g,m,h,n,l+1)};return s(e,t,r,n,0),a}function tY(...e){let t=e[0];if(t)for(let r=1;r<e.length;r++){let n=t_(t,e[r]);if(n)return n}}function tQ(e,t,r,n=.5){var i,o,a,s,l,d,u;let c,f;for(let e of[t,...r.flatMap(e=>"line"===e.kind?[e.end]:"quadratic"===e.kind?[e.control,e.end]:[e.control1,e.control2,e.end])])if(!Number.isFinite(e.x)||!Number.isFinite(e.y))throw TypeError("Connector path projection points must be finite");let h=[{...t}],p=[],m=t;for(let e of r){if(p.push(m),"line"===e.kind)h.push({...e.end});else if("quadratic"===e.kind){let[t,r]=(i=m,o=e.control,a=e.end,[{x:i.x+(o.x-i.x)*2/3,y:i.y+(o.y-i.y)*2/3},{x:a.x+(o.x-a.x)*2/3,y:a.y+(o.y-a.y)*2/3}]);h.push(...tX(m,t,r,e.end,n).slice(1))}else h.push(...tX(m,e.control1,e.control2,e.end,n).slice(1));m=e.end}for(let e=0;e<r.length&&!c;e++)s=p[e],c="line"===(l=r[e]).kind?tY(s,l.end):"quadratic"===l.kind?tY(s,l.control,l.end):tY(s,l.control1,l.control2,l.end);for(let e=r.length-1;e>=0&&!f;e--)d=p[e],f="line"===(u=r[e]).kind?tY(d,u.end):"quadratic"===u.kind?tY(u.control,u.end)??tY(d,u.end):tY(u.control2,u.end)??tY(u.control1,u.end)??tY(d,u.end);return{geometry:{kind:"path",d:e,points:h},contours:[{start:{...t},end:{...m},closed:!1,...c?{startTangent:c}:{},...f?{endTangent:f}:{}}]}}function tK(e,t,r){return"manhattan"===r?Math.abs(t.x-e.x)+Math.abs(t.y-e.y):tU(e,t)}function t0(e,t){if(void 0===t)return e;if(!Number.isSafeInteger(t)||t<0)throw TypeError("Rounded connector precision must be a non-negative safe integer");let r=10**t;return Math.round(e*r)/r}function t1(e,t,r,n,i){let o=tK(e,t,n);if(0===o)return{...e};let a=r/o;return{x:t0(e.x+(t.x-e.x)*a,i),y:t0(e.y+(t.y-e.y)*a,i)}}function t2(e,t){for(let r=1;r<e.length-1;r++){let n=t?r:e.length-1-r,i=e[n-1],o=e[n],a=e[n+1],s=o.x-i.x,l=o.y-i.y,d=a.x-o.x,u=a.y-o.y;if(s*u!=l*d||s*d+l*u<0)return n}return -1}function t5(e,t,r={}){if(0===e.length)throw RangeError("Rounded connector paths require at least one point");if(!Number.isFinite(t))throw TypeError("Rounded connector radius must be finite");let n=r.metric??"euclidean",i=r.terminalClearance;if(i&&(!Number.isFinite(i.start??0)||(i.start??0)<0||!Number.isFinite(i.end??0)||(i.end??0)<0))throw TypeError("Terminal clearance must be finite and non-negative");let o=e[0],a=[];if(t<=0||e.length<3){for(let t=1;t<e.length;t++)a.push({kind:"line",end:e[t]});return tQ(`M${e.map(e=>`${e.x},${e.y}`).join(" L")}`,o,a,r.tolerance)}let s=i?.start?t2(e,!0):-1,l=i?.end?t2(e,!1):-1,d=[`M${o.x},${o.y}`];for(let u=1;u<e.length-1;u++){let c=e[u-1],f=e[u],h=e[u+1],p=Math.max(0,Math.min(t,tK(c,f,n)/2,tK(f,h,n)/2,u===s?tK(o,f,n)-i.start:1/0,u===l?tK(e.at(-1),f,n)-i.end:1/0));if(p<=0){d.push(`L${f.x},${f.y}`),a.push({kind:"line",end:f});continue}let m=t1(f,c,p,n,r.precision),g=t1(f,h,p,n,r.precision);d.push(`L${m.x},${m.y}`),d.push(`Q${f.x},${f.y} ${g.x},${g.y}`),a.push({kind:"line",end:m}),a.push({kind:"quadratic",control:f,end:g})}let u=e.at(-1);return d.push(`L${u.x},${u.y}`),a.push({kind:"line",end:u}),tQ(d.join(" "),o,a,r.tolerance)}function t3(e,t=!1){return"line"===e.kind?[{points:[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}],closed:!1}]:"path"===e.kind&&void 0!==e.subpaths?e.subpaths:[{points:e.points,closed:t}]}function t6(e){return"path"===e.kind&&/[AaCcQqSsTt]/.test(e.d)}function t4(e,t=!1){let r=[];for(let n of t3(e,t)){let t,i=n.points[0],o=n.points.at(-1);if(!i||!o)continue;for(let e=1;e<n.points.length&&!t;e++)t=t_(n.points[e-1],n.points[e]);let a=n.closed&&!tZ(i,o);!t&&a&&(t=t_(o,i));let s=a?t_(o,i):void 0;for(let e=n.points.length-1;e>0&&!s;e--)s=t_(n.points[e-1],n.points[e]);r.push({start:"line"===e.kind?i:{...i},end:"line"===e.kind?o:{...n.closed?i:o},closed:n.closed,...t?{startTangent:t}:{},...s?{endTangent:s}:{}})}return r}function t8(e,t=!1){let r=[],n=[];for(let i of t3(e,t)){let e=i.points[0],t=i.closed?e:i.points.at(-1);e&&r.push(e),t&&n.push(t)}return{starts:r,ends:n}}function t9(e,t=!1){let r=[];for(let[n,i]of t3(e,t).entries()){for(let e=1;e<i.points.length;e++)r.push({start:i.points[e-1],end:i.points[e],subpathIndex:n,closing:!1});let e=i.points[0],t=i.points.at(-1);i.closed&&e&&t&&!tZ(e,t)&&r.push({start:t,end:e,subpathIndex:n,closing:!0})}return r}function t7(e,t=!1){return"line"===e.kind?[]:"path"===e.kind?e.markerMidpoints??[]:t3(e,t).flatMap(e=>{if(e.points.length<2)return[];let t=e.closed&&tZ(e.points[0],e.points.at(-1))?e.points.slice(0,-1):e.points;return e.closed?t.slice(1):t.slice(1,-1)})}var re=Object.assign(Object.create(null),{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}),rt=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function rr(e){let t=e.replace("#",""),r=3===t.length||4===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t;return[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)]}function rn(e){return ry(e)?rr(e):null}function ri(e,t,r){return"#"+[e,t,r].map(e=>Math.round(Math.max(0,Math.min(255,e))).toString(16).padStart(2,"0")).join("")}function ro(e,t,r){return ri(...ra(rr(e),rr(t),r))}function ra(e,t,r,n=[0,0,0]){let i=r/100;for(let r=0;r<3;r++)n[r]=Math.round(Math.max(0,Math.min(255,e[r]*i+t[r]*(1-i))));return n}function rs(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function rl(e){return .2126*rs(e[0]/255)+.7152*rs(e[1]/255)+.0722*rs(e[2]/255)}function rd(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function ru(e){let t=rk(e);return t?rl(t):null}function rc(e,t){let r=ru(e),n=ru(t);return null===r||null===n?null:rd(r,n)}function rf(e,t,r,n){let i=rc(e,t);if(null===i||i>=r)return e;let o=rc("#000000",t)??0,a=rc("#ffffff",t)??0,s=(n?rc(n,t)??0:0)>=r?n:o>=a?"#000000":"#ffffff";if((rc(s,t)??0)<r)return e;let l=ru(t),d=rr(s),u=rr(e),c=[0,0,0];for(let e=1;e<=1e3;e++)if(ra(d,u,e/10,c),rd(rl(c),l)>=r)return ri(...c);return s}var rh=4.5,rp=3,rm=3;function rg(e,t,r=rh){return rf(e,t,r)}function ry(e){return rt.test(e)}function rb(e){return/^#[0-9a-fA-F]{6}$/.test(e)}function rx(e,t,r){return(299*e+587*t+114*r)/1e3}function rk(e){let t=e.trim().toLowerCase(),r=Object.hasOwn(re,t)?re[t]:void 0;if(r){let e=rr(r);return[e[0],e[1],e[2],1]}if("transparent"===t)return[0,0,0,0];let n=ry(t)?t.slice(1):void 0;if(n){let e=n.length<=4?[...n].map(e=>e+e).join(""):n;return[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16),8===e.length?Number.parseInt(e.slice(6,8),16)/255:1]}let i=t.match(/^rgba?\((.*)\)$/);if(i){let e=i[1].trim(),t=e.split("/").map(e=>e.trim());if(t.length>2||2===t.length&&e.includes(","))return null;let r=(e.includes(",")?e.split(","):t[0].split(/\s+/)).map(e=>e.trim()),n=t[1];if(e.includes(",")&&4===r.length&&void 0===n&&(n=r.pop()),3!==r.length||e.includes(",")&&r.some(e=>e.endsWith("%"))&&!r.every(e=>e.endsWith("%")))return null;let o=r.map(e=>{let t=e.endsWith("%"),r=rw(e,t);return null===r?null:Math.max(0,Math.min(255,t?2.55*r:r))});if(o.some(e=>null===e))return null;let a=rv(n);return null===a?null:[o[0],o[1],o[2],a]}let o=t.match(/^hsla?\((.*)\)$/);if(o){let e=o[1].trim(),t=e.split("/").map(e=>e.trim());if(t.length>2||2===t.length&&e.includes(","))return null;let r=(e.includes(",")?e.split(","):t[0].split(/\s+/)).map(e=>e.trim()),n=t[1];if(e.includes(",")&&4===r.length&&void 0===n&&(n=r.pop()),3!==r.length||e.includes(",")&&(!r[1].endsWith("%")||!r[2].endsWith("%")))return null;let i=function(e){let t=e.trim().match(/^([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(deg|grad|rad|turn)?$/i);if(!t)return null;let r=Number(t[1]);if(!Number.isFinite(r))return null;let n=r;switch(t[2]?.toLowerCase()){case"grad":n*=.9;break;case"rad":n*=180/Math.PI;break;case"turn":n*=360}return Number.isFinite(n)?n:null}(r[0]),a=rw(r[1],r[1].endsWith("%")),s=rw(r[2],r[2].endsWith("%")),l=rv(n);if(null===i||null===a||null===s||null===l)return null;let d=s/100,u=Math.max(0,a)/100*(1-Math.abs(2*d-1)),c=(i%360+360)%360/60,f=u*(1-Math.abs(c%2-1)),[h,p,m]=c<1?[u,f,0]:c<2?[f,u,0]:c<3?[0,u,f]:c<4?[0,f,u]:c<5?[f,0,u]:[u,0,f],g=d-u/2,y=[(h+g)*255,(p+g)*255,(m+g)*255];return y.some(e=>!Number.isFinite(e))?null:[Math.max(0,Math.min(255,y[0])),Math.max(0,Math.min(255,y[1])),Math.max(0,Math.min(255,y[2])),l]}return null}function rv(e){if(void 0===e)return 1;let t=e.endsWith("%"),r=rw(e,t);return null===r?null:Math.max(0,Math.min(1,t?r/100:r))}function rw(e,t){if(!(t?/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?%$/i:/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?$/i).test(e))return null;let r=Number(t?e.slice(0,-1):e);return Number.isFinite(r)?r:null}function r$(e,t){let r=rk(e);if(!r)return null;if(1===r[3])return[r[0],r[1],r[2]];let n=rk(t);if(!n)return null;let i=n[3],o=r[3]+i*(1-r[3]);return o<=0?null:[0,1,2].map(e=>Math.min(255,Math.max(0,(r[e]*r[3]+n[e]*i*(1-r[3]))/o)))}function rM(e){let t=rn(e);return t?rl(t):null}function rz(e,t){let r=rM(e),n=rM(t);return null===r||null===n?null:rd(r,n)}function rS(e,t,r="#ffffff"){let n=r$(t,r);if(!n)return null;let i=ri(...n),o=r$(e,i);return o?rz(ri(...o),i):null}var rj=[1,0,0,1,0,0];function rE(e){if(!e)return rj;if("matrix"===e.kind)return[e.a,e.b,e.c,e.d,e.e,e.f];let t=e.angle*Math.PI/180,r=Math.cos(t),n=Math.sin(t);return[r,n,-n,r,e.cx-r*e.cx+n*e.cy,e.cy-n*e.cx-r*e.cy]}function rT(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}function rO(e,t){return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}function rC(e){let t=e[0]*e[3]-e[1]*e[2];if(!(!Number.isFinite(t)||0===t))return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[3]*e[4])/t,(e[1]*e[4]-e[0]*e[5])/t]}function rW(e){return"rotate"===e.kind?`rotate(${e.angle} ${e.cx} ${e.cy})`:`matrix(${e.a} ${e.b} ${e.c} ${e.d} ${e.e} ${e.f})`}var rF=Symbol.for("agentic-mermaid.performance-observer.v1"),rN=globalThis;function rI(e,t){try{e(Object.freeze(t))}catch{}}function rA(e,t,r,n){let i=rN[rF];"function"==typeof i&&rI(i,{version:1,kind:"cache",owner:e,outcome:t,...r?{reason:r}:{},...n?{detail:n}:{}})}function rL(e,t,r){let n=rN[rF];"function"==typeof n&&rI(n,{version:1,kind:"fallback",owner:e,reason:t,...void 0!==r?{attempt:r}:{}})}var rP,rq=0,rB=0;function rH(e){let t;"function"==typeof(t=rN[rF])&&rI(t,{version:1,kind:"scope",owner:"graphical"});let r=rP,n=rq,i=rB;rP=new Map,rq=0,rB=0;try{return e()}finally{rP=r,rq=n,rB=i}}function rR(e,t,r){if(!rP)return rA("svg-inspection","bypass","outside-graphical-scope",e),r();let n=rP.get(e);if(n?.has(t))return rA("svg-inspection","hit",void 0,e),n.get(t);rA("svg-inspection","miss",void 0,e);let i=r();return rB<512&&rq+t.length<=524288?(n||(n=new Map,rP.set(e,n)),n.set(t,i),rq+=t.length,rB++):rA("svg-inspection","store-skipped",rB>=512?"entry-limit":"character-limit",e),i}function rD(e){if(void 0===e)return!1;let t=e.charCodeAt(0),r=32|t;return r>=97&&r<=122||t>=48&&t<=57||95===t||46===t||58===t||45===t}function rG(e){if(void 0===e)return!1;let t=e.charCodeAt(0);return t<128?32===t||t>=9&&t<=13:/\s/.test(e)}function rZ(e,t){let r=e.indexOf(">",t);if(r<0)return -1;for(let n=t;n<r;n++){let t=e[n];if('"'!==t&&"'"!==t)continue;let i=e.indexOf(t,n+1);if(i<0||(n=i,i>r&&(r=e.indexOf(">",i+1))<0))return -1}return r+1}function r_(e){return rR("start-tags",e,()=>rJ(e))}function rJ(e,t,r,n){let i=t||r||n?void 0:[];for(let o=e.indexOf("<");o>=0;o=e.indexOf("<",o+1)){if(e.startsWith("\x3c!--",o)){let t=e.indexOf("--\x3e",o+4);if(t<0)break;o=t+2;continue}let a=e[o+1];if(!a||"/"===a||"!"===a||"?"===a)continue;let s=o+1;for(;rD(e[s]);)s++;if(s===o+1)continue;let l=rZ(e,s);if(l<0)break;let d=l-2;for(;d>o&&rG(e[d]);)d--;let u=e.slice(o+1,s);n&&(n.name=u);let c="/"===e[d],f=i?[]:void 0;if(i||t||n){let i=s;for(;i<l-1;){for(;rG(e[i]);)i++;if(">"===e[i]||"/"===e[i]&&">"===e[i+1])break;let o=i;for(;rD(e[i]);)i++;if(i===o)break;let a=e.slice(o,i);for(;rG(e[i]);)i++;if("="!==e[i])break;for(i++;rG(e[i]);)i++;let s=e[i];if('"'!==s&&"'"!==s)break;let d=++i,u=e.indexOf(s,i);if(u<0||u>=l-1)break;if(i=u,f)f.push(Object.freeze({name:a,value:e.slice(d,i),quote:s,nameStart:o,valueStart:d,valueEnd:i}));else if(n&&n.name===n.expectedName)n.attribute(a,e.slice(d,i));else if(t&&rK.has(a)){let e={start:d,end:i};t.push(e),"style"===a&&r.push(e)}i++}}if(i&&i.push(Object.freeze({name:u,start:o,end:l,attributes:Object.freeze(f),selfClosing:c})),n)return;if(r&&"style"===u&&!c){let n=e.indexOf("</style",l);if(n>=0){let e={start:l,end:n};t?.push(e),r.push(e)}}o=l-1}return i&&Object.freeze(i)}function rU(e){let t=e.search(/\S/);if(t<0)return;let r=rZ(e,t);if(r<0)return;let n=r_(e.slice(0,r))[0];return n?.start===t&&"svg"===n.name?n:void 0}function rV(e,t){return e.attributes.find(e=>e.name===t)}function rX(t,r){let n=rV(t,r);return n?e(n.value):void 0}function rY(e,t){if(0===t.length)return e;let r=[...t].sort((e,t)=>t.start-e.start),n=[],i=e.length;for(let t of r){if(t.end>i){let t=e;for(let e of r)t=`${t.slice(0,e.start)}${e.value}${t.slice(e.end)}`;return t}n.push(e.slice(t.end,i),t.value),i=t.start}return n.push(e.slice(0,i)),n.reverse().join("")}function rQ(e,t){let r=[];for(let n of r_(e))for(let e of n.attributes){let i=t(e,n);void 0!==i&&i!==e.value&&r.push({start:e.valueStart,end:e.valueEnd,value:i})}return rY(e,r)}var rK=new Set(["clip-path","color","cursor","fill","filter","flood-color","lighting-color","marker-end","marker-mid","marker-start","mask","stop-color","stroke","style"]);function r0(e){let t=[],r=[];return rJ(e,t,r),{source:e,cssRanges:t,styleContexts:r}}function r1(e){let t=[];return rJ(e,void 0,t),t}function r2(e,t,r=r0(e)){if(r.source!==e)throw Error("SVG CSS projection does not match its source");return rY(e,r.cssRanges.map(r=>({...r,value:t(e.slice(r.start,r.end))})))}function r5(e,t,r){return`${e.slice(0,t.start)}${r}${e.slice(t.end)}`}function r3(e,t){let r=[...e].map(e=>e.codePointAt(0)),n=[...t].map(e=>e.codePointAt(0)),i=Math.min(r.length,n.length);for(let e=0;e<i;e++){let t=r[e]-n[e];if(0!==t)return t}return r.length-n.length}function r6(e,t,r){let n=r*Math.PI/180,i=Math.cos(n),o=Math.sin(n),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*i-s*o,y:t.y+a*o+s*i}}function r4(e,t,r){if(r%360==0)return{...e};let n=[r6({x:e.x0,y:e.y0},t,r),r6({x:e.x1,y:e.y0},t,r),r6({x:e.x0,y:e.y1},t,r),r6({x:e.x1,y:e.y1},t,r)];return{x0:Math.min(...n.map(e=>e.x)),y0:Math.min(...n.map(e=>e.y)),x1:Math.max(...n.map(e=>e.x)),y1:Math.max(...n.map(e=>e.y))}}var r8=new eI(256,8388608),r9=new WeakSet,r7=eD(function(e){return eU.has(e)});function ne(e){return r7.has(e)}function nt(e){return r9.has(e)}function nr(e,t){r9.has(e)&&r9.add(t)}function nn(e,t){return e.bold===t.bold&&e.italic===t.italic&&e.underline===t.underline&&e.strikethrough===t.strikethrough}function ni(e){let t=[],r;for(let n of e.flatMap(e=>e.fragments??e))r&&nn(r,n)?(r.text+=n.text,r.sourceEnd=n.sourceEnd):(r={...n},t.push(r));return t}function no(e,t){if(0===e.length)return 0;let r=t.safeFont?tc:tu,n=1!==e.length||e[0].fragments?ni(e):e,i=1===n.length?n[0].text:n.map(e=>e.text).join("");if((t.letterSpacing??0)!==0&&!/[^\x20-\x7e]/u.test(i))return ns(n,t).width;let o=t.monospace?eS()?n.reduce((e,r)=>e+tf(r.text,t.fontSize,0,r.bold?Math.max(700,t.fontWeight):t.fontWeight,r.italic?"italic":"normal",t.fontFamily),0):tf(i,t.fontSize):n.reduce((e,n)=>e+r(n.text,t.fontSize,n.bold?Math.max(700,t.fontWeight):t.fontWeight,n.italic?"italic":"normal",t.fontFamily),0);if(!eS()&&/[^\x20-\x7e]/u.test(i))return Math.max(o,n.reduce((e,r)=>e+[...r.text].reduce((e,n)=>e+(0===ts(n)?0:/[^\x20-\x7e]/u.test(n)?1.2*t.fontSize:tc(n,t.fontSize,r.bold?Math.max(700,t.fontWeight):t.fontWeight)),0),0)+eR(i).filter(e=>/\p{M}/u.test(e)&&[...e].every(e=>0===ts(e))).length*t.fontSize*1.2)+Math.max(0,[...i].length-1)*Math.abs(t.letterSpacing??0);if((t.letterSpacing??0)<0)return ns(n,t).width;let a=t.letterSpacing??0;return Math.max(0,o+(0===a?0:Math.max(0,eR(i).length-1)*a))}function na(e,t,r,n){let i=t.bold?Math.max(700,n.fontWeight):n.fontWeight,o=t.italic?"italic":"normal",a=n.safeFont?tc:tu;return n.monospace?tf(e,n.fontSize,0,i,o,n.fontFamily):a(e,n.fontSize,i,o,n.fontFamily)-(r||eS()?0:.15*n.fontSize)}function ns(e,t){let r=0,n=0,i=0;for(let o of e){let e=eR(o.text);for(let[a,s]of e.entries()){let l=na(s,o,a===e.length-1,t);n=Math.min(n,r),i=Math.max(i,r+l),r+=l+(t.letterSpacing??0)}}return{width:i-n,originX:-n}}function nl(e){let{fragments:t,...r}=e.fragments?.at(-1)??e;return{...r,text:"-",clusters:void 0}}function nd(e,t){if(eN("text-spans")&&(t={display:t.display,transform:t.transform,fontSize:t.fontSize,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,maxWidth:t.maxWidth,safeFont:t.safeFont,monospace:t.monospace,fontFamily:t.fontFamily}),!Number.isFinite(t.fontSize)||t.fontSize<=0||!Number.isFinite(t.fontWeight)||!Number.isFinite(t.letterSpacing??0))throw RangeError("Prepared text requires finite typography and a positive font size");let r=eN("text-spans")&&!eS()&&"string"==typeof e&&e.length<=16384?JSON.stringify([e,t]):void 0;if(void 0!==r){let e=r8.get(r);if(e)return e}let n=e1(e,t.display,t.transform),i=t.maxWidth,o=[],a=[];for(let[e,r]of n.lines.entries()){if(e>0&&a.push({kind:"authored",sourceOffset:n.lineStarts[e]-1}),0===r.length){o.push([]);continue}if(!i||!Number.isFinite(i)||i<=0||no(r,t)<=i){o.push([...r]);continue}let s=function(e){let t=e.flatMap(e=>(e.clusters??eR(e.text).map(t=>({text:t,sourceStart:e.sourceStart,sourceEnd:e.sourceEnd}))).map(t=>({...e,...t,clusters:void 0}))),r=0,n=0;return eR(t.map(e=>e.text).join("")).map(e=>{let i=e.length,o=[];for(;i>0;){let e=t[r],a=Math.min(i,e.text.length-n);o.push({...e,text:e.text.slice(n,n+a)}),i-=a,(n+=a)===e.text.length&&(r++,n=0)}return{...o[0],text:e,sourceEnd:o.at(-1).sourceEnd,...o.length>1?{fragments:o}:{}}})}(r),l=eN("text-spans"),d=l&&!eS()?function(e,t){if(1!==e.length||t.monospace||t.letterSpacing||e[0].bold||e[0].italic||e[0].underline||e[0].strikethrough||/[^\x20-\x7e]/u.test(e[0].text))return;let r=e[0],n=e=>Number.isInteger(e)&&e>=0&&e<=0xffffffff;if(!r.clusters||r.clusters.length!==r.text.length||!n(r.sourceEnd)||r.clusters.some((e,t)=>e.text!==r.text[t]||!n(e.sourceStart)))return;let i=new Float64Array(r.text.length+1),o=new Uint32Array(r.text.length+1),a=t.fontWeight>=600?.6:t.fontWeight>=500?.57:.54;for(let e=0;e<r.text.length;e++){let n=ts(r.text[e]);t.safeFont&&("W"===r.text[e]||"M"===r.text[e])&&(n+=.35),i[e+1]=i[e]+n,o[e]=r.clusters[e].sourceStart}return o[r.text.length]=r.sourceEnd,{offsets:o,width:(e,r)=>(i[r]-i[e])*t.fontSize*a+.15*t.fontSize}}(r,t):void 0,u=l?(e,r)=>{let n=d?.width(e,r);return void 0!==n&&Math.abs(n-i)>1e-8*Math.max(1,Math.abs(n),Math.abs(i))?n<i:no(s.slice(e,r),t)<=i}:void 0,c=0;for(;c<s.length;){let e=c,r=-1;if(u)for(;e<s.length&&u(c,e+1);)/\s/u.test(s[e].text)&&(r=e+1),e++;else for(;e<s.length&&no(s.slice(c,e+1),t)<=i;)/\s/u.test(s[e].text)&&(r=e+1),e++;if(e===s.length){o.push(ni(s.slice(c)));break}if(e>c&&!/\s/u.test(s[e-1].text)&&/\s/u.test(s[e]?.text??""))for(r=e;r<s.length&&/\s/u.test(s[r].text);)r++;let l=!1,f,h;if(r>c){if(s.slice(c,r).some(e=>!/\s/u.test(e.text)))for(;r<s.length&&/\s/u.test(s[r].text);)r++;for(f=e=r;f>c&&/\s/u.test(s[f-1].text);)f--;f===c?f=e:h=s.slice(f,e).map(e=>e.text).join("")}else{let r;if(r=e=Math.max(c+1,e),/[\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}]/u.test(s[r-1]?.text??"")&&/\p{L}/u.test(s[r]?.text??"")){for(;e>c+1&&no([...s.slice(c,e),nl(s[e-1])],t)>i;)e--;l=no([...s.slice(c,e),nl(s[e-1])],t)<=i}}let p=ni(s.slice(c,f??e)),m=d?.offsets[e]??s[e]?.sourceStart??n.source.length;l&&p.push({...nl(s[e-1]),sourceStart:m,sourceEnd:m}),o.push(p),e<s.length&&a.push({kind:l?"hyphen":"wrap",sourceOffset:m,...h?{replacedText:h}:{}}),c=e}0===s.length&&o.push([])}let s=n.lines.map(e=>e.map(e=>e.text).join("")).join(`
|
|
14
|
+
`),l=/\p{M}/u.test(s.normalize("NFD").replace(/[\uFE0E\uFE0F]/g,""))?eR(s.normalize("NFD")).reduce((e,t)=>Math.max(e,(t.replace(/[\uFE0E\uFE0F]/g,"").match(/\p{M}/gu)??[]).length),0):0,d=t.fontSize*Math.max(tp,2.4*!!/[\p{Script=Arabic}\p{Script=Hebrew}]/u.test(s),l?tp+.6*l:0),u=o.map((e,r)=>{var i;let o,a,s,l,u,c=e.map(e=>{let t;return"literal"===n.display?e.text:(t=e.text,e.strikethrough&&(t=`<s>${t}</s>`),e.underline&&(t=`<u>${t}</u>`),e.italic&&(t=`<i>${t}</i>`),e.bold&&(t=`<b>${t}</b>`),t)}).join("");e.forEach(r7.freeze);let f=!/[^\x20-\x7e]/u.test(c),h=e.some(e=>e.bold||e.italic||e.underline||e.strikethrough),p=f?(t.letterSpacing??0)!==0?(i=t,o=e.flatMap((e,t)=>eR(e.text).map(e=>({runIndex:t,text:e}))),a=0,s=0,l=0,u=o.map((t,r)=>{let n=e[t.runIndex],d=o[r+1],u=!d||!nn(n,e[d.runIndex]),c=na(t.text,n,u,i),f=r7.freeze({...t,x:a,width:c});return s=Math.min(s,a),l=Math.max(l,a+c),a+=c+(i.letterSpacing??0),f}),{width:l-s,originX:-s,fragments:r7.freeze(u)}):h?function(e,t){let r=[];for(let[t,n]of e.entries()){let i=r.at(-1);i&&nn(e[i.runIndex],n)?i.text+=n.text:r.push({runIndex:t,text:n.text})}let n=0,i=r.map(({runIndex:r,text:i})=>{let o=no([{...e[r],text:i}],t),a=r7.freeze({runIndex:r,text:i,x:n,width:o});return n+=o,a});return{width:n,originX:0,fragments:r7.freeze(i)}}(e,t):void 0:void 0;return r7.freeze({runs:r7.freeze(e),text:c,width:p?.width??no(e,t),baseline:r*d+.35*t.fontSize,originX:p?.originX??0,...p?{fragments:p.fragments}:{}})}),c=u.map(e=>e.text);r7.freeze(c),a.forEach(r7.freeze);let f=u.reduce((e,t)=>Math.max(e,t.width),0),h=r7.freeze({unit:"px",prepared:n,text:c.join(`
|
|
15
|
+
`),lines:c,lineBlocks:r7.freeze(u),breaks:r7.freeze(a),width:f,height:c.length*d,lineHeight:d,fontSize:t.fontSize,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing??0,monospace:t.monospace??!1,safeFont:t.safeFont??!1,...t.fontFamily?{fontFamily:t.fontFamily}:{}});return r9.add(h),void 0!==r&&r8.set(r,h,2*r.length+128*h.prepared.source.length+256*h.lines.length+512),h}function nu(e,t){let r=e?.lineBlocks[t];if(!e||!r)return;if(!nt(e))throw TypeError("Pixel line projection requires retained preparation");let n=[r.text];r7.freeze(n);let i=r7.freeze({...e,text:r.text,lines:n,lineBlocks:r7.freeze([r7.freeze({...r,baseline:.35*e.fontSize})]),breaks:r7.freeze([]),width:r.width,height:e.lineHeight});return r9.add(i),i}function nc(e,t){let r=t.top??0,n=0,i=0,o=e.map(e=>{let o=Math.max(t.minRowHeight??0,e.block.height),a={item:e,top:r,height:o,textY:r+("start"===t.align?e.block.height:o)/2};return n=Math.max(n,e.block.width,e.reservedWidth??0),i+=o,r+=o+t.gap,a}),a=Math.max(0,e.length-!t.trailingGap),s=r-(e.length&&!t.trailingGap?t.gap:0);return{width:n,height:i+a*t.gap,bottom:s,rows:o}}function nf(e,t){let r=nc(e,t),n={width:t.leadingWidth+r.width,height:r.height,columns:1,rows:r.rows};if(void 0===t.maxWidth||e.length<4)return n;let i=[0,0];for(let[r,o]of e.entries()){if(1!==o.block.lines.length)return n;let e=r%2;i[e]=Math.max(i[e],t.leadingWidth+o.block.width,t.leadingWidth+(o.reservedWidth??0))}let o=i[0]+t.columnGap+i[1];if(o>t.maxWidth+.01)return n;let a=[],s=t.top??0,l=0;for(let r=0;r<e.length;r+=2){let n=e.slice(r,r+2),o=Math.max(t.minRowHeight??0,...n.map(e=>e.block.height));for(let[e,r]of n.entries())a.push({item:r,x:e?i[0]+t.columnGap:0,top:s,height:o,textY:s+o/2});l+=o,s+=o+t.gap}return(l+=(Math.ceil(e.length/2)-1)*t.gap)<r.height?{width:o,height:l,columns:2,rows:a}:n}function nh(e){if(0!==e.length)return{x0:Math.min(...e.map(e=>e.x)),y0:Math.min(...e.map(e=>e.y)),x1:Math.max(...e.map(e=>e.x)),y1:Math.max(...e.map(e=>e.y))}}function np(e,t){return e?t?{x0:Math.min(e.x0,t.x0),y0:Math.min(e.y0,t.y0),x1:Math.max(e.x1,t.x1),y1:Math.max(e.y1,t.y1)}:e:t}function nm(e,t){let r=Number.isFinite(t)?Math.max(0,t):0;return{x0:e.x0-r,y0:e.y0-r,x1:e.x1+r,y1:e.y1+r}}function ng(e,t,r){let n=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/y,i=0,o=0,a=0,s=0,l=0,d="",u="",c,f,h,p=!1,m=e=>{if(r){for(let t=0;t<e;t++)if(!r())return p=!0,!1}return!0},g=()=>{for(;i<e.length&&/[\s,]/.test(e[i]);){if(!m(1))return;i++}},y=(t=!1)=>{if(g(),p)return;if(t){let t=e[i];return("0"===t||"1"===t)&&m(1)?(i++,Number(t)):void 0}n.lastIndex=i;let r=n.exec(e);if(!r||!m(r[0].length))return;i=n.lastIndex;let o=Number(r[0]);return Number.isFinite(o)?o:void 0},b=(e,r)=>!!Number.isFinite(e)&&!!Number.isFinite(r)&&(f=np(f,{x0:e,y0:r,x1:e,y1:r}),t&&(h=np(h,{x0:e,y0:r,x1:e,y1:r})),!0);for(;;){if(g(),p)return;if(i>=e.length)return f;if(/[a-zA-Z]/.test(e[i])){if(!m(1)||(d=e[i++],!/[MmLlHhVvCcSsQqTtAaZz]/.test(d)||!f&&"M"!==d.toUpperCase()))return;if("Z"===d.toUpperCase()){if(t&&!t({bounds:{x0:Math.min(o,s),y0:Math.min(a,l),x1:Math.max(o,s),y1:Math.max(a,l)},line:[{x:o,y:a},{x:s,y:l}]}))return;o=s,a=l,u="Z",c=void 0,d="";continue}}if(!d)return;let r=d.toUpperCase(),n=d!==r;t&&(h={x0:o,y0:a,x1:o,y1:a});let x="A"===r?7:"C"===r?6:"S"===r||"Q"===r?4:"H"===r||"V"===r?1:2,k=[];for(let e=0;e<x;e++){let t=y("A"===r&&(3===e||4===e));if(void 0===t)return;k.push(t)}let v=e=>k[e]+(n?o:0),w=e=>k[e]+(n?a:0),$,M,z;if("H"===r)$=v(0),M=a;else if("V"===r)$=o,M=w(0);else if("C"===r||"S"===r||"Q"===r||"T"===r){let e=c&&("S"===r?"C"===u||"S"===u:"Q"===u||"T"===u)?{x:2*o-c.x,y:2*a-c.y}:{x:o,y:a};if(("S"===r||"T"===r)&&!b(e.x,e.y))return;for(let e=0;e<x-2;e+=2)if(!b(v(e),w(e+1)))return;$=v(x-2),M=w(x-1),z="T"===r?e:{x:v(x-4),y:w(x-3)}}else if("A"===r){$=v(5),M=w(6);let e=Math.abs(k[0]),t=Math.abs(k[1]);if(e>0&&t>0&&($!==o||M!==a)){let r=k[2]%360*Math.PI/180,n=Math.cos(r),i=Math.sin(r),s=(o-$)/2,l=(a-M)/2,d=n*s+i*l,u=-i*s+n*l,c=Math.hypot(d/e,u/t);c>1&&(e*=c,t*=c);let f=(d/e)**2+(u/t)**2,h=(k[3]===k[4]?-1:1)*Math.sqrt(Math.max(0,(1-f)/f)),p=h*e*u/t,m=-h*t*d/e,g=n*p-i*m+(o+$)/2,y=i*p+n*m+(a+M)/2,x=Math.hypot(e*n,t*i),v=Math.hypot(e*i,t*n);if(!b(g-x,y-v)||!b(g+x,y+v))return}}else $=v(0),M=w(1),"M"===r&&(s=$,l=M,d=n?"l":"L");if(!b($,M)||t&&"M"!==r&&!t({bounds:h,...["L","H","V"].includes(r)?{line:[{x:o,y:a},{x:$,y:M}]}:{}}))return;o=$,a=M,c=z,u=r}}function ny(e,t,r){return void 0!==ng(e,t,r)}function nb(e){switch(e.kind){case"rect":return{x0:e.x,y0:e.y,x1:e.x+e.width,y1:e.y+e.height};case"circle":return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};case"ellipse":return{x0:e.cx-e.rx,y0:e.cy-e.ry,x1:e.cx+e.rx,y1:e.cy+e.ry};case"line":return{x0:Math.min(e.x1,e.x2),y0:Math.min(e.y1,e.y2),x1:Math.max(e.x1,e.x2),y1:Math.max(e.y1,e.y2)};case"polygon":case"polyline":return nh(e.points);case"compound":{let t;for(let r of e.children){let e=nb(r);if(!e)return;t=np(t,e)}return t}case"path":return ng(e.d)}}function nx(e,t,r,n=!1,i){if(!e||!t)return;let o=e.geometry?nb(e.geometry):void 0;if(n&&e.geometry&&!o)return;let a=e.bounds??o??(e.viewBox?{x0:e.viewBox.x,y0:e.viewBox.y,x1:e.viewBox.x+e.viewBox.width,y1:e.viewBox.y+e.viewBox.height}:void 0)??(e.size?{x0:0,y0:0,x1:e.size.width,y1:e.size.height}:void 0);if(!a)return;if(n){a=np(a,o);let t=nT(e.paint??{},!0);if(void 0===t)return;a=nm(a,t)}let s=e.ref?.x??0,l=e.ref?.y??0,d=a;if(e.viewBox&&e.size){let t=Math.min(e.size.width/e.viewBox.width,e.size.height/e.viewBox.height),r=(e.size.width-e.viewBox.width*t)/2,n=(e.size.height-e.viewBox.height*t)/2,i=n=>r+(n-e.viewBox.x)*t,o=r=>n+(r-e.viewBox.y)*t;d={x0:i(a.x0),y0:o(a.y0),x1:i(a.x1),y1:o(a.y1)},s=i(s),l=o(l)}let u=(e.units??"strokeWidth")==="strokeWidth"?r:1,c=Math.max(+!!n,e.scale??1)*u;if(void 0!==i){let e=i*Math.PI/180,r=Math.cos(e),n=Math.sin(e),o=[[d.x0,d.y0],[d.x0,d.y1],[d.x1,d.y0],[d.x1,d.y1]].map(([e,i])=>({x:t.x+((e-s)*r-(i-l)*n)*c,y:t.y+((e-s)*n+(i-l)*r)*c}));return o.every(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))?nh(o):void 0}let f=Math.max(Math.abs(d.x0-s),Math.abs(d.x1-s)),h=Math.max(Math.abs(d.y0-l),Math.abs(d.y1-l)),p=(n?Math.hypot(f,h):Math.max(f,h))*c;return{x0:t.x-p,y0:t.y-p,x1:t.x+p,y1:t.y+p}}function nk(e,t){let r="number"==typeof e.orient?e.orient:180*("start"===t&&"auto-start-reverse"===e.orient),n=nx(e,{x:0,y:0},1,!0,r);if(!n)throw TypeError(`Unmeasured terminal marker ${e.id}`);return Math.max(0,"start"===t?n.x1:-n.x0)}function nv(e,t){let r=e.route.geometry,n=t8(r,e.route.closed),i=t7(r,e.route.closed),o=nj(t,e.transform),a=[],s=(t,n,i,s)=>{if(!n||!i)return;let l="number"==typeof n.orient?n.orient:s?180*Math.atan2(s.y,s.x)/Math.PI+180*("start"===t&&"auto-start-reverse"===n.orient):void 0,d=nw(e.stroke.width),u=nx(n,i,d,!0,l),c=rE(o),f=JSON.stringify([{...n,orient:n.orient??"auto"},l??["unknown",r],"userSpaceOnUse"===n.units?1:d,c.slice(0,4)]),h,p;if(void 0!==l&&n.geometry?.kind==="polygon"&&n.geometry.points.length<=64){let e=(n.viewBox&&n.size?Math.min(n.size.width/n.viewBox.width,n.size.height/n.viewBox.height):1)*Math.max(1,n.scale??1)*("userSpaceOnUse"===n.units?1:d),t=l*Math.PI/180,r=Math.cos(t),o=Math.sin(t);h=n.geometry.points.map(t=>{let a=(t.x-(n.ref?.x??0))*e,s=(t.y-(n.ref?.y??0))*e;return rO({x:i.x+a*r-s*o,y:i.y+a*o+s*r},c)});let[a,s,u,f]=c,m=(Math.hypot(a+f,s-u)+Math.hypot(a-f,s+u))/2,g=nT(n.paint??{},!0);void 0!==(p=void 0===g?void 0:g*e*m)&&Number.isFinite(p)&&h.every(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))||(h=void 0)}a.push({position:t,resource:n.id,anchor:rO(i,c),repaint:f,...h?{hull:h,padding:p}:{},...u?{bounds:nS(u,o)}:{}})};if(n.starts.forEach((t,r)=>s("start",e.markers.start,t,e.route.contours[r]?.startTangent)),n.ends.forEach((t,r)=>s("end",e.markers.end,t,e.route.contours[r]?.endTangent)),1===e.markers.mid.length)for(let t of i)s("mid",e.markers.mid[0],t);else e.markers.mid.forEach((e,t)=>s("mid",e,i[t]));return a}function nw(e){let t="number"==typeof e?e:parseFloat(e);return Number.isFinite(t)?Math.max(0,t):1}var n$=new WeakMap;function nM(e){let t=eY(e.text,e.textContent),r="string"==typeof t?t:t.source;if(e.block){let t=e.block;if(t.prepared.source!==r||void 0!==e.fontSize&&e.fontSize!==t.fontSize||void 0!==e.fontWeight&&e.fontWeight!==t.fontWeight||void 0!==e.letterSpacing&&e.letterSpacing!==t.letterSpacing||void 0!==e.display&&e.display!==t.prepared.display)throw TypeError("Connector inline label typography and source must agree with its prepared block");return t}let n=e.fontSize??12,i=e.fontWeight??400,o=e.letterSpacing??0,a=e.display??"literal",s=n$.get(e);if(s&&("string"==typeof t?s.prepared.source===r:s.prepared===t)&&s.fontSize===n&&s.fontWeight===i&&s.letterSpacing===o&&s.prepared.display===a)return s;let l=nd(t,{display:a,fontSize:n,fontWeight:i,letterSpacing:o});return n$.set(e,l),l}function nz(e){if(e.visual?.kind!=="inline"||!e.anchor||void 0===e.fontSize||void 0===e.textAnchor)return;let t=nM(e),r=t.width,n="middle"===e.textAnchor?e.anchor.x-r/2:"end"===e.textAnchor?e.anchor.x-r:e.anchor.x,i=e.anchor.y-Math.max(0,e.clearance??0),o=Math.max(0,e.halo?.width??0)/2;return nm({x0:n,y0:i-.35*t.fontSize-t.height/2,x1:n+r,y1:i-.35*t.fontSize+t.height/2},o)}function nS(e,t){if(![e.x0,e.y0,e.x1,e.y1].every(Number.isFinite))return;if(!t)return e;if("rotate"===t.kind)return r4(e,{x:t.cx,y:t.cy},t.angle);let r=rE(t),n=e.x0,i=e.y0,o=e.x0,a=e.y1,s=e.x1,l=e.y0,d=e.x1,u=e.y1;if(1===r[0]&&0===r[1]&&0===r[2]&&1===r[3]&&n===o&&i===l&&s===d&&a===u&&0!==n&&0!==i&&0!==s&&0!==a&&Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(s)&&Number.isFinite(a)){let e=rO({x:n,y:i},r),t=rO({x:d,y:u},r);return Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(t.x)&&Number.isFinite(t.y)?{x0:Math.min(e.x,t.x),y0:Math.min(e.y,t.y),x1:Math.max(e.x,t.x),y1:Math.max(e.y,t.y)}:void 0}let c=[[n,i],[o,a],[s,l],[d,u]].map(([e,t])=>rO({x:e,y:t},r));return c.every(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))?nh(c):void 0}function nj(e,t){if(!e)return t;if(!t)return e;let[r,n,i,o,a,s]=rT(rE(e),rE(t));return{kind:"matrix",a:r,b:n,c:i,d:o,e:a,f:s}}function nE(e){return"line"!==e.geometry.kind&&!("polyline"===e.geometry.kind&&2===e.geometry.points.length&&!e.closed)}function nT(e,t){if(void 0===e.stroke||"none"===e.stroke||"transparent"===e.stroke||rk(e.stroke)?.[3]===0)return 0;let r=e.strokeWidth??"1";if(!/^\s*(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?(?:px)?\s*$/.test(r))return;let n=Number.parseFloat(r)/2;if(!Number.isFinite(n))return;let i=e.strokeLinejoin??"miter",o=Number(e.strokeMiterlimit??4);if(!Number.isFinite(o)||o<1)return;let a=Math.max(t&&("miter"===i||"miter-clip"===i)?n*o:n,"square"===e.strokeLinecap?n*Math.SQRT2:n);return Number.isFinite(a)?a:void 0}function nO(e,t,r,n){if(!r)return nS(nm(e,t),n);let i=nS(e,n);return i?nm(i,t):void 0}function nC(e,t,r,n,i,o){return"line"!==e.kind||i?nO(t,r,i,o):nS(function(e,t,r){let n=nb(e),i=Math.hypot(e.x2-e.x1,e.y2-e.y1);if(void 0!==r&&"butt"!==r||0===i)return nm(n,t);let o=t*Math.abs(e.y2-e.y1)/i,a=t*Math.abs(e.x2-e.x1)/i;return{x0:n.x0-o,y0:n.y0-a,x1:n.x1+o,y1:n.y1+a}}(e,r,n),o)}function nW(e,t,r,n){let i=0;for(let o=0;o<32;o++){let a,s=o/32,l=(o+1)/32,d=e=>Math.min(l,Math.max(s,e)),u=r=>e*(1-r)**2+t*(1+r+r*r),c=6*r*Math.min(s*(1-s),l*(1-l)),f=6*n*r*l/Math.hypot((a=d(e/(e+t)),3*(e*(1-a)**2+t*a*a)),c)-u(d((2*e-t)/(2*(e+t))));f>0&&(i=Math.max(i,(1-s)*f))}return Math.min(n,i)}function nF(e,t){return function e(t,r){let n,i=nj(r,t.transform);if(!i||rC(rE(i))){if("shape"===t.kind){if(!(n=nb(t.geometry)))return;let e=["polygon","polyline","path","compound"].includes(t.geometry.kind),r;for(let o of[t.paint,...t.childPaints??[]]){let a=nT(o,e),s=void 0===a?void 0:nC(t.geometry,n,a,o.strokeLinecap,"non-scaling-stroke"===o.vectorEffect,i);if(!s)return;r=r?np(r,s):s}if(!t.conditionalPaint)return r;let o=nT(t.conditionalPaint,["polygon","polyline","path","compound"].includes(t.geometry.kind));if(!r||void 0===o)return;let a=nC(t.geometry,n,o,t.conditionalPaint.strokeLinecap,"non-scaling-stroke"===t.conditionalPaint.vectorEffect,i);return a?np(r,a):void 0}if("connector"===t.kind)return function(e,t){let r=e.route.geometry,n=nb(r),i=nT({stroke:e.stroke.color,strokeWidth:String(e.stroke.width),strokeLinecap:e.stroke.lineCap,strokeLinejoin:e.stroke.lineJoin,strokeMiterlimit:String(e.stroke.miterLimit)},nE(e.route));if(!n||void 0===i)return;let o="path"!==r.kind||"butt"!==e.stroke.lineCap||e.stroke.nonScaling?void 0:function(e,t){if(!/^[\s,0-9eE.+\-MC]+$/.test(e))return;let r=e.match(/[MC]|[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g);if(!r||10!==r.length||"M"!==r[0]||"C"!==r[3])return;let n=r.filter(e=>"M"!==e&&"C"!==e).map(Number);if(!n.every(Number.isFinite))return;let[i,o,a,s,l,d,u,c]=n;if(a!==l||s!==o||d!==c||!((a-i)*(u-a)>0))return;let f=Math.abs(a-i),h=Math.abs(u-a),p=Math.abs(c-o),m=Math.sign(u-i),g=[i-m*nW(h,f,p,t),u+m*nW(f,h,p,t)];return{x0:Math.min(...g),y0:Math.min(o,c)-t,x1:Math.max(...g),y1:Math.max(o,c)+t}}(r.d,nw(e.stroke.width)/2),a=o?nS(o,t):nO(n,i,e.stroke.nonScaling,t);if(!a)return;let s=nw(e.stroke.width),l=t8(r,e.route.closed),d=t7(r,e.route.closed);for(let{marker:r,anchor:n}of[...l.starts.flatMap(t=>e.markers.start?[{marker:e.markers.start,anchor:t}]:[]),...l.ends.flatMap(t=>e.markers.end?[{marker:e.markers.end,anchor:t}]:[]),...1===e.markers.mid.length?d.map(t=>({marker:e.markers.mid[0],anchor:t})):e.markers.mid.map((e,t)=>({marker:e,anchor:d[t]}))]){let e=nx(r,n,s,!0),i=e&&nS(e,t);if(!i)return;a=np(a,i)}for(let r of e.labels){let e=np(r.bounds,nz(r));if(r.visual?.kind==="inline"&&!e)return;if(e){let r=nS(e,t);if(!r)return;a=np(a,r)}}return a}(t,i);if("text"===t.kind){n=function(e){let t;if("shape"===e.kind)t=nb(e.geometry);else if("connector"===e.kind)t=function(e){let t=e.route.geometry,r="path"===t.kind?nh(t.points):nb(t);if(!r)return;let n=nw(e.stroke.width),i=n/2;r=nm(r,"miter"===e.stroke.lineJoin||"miter-clip"===e.stroke.lineJoin?i*Math.max(1,e.stroke.miterLimit):i);let o=t8(t,e.route.closed);for(let t of o.starts)r=np(r,nx(e.markers.start,t,n));for(let t of o.ends)r=np(r,nx(e.markers.end,t,n));let a=t7(t,e.route.closed);if(1===e.markers.mid.length)for(let t of a)r=np(r,nx(e.markers.mid[0],t,n));else for(let t=0;t<e.markers.mid.length;t++)r=np(r,nx(e.markers.mid[t],a[t],n));for(let t of e.labels)t.bounds&&(r=np(r,t.bounds)),r=np(r,nz(t));return r}(e);else{if("text"!==e.kind)return;let r=e.textLayout??nd(e.text,{display:e.display,fontSize:e.fontSize,fontWeight:e.fontWeight??500,letterSpacing:e.letterSpacing}),n=r.width,i="middle"===e.anchor?e.x-n/2:"end"===e.anchor?e.x-n:e.x,o="offsetY"in r?r.offsetY:-(.35*e.fontSize);t={x0:i,y0:e.y+o-r.height/2,x1:i+n,y1:e.y+o+r.height/2}}return t?nS(t,e.transform):void 0}({...t,transform:void 0});let e=nT(t.paint,!1);return n&&void 0!==e?nO(n,e,"non-scaling-stroke"===t.paint.vectorEffect,i):void 0}if("group"!==t.kind)return;for(let r of t.children){if("document"===r.node.kind&&r.node.nonPaint)continue;let t=e(r.node,i);if(!t)return;n=np(n,t)}return n}}(e,t)}var nN=class{value="";raw(e){this.value+=e}attribute(e,t){this.value+=` ${e}="${"number"==typeof t?tL(t):tz(tP(e,t))}"`}},nI=new Set(["id","role","from","to","relationship","direction","prepared-text","font-metrics","text-fragment","connector-label-for"]),nA=/^[A-Za-z0-9_-]+(?: [A-Za-z0-9_-]+)*$/,nL=/^[a-z][a-z0-9-]*$/;function nP(e,t){if(t){if(t.className&&e.attribute("class",t.className),t.data)for(let r of Object.keys(t.data))e.attribute(`data-${r}`,t.data[r]);t.ariaHidden&&e.attribute("aria-hidden","true"),0===t.tabIndex&&e.attribute("tabindex",0),void 0!==t.ariaLabel&&e.attribute("aria-label",t.ariaLabel)}}function nq(e,t){void 0!==t.fill&&e.attribute("fill",t.fill),void 0!==t.fillOpacity&&e.attribute("fill-opacity",t.fillOpacity),void 0!==t.stroke&&e.attribute("stroke",t.stroke),void 0!==t.strokeOpacity&&e.attribute("stroke-opacity",t.strokeOpacity),void 0!==t.strokeWidth&&e.attribute("stroke-width",t.strokeWidth),void 0!==t.strokeDasharray&&e.attribute("stroke-dasharray",t.strokeDasharray),void 0!==t.strokeDashoffset&&e.attribute("stroke-dashoffset",t.strokeDashoffset),void 0!==t.strokeLinecap&&e.attribute("stroke-linecap",t.strokeLinecap),void 0!==t.strokeLinejoin&&e.attribute("stroke-linejoin",t.strokeLinejoin),void 0!==t.strokeMiterlimit&&e.attribute("stroke-miterlimit",t.strokeMiterlimit),void 0!==t.vectorEffect&&e.attribute("vector-effect",t.vectorEffect),void 0!==t.paintOrder&&e.attribute("paint-order",t.paintOrder),void 0!==t.opacity&&e.attribute("opacity",t.opacity)}function nB(e,t){t&&e.attribute("transform",rW(t))}function nH(e,t,r){t&&tD(t.role)&&(e.attribute("data-id",t.id),e.attribute("data-role",t.role),void 0!==t.from&&e.attribute("data-from",t.from),void 0!==t.to&&e.attribute("data-to",t.to)),r&&(e.attribute("role",r.role),e.attribute("aria-roledescription",r.roleDescription),e.attribute("aria-label",r.label))}function nR(e,t){switch(t.kind){case"rect":e.attribute("x",t.x),e.attribute("y",t.y),e.attribute("width",t.width),e.attribute("height",t.height),void 0!==t.rx&&e.attribute("rx",t.rx),void 0!==t.ry&&e.attribute("ry",t.ry);return;case"circle":e.attribute("cx",t.cx),e.attribute("cy",t.cy),e.attribute("r",t.r);return;case"ellipse":e.attribute("cx",t.cx),e.attribute("cy",t.cy),e.attribute("rx",t.rx),e.attribute("ry",t.ry);return;case"line":e.attribute("x1",t.x1),e.attribute("y1",t.y1),e.attribute("x2",t.x2),e.attribute("y2",t.y2);return;case"polygon":case"polyline":{let r="";for(let e=0;e<t.points.length;e++){let n=t.points[e];r+=`${e?" ":""}${n.x},${n.y}`}e.attribute("points",r);return}case"path":e.attribute("d",t.d)}}function nD(e,t,r,n,i){let o=Math.max(0,Math.min(i,r/2,n));return 0===o?`M${e},${t} H${e+r} V${t+n} H${e} Z`:`M${e+o},${t} H${e+r-o} A${o},${o} 0 0 1 ${e+r},${t+o} V${t+n} H${e} V${t+o} A${o},${o} 0 0 1 ${e+o},${t} Z`}var nG=new WeakMap,nZ=new WeakSet,n_=new WeakMap,nJ=/<\s*text/i;function nU(e){if(!e.includes("<svg"))return e;let t="",r=0;for(;r<e.length;){let n=e.indexOf("<",r);if(n<0)return t+e.slice(r);if(t+=e.slice(r,n),e.startsWith("\x3c!--",n)){let i=e.indexOf("--\x3e",n+4);if(i<0)return t+e.slice(n);t+=e.slice(n,i+3),r=i+3;continue}let i,o=n+1;for(;o<e.length;o++){let t=e[o];if(i)t===i&&(i=void 0);else if('"'===t||"'"===t)i=t;else if(">"===t)break}if(o>=e.length)return t+e.slice(n);t+=function(e){let t=e.match(/^<([A-Za-z_][A-Za-z0-9_.:-]*)/);if(!t||e.startsWith("</")||e.startsWith("<!")||e.startsWith("<?"))return e;let r=t[1];if("svg"!==r)return e;let n=/\/\s*>$/.test(e),i=n?e.lastIndexOf("/"):e.length-1,o=[],a=t[0].length;for(;a<i;){for(;/\s/.test(e[a]??"");)a++;if(a>=i)break;let t=e.slice(a).match(/^([^\s=<>/]+)/);if(!t)return e;let r=t[1];for(a+=t[0].length;/\s/.test(e[a]??"");)a++;if("="!==e[a])return e;for(a++;/\s/.test(e[a]??"");)a++;let n=e[a];if('"'!==n&&"'"!==n)return e;let s=++a;for(;a<i&&e[a]!==n;)a++;if(e[a]!==n)return e;let l=e.slice(s,a);a++,o.push({name:r,value:'"'===n?l:l.replaceAll('"',"""),index:o.length})}let s=new Map([["xmlns",0],["width",1],["height",2],["viewBox",3],["style",4]]);o.sort((e,t)=>(s.get(e.name)??100)-(s.get(t.name)??100)||r3(e.name,t.name)||e.index-t.index);let l=o.map(e=>`${e.name}="${e.value}"`).join(" ");return`<${r}${l?` ${l}`:""}${n?" /":""}>`}(e.slice(n,o+1)),r=o+1}return t}function nV(e,t){if("document"!==e.kind)throw TypeError(`Scene ${e.kind} "${e.id}" is written from its fields, not stored markup`);return nG.set(e,nU(t)),e}function nX(e){return nZ.add(e),e}function nY(e){let t=nG.get(e);if(void 0!==t)return t;if(!nZ.has(e))throw TypeError(`Scene node "${e.id}" has no admitted SVG serialization`);let r=n_.get(e);if(void 0!==r)return r;let n=function(e){switch(e.kind){case"shape":return function(e){let t=new nN,r="compound"===e.geometry.kind,n="compound"===e.geometry.kind?e.geometry.children:[e.geometry];for(let i=0;i<n.length;i++){let o=n[i];if("compound"===o.kind)throw TypeError(`Shape "${e.id}" nests compound geometry`);i&&t.raw(`
|
|
16
|
+
`),t.raw(`<${o.kind}`),0===i&&nP(t,e.attributes),nR(t,o),nq(t,r?e.childPaints?.[i]??e.paint:e.paint),nB(t,e.transform),0===i&&nH(t,e.identity,e.accessibility),t.raw(" />")}return t.value}(e);case"text":return function(e){let t=new nN;nP(t,e.attributes),t.attribute("text-anchor",e.anchor),e.dominantBaseline&&t.attribute("dominant-baseline",e.dominantBaseline),e.block?.fontFamily&&t.attribute("font-family",e.block.fontFamily),t.attribute("font-size",e.fontSize),t.attribute("font-weight",e.fontWeight??e.block?.fontWeight??400),(e.letterSpacing??0)!==0&&t.attribute("letter-spacing",e.letterSpacing),e.fontStyle&&t.attribute("font-style",e.fontStyle),e.textDecoration&&t.attribute("text-decoration",e.textDecoration),nq(t,e.paint),nB(t,e.transform),nH(t,e.identity,e.accessibility);let r=t.value.slice(1),n="prepared"===e.measurement&&e.block,i=tO(n?e.block:e.text,e.x,e.y,e.fontSize,r,e.baselineShift??.35,"literal"===e.display);if(!e.spans)return i;let o=n?e.block.text:e.text,a=`>${tM(o)}</text>`;if(!i.endsWith(a))throw TypeError(`Text "${e.id}" spans require a one-line label`);let s="";for(let t of e.spans)s+=`<tspan fill="${tz(t.fill)}">${tM(t.text)}</tspan>`;return`${i.slice(0,-a.length)}>${s}</text>`}(e);case"connector":return function(e){let t=new nN,{stroke:r,markers:n}=e,i=r.dash,o=n.mid[0];if("invisible"!==e.lineStyle){let a=e.route.geometry;t.raw(`<${a.kind}`),nP(t,e.attributes),nR(t,a),"line"!==a.kind&&t.attribute("fill","none"),t.attribute("stroke",r.color),void 0!==r.opacity&&t.attribute("stroke-opacity",r.opacity),t.attribute("stroke-width",r.width),i&&t.attribute("stroke-dasharray","string"==typeof i.array?i.array:i.array.join(" ")),i?.offset!==void 0&&t.attribute("stroke-dashoffset",i.offset),"butt"!==r.lineCap&&t.attribute("stroke-linecap",r.lineCap),"miter"!==r.lineJoin&&t.attribute("stroke-linejoin",r.lineJoin),4!==r.miterLimit&&t.attribute("stroke-miterlimit",r.miterLimit),void 0!==r.pathLength&&t.attribute("pathLength",r.pathLength),void 0!==r.paintOrder&&t.attribute("paint-order",r.paintOrder),r.nonScaling&&t.attribute("vector-effect","non-scaling-stroke"),r.mixBlendMode&&t.attribute("style",`mix-blend-mode:${r.mixBlendMode}`),n.start&&t.attribute("marker-start",`url(#${n.start.id})`),o&&t.attribute("marker-mid",`url(#${o.id})`),n.end&&t.attribute("marker-end",`url(#${n.end.id})`),"none"===e.hit.pointerEvents&&t.attribute("pointer-events","none"),nB(t,e.transform),t.attribute("data-relationship",e.relationship.kind),t.attribute("data-direction",e.relationship.direction),nH(t,e.identity,e.accessibility),t.raw(" />")}for(let r=0;r<e.labels.length;r++){let n=function(e,t,r){if(t.visual?.kind!=="inline")return;if(!t.anchor||!t.paint||void 0===t.fontSize||void 0===t.textAnchor)throw TypeError(`Connector "${e.id}" inline label ${r+1} requires anchor, paint, fontSize, and textAnchor`);let n=nM(t),i={...t.paint,...t.halo?{stroke:t.halo.color??"var(--bg)",strokeWidth:String(t.halo.width),paintOrder:"stroke fill"}:{}},o=new nN;return o.attribute("data-id",t.id??`${e.id}-label-${r+1}`),o.attribute("data-role","label"),o.attribute("data-connector-label-for",e.id),o.attribute("font-size",n.fontSize),o.attribute("font-weight",n.fontWeight),n.letterSpacing&&o.attribute("letter-spacing",n.letterSpacing),o.attribute("text-anchor",t.textAnchor),nB(o,e.transform),nq(o,i),tO(n,t.anchor.x,t.anchor.y-Math.max(0,t.clearance??0),n.fontSize,o.value.slice(1),0)}(e,e.labels[r],r);void 0!==n&&(t.value&&t.raw(`
|
|
17
|
+
`),t.raw(n))}return t.value}(e);case"group":return[e.open,...e.children.map(e=>nQ(nY(e.node),e.indent)),e.close].join(e.join);case"document":throw TypeError(`Scene node "${e.id}" has no admitted SVG serialization`)}}(e);return"group"!==e.kind&&Object.isFrozen(e)&&n_.set(e,n),n}function nQ(e,t){if(t<=0||""===e)return e;let r=" ".repeat(t);return r+e.replace(/\n/g,`
|
|
18
|
+
${r}`)}function nK(e,t){let r=nG.get(e);void 0!==r&&nG.set(t,r),nZ.has(e)&&nZ.add(t)}function n0(e){let t=e=>{if("document"===e.kind){let t=nG.get(e);return void 0!==t&&!nJ.test(t)}if(!nZ.has(e))return!1;switch(e.kind){case"text":return"prepared"===e.measurement&&void 0!==e.block;case"shape":case"connector":return!0;case"group":return!nJ.test(e.open)&&!nJ.test(e.close)&&e.children.every(e=>t(e.node))}};return e.parts.every(t)}var n1={};function n2(e,t){if(!ev(e.role).relation||void 0===e.from||void 0===e.to)return;let r={from:e.from,to:e.to,...t?{label:t}:{}};return{label:`${r.from} to ${r.to}${r.label?`: ${r.label}`:""}`,role:"graphics-symbol",roleDescription:"relation",relation:r}}function n5(e,t,r){return!r||Object.hasOwn(e,t)?e[t]:void 0}function n3(e,t){return e?{...e,...n5(e,"geometry",t)?{geometry:n5(e,"geometry",t)}:{},...n5(e,"size",t)?{size:{...n5(e,"size",t)}}:{},...n5(e,"viewBox",t)?{viewBox:{...n5(e,"viewBox",t)}}:{},...n5(e,"ref",t)?{ref:{...n5(e,"ref",t)}}:{},...n5(e,"bounds",t)?{bounds:{...n5(e,"bounds",t)}}:{},...n5(e,"paint",t)?{paint:{...n5(e,"paint",t)}}:{}}:void 0}function n6(e,t){let r=n5(e,"owner",t),n=n5(e,"point",t);return{...e,...r?{owner:{...r}}:{},...n?{point:{...n}}:{}}}function n4(e,t=!1){if(t&&"path"===e.geometry.kind)throw TypeError("Deferred terminal projections require line or polyline geometry");let r=function(e,t,r=!1){let n=["continuous-geometry","stroke-width","stroke-cap","stroke-join"];e.bendRadius>0&&n.push("bend-radius"),void 0!==n5(t,"opacity",r)&&n.push("stroke-opacity"),("miter"===t.lineJoin||"miter-clip"===t.lineJoin)&&n.push("stroke-miter"),n5(t,"dash",r)&&n.push("dash-pattern");let i=n5(t,"dash",r);return i&&void 0!==n5(i,"offset",r)&&n.push("dash-offset"),void 0!==n5(t,"pathLength",r)&&n.push("path-length"),void 0!==n5(t,"paintOrder",r)&&n.push("paint-order"),/^url\(#[A-Za-z_][A-Za-z0-9_.:-]*\)$/.test(t.color)&&n.push("gradient-paint"),void 0!==n5(t,"mixBlendMode",r)&&"normal"!==n5(t,"mixBlendMode",r)&&n.push("mix-blend-mode"),n5(t,"nonScaling",r)&&n.push("non-scaling-stroke"),n}(e.route,e.stroke,t),n=function(e,t=!1){let r=[],n=[];return t3(e,t).forEach((e,t)=>{let i=e.points[0],o=e.closed?i:e.points.at(-1);i&&r.push({point:{...i},contourIndex:t}),o&&n.push({point:{...o},contourIndex:t})}),{starts:r,ends:n}}(e.geometry,e.route.closed),i=function(e,t=!1){if("line"===e.kind)return[];let r=t3(e,t);return"path"===e.kind?(e.markerMidpoints??[]).map(e=>{if(1===r.length)return{point:{...e},contourIndex:0};let t=r.flatMap((t,r)=>t.points.some(t=>tZ(t,e))?[r]:[]);if(1!==t.length)throw TypeError("Path marker-mid vertices on multiple subpaths must belong to exactly one typed contour");return{point:{...e},contourIndex:t[0]}}):r.flatMap((e,t)=>{if(e.points.length<2)return[];let r=e.closed&&tZ(e.points[0],e.points.at(-1))?e.points.slice(0,-1):e.points;return(e.closed?r.slice(1):r.slice(1,-1)).map(e=>({point:{...e},contourIndex:t}))})}(e.geometry,e.route.closed),o=n5(e.stroke,"dash",t),a={start:n5(e.markers,"start",t)?n.starts.map(r=>({markerId:n5(e.markers,"start",t).id,point:{...r.point},contourIndex:r.contourIndex})):[],mid:0===e.markers.mid.length?[]:i.map((t,r)=>({markerId:(1===e.markers.mid.length?e.markers.mid[0]:e.markers.mid[r]).id,point:{...t.point},contourIndex:t.contourIndex})),end:n5(e.markers,"end",t)?n.ends.map(r=>({markerId:n5(e.markers,"end",t).id,point:{...r.point},contourIndex:r.contourIndex})):[]};return{realization:"invisible"===e.lineStyle?"unsupported":"projected",topology:e.geometry.kind,geometry:e.geometry,direction:e.relationship.direction,relationship:e.relationship.kind,markers:{...n5(e.markers,"start",t)?{start:n3(n5(e.markers,"start",t),t)}:{},mid:e.markers.mid.map(e=>n3(e,t)),...n5(e.markers,"end",t)?{end:n3(n5(e.markers,"end",t),t)}:{}},markerPlacements:a,endpoints:{...e.endpoints,...n5(e.endpoints,"start",t)?{start:n6(n5(e.endpoints,"start",t),t)}:{},...n5(e.endpoints,"end",t)?{end:n6(n5(e.endpoints,"end",t),t)}:{}},route:{ownership:e.route.ownership,closed:e.route.closed,bendRadius:e.route.bendRadius,contours:e.route.contours.map(e=>({...e,start:{...e.start},end:{...e.end},...n5(e,"startTangent",t)?{startTangent:{...n5(e,"startTangent",t)}}:{},...n5(e,"endTangent",t)?{endTangent:{...n5(e,"endTangent",t)}}:{}})),...n5(e.route,"startTangent",t)?{startTangent:{...n5(e.route,"startTangent",t)}}:{},...n5(e.route,"endTangent",t)?{endTangent:{...n5(e.route,"endTangent",t)}}:{},labelAnchors:e.route.labelAnchors.map(e=>({...e}))},stroke:{...e.stroke,...o?{dash:{...o,array:Array.isArray(o.array)?[...o.array]:o.array}}:{}},hit:{...e.hit,geometry:e.hit.geometry},...n5(e,"transform",t)?{transform:{...n5(e,"transform",t)}}:{},labels:e.labels.map(e=>({...e,...n5(e,"anchor",t)?{anchor:{...n5(e,"anchor",t)}}:{},...n5(e,"bounds",t)?{bounds:{...n5(e,"bounds",t)}}:{},...n5(e,"halo",t)?{halo:{...n5(e,"halo",t)}}:{},...n5(e,"paint",t)?{paint:{...n5(e,"paint",t)}}:{},...n5(e,"visual",t)?{visual:{...n5(e,"visual",t)}}:{}})),lineStyle:e.lineStyle,strokeLosses:r,diagnostics:["invisible"===e.lineStyle?"This connector affects layout but is intentionally absent from terminal output.":`The terminal grid preserves connector semantics while projecting continuous stroke fields: ${r.join(", ")}.`,...n5(e,"additionalDiagnostics",t)??[]]}}t(n1,{connector:()=>ik,definitions:()=>iM,documentClose:()=>iz,documentContent:()=>iw,documentOpen:()=>ij,documentText:()=>i$,drawPathArtwork:()=>iT,group:()=>iS,indentLines:()=>nQ,pathArtwork:()=>iE,retainedGroupEmission:()=>ih,shape:()=>im,text:()=>iv});var n8=new WeakMap,n9=0;function n7(e){n9++;try{return e()}finally{n9--}}var ie={enumerable:!0,configurable:!0,get(){let e=n8.get(this);if(Object.hasOwn(e,"projection"))return e.projection;let t=n4(e,!0);return n8.set(this,{projection:t}),t},set(e){if(Object.isFrozen(this))throw TypeError("Cannot assign to readonly terminalProjection");Object.defineProperty(this,"terminalProjection",{value:e,enumerable:!0,configurable:!0,writable:!0}),n8.delete(this)}};function it(e,t){n8.set(e,t),Object.defineProperty(e,"terminalProjection",ie)}function ir(e){let t=n8.get(e);return!t||Object.hasOwn(t,"projection")?void 0:Object.getOwnPropertyDescriptor(e,"terminalProjection")?.get===ie.get?t:void 0}function ii(e,t,r){let n=n8.get(e);return"terminalProjection"===t&&n&&r.get===ie.get?ie.get.call(e):void 0}function io(e,t){let r=ir(e);return!!r&&(it(t,r),!0)}var ia=/^(?:class|data-[a-z][a-z0-9-]*|role|aria-[a-z]+|tabindex|pointer-events|transform|style)$/,is=/^\s*<g\b[^>]*>(?:<title>[^<]*<\/title>)?$/,il=/^\s*(?:--[A-Za-z0-9_-]+\s*:[^;]*(?:;\s*|$))*$/;function id({id:t,open:r,close:n,join:i,transform:o,paint:a}){let s;if("</g>"!==n||!/^\s*$/.test(i))throw TypeError(`Group "${t}" close and join must not add artwork`);let l=new Set,d,u=is.test(r)?(rJ(r,void 0,void 0,s={attribute:(r,n)=>{if(l.has(r))throw TypeError(`Group "${t}" open has a duplicate "${r}"`);if(l.add(r),"opacity"!==r&&"fill"!==r||a?.[r]===void 0||e(n)!==a[r]){if(!ia.test(r))throw TypeError(`Group "${t}" open sets "${r}"; paint and geometry belong to typed marks`);if("style"===r&&!il.test(e(n)))throw TypeError(`Group "${t}" open style may only set custom properties; paint belongs to typed marks`);"transform"===r&&(d=n)}},expectedName:"g",name:void 0}),s.name):void 0;if(["opacity","fill"].some(e=>l.has(e)!==(a?.[e]!==void 0)))throw TypeError(`Group "${t}" open disagrees with its typed paint`);if("g"!==u)throw TypeError(`Group "${t}" open must be one <g> tag with an optional <title>`);let c=void 0===d?void 0:e(d),f=void 0===c?void 0:function(e){let t=rj,r=0;for(let n of e.matchAll(/([A-Za-z]+)\s*\(([^()]*)\)/g)){let i;if(e.slice(r,n.index).trim())return;r=n.index+n[0].length;let o=n[2].trim();if(!o||/^(?:,)|(?:,)$|,\s*,/.test(o)||!/^[-+\d.eE,\s]+$/.test(o))return;let a=o.split(/[\s,]+/).map(Number);if(!a.every(Number.isFinite))return;if("matrix"===n[1]&&6===a.length)i=a;else if("translate"===n[1]&&(1===a.length||2===a.length))i=[1,0,0,1,a[0],a[1]??0];else if("scale"===n[1]&&(1===a.length||2===a.length))i=[a[0],0,0,a[1]??a[0],0,0];else{if("rotate"!==n[1]||1!==a.length&&3!==a.length)return;i=rE({kind:"rotate",angle:a[0],cx:a[1]??0,cy:a[2]??0})}t=rT(t,i)}return r>0&&!e.slice(r).trim()?t:void 0}(c),h=o?rE(o):void 0;if(void 0!==c&&!f)throw TypeError(`Group "${t}" open has an unsupported transform`);if(!!f!=!!h||f&&h&&f.some((e,t)=>Math.abs(e-h[t])>1e-9*Math.max(1,Math.abs(e))))throw TypeError(`Group "${t}" open transform disagrees with its typed transform`);return{matrix:f&&Object.freeze(f),style:l.has("style")}}function iu(e,t){if(t){for(let r of Object.keys(t))if("className"!==r&&"data"!==r&&"ariaHidden"!==r&&"tabIndex"!==r&&"ariaLabel"!==r)throw TypeError(`Mark "${e}" has unknown attribute hook "${r}"`);if(void 0!==t.className&&!nA.test(t.className))throw TypeError(`Mark "${e}" class must be space-separated CSS tokens`);for(let[r,n]of Object.entries(t.data??{})){if(!nL.test(r))throw TypeError(`Mark "${e}" has an invalid data attribute key "${r}"`);if(nI.has(r))throw TypeError(`Mark "${e}" data-${r} belongs to its typed fields`);if("string"!=typeof n)throw TypeError(`Mark "${e}" data-${r} must be a string`)}if(void 0!==t.ariaHidden&&!0!==t.ariaHidden)throw TypeError(`Mark "${e}" ariaHidden must be true when present`);if(void 0!==t.tabIndex&&0!==t.tabIndex)throw TypeError(`Mark "${e}" tabIndex must be 0 when present`);if(void 0!==t.ariaLabel&&"string"!=typeof t.ariaLabel)throw TypeError(`Mark "${e}" ariaLabel must be a string`)}}var ic=new WeakMap;function ih(e){return ic.get(e)}function ip(e){if(e.identity)return{...e.identity,role:e.role};let t=e.attributes?.className?.split(" ");return{id:e.id,role:e.role,...t?{classNames:t}:{}}}function im(e){if(iu(e.id,e.attributes),e.childPaints&&("compound"!==e.geometry.kind||e.childPaints.length!==e.geometry.children.length))throw TypeError(`Shape "${e.id}" child paints must match its compound geometry`);if(!1===e.identity&&e.owner?.role!==e.role)throw TypeError(`Shape "${e.id}" without DOM identity requires an explicit owner with the same role`);let t=!1===e.identity?void 0:ip(e),r=t?n2(t,e.attributes?.data?.label):void 0;if(r&&e.attributes?.ariaLabel!==void 0)throw TypeError(`Shape "${e.id}" takes its aria-label from typed relation accessibility`);return nX({kind:"shape",id:e.id,role:e.role,...t?{identity:t}:{},...e.owner?{owner:e.owner}:{},...e.visibility?{visibility:e.visibility}:{},...r?{accessibility:r}:{},geometry:e.geometry,paint:e.paint,...e.childPaints?{childPaints:e.childPaints}:{},...e.conditionalPaint?{conditionalPaint:e.conditionalPaint}:{},...void 0!==e.surfaceFragment?{surfaceFragment:e.surfaceFragment}:{},...e.channels?{channels:e.channels}:{},...e.transform?{transform:e.transform}:{},...e.attributes?{attributes:e.attributes}:{}})}var ig={id:!0,role:!0,geometry:!0,lineStyle:!0,paint:!0,identity:!0,owner:!0,visibility:!0,endpoints:!0,relationship:!0,route:!0,stroke:!0,markers:!0,labels:!0,hit:!0,terminalProjection:!0,channels:!0,transform:!0,attributes:!0},iy={start:!0,mid:!0,end:!0};function ib(e,t,r){if(!e||"object"!=typeof e||Array.isArray(e))throw TypeError(`${r} fields must be an object`);for(let n of Reflect.ownKeys(e))if(!Object.hasOwn(t,n))throw TypeError(`unknown ${r} field "${String(n)}"`)}function ix(e,t){return t?{...e,...t,...t.owner?{owner:{...t.owner}}:{},...t.point?{point:{...t.point}}:{}}:e??{}}function ik(e){var t;let r;if(ib(e,ig,"connector"),void 0!==e.markers&&ib(e.markers,iy,"marker"),"path"!==e.geometry.kind&&e.route?.closed===!0)throw TypeError(`Connector "${e.id}" closed route topology requires path geometry`);if("path"===e.geometry.kind){let r=e.geometry,n=r.subpaths,i=(t=r.d,t.match(/[Mm](?=\s*[-+.]?\d)/g)?.length??0);if(i>1&&!n)throw TypeError(`Connector "${e.id}" path has multiple SVG subpaths but no typed subpaths`);if(n){if(0===n.length||n.some(e=>e.points.length<2))throw TypeError(`Connector "${e.id}" typed subpaths must each contain at least two points`);if(i!==n.length)throw TypeError(`Connector "${e.id}" typed subpath count disagrees with SVG path moves`);let t=n.flatMap(e=>e.points);if(t.length!==r.points.length||t.some((e,t)=>{let n=r.points[t];return!n||n.x!==e.x||n.y!==e.y}))throw TypeError(`Connector "${e.id}" typed subpaths disagree with the canonical point projection`)}}let n=t3(e.geometry,e.route?.closed??!1),i=1===n.length&&n[0].closed;if("path"===e.geometry.kind&&e.geometry.subpaths&&e.route?.closed!==void 0&&e.route.closed!==i)throw TypeError(`Connector "${e.id}" route.closed disagrees with typed subpath topology`);let o="path"===e.geometry.kind&&e.geometry.subpaths?i:e.route?.closed??!1;if("path"===e.geometry.kind&&(e.geometry.d.match(/[Zz]/g)?.length??0)!==(e.geometry.subpaths?e.geometry.subpaths.filter(e=>e.closed).length:+!!o))throw TypeError(`Connector "${e.id}" SVG close commands disagree with typed closed-contour semantics`);let a=e.markers?.start,s=e.markers?.end,l=e.markers?.mid??[];for(let t of[a,...l,s])if(t?.geometry?.kind==="path"&&!t.bounds&&!t.viewBox&&!t.size)throw TypeError(`Connector "${e.id}" path marker "${t.id}" requires bounds, viewBox, or size`);!function(e,t,r,n){if(0===n.length)return;let i=t7(t,r).length;if(0===i)throw RangeError(`Connector "${e}" has mid markers but no typed interior route points`);if(1!==n.length&&n.length!==i)throw RangeError(`Connector "${e}" mid markers must contain one repeated descriptor or one descriptor per interior route point`);if(1!==new Set(n.map(e=>e.id)).size)throw RangeError(`Connector "${e}" uses distinct mid markers that one SVG marker-mid carrier cannot represent`);n[0].id}(e.id,e.geometry,o,l);let d=function(e,t){if("line"===e.kind)return{start:{point:{x:e.x1,y:e.y1}},end:{point:{x:e.x2,y:e.y2}}};let r=t3(e,t),n=r[0]?.points[0],i=r.at(-1),o=i?.closed?i.points[0]:i?.points.at(-1);return{...n?{start:{point:{...n}}}:{},...o?{end:{point:{...o}}}:{}}}(e.geometry,o);for(let t of["start","end"]){let r=e.endpoints?.[t]?.point,n=d[t]?.point;if(r&&n&&!tZ(r,n))throw TypeError(`Connector "${e.id}" endpoints.${t}.point disagrees with typed route geometry`)}let u={...e.endpoints??{},start:ix(d.start,e.endpoints?.start),end:ix(d.end,e.endpoints?.end)},c={kind:e.relationship?.kind??e.role,direction:e.relationship?.direction??(void 0!==u.from&&u.from===u.to?"self":a&&s?"bidirectional":a?"reverse":s?"forward":"undirected")},f=(e.labels??[]).map(e=>{let t=eY(e.text,e.textContent),r=eZ(e.text);return{...e,text:r,..."string"!=typeof t?{textContent:{...e.textContent,value:r}}:{}}}),h={id:e.identity?.id??e.id,role:e.role,...e.identity?.classNames?{classNames:e.identity.classNames}:{},...e.identity?.from??u.from?{from:e.identity?.from??u.from}:{},...e.identity?.to??u.to?{to:e.identity?.to??u.to}:{}},p=f[0],m=n2(h,p?.visual?.kind==="inline"?nM(p).lineBlocks.map(e=>e.runs.map(e=>e.text).join("")).join(`
|
|
19
|
+
`):p?tv(eY(p.text,p.textContent),p.display??"literal"):void 0);if(iu(e.id,e.attributes),m&&e.attributes?.ariaLabel!==void 0)throw TypeError(`Connector "${e.id}" takes its aria-label from typed relation accessibility`);for(let[t,r]of f.entries())if(r.visual?.kind==="inline"&&(!r.anchor||!r.paint||void 0===r.fontSize||void 0===r.textAnchor))throw TypeError(`Connector "${e.id}" inline label ${t+1} requires anchor, paint, fontSize, and textAnchor`);let g=e.stroke?.width??e.paint.strokeWidth??"1",y=e.stroke?.dash??(e.paint.strokeDasharray?{array:e.paint.strokeDasharray,...void 0!==e.paint.strokeDashoffset?{offset:e.paint.strokeDashoffset}:{}}:void 0),b=e.stroke?.opacity??e.paint.opacity,x=e.stroke?.paintOrder??e.paint.paintOrder,k=e.stroke?.mixBlendMode,v={color:e.stroke?.color??e.paint.stroke??"var(--_line)",width:g,...void 0!==b?{opacity:b}:{},...y?{dash:y}:{},lineCap:e.stroke?.lineCap??e.paint.strokeLinecap??"butt",lineJoin:e.stroke?.lineJoin??e.paint.strokeLinejoin??"miter",miterLimit:e.stroke?.miterLimit??Number(e.paint.strokeMiterlimit??4),...e.stroke?.pathLength!==void 0?{pathLength:e.stroke.pathLength}:{},...void 0!==x?{paintOrder:x}:{},...void 0!==k?{mixBlendMode:k}:{},nonScaling:e.stroke?.nonScaling??"non-scaling-stroke"===e.paint.vectorEffect,...e.stroke?.encodesValue?{encodesValue:!0}:{}},w=t4(e.geometry,o),$=e.route?.contours;if($&&($.length!==w.length||$.some((e,t)=>{let r=w[t];return!r||e.start.x!==r.start.x||e.start.y!==r.start.y||e.end.x!==r.end.x||e.end.y!==r.end.y||e.closed!==r.closed})))throw TypeError(`Connector "${e.id}" route contours disagree with typed subpath endpoint topology`);if(!t6(e.geometry)&&$)for(let[t,r]of $.entries()){let n=w[t];for(let i of["startTangent","endTangent"]){let o=r[i],a=n[i];if(o&&(!a||!tZ(o,a,1e-9)))throw TypeError(`Connector "${e.id}" route.contours[${t}].${i} disagrees with linear route geometry`)}}let M=$?w.map((e,t)=>{let r=$?.[t],n=r?.startTangent??e.startTangent,i=r?.endTangent??e.endTangent;return{start:{...e.start},end:{...e.end},closed:e.closed,...n?{startTangent:n}:{},...i?{endTangent:i}:{}}}):w;for(let t of M)for(let r of[t.startTangent,t.endTangent]){if(!r)continue;let t=Math.hypot(r.x,r.y);if(!Number.isFinite(t)||Math.abs(t-1)>1e-9)throw TypeError(`Connector "${e.id}" contour tangents must be finite unit vectors`)}for(let t of[e.route?.startTangent,e.route?.endTangent]){if(!t)continue;let r=Math.hypot(t.x,t.y);if(!Number.isFinite(r)||Math.abs(r-1)>1e-9)throw TypeError(`Connector "${e.id}" route tangents must be finite unit vectors`)}for(let[t,r,n]of[["startTangent",e.route?.startTangent,M[0]?.startTangent],["endTangent",e.route?.endTangent,M.at(-1)?.endTangent]])if(r&&n&&!tZ(r,n,1e-9))throw TypeError(`Connector "${e.id}" route.${t} disagrees with its contour tangent authority`);let z={geometry:e.geometry,ownership:e.route?.ownership??"family",closed:o,bendRadius:e.route?.bendRadius??0,contours:M,...e.route?.startTangent??M[0]?.startTangent?{startTangent:e.route?.startTangent??M[0]?.startTangent}:{},...e.route?.endTangent??M.at(-1)?.endTangent?{endTangent:e.route?.endTangent??M.at(-1)?.endTangent}:{},labelAnchors:e.route?.labelAnchors??f.flatMap(e=>e.anchor?[e.anchor]:[])};if(e.hit?.closed!==void 0&&e.hit.closed!==o)throw TypeError(`Connector "${e.id}" hit.closed must match route.closed topology`);let S={geometry:e.hit?.geometry??e.geometry,closed:e.hit?.closed??o,strokeWidth:e.hit?.strokeWidth??Math.max(6,Number.isFinite(r="number"==typeof g?g:parseFloat(g))?Math.max(0,r):1),pointerEvents:e.hit?.pointerEvents??("invisible"===e.lineStyle?"none":"stroke")},j={geometry:e.geometry,lineStyle:e.lineStyle,endpoints:u,relationship:c,route:z,stroke:v,markers:{...a?{start:a}:{},mid:l,...s?{end:s}:{}},labels:f,hit:S,...e.transform?{transform:e.transform}:{},additionalDiagnostics:e.terminalProjection?.diagnostics},E={kind:"connector",id:e.id,role:e.role,lineStyle:e.lineStyle,endpoints:u,relationship:c,route:z,stroke:v,markers:{...a?{start:a}:{},mid:l,...s?{end:s}:{}},labels:f,hit:S,terminalProjection:void 0,identity:h,...e.owner?{owner:e.owner}:{},...e.visibility?{visibility:e.visibility}:{},...m?{accessibility:m}:{},...e.channels?{channels:e.channels}:{},...e.transform?{transform:e.transform}:{},...e.attributes?{attributes:e.attributes}:{}};return function(e,t){if(0===n9||"path"===t.geometry.kind||void 0!==t.additionalDiagnostics&&!t.additionalDiagnostics.every(e=>"string"==typeof e)){e.terminalProjection=n4(t);return}t.additionalDiagnostics&&Object.defineProperty(t,"additionalDiagnostics",{value:Object.freeze([...t.additionalDiagnostics])}),it(e,Object.freeze(t))}(E,j),nX(E)}function iv(e){let{block:t,...r}=e;if(t){for(let r of["fontSize","fontWeight","letterSpacing"])if(void 0!==e[r]&&e[r]!==t[r])throw TypeError(`Text "${e.id}" ${r} differs from its retained prepared block`)}iu(e.id,e.attributes);let n=e.fontWeight??t?.fontWeight??400,i=e.letterSpacing??t?.letterSpacing??0,o=e.display??t?.prepared.display??"formatted",a=t??nd(e.text,{display:o,fontSize:e.fontSize,fontWeight:n,letterSpacing:i});if(e.spans&&(1!==a.lines.length||e.spans.map(e=>e.text).join("")!==a.text))throw TypeError(`Text "${e.id}" spans must spell its one displayed line`);let s=e.baselineShift??.35,l=a.lines.length,d=t?t.lineHeight:e.fontSize*tp,u=(1===l?0:-((l-1)/2)*d)+e.fontSize*s,c="hanging"===e.dominantBaseline?a.lineHeight/2:"middle"===e.dominantBaseline||"central"===e.dominantBaseline?0:-(.35*e.fontSize),f=u+(l-1)*a.lineHeight/2+c,h=ip(e),p=n2(h,e.attributes?.data?.label);if(p&&e.attributes?.ariaLabel!==void 0)throw TypeError(`Text "${e.id}" takes its aria-label from typed relation accessibility`);return nX({kind:"text",...r,identity:h,accessibility:p,block:a,measurement:t?"prepared":"fallback",...t?{prepared:!0,preparedLines:t.lineBlocks.map(e=>e.runs)}:{},fontWeight:n,letterSpacing:i,display:o,textLayout:{width:a.width,height:a.height,lineHeight:a.lineHeight,offsetY:f}})}function iw(e,t){return nV({kind:"document",element:"content",...e},t)}function i$(e){let t="title"===e.element?"title":"desc",r=e.domId?` id="${tz(e.domId)}"`:"";return nV({kind:"document",role:"chrome",...e},`<${t}${r}>${tM(e.text)}</${t}>`)}function iM(e,t){return nV({kind:"document",role:"defs",element:"definitions",...e},t)}function iz(){return nV({kind:"document",id:"svg-close",role:"chrome",element:"close"},"</svg>")}function iS(t){let r,n,i,o,a,s=t.open,l=t.close,d=t.join??`
|
|
20
|
+
`,u=id({id:t.id,open:s,close:l,join:d,transform:t.transform}),c=(r=s.match(/^\s*<([A-Za-z][\w:-]*)\b[^>]*>/)?.[0]??"",i=((n=t=>{let n=r.match(RegExp(`\\s${t}="([^"]*)"`))?.[1];return void 0===n?void 0:e(n)})("class")??"").split(/\s+/).filter(Boolean),o=n("data-from"),a=n("data-to"),{id:n("data-id")??t.id,role:t.role,...void 0!==o?{from:o}:{},...void 0!==a?{to:a}:{},...i.length>0?{classNames:i}:{}}),f=t.paint,h=f?.opacity,p=f?.fill,m=f&&[...void 0!==h?[`opacity="${tz(h)}"`]:[],...void 0!==p?[`fill="${tz(p)}"`]:[]].join(" "),g=m?s.replace(/^(\s*<g)\b/,`$1 ${m}`):s,y=t.owner??{id:c.id,role:c.role},b=t.children.map(e=>{var t;let r;if(e.node.owner||"document"===e.node.kind||"group"===e.node.kind)return e;if(ir(e.node)){let t={};for(let r of Object.keys(e.node))t[r]="terminalProjection"===r?void 0:e.node[r];t.owner=y,r=t,io(e.node,r)}else r={...e.node,owner:y};return t=e.node,(nG.has(t)||nZ.has(t))&&nK(e.node,r),{...e,node:r}}),x=nU(tG(g,c)),k=nX({kind:"group",id:t.id,role:t.role,open:x,close:l,children:b,join:d,channels:t.channels,identity:c,owner:y,...t.visibility?{visibility:t.visibility}:{},...t.transform?{transform:t.transform}:{},...f?{paint:f}:{}});return ic.set(k,Object.freeze({open:x,opacity:h,...u,style:u.style||void 0!==p})),k}function ij(e,t){return nV({kind:"document",element:"open",id:e.id,role:"prelude"},t)}function iE(e){return iT({shape:im,group:iS},e)}function iT(e,t){return e.group({id:t.id,role:"icon",open:t.open,close:"</g>",...t.transform?{transform:t.transform}:{},...t.owner?{owner:t.owner}:{},...t.channels?{channels:t.channels}:{},join:t.join??"",children:t.paths.map((r,n)=>({indent:t.indent??0,node:e.shape({id:tH(t.id,"path",n),role:"icon",geometry:{kind:"path",d:r},paint:t.paint,...t.owner?{owner:t.owner}:{}})}))})}export{eZ as a,S as b,L as c,D as d,G as e,Z as f,J as g,U as h,es as i,el as j,ed as k,eb as l,ek as m,ev as n,ew as o,eA as p,eR as q,eM as r,ez as s,eS as t,tu as u,tf as v,th as w,tp as x,tm as y,eO as z,eN as A,eI as B,eY as C,eQ as D,eK as E,e0 as F,e1 as G,tg as H,ty as I,tb as J,tk as K,tv as L,tM as M,tz as N,tS as O,tW as P,tL as Q,tP as R,tB as S,tH as T,tR as U,tD as V,tG as W,ne as X,nt as Y,nr as Z,nd as _,nu as $,nc as aa,nf as ba,tZ as ca,tQ as da,t5 as ea,t3 as fa,t6 as ga,t4 as ha,t8 as ia,t9 as ja,re as ka,rr as la,rn as ma,ri as na,ro as oa,rs as pa,ru as qa,rc as ra,rf as sa,rh as ta,rp as ua,rm as va,rg as wa,ry as xa,rb as ya,rx as za,rk as Aa,r$ as Ba,rz as Ca,rS as Da,r4 as Ea,rj as Fa,rE as Ga,rT as Ha,rO as Ia,rC as Ja,rW as Ka,np as La,nm as Ma,ny as Na,nb as Oa,nk as Pa,nv as Qa,nz as Ra,nS as Sa,nE as Ta,nT as Ua,nW as Va,nF as Wa,n4 as Xa,n7 as Ya,ir as Za,ii as _a,io as $a,rA as ab,rL as bb,rH as cb,rR as db,rD as eb,r_ as fb,rU as gb,rV as hb,rX as ib,rQ as jb,r0 as kb,r1 as lb,r2 as mb,r5 as nb,id as ob,r3 as pb,nI as qb,nA as rb,nL as sb,nD as tb,nU as ub,nY as vb,nQ as wb,nK as xb,n0 as yb,ih as zb,im as Ab,ik as Bb,iv as Cb,iw as Db,i$ as Eb,iM as Fb,iz as Gb,iS as Hb,ij as Ib,iT as Jb,n1 as Kb,l as Lb,d as Mb,u as Nb,o as Ob,c as Pb,f as Qb,h as Rb,p as Sb,m as Tb,g as Ub,b as Vb,x as Wb,k as Xb,w as Yb,$ as Zb,M as _b,z as $b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,d as t,e as r,h as n,m as s}from"./chunk-
|
|
2
|
-
`).trim(),endIndex:r,...l.trim()?{suffixLine:c+l.trimStart()}:{}}}return}let i=r.match(
|
|
1
|
+
import{c as e,d as t,e as r,h as n,m as s}from"./chunk-3JTYTXA6.js";import{Ba as i,Kb as o,Qb as a,ma as l,na as c,qa as f,ta as u,va as d,wa as h}from"./chunk-EIYLJ4FI.js";import{a as g}from"./chunk-YHMTSXIR.js";var p,m=new WeakSet;function b(e){m.add(e)}function v(e){return m.has(e)}var w=new WeakMap;function y(e){let t=t=>e(o,t);return w.set(t,{original:e,current:e}),t}function x(e,t){let r=w.get(e)?.current;if(r){let e=w.get(t);e?e.current=r:w.set(t,{original:r,current:r})}return t}function $(e){return e&&w.get(e)?.current}function O(e){return e&&w.get(e)?.original}var j=/[\u0000-\u001f\u007f-\u009f]/,S=/#\w+;/g,I=/fl°°(\d+)¶ß|fl°(\w+)¶ß/g,k=new Map([["amp","&"],["apos","'"],["gt",">"],["lt","<"],["quot",'"']]);function C(e){return e.replace(/[^\r\n\u2028\u2029]+/g,e=>A(A(e,"style"),"classDef"))}function A(e,t){let r=e.lastIndexOf(";");if(r<0||!e.includes(t))return e;let n=new Uint8Array(e.length+1),s=-1,i=!1;for(let t=e.length-1;t>=0;t--){let o=e[t];/\s/.test(o)?s=-1:"#"===o&&(s=t),":"===o&&s>=0&&s<r&&(i=!0),n[t]=+!!i}for(let s=e.indexOf(t);s>=0;s=e.indexOf(t,s+t.length))if(1===n[s+t.length])return e.slice(0,r)+e.slice(r+1);return e}function z(e){return e.replace(S,e=>{let t=e.slice(1,-1);return/^\+?\d+$/.test(t)?`\uFB02\xb0\xB0${t}\xb6\xDF`:`\uFB02\xb0${t}\xb6\xDF`})}function T(e){return e.replace(I,(e,t,r)=>`#${t??r};`)}var E={'"':"quot","&":"amp","<":"lt",">":"gt"};function M(e){let t=E[e];return t?`#${t};`:`#${e.codePointAt(0)};`}var D=/\w/;function F(e,t=""){let r=new Set(t);for(let e of r){let t=e.codePointAt(0);if(j.test(e)||t>=55296&&t<=57343)throw RangeError(`encodeMermaidEntities cannot reserve U+${t.toString(16).toUpperCase().padStart(4,"0")}: no entity displays it`)}let n=[...e],s=e=>{let t=n[e];return void 0===t||r.has(t)?void 0:t},i=e=>{let t=e+1;for(;void 0!==s(t)&&D.test(s(t));)t++;return t>e+1&&";"===s(t)},o="";for(let e=0;e<n.length;e++){let t=n[e];r.has(t)?o+=M(t):"#"===t&&i(e)?o+=M("#"):"fl"===t&&"°"===s(e+1)||"¶"===t&&"ß"===s(e+1)?o+=M(t):o+=t}return o}function R(e,t=""){return e.split(/(#\w+;)/g).map((e,r)=>r%2?e:F(e,t)).join("")}function N(e){return g(T(e))}var B=new Set([..."#&:;,%{}\"'\\`","fl","¶"]),L={amp:"&",quot:'"',apos:"'"};function _(e,t=""){let r=T(e);return r.replace(/#(\w+);/g,(e,n,s)=>{if(s>0&&"&"===r[s-1])return e;let i=L[n]??(/^\d+$/.test(n)&&1114111>=Number(n)?String.fromCodePoint(Number(n)):void 0);return i&&(B.has(i)||t.includes(i)||0===s&&/^[A-Za-z]$/.test(i))?i:e})}function q(e){return{...void 0!==e.title?{title:_(e.title)}:{},...void 0!==e.descr?{descr:_(e.descr)}:{}}}function W(e){return q({...void 0!==e.title?{title:N(e.title)}:{},...void 0!==e.descr?{descr:N(e.descr)}:{}})}var Y=class extends Error{constructor(e){super(e),this.name="MermaidSyntaxError"}};function J(e){let t=e.known&&e.known.length>0?` (known: ${e.known.join(", ")})`:"";return new Y(`${e.what} \u2014 expected ${e.expectedForm}, e.g. ${e.example}${t}`)}function G(e){let t=[0];for(let r=0;r<e.length;r++)13===e.charCodeAt(r)?(10===e.charCodeAt(r+1)&&r++,t.push(r+1)):10===e.charCodeAt(r)&&t.push(r+1);return t}function K(e,t){let r=0,n=e.length;for(;r<n;){let s=r+Math.floor((n-r)/2);e[s]<=t?r=s+1:n=s}let s=Math.max(0,r-1);return Object.freeze({offset:t,line:s+1,col:t-e[s]+1})}function P(e,t,r){return Object.freeze({start:K(e,t),end:K(e,r)})}function U(){let e=new Map;return{close(t,r){let n=[],s=new Set;for(let i of r)""===i.trim()||s.has(i)||e.has(i)&&e.get(i)!==t||(s.add(i),e.set(i,t),n.push(i));return n},ownerOf:t=>e.get(t)}}var V=/^\s*accTitle(?:\s*:\s*|\s+)([^\r\n]+)$/i,X=/^\s*accDescr(?=\s|:|\{|$)/i;function H(e,t){let r=e[t];if(void 0===r)return null;let n=r.match(/^\s*%% agentic-mermaid (accTitle|accDescr): ("[^\r\n]*")\s*$/);if(n)try{let e=JSON.parse(n[2]);if("string"==typeof e)return{title:"accTitle"===n[1],form:"native",value:e,endIndex:t}}catch{}let s=r.match(X);if(s){let n=r.slice(s[0].length).trimStart();if(n.startsWith(":")&&(n=n.slice(1).trimStart()),!n.startsWith("{")){let e=n.trim();return e?{title:!1,form:"inline",value:e,endIndex:t}:null}let i=[];for(let r=t;r<e.length;r++){let s=r===t?n.slice(1):e[r],o=s.indexOf("}");if(o<0){s.trim()&&i.push(s.trim());continue}let a=s.slice(0,o).trim();a&&i.push(a);let l=s.slice(o+1),c=e[r].match(/^\s*/)?.[0]??"";return{title:!1,form:"block",value:i.join(`
|
|
2
|
+
`).trim(),endIndex:r,...l.trim()?{suffixLine:c+l.trimStart()}:{}}}return}let i=r.match(V);return i?{title:!0,form:"inline",value:i[1].trim(),endIndex:t}:null}function Q(e,t,r){let n={},s=[],i=[],o;for(let a=0;a<e.length;a++){let l=H(e,a);if(void 0===l){o=a,s.push(...e.slice(a));for(let t=a;t<e.length;t++)i.push(t);break}if(null===l){let r=Z(t,a,e.length);s.push(...e.slice(a,r+1));for(let e=a;e<=r;e++)i.push(e);a=r;continue}let c=r?r(l):l.value;l.title?n.title=c:n.descr=c,l.suffixLine&&(s.push(l.suffixLine),i.push(l.endIndex)),a=l.endIndex}return{accessibility:n,familyLines:s,familyOrigins:i,...void 0!==o?{unclosedIndex:o}:{}}}function Z(e,t,r){let n=e?.[t]??t;return n>t?Math.min(n,r-1):t}function ee(e){if(void 0!==e.unclosedIndex)throw Error("Unclosed accDescr block")}function et(e){return{...void 0!==e.title?{accessibilityTitle:e.title}:{},...void 0!==e.descr?{accessibilityDescription:e.descr}:{}}}function er(e,t){return void 0===t.title&&void 0===t.descr?e:{...e,...et(t)}}function en(e,t){return void 0===t.title&&void 0===t.descr?e:{...e,accessibility:{...e.accessibility,...void 0!==t.title?{title:t.title}:{},...void 0!==t.descr?{description:t.descr}:{}}}}function es(e,t){return ei(e,t).native.map(t=>{let r=e.slice(t.start,t.end);return{start:t.start+r.indexOf('"'),end:t.start+r.trimEnd().length,text:JSON.stringify(t.directive.value).replace(/[&<>#%\u2028\u2029]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`)}}).filter(t=>t.text!==e.slice(t.start,t.end))}function ei(e,t){let{openers:r,closings:n}=eo(e),s=[],i=[],o=e.split(/\r\n?|\n/),a=0,l=0,c=0,f=0,u=-1,d=e=>{for(;l<r.length&&r[l]<e;){let e=r[l++];if(!(e<f)){for(;c<n.length&&n[c].start<e;)c++;c!==n.length&&(f=n[c].end,s.push({start:e,end:f}))}}};for(let n=0;n<o.length;n++){let s=o[n];if(d(a),f<=a&&n>u){let e=H(o,n);if(e?.form==="native"){let t=a+s.length;for(i.push({start:a,end:t,directive:e});l<r.length&&r[l]<t;)l++}else u=void 0===e?o.length:Math.max(Z(t,n,o.length),e?.endIndex??n)}"\r"===e[a+=s.length]&&a++,e[a]===`
|
|
3
3
|
`&&a++}return d(1/0),{native:i,directives:s}}function eo(e){return{openers:[...e.matchAll(/%%\{\s*\w+/g)].map(e=>e.index),closings:[...e.matchAll(/\}\s*%%/g)].map(e=>({start:e.index,end:e.index+e[0].length}))}}function ea(e){let{openers:t,closings:r}=eo(e),n=e.split(""),s=0,i=0;for(let e of t)if(!(e<i)){for(;s<r.length&&r[s].start<e;)s++;if(s===r.length)break;i=r[s].end;for(let t=e;t<i;t++)"\r"!==n[t]&&n[t]!==`
|
|
4
|
-
`&&(n[t]=" ")}return n.join("")}var el=Object.freeze({nodes:5e3,edges:5e3,nesting:64,sourceCharacters:2e6}),ec=class extends RangeError{code="DIAGRAM_WORK_LIMIT";resource;requested;constructor(e,t,r=!1){let n="sourceCharacters"===e?`authored plus normalized source of ${t} characters${r?", with its configuration,":""}`:`expanded graph ${e} ${t}`;super(`DIAGRAM_WORK_LIMIT: ${n} exceeds the host limit of ${el[e]}; split the diagram${"sourceCharacters"===e?"":` or reduce its ${e}`}`),this.name="DiagramWorkLimitError",this.resource=e,this.requested=t}};function ef(e,t){if(t>el[e])throw new ec(e,t)}function eu(e){ef("nodes",e.requirements.length+e.elements.length),ef("edges",e.relations.length)}function ed(e){ef("edges",e.edges.length),ef("nodes",e.root.children?.length??0);let t=(e.root.children??[]).map(e=>({node:e,depth:0})),r=new Set([e.root]),n=0;for(;t.length;){let{node:e,depth:s}=t.pop();if(r.has(e))throw TypeError("Block children must form a tree without repeated objects");r.add(e);let i=s+ +("composite"===e.type);for(let r of(ef("nesting",i),ef("nodes",++n+t.length+(e.children?.length??0)),e.children??[]))t.push({node:r,depth:i})}}function eh(e){ef("nodes",e.nodes.size),ef("edges",e.edges.length),ef("nodes",e.nodes.size+e.subgraphs.length);let t=e.subgraphs.map(e=>({group:e,depth:1})),r=new Set,n=e.nodes.size;for(;t.length;){let{group:e,depth:s}=t.pop();if(r.has(e))throw TypeError("Graph groups must form a tree without repeated group objects");for(let i of(r.add(e),ef("nesting",s),ef("nodes",++n),ef("nodes",n+t.length+e.children.length),e.children))t.push({group:i,depth:s+1})}}function eg(e){ef("nodes",e.children?.length??0);let t=(e.children??[]).map(e=>({node:e,depth:1})),r=new Set([e]),n=0,s=e.edges?.length??0;for(ef("edges",s);t.length;){let{node:e,depth:i}=t.pop();if(r.has(e))throw TypeError("Layout graph must form a tree without repeated node objects");for(let o of(r.add(e),ef("nesting",void 0===e.children?i-1:i),ef("nodes",++n),ef("edges",s+=e.edges?.length??0),ef("nodes",n+t.length+(e.children?.length??0)),e.children??[]))t.push({node:o,depth:i+1})}}function ep(e){let t=e.classes.length+e.notes.length;ef("nodes",t+e.namespaces.length),ef("edges",e.relationships.length);let r=e.namespaces.map(e=>({namespace:e,depth:1})),n=new Set;for(;r.length;){let{namespace:e,depth:s}=r.pop();if(n.has(e))throw TypeError("Class namespaces must form a tree without repeated namespace objects");for(let i of(n.add(e),ef("nesting",s),ef("nodes",++t+r.length+e.children.length),e.children))r.push({namespace:i,depth:s+1})}}function em(e){ew(e.entities.length,e.relationships.length,e.groups,"ER")}function eb(e){ew(e.services.length+e.junctions.length,e.edges.length,e.groups,"Architecture")}function ev(e){ew(e.elements.length,e.relationships.length+e.layout.hints.length,e.boundaries,"C4");let t=new Set(e.boundaries.map(e=>e.id)),r=new Set(t);for(let t of e.elements){if(r.has(t.id))throw TypeError(`C4 elements and boundaries must have distinct identities: ${t.id}`);r.add(t.id)}for(let r of[...e.elements,...e.boundaries])if(void 0!==r.parentId&&!t.has(r.parentId))throw TypeError(`C4 ${r.id} has no boundary parent ${r.parentId}`)}function ew(e,t,r,n){ef("nodes",e+r.length),ef("edges",t);let s=new Map(r.map(e=>[e.id,e]));if(s.size!==r.length)throw TypeError(`${n} groups must have distinct identities`);let i=new Map;for(let e of r){let t=[],r=new Set,o=e;for(;o&&!i.has(o.id);){if(r.has(o.id))throw TypeError(`${n} groups must form an acyclic hierarchy`);r.add(o.id),t.push(o.id),ef("nesting",t.length),o=void 0===o.parentId?void 0:s.get(o.parentId)}let a=o?i.get(o.id):0;for(let e of t.reverse())ef("nesting",++a),i.set(e,a)}}function ey(e){let t=new Map;for(let[r,n]of e)t.delete(r),t.set(r,n);return Object.fromEntries(t)}function ex(...e){let t=new Map;for(let r of e)for(let[e,n]of Object.entries(r??{}))t.delete(e),t.set(e,n);return Object.fromEntries(t)}function e$(e,t={}){return ey(function(e,t={}){let r=e.replace(/;\s*$/,""),n=[];for(let e of function(e){let t=[],r=0,n=0,s=!1,i="";for(let o=0;o<e.length;o++){let a=e[o];if(s){s=!1;continue}if("\\"===a){s=!0;continue}if(i){a===i&&(i="");continue}if('"'===a||"'"===a){i=a;continue}"("===a?r++:")"===a?r=Math.max(0,r-1):(","===a||";"===a)&&0===r&&(t.push(e.slice(n,o)),n=o+1)}return t.push(e.slice(n)),t.map(e=>e.replace(/\\,/g,","))}(r)){let r=e.indexOf(":");if(r<=0)continue;let s=e.slice(0,r).trim(),i=t.caseInsensitive?s.toLowerCase():s,o=e.slice(r+1).trim();i&&o&&n.push([i,o])}return n}(e,t))}var eO=["fill","stroke","color"],ej=class extends Error{code="INVALID_STYLE_COLOR";subject;property;value;constructor(e,r,n,s){super(Y({what:`${e}: ${r} ${JSON.stringify(n)} is not a CSS color`,expectedForm:t("color"!==r),example:`${s?`${s} `:""}${r}:#f96`}).message),this.name="AuthoredStyleColorError",this.subject=e,this.property=r,this.value=n}};function eS(t,r){let n=t&&function(t){for(let r of eO){let n=t[r];if(void 0!==n&&void 0===e(n,"color"!==r))return{property:r,value:n}}}(t);if(n)throw new ej(r,n.property,n.value,r);return t}function ek(e){for(let[t,r]of e.classDefs)eS(r,`classDef ${t}`);for(let[t,r]of e.nodeStyles)eS(r,`style ${t}`);for(let[t,r]of e.linkStyles)eS(r,`linkStyle ${t}`)}function eI(e,t){for(let[t,r]of e)eS(r,`classDef ${t}`);for(let e of t)eS(e.inlineStyle,`style ${e.id}`)}function eC(e){return e?.split(/\s+/).filter(Boolean)??[]}function eA(e,t,r){let n=e.get(t);e.set(t,n?`${n} ${r}`:r)}var ez={default:{bg:n.bg,fg:n.fg},base:{bg:n.bg,fg:n.fg},neutral:{bg:"#ffffff",fg:"#1f2937",line:"#9ca3af",accent:"#6b7280",muted:"#6b7280"},dark:{bg:"#18181B",fg:"#FAFAFA"},forest:{bg:"#f0fdf4",fg:"#14532d",line:"#4d7c0f",accent:"#15803d",muted:"#65a30d",border:"#86efac"}},eD={bg:["background","mainBkg"],fg:["primaryTextColor","textColor","nodeTextColor"],line:["lineColor","defaultLinkColor"],accent:["arrowheadColor","primaryColor"],muted:["secondaryTextColor","tertiaryTextColor"],surface:["primaryColor","nodeBkg","mainBkg"],border:["primaryBorderColor","secondaryBorderColor"]};function eE(e,t,s,i=!1){let o=function(e){if(!("string"!=typeof e||!e))return ez[e.toLowerCase()]}(t.theme),a=t.themeVariables,l=(...e)=>{let t=eM(a,...e);return i?t:r(t)};return{bg:e.bg??l(...eD.bg)??o?.bg??n.bg,fg:e.fg??l(...eD.fg)??o?.fg??n.fg,line:e.line??l(...eD.line)??o?.line,accent:e.accent??l(...eD.accent)??o?.accent,muted:e.muted??l(...eD.muted)??o?.muted,surface:e.surface??l(...eD.surface)??o?.surface,border:e.border??l(...eD.border)??o?.border,shadow:e.shadow??o?.shadow,font:s,embedFontImport:e.embedFontImport}}function eM(e,...t){if(e)for(let r of t){let t=e[r];if("string"==typeof t&&t.length>0)return t}}function eT(e,t){let r;for(let n of eC(t.classAssignments.get(e))){let e=eS(t.classDefs.get(n),`classDef ${n}`);e&&(r={...r,...e})}let n=eS(t.nodeStyles.get(e),`style ${e}`);return n&&(r=r?{...r,...n}:{...n}),r}function eF(e,t){let r;for(let n of eC(t.classAssignments.get(e))){let e=eS(t.classDefs.get(n),`classDef ${n}`);e&&(r={...r,...e})}return r}function eN(e,t){let r,n=t.edges[e]?.id;for(let e of eC(n?t.classAssignments.get(n):void 0)){let n=eS(t.classDefs.get(e),`classDef ${e}`);n&&(r={...r,...n})}let s=eS(t.linkStyles.get("default"),"linkStyle default");s&&(r=r?{...r,...s}:{...s});let i=eS(t.linkStyles.get(e),`linkStyle ${e}`);return i&&(r=r?{...r,...i}:{...i}),r}function eR(e){let t,r=((t=l(e))?{r:t[0],g:t[1],b:t[2]}:null)??function(e){let t=e.match(/^rgba?\(\s*(\d{1,3})(?:\s*,\s*|\s+)(\d{1,3})(?:\s*,\s*|\s+)(\d{1,3})/i);if(!t)return null;let r={r:Number.parseInt(t[1],10),g:Number.parseInt(t[2],10),b:Number.parseInt(t[3],10)};return Object.values(r).every(e=>e>=0&&e<=255)?r:null}(e);if(!r)return;let n=f(`rgb(${r.r}, ${r.g}, ${r.b})`);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#FFFFFF"}function eL(e,t="var(--_text)"){return e?.color?e.color:e?.fill?eR(e.fill)??t:t}var e_=new Set(["var(--_text)","var(--_text-sec)","var(--_text-muted)","var(--_text-faint)"]);function eB(e,t,r){if(!e_.has(e))return e;let n=s(e,r),o=s(t,r),a=n&&o?i(o,s("var(--bg)",r)??"#ffffff"):null;if(!a)return e;let l="var(--_text-faint)"===e?d:u,f=h(n,c(...a),l);return f===n?e:f}function eq(e,t,r){let n=e?.color;if(n)return()=>n;if(!e?.fill)return void 0===r?e=>e:e=>eB(e,r,t);let o=i(e.fill,s("var(--bg)",t)??"#ffffff");if(!o)return e=>e;let a=c(...o);return e=>{let r=s(e,t);return r?h(r,a):eR(a)??e}}function eW(e){let t=new Map,r=new Map;return(n,s,i=!1)=>{let o=i?r:t,a=o.get(s),l=a?.get(n);if(void 0!==l)return l;let c=i?eq({fill:s},e,s)(n):eB(n,s,e);return a||o.set(s,a=new Map),a.set(n,c),c}}async function eU(){p??=await import("./mermaid-yaml-runtime-QVYX4EWK.js")}function eY(){if(!p)throw new a("YAML",eU);return p}function eG(e){return eY().parseMermaidYaml(e)}function eV(e){return eY().parseDirectiveYaml(e)}function eJ(e){return eY().readYamlMappingRanges(e)}var eK=Object.freeze({contrast:Object.freeze({properties:Object.freeze({role:Object.freeze({kind:"role"}),minimum:Object.freeze({kind:"number",minimum:1,maximum:21})}),recovery:"Choose an authored text/surface pair that meets the requested ratio, or remove the rule; the renderer will not repaint it."}),"accent-area":Object.freeze({properties:Object.freeze({maxFraction:Object.freeze({kind:"number",minimum:0,maximum:1,required:!0})}),recovery:"Reduce authored accent-filled area or raise the declared maximum; the renderer will not rewrite fills."}),"mono-role":Object.freeze({properties:Object.freeze({role:Object.freeze({kind:"role",required:!0})}),recovery:"Use measurable monochrome paint for the named role or remove the rule; the renderer will not rewrite paint."})}),eP=Object.freeze(Object.keys(eK));function eZ(e){return eK[e].properties}function eX(e){return Object.freeze(["kind","action",...Object.keys(eK[e].properties)])}function eH(e){return Object.freeze(["kind","action",...Object.entries(eZ(e)).filter(([,e])=>!0===e.required).map(([e])=>e)])}var eQ=Object.freeze({warn:Object.freeze({code:"BRAND_CONSTRAINT_WARNING",severity:"warning",tier:"lint"}),error:Object.freeze({code:"BRAND_CONSTRAINT_ERROR",severity:"error",tier:"lint"})});export{b as a,v as b,y as c,x as d,$ as e,O as f,j as g,k as h,I as i,C as j,z as k,F as l,N as m,R as n,B as o,q as p,W as q,U as r,Y as s,G as t,V as u,J as v,K as w,X as x,H as y,Q as z,ee as A,et as B,er as C,en as D,es as E,ei as F,ea as G,eG as H,eV as I,eJ as J,el as K,ec as L,ef as M,eu as N,ed as O,eh as P,eg as Q,ep as R,em as S,eb as T,ev as U,eP as V,eZ as W,eX as X,eH as Y,eQ as Z,ey as _,ex as $,e$ as aa,ej as ba,eS as ca,ek as da,eI as ea,eA as fa,eD as ga,eE as ha,eM as ia,eT as ja,eF as ka,eN as la,eR as ma,eL as na,eB as oa,eq as pa,eW as qa};
|
|
4
|
+
`&&(n[t]=" ")}return n.join("")}var el=Object.freeze({nodes:5e3,edges:5e3,nesting:64,sourceCharacters:2e6}),ec=class extends RangeError{code="DIAGRAM_WORK_LIMIT";resource;requested;constructor(e,t,r=!1){let n="sourceCharacters"===e?`authored plus normalized source of ${t} characters${r?", with its configuration,":""}`:`expanded graph ${e} ${t}`;super(`DIAGRAM_WORK_LIMIT: ${n} exceeds the host limit of ${el[e]}; split the diagram${"sourceCharacters"===e?"":` or reduce its ${e}`}`),this.name="DiagramWorkLimitError",this.resource=e,this.requested=t}};function ef(e,t){if(t>el[e])throw new ec(e,t)}function eu(e){ef("nodes",e.requirements.length+e.elements.length),ef("edges",e.relations.length)}function ed(e){ef("edges",e.edges.length),ef("nodes",e.root.children?.length??0);let t=(e.root.children??[]).map(e=>({node:e,depth:0})),r=new Set([e.root]),n=0;for(;t.length;){let{node:e,depth:s}=t.pop();if(r.has(e))throw TypeError("Block children must form a tree without repeated objects");r.add(e);let i=s+ +("composite"===e.type);for(let r of(ef("nesting",i),ef("nodes",++n+t.length+(e.children?.length??0)),e.children??[]))t.push({node:r,depth:i})}}function eh(e){ef("nodes",e.nodes.size),ef("edges",e.edges.length),ef("nodes",e.nodes.size+e.subgraphs.length);let t=e.subgraphs.map(e=>({group:e,depth:1})),r=new Set,n=e.nodes.size;for(;t.length;){let{group:e,depth:s}=t.pop();if(r.has(e))throw TypeError("Graph groups must form a tree without repeated group objects");for(let i of(r.add(e),ef("nesting",s),ef("nodes",++n),ef("nodes",n+t.length+e.children.length),e.children))t.push({group:i,depth:s+1})}}function eg(e){ef("nodes",e.children?.length??0);let t=(e.children??[]).map(e=>({node:e,depth:1})),r=new Set([e]),n=0,s=e.edges?.length??0;for(ef("edges",s);t.length;){let{node:e,depth:i}=t.pop();if(r.has(e))throw TypeError("Layout graph must form a tree without repeated node objects");for(let o of(r.add(e),ef("nesting",void 0===e.children?i-1:i),ef("nodes",++n),ef("edges",s+=e.edges?.length??0),ef("nodes",n+t.length+(e.children?.length??0)),e.children??[]))t.push({node:o,depth:i+1})}}function ep(e){let t=e.classes.length+e.notes.length;ef("nodes",t+e.namespaces.length),ef("edges",e.relationships.length);let r=e.namespaces.map(e=>({namespace:e,depth:1})),n=new Set;for(;r.length;){let{namespace:e,depth:s}=r.pop();if(n.has(e))throw TypeError("Class namespaces must form a tree without repeated namespace objects");for(let i of(n.add(e),ef("nesting",s),ef("nodes",++t+r.length+e.children.length),e.children))r.push({namespace:i,depth:s+1})}}function em(e){ew(e.entities.length,e.relationships.length,e.groups,"ER")}function eb(e){ew(e.services.length+e.junctions.length,e.edges.length,e.groups,"Architecture")}function ev(e){ew(e.elements.length,e.relationships.length+e.layout.hints.length,e.boundaries,"C4");let t=new Set(e.boundaries.map(e=>e.id)),r=new Set(t);for(let t of e.elements){if(r.has(t.id))throw TypeError(`C4 elements and boundaries must have distinct identities: ${t.id}`);r.add(t.id)}for(let r of[...e.elements,...e.boundaries])if(void 0!==r.parentId&&!t.has(r.parentId))throw TypeError(`C4 ${r.id} has no boundary parent ${r.parentId}`)}function ew(e,t,r,n){ef("nodes",e+r.length),ef("edges",t);let s=new Map(r.map(e=>[e.id,e]));if(s.size!==r.length)throw TypeError(`${n} groups must have distinct identities`);let i=new Map;for(let e of r){let t=[],r=new Set,o=e;for(;o&&!i.has(o.id);){if(r.has(o.id))throw TypeError(`${n} groups must form an acyclic hierarchy`);r.add(o.id),t.push(o.id),ef("nesting",t.length),o=void 0===o.parentId?void 0:s.get(o.parentId)}let a=o?i.get(o.id):0;for(let e of t.reverse())ef("nesting",++a),i.set(e,a)}}function ey(e){let t=new Map;for(let[r,n]of e)t.delete(r),t.set(r,n);return Object.fromEntries(t)}function ex(...e){let t=new Map;for(let r of e)for(let[e,n]of Object.entries(r??{}))t.delete(e),t.set(e,n);return Object.fromEntries(t)}function e$(e,t={}){return ey(function(e,t={}){let r=e.replace(/;\s*$/,""),n=[];for(let e of function(e){let t=[],r=0,n=0,s=!1,i="";for(let o=0;o<e.length;o++){let a=e[o];if(s){s=!1;continue}if("\\"===a){s=!0;continue}if(i){a===i&&(i="");continue}if('"'===a||"'"===a){i=a;continue}"("===a?r++:")"===a?r=Math.max(0,r-1):(","===a||";"===a)&&0===r&&(t.push(e.slice(n,o)),n=o+1)}return t.push(e.slice(n)),t.map(e=>e.replace(/\\,/g,","))}(r)){let r=e.indexOf(":");if(r<=0)continue;let s=e.slice(0,r).trim(),i=t.caseInsensitive?s.toLowerCase():s,o=e.slice(r+1).trim();i&&o&&n.push([i,o])}return n}(e,t))}var eO=["fill","stroke","color"],ej=class extends Error{code="INVALID_STYLE_COLOR";subject;property;value;constructor(e,r,n,s){super(J({what:`${e}: ${r} ${JSON.stringify(n)} is not a CSS color`,expectedForm:t("color"!==r),example:`${s?`${s} `:""}${r}:#f96`}).message),this.name="AuthoredStyleColorError",this.subject=e,this.property=r,this.value=n}};function eS(t,r){let n=t&&function(t){for(let r of eO){let n=t[r];if(void 0!==n&&void 0===e(n,"color"!==r))return{property:r,value:n}}}(t);if(n)throw new ej(r,n.property,n.value,r);return t}function eI(e){for(let[t,r]of e.classDefs)eS(r,`classDef ${t}`);for(let[t,r]of e.nodeStyles)eS(r,`style ${t}`);for(let[t,r]of e.linkStyles)eS(r,`linkStyle ${t}`)}function ek(e,t){for(let[t,r]of e)eS(r,`classDef ${t}`);for(let e of t)eS(e.inlineStyle,`style ${e.id}`)}function eC(e){return e?.split(/\s+/).filter(Boolean)??[]}function eA(e,t,r){let n=e.get(t);e.set(t,n?`${n} ${r}`:r)}var ez={default:{bg:n.bg,fg:n.fg},base:{bg:n.bg,fg:n.fg},neutral:{bg:"#ffffff",fg:"#1f2937",line:"#9ca3af",accent:"#6b7280",muted:"#6b7280"},dark:{bg:"#18181B",fg:"#FAFAFA"},forest:{bg:"#f0fdf4",fg:"#14532d",line:"#4d7c0f",accent:"#15803d",muted:"#65a30d",border:"#86efac"}},eT={bg:["background","mainBkg"],fg:["primaryTextColor","textColor","nodeTextColor"],line:["lineColor","defaultLinkColor"],accent:["arrowheadColor","primaryColor"],muted:["secondaryTextColor","tertiaryTextColor"],surface:["primaryColor","nodeBkg","mainBkg"],border:["primaryBorderColor","secondaryBorderColor"]};function eE(e,t,s,i=!1){let o=function(e){if(!("string"!=typeof e||!e))return ez[e.toLowerCase()]}(t.theme),a=t.themeVariables,l=(...e)=>{let t=eM(a,...e);return i?t:r(t)};return{bg:e.bg??l(...eT.bg)??o?.bg??n.bg,fg:e.fg??l(...eT.fg)??o?.fg??n.fg,line:e.line??l(...eT.line)??o?.line,accent:e.accent??l(...eT.accent)??o?.accent,muted:e.muted??l(...eT.muted)??o?.muted,surface:e.surface??l(...eT.surface)??o?.surface,border:e.border??l(...eT.border)??o?.border,shadow:e.shadow??o?.shadow,font:s,embedFontImport:e.embedFontImport}}function eM(e,...t){if(e)for(let r of t){let t=e[r];if("string"==typeof t&&t.length>0)return t}}function eD(e,t){let r;for(let n of eC(t.classAssignments.get(e))){let e=eS(t.classDefs.get(n),`classDef ${n}`);e&&(r={...r,...e})}let n=eS(t.nodeStyles.get(e),`style ${e}`);return n&&(r=r?{...r,...n}:{...n}),r}function eF(e,t){let r;for(let n of eC(t.classAssignments.get(e))){let e=eS(t.classDefs.get(n),`classDef ${n}`);e&&(r={...r,...e})}return r}function eR(e,t){let r,n=t.edges[e]?.id;for(let e of eC(n?t.classAssignments.get(n):void 0)){let n=eS(t.classDefs.get(e),`classDef ${e}`);n&&(r={...r,...n})}let s=eS(t.linkStyles.get("default"),"linkStyle default");s&&(r=r?{...r,...s}:{...s});let i=eS(t.linkStyles.get(e),`linkStyle ${e}`);return i&&(r=r?{...r,...i}:{...i}),r}function eN(e){let t,r=((t=l(e))?{r:t[0],g:t[1],b:t[2]}:null)??function(e){let t=e.match(/^rgba?\(\s*(\d{1,3})(?:\s*,\s*|\s+)(\d{1,3})(?:\s*,\s*|\s+)(\d{1,3})/i);if(!t)return null;let r={r:Number.parseInt(t[1],10),g:Number.parseInt(t[2],10),b:Number.parseInt(t[3],10)};return Object.values(r).every(e=>e>=0&&e<=255)?r:null}(e);if(!r)return;let n=f(`rgb(${r.r}, ${r.g}, ${r.b})`);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#FFFFFF"}function eB(e,t="var(--_text)"){return e?.color?e.color:e?.fill?eN(e.fill)??t:t}var eL=new Set(["var(--_text)","var(--_text-sec)","var(--_text-muted)","var(--_text-faint)"]);function e_(e,t,r){if(!eL.has(e))return e;let n=s(e,r),o=s(t,r),a=n&&o?i(o,s("var(--bg)",r)??"#ffffff"):null;if(!a)return e;let l="var(--_text-faint)"===e?d:u,f=h(n,c(...a),l);return f===n?e:f}function eq(e,t,r){let n=e?.color;if(n)return()=>n;if(!e?.fill)return void 0===r?e=>e:e=>e_(e,r,t);let o=i(e.fill,s("var(--bg)",t)??"#ffffff");if(!o)return e=>e;let a=c(...o);return e=>{let r=s(e,t);return r?h(r,a):eN(a)??e}}function eW(e){let t=new Map,r=new Map;return(n,s,i=!1)=>{let o=i?r:t,a=o.get(s),l=a?.get(n);if(void 0!==l)return l;let c=i?eq({fill:s},e,s)(n):e_(n,s,e);return a||o.set(s,a=new Map),a.set(n,c),c}}async function eY(){p??=await import("./mermaid-yaml-runtime-IK4ET4BT.js")}function eJ(){if(!p)throw new a("YAML",eY);return p}function eG(e){return eJ().parseMermaidYaml(e)}function eK(e){return eJ().parseDirectiveYaml(e)}function eP(e){return eJ().readYamlMappingRanges(e)}var eU=Object.freeze({contrast:Object.freeze({properties:Object.freeze({role:Object.freeze({kind:"role"}),minimum:Object.freeze({kind:"number",minimum:1,maximum:21})}),recovery:"Choose an authored text/surface pair that meets the requested ratio, or remove the rule; the renderer will not repaint it."}),"accent-area":Object.freeze({properties:Object.freeze({maxFraction:Object.freeze({kind:"number",minimum:0,maximum:1,required:!0})}),recovery:"Reduce authored accent-filled area or raise the declared maximum; the renderer will not rewrite fills."}),"mono-role":Object.freeze({properties:Object.freeze({role:Object.freeze({kind:"role",required:!0})}),recovery:"Use measurable monochrome paint for the named role or remove the rule; the renderer will not rewrite paint."})}),eV=Object.freeze(Object.keys(eU));function eX(e){return eU[e].properties}function eH(e){return Object.freeze(["kind","action",...Object.keys(eU[e].properties)])}function eQ(e){return Object.freeze(["kind","action",...Object.entries(eX(e)).filter(([,e])=>!0===e.required).map(([e])=>e)])}var eZ=Object.freeze({warn:Object.freeze({code:"BRAND_CONSTRAINT_WARNING",severity:"warning",tier:"lint"}),error:Object.freeze({code:"BRAND_CONSTRAINT_ERROR",severity:"error",tier:"lint"})});export{b as a,v as b,y as c,x as d,$ as e,O as f,j as g,I as h,k as i,C as j,z as k,F as l,R as m,N as n,_ as o,q as p,W as q,Y as r,J as s,G as t,K as u,P as v,U as w,H as x,Q as y,Z as z,ee as A,et as B,er as C,en as D,es as E,ei as F,ea as G,eG as H,eK as I,eP as J,el as K,ec as L,ef as M,eu as N,ed as O,eh as P,eg as Q,ep as R,em as S,eb as T,ev as U,eV as V,eX as W,eH as X,eQ as Y,eZ as Z,ey as _,ex as $,e$ as aa,ej as ba,eS as ca,eI as da,ek as ea,eA as fa,eT as ga,eE as ha,eM as ia,eD as ja,eF as ka,eR as la,eN as ma,eB as na,e_ as oa,eq as pa,eW as qa};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{i as t,j as e,k as o}from"./chunk-
|
|
1
|
+
import{i as t,j as e,k as o}from"./chunk-3JTYTXA6.js";function h(h,n,i,r,s,a){let d=r.font??"Inter",p=t(r);return{family:n,width:i.width,height:i.height,colors:r,transparent:s,parts:[h.documentOpen({id:"prelude",width:i.width,height:i.height,colors:r,transparent:s,font:d,hasMonoFont:!1},`${o(i.width,i.height,r,s)}
|
|
2
2
|
${e(d,!1,r.shadow,r.embedFontImport)}${p?`
|
|
3
3
|
<defs>${p}</defs>`:""}`),...a,h.documentClose()]}}export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,h as t,i as r,k as a,s as n}from"./chunk-
|
|
1
|
+
import{g as e,h as t,i as r,k as a,s as n}from"./chunk-G4JBA7HU.js";async function o(){let e=await import("./decode-5MFOG3AZ.js"),t=e.decodeHTML?e:e.default;i??=t.decodeHTML,s??=t.decodeHTMLStrict}var i,s,c=class extends Error{loadHtmlEntityTable;constructor(e,t){super(`${e} needs the HTML entity table, which has not loaded`),this.loadHtmlEntityTable=t}};function d(e){if(!i)throw new c(e,o);return i(e)}function l(e){let t=`&${e};`;if(!s)throw new c(t,o);return s(t)!==t}var u=new TextDecoder("windows-1252"),f={subject:"Mermaid entity",example:"#35;"};function h(a,o=f){return a.replace(t,(t,a,i)=>{let s;if(void 0!==a){let e=Number(a);s=0===e||e>1114111||e>=55296&&e<=57343?"�":e>=128&&e<=159?u.decode(Uint8Array.of(e)):String.fromCodePoint(e)}else s=r.get(i)??d(`&${i};`);if(e.test(s))throw n({what:`${o.subject} projects a terminal control character`,expectedForm:"an entity that displays printable text",example:o.example});return s})}function m(e,t=f){return h(a(e),t)}export{d as a,l as b,h as c,m as d};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,c as t}from"./chunk-
|
|
2
|
-
`+k(N,!1,
|
|
3
|
-
`))),j.title&&H.push(p.text(w(j.title,P))),A?.surfaces===!1?[]:j.groups))H.push(function e(t,r,o,i,n){if(r.concurrencyRegion)return t.group({id:`group:${r.id}`,role:"group",open:`<g class="concurrency-region" data-id="${C(r.id)}"${n?` data-parent-id="${C(n)}"`:""}>`,close:"</g>",children:r.children.map(n=>({indent:0,node:e(t,n,o,i,r.id)}))});let a=r.labelBlock??d(S(r.label,r.labelContent),i,"group"),l=r.headerHeight??i.groupHeaderFontSize+16+a.height-a.lineHeight,s=[],h=`<g class="subgraph" data-id="${C(r.id)}" data-region="subgraph" data-label="${M(r.label)}"${n?` data-parent-id="${C(n)}"`:""}>`,c=r.inlineStyle,p=c?.fill??i.groupFillColor??"var(--_group-fill)",g=c?.stroke??i.groupBorderColor??"var(--_node-stroke)",u=c?.["stroke-width"]??String(i.groupLineWidth);s.push({indent:2,node:t.shape({id:`group-rect:${r.id}`,role:"group",geometry:{kind:"rect",x:r.x,y:r.y,width:r.width,height:r.height,rx:i.groupCornerRadius,ry:i.groupCornerRadius},paint:{fill:p,stroke:g,strokeWidth:u}})});let f=i.groupHeaderFillColor??"var(--_group-hdr)",k=_(r.x,r.y,r.width,l,i.groupCornerRadius);s.push({indent:2,node:t.shape({id:`group-header:${r.id}`,role:"group-header",geometry:{kind:"path",d:k},paint:{fill:f,stroke:g,strokeWidth:u}})});let m=a.text,y=c?.color??i.groupTextColor??"var(--_text-sec)";for(let e of(s.push({indent:2,node:t.text({id:`group-label:${r.id}`,role:"group-header",text:m,block:a,x:r.x+i.groupLabelPaddingX,y:r.y+l/2,fontSize:i.groupHeaderFontSize,anchor:"start",paint:{fill:y}})}),function(e,t){let r=e.children.filter(e=>e.concurrencyRegion);if(r.length<2)return[];let o=e=>Math.max(...r.map(e))-Math.min(...r.map(e)),i=o(e=>e.x+e.width/2)>=o(e=>e.y+e.height/2),n=[...r].sort((e,t)=>i?e.x-t.x:e.y-t.y),a=[];for(let r=1;r<n.length;r++){let o=n[r-1],l=n[r];if(i){let i=(o.x+o.width+l.x)/2;a.push({index:r-1,x1:i,y1:e.y+t+4,x2:i,y2:e.y+e.height-4})}else{let t=(o.y+o.height+l.y)/2;a.push({index:r-1,x1:e.x+4,y1:t,x2:e.x+e.width-4,y2:t})}}return a}(r,l)))s.push({indent:2,node:t.shape({id:`region-separator:${r.id}:${e.index}`,role:"group",geometry:{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},paint:{stroke:g,strokeWidth:String(i.groupLineWidth),strokeDasharray:"6 4"},attributes:{className:"region-separator"}})});for(let n of r.children)s.push({indent:0,node:e(t,n,o,i,r.id)});return t.group({id:`group:${r.id}`,role:"group",open:h,close:"</g>",children:s})}(p,e,N,P));A?.beforeEdges&&H.push(...A.beforeEdges());let Y=new Set(j.nodes.map(e=>e.id)),J=e=>e.forEach(e=>{Y.add(e.id),J(e.children)});J(j.groups);let K=new Map,Q=new Map;for(let e of j.edges){if(e.points.length<2)continue;let t=`${e.source}->${e.target}`,r=K.get(t)??0;K.set(t,r+1);let a=`edge:${t}#${r}`;Q.set(e,a);let l=void 0===e.id||Y.has(e.id)?a:e.id;H.push(function(e,t,r,a,l,d){let s="dotted"===t.style?"dotted":"thick"===t.style?"thick":"invisible"===t.style?"invisible":"solid",h=L(a),p=t.labelPosition??c(t.points),g=r.edgeTextColor??"var(--_text-sec)",u=t.label?[{id:`${a}:label`,text:t.label,textContent:{value:t.label,prepared:v(S(t.label,t.labelContent))},anchor:p,paint:{fill:g},fontSize:r.edgeLabelFontSize,textAnchor:"middle",visual:{kind:"companion",markId:`${h}:text`}}]:[],f=(t.classNames??[]).map(e=>e.replace(/[^A-Za-z0-9_-]/g,"")).filter(Boolean),k={identity:{id:l,...f.length?{classNames:f}:{}},endpoints:{from:t.source,to:t.target},relationship:{kind:"flowchart-edge",direction:t.source===t.target?"self":t.hasArrowStart&&t.hasArrowEnd?"bidirectional":t.hasArrowStart?"reverse":t.hasArrowEnd?"forward":"undirected"},route:{ownership:"layout",bendRadius:r.edgeBendRadius,labelAnchors:t.labelPosition?[t.labelPosition]:[]},labels:u};if("invisible"===t.style)return e.connector({id:a,role:"edge",geometry:{kind:"polyline",points:t.points},lineStyle:"invisible",paint:{},...k});let m=n(t,r),y="dotted"===t.style?`${$.dash} ${$.gap}`:t.animate?"8 4":void 0,x="thick"===t.style?2*r.lineWidth:r.lineWidth,b=t.inlineStyle?.stroke??r.edgeStrokeColor,w=`${b?`-${i(b)}`:""}${t.inlineStyle?.["stroke-width"]?"-fixed":""}`,C,M;if(t.hasArrowEnd){let e=o(t.endMarker??"arrow");if(!(C=d.find(t=>t.id===`${e}${w}`)))throw Error(`Missing marker resource "${e}${w}"`)}if(t.hasArrowStart){let e=o(t.startMarker??"arrow");if(!(M=d.find(t=>t.id===`${e}-start${w}`)))throw Error(`Missing marker resource "${e}-start${w}"`)}let _={className:["edge",...f].join(" "),data:{style:t.style,"arrow-start":String(t.hasArrowStart),"arrow-end":String(t.hasArrowEnd),...t.hasArrowStart?{"marker-start":t.startMarker??"arrow"}:{},...t.hasArrowEnd?{"marker-end":t.endMarker??"arrow"}:{},...t.label?{label:W(t.label)}:{},...t.curve?{curve:t.curve}:{},...t.animate?{animate:"true",animation:t.animation??"slow"}:{}}},F={stroke:b??"var(--_line)",strokeWidth:t.inlineStyle?.["stroke-width"]??String(x),...y?{strokeDasharray:y}:{}};if(r.edgeBendRadius>0||t.curve){if(!m)throw Error(`Missing path projection for flowchart edge "${a}"`);return e.connector({id:a,role:"edge",geometry:m.geometry,lineStyle:s,paint:F,markers:{...M?{start:M}:{},mid:[],...C?{end:C}:{}},...k,route:{...k.route,contours:m.contours},attributes:_})}return e.connector({id:a,role:"edge",geometry:{kind:"polyline",points:t.points},lineStyle:s,paint:F,markers:{...M?{start:M}:{},mid:[],...C?{end:C}:{}},...k,attributes:_})}(p,e,P,a,l,V))}for(let e of j.edges){let t=Q.get(e);A?.edgeLabels!==!1&&e.label&&t&&H.push(function(e,t,r,o,i){let n=t.labelPosition??c(t.points),a=t.labelBlock??d(S(t.label,t.labelContent),o,"edge"),l=a.text,p=s+h(t,o.lineWidth),g=a.width+2*p,u=a.height+2*p,f=n.x-g/2,k=n.y-u/2,m=e.shape({id:`${i}:halo`,role:"chrome",geometry:{kind:"rect",x:f,y:k,width:g,height:u,rx:4,ry:4},paint:{fill:"var(--bg)",stroke:"none"},attributes:{className:"edge-label-halo"}}),y=a.width+2*s,x=a.height+2*s,$=e.shape({id:`${i}:pill`,role:"chrome",geometry:{kind:"rect",x:n.x-y/2,y:n.y-x/2,width:y,height:x,rx:2,ry:2},paint:{fill:"var(--bg)",stroke:"var(--_inner-stroke)",strokeWidth:"1"}}),b=o.edgeTextColor??"var(--_text-sec)",w=e.text({id:`${i}:text`,role:"label",text:l,block:a,x:n.x,y:n.y,fontSize:o.edgeLabelFontSize,anchor:"middle",paint:{fill:b}});return e.group({id:i,role:"edge-label",open:`<g class="edge-label" data-from="${C(t.source)}" data-to="${C(t.target)}" data-label="${M(t.label)}">`,close:"</g>",children:[{indent:2,node:m},{indent:2,node:$},{indent:2,node:w}]})}(p,e,0,P,L(t)))}for(let r of A?.surfaces===!1?[]:j.nodes)H.push(function(r,o,i,n,s,h){let c=function(e,t,r){let{x:o,y:i,width:n,height:l,shape:d,inlineStyle:s}=t,h=a(t,{fill:s?.fill??r.nodeFillColor??"var(--_node-fill)",stroke:s?.stroke??r.nodeBorderColor??"var(--_node-stroke)",strokeWidth:s?.["stroke-width"]??String(r.nodeLineWidth)},r.cornerRadius);return e.shape({id:`node-shape:${t.id}`,role:"state-note"===t.shape?"note":"node",geometry:h.geometry,paint:h.paint,...h.childPaints?{childPaints:h.childPaints}:{}})}(r,o,n),p=function(e,t,r){let o=t.nodeTextColor??(e.inlineStyle?.fill||!l(e)?"var(--_text)":u("var(--_text)",t.nodeFillColor??"var(--_node-fill)",r));return g(e.inlineStyle,o)}(o,n,s),f=function(e,t,r,o,i){if(("state-start"===t.shape||"state-end"===t.shape||"state-fork"===t.shape||"state-join"===t.shape||"state-choice"===t.shape)&&!t.label)return null;let n=t.x+t.width/2,a=t.y+t.height/2,l=t.labelBlock??d(S(t.label,t.labelContent),o,"node"),s=l.text;return e.text({id:`node-label:${t.id}`,role:"label",text:s,block:l,x:n,y:a,fontSize:o.nodeLabelFontSize,anchor:"middle",paint:{fill:i}})}(r,o,0,n,p),k=(o.classNames??[]).map(e=>e.replace(/[^A-Za-z0-9_-]/g,"")).filter(Boolean),m=["node",..."state-note"===o.shape?["state-note"]:[],...k].join(" "),y="state-start"===o.shape?{status:"start"}:"state-end"===o.shape?{status:"end"}:void 0,x=[{indent:2,node:c}],$=function(r,o,i){let n=Math.min(28,.4*o.height),a=o.x+o.width/2,l=o.y+6;if(o.icon){let d=t(o.icon);if(d){let e=n/24;return r.pathArtwork({id:`node:${o.id}:icon`,paths:d.paths,owner:{id:o.id,role:"node"},open:`<g class="flowchart-icon" data-icon="${C(o.icon)}" transform="translate(${a-n/2} ${l}) scale(${e})">`,transform:{kind:"matrix",a:e,b:0,c:0,d:e,e:a-n/2,f:l},paint:{fill:i,stroke:i,strokeWidth:"0.8"}})}let s=e(o.icon);return r.text({id:`node:${o.id}:icon`,role:"icon",owner:{id:o.id,role:"node"},text:s,block:o.iconFallbackBlock,x:a,y:l+n/2,fontSize:10,anchor:"middle",paint:{fill:i},baselineShift:0,attributes:{className:"flowchart-icon-fallback",data:{icon:o.icon}}})}if(o.image){let e=a-n/2,t=`M${e+2} ${l+.66*n}L${e+.36*n} ${l+.36*n}L${e+.52*n} ${l+.5*n}L${e+.7*n} ${l+.32*n}L${e+n-2} ${l+.66*n}`,d={fill:"none",stroke:i,strokeWidth:"1.2"},s={id:o.id,role:"node"};return r.group({id:`node:${o.id}:image`,role:"icon",owner:s,open:`<g class="flowchart-image-placeholder" data-image-src="${C(o.image)}">`,close:"</g>",join:"",children:[{indent:0,node:r.shape({id:`node:${o.id}:image:frame`,role:"icon",owner:s,geometry:{kind:"rect",x:e,y:l,width:n,height:.72*n,rx:2},paint:d})},{indent:0,node:r.shape({id:`node:${o.id}:image:sun`,role:"icon",owner:s,geometry:{kind:"circle",cx:e+.72*n,cy:l+.2*n,r:.08*n},paint:d})},{indent:0,node:r.shape({id:`node:${o.id}:image:landscape`,role:"icon",owner:s,geometry:{kind:"path",d:t},paint:d})}]})}return null}(r,o,p);$&&x.push({indent:2,node:$}),f&&x.push({indent:2,node:f});let b=o.semanticShape?` data-semantic-shape="${C(o.semanticShape)}"`:"",w=h&&o.href?` data-href="${C(o.href)}" role="link" tabindex="0"`:"",v=void 0===o.floatingNoteId?"":` data-floating-note-id="${C(o.floatingNoteId)}"`;return r.group({id:`node:${o.id}`,role:"state-note"===o.shape?"note":"node",open:`<g class="${m}" data-id="${C(o.id)}" data-label="${M(o.label)}" data-shape="${o.shape}"${b}${w}${v}>`,close:"</g>",children:x,channels:y})}(p,r,0,P,z,"strict"!==E.security));for(let e of j.notes??[])H.push(function(e,t,r,o){let{x:i,y:n,width:a,height:l}=t,s=o.groupHeaderFillColor??"var(--_group-hdr)",h=o.groupBorderColor??"var(--_node-stroke)",c=o.edgeTextColor??"var(--_text-sec)",p=t.textBlock??d(S(t.text,t.textContent),o,"note"),g=p.text,u=`state-note:${t.id}`;return e.group({id:u,role:"note",open:`<g class="state-note" data-id="${C(t.id)}" data-target="${C(t.target)}" data-side="${t.side}">`,close:"</g>",children:[{indent:2,node:e.shape({id:`${u}:rect`,role:"note",geometry:{kind:"rect",x:i,y:n,width:a,height:l,rx:4,ry:4},paint:{fill:s,stroke:h,strokeWidth:String(x.innerBox)}})},{indent:2,node:e.text({id:`${u}:text`,role:"label",text:g,block:p,x:i+a/2,y:n+l/2,fontSize:o.edgeLabelFontSize,anchor:"middle",paint:{fill:c}})}]})}(p,e,0,P));return H.push(p.documentClose()),{family:"flowchart",width:j.width,height:j.height,colors:z,transparent:R,parts:H}}function L(e){return e.startsWith("edge:")?`edge-label:${e.slice(5)}`:`${e}:label`}var A=p(F);export{F as a,A as b};
|
|
1
|
+
import{a as e,c as t}from"./chunk-MFTQWHUB.js";import{d as r,e as o,f as i,h as n,m as a,p as l}from"./chunk-NKW2ZNCD.js";import{b as d,c as s,d as h}from"./chunk-PXTLV57R.js";import{o as c}from"./chunk-QVSZOF5M.js";import{c as p,na as g,oa as u}from"./chunk-G4JBA7HU.js";import{i as f,j as k,k as m,u as y}from"./chunk-3JTYTXA6.js";import{c as x,e as $,h as b,o as w}from"./chunk-YVNJDVQO.js";import{C as S,G as v,N as C,O as M,a as A,tb as F}from"./chunk-EIYLJ4FI.js";function W(p,W,B){let{positioned:L,colors:j,resolved:z}=W,E=z.renderOptions,N=j.font??"Inter",R=E.transparent??!1,P=[],T=z.familyAppearance?.visual??E.stateVisual,H=b(E,T?.styleDefaults,z.styleFace);P.push(p.documentOpen({id:"prelude",width:L.width,height:L.height,colors:j,transparent:R,font:N,hasMonoFont:!1},m(L.width,L.height,j,R)+`
|
|
2
|
+
`+k(N,!1,j.shadow,j.embedFontImport)));let I=[];I.push("<defs>");let D=f(j);D&&I.push(D);let O=new Set,V=new Set;H.edgeStrokeColor&&O.add(H.edgeStrokeColor);let J=!1,Z=!1;for(let e of L.edges)e.inlineStyle?.stroke&&O.add(e.inlineStyle.stroke),e.inlineStyle?.["stroke-width"]&&V.add(e.inlineStyle.stroke??H.edgeStrokeColor),("circle"===e.startMarker||"circle"===e.endMarker)&&(J=!0),("cross"===e.startMarker||"cross"===e.endMarker)&&(Z=!0);let Q=r(O,V,J,Z);for(let e of(I.splice(1,0,y(Q)),I.push("</defs>"),P.push(p.definitions({id:"defs",markerResources:Q},I.join(`
|
|
3
|
+
`))),L.title&&P.push(p.text(w(L.title,H))),B?.surfaces===!1?[]:L.groups))P.push(function e(t,r,o,i,n){if(r.concurrencyRegion)return t.group({id:`group:${r.id}`,role:"group",open:`<g class="concurrency-region" data-id="${C(r.id)}"${n?` data-parent-id="${C(n)}"`:""}>`,close:"</g>",children:r.children.map(n=>({indent:0,node:e(t,n,o,i,r.id)}))});let a=r.labelBlock??d(S(r.label,r.labelContent),i,"group"),l=r.headerHeight??i.groupHeaderFontSize+16+a.height-a.lineHeight,s=[],h=`<g class="subgraph" data-id="${C(r.id)}" data-region="subgraph" data-label="${M(r.label)}"${n?` data-parent-id="${C(n)}"`:""}>`,c=r.inlineStyle,p=c?.fill??i.groupFillColor??"var(--_group-fill)",g=c?.stroke??i.groupBorderColor??"var(--_node-stroke)",u=c?.["stroke-width"]??String(i.groupLineWidth);s.push({indent:2,node:t.shape({id:`group-rect:${r.id}`,role:"group",geometry:{kind:"rect",x:r.x,y:r.y,width:r.width,height:r.height,rx:i.groupCornerRadius,ry:i.groupCornerRadius},paint:{fill:p,stroke:g,strokeWidth:u}})});let f=i.groupHeaderFillColor??"var(--_group-hdr)",k=F(r.x,r.y,r.width,l,i.groupCornerRadius);s.push({indent:2,node:t.shape({id:`group-header:${r.id}`,role:"group-header",geometry:{kind:"path",d:k},paint:{fill:f,stroke:g,strokeWidth:u}})});let m=a.text,y=c?.color??i.groupTextColor??"var(--_text-sec)";for(let e of(s.push({indent:2,node:t.text({id:`group-label:${r.id}`,role:"group-header",text:m,block:a,x:r.x+i.groupLabelPaddingX,y:r.y+l/2,fontSize:i.groupHeaderFontSize,anchor:"start",paint:{fill:y}})}),function(e,t){let r=e.children.filter(e=>e.concurrencyRegion);if(r.length<2)return[];let o=e=>Math.max(...r.map(e))-Math.min(...r.map(e)),i=o(e=>e.x+e.width/2)>=o(e=>e.y+e.height/2),n=[...r].sort((e,t)=>i?e.x-t.x:e.y-t.y),a=[];for(let r=1;r<n.length;r++){let o=n[r-1],l=n[r];if(i){let i=(o.x+o.width+l.x)/2;a.push({index:r-1,x1:i,y1:e.y+t+4,x2:i,y2:e.y+e.height-4})}else{let t=(o.y+o.height+l.y)/2;a.push({index:r-1,x1:e.x+4,y1:t,x2:e.x+e.width-4,y2:t})}}return a}(r,l)))s.push({indent:2,node:t.shape({id:`region-separator:${r.id}:${e.index}`,role:"group",geometry:{kind:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},paint:{stroke:g,strokeWidth:String(i.groupLineWidth),strokeDasharray:"6 4"},attributes:{className:"region-separator"}})});for(let n of r.children)s.push({indent:0,node:e(t,n,o,i,r.id)});return t.group({id:`group:${r.id}`,role:"group",open:h,close:"</g>",children:s})}(p,e,N,H));B?.beforeEdges&&P.push(...B.beforeEdges());let X=new Set(L.nodes.map(e=>e.id)),Y=e=>e.forEach(e=>{X.add(e.id),Y(e.children)});Y(L.groups);let G=new Map,U=new Map;for(let e of L.edges){if(e.points.length<2)continue;let t=`${e.source}->${e.target}`,r=G.get(t)??0;G.set(t,r+1);let a=`edge:${t}#${r}`;U.set(e,a);let l=void 0===e.id||X.has(e.id)?a:e.id;P.push(function(e,t,r,a,l,d){let s="dotted"===t.style?"dotted":"thick"===t.style?"thick":"invisible"===t.style?"invisible":"solid",h=_(a),p=t.labelPosition??c(t.points),g=r.edgeTextColor??"var(--_text-sec)",u=t.label?[{id:`${a}:label`,text:t.label,textContent:{value:t.label,prepared:v(S(t.label,t.labelContent))},anchor:p,paint:{fill:g},fontSize:r.edgeLabelFontSize,textAnchor:"middle",visual:{kind:"companion",markId:`${h}:text`}}]:[],f=(t.classNames??[]).map(e=>e.replace(/[^A-Za-z0-9_-]/g,"")).filter(Boolean),k={identity:{id:l,...f.length?{classNames:f}:{}},endpoints:{from:t.source,to:t.target},relationship:{kind:"flowchart-edge",direction:t.source===t.target?"self":t.hasArrowStart&&t.hasArrowEnd?"bidirectional":t.hasArrowStart?"reverse":t.hasArrowEnd?"forward":"undirected"},route:{ownership:"layout",bendRadius:r.edgeBendRadius,labelAnchors:t.labelPosition?[t.labelPosition]:[]},labels:u};if("invisible"===t.style)return e.connector({id:a,role:"edge",geometry:{kind:"polyline",points:t.points},lineStyle:"invisible",paint:{},...k});let m=n(t,r),y="dotted"===t.style?`${$.dash} ${$.gap}`:t.animate?"8 4":void 0,x="thick"===t.style?2*r.lineWidth:r.lineWidth,b=t.inlineStyle?.stroke??r.edgeStrokeColor,w=`${b?`-${i(b)}`:""}${t.inlineStyle?.["stroke-width"]?"-fixed":""}`,C,M;if(t.hasArrowEnd){let e=o(t.endMarker??"arrow");if(!(C=d.find(t=>t.id===`${e}${w}`)))throw Error(`Missing marker resource "${e}${w}"`)}if(t.hasArrowStart){let e=o(t.startMarker??"arrow");if(!(M=d.find(t=>t.id===`${e}-start${w}`)))throw Error(`Missing marker resource "${e}-start${w}"`)}let F={className:["edge",...f].join(" "),data:{style:t.style,"arrow-start":String(t.hasArrowStart),"arrow-end":String(t.hasArrowEnd),...t.hasArrowStart?{"marker-start":t.startMarker??"arrow"}:{},...t.hasArrowEnd?{"marker-end":t.endMarker??"arrow"}:{},...t.label?{label:A(t.label)}:{},...t.curve?{curve:t.curve}:{},...t.animate?{animate:"true",animation:t.animation??"slow"}:{}}},W={stroke:b??"var(--_line)",strokeWidth:t.inlineStyle?.["stroke-width"]??String(x),...y?{strokeDasharray:y}:{}};if(r.edgeBendRadius>0||t.curve){if(!m)throw Error(`Missing path projection for flowchart edge "${a}"`);return e.connector({id:a,role:"edge",geometry:m.geometry,lineStyle:s,paint:W,markers:{...M?{start:M}:{},mid:[],...C?{end:C}:{}},...k,route:{...k.route,contours:m.contours},attributes:F})}return e.connector({id:a,role:"edge",geometry:{kind:"polyline",points:t.points},lineStyle:s,paint:W,markers:{...M?{start:M}:{},mid:[],...C?{end:C}:{}},...k,attributes:F})}(p,e,H,a,l,Q))}for(let e of L.edges){let t=U.get(e);B?.edgeLabels!==!1&&e.label&&t&&P.push(function(e,t,r,o,i){let n=t.labelPosition??c(t.points),a=t.labelBlock??d(S(t.label,t.labelContent),o,"edge"),l=a.text,p=s+h(t,o.lineWidth),g=a.width+2*p,u=a.height+2*p,f=n.x-g/2,k=n.y-u/2,m=e.shape({id:`${i}:halo`,role:"chrome",geometry:{kind:"rect",x:f,y:k,width:g,height:u,rx:4,ry:4},paint:{fill:"var(--bg)",stroke:"none"},attributes:{className:"edge-label-halo"}}),y=a.width+2*s,x=a.height+2*s,$=e.shape({id:`${i}:pill`,role:"chrome",geometry:{kind:"rect",x:n.x-y/2,y:n.y-x/2,width:y,height:x,rx:2,ry:2},paint:{fill:"var(--bg)",stroke:"var(--_inner-stroke)",strokeWidth:"1"}}),b=o.edgeTextColor??"var(--_text-sec)",w=e.text({id:`${i}:text`,role:"label",text:l,block:a,x:n.x,y:n.y,fontSize:o.edgeLabelFontSize,anchor:"middle",paint:{fill:b}});return e.group({id:i,role:"edge-label",open:`<g class="edge-label" data-from="${C(t.source)}" data-to="${C(t.target)}" data-label="${M(t.label)}">`,close:"</g>",children:[{indent:2,node:m},{indent:2,node:$},{indent:2,node:w}]})}(p,e,0,H,_(t)))}for(let r of B?.surfaces===!1?[]:L.nodes)P.push(function(r,o,i,n,s,h){let c=function(e,t,r){let{x:o,y:i,width:n,height:l,shape:d,inlineStyle:s}=t,h=a(t,{fill:s?.fill??r.nodeFillColor??"var(--_node-fill)",stroke:s?.stroke??r.nodeBorderColor??"var(--_node-stroke)",strokeWidth:s?.["stroke-width"]??String(r.nodeLineWidth)},r.cornerRadius);return e.shape({id:`node-shape:${t.id}`,role:"state-note"===t.shape?"note":"node",geometry:h.geometry,paint:h.paint,...h.childPaints?{childPaints:h.childPaints}:{}})}(r,o,n),p=function(e,t,r){let o=t.nodeTextColor??(e.inlineStyle?.fill||!l(e)?"var(--_text)":u("var(--_text)",t.nodeFillColor??"var(--_node-fill)",r));return g(e.inlineStyle,o)}(o,n,s),f=function(e,t,r,o,i){if(("state-start"===t.shape||"state-end"===t.shape||"state-fork"===t.shape||"state-join"===t.shape||"state-choice"===t.shape)&&!t.label)return null;let n=t.x+t.width/2,a=t.y+t.height/2,l=t.labelBlock??d(S(t.label,t.labelContent),o,"node"),s=l.text;return e.text({id:`node-label:${t.id}`,role:"label",text:s,block:l,x:n,y:a,fontSize:o.nodeLabelFontSize,anchor:"middle",paint:{fill:i}})}(r,o,0,n,p),k=(o.classNames??[]).map(e=>e.replace(/[^A-Za-z0-9_-]/g,"")).filter(Boolean),m=["node",..."state-note"===o.shape?["state-note"]:[],...k].join(" "),y="state-start"===o.shape?{status:"start"}:"state-end"===o.shape?{status:"end"}:void 0,x=[{indent:2,node:c}],$=function(r,o,i){let n=Math.min(28,.4*o.height),a=o.x+o.width/2,l=o.y+6;if(o.icon){let d=t(o.icon);if(d){let e=n/24;return r.pathArtwork({id:`node:${o.id}:icon`,paths:d.paths,owner:{id:o.id,role:"node"},open:`<g class="flowchart-icon" data-icon="${C(o.icon)}" transform="translate(${a-n/2} ${l}) scale(${e})">`,transform:{kind:"matrix",a:e,b:0,c:0,d:e,e:a-n/2,f:l},paint:{fill:i,stroke:i,strokeWidth:"0.8"}})}let s=e(o.icon);return r.text({id:`node:${o.id}:icon`,role:"icon",owner:{id:o.id,role:"node"},text:s,block:o.iconFallbackBlock,x:a,y:l+n/2,fontSize:10,anchor:"middle",paint:{fill:i},baselineShift:0,attributes:{className:"flowchart-icon-fallback",data:{icon:o.icon}}})}if(o.image){let e=a-n/2,t=`M${e+2} ${l+.66*n}L${e+.36*n} ${l+.36*n}L${e+.52*n} ${l+.5*n}L${e+.7*n} ${l+.32*n}L${e+n-2} ${l+.66*n}`,d={fill:"none",stroke:i,strokeWidth:"1.2"},s={id:o.id,role:"node"};return r.group({id:`node:${o.id}:image`,role:"icon",owner:s,open:`<g class="flowchart-image-placeholder" data-image-src="${C(o.image)}">`,close:"</g>",join:"",children:[{indent:0,node:r.shape({id:`node:${o.id}:image:frame`,role:"icon",owner:s,geometry:{kind:"rect",x:e,y:l,width:n,height:.72*n,rx:2},paint:d})},{indent:0,node:r.shape({id:`node:${o.id}:image:sun`,role:"icon",owner:s,geometry:{kind:"circle",cx:e+.72*n,cy:l+.2*n,r:.08*n},paint:d})},{indent:0,node:r.shape({id:`node:${o.id}:image:landscape`,role:"icon",owner:s,geometry:{kind:"path",d:t},paint:d})}]})}return null}(r,o,p);$&&x.push({indent:2,node:$}),f&&x.push({indent:2,node:f});let b=o.semanticShape?` data-semantic-shape="${C(o.semanticShape)}"`:"",w=h&&o.href?` data-href="${C(o.href)}" role="link" tabindex="0"`:"",v=void 0===o.floatingNoteId?"":` data-floating-note-id="${C(o.floatingNoteId)}"`;return r.group({id:`node:${o.id}`,role:"state-note"===o.shape?"note":"node",open:`<g class="${m}" data-id="${C(o.id)}" data-label="${M(o.label)}" data-shape="${o.shape}"${b}${w}${v}>`,close:"</g>",children:x,channels:y})}(p,r,0,H,j,"strict"!==E.security));for(let e of L.notes??[])P.push(function(e,t,r,o){let{x:i,y:n,width:a,height:l}=t,s=o.groupHeaderFillColor??"var(--_group-hdr)",h=o.groupBorderColor??"var(--_node-stroke)",c=o.edgeTextColor??"var(--_text-sec)",p=t.textBlock??d(S(t.text,t.textContent),o,"note"),g=p.text,u=`state-note:${t.id}`;return e.group({id:u,role:"note",open:`<g class="state-note" data-id="${C(t.id)}" data-target="${C(t.target)}" data-side="${t.side}">`,close:"</g>",children:[{indent:2,node:e.shape({id:`${u}:rect`,role:"note",geometry:{kind:"rect",x:i,y:n,width:a,height:l,rx:4,ry:4},paint:{fill:s,stroke:h,strokeWidth:String(x.innerBox)}})},{indent:2,node:e.text({id:`${u}:text`,role:"label",text:g,block:p,x:i+a/2,y:n+l/2,fontSize:o.edgeLabelFontSize,anchor:"middle",paint:{fill:c}})}]})}(p,e,0,H));return P.push(p.documentClose()),{family:"flowchart",width:L.width,height:L.height,colors:j,transparent:R,parts:P}}function _(e){return e.startsWith("edge:")?`edge-label:${e.slice(5)}`:`${e}:label`}var B=p(W);export{W as a,B as b};
|