@aiquants/markdown 11.8.2 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -41
- package/dist/{abnfDiagram-VRR7QNED-Bv6iQTPf.cjs → abnfDiagram-VRR7QNED-CBpBnfY2.cjs} +1 -1
- package/dist/{abnfDiagram-VRR7QNED-BVKLANg1.js → abnfDiagram-VRR7QNED-DfXbTqjh.js} +3 -3
- package/dist/{arc-C0_ZFMbn.js → arc-SwVEWxG-.js} +1 -1
- package/dist/{arc-XvdQv3_X.cjs → arc-i1LLtFAY.cjs} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-D4WEA8bR.js → architectureDiagram-ZJ3FMSHR-U_pWpndb.js} +2 -2
- package/dist/{architectureDiagram-ZJ3FMSHR-Ba2ARwzf.cjs → architectureDiagram-ZJ3FMSHR-mtDK4cwq.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-J9p7hRr-.cjs → blockDiagram-677ZJIJ3-09mZA62D.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-BI9MniQl.js → blockDiagram-677ZJIJ3-DaMXfbBZ.js} +3 -3
- package/dist/{c4Diagram-LMCZKHZV-C5yuw9y4.js → c4Diagram-LMCZKHZV-CLofA9zh.js} +2 -2
- package/dist/{c4Diagram-LMCZKHZV-B2vWx9OJ.cjs → c4Diagram-LMCZKHZV-DWjHOW7P.cjs} +1 -1
- package/dist/{channel-D4RNSR4m.cjs → channel-CQoj-afO.cjs} +1 -1
- package/dist/{channel-BuUKRvwz.js → channel-Dl2sOuEn.js} +1 -1
- package/dist/{chunk-2Q5K7J3B-Da82f-JV.cjs → chunk-2Q5K7J3B-CEUXgiDQ.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-mP7m0aTi.js → chunk-2Q5K7J3B-CKPbsraT.js} +1 -1
- package/dist/{chunk-32BRIVSS-QL8wikEz.cjs → chunk-32BRIVSS-BUpbARO6.cjs} +1 -1
- package/dist/{chunk-32BRIVSS-CY47jInE.js → chunk-32BRIVSS-CSloQ7s4.js} +1 -1
- package/dist/{chunk-5VM5RSS4-Dw1sZ2dK.cjs → chunk-5VM5RSS4-Bi4r4BMv.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-C2ibgWcT.js → chunk-5VM5RSS4-DnY6RxJd.js} +1 -1
- package/dist/{chunk-EX3LRPZG-CZYqHwqR.cjs → chunk-EX3LRPZG-Dj5dcbgv.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-DH1eP-Pi.js → chunk-EX3LRPZG-tOgHFiZ3.js} +4 -4
- package/dist/{chunk-JWPE2WC7-CI8vElJl.js → chunk-JWPE2WC7-Bhm6M6wC.js} +1 -1
- package/dist/{chunk-JWPE2WC7-8-O6I23F.cjs → chunk-JWPE2WC7-k67jLZJ7.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-CnalNinv.js → chunk-MOJQB5TN-9753BB9c.js} +1 -1
- package/dist/{chunk-MOJQB5TN-DSUj8oTw.cjs → chunk-MOJQB5TN-FdExe_-9.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-JOq1Wp-f.cjs → chunk-PUDLZKDR-D0K6eTN9.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-BonU-X-L.js → chunk-PUDLZKDR-D1FbiHYm.js} +6 -6
- package/dist/{chunk-RYQCIY6F-DuFhIn5O.cjs → chunk-RYQCIY6F-BTRnFcRY.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-4EL63XFL.js → chunk-RYQCIY6F-DDGOfO1d.js} +1 -1
- package/dist/{chunk-V7JOEXUC-Di_E9qbZ.cjs → chunk-V7JOEXUC-B_5ply0Z.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-BZ6cldra.js → chunk-V7JOEXUC-YddVyhzx.js} +5 -5
- package/dist/{chunk-VR4S4FIN-Dz0-pMsF.js → chunk-VR4S4FIN-DYEB0iUI.js} +1 -1
- package/dist/{chunk-VR4S4FIN-D-5k7LYg.cjs → chunk-VR4S4FIN-h3qCNGDA.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-B9ZdRyQ3.js → chunk-XXDRQBXY-CXTX2F5M.js} +1 -1
- package/dist/{chunk-XXDRQBXY-DBz3b8lw.cjs → chunk-XXDRQBXY-Dn3UHIR-.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-BitRXfny.cjs → classDiagram-OUVF2IWQ-BZRw3Il9.cjs} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-C3mqCNeB.js → classDiagram-OUVF2IWQ-Bygloau7.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-BitRXfny.cjs → classDiagram-v2-EOCWNBFH-BZRw3Il9.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-C3mqCNeB.js → classDiagram-v2-EOCWNBFH-Bygloau7.js} +2 -2
- package/dist/{code-blocks-UwfqjHr4.js → code-blocks-BWr5Xg1I.js} +108 -100
- package/dist/code-blocks-BdKjppKq.cjs +4 -0
- package/dist/code-blocks.cjs +1 -1
- package/dist/code-blocks.js +1 -1
- package/dist/components/SpreadsheetToolbar.d.ts +1 -0
- package/dist/components/blockFullscreen.d.ts +31 -0
- package/dist/components/fullscreenLabels.d.ts +4 -0
- package/dist/components/mermaidInteraction.d.ts +2 -2
- package/dist/components/mermaidLabels.d.ts +3 -0
- package/dist/components/svgImageLabels.d.ts +3 -0
- package/dist/components/svgRaster.d.ts +1 -0
- package/dist/converter.wasm +0 -0
- package/dist/{cose-bilkent-JH36ORCC-B04yjbiX.cjs → cose-bilkent-JH36ORCC-BeacL0Ew.cjs} +1 -1
- package/dist/{cose-bilkent-JH36ORCC-BP9FPPl5.js → cose-bilkent-JH36ORCC-DpqqWegk.js} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-Czf82C5l.cjs → cynefinDiagram-TSTJHNR4-CB8X1jFh.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-C9Su2eDY.js → cynefinDiagram-TSTJHNR4-DTqoE65U.js} +2 -2
- package/dist/{dagre-VKFMJZFB-CNHo3ePy.cjs → dagre-VKFMJZFB-CC9EQKtT.cjs} +1 -1
- package/dist/{dagre-VKFMJZFB-CHzg8A4L.js → dagre-VKFMJZFB-CXjbVzxo.js} +2 -2
- package/dist/{diagram-FQU43EPY-DPOANLfh.js → diagram-FQU43EPY-B8x8fTKN.js} +2 -2
- package/dist/{diagram-FQU43EPY-SBbc6A-V.cjs → diagram-FQU43EPY-pkT8NaMb.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-qINOCq2i.cjs → diagram-G47NLZAW-DqNB9k7X.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-DcmugHso.js → diagram-G47NLZAW-YJY1vw-z.js} +3 -3
- package/dist/{diagram-NH7WQ7WH-B-H4sDOs.js → diagram-NH7WQ7WH-6S5rssLn.js} +2 -2
- package/dist/{diagram-NH7WQ7WH-CqLkXrhA.cjs → diagram-NH7WQ7WH-e_5r7YfA.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-CFPQUn99.js → diagram-OA4YK3LP-CXQnLyDQ.js} +3 -3
- package/dist/{diagram-OA4YK3LP-Cx_mMF_k.cjs → diagram-OA4YK3LP-gAuJXOZ8.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-BCp3CEPx.cjs → diagram-WEI45ONY-PgR9S6g1.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-DtIWiRZh.js → diagram-WEI45ONY-ixyUSYN0.js} +2 -2
- package/dist/{ebnfDiagram-CCIWWBDH-BkyB7GDl.js → ebnfDiagram-CCIWWBDH-KryWrZHM.js} +3 -3
- package/dist/{ebnfDiagram-CCIWWBDH-ae7r9sJj.cjs → ebnfDiagram-CCIWWBDH-y4KbiCN5.cjs} +1 -1
- package/dist/{erDiagram-Q63AITRT-C3frz5_E.js → erDiagram-Q63AITRT-B11QNISq.js} +4 -4
- package/dist/{erDiagram-Q63AITRT-Uob9EKIP.cjs → erDiagram-Q63AITRT-D8vW6pbx.cjs} +1 -1
- package/dist/{extractHeadings-CSIST70N.js → extractHeadings-9PqrYAM2.js} +6230 -6188
- package/dist/extractHeadings-BXiMC-GU.cjs +315 -0
- package/dist/flowDiagram-23GEKE2U-BY2Fc_n3.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-DKG5Q_i5.js +7 -0
- package/dist/{ganttDiagram-NO4QXBWP-C0Yd_Jgw.cjs → ganttDiagram-NO4QXBWP-D8Y9jimu.cjs} +1 -1
- package/dist/{ganttDiagram-NO4QXBWP-Br8K8yMC.js → ganttDiagram-NO4QXBWP-DZTm-SVx.js} +2 -2
- package/dist/{gitGraphDiagram-IHSO6WYX-D9mGopoc.js → gitGraphDiagram-IHSO6WYX-CJbZ5ZvO.js} +3 -3
- package/dist/{gitGraphDiagram-IHSO6WYX-wea6OW4b.cjs → gitGraphDiagram-IHSO6WYX-DbYXrclf.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.d.ts +1 -1
- package/dist/index.client.js +23 -22
- package/dist/index.js +23 -22
- package/dist/{infoDiagram-FWYZ7A6U-DJP2-3Wv.js → infoDiagram-FWYZ7A6U-B50T5vm2.js} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-DG5lOgKP.cjs → infoDiagram-FWYZ7A6U-D5RCO_vv.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-B5RTeC2V.js → ishikawaDiagram-FXEZZL3T-CDedQKau.js} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-D103ENwS.cjs → ishikawaDiagram-FXEZZL3T-Csx1NBdz.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-BhIlJSFf.js → journeyDiagram-5HDEW3XC-DtiYwhDm.js} +4 -4
- package/dist/{journeyDiagram-5HDEW3XC-CljsyWWe.cjs → journeyDiagram-5HDEW3XC-a80p1mpy.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-XYVjcLiT.cjs → kanban-definition-HUTT4EX6-D9SadN7G.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-i_ZeGNw5.js → kanban-definition-HUTT4EX6-I9eVeuC0.js} +2 -2
- package/dist/{linear-CDbnw2fg.js → linear-0P_8Ivdd.js} +1 -1
- package/dist/{linear-B7pKd8FB.cjs → linear-DXqXAu27.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-1vdq3Rlm.cjs → mindmap-definition-LN4V7U3C-BkehNbGL.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-0_lr0tHS.js → mindmap-definition-LN4V7U3C-CFZpZpE0.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-19B9d_Bh.cjs → pegDiagram-2B236MQR-BfOxwgjO.cjs} +1 -1
- package/dist/{pegDiagram-2B236MQR-BJd-RgxS.js → pegDiagram-2B236MQR-DjCc1Quh.js} +3 -3
- package/dist/{pieDiagram-ENE6RG2P-D4bPhOA3.js → pieDiagram-ENE6RG2P-BPZ7HAvt.js} +3 -3
- package/dist/{pieDiagram-ENE6RG2P-D_3kijCk.cjs → pieDiagram-ENE6RG2P-Cak5M9yn.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-chTKMnmP.cjs → quadrantDiagram-ABIIQ3AL-55hF84Fw.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-D2IKj61w.js → quadrantDiagram-ABIIQ3AL-D104Wy4Z.js} +2 -2
- package/dist/{railroadDiagram-RFXS5EU6-Dj2mjq2m.cjs → railroadDiagram-RFXS5EU6-DcKZ88rg.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-CshSitep.js → railroadDiagram-RFXS5EU6-JxXkyrZQ.js} +3 -3
- package/dist/{requirementDiagram-TGXJPOKE-IqVUXu-f.cjs → requirementDiagram-TGXJPOKE-DPs0Ihw7.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-Cr-WsvUU.js → requirementDiagram-TGXJPOKE-MV4pfoX4.js} +3 -3
- package/dist/{sankeyDiagram-HTMAVEWB-DKcAsCkg.cjs → sankeyDiagram-HTMAVEWB-C5XpxThf.cjs} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-BS8HE-f9.js → sankeyDiagram-HTMAVEWB-DOV_mdAU.js} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-BhMjkZuk.cjs → sequenceDiagram-DBY2YBRQ-0J_xPyLe.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-oBPBZr8W.js → sequenceDiagram-DBY2YBRQ-CGbFTj5V.js} +3 -3
- package/dist/{sizeCapture-X5ZJPWSS-CzAWlgIJ.js → sizeCapture-X5ZJPWSS-BBd4os7j.js} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-DSOrfCCU.cjs → sizeCapture-X5ZJPWSS-DgTVF2P9.cjs} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-DUgJ1fpB.js → stateDiagram-2N3HPSRC-ByQZMt4V.js} +2 -2
- package/dist/{stateDiagram-2N3HPSRC-DGf-34Vz.cjs → stateDiagram-2N3HPSRC-DzuNZ3I1.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-DTLP-Rp0.js → stateDiagram-v2-6OUMAXLB-Dy3F4gdh.js} +2 -2
- package/dist/{stateDiagram-v2-6OUMAXLB-BlMEhtRV.cjs → stateDiagram-v2-6OUMAXLB-pdxYI04k.cjs} +1 -1
- package/dist/styles/markdown.css +1 -1
- package/dist/styles/markdown.standalone.css +1 -1
- package/dist/{swimlanes-5IMT3BWC-HUe2Zb14.js → swimlanes-5IMT3BWC-6i8hPBJr.js} +3 -3
- package/dist/{swimlanes-5IMT3BWC-DxH3ensQ.cjs → swimlanes-5IMT3BWC-RzXk2ZsR.cjs} +1 -1
- package/dist/{swimlanesDiagram-G3AALYLV-Bmxs1DxC.cjs → swimlanesDiagram-G3AALYLV-BdbEkuk7.cjs} +1 -1
- package/dist/{swimlanesDiagram-G3AALYLV-DZUE8SZP.js → swimlanesDiagram-G3AALYLV-C6aFaQGO.js} +2 -2
- package/dist/test-setup.d.ts +1 -0
- package/dist/{timeline-definition-FHXFAJF6-Bhi-eZDC.cjs → timeline-definition-FHXFAJF6--ngcmo2O.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-7mi78EDG.js → timeline-definition-FHXFAJF6-HwXvlWGt.js} +2 -2
- package/dist/{vennDiagram-L72KCM5P-BfVSqh6A.js → vennDiagram-L72KCM5P-CEMDoE35.js} +1 -1
- package/dist/{vennDiagram-L72KCM5P-8WRB9PMl.cjs → vennDiagram-L72KCM5P-rD2w7pAb.cjs} +1 -1
- package/dist/viewer-settings.cjs +1 -1
- package/dist/viewer-settings.d.ts +1 -0
- package/dist/viewer-settings.js +3 -2
- package/dist/{wardleyDiagram-EHGQE667-Ck9IAPXj.js → wardleyDiagram-EHGQE667-CAaRrppH.js} +2 -2
- package/dist/{wardleyDiagram-EHGQE667-0bPs97A3.cjs → wardleyDiagram-EHGQE667-DfYFaC8_.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-BzTVzWqQ.cjs → xychartDiagram-FW5EYKEG-By9uEzY0.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-CltjynUS.js → xychartDiagram-FW5EYKEG-DaD79epL.js} +2 -2
- package/package.json +9 -9
- package/dist/code-blocks-_AnVEB6v.cjs +0 -4
- package/dist/extractHeadings-q9-nMjxZ.cjs +0 -315
- package/dist/flowDiagram-23GEKE2U-B9QWrcsx.js +0 -7
- package/dist/flowDiagram-23GEKE2U-C3jd6i7t.cjs +0 -1
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
"use strict";var MC=Object.create;var ic=Object.defineProperty;var $C=Object.getOwnPropertyDescriptor;var OC=Object.getOwnPropertyNames;var RC=Object.getPrototypeOf,IC=Object.prototype.hasOwnProperty;var PC=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of OC(t))!IC.call(e,o)&&o!==r&&ic(e,o,{get:()=>t[o],enumerable:!(i=$C(t,o))||i.enumerable});return e};var oc=(e,t,r)=>(r=e!=null?MC(RC(e)):{},PC(t||!e||!e.__esModule?ic(r,"default",{value:e,enumerable:!0}):r,e));const B=require("react"),Ze=require("./linkCards-Bjd_vW39.cjs"),Kr=require("./providers-DO2t7ks4.cjs"),so=require("./viewer-settings.cjs"),vt=require("html-react-parser"),At=require("./code-blocks-BdKjppKq.cjs"),wr=require("./embeds.cjs"),Ni=require("./source-lines.cjs"),Bn=require("./simple-logger-9yf7ypyB.cjs"),Ln=require("shiki"),qi=require("dompurify"),ne=require("@aiquants/spreadsheet/view"),fa=require("@aiquants/spreadsheet/tsv"),DC=require("github-slugger"),NC=require("katex"),we=require("unist-util-visit"),zi=(e,t)=>{const r={};for(const i of Object.keys(e)){const o=t?.[i];if(o===void 0){r[i]=e[i];continue}if(typeof o!="string")throw new TypeError(`[@aiquants/markdown] label "${i}" must be a string; got ${o===null?"null":typeof o}`);r[i]={text:o,lang:void 0}}return Object.freeze(r)},ga=e=>{const t={};for(const r of Object.keys(e))t[r]=e[r].text;return Object.freeze(t)},pa=Object.freeze({embeddedVideo:{text:"embedded video",lang:"en"},embeddedPost:{text:"embedded post",lang:"en"},embeddedFrame:{text:"Embedded content",lang:"en"}}),qC=ga(pa),yu=e=>zi(pa,e),zC=yu(void 0);function xu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rs={exports:{}},ao={};var sc;function jC(){if(sc)return ao;sc=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var n in o)n!=="key"&&(s[n]=o[n])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:a,ref:o!==void 0?o:null,props:s}}return ao.Fragment=t,ao.jsx=r,ao.jsxs=r,ao}var no={};var ac;function WC(){return ac||(ac=1,process.env.NODE_ENV!=="production"&&(function(){function e(E){if(E==null)return null;if(typeof E=="function")return E.$$typeof===I?null:E.displayName||E.name||null;if(typeof E=="string")return E;switch(E){case y:return"Fragment";case C:return"Profiler";case x:return"StrictMode";case T:return"Suspense";case L:return"SuspenseList";case O:return"Activity"}if(typeof E=="object")switch(typeof E.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),E.$$typeof){case m:return"Portal";case S:return E.displayName||"Context";case k:return(E._context.displayName||"Context")+".Consumer";case v:var G=E.render;return E=E.displayName,E||(E=G.displayName||G.name||"",E=E!==""?"ForwardRef("+E+")":"ForwardRef"),E;case _:return G=E.displayName||null,G!==null?G:e(E.type)||"Memo";case D:G=E._payload,E=E._init;try{return e(E(G))}catch{}}return null}function t(E){return""+E}function r(E){try{t(E);var G=!1}catch{G=!0}if(G){G=console;var U=G.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&E[Symbol.toStringTag]||E.constructor.name||"Object";return U.call(G,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(E)}}function i(E){if(E===y)return"<>";if(typeof E=="object"&&E!==null&&E.$$typeof===D)return"<...>";try{var G=e(E);return G?"<"+G+">":"<...>"}catch{return"<...>"}}function o(){var E=j.A;return E===null?null:E.getOwner()}function s(){return Error("react-stack-top-frame")}function a(E){if(z.call(E,"key")){var G=Object.getOwnPropertyDescriptor(E,"key").get;if(G&&G.isReactWarning)return!1}return E.key!==void 0}function n(E,G){function U(){F||(F=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",G))}U.isReactWarning=!0,Object.defineProperty(E,"key",{get:U,configurable:!0})}function l(){var E=e(this.type);return N[E]||(N[E]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),E=this.props.ref,E!==void 0?E:null}function c(E,G,U,X,K,Q){var Y=U.ref;return E={$$typeof:g,type:E,key:G,props:U,_owner:X},(Y!==void 0?Y:null)!==null?Object.defineProperty(E,"ref",{enumerable:!1,get:l}):Object.defineProperty(E,"ref",{enumerable:!1,value:null}),E._store={},Object.defineProperty(E._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(E,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(E,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(E,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(E.props),Object.freeze(E)),E}function h(E,G,U,X,K,Q){var Y=G.children;if(Y!==void 0)if(X)if(A(Y)){for(X=0;X<Y.length;X++)d(Y[X]);Object.freeze&&Object.freeze(Y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(Y);if(z.call(G,"key")){Y=e(E);var Z=Object.keys(G).filter(function(at){return at!=="key"});X=0<Z.length?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}",q[Y+X]||(Z=0<Z.length?"{"+Z.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,X,Y,Z,Y),q[Y+X]=!0)}if(Y=null,U!==void 0&&(r(U),Y=""+U),a(G)&&(r(G.key),Y=""+G.key),"key"in G){U={};for(var J in G)J!=="key"&&(U[J]=G[J])}else U=G;return Y&&n(U,typeof E=="function"?E.displayName||E.name||"Unknown":E),c(E,Y,U,o(),K,Q)}function d(E){f(E)?E._store&&(E._store.validated=1):typeof E=="object"&&E!==null&&E.$$typeof===D&&(E._payload.status==="fulfilled"?f(E._payload.value)&&E._payload.value._store&&(E._payload.value._store.validated=1):E._store&&(E._store.validated=1))}function f(E){return typeof E=="object"&&E!==null&&E.$$typeof===g}var u=B,g=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),S=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),j=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,A=Array.isArray,M=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(E){return E()}};var F,N={},P=u.react_stack_bottom_frame.bind(u,s)(),$=M(i(s)),q={};no.Fragment=y,no.jsx=function(E,G,U){var X=1e4>j.recentlyCreatedOwnerStacks++;return h(E,G,U,!1,X?Error("react-stack-top-frame"):P,X?M(i(E)):$)},no.jsxs=function(E,G,U){var X=1e4>j.recentlyCreatedOwnerStacks++;return h(E,G,U,!0,X?Error("react-stack-top-frame"):P,X?M(i(E)):$)}})()),no}var nc;function HC(){return nc||(nc=1,process.env.NODE_ENV==="production"?rs.exports=jC():rs.exports=WC()),rs.exports}var w=HC();const lc=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),YC=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),UC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),GC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),XC=Object.freeze({scrollbarWidth:"none"}),VC=.01,hc=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Ya=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},KC=(e,t,r)=>{const i=getComputedStyle(e),o=Ya(i.width),s=e.getBoundingClientRect();if(o<=0||s.width<=0)return{barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1};const a=s.width/o,n=(s.width-t.getBoundingClientRect().width)/a-Ya(i.borderLeftWidth)-Ya(i.borderRightWidth),l=Math.max(0,Math.ceil(n-VC));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},ZC=(e,t,r,i,o)=>{const[s,a]=B.useState(hc),n=B.useRef(o),l=B.useRef(0);return B.useLayoutEffect(()=>{n.current=o}),B.useLayoutEffect(()=>{const c=m=>{l.current!==m&&(l.current=m,n.current?.(m))},h=t.current,d=r.current,f=i.current;if(!e||h===null||d===null||f===null){a(hc),c(0);return}const u=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=KC(h,d,f);a(C=>C.scroller===h&&C.barInlineSize===m&&C.nativeBarInlineSize===y&&C.overlaysScrollbars===x?C:Object.freeze({scroller:h,barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x})),c(m)};u();const g=new ResizeObserver(u);return g.observe(h),g.observe(d),g.observe(f),window.addEventListener("resize",u),()=>{g.disconnect(),window.removeEventListener("resize",u)}},[e,t,r,i]),s},QC=(e,t)=>{if(typeof e=="function"){const r=e(t);return typeof r=="function"?r:()=>e(null)}return e!=null?(e.current=t,()=>{e.current=null}):()=>{}};function Cu({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:o,rowStyle:s,onBarInlineSizeChange:a}){const n=B.useRef(null),l=B.useRef(null),c=B.useRef(null),h=i!==void 0,d=ZC(h,n,l,c,a),f=B.useCallback(m=>{n.current=m;const y=QC(t,m);return()=>{n.current=null,y()}},[t]),u=h?{...e.style,position:"relative",boxSizing:"border-box",overflowY:"scroll",width:`calc(100% + ${d.nativeBarInlineSize}px)`,...d.overlaysScrollbars?XC:void 0}:e.style,g=w.jsxs("div",{...e,ref:f,style:u,children:[r,h&&w.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:GC})]});return h?w.jsxs("div",{"data-aqmd-scroll-row":!0,className:o,style:s===void 0?lc:{...lc,...s},children:[w.jsx("div",{"data-aqmd-scroll-clip":!0,style:YC,children:g}),w.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:UC,children:d.scroller!==null&&i(d.scroller)})]}):g}const JC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),cc=e=>{const t=tb(e);return t.charAt(0).toUpperCase()+t.slice(1)},bu=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),eb=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var rb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ib=B.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:a,...n},l)=>B.createElement("svg",{ref:l,...rb,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:bu("lucide",o),...!s&&!eb(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>B.createElement(c,h)),...Array.isArray(s)?s:[s]]));const Bt=(e,t)=>{const r=B.forwardRef(({className:i,...o},s)=>B.createElement(ib,{ref:s,iconNode:t,className:bu(`lucide-${JC(cc(e))}`,`lucide-${e}`,i),...o}));return r.displayName=cc(e),r};const ob=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],sb=Bt("image-off",ob);class ab extends B.Component{constructor(t){super(t),this.state={content:t.content,failed:!1}}static getDerivedStateFromProps(t,r){return t.content===r.content?null:{content:t.content,failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?w.jsxs("div",{"data-aqmd-block-failure":"",children:[w.jsx("p",{"data-aqmd-block-failure-notice":"",lang:this.props.label.lang,children:this.props.label.text}),w.jsx("pre",{"data-aqmd-block-failure-text":"",children:this.props.text()})]}):this.props.children}}const ku=Object.freeze({blockFailed:{text:"This block could not be shown.",lang:"en"}}),nb=1024,Os=(e,t)=>e.fingerprint===t.fingerprint&&e.content===t.content,lb=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&Os(e[r],t[r]);)r+=1;let i=0;for(;i<e.length-r&&i<t.length-r&&Os(e[e.length-1-i],t[t.length-1-i]);)i+=1;const o=Array.from({length:r},(n,l)=>[l,l]),s=Array.from({length:i},(n,l)=>[e.length-i+l,t.length-i+l]),a=hb(e,t,r,e.length-i,t.length-i);return[...o,...a,...s]},hb=(e,t,r,i,o)=>{const s=new Set(e.slice(r,i).map(S=>S.fingerprint)),a=new Set(t.slice(r,o).map(S=>S.fingerprint)),n=[];for(let S=r;S<i;S+=1)a.has(e[S].fingerprint)&&n.push(S);const l=[];for(let S=r;S<o;S+=1)s.has(t[S].fingerprint)&&l.push(S);const c=n.length,h=l.length;if(c===0||h===0)return[];const d=(S,v)=>Os(e[n[S]],t[l[v]]),f=(S,v)=>e[n[S]].fingerprint===t[l[v]].fingerprint,u=(S,v)=>{let T=S;for(;T<c&&T+v<h&&d(T,T+v);)T+=1;return T},g=[Int32Array.of(u(0,0))],m=[Uint8Array.of(Ua)],y=h-c;let x=0;for(;!(y>=-x&&y<=x&&g[x][y+x]===c);){if(x+=1,x>nb)return[];const S=g[x-1],v=_=>_>=-(x-1)&&_<=x-1?S[_+x-1]:-1,T=new Int32Array(2*x+1).fill(-1),L=new Uint8Array(2*x+1);for(let _=-x;_<=x;_+=1){if(_<-c||_>h)continue;let D=-1,O=Ua;const I=v(_);I!==-1&&I<c&&I+_<h&&f(I,I+_)&&(D=I+1,O=dc);const j=v(_+1);j!==-1&&j+1<=c&&j+1>D&&(D=j+1,O=uc);const z=v(_-1);z!==-1&&z+_<=h&&z>D&&(D=z,O=Ga),D!==-1&&(T[_+x]=u(D,_),L[_+x]=O)}g.push(T),m.push(L)}const C=[];let k=y;for(let S=x;S>=0;S-=1){const v=g[S][k+S],T=m[S][k+S],L=T===uc?k+1:T===Ga?k-1:k,_=T===Ua?0:g[S-1][L+S-1]+(T===Ga?0:1);for(let D=v-1;D>=_;D-=1)C.push([n[D],l[D+k]]);T===dc&&C.push([n[_-1],l[_-1+k]]),k=L}return C.reverse()},Ua=0,dc=1,uc=2,Ga=3,cb=(e,t)=>{const r=e.map(()=>null),i=new Set;for(const[n,l]of lb(t,e))r[l]=t[n].key,i.add(n);const o=new Map;for(const[n,l]of t.entries()){if(i.has(n))continue;const c=o.get(l.fingerprint);c===void 0?o.set(l.fingerprint,[n]):c.push(n)}const s=n=>{for(const[l,c]of e.entries()){if(r[l]!==null)continue;const h=o.get(c.fingerprint),d=h===void 0?-1:h.findIndex(f=>n(c,t[f]));h!==void 0&&d!==-1&&(r[l]=t[h.splice(d,1)[0]].key)}};s(Os),s(()=>!0);const a=new Set(r.filter(n=>n!==null));return e.map((n,l)=>{let c=r[l];if(c===null){let h=0;for(;a.has(`${n.fingerprint}.${h}`);)h+=1;c=`${n.fingerprint}.${h}`,a.add(c)}return{...n,key:c}})};const db=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],ub=Bt("building-2",db);const fb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],fc=Bt("globe",fb),gb=/^[a-z]{2,3}$/u,pb=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return gb.test(t)?t:null},mb=()=>()=>{},yb=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},Pl=()=>B.useSyncExternalStore(mb,()=>window.location.origin,()=>null),xb=()=>B.useSyncExternalStore(yb,()=>pb(document.documentElement.lang),()=>null),Cb=/^[1-9]\d{0,4}$/u,gc=e=>e!==void 0&&Cb.test(e.trim())?Number(e.trim()):null,bb=({embed:e,label:t,insideAnchor:r,children:i})=>{const o=Pl(),s=new URL(e.src);if(o!==null&&s.origin!==o&&!r)return i;const a=gc(e.attributes.width),n=gc(e.attributes.height),l=a!==null&&n!==null?{width:"100%",maxWidth:`${a}px`,aspectRatio:`${a} / ${n}`}:void 0,c=e.attributes.title,h=c===void 0?t.lang:void 0;return w.jsx("span",{"data-embed-frame":o===null?"pending":"refused","data-aqmd-embed-surface":l===void 0?void 0:"",style:l,className:l===void 0?void 0:"flex items-center justify-center rounded-lg p-2 text-center",children:r?w.jsx("span",{lang:h,children:`${c??t.text}: ${s.hostname}`}):w.jsx("a",{href:s.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${s.hostname}`})})},wu=({concurrency:e,capacity:t,timeoutMs:r})=>{for(const[h,d]of Object.entries({concurrency:e,capacity:t,timeoutMs:r}))if(!Number.isInteger(d)||d<=0)throw new RangeError(`[@aiquants/markdown] request queue ${h} must be a positive integer; got ${String(d)}`);const i=new Map,o=new Map,s=[];let a=0;const n=(h,d,f)=>{if(o.get(h)===d&&(o.delete(h),f!==null)){i.set(h,f);for(const u of i.keys()){if(i.size<=t)break;i.delete(u)}for(const u of d.subscriptions)u.listener(f)}},l=()=>{for(;a<e;){const h=s.shift();if(h===void 0)return;const d=o.get(h);if(d===void 0)continue;const f=new AbortController;d.controller=f,a+=1,new Promise(u=>u(d.start(AbortSignal.any([f.signal,AbortSignal.timeout(r)])))).then(u=>n(h,d,{ok:!0,value:u}),()=>n(h,d,f.signal.aborted?null:{ok:!1})).finally(()=>{a-=1,l()})}};return Object.freeze({subscribe:(h,d,f)=>{const u=i.get(h);if(u!==void 0)return i.delete(h),i.set(h,u),f(u),()=>{};let g=o.get(h);g===void 0&&(g={start:d,subscriptions:new Set,controller:null},o.set(h,g),s.push(h));const m=g,y={listener:f};return m.subscriptions.add(y),l(),()=>{m.subscriptions.delete(y),!(m.subscriptions.size>0||o.get(h)!==m)&&(o.delete(h),m.controller===null?s.splice(s.indexOf(h),1):m.controller.abort())}}})},kb=wu({concurrency:2,capacity:256,timeoutMs:15e3}),wb="[data-aqmd-scroll-container]",Sb=async(e,t)=>{let r;try{r=await fetch(e,{credentials:"same-origin",redirect:"error",headers:{accept:"application/json"},signal:t})}catch(s){if(t.aborted)throw s;return{kind:"error",cause:"network error"}}if(r.status===204){const s=Ze.linkCardSkipReasonOf(r.headers.get(Ze.LINK_CARD_SKIP_HEADER));return s===null?{kind:"error",cause:"HTTP 204 without a known skip reason"}:{kind:"skip",reason:s}}if(!r.ok)return{kind:"error",cause:`HTTP ${r.status}`};let i;try{i=await r.json()}catch(s){if(t.aborted)throw s;return{kind:"error",cause:`HTTP ${r.status}, not JSON`}}const o=Ze.linkCardMetadataOf(i);return o===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:o}},vb=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",pc=(e,t)=>e!==null&&new URL(e).hostname!==t?e:null,Xa=({tile:e,tileKind:t,primary:r,secondary:i})=>w.jsxs("span",{className:"flex min-w-0 flex-auto items-center gap-3 px-3",children:[w.jsx("span",{"aria-hidden":"true","data-link-card-icon":t,className:`flex size-8 shrink-0 items-center justify-center rounded-md bg-(--aqmd-link-card-bg-hover) text-(--aqmd-link-card-muted) ${t==="pending"?"motion-safe:animate-pulse":""}`,children:e}),w.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[w.jsx("span",{className:"truncate font-semibold text-[0.875rem] leading-5",children:r}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:i})]})]}),Tb=({href:e,endpoint:t,size:r,fallback:i})=>{const o=Pl(),s=B.useRef(null),a=new URL(e),n=`${t}
|
|
7
|
+
${a.href}`,[l,c]=B.useState(null);B.useEffect(()=>{const x=s.current;if(x===null||o===null)return;let C=null;const k=new IntersectionObserver(S=>{C!==null||!S.some(v=>v.isIntersecting)||(k.disconnect(),C=kb.subscribe(n,v=>Sb(Ze.linkCardRequestOf(t,new URL(e),o),v),v=>{c({key:n,outcome:v});const T=vb(v);T!==null&&Bn.linkCardLogger.info(`No link card for ${e} (${T})`)}))},{root:x.closest(wb),rootMargin:"100% 0px"});return k.observe(x),()=>{k.disconnect(),C?.()}},[n,t,e,o]);const h=l!==null&&l.key===n?l.outcome:null;if(h!==null&&!h.ok)return i;const d=h===null?null:h.value;if(d!==null&&d.kind==="error")return i;if(d===null||o===null)return w.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","aria-busy":"true","data-link-card":"pending","data-link-card-size":r,children:r==="compact"?w.jsx(Xa,{tile:null,tileKind:"pending",primary:a.hostname,secondary:e}):w.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-2 px-4 py-3.5",children:[w.jsx("span",{"aria-hidden":"true",className:"block h-3.5 w-2/3 rounded bg-(--aqmd-link-card-border) motion-safe:animate-pulse"}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem]",children:a.hostname}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:e})]})});if(d.kind==="skip"){const{reason:x}=d,C=x==="private-network",k=C?ub:fc;return w.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"compact","data-link-card-reason":x,"data-link-card-size":"compact",children:w.jsx(Xa,{tile:w.jsx(k,{"aria-hidden":"true",className:"size-4"}),tileKind:C?"internal":"link",primary:a.hostname,secondary:e})})}const{metadata:f}=d,u=new URL(o).hostname,g=pc(f.image,u),m=pc(f.icon,u),y=f.siteName===null?a.hostname:`${f.siteName} · ${a.hostname}`;return r==="compact"?w.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:w.jsx(Xa,{tile:m===null?w.jsx(fc,{"aria-hidden":"true",className:"size-4"}):w.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 rounded-[3px]"}),tileKind:m===null?"link":"favicon",primary:f.title??e,secondary:y})}):w.jsxs("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":r,children:[w.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1 px-4 py-3.5",children:[w.jsx("span",{className:"wrap-anywhere line-clamp-2 font-semibold text-[0.9375rem] leading-5",children:f.title??e}),f.description===null?null:w.jsx("span",{className:`wrap-anywhere text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem] ${r==="banner"?"line-clamp-1":"line-clamp-2"}`,children:f.description}),w.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-(--aqmd-link-card-muted) text-xs leading-4",children:[m===null?null:w.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 shrink-0 rounded-[3px]"}),w.jsx("span",{className:"truncate",children:y})]})]}),g===null?null:w.jsx("img",{src:g,alt:"",loading:"lazy",referrerPolicy:"no-referrer"})]})},Su=e=>{if(!Array.isArray(e.providers))throw new RangeError(`[@aiquants/markdown] embeds.providers must be an array of provider ids; got ${typeof e.providers}`);for(const t of e.providers)if(!Kr.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${Kr.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!Ze.isLinkCardEndpoint(e.linkCardEndpoint))throw new RangeError(`[@aiquants/markdown] embeds.linkCardEndpoint must be null or an absolute path without a trailing "/" (segments of A-Z a-z 0-9 . _ ~ -, no "." or ".."); got ${JSON.stringify(e.linkCardEndpoint)}`);if(e.linkCardSize!==void 0&&!Ze.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${Ze.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},Co=new WeakMap;let is=0;const mc=e=>{if(e.source===null)return;const t=Co.get(e.source);if(t===void 0||e.origin!==t.watch.origin)return;const r=t.watch.heightOf(e.data,t.watch.src);if(r===null||!Number.isFinite(r))return;const i=Math.min(Kr.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(Kr.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},_b=(e,t)=>{const r={watch:t,last:null};return Co.has(e)||(is+=1,is===1&&window.addEventListener("message",mc)),Co.set(e,r),()=>{Co.get(e)===r&&(Co.delete(e),is-=1,is===0&&window.removeEventListener("message",mc))}},Bb=wu({concurrency:2,capacity:256,timeoutMs:5e3}),Lb=async(e,t)=>{const r=await fetch(e,{credentials:"omit",redirect:"error",referrerPolicy:"no-referrer",headers:{accept:"application/json"},signal:t});if(!r.ok)throw new Error(`[@aiquants/markdown] embed lookup answered ${r.status}`);return await r.json()},Eb=(e,t)=>{const r=e.maxWidth===null?void 0:`${e.maxWidth}px`;switch(e.kind){case"aspect":return{width:"100%",maxWidth:r,aspectRatio:`${e.ratio[0]} / ${e.ratio[1]}`};case"fixed":return{width:"100%",maxWidth:r,height:`${e.height}px`};case"message":return{width:"100%",maxWidth:r,height:`${t??e.initialHeight}px`}}},Fb=Object.freeze({marginInline:0}),Va=Object.freeze({kind:"pending"}),Ab=Object.freeze({kind:"narrow"}),Mb=Object.freeze({kind:"fallback"}),$b=(e,t,r,i,o)=>{if(t===null)return Va;let s;if(e.kind==="frame")s=e.srcOf(r);else{if(i===null)return Va;s=i.ok?e.srcOf(i.value,r):null}if(s===null||new URL(s).origin===t)return Mb;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(o===null)return Va;if(Math.min(o,n??Number.POSITIVE_INFINITY)<a)return Ab}return{kind:"frame",src:s}},Ob=({resolution:e,caption:t,fallback:r,theme:i,labels:o})=>{const s=Pl(),a=xb(),[n,l]=B.useState(null),[c,h]=B.useState(null),d=e.kind==="lookup"?e.request.href:null,[f,u]=B.useState(null);B.useEffect(()=>{if(d!==null)return Bb.subscribe(d,_=>Lb(new URL(d),_),_=>u({key:d,outcome:_}))},[d]);const{provider:g,layout:m}=e,y=$b(e,s,{theme:i,lang:a},f!==null&&f.key===d?f.outcome:null,n),x=B.useCallback(_=>{if(_===null)return;l(_.getBoundingClientRect().width);const D=new ResizeObserver(()=>l(_.getBoundingClientRect().width));return D.observe(_),()=>D.disconnect()},[]),C=y.kind==="frame"?y.src:null,k=c!==null&&c.src===C?c.height:null,S=B.useCallback(_=>{if(!(_===null||_.contentWindow===null||m.kind!=="message"||C===null))return _b(_.contentWindow,{origin:g.frameOrigin,src:C,heightOf:m.heightOf,set:D=>h({src:C,height:D})})},[m,g.frameOrigin,C]);if(y.kind==="fallback")return r;const v=m.minWidth===null?null:w.jsx("span",{ref:x,"aria-hidden":"true","data-embed-measure":g.id,className:"block h-0"});if(y.kind==="narrow")return w.jsxs(w.Fragment,{children:[v,r]});const T=g.content==="video"?o.embeddedVideo:o.embeddedPost,{frame:L}=g;return w.jsxs(w.Fragment,{children:[v,w.jsxs("figure",{"data-embed-provider":g.id,"data-embed-state":y.kind,style:Fb,children:[w.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:Eb(m,k),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?w.jsx("iframe",{ref:S,src:y.src,title:`${g.name}: ${T.text}`,lang:T.lang,loading:"lazy",allow:L.allow??void 0,allowFullScreen:L.allowFullScreen,sandbox:L.sandbox,referrerPolicy:L.referrerPolicy,scrolling:L.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),w.jsx("figcaption",{className:"mt-2",children:t})]})]})},Rb=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],Ib=(e,t)=>wr.allowedFrameUrlOf(e,t)!==null,Pb=(e,t)=>{const r=new Map(Object.entries(e).map(([s,a])=>[s.toLowerCase(),a])),i=wr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const o={};for(const s of Rb){const a=r.get(s);if(a!==void 0)if(s==="allow"){const n=wr.reduceFrameFeatures(a);n!==null&&(o.allow=n)}else if(s==="referrerpolicy"){const n=a.trim().toLowerCase();wr.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(o.referrerpolicy=n)}else o[s]=a}return Object.freeze({src:i.href,attributes:Object.freeze(o)})},Db=new Set(["script","style","template","noscript","noembed","noframes","plaintext","xmp","title","head","meta","link","base","object","embed","applet","param","frame","frameset","select","datalist","track","math","foreignobject"]),Nb=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),qb=new Set(["markdown-alert","markdown-alert-title","markdown-alert-note","markdown-alert-tip","markdown-alert-important","markdown-alert-warning","markdown-alert-caution","octicon","octicon-info","octicon-light-bulb","octicon-report","octicon-alert","octicon-stop","mr-2","message","message-symbol","message-content","alert","info","warning","markdown-details","markdown-details-content","footnotes","footnote-ref","footnote-backref","math","inline","display"]),yc="language-",zb=/[\t\n\f\r ]+/u,jb=new Set(["h1","h2","h3","h4","h5","h6"]),xc=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),Cc="user-content-",te=["align"],fi=["width","height"],bc=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],Ka=Object.freeze({a:["href","name","hreflang","data-link-kind","data-doc-path","data-doc-exists","data-footnote-ref","data-footnote-backref"],abbr:[],address:[],article:[],aside:[],audio:["src","controls","loop","muted","preload"],b:[],bdi:[],bdo:[],blockquote:["cite"],br:[],caption:te,cite:[],code:[At.CODE_META_ATTRIBUTE],col:["span",...te,...fi],colgroup:["span",...te,...fi],dd:[],del:["cite","datetime"],details:["open"],dfn:[],div:te,dl:[],dt:[],em:[],figcaption:[],figure:[],footer:[],h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,header:[],hgroup:[],hr:[],i:[],img:["src","alt","loading","decoding",...te,...fi,"data-asset-src","data-asset-exists"],ins:["cite","datetime"],kbd:[],li:["value"],main:[],mark:[],nav:[],ol:["start","reversed","type"],p:te,pre:[],q:["cite"],rp:[],rt:[],ruby:[],s:[],samp:[],section:["data-footnotes"],small:[],source:["src","type"],span:[],strong:[],sub:[],summary:[],sup:[],table:[...te,"border",...fi],tbody:[...te,"valign"],td:bc,tfoot:[...te,"valign"],th:bc,thead:[...te,"valign"],time:["datetime"],tr:[...te,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...fi],wbr:[]}),Za=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...fi],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),Wb=new Set(["svg","g"]),Hb=new Set(["href","src","cite","poster",wr.EMBED_LINK_ATTRIBUTE]),Yb=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,Ub=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,Gb=new Set(["left","right","center","justify","start","end"]),Vo=e=>Ub.test(e.replace(Yb,"")),Xb=e=>{let t=null;for(const r of e.split(";")){const i=r.indexOf(":");if(i<0||r.slice(0,i).trim().toLowerCase()!=="text-align")continue;const o=r.slice(i+1).trim().toLowerCase();Gb.has(o)&&(t=o)}return t===null?null:`text-align: ${t}`},Vb=e=>{const t=e.split(zb).filter(r=>qb.has(r)||r.startsWith(yc)&&r.length>yc.length);return t.length===0?null:t.join(" ")},Kb=(e,t)=>jb.has(e)||t.startsWith(Cc)&&t.length>Cc.length||Object.hasOwn(xc,e)&&xc[e].test(t),Zb=e=>{const t=new Map;for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();t.has(o)||t.set(o,i)}return t},lo=(e,t,r)=>{const i={};for(const[o,s]of t){if(o===Ni.SOURCE_LINES_ATTRIBUTE){Ni.parseSourceLines(s)!==null&&(i[o]=s);continue}if((Nb.has(o)||r.includes(o)||o.startsWith("aria-")&&o.length>5)&&!(Hb.has(o)&&!Vo(s))&&!(o==="fill"&&/url\s*\(/iu.test(s))&&!(o==="id"&&!Kb(e,s))){if(o==="class"||o==="style"){const a=o==="class"?Vb(s):Xb(s);a!==null&&(i[o]=a);continue}i[o]=s}}return i},Qb=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),ma=(e,t,r)=>{const i=e.toLowerCase(),o=r.parentName===null?null:r.parentName.toLowerCase(),s=Zb(t);if(o!==null&&Wb.has(o)){const n=i!=="svg"&&Object.hasOwn(Za,i)?Za[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:lo(i,s,n)}}if(i==="svg")return{action:"keep",attributes:lo(i,s,Za.svg)};if(i==="iframe"){const n=Pb(Object.fromEntries(s),r.iFrameAllowedDomains);return n===null?{action:"remove"}:{action:"embed",embed:n,pluginType:s.get("data-plugin-type")??null}}if(i==="p"){const n=lo(i,s,Ka.p),l=s.get(wr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&Vo(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return Qb(s)?{action:"keep",attributes:lo(i,s,["type","checked","disabled"])}:{action:"remove"};if(Db.has(i))return{action:"remove"};const a=Object.hasOwn(Ka,i)?Ka[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:lo(i,s,a)}};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(t,r){r=r||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r.bubbles,r.cancelable,r.detail),i}));const Jb=typeof document<"u"&&!!document.documentMode;let Qa;function t1(){return Qa||(Qa=document.createElement("div").style)}const kc=["webkit","moz","ms"],os={};function Dl(e){if(os[e])return os[e];const t=t1();if(e in t)return os[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=kc.length;for(;i--;){const o=`${kc[i]}${r}`;if(o in t)return os[e]=o}}function ss(e,t){return parseFloat(t[Dl(e)])||0}function as(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:ss(`${t}Left${i}`,r),right:ss(`${t}Right${i}`,r),top:ss(`${t}Top${i}`,r),bottom:ss(`${t}Bottom${i}`,r)}}function Ci(e,t,r){e.style[Dl(t)]=r}function e1(e,t){const r=Dl("transform");Ci(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function r1(e,{x:t,y:r,scale:i,isSVG:o},s){if(Ci(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),o&&Jb){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Ja(e){let t=e.parentNode;(!t||t.nodeType!==1)&&(t=document.documentElement);const r=window.getComputedStyle(e),i=window.getComputedStyle(t),o=e.getBoundingClientRect(),s=t.getBoundingClientRect();return{elem:{style:r,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,margin:as(e,"margin",r),border:as(e,"border",r)},parent:{style:i,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:as(t,"padding",i),border:as(t,"border",i)}}}let Io={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Io={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Io={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function tn(e,t,r,i){Io[e].split(" ").forEach(o=>{t.addEventListener(o,r,i)})}function en(e,t,r){Io[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function vu(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function En(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,En(e,i);return}r=vu(e,t),r>-1&&e.splice(r,1),e.push(t)}function i1(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=vu(e,t);r>-1&&e.splice(r,1)}function wc(e){e=e.slice(0);let t=e.pop(),r;for(;r=e.pop();)t={clientX:(r.clientX-t.clientX)/2+t.clientX,clientY:(r.clientY-t.clientY)/2+t.clientY};return t}function rn(e){if(e.length<2)return 0;const t=e[0],r=e[1];return Math.sqrt(Math.pow(Math.abs(r.clientX-t.clientX),2)+Math.pow(Math.abs(r.clientY-t.clientY),2))}function o1(e){let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1}function s1(e){return(e.getAttribute("class")||"").trim()}function a1(e,t){return e.nodeType===1&&` ${s1(e)} `.indexOf(` ${t} `)>-1}function n1(e,t){for(let r=e;r!=null;r=r.parentNode)if(a1(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const l1=/^http:[\w\.\/]+svg$/;function h1(e){return l1.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function c1(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const Tu={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:e=>{e.preventDefault(),e.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:r1,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function _u(e,t){if(!e)throw new Error("Panzoom requires an element as an argument");if(e.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!o1(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...Tu,...t};const r=h1(e),i=e.parentNode;i.style.overflow=t.overflow,i.style.userSelect="none",i.style.touchAction=t.touchAction,(t.canvas?i:e).style.cursor=t.cursor,e.style.userSelect="none",e.style.touchAction=t.touchAction,Ci(e,"transformOrigin",typeof t.origin=="string"?t.origin:r?"0 0":"50% 50%");function o(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",e.style.cursor="",e.style.userSelect="",e.style.touchAction="",Ci(e,"transformOrigin","")}function s($={}){for(const q in $)$.hasOwnProperty(q)&&(t[q]=$[q]);($.hasOwnProperty("cursor")||$.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),$.hasOwnProperty("overflow")&&(i.style.overflow=$.overflow),$.hasOwnProperty("touchAction")&&(i.style.touchAction=$.touchAction,e.style.touchAction=$.touchAction)}let a=0,n=0,l=1,c=!1;m(t.startScale,{animate:!1,force:!0}),setTimeout(()=>{g(t.startX,t.startY,{animate:!1,force:!0})});function h($,q,E){if(E.silent)return;const G=new CustomEvent($,{detail:q});e.dispatchEvent(G)}function d($,q,E){const G={x:a,y:n,scale:l,isSVG:r,originalEvent:E};return requestAnimationFrame(()=>{typeof q.animate=="boolean"&&(q.animate?e1(e,q):Ci(e,"transition","none")),q.setTransform(e,G,q),h($,G,q),h("panzoomchange",G,q)}),G}function f($,q,E,G){const U={...t,...G},X={x:a,y:n,opts:U};if(!G?.force&&(U.disablePan||U.panOnlyWhenZoomed&&l===U.startScale))return X;if($=parseFloat($),q=parseFloat(q),U.disableXAxis||(X.x=(U.relative?a:0)+$),U.disableYAxis||(X.y=(U.relative?n:0)+q),U.contain){const K=Ja(e),Q=K.elem.width/l,Y=K.elem.height/l,Z=Q*E,J=Y*E,at=(Z-Q)/2,pt=(J-Y)/2;if(U.contain==="inside"){const Ct=(-K.elem.margin.left-K.parent.padding.left+at)/E,St=(K.parent.width-Z-K.parent.padding.left-K.elem.margin.left-K.parent.border.left-K.parent.border.right+at)/E;X.x=Math.max(Math.min(X.x,St),Ct);const Kt=(-K.elem.margin.top-K.parent.padding.top+pt)/E,de=(K.parent.height-J-K.parent.padding.top-K.elem.margin.top-K.parent.border.top-K.parent.border.bottom+pt)/E;X.y=Math.max(Math.min(X.y,de),Kt)}else if(U.contain==="outside"){const Ct=(-(Z-K.parent.width)-K.parent.padding.left-K.parent.border.left-K.parent.border.right+at)/E,St=(at-K.parent.padding.left)/E;X.x=Math.max(Math.min(X.x,St),Ct);const Kt=(-(J-K.parent.height)-K.parent.padding.top-K.parent.border.top-K.parent.border.bottom+pt)/E,de=(pt-K.parent.padding.top)/E;X.y=Math.max(Math.min(X.y,de),Kt)}}return U.roundPixels&&(X.x=Math.round(X.x),X.y=Math.round(X.y)),X}function u($,q){const E={...t,...q},G={scale:l,opts:E};if(!q?.force&&E.disableZoom)return G;let U=t.minScale,X=t.maxScale;if(E.contain){const K=Ja(e),Q=K.elem.width/l,Y=K.elem.height/l;if(Q>1&&Y>1){const Z=K.parent.width-K.parent.border.left-K.parent.border.right,J=K.parent.height-K.parent.border.top-K.parent.border.bottom,at=Z/Q,pt=J/Y;t.contain==="inside"?X=Math.min(X,at,pt):t.contain==="outside"&&(U=Math.max(U,at,pt))}}return G.scale=Math.min(Math.max($,U),X),G}function g($,q,E,G){const U=f($,q,l,E);return a!==U.x||n!==U.y?(a=U.x,n=U.y,d("panzoompan",U.opts,G)):{x:a,y:n,scale:l,isSVG:r,originalEvent:G}}function m($,q,E){const G=u($,q),U=G.opts;if(!q?.force&&U.disableZoom)return;$=G.scale;let X=a,K=n;if(U.focal){const Y=U.focal;X=(Y.x/$-Y.x/l+a*$)/$,K=(Y.y/$-Y.y/l+n*$)/$}const Q=f(X,K,$,{relative:!1,force:!0});return a=Q.x,n=Q.y,l=$,d("panzoomzoom",U,E)}function y($,q){const E={...t,animate:!0,...q};return m(l*Math.exp(($?1:-1)*E.step),E)}function x($){return y(!0,$)}function C($){return y(!1,$)}function k($,q,E,G){const U=Ja(e),X={width:U.parent.width-U.parent.padding.left-U.parent.padding.right-U.parent.border.left-U.parent.border.right,height:U.parent.height-U.parent.padding.top-U.parent.padding.bottom-U.parent.border.top-U.parent.border.bottom};let K=q.clientX-U.parent.left-U.parent.padding.left-U.parent.border.left-U.elem.margin.left,Q=q.clientY-U.parent.top-U.parent.padding.top-U.parent.border.top-U.elem.margin.top;r||(K-=U.elem.width/l/2,Q-=U.elem.height/l/2);const Y={x:K/X.width*(X.width*$),y:Q/X.height*(X.height*$)};return m($,{...E,animate:!1,focal:Y},G)}function S($,q){$.preventDefault();const E={...t,...q,animate:!1},U=($.deltaY===0&&$.deltaX?$.deltaX:$.deltaY)<0?1:-1,X=u(l*Math.exp(U*E.step/3),E).scale;return k(X,$,E,$)}function v($){const q={...t,animate:!0,force:!0,...$};l=u(q.startScale,q).scale;const E=f(q.startX,q.startY,l,q);return a=E.x,n=E.y,d("panzoomreset",q)}let T,L,_,D,O,I;const j=[];function z($){if(n1($.target,t))return;En(j,$),c=!0,t.handleStartEvent($),T=a,L=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:$},t);const q=wc(j);_=q.clientX,D=q.clientY,O=l,I=rn(j)}function A($){if(!c||T===void 0||L===void 0||_===void 0||D===void 0)return;En(j,$);const q=wc(j),E=j.length>1;let G=l;if(E){I===0&&(I=rn(j));const U=rn(j)-I;G=u(U*t.step/80+O).scale,k(G,q,{animate:!1},$)}(!E||t.pinchAndPan)&&g(T+(q.clientX-_)/G,L+(q.clientY-D)/G,{animate:!1},$)}function M($){j.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:$},t),i1(j,$),c&&(c=!1,T=L=_=D=void 0)}let F=!1;function N(){F||(F=!0,tn("down",t.canvas?i:e,z),tn("move",document,A,{passive:!0}),tn("up",document,M,{passive:!0}))}function P(){F=!1,en("down",t.canvas?i:e,z),en("move",document,A),en("up",document,M)}return t.noBind||N(),{bind:N,destroy:P,eventNames:Io,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>c1(t),handleDown:z,handleMove:A,handleUp:M,pan:g,reset:v,resetStyle:o,setOptions:s,setStyle:($,q)=>Ci(e,$,q),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:k,zoomWithWheel:S}}_u.defaultOptions=Tu;const d1=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],u1=Bt("arrow-down",d1);const f1=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],g1=Bt("arrow-left",f1);const p1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],m1=Bt("arrow-right",p1);const y1=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],x1=Bt("arrow-up",y1);const C1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Fn=Bt("refresh-cw",C1);const b1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],k1=Bt("settings-2",b1);const w1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Bu=Bt("zoom-in",w1);const S1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Lu=Bt("zoom-out",S1);var Eu=Object.defineProperty,p=(e,t)=>Eu(e,"name",{value:t,configurable:!0}),Fu=(e,t)=>{for(var r in t)Eu(e,r,{get:t[r],enumerable:!0})},Cs={exports:{}},v1=Cs.exports,Sc;function T1(){return Sc||(Sc=1,(function(e,t){(function(r,i){e.exports=i()})(v1,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var M=["th","st","nd","rd"],F=A%100;return"["+A+(M[(F-20)%10]||M[F]||M[0])+"]"}},k=function(A,M,F){var N=String(A);return!N||N.length>=M?A:""+Array(M+1-N.length).join(F)+A},S={s:k,z:function(A){var M=-A.utcOffset(),F=Math.abs(M),N=Math.floor(F/60),P=F%60;return(M<=0?"+":"-")+k(N,2,"0")+":"+k(P,2,"0")},m:function A(M,F){if(M.date()<F.date())return-A(F,M);var N=12*(F.year()-M.year())+(F.month()-M.month()),P=M.clone().add(N,d),$=F-P<0,q=M.clone().add(N+($?-1:1),d);return+(-(N+(F-P)/($?P-q:q-P))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:d,y:u,w:h,d:c,D:g,h:l,m:n,s:a,ms:s,Q:f}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},v="en",T={};T[v]=C;var L="$isDayjsObject",_=function(A){return A instanceof j||!(!A||!A[L])},D=function A(M,F,N){var P;if(!M)return v;if(typeof M=="string"){var $=M.toLowerCase();T[$]&&(P=$),F&&(T[$]=F,P=$);var q=M.split("-");if(!P&&q.length>1)return A(q[0])}else{var E=M.name;T[E]=M,P=E}return!N&&P&&(v=P),P||!N&&v},O=function(A,M){if(_(A))return A.clone();var F=typeof M=="object"?M:{};return F.date=A,F.args=arguments,new j(F)},I=S;I.l=D,I.i=_,I.w=function(A,M){return O(A,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var j=(function(){function A(F){this.$L=D(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[L]=!0}var M=A.prototype;return M.parse=function(F){this.$d=(function(N){var P=N.date,$=N.utc;if(P===null)return new Date(NaN);if(I.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var q=P.match(y);if(q){var E=q[2]-1||0,G=(q[7]||"0").substring(0,3);return $?new Date(Date.UTC(q[1],E,q[3]||1,q[4]||0,q[5]||0,q[6]||0,G)):new Date(q[1],E,q[3]||1,q[4]||0,q[5]||0,q[6]||0,G)}}return new Date(P)})(F),this.init()},M.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},M.$utils=function(){return I},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(F,N){var P=O(F);return this.startOf(N)<=P&&P<=this.endOf(N)},M.isAfter=function(F,N){return O(F)<this.startOf(N)},M.isBefore=function(F,N){return this.endOf(N)<O(F)},M.$g=function(F,N,P){return I.u(F)?this[N]:this.set(P,F)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(F,N){var P=this,$=!!I.u(N)||N,q=I.p(F),E=function(J,at){var pt=I.w(P.$u?Date.UTC(P.$y,at,J):new Date(P.$y,at,J),P);return $?pt:pt.endOf(c)},G=function(J,at){return I.w(P.toDate()[J].apply(P.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(at)),P)},U=this.$W,X=this.$M,K=this.$D,Q="set"+(this.$u?"UTC":"");switch(q){case u:return $?E(1,0):E(31,11);case d:return $?E(1,X):E(0,X+1);case h:var Y=this.$locale().weekStart||0,Z=(U<Y?U+7:U)-Y;return E($?K-Z:K+(6-Z),X);case c:case g:return G(Q+"Hours",0);case l:return G(Q+"Minutes",1);case n:return G(Q+"Seconds",2);case a:return G(Q+"Milliseconds",3);default:return this.clone()}},M.endOf=function(F){return this.startOf(F,!1)},M.$set=function(F,N){var P,$=I.p(F),q="set"+(this.$u?"UTC":""),E=(P={},P[c]=q+"Date",P[g]=q+"Date",P[d]=q+"Month",P[u]=q+"FullYear",P[l]=q+"Hours",P[n]=q+"Minutes",P[a]=q+"Seconds",P[s]=q+"Milliseconds",P)[$],G=$===c?this.$D+(N-this.$W):N;if($===d||$===u){var U=this.clone().set(g,1);U.$d[E](G),U.init(),this.$d=U.set(g,Math.min(this.$D,U.daysInMonth())).$d}else E&&this.$d[E](G);return this.init(),this},M.set=function(F,N){return this.clone().$set(F,N)},M.get=function(F){return this[I.p(F)]()},M.add=function(F,N){var P,$=this;F=Number(F);var q=I.p(N),E=function(X){var K=O($);return I.w(K.date(K.date()+Math.round(X*F)),$)};if(q===d)return this.set(d,this.$M+F);if(q===u)return this.set(u,this.$y+F);if(q===c)return E(1);if(q===h)return E(7);var G=(P={},P[n]=i,P[l]=o,P[a]=r,P)[q]||1,U=this.$d.getTime()+F*G;return I.w(U,this)},M.subtract=function(F,N){return this.add(-1*F,N)},M.format=function(F){var N=this,P=this.$locale();if(!this.isValid())return P.invalidDate||m;var $=F||"YYYY-MM-DDTHH:mm:ssZ",q=I.z(this),E=this.$H,G=this.$m,U=this.$M,X=P.weekdays,K=P.months,Q=P.meridiem,Y=function(at,pt,Ct,St){return at&&(at[pt]||at(N,$))||Ct[pt].slice(0,St)},Z=function(at){return I.s(E%12||12,at,"0")},J=Q||function(at,pt,Ct){var St=at<12?"AM":"PM";return Ct?St.toLowerCase():St};return $.replace(x,(function(at,pt){return pt||(function(Ct){switch(Ct){case"YY":return String(N.$y).slice(-2);case"YYYY":return I.s(N.$y,4,"0");case"M":return U+1;case"MM":return I.s(U+1,2,"0");case"MMM":return Y(P.monthsShort,U,K,3);case"MMMM":return Y(K,U);case"D":return N.$D;case"DD":return I.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return Y(P.weekdaysMin,N.$W,X,2);case"ddd":return Y(P.weekdaysShort,N.$W,X,3);case"dddd":return X[N.$W];case"H":return String(E);case"HH":return I.s(E,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return J(E,G,!0);case"A":return J(E,G,!1);case"m":return String(G);case"mm":return I.s(G,2,"0");case"s":return String(N.$s);case"ss":return I.s(N.$s,2,"0");case"SSS":return I.s(N.$ms,3,"0");case"Z":return q}return null})(at)||q.replace(":","")}))},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(F,N,P){var $,q=this,E=I.p(N),G=O(F),U=(G.utcOffset()-this.utcOffset())*i,X=this-G,K=function(){return I.m(q,G)};switch(E){case u:$=K()/12;break;case d:$=K();break;case f:$=K()/3;break;case h:$=(X-U)/6048e5;break;case c:$=(X-U)/864e5;break;case l:$=X/o;break;case n:$=X/i;break;case a:$=X/r;break;default:$=X}return P?$:I.a($)},M.daysInMonth=function(){return this.endOf(d).$D},M.$locale=function(){return T[this.$L]},M.locale=function(F,N){if(!F)return this.$L;var P=this.clone(),$=D(F,N,!0);return $&&(P.$L=$),P},M.clone=function(){return I.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},A})(),z=j.prototype;return O.prototype=z,[["$ms",s],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",u],["$D",g]].forEach((function(A){z[A[1]]=function(M){return this.$g(M,A[0],A[1])}})),O.extend=function(A,M){return A.$i||(A(M,j,O),A.$i=!0),O},O.locale=D,O.isDayjs=_,O.unix=function(A){return O(1e3*A)},O.en=T[v],O.Ls=T,O.p={},O}))})(Cs)),Cs.exports}var _1=T1();const Au=xu(_1);var sr={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},V={trace:p((...e)=>{},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},Nl=p(function(e="fatal"){let t=sr.fatal;typeof e=="string"?e.toLowerCase()in sr&&(t=sr[e]):typeof e=="number"&&(t=e),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},t<=sr.fatal&&(V.fatal=console.error?console.error.bind(console,ve("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ve("FATAL"))),t<=sr.error&&(V.error=console.error?console.error.bind(console,ve("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ve("ERROR"))),t<=sr.warn&&(V.warn=console.warn?console.warn.bind(console,ve("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ve("WARN"))),t<=sr.info&&(V.info=console.info?console.info.bind(console,ve("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ve("INFO"))),t<=sr.debug&&(V.debug=console.debug?console.debug.bind(console,ve("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ve("DEBUG"))),t<=sr.trace&&(V.trace=console.debug?console.debug.bind(console,ve("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ve("TRACE")))},"setLogLevel"),ve=p(e=>`%c${Au().format("ss.SSS")} : ${e} : `,"format");const bs={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return bs.hue2rgb(s,o,e+1/3)*255;case"g":return bs.hue2rgb(s,o,e)*255;case"b":return bs.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},B1={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},L1={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},gt={channel:bs,lang:B1,unit:L1},Cr={};for(let e=0;e<=255;e++)Cr[e]=gt.unit.dec2hex(e);const ae={ALL:0,RGB:1,HSL:2};class E1{constructor(){this.type=ae.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=ae.ALL}is(t){return this.type===t}}class F1{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new E1}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=ae.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=gt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=gt.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=gt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=gt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=gt.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=gt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(ae.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(ae.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(ae.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(ae.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(ae.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(ae.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(ae.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(ae.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(ae.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(ae.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(ae.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(ae.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ya=new F1({r:0,g:0,b:0,a:0},"transparent"),wi={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(wi.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return ya.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${Cr[Math.round(t)]}${Cr[Math.round(r)]}${Cr[Math.round(i)]}${Cr[Math.round(o*255)]}`:`#${Cr[Math.round(t)]}${Cr[Math.round(r)]}${Cr[Math.round(i)]}`}},Hr={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(Hr.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return gt.channel.clamp.h(parseFloat(r)*.9);case"rad":return gt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return gt.channel.clamp.h(parseFloat(r)*360)}}return gt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Hr.re);if(!r)return;const[,i,o,s,a,n]=r;return ya.set({h:Hr._hue2deg(i),s:gt.channel.clamp.s(parseFloat(o)),l:gt.channel.clamp.l(parseFloat(s)),a:a?gt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${gt.lang.round(t)}, ${gt.lang.round(r)}%, ${gt.lang.round(i)}%, ${o})`:`hsl(${gt.lang.round(t)}, ${gt.lang.round(r)}%, ${gt.lang.round(i)}%)`}},Lo={colors:{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",cyanaqua:"#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",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Lo.colors[e];if(t)return wi.parse(t)},stringify:e=>{const t=wi.stringify(e);for(const r in Lo.colors)if(Lo.colors[r]===t)return r}},bo={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(bo.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return ya.set({r:gt.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:gt.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:gt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?gt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${gt.lang.round(t)}, ${gt.lang.round(r)}, ${gt.lang.round(i)}, ${gt.lang.round(o)})`:`rgb(${gt.lang.round(t)}, ${gt.lang.round(r)}, ${gt.lang.round(i)})`}},Ne={format:{keyword:Lo,hex:wi,rgb:bo,rgba:bo,hsl:Hr,hsla:Hr},parse:e=>{if(typeof e!="string")return e;const t=wi.parse(e)||bo.parse(e)||Hr.parse(e)||Lo.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(ae.HSL)||e.data.r===void 0?Hr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?bo.stringify(e):wi.stringify(e)},Mu=(e,t)=>{const r=Ne.parse(e);for(const i in t)r[i]=gt.channel.clamp[i](t[i]);return Ne.stringify(r)},cr=(e,t,r=0,i=1)=>{if(typeof e!="number")return Mu(e,{a:t});const o=ya.set({r:gt.channel.clamp.r(e),g:gt.channel.clamp.g(t),b:gt.channel.clamp.b(r),a:gt.channel.clamp.a(i)});return Ne.stringify(o)},A1=e=>{const{r:t,g:r,b:i}=Ne.parse(e),o=.2126*gt.channel.toLinear(t)+.7152*gt.channel.toLinear(r)+.0722*gt.channel.toLinear(i);return gt.lang.round(o)},M1=e=>A1(e)>=.5,Ee=e=>!M1(e),ql=(e,t,r)=>{const i=Ne.parse(e),o=i[t],s=gt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Ne.stringify(i)},W=(e,t)=>ql(e,"l",t),H=(e,t)=>ql(e,"l",-t),b=(e,t)=>{const r=Ne.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return Mu(e,i)},$1=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Ne.parse(e),{r:n,g:l,b:c,a:h}=Ne.parse(t),d=r/100,f=d*2-1,u=a-h,m=((f*u===-1?f:(f+u)/(1+f*u))+1)/2,y=1-m,x=i*m+n*y,C=o*m+l*y,k=s*m+c*y,S=a*d+h*(1-d);return cr(x,C,k,S)},R=(e,t=100)=>{const r=Ne.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,$1(r,e,t)};var An=p((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>An(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=An(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),zt=An,er="#ffffff",rr="#f2f2f2",ft=p((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),Ti,O1=(Ti=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||H(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||W(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||H(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,10)):(this.rowOdd=this.rowOdd||W(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||W(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=H(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=H(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)):(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Ti,"Theme"),Ti),R1=p(e=>{const t=new O1;return t.calculate(e),t},"getThemeVariables"),_i,I1=(_i=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=W(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=W(R("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=cr(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=H("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=H(this.sectionBkgColor,10),this.taskBorderColor=cr(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=cr(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||W(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=W(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=W(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=W(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=R(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||R(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||W(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??W(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=W(this.secondaryColor,20),this.git1=W(this.pie2||this.secondaryColor,20),this.git2=W(this.pie3||this.tertiaryColor,20),this.git3=W(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=W(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=W(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=W(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=W(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||R(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||R(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||W("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||W("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||W("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||W("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||W(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||W(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||W(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||W(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(_i,"Theme"),_i),P1=p(e=>{const t=new I1;return t.calculate(e),t},"getThemeVariables"),Bi,D1=(Bi=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=b(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=cr(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||H(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||H(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=H(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||R(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||R(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||W(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||W(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||b(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||b(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)):(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)),this.gitInv0=this.gitInv0||H(R(this.git0),25),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||R(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||R(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Bi,"Theme"),Bi),$u=p(e=>{const t=new D1;return t.calculate(e),t},"getThemeVariables"),Li,N1=(Li=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=W("#cde498",10),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.primaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=H(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||H(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||H(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=H(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||W(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||W(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-30}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)):(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||R(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||R(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Li,"Theme"),Li),q1=p(e=>{const t=new N1;return t.calculate(e),t},"getThemeVariables"),Ei,z1=(Ei=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=W(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||W(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=W(this.contrast,55),this.border2=this.contrast,this.actorBorder=W(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||R(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||W(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=W(this.contrast,30),this.sectionBkgColor2=W(this.contrast,30),this.taskBorderColor=H(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=W(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=H(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=H(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||b(this.primaryColor,{h:-30}),this.git4=this.pie5||b(this.primaryColor,{h:-60}),this.git5=this.pie6||b(this.primaryColor,{h:-90}),this.git6=this.pie7||b(this.primaryColor,{h:60}),this.git7=this.pie8||b(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Ei,"Theme"),Ei),j1=p(e=>{const t=new z1;return t.calculate(e),t},"getThemeVariables"),Fi,W1=(Fi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||H(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||W(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||b(t,{h:30}),this.cScale4=this.cScale4||b(t,{h:60}),this.cScale5=this.cScale5||b(t,{h:90}),this.cScale6=this.cScale6||b(t,{h:120}),this.cScale7=this.cScale7||b(t,{h:150}),this.cScale8=this.cScale8||b(t,{h:210,l:150}),this.cScale9=this.cScale9||b(t,{h:270}),this.cScale10=this.cScale10||b(t,{h:300}),this.cScale11=this.cScale11||b(t,{h:330}),this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=H(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=H(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||R(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||W(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)):(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Fi,"Theme"),Fi),H1=p(e=>{const t=new W1;return t.calculate(e),t},"getThemeVariables"),Ai,Y1=(Ai=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=W(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=W(R("#323D47"),10),this.border1="#ccc",this.border2=cr(255,255,255,.25),this.arrowheadColor=R(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||H(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||W(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=H(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=H(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)):(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Ai,"Theme"),Ai),U1=p(e=>{const t=new Y1;return t.calculate(e),t},"getThemeVariables"),Mi,G1=(Mi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ft("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||H(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||W(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=this.mainBkg;if(this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=H(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=H(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||R(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||W(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)):(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Mi,"Theme"),Mi),X1=p(e=>{const t=new G1;return t.calculate(e),t},"getThemeVariables"),$i,V1=($i=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=W(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=W(R("#323D47"),10),this.border1="#ccc",this.border2=cr(255,255,255,.25),this.arrowheadColor=R(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||H(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||W(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=H(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=H(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)):(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p($i,"Theme"),$i),K1=p(e=>{const t=new V1;return t.calculate(e),t},"getThemeVariables"),Oi,Z1=(Oi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||H(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||W(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||R(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||W(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)):(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Oi,"Theme"),Oi),Q1=p(e=>{const t=new Z1;return t.calculate(e),t},"getThemeVariables"),Ri,J1=(Ri=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=W(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=W(R("#323D47"),10),this.border1="#ccc",this.border2=cr(255,255,255,.25),this.arrowheadColor=R(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||H(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||W(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=H(this["cScale"+r],75);const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ee(this.quadrant1Fill)?W(this.quadrant1Fill):H(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?H(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)):(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||er,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||rr}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Ri,"Theme"),Ri),tk=p(e=>{const t=new J1;return t.calculate(e),t},"getThemeVariables"),dr={base:{getThemeVariables:R1},dark:{getThemeVariables:P1},default:{getThemeVariables:$u},forest:{getThemeVariables:q1},neutral:{getThemeVariables:j1},neo:{getThemeVariables:H1},"neo-dark":{getThemeVariables:U1},redux:{getThemeVariables:X1},"redux-dark":{getThemeVariables:K1},"redux-color":{getThemeVariables:Q1},"redux-dark-color":{getThemeVariables:tk}},ee={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Ou={...ee,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:dr.default.getThemeVariables(),sequence:{...ee.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...ee.gantt,tickInterval:void 0,useWidth:void 0},c4:{...ee.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...ee.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...ee.pie,useWidth:984},xyChart:{...ee.xyChart,useWidth:void 0},requirement:{...ee.requirement,useWidth:void 0},packet:{...ee.packet},eventmodeling:{...ee.eventmodeling},treeView:{...ee.treeView,useWidth:void 0},radar:{...ee.radar},railroad:{...ee.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...ee.ishikawa},sankey:{...ee.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...ee.venn},cynefin:{...ee.cynefin}},Ru=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Ru(e[i],"")]:[...r,t+i],[]),"keyify"),ek=new Set(Ru(Ou,"")),zl=Ou,rk={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},ik=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(V.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),Rs=p(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Rs(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!ek.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=rk[t];i?ik(e[t],i):(V.debug("sanitizing object",t),Rs(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=Iu(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}V.debug("After sanitization",e)}},"sanitizeDirective"),Iu=p(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),ji=Object.freeze(zl),ir=p(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Ce=zt({},ji),Is,Zr=[],Eo=zt({},ji),xa=p((e,t)=>{let r=zt({},e),i={};for(const o of t)Nu(o),i=zt(i,o);if(r=zt(r,i),i.theme&&i.theme in dr){const o=zt({},Is),s=zt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in dr&&(r.themeVariables=dr[r.theme].getThemeVariables(s))}return Eo=r,zu(Eo),Eo},"updateCurrentConfig"),ok=p(e=>(Ce=zt({},ji),Ce=zt(Ce,e),e.theme&&dr[e.theme]&&(Ce.themeVariables=dr[e.theme].getThemeVariables(e.themeVariables)),xa(Ce,Zr),Ce),"setSiteConfig"),sk=p(e=>{Is=zt({},e)},"saveConfigFromInitialize"),ak=p(e=>(Ce=zt(Ce,e),xa(Ce,Zr),Ce),"updateSiteConfig"),Pu=p(()=>zt({},Ce),"getSiteConfig"),Du=p(e=>(zu(e),zt(Eo,e),Rt()),"setConfig"),Rt=p(()=>zt({},Eo),"getConfig"),Nu=p(e=>{e&&(["secure",...Ce.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(V.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&Nu(e[t])}))},"sanitize"),nk=p(e=>{Rs(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Zr.push(e),xa(Ce,Zr)},"addDirective"),Ps=p((e=Ce)=>{Zr=[],xa(e,Zr)},"reset"),lk={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},vc={},qu=p(e=>{vc[e]||(V.warn(lk[e]),vc[e]=!0)},"issueWarning"),zu=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&qu("LAZY_LOAD_DEPRECATED")},"checkConfig"),hk=p(()=>{let e={};Is&&(e=zt(e,Is));for(const t of Zr)e=zt(e,t);return e},"getUserDefinedConfig"),he=p(e=>(e.flowchart?.htmlLabels!=null&&qu("FLOWCHART_HTML_LABELS_DEPRECATED"),ir(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),ju=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Fo=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ck=/\s*%%.*\n/gm,Ii,Wu=(Ii=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(Ii,"UnknownDiagramError"),Ii),Qr={},jl=p(function(e,t){e=e.replace(ju,"").replace(Fo,"").replace(ck,`
|
|
8
|
+
`);for(const[r,{detector:i}]of Object.entries(Qr))if(i(e,t))return r;throw new Wu(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Mn=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)Hu(t,r,i)},"registerLazyLoadedDiagrams"),Hu=p((e,t,r)=>{Qr[e]&&V.warn(`Detector with key ${e} already exists. Overwriting.`),Qr[e]={detector:t,loader:r},V.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),dk=p(e=>Qr[e].loader,"getDiagramLoader"),Zi=/<br\s*\/?>/gi,uk=p(e=>e?Gu(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),fk=(()=>{let e=!1;return()=>{e||(Yu(),e=!0)}})();function Yu(){const e="data-temp-href-target";qi.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),qi.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(Yu,"setupDompurifyHooks");var Uu=p(e=>(fk(),qi.sanitize(e)),"removeScript"),Tc=p((e,t)=>{if(he(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Uu(e):r!=="loose"&&(e=Gu(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=yk(e))}return e},"sanitizeMore"),Be=p((e,t)=>e&&(t.dompurifyConfig?e=qi.sanitize(Tc(e,t),t.dompurifyConfig).toString():e=qi.sanitize(Tc(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),gk=p((e,t)=>typeof e=="string"?Be(e,t):e.flat().map(r=>Be(r,t)),"sanitizeTextOrArray"),pk=p(e=>Zi.test(e),"hasBreaks"),mk=p(e=>e.split(Zi),"splitBreaks"),yk=p(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),Gu=p(e=>e.replace(Zi,"#br#"),"breakToPlaceholder"),Xu=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),xk=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),Ck=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),$n=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const s=t[i-1],a=t[i+1];bk(s,a)&&(o=s+","+a,i++,r.pop())}r.push(kk(o))}return r.join("")},"parseGenericTypes"),On=p((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),bk=p((e,t)=>{const r=On(e,"~"),i=On(t,"~");return r===1&&i===1},"shouldCombineSets"),kk=p(e=>{const t=On(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),_c=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Rn=/\$\$(.*?)\$\$/g,Wi=p(e=>(e.match(Rn)?.length??0)>0,"hasKatex"),wk=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Wl(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),Sk=p(async(e,t)=>{if(!Wi(e))return e;if(!(_c()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Rn,"MathML is unsupported in this environment.");{const{default:r}=await import("katex"),i=t.forceLegacyMathML||!_c()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Zi).map(o=>Wi(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(Rn,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Wl=p(async(e,t)=>Be(await Sk(e,t),t),"renderKatexSanitized"),Qi={getRows:uk,sanitizeText:Be,sanitizeTextOrArray:gk,hasBreaks:pk,splitBreaks:mk,lineBreakRegex:Zi,removeScript:Uu,getUrl:Xu,evaluate:ir,getMax:xk,getMin:Ck},vk=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Tk=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),Hl=p(function(e,t,r,i){const o=Tk(t,r,i);vk(e,o)},"configureSvgSize"),Vu=p(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;V.info(`SVG bounds: ${s}x${a}`,o);let n=0,l=0;V.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=a+r*2,V.info(`Calculated bounds: ${n}x${l}`),Hl(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),ks={};function In(e){return[...e.cssRules].map(t=>t.cssText).join(`
|
|
9
|
+
`)}p(In,"cssStyleSheetToString");var _k=p((e,t,r,i)=>{let o="";return e in ks&&ks[e]?o=ks[e]({...r,svgId:i}):V.warn(`No theme found for ${e}`),` & {
|
|
10
|
+
font-family: ${r.fontFamily};
|
|
11
|
+
font-size: ${r.fontSize};
|
|
12
|
+
fill: ${r.textColor}
|
|
13
|
+
}
|
|
14
|
+
@keyframes edge-animation-frame {
|
|
15
|
+
from {
|
|
16
|
+
stroke-dashoffset: 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
@keyframes dash {
|
|
20
|
+
to {
|
|
21
|
+
stroke-dashoffset: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
& .edge-animation-slow {
|
|
25
|
+
stroke-dasharray: 9,5 !important;
|
|
26
|
+
stroke-dashoffset: 900;
|
|
27
|
+
animation: dash 50s linear infinite;
|
|
28
|
+
stroke-linecap: round;
|
|
29
|
+
}
|
|
30
|
+
& .edge-animation-fast {
|
|
31
|
+
stroke-dasharray: 9,5 !important;
|
|
32
|
+
stroke-dashoffset: 900;
|
|
33
|
+
animation: dash 20s linear infinite;
|
|
34
|
+
stroke-linecap: round;
|
|
35
|
+
}
|
|
36
|
+
/* Classes common for multiple diagrams */
|
|
37
|
+
|
|
38
|
+
& .error-icon {
|
|
39
|
+
fill: ${r.errorBkgColor};
|
|
40
|
+
}
|
|
41
|
+
& .error-text {
|
|
42
|
+
fill: ${r.errorTextColor};
|
|
43
|
+
stroke: ${r.errorTextColor};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
& .edge-thickness-normal {
|
|
47
|
+
stroke-width: ${r.strokeWidth??1}px;
|
|
48
|
+
}
|
|
49
|
+
& .edge-thickness-thick {
|
|
50
|
+
stroke-width: 3.5px
|
|
51
|
+
}
|
|
52
|
+
& .edge-pattern-solid {
|
|
53
|
+
stroke-dasharray: 0;
|
|
54
|
+
}
|
|
55
|
+
& .edge-thickness-invisible {
|
|
56
|
+
stroke-width: 0;
|
|
57
|
+
fill: none;
|
|
58
|
+
}
|
|
59
|
+
& .edge-pattern-dashed{
|
|
60
|
+
stroke-dasharray: 3;
|
|
61
|
+
}
|
|
62
|
+
.edge-pattern-dotted {
|
|
63
|
+
stroke-dasharray: 2;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
& .marker {
|
|
67
|
+
fill: ${r.lineColor};
|
|
68
|
+
stroke: ${r.lineColor};
|
|
69
|
+
}
|
|
70
|
+
& .marker.cross {
|
|
71
|
+
stroke: ${r.lineColor};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
& svg {
|
|
75
|
+
font-family: ${r.fontFamily};
|
|
76
|
+
font-size: ${r.fontSize};
|
|
77
|
+
}
|
|
78
|
+
& p {
|
|
79
|
+
margin: 0
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
${o}
|
|
83
|
+
.node .neo-node {
|
|
84
|
+
stroke: ${r.nodeBorder};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
|
|
88
|
+
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
89
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
90
|
+
}
|
|
91
|
+
[data-look="neo"].swimlane.cluster rect {
|
|
92
|
+
filter: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
[data-look="neo"].node path {
|
|
97
|
+
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
98
|
+
stroke-width: ${r.strokeWidth??1}px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-look="neo"].node .outer-path {
|
|
102
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-look="neo"].node .neo-line path {
|
|
106
|
+
stroke: ${r.nodeBorder};
|
|
107
|
+
filter: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[data-look="neo"].node circle{
|
|
111
|
+
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
112
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[data-look="neo"].node circle .state-start{
|
|
116
|
+
fill: #000000;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
[data-look="neo"].icon-shape .icon {
|
|
120
|
+
fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
121
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
[data-look="neo"].icon-shape .icon-neo path {
|
|
125
|
+
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
126
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
${t}
|
|
130
|
+
`},"getStyles"),Bk=p((e,t)=>{t!==void 0&&(ks[e]=t)},"addStylesForDiagram"),Lk=_k,Yl={};Fu(Yl,{clear:()=>Ku,getAccDescription:()=>tf,getAccTitle:()=>Qu,getDiagramTitle:()=>rf,setAccDescription:()=>Ju,setAccTitle:()=>Zu,setDiagramTitle:()=>ef});var Ul="",Gl="",Xl="",Vl=p(e=>Be(e,Rt()),"sanitizeText"),Ku=p(()=>{Ul="",Xl="",Gl=""},"clear"),Zu=p(e=>{Ul=Vl(e).replace(/^\s+/g,"")},"setAccTitle"),Qu=p(()=>Ul,"getAccTitle"),Ju=p(e=>{Xl=Vl(e).replace(/\n\s+/g,`
|
|
131
|
+
`)},"setAccDescription"),tf=p(()=>Xl,"getAccDescription"),ef=p(e=>{Gl=Vl(e)},"setDiagramTitle"),rf=p(()=>Gl,"getDiagramTitle"),Bc=V,Ek=Nl,wt=Rt,Fk=Du,Ak=ji,Kl=p(e=>Be(e,wt()),"sanitizeText"),of=Vu,Mk=p(()=>Yl,"getCommonDb"),Ds={},Ns=p((e,t,r)=>{Ds[e]&&Bc.warn(`Diagram with id ${e} already registered. Overwriting.`),Ds[e]=t,r&&Hu(e,r),Bk(e,t.styles),t.injectUtils?.(Bc,Ek,wt,Kl,of,Mk(),()=>{})},"registerDiagram"),Pn=p(e=>{if(e in Ds)return Ds[e];throw new $k(e)},"getDiagram"),Pi,$k=(Pi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},p(Pi,"DiagramNotFoundError"),Pi),Ok={value:()=>{}};function sf(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new ws(r)}function ws(e){this._=e}function Rk(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}ws.prototype=sf.prototype={constructor:ws,on:function(e,t){var r=this._,i=Rk(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(e=i[s]).type)&&(o=Ik(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(o=(e=i[s]).type)r[o]=Lc(r[o],e.name,t);else if(t==null)for(o in r)r[o]=Lc(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new ws(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,s;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,o=s.length;i<o;++i)s[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,s=i.length;o<s;++o)i[o].value.apply(t,r)}};function Ik(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function Lc(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=Ok,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Dn="http://www.w3.org/1999/xhtml";const Ec={svg:"http://www.w3.org/2000/svg",xhtml:Dn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ca(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Ec.hasOwnProperty(t)?{space:Ec[t],local:e}:e}function Pk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Dn&&t.documentElement.namespaceURI===Dn?t.createElement(e):t.createElementNS(r,e)}}function Dk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function af(e){var t=Ca(e);return(t.local?Dk:Pk)(t)}function Nk(){}function Zl(e){return e==null?Nk:function(){return this.querySelector(e)}}function qk(e){typeof e!="function"&&(e=Zl(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=new Array(a),l,c,h=0;h<a;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new Se(i,this._parents)}function zk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function jk(){return[]}function nf(e){return e==null?jk:function(){return this.querySelectorAll(e)}}function Wk(e){return function(){return zk(e.apply(this,arguments))}}function Hk(e){typeof e=="function"?e=Wk(e):e=nf(e);for(var t=this._groups,r=t.length,i=[],o=[],s=0;s<r;++s)for(var a=t[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),o.push(l));return new Se(i,o)}function lf(e){return function(){return this.matches(e)}}function hf(e){return function(t){return t.matches(e)}}var Yk=Array.prototype.find;function Uk(e){return function(){return Yk.call(this.children,e)}}function Gk(){return this.firstElementChild}function Xk(e){return this.select(e==null?Gk:Uk(typeof e=="function"?e:hf(e)))}var Vk=Array.prototype.filter;function Kk(){return Array.from(this.children)}function Zk(e){return function(){return Vk.call(this.children,e)}}function Qk(e){return this.selectAll(e==null?Kk:Zk(typeof e=="function"?e:hf(e)))}function Jk(e){typeof e!="function"&&(e=lf(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new Se(i,this._parents)}function cf(e){return new Array(e.length)}function t2(){return new Se(this._enter||this._groups.map(cf),this._parents)}function qs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}qs.prototype={constructor:qs,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function e2(e){return function(){return e}}function r2(e,t,r,i,o,s){for(var a=0,n,l=t.length,c=s.length;a<c;++a)(n=t[a])?(n.__data__=s[a],i[a]=n):r[a]=new qs(e,s[a]);for(;a<l;++a)(n=t[a])&&(o[a]=n)}function i2(e,t,r,i,o,s,a){var n,l,c=new Map,h=t.length,d=s.length,f=new Array(h),u;for(n=0;n<h;++n)(l=t[n])&&(f[n]=u=a.call(l,l.__data__,n,t)+"",c.has(u)?o[n]=l:c.set(u,l));for(n=0;n<d;++n)u=a.call(e,s[n],n,s)+"",(l=c.get(u))?(i[n]=l,l.__data__=s[n],c.delete(u)):r[n]=new qs(e,s[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(f[n])===l&&(o[n]=l)}function o2(e){return e.__data__}function s2(e,t){if(!arguments.length)return Array.from(this,o2);var r=t?i2:r2,i=this._parents,o=this._groups;typeof e!="function"&&(e=e2(e));for(var s=o.length,a=new Array(s),n=new Array(s),l=new Array(s),c=0;c<s;++c){var h=i[c],d=o[c],f=d.length,u=a2(e.call(h,h&&h.__data__,c,i)),g=u.length,m=n[c]=new Array(g),y=a[c]=new Array(g),x=l[c]=new Array(f);r(h,d,m,y,x,u,t);for(var C=0,k=0,S,v;C<g;++C)if(S=m[C]){for(C>=k&&(k=C+1);!(v=y[k])&&++k<g;);S._next=v||null}}return a=new Se(a,i),a._enter=n,a._exit=l,a}function a2(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function n2(){return new Se(this._exit||this._groups.map(cf),this._parents)}function l2(e,t,r){var i=this.enter(),o=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?s.remove():r(s),i&&o?i.merge(o).order():o}function h2(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,s=i.length,a=Math.min(o,s),n=new Array(o),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,f=n[l]=new Array(d),u,g=0;g<d;++g)(u=c[g]||h[g])&&(f[g]=u);for(;l<o;++l)n[l]=r[l];return new Se(n,this._parents)}function c2(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,s=i[o],a;--o>=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function d2(e){e||(e=u2);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s){for(var a=r[s],n=a.length,l=o[s]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new Se(o,this._parents).order()}function u2(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function f2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function g2(){return Array.from(this)}function p2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length;o<s;++o){var a=i[o];if(a)return a}return null}function m2(){let e=0;for(const t of this)++e;return e}function y2(){return!this.node()}function x2(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],s=0,a=o.length,n;s<a;++s)(n=o[s])&&e.call(n,n.__data__,s,o);return this}function C2(e){return function(){this.removeAttribute(e)}}function b2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function k2(e,t){return function(){this.setAttribute(e,t)}}function w2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function S2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function v2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function T2(e,t){var r=Ca(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?b2:C2:typeof t=="function"?r.local?v2:S2:r.local?w2:k2)(r,t))}function df(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function _2(e){return function(){this.style.removeProperty(e)}}function B2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function L2(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function E2(e,t,r){return arguments.length>1?this.each((t==null?_2:typeof t=="function"?L2:B2)(e,t,r??"")):Hi(this.node(),e)}function Hi(e,t){return e.style.getPropertyValue(t)||df(e).getComputedStyle(e,null).getPropertyValue(t)}function F2(e){return function(){delete this[e]}}function A2(e,t){return function(){this[e]=t}}function M2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function $2(e,t){return arguments.length>1?this.each((t==null?F2:typeof t=="function"?M2:A2)(e,t)):this.node()[e]}function uf(e){return e.trim().split(/^|\s+/)}function Ql(e){return e.classList||new ff(e)}function ff(e){this._node=e,this._names=uf(e.getAttribute("class")||"")}ff.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function gf(e,t){for(var r=Ql(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function pf(e,t){for(var r=Ql(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function O2(e){return function(){gf(this,e)}}function R2(e){return function(){pf(this,e)}}function I2(e,t){return function(){(t.apply(this,arguments)?gf:pf)(this,e)}}function P2(e,t){var r=uf(e+"");if(arguments.length<2){for(var i=Ql(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?I2:t?O2:R2)(r,t))}function D2(){this.textContent=""}function N2(e){return function(){this.textContent=e}}function q2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function z2(e){return arguments.length?this.each(e==null?D2:(typeof e=="function"?q2:N2)(e)):this.node().textContent}function j2(){this.innerHTML=""}function W2(e){return function(){this.innerHTML=e}}function H2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Y2(e){return arguments.length?this.each(e==null?j2:(typeof e=="function"?H2:W2)(e)):this.node().innerHTML}function U2(){this.nextSibling&&this.parentNode.appendChild(this)}function G2(){return this.each(U2)}function X2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function V2(){return this.each(X2)}function K2(e){var t=typeof e=="function"?e:af(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Z2(){return null}function Q2(e,t){var r=typeof e=="function"?e:af(e),i=t==null?Z2:typeof t=="function"?t:Zl(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function J2(){var e=this.parentNode;e&&e.removeChild(this)}function tw(){return this.each(J2)}function ew(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rw(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function iw(e){return this.select(e?rw:ew)}function ow(e){return arguments.length?this.property("__data__",e):this.node().__data__}function sw(e){return function(t){e.call(this,t,this.__data__)}}function aw(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function nw(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r<o;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function lw(e,t,r){return function(){var i=this.__on,o,s=sw(t);if(i){for(var a=0,n=i.length;a<n;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=t;return}}this.addEventListener(e.type,s,r),o={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(o):this.__on=[o]}}function hw(e,t,r){var i=aw(e+""),o,s=i.length,a;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(o=0,h=n[l];o<s;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?lw:nw,o=0;o<s;++o)this.each(n(i[o],t,r));return this}function mf(e,t,r){var i=df(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function cw(e,t){return function(){return mf(this,e,t)}}function dw(e,t){return function(){return mf(this,e,t.apply(this,arguments))}}function uw(e,t){return this.each((typeof t=="function"?dw:cw)(e,t))}function*fw(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,a;o<s;++o)(a=i[o])&&(yield a)}var yf=[null];function Se(e,t){this._groups=e,this._parents=t}function Ko(){return new Se([[document.documentElement]],yf)}function gw(){return this}Se.prototype=Ko.prototype={constructor:Se,select:qk,selectAll:Hk,selectChild:Xk,selectChildren:Qk,filter:Jk,data:s2,enter:t2,exit:n2,join:l2,merge:h2,selection:gw,order:c2,sort:d2,call:f2,nodes:g2,node:p2,size:m2,empty:y2,each:x2,attr:T2,style:E2,property:$2,classed:P2,text:z2,html:Y2,raise:G2,lower:V2,append:K2,insert:Q2,remove:tw,clone:iw,datum:ow,on:hw,dispatch:uw,[Symbol.iterator]:fw};function yt(e){return typeof e=="string"?new Se([[document.querySelector(e)]],[document.documentElement]):new Se([[e]],yf)}function ba(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Jl(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Ji(){}var Po=.7,zs=1/Po,Si="\\s*([+-]?\\d+)\\s*",Do="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pw=/^#([0-9a-f]{3,8})$/,mw=new RegExp(`^rgb\\(${Si},${Si},${Si}\\)$`),yw=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),xw=new RegExp(`^rgba\\(${Si},${Si},${Si},${Do}\\)$`),Cw=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${Do}\\)$`),bw=new RegExp(`^hsl\\(${Do},${Qe},${Qe}\\)$`),kw=new RegExp(`^hsla\\(${Do},${Qe},${Qe},${Do}\\)$`),Fc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ba(Ji,Yi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ac,formatHex:Ac,formatHex8:ww,formatHsl:Sw,formatRgb:Mc,toString:Mc});function Ac(){return this.rgb().formatHex()}function ww(){return this.rgb().formatHex8()}function Sw(){return Cf(this).formatHsl()}function Mc(){return this.rgb().formatRgb()}function Yi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=pw.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?$c(t):r===3?new ge(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ns(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ns(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=mw.exec(e))?new ge(t[1],t[2],t[3],1):(t=yw.exec(e))?new ge(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xw.exec(e))?ns(t[1],t[2],t[3],t[4]):(t=Cw.exec(e))?ns(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bw.exec(e))?Ic(t[1],t[2]/100,t[3]/100,1):(t=kw.exec(e))?Ic(t[1],t[2]/100,t[3]/100,t[4]):Fc.hasOwnProperty(e)?$c(Fc[e]):e==="transparent"?new ge(NaN,NaN,NaN,0):null}function $c(e){return new ge(e>>16&255,e>>8&255,e&255,1)}function ns(e,t,r,i){return i<=0&&(e=t=r=NaN),new ge(e,t,r,i)}function xf(e){return e instanceof Ji||(e=Yi(e)),e?(e=e.rgb(),new ge(e.r,e.g,e.b,e.opacity)):new ge}function Nn(e,t,r,i){return arguments.length===1?xf(e):new ge(e,t,r,i??1)}function ge(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}ba(ge,Nn,Jl(Ji,{brighter(e){return e=e==null?zs:Math.pow(zs,e),new ge(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Po:Math.pow(Po,e),new ge(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ge(Xr(this.r),Xr(this.g),Xr(this.b),js(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Oc,formatHex:Oc,formatHex8:vw,formatRgb:Rc,toString:Rc}));function Oc(){return`#${Yr(this.r)}${Yr(this.g)}${Yr(this.b)}`}function vw(){return`#${Yr(this.r)}${Yr(this.g)}${Yr(this.b)}${Yr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rc(){const e=js(this.opacity);return`${e===1?"rgb(":"rgba("}${Xr(this.r)}, ${Xr(this.g)}, ${Xr(this.b)}${e===1?")":`, ${e})`}`}function js(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yr(e){return e=Xr(e),(e<16?"0":"")+e.toString(16)}function Ic(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ie(e,t,r,i)}function Cf(e){if(e instanceof Ie)return new Ie(e.h,e.s,e.l,e.opacity);if(e instanceof Ji||(e=Yi(e)),!e)return new Ie;if(e instanceof Ie)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r<i)*6:r===s?a=(i-t)/n+2:a=(t-r)/n+4,n/=l<.5?s+o:2-s-o,a*=60):n=l>0&&l<1?0:a,new Ie(a,n,l,e.opacity)}function Tw(e,t,r,i){return arguments.length===1?Cf(e):new Ie(e,t,r,i??1)}function Ie(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}ba(Ie,Tw,Jl(Ji,{brighter(e){return e=e==null?zs:Math.pow(zs,e),new Ie(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Po:Math.pow(Po,e),new Ie(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new ge(on(e>=240?e-240:e+120,o,i),on(e,o,i),on(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Ie(Pc(this.h),ls(this.s),ls(this.l),js(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=js(this.opacity);return`${e===1?"hsl(":"hsla("}${Pc(this.h)}, ${ls(this.s)*100}%, ${ls(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Pc(e){return e=(e||0)%360,e<0?e+360:e}function ls(e){return Math.max(0,Math.min(1,e||0))}function on(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ka=e=>()=>e;function bf(e,t){return function(r){return e+r*t}}function _w(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function Bw(e,t){var r=t-e;return r?bf(e,r>180||r<-180?r-360*Math.round(r/360):r):ka(isNaN(e)?t:e)}function Lw(e){return(e=+e)==1?th:function(t,r){return r-t?_w(t,r,e):ka(isNaN(t)?r:t)}}function th(e,t){var r=t-e;return r?bf(e,r):ka(isNaN(e)?t:e)}const qn=(function e(t){var r=Lw(t);function i(o,s){var a=r((o=Nn(o)).r,(s=Nn(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=th(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function hr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var zn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sn=new RegExp(zn.source,"g");function Ew(e){return function(){return e}}function Fw(e){return function(t){return e(t)+""}}function kf(e,t){var r=zn.lastIndex=sn.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=zn.exec(e))&&(o=sn.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:hr(i,o)})),r=sn.lastIndex;return r<t.length&&(s=t.slice(r),n[a]?n[a]+=s:n[++a]=s),n.length<2?l[0]?Fw(l[0].x):Ew(t):(t=l.length,function(c){for(var h=0,d;h<t;++h)n[(d=l[h]).i]=d.x(c);return n.join("")})}var Dc=180/Math.PI,jn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function wf(e,t,r,i,o,s){var a,n,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(n=Math.sqrt(r*r+i*i))&&(r/=n,i/=n,l/=n),e*i<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*Dc,skewX:Math.atan(l)*Dc,scaleX:a,scaleY:n}}var hs;function Aw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jn:wf(t.a,t.b,t.c,t.d,t.e,t.f)}function Mw(e){return e==null||(hs||(hs=document.createElementNS("http://www.w3.org/2000/svg","g")),hs.setAttribute("transform",e),!(e=hs.transform.baseVal.consolidate()))?jn:(e=e.matrix,wf(e.a,e.b,e.c,e.d,e.e,e.f))}function Sf(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function s(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push("translate(",null,t,null,r);g.push({i:m-4,x:hr(c,d)},{i:m-2,x:hr(h,f)})}else(d||f)&&u.push("translate("+d+t+f+r)}function a(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(o(d)+"rotate(",null,i)-2,x:hr(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,f){c!==h?f.push({i:d.push(o(d)+"skewX(",null,i)-2,x:hr(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push(o(u)+"scale(",null,",",null,")");g.push({i:m-4,x:hr(c,d)},{i:m-2,x:hr(h,f)})}else(d!==1||f!==1)&&u.push(o(u)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,d,f),a(c.rotate,h.rotate,d,f),n(c.skewX,h.skewX,d,f),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(u){for(var g=-1,m=f.length,y;++g<m;)d[(y=f[g]).i]=y.x(u);return d.join("")}}}var $w=Sf(Aw,"px, ","px)","deg)"),Ow=Sf(Mw,", ",")",")"),Ui=0,ko=0,ho=0,vf=1e3,Ws,wo,Hs=0,Jr=0,wa=0,No=typeof performance=="object"&&performance.now?performance:Date,Tf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eh(){return Jr||(Tf(Rw),Jr=No.now()+wa)}function Rw(){Jr=0}function Ys(){this._call=this._time=this._next=null}Ys.prototype=_f.prototype={constructor:Ys,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?eh():+r)+(t==null?0:+t),!this._next&&wo!==this&&(wo?wo._next=this:Ws=this,wo=this),this._call=e,this._time=r,Wn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wn())}};function _f(e,t,r){var i=new Ys;return i.restart(e,t,r),i}function Iw(){eh(),++Ui;for(var e=Ws,t;e;)(t=Jr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ui}function Nc(){Jr=(Hs=No.now())+wa,Ui=ko=0;try{Iw()}finally{Ui=0,Dw(),Jr=0}}function Pw(){var e=No.now(),t=e-Hs;t>vf&&(wa-=t,Hs=e)}function Dw(){for(var e,t=Ws,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Ws=r);wo=e,Wn(i)}function Wn(e){if(!Ui){ko&&(ko=clearTimeout(ko));var t=e-Jr;t>24?(e<1/0&&(ko=setTimeout(Nc,e-No.now()-wa)),ho&&(ho=clearInterval(ho))):(ho||(Hs=No.now(),ho=setInterval(Pw,vf)),Ui=1,Tf(Nc))}}function qc(e,t,r){var i=new Ys;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var Nw=sf("start","end","cancel","interrupt"),qw=[],Bf=0,zc=1,Hn=2,Ss=3,jc=4,Yn=5,vs=6;function Sa(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;zw(e,r,{name:t,index:i,group:o,on:Nw,tween:qw,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Bf})}function rh(e,t){var r=qe(e,t);if(r.state>Bf)throw new Error("too late; already scheduled");return r}function or(e,t){var r=qe(e,t);if(r.state>Ss)throw new Error("too late; already running");return r}function qe(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function zw(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=_f(s,0,r.time);function s(c){r.state=zc,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,f,u;if(r.state!==zc)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===Ss)return qc(a);u.state===jc?(u.state=vs,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+h<t&&(u.state=vs,u.timer.stop(),u.on.call("cancel",e,e.__data__,u.index,u.group),delete i[h])}if(qc(function(){r.state===Ss&&(r.state=jc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=Hn,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Hn){for(r.state=Ss,o=new Array(f=r.tween.length),h=0,d=-1;h<f;++h)(u=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++d]=u);o.length=d+1}}function n(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=Yn,1),d=-1,f=o.length;++d<f;)o[d].call(e,h);r.state===Yn&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=vs,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function jw(e,t){var r=e.__transition,i,o,s=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){s=!1;continue}o=i.state>Hn&&i.state<Yn,i.state=vs,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function Ww(e){return this.each(function(){jw(this,e)})}function Hw(e,t){var r,i;return function(){var o=or(this,e),s=o.tween;if(s!==r){i=r=s;for(var a=0,n=i.length;a<n;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function Yw(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=or(this,e),a=s.tween;if(a!==i){o=(i=a).slice();for(var n={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=n;break}l===c&&o.push(n)}s.tween=o}}function Uw(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=qe(this.node(),r).tween,o=0,s=i.length,a;o<s;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((t==null?Hw:Yw)(r,e,t))}function ih(e,t,r){var i=e._id;return e.each(function(){var o=or(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return qe(o,i).value[t]}}function Lf(e,t){var r;return(typeof t=="number"?hr:t instanceof Yi?qn:(r=Yi(t))?(t=r,qn):kf)(e,t)}function Gw(e){return function(){this.removeAttribute(e)}}function Xw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttribute(e);return a===o?null:a===i?s:s=t(i=a,r)}}function Kw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?s:s=t(i=a,r)}}function Zw(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function Qw(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function Jw(e,t){var r=Ca(e),i=r==="transform"?Ow:Lf;return this.attrTween(e,typeof t=="function"?(r.local?Qw:Zw)(r,i,ih(this,"attr."+e,t)):t==null?(r.local?Xw:Gw)(r):(r.local?Kw:Vw)(r,i,t))}function tS(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function eS(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function rS(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&eS(e,s)),r}return o._value=t,o}function iS(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&tS(e,s)),r}return o._value=t,o}function oS(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=Ca(e);return this.tween(r,(i.local?rS:iS)(i,t))}function sS(e,t){return function(){rh(this,e).delay=+t.apply(this,arguments)}}function aS(e,t){return t=+t,function(){rh(this,e).delay=t}}function nS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sS:aS)(t,e)):qe(this.node(),t).delay}function lS(e,t){return function(){or(this,e).duration=+t.apply(this,arguments)}}function hS(e,t){return t=+t,function(){or(this,e).duration=t}}function cS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?lS:hS)(t,e)):qe(this.node(),t).duration}function dS(e,t){if(typeof t!="function")throw new Error;return function(){or(this,e).ease=t}}function uS(e){var t=this._id;return arguments.length?this.each(dS(t,e)):qe(this.node(),t).ease}function fS(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;or(this,e).ease=r}}function gS(e){if(typeof e!="function")throw new Error;return this.each(fS(this._id,e))}function pS(e){typeof e!="function"&&(e=lf(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new fr(i,this._parents,this._name,this._id)}function mS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,o=r.length,s=Math.min(i,o),a=new Array(i),n=0;n<s;++n)for(var l=t[n],c=r[n],h=l.length,d=a[n]=new Array(h),f,u=0;u<h;++u)(f=l[u]||c[u])&&(d[u]=f);for(;n<i;++n)a[n]=t[n];return new fr(a,this._parents,this._name,this._id)}function yS(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function xS(e,t,r){var i,o,s=yS(t)?rh:or;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function CS(e,t){var r=this._id;return arguments.length<2?qe(this.node(),r).on.on(e):this.each(xS(r,e,t))}function bS(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function kS(){return this.on("end.remove",bS(this._id))}function wS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Zl(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a<o;++a)for(var n=i[a],l=n.length,c=s[a]=new Array(l),h,d,f=0;f<l;++f)(h=n[f])&&(d=e.call(h,h.__data__,f,n))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,Sa(c[f],t,r,f,c,qe(h,r)));return new fr(s,this._parents,t,r)}function SS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=nf(e));for(var i=this._groups,o=i.length,s=[],a=[],n=0;n<o;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var f=e.call(h,h.__data__,d,l),u,g=qe(h,r),m=0,y=f.length;m<y;++m)(u=f[m])&&Sa(u,t,r,m,f,g);s.push(f),a.push(h)}return new fr(s,a,t,r)}var vS=Ko.prototype.constructor;function TS(){return new vS(this._groups,this._parents)}function _S(e,t){var r,i,o;return function(){var s=Hi(this,e),a=(this.style.removeProperty(e),Hi(this,e));return s===a?null:s===r&&a===i?o:o=t(r=s,i=a)}}function Ef(e){return function(){this.style.removeProperty(e)}}function BS(e,t,r){var i,o=r+"",s;return function(){var a=Hi(this,e);return a===o?null:a===i?s:s=t(i=a,r)}}function LS(e,t,r){var i,o,s;return function(){var a=Hi(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),Hi(this,e))),a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n))}}function ES(e,t){var r,i,o,s="style."+t,a="end."+s,n;return function(){var l=or(this,e),c=l.on,h=l.value[s]==null?n||(n=Ef(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(a,o=h),l.on=i}}function FS(e,t,r){var i=(e+="")=="transform"?$w:Lf;return t==null?this.styleTween(e,_S(e,i)).on("end.style."+e,Ef(e)):typeof t=="function"?this.styleTween(e,LS(e,i,ih(this,"style."+e,t))).each(ES(this._id,e)):this.styleTween(e,BS(e,i,t),r).on("end.style."+e,null)}function AS(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function MS(e,t,r){var i,o;function s(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&AS(e,a,r)),i}return s._value=t,s}function $S(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,MS(e,t,r??""))}function OS(e){return function(){this.textContent=e}}function RS(e){return function(){var t=e(this);this.textContent=t??""}}function IS(e){return this.tween("text",typeof e=="function"?RS(ih(this,"text",e)):OS(e==null?"":e+""))}function PS(e){return function(t){this.textContent=e.call(this,t)}}function DS(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&PS(o)),t}return i._value=e,i}function NS(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,DS(e))}function qS(){for(var e=this._name,t=this._id,r=Ff(),i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=qe(l,t);Sa(l,e,r,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new fr(i,this._parents,e,r)}function zS(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(s,a){var n={value:a},l={value:function(){--o===0&&s()}};r.each(function(){var c=or(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),o===0&&s()})}var jS=0;function fr(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function Ff(){return++jS}var ar=Ko.prototype;fr.prototype={constructor:fr,select:wS,selectAll:SS,selectChild:ar.selectChild,selectChildren:ar.selectChildren,filter:pS,merge:mS,selection:TS,transition:qS,call:ar.call,nodes:ar.nodes,node:ar.node,size:ar.size,empty:ar.empty,each:ar.each,on:CS,attr:Jw,attrTween:oS,style:FS,styleTween:$S,text:IS,textTween:NS,remove:kS,tween:Uw,delay:nS,duration:cS,ease:uS,easeVarying:gS,end:zS,[Symbol.iterator]:ar[Symbol.iterator]};function WS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var HS={time:null,delay:0,duration:250,ease:WS};function YS(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function US(e){var t,r;e instanceof fr?(t=e._id,e=e._name):(t=Ff(),(r=HS).time=eh(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&Sa(l,e,t,c,a,r||YS(l,t));return new fr(i,this._parents,e,t)}Ko.prototype.interrupt=Ww;Ko.prototype.transition=US;const Un=Math.PI,Gn=2*Un,qr=1e-6,GS=Gn-qr;function Af(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function XS(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Af;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;o<s;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}class VS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Af:XS(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,s,a){this._append`C${+t},${+r},${+i},${+o},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,i,o,s){if(t=+t,r=+r,i=+i,o=+o,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,n=this._y1,l=i-t,c=o-r,h=a-t,d=n-r,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(f>qr)if(!(Math.abs(d*l-c*h)>qr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let u=i-a,g=o-n,m=l*l+c*c,y=u*u+g*g,x=Math.sqrt(m),C=Math.sqrt(f),k=s*Math.tan((Un-Math.acos((m+f-y)/(2*x*C)))/2),S=k/C,v=k/x;Math.abs(S-1)>qr&&this._append`L${t+S*h},${r+S*d}`,this._append`A${s},${s},0,0,${+(d*u>h*g)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^a,f=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>qr||Math.abs(this._y1-h)>qr)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%Gn+Gn),f>GS?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:f>qr&&this._append`A${i},${i},0,${+(f>=Un)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function zr(e){return function(){return e}}const KS=Math.abs,ZS=Math.atan2,QS=Math.cos,JS=Math.max,tv=Math.min,ev=Math.sin,rv=Math.sqrt,Xn=1e-12,va=Math.PI,Vn=va/2,iv=2*va;function ov(e){return e>1?0:e<-1?va:Math.acos(e)}function sv(e){return e>=1?Vn:e<=-1?-Vn:Math.asin(e)}function Mf(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new VS(t)}function $f(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Of(e){this._context=e}Of.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ao(e){return new Of(e)}function av(e){return e[0]}function nv(e){return e[1]}function Rf(e,t){var r=zr(!0),i=null,o=Ao,s=null,a=Mf(n);e=typeof e=="function"?e:e===void 0?av:zr(e),t=typeof t=="function"?t:t===void 0?nv:zr(t);function n(l){var c,h=(l=$f(l)).length,d,f=!1,u;for(i==null&&(s=o(u=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(d,c,l),+t(d,c,l));if(u)return s=null,u+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:zr(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:zr(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:zr(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(s=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=s=null:s=o(i=l),n):i},n}class If{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Pf(e){return new If(e,!0)}function Df(e){return new If(e,!1)}function vr(){}function Us(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Ta(e){this._context=e}Ta.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Us(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Us(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Gs(e){return new Ta(e)}function Nf(e){this._context=e}Nf.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Us(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lv(e){return new Nf(e)}function qf(e){this._context=e}qf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:Us(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hv(e){return new qf(e)}function zf(e,t){this._basis=new Ta(e),this._beta=t}zf.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const cv=(function e(t){function r(i){return t===1?new Ta(i):new zf(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function Xs(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function oh(e,t){this._context=e,this._k=(1-t)/6}oh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Xs(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Xs(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const jf=(function e(t){function r(i){return new oh(i,t)}return r.tension=function(i){return e(+i)},r})(0);function sh(e,t){this._context=e,this._k=(1-t)/6}sh.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Xs(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const dv=(function e(t){function r(i){return new sh(i,t)}return r.tension=function(i){return e(+i)},r})(0);function ah(e,t){this._context=e,this._k=(1-t)/6}ah.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xs(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const uv=(function e(t){function r(i){return new ah(i,t)}return r.tension=function(i){return e(+i)},r})(0);function nh(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Xn){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Xn){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,s,a,e._x2,e._y2)}function Wf(e,t){this._context=e,this._alpha=t}Wf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:nh(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Hf=(function e(t){function r(i){return t?new Wf(i,t):new oh(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Yf(e,t){this._context=e,this._alpha=t}Yf.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:nh(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const fv=(function e(t){function r(i){return t?new Yf(i,t):new sh(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Uf(e,t){this._context=e,this._alpha=t}Uf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:nh(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const gv=(function e(t){function r(i){return t?new Uf(i,t):new ah(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Gf(e){this._context=e}Gf.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function pv(e){return new Gf(e)}function Wc(e){return e<0?-1:1}function Hc(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(Wc(s)+Wc(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function Yc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function an(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function Vs(e){this._context=e}Vs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:an(this,this._t0,Yc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,an(this,Yc(this,r=Hc(this,e,t)),r);break;default:an(this,this._t0,r=Hc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Xf(e){this._context=new Vf(e)}(Xf.prototype=Object.create(Vs.prototype)).point=function(e,t){Vs.prototype.point.call(this,t,e)};function Vf(e){this._context=e}Vf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function Kf(e){return new Vs(e)}function Zf(e){return new Xf(e)}function Qf(e){this._context=e}Qf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=Uc(e),o=Uc(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(i[0][s],o[0][s],i[1][s],o[1][s],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Uc(e){var t,r=e.length-1,i,o=new Array(r),s=new Array(r),a=new Array(r);for(o[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(o[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-o[t+1];return[o,s]}function Jf(e){return new Qf(e)}function _a(e,t){this._context=e,this._t=t}_a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function tg(e){return new _a(e,.5)}function eg(e){return new _a(e,0)}function rg(e){return new _a(e,1)}function So(e,t,r){this.k=e,this.x=t,this.y=r}So.prototype={constructor:So,scale:function(e){return e===1?this:new So(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new So(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};So.prototype;var ig=p(e=>{const{securityLevel:t}=wt();let r=yt("body");if(t==="sandbox"){const s=yt(`#i${e}`).node()?.contentDocument??document;r=yt(s.body)}return r.select(`#${e}`)},"selectSvgElement");function lh(e){return typeof e>"u"||e===null}p(lh,"isNothing");function og(e){return typeof e=="object"&&e!==null}p(og,"isObject");function sg(e){return Array.isArray(e)?e:lh(e)?[]:[e]}p(sg,"toArray");function ag(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}p(ag,"extend");function ng(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}p(ng,"repeat");function lg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}p(lg,"isNegativeZero");var mv=lh,yv=og,xv=sg,Cv=ng,bv=lg,kv=ag,Vt={isNothing:mv,isObject:yv,toArray:xv,repeat:Cv,isNegativeZero:bv,extend:kv};function hh(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
132
|
+
|
|
133
|
+
`+e.mark.snippet),i+" "+r):i}p(hh,"formatError");function Gi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=hh(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}p(Gi,"YAMLException$1");Gi.prototype=Object.create(Error.prototype);Gi.prototype.constructor=Gi;Gi.prototype.toString=p(function(t){return this.name+": "+hh(this,t)},"toString");var be=Gi;function Ts(e,t,r,i,o){var s="",a="",n=Math.floor(o/2)-1;return i-t>n&&(s=" ... ",t=i-n+s.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}p(Ts,"getLine");function _s(e,t){return Vt.repeat(" ",t-e.length)+e}p(_s,"padStart");function hg(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,o.length).toString().length,d=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=Ts(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),d),n=Vt.repeat(" ",t.indent)+_s((e.line-l+1).toString(),h)+" | "+c.str+`
|
|
134
|
+
`+n;for(c=Ts(e.buffer,i[a],o[a],e.position,d),n+=Vt.repeat(" ",t.indent)+_s((e.line+1).toString(),h)+" | "+c.str+`
|
|
135
|
+
`,n+=Vt.repeat("-",t.indent+h+3+c.pos)+`^
|
|
136
|
+
`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)c=Ts(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),d),n+=Vt.repeat(" ",t.indent)+_s((e.line+l+1).toString(),h)+" | "+c.str+`
|
|
137
|
+
`;return n.replace(/\n$/,"")}p(hg,"makeSnippet");var wv=hg,Sv=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],vv=["scalar","sequence","mapping"];function cg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(cg,"compileStyleAliases");function dg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Sv.indexOf(r)===-1)throw new be('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=cg(t.styleAliases||null),vv.indexOf(this.kind)===-1)throw new be('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(dg,"Type$1");var le=dg;function Kn(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}p(Kn,"compileList");function ug(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(p(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}p(ug,"compileMap");function Ks(e){return this.extend(e)}p(Ks,"Schema$1");Ks.prototype.extend=p(function(t){var r=[],i=[];if(t instanceof le)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new be("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof le))throw new be("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new be("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new be("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof le))throw new be("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(Ks.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(i),o.compiledImplicit=Kn(o,"implicit"),o.compiledExplicit=Kn(o,"explicit"),o.compiledTypeMap=ug(o.compiledImplicit,o.compiledExplicit),o},"extend");var Tv=Ks,_v=new le("tag:yaml.org,2002:str",{kind:"scalar",construct:p(function(e){return e!==null?e:""},"construct")}),Bv=new le("tag:yaml.org,2002:seq",{kind:"sequence",construct:p(function(e){return e!==null?e:[]},"construct")}),Lv=new le("tag:yaml.org,2002:map",{kind:"mapping",construct:p(function(e){return e!==null?e:{}},"construct")}),Ev=new Tv({explicit:[_v,Bv,Lv]});function fg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}p(fg,"resolveYamlNull");function gg(){return null}p(gg,"constructYamlNull");function pg(e){return e===null}p(pg,"isNull");var Fv=new le("tag:yaml.org,2002:null",{kind:"scalar",resolve:fg,construct:gg,predicate:pg,represent:{canonical:p(function(){return"~"},"canonical"),lowercase:p(function(){return"null"},"lowercase"),uppercase:p(function(){return"NULL"},"uppercase"),camelcase:p(function(){return"Null"},"camelcase"),empty:p(function(){return""},"empty")},defaultStyle:"lowercase"});function mg(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}p(mg,"resolveYamlBoolean");function yg(e){return e==="true"||e==="True"||e==="TRUE"}p(yg,"constructYamlBoolean");function xg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}p(xg,"isBoolean");var Av=new le("tag:yaml.org,2002:bool",{kind:"scalar",resolve:mg,construct:yg,predicate:xg,represent:{lowercase:p(function(e){return e?"true":"false"},"lowercase"),uppercase:p(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:p(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function Cg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}p(Cg,"isHexCode");function bg(e){return 48<=e&&e<=55}p(bg,"isOctCode");function kg(e){return 48<=e&&e<=57}p(kg,"isDecCode");function wg(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Cg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!bg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!kg(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}p(wg,"resolveYamlInteger");function Sg(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}p(Sg,"constructYamlInteger");function vg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Vt.isNegativeZero(e)}p(vg,"isInteger");var Mv=new le("tag:yaml.org,2002:int",{kind:"scalar",resolve:wg,construct:Sg,predicate:vg,represent:{binary:p(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:p(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:p(function(e){return e.toString(10)},"decimal"),hexadecimal:p(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),$v=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Tg(e){return!(e===null||!$v.test(e)||e[e.length-1]==="_")}p(Tg,"resolveYamlFloat");function _g(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}p(_g,"constructYamlFloat");var Ov=/^[-+]?[0-9]+e/;function Bg(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Vt.isNegativeZero(e))return"-0.0";return r=e.toString(10),Ov.test(r)?r.replace("e",".e"):r}p(Bg,"representYamlFloat");function Lg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Vt.isNegativeZero(e))}p(Lg,"isFloat");var Rv=new le("tag:yaml.org,2002:float",{kind:"scalar",resolve:Tg,construct:_g,predicate:Lg,represent:Bg,defaultStyle:"lowercase"}),Eg=Ev.extend({implicit:[Fv,Av,Mv,Rv]}),Iv=Eg,Fg=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ag=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Mg(e){return e===null?!1:Fg.exec(e)!==null||Ag.exec(e)!==null}p(Mg,"resolveYamlTimestamp");function $g(e){var t,r,i,o,s,a,n,l=0,c=null,h,d,f;if(t=Fg.exec(e),t===null&&(t=Ag.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],d=+(t[11]||0),c=(h*60+d)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,i,o,s,a,n,l)),c&&f.setTime(f.getTime()-c),f}p($g,"constructYamlTimestamp");function Og(e){return e.toISOString()}p(Og,"representYamlTimestamp");var Pv=new le("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Mg,construct:$g,instanceOf:Date,represent:Og});function Rg(e){return e==="<<"||e===null}p(Rg,"resolveYamlMerge");var Dv=new le("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Rg}),ch=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
138
|
+
\r`;function Ig(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=ch;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}p(Ig,"resolveYamlBinary");function Pg(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=ch,a=0,n=[];for(t=0;t<o;t++)t%4===0&&t&&(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)):r===18?(n.push(a>>10&255),n.push(a>>2&255)):r===12&&n.push(a>>4&255),new Uint8Array(n)}p(Pg,"constructYamlBinary");function Dg(e){var t="",r=0,i,o,s=e.length,a=ch;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}p(Dg,"representYamlBinary");function Ng(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}p(Ng,"isBinary");var Nv=new le("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Ig,construct:Pg,predicate:Ng,represent:Dg}),qv=Object.prototype.hasOwnProperty,zv=Object.prototype.toString;function qg(e){if(e===null)return!0;var t=[],r,i,o,s,a,n=e;for(r=0,i=n.length;r<i;r+=1){if(o=n[r],a=!1,zv.call(o)!=="[object Object]")return!1;for(s in o)if(qv.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}p(qg,"resolveYamlOmap");function zg(e){return e!==null?e:[]}p(zg,"constructYamlOmap");var jv=new le("tag:yaml.org,2002:omap",{kind:"sequence",resolve:qg,construct:zg}),Wv=Object.prototype.toString;function jg(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],Wv.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}p(jg,"resolveYamlPairs");function Wg(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}p(Wg,"constructYamlPairs");var Hv=new le("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:jg,construct:Wg}),Yv=Object.prototype.hasOwnProperty;function Hg(e){if(e===null)return!0;var t,r=e;for(t in r)if(Yv.call(r,t)&&r[t]!==null)return!1;return!0}p(Hg,"resolveYamlSet");function Yg(e){return e!==null?e:{}}p(Yg,"constructYamlSet");var Uv=new le("tag:yaml.org,2002:set",{kind:"mapping",resolve:Hg,construct:Yg}),Ug=Iv.extend({implicit:[Pv,Dv],explicit:[Nv,jv,Hv,Uv]}),Tr=Object.prototype.hasOwnProperty,Zs=1,Gg=2,Xg=3,Qs=4,nn=1,Gv=2,Gc=3,Xv=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Vv=/[\x85\u2028\u2029]/,Kv=/[,\[\]\{\}]/,Vg=/^(?:!|!!|![a-z\-]+!)$/i,Kg=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Zn(e){return Object.prototype.toString.call(e)}p(Zn,"_class");function Pe(e){return e===10||e===13}p(Pe,"is_EOL");function Sr(e){return e===9||e===32}p(Sr,"is_WHITE_SPACE");function pe(e){return e===9||e===32||e===10||e===13}p(pe,"is_WS_OR_EOL");function Ur(e){return e===44||e===91||e===93||e===123||e===125}p(Ur,"is_FLOW_INDICATOR");function Zg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}p(Zg,"fromHexCode");function Qg(e){return e===120?2:e===117?4:e===85?8:0}p(Qg,"escapedHexLen");function Jg(e){return 48<=e&&e<=57?e-48:-1}p(Jg,"fromDecimalCode");function Qn(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
139
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}p(Qn,"simpleEscapeSequence");function tp(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}p(tp,"charFromCodepoint");function dh(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}p(dh,"setProperty");var ep=new Array(256),rp=new Array(256);for(Pr=0;Pr<256;Pr++)ep[Pr]=Qn(Pr)?1:0,rp[Pr]=Qn(Pr);var Pr;function ip(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ug,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}p(ip,"State$1");function uh(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=wv(r),new be(t,r)}p(uh,"generateError");function lt(e,t){throw uh(e,t)}p(lt,"throwError");function qo(e,t){e.onWarning&&e.onWarning.call(null,uh(e,t))}p(qo,"throwWarning");var Xc={YAML:p(function(t,r,i){var o,s,a;t.version!==null&<(t,"duplication of %YAML directive"),i.length!==1&<(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&<(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),a=parseInt(o[2],10),s!==1&<(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&qo(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function(t,r,i){var o,s;i.length!==2&<(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],Vg.test(o)||lt(t,"ill-formed tag handle (first argument) of the TAG directive"),Tr.call(t.tagMap,o)&<(t,'there is a previously declared suffix for "'+o+'" tag handle'),Kg.test(s)||lt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{lt(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function ur(e,t,r,i){var o,s,a,n;if(t<r){if(n=e.input.slice(t,r),i)for(o=0,s=n.length;o<s;o+=1)a=n.charCodeAt(o),a===9||32<=a&&a<=1114111||lt(e,"expected valid JSON character");else Xv.test(n)&<(e,"the stream contains non-printable characters");e.result+=n}}p(ur,"captureSegment");function Jn(e,t,r,i){var o,s,a,n;for(Vt.isObject(r)||lt(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,n=o.length;a<n;a+=1)s=o[a],Tr.call(t,s)||(dh(t,s,r[s]),i[s]=!0)}p(Jn,"mergeMappings");function Gr(e,t,r,i,o,s,a,n,l){var c,h;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),c=0,h=o.length;c<h;c+=1)Array.isArray(o[c])&<(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Zn(o[c])==="[object Object]"&&(o[c]="[object Object]");if(typeof o=="object"&&Zn(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,h=s.length;c<h;c+=1)Jn(e,t,s[c],r);else Jn(e,t,s,r);else!e.json&&!Tr.call(r,o)&&Tr.call(t,o)&&(e.line=a||e.line,e.lineStart=n||e.lineStart,e.position=l||e.position,lt(e,"duplicated mapping key")),dh(t,o,s),delete r[o];return t}p(Gr,"storeMappingPair");function Ba(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):lt(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}p(Ba,"readLineBreak");function Dt(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;Sr(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Pe(o))for(Ba(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&qo(e,"deficient indentation"),i}p(Dt,"skipSeparationSpace");function Zo(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||pe(r)))}p(Zo,"testDocumentSeparator");function La(e,t){t===1?e.result+=" ":t>1&&(e.result+=Vt.repeat(`
|
|
140
|
+
`,t-1))}p(La,"writeFoldedLines");function op(e,t,r){var i,o,s,a,n,l,c,h,d=e.kind,f=e.result,u;if(u=e.input.charCodeAt(e.position),pe(u)||Ur(u)||u===35||u===38||u===42||u===33||u===124||u===62||u===39||u===34||u===37||u===64||u===96||(u===63||u===45)&&(o=e.input.charCodeAt(e.position+1),pe(o)||r&&Ur(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,n=!1;u!==0;){if(u===58){if(o=e.input.charCodeAt(e.position+1),pe(o)||r&&Ur(o))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),pe(i))break}else{if(e.position===e.lineStart&&Zo(e)||r&&Ur(u))break;if(Pe(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,Dt(e,!1,-1),e.lineIndent>=t){n=!0,u=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(ur(e,s,a,!1),La(e,e.line-l),s=a=e.position,n=!1),Sr(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return ur(e,s,a,!1),e.result?!0:(e.kind=d,e.result=f,!1)}p(op,"readPlainScalar");function sp(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(ur(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else Pe(r)?(ur(e,i,o,!0),La(e,Dt(e,!1,t)),i=o=e.position):e.position===e.lineStart&&Zo(e)?lt(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);lt(e,"unexpected end of the stream within a single quoted scalar")}p(sp,"readSingleQuotedScalar");function ap(e,t){var r,i,o,s,a,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return ur(e,r,e.position,!0),e.position++,!0;if(n===92){if(ur(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),Pe(n))Dt(e,!1,t);else if(n<256&&ep[n])e.result+=rp[n],e.position++;else if((a=Qg(n))>0){for(o=a,s=0;o>0;o--)n=e.input.charCodeAt(++e.position),(a=Zg(n))>=0?s=(s<<4)+a:lt(e,"expected hexadecimal character");e.result+=tp(s),e.position++}else lt(e,"unknown escape sequence");r=i=e.position}else Pe(n)?(ur(e,r,i,!0),La(e,Dt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Zo(e)?lt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}lt(e,"unexpected end of the stream within a double quoted scalar")}p(ap,"readDoubleQuotedScalar");function np(e,t){var r=!0,i,o,s,a=e.tag,n,l=e.anchor,c,h,d,f,u,g=Object.create(null),m,y,x,C;if(C=e.input.charCodeAt(e.position),C===91)h=93,u=!1,n=[];else if(C===123)h=125,u=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),C=e.input.charCodeAt(++e.position);C!==0;){if(Dt(e,!0,t),C=e.input.charCodeAt(e.position),C===h)return e.position++,e.tag=a,e.anchor=l,e.kind=u?"mapping":"sequence",e.result=n,!0;r?C===44&<(e,"expected the node content, but found ','"):lt(e,"missed comma between flow collection entries"),y=m=x=null,d=f=!1,C===63&&(c=e.input.charCodeAt(e.position+1),pe(c)&&(d=f=!0,e.position++,Dt(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,ti(e,t,Zs,!1,!0),y=e.tag,m=e.result,Dt(e,!0,t),C=e.input.charCodeAt(e.position),(f||e.line===i)&&C===58&&(d=!0,C=e.input.charCodeAt(++e.position),Dt(e,!0,t),ti(e,t,Zs,!1,!0),x=e.result),u?Gr(e,n,g,y,m,x,i,o,s):d?n.push(Gr(e,null,g,y,m,x,i,o,s)):n.push(m),Dt(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}lt(e,"unexpected end of the stream within a flow collection")}p(np,"readFlowCollection");function lp(e,t){var r,i,o=nn,s=!1,a=!1,n=t,l=0,c=!1,h,d;if(d=e.input.charCodeAt(e.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)nn===o?o=d===43?Gc:Gv:lt(e,"repeat of a chomping mode identifier");else if((h=Jg(d))>=0)h===0?lt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?lt(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(Sr(d)){do d=e.input.charCodeAt(++e.position);while(Sr(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Pe(d)&&d!==0)}for(;d!==0;){for(Ba(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!a||e.lineIndent<n)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>n&&(n=e.lineIndent),Pe(d)){l++;continue}if(e.lineIndent<n){o===Gc?e.result+=Vt.repeat(`
|
|
141
|
+
`,s?1+l:l):o===nn&&s&&(e.result+=`
|
|
142
|
+
`);break}for(i?Sr(d)?(c=!0,e.result+=Vt.repeat(`
|
|
143
|
+
`,s?1+l:l)):c?(c=!1,e.result+=Vt.repeat(`
|
|
144
|
+
`,l+1)):l===0?s&&(e.result+=" "):e.result+=Vt.repeat(`
|
|
145
|
+
`,l):e.result+=Vt.repeat(`
|
|
146
|
+
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!Pe(d)&&d!==0;)d=e.input.charCodeAt(++e.position);ur(e,r,e.position,!1)}return!0}p(lp,"readBlockScalar");function tl(e,t){var r,i=e.tag,o=e.anchor,s=[],a,n=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,lt(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!pe(a))));){if(n=!0,e.position++,Dt(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,ti(e,t,Xg,!1,!0),s.push(e.result),Dt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)lt(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return n?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}p(tl,"readBlockSequence");function hp(e,t,r){var i,o,s,a,n,l,c=e.tag,h=e.anchor,d={},f=Object.create(null),u=null,g=null,m=null,y=!1,x=!1,C;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),C=e.input.charCodeAt(e.position);C!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,lt(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(C===63||C===58)&&pe(i))C===63?(y&&(Gr(e,d,f,u,g,null,a,n,l),u=g=m=null),x=!0,y=!0,o=!0):y?(y=!1,o=!0):lt(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,C=i;else{if(a=e.line,n=e.lineStart,l=e.position,!ti(e,r,Gg,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);Sr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),pe(C)||lt(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Gr(e,d,f,u,g,null,a,n,l),u=g=m=null),x=!0,y=!1,o=!1,u=e.tag,g=e.result;else if(x)lt(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=h,!0}else if(x)lt(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=h,!0}if((e.line===s||e.lineIndent>t)&&(y&&(a=e.line,n=e.lineStart,l=e.position),ti(e,t,Qs,!0,o)&&(y?g=e.result:m=e.result),y||(Gr(e,d,f,u,g,m,a,n,l),u=g=m=null),Dt(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&C!==0)lt(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Gr(e,d,f,u,g,null,a,n,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=d),x}p(hp,"readBlockMapping");function cp(e){var t,r=!1,i=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&<(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,o="!!",a=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):lt(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!pe(a);)a===33&&(i?lt(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Vg.test(o)||lt(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Kv.test(s)&<(e,"tag suffix cannot contain flow indicator characters")}s&&!Kg.test(s)&<(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{lt(e,"tag name is malformed: "+s)}return r?e.tag=s:Tr.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:lt(e,'undeclared tag handle "'+o+'"'),!0}p(cp,"readTagProperty");function dp(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&<(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!pe(r)&&!Ur(r);)r=e.input.charCodeAt(++e.position);return e.position===t&<(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}p(dp,"readAnchorProperty");function up(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!pe(i)&&!Ur(i);)i=e.input.charCodeAt(++e.position);return e.position===t&<(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Tr.call(e.anchorMap,r)||lt(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Dt(e,!0,-1),!0}p(up,"readAlias");function ti(e,t,r,i,o){var s,a,n,l=1,c=!1,h=!1,d,f,u,g,m,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=n=Qs===r||Xg===r,i&&Dt(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;cp(e)||dp(e);)Dt(e,!0,-1)?(c=!0,n=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):n=!1;if(n&&(n=c||o),(l===1||Qs===r)&&(Zs===r||Gg===r?m=t:m=t+1,y=e.position-e.lineStart,l===1?n&&(tl(e,y)||hp(e,y,m))||np(e,m)?h=!0:(a&&lp(e,m)||sp(e,m)||ap(e,m)?h=!0:up(e)?(h=!0,(e.tag!==null||e.anchor!==null)&<(e,"alias node should not have any properties")):op(e,m,Zs===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(h=n&&tl(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&<(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if(g=e.implicitTypes[d],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Tr.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,u=e.typeMap.multi[e.kind||"fallback"],d=0,f=u.length;d<f;d+=1)if(e.tag.slice(0,u[d].tag.length)===u[d].tag){g=u[d];break}g||lt(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&<(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):lt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}p(ti,"composeNode");function fp(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Dt(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!pe(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&<(e,"directive name must not be less than one character in length");a!==0;){for(;Sr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Pe(a));break}if(Pe(a))break;for(r=e.position;a!==0&&!pe(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Ba(e),Tr.call(Xc,i)?Xc[i](e,i,o):qo(e,'unknown document directive "'+i+'"')}if(Dt(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Dt(e,!0,-1)):s&<(e,"directives end mark is expected"),ti(e,e.lineIndent-1,Qs,!1,!0),Dt(e,!0,-1),e.checkLineBreaks&&Vv.test(e.input.slice(t,e.position))&&qo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Zo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Dt(e,!0,-1));return}if(e.position<e.length-1)lt(e,"end of the stream or a document separator is expected");else return}p(fp,"readDocument");function fh(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
147
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new ip(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,lt(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)fp(r);return r.documents}p(fh,"loadDocuments");function Zv(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=fh(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}p(Zv,"loadAll$1");function gp(e,t){var r=fh(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new be("expected a single document in the stream, but found more")}}p(gp,"load$1");var Qv=gp,Jv={load:Qv},pp=Object.prototype.toString,mp=Object.prototype.hasOwnProperty,gh=65279,tT=9,zo=10,eT=13,rT=32,iT=33,oT=34,el=35,sT=37,aT=38,nT=39,lT=42,yp=44,hT=45,Js=58,cT=61,dT=62,uT=63,fT=64,xp=91,Cp=93,gT=96,bp=123,pT=124,kp=125,ce={};ce[0]="\\0";ce[7]="\\a";ce[8]="\\b";ce[9]="\\t";ce[10]="\\n";ce[11]="\\v";ce[12]="\\f";ce[13]="\\r";ce[27]="\\e";ce[34]='\\"';ce[92]="\\\\";ce[133]="\\N";ce[160]="\\_";ce[8232]="\\L";ce[8233]="\\P";var mT=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],yT=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function wp(e,t){var r,i,o,s,a,n,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],n=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&mp.call(l.styleAliases,n)&&(n=l.styleAliases[n]),r[a]=n;return r}p(wp,"compileStyleMap");function Sp(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new be("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Vt.repeat("0",i-t.length)+t}p(Sp,"encodeHex");var xT=1,jo=2;function vp(e){this.schema=e.schema||Ug,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Vt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=wp(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?jo:xT,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}p(vp,"State");function rl(e,t){for(var r=Vt.repeat(" ",t),i=0,o=-1,s="",a,n=e.length;i<n;)o=e.indexOf(`
|
|
148
|
+
`,i),o===-1?(a=e.slice(i),i=n):(a=e.slice(i,o+1),i=o+1),a.length&&a!==`
|
|
149
|
+
`&&(s+=r),s+=a;return s}p(rl,"indentString");function ta(e,t){return`
|
|
150
|
+
`+Vt.repeat(" ",e.indent*t)}p(ta,"generateNextLine");function Tp(e,t){var r,i,o;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}p(Tp,"testImplicitResolving");function Wo(e){return e===rT||e===tT}p(Wo,"isWhitespace");function Xi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==gh||65536<=e&&e<=1114111}p(Xi,"isPrintable");function il(e){return Xi(e)&&e!==gh&&e!==eT&&e!==zo}p(il,"isNsCharOrWhitespace");function ol(e,t,r){var i=il(e),o=i&&!Wo(e);return(r?i:i&&e!==yp&&e!==xp&&e!==Cp&&e!==bp&&e!==kp)&&e!==el&&!(t===Js&&!o)||il(t)&&!Wo(t)&&e===el||t===Js&&o}p(ol,"isPlainSafe");function _p(e){return Xi(e)&&e!==gh&&!Wo(e)&&e!==hT&&e!==uT&&e!==Js&&e!==yp&&e!==xp&&e!==Cp&&e!==bp&&e!==kp&&e!==el&&e!==aT&&e!==lT&&e!==iT&&e!==pT&&e!==cT&&e!==dT&&e!==nT&&e!==oT&&e!==sT&&e!==fT&&e!==gT}p(_p,"isPlainSafeFirst");function Bp(e){return!Wo(e)&&e!==Js}p(Bp,"isPlainSafeLast");function bi(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}p(bi,"codePointAt");function ph(e){var t=/^\n* /;return t.test(e)}p(ph,"needIndentIndicator");var Lp=1,sl=2,Ep=3,Fp=4,gi=5;function Ap(e,t,r,i,o,s,a,n){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,g=-1,m=_p(bi(e,0))&&Bp(bi(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=bi(e,l),!Xi(c))return gi;m=m&&ol(c,h,n),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=bi(e,l),c===zo)d=!0,u&&(f=f||l-g-1>i&&e[g+1]!==" ",g=l);else if(!Xi(c))return gi;m=m&&ol(c,h,n),h=c}f=f||u&&l-g-1>i&&e[g+1]!==" "}return!d&&!f?m&&!a&&!o(e)?Lp:s===jo?gi:sl:r>9&&ph(e)?gi:a?s===jo?gi:sl:f?Fp:Ep}p(Ap,"chooseScalarStyle");function Mp(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===jo?'""':"''";if(!e.noCompatMode&&(mT.indexOf(t)!==-1||yT.test(t)))return e.quotingType===jo?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return Tp(e,c)}switch(p(l,"testAmbiguity"),Ap(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case Lp:return t;case sl:return"'"+t.replace(/'/g,"''")+"'";case Ep:return"|"+al(t,e.indent)+nl(rl(t,s));case Fp:return">"+al(t,e.indent)+nl(rl($p(t,a),s));case gi:return'"'+Op(t)+'"';default:throw new be("impossible error: invalid scalar style")}})()}p(Mp,"writeScalar");function al(e,t){var r=ph(e)?String(t):"",i=e[e.length-1]===`
|
|
151
|
+
`,o=i&&(e[e.length-2]===`
|
|
152
|
+
`||e===`
|
|
153
|
+
`),s=o?"+":i?"":"-";return r+s+`
|
|
154
|
+
`}p(al,"blockHeader");function nl(e){return e[e.length-1]===`
|
|
155
|
+
`?e.slice(0,-1):e}p(nl,"dropEndingNewline");function $p(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
|
|
156
|
+
`);return c=c!==-1?c:e.length,r.lastIndex=c,ll(e.slice(0,c),t)})(),o=e[0]===`
|
|
157
|
+
`||e[0]===" ",s,a;a=r.exec(e);){var n=a[1],l=a[2];s=l[0]===" ",i+=n+(!o&&!s&&l!==""?`
|
|
158
|
+
`:"")+ll(l,t),o=s}return i}p($p,"foldString");function ll(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-o>t&&(s=a>o?a:n,l+=`
|
|
159
|
+
`+e.slice(o,s),o=s+1),a=n;return l+=`
|
|
160
|
+
`,e.length-o>t&&a>o?l+=e.slice(o,a)+`
|
|
161
|
+
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}p(ll,"foldLine");function Op(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=bi(e,o),i=ce[r],!i&&Xi(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||Sp(r);return t}p(Op,"escapeString");function Rp(e,t,r){var i="",o=e.tag,s,a,n;for(s=0,a=r.length;s<a;s+=1)n=r[s],e.replacer&&(n=e.replacer.call(r,String(s),n)),(Je(e,t,n,!1,!1)||typeof n>"u"&&Je(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}p(Rp,"writeFlowSequence");function hl(e,t,r,i){var o="",s=e.tag,a,n,l;for(a=0,n=r.length;a<n;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(Je(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Je(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=ta(e,t)),e.dump&&zo===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}p(hl,"writeBlockSequence");function Ip(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,n,l,c,h;for(a=0,n=s.length;a<n;a+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),l=s[a],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),Je(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Je(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}p(Ip,"writeFlowMapping");function Pp(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),n,l,c,h,d,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new be("sortKeys must be a boolean or a function");for(n=0,l=a.length;n<l;n+=1)f="",(!i||o!=="")&&(f+=ta(e,t)),c=a[n],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),Je(e,t+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&zo===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=ta(e,t)),Je(e,t+1,h,!0,d)&&(e.dump&&zo===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=s,e.dump=o||"{}"}p(Pp,"writeBlockMapping");function cl(e,t,r){var i,o,s,a,n,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(n=o[s],(n.instanceOf||n.predicate)&&(!n.instanceOf||typeof t=="object"&&t instanceof n.instanceOf)&&(!n.predicate||n.predicate(t))){if(r?n.multi&&n.representName?e.tag=n.representName(t):e.tag=n.tag:e.tag="?",n.represent){if(l=e.styleMap[n.tag]||n.defaultStyle,pp.call(n.represent)==="[object Function]")i=n.represent(t,l);else if(mp.call(n.represent,l))i=n.represent[l](t,l);else throw new be("!<"+n.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(cl,"detectType");function Je(e,t,r,i,o,s,a){e.tag=null,e.dump=r,cl(e,r,!1)||cl(e,r,!0);var n=pp.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=n==="[object Object]"||n==="[object Array]",d,f;if(h&&(d=e.duplicates.indexOf(r),f=d!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(o=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(h&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(Pp(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(Ip(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?hl(e,t-1,e.dump,o):hl(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(Rp(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&Mp(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new be("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}p(Je,"writeNode");function Dp(e,t){var r=[],i=[],o,s;for(ea(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}p(Dp,"getDuplicateReferences");function ea(e,t,r){var i,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)ea(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)ea(e[i[o]],t,r)}p(ea,"inspectNode");function CT(e,t){t=t||{};var r=new vp(t);r.noRefs||Dp(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Je(r,0,i,!0,!0)?r.dump+`
|
|
162
|
+
`:""}p(CT,"dump$1");function bT(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}p(bT,"renamed");var Np=Eg,qp=Jv.load;var kT=p(e=>{const{handDrawnSeed:t}=wt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),to=p(e=>{const t=wT([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),wT=p(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),mh=p(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),st=p(e=>{const{stylesArray:t}=to(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];mh(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),it=p((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=wt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=to(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:ST(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),ST=p(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),cs={},Xt={},Vc;function vT(){return Vc||(Vc=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.BLANK_URL=Xt.relativeFirstCharacters=Xt.whitespaceEscapeCharsRegex=Xt.urlSchemeRegex=Xt.ctrlCharactersRegex=Xt.htmlCtrlEntityRegex=Xt.htmlEntitiesRegex=Xt.invalidProtocolRegex=void 0,Xt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Xt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Xt.htmlCtrlEntityRegex=/&(newline|tab);/gi,Xt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Xt.urlSchemeRegex=/^.+(:|:)/gim,Xt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Xt.relativeFirstCharacters=[".","/"],Xt.BLANK_URL="about:blank"),Xt}var Kc;function TT(){if(Kc)return cs;Kc=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.sanitizeUrl=s;var e=vT();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var f=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var u=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return u;if(f==="http:"||f==="https:"){if(!i(u))return e.BLANK_URL;var g=new URL(u);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return u}return cs}var zp=TT();function ln(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function _T(){}function jp(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Ea(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Wp="[object RegExp]",yh="[object String]",xh="[object Number]",Ch="[object Boolean]",bh="[object Arguments]",Hp="[object Symbol]",Yp="[object Date]",Up="[object Map]",Gp="[object Set]",Xp="[object Array]",Vp="[object ArrayBuffer]",Kp="[object Object]",Zp="[object DataView]",Qp="[object Uint8Array]",Jp="[object Uint8ClampedArray]",tm="[object Uint16Array]",em="[object Uint32Array]",rm="[object Int8Array]",im="[object Int16Array]",om="[object Int32Array]",sm="[object Float32Array]",am="[object Float64Array]",Zc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function kh(e){return typeof Zc.Buffer<"u"&&Zc.Buffer.isBuffer(e)}function BT(e){return Number.isSafeInteger(e)&&e>=0}function nm(e){return e!=null&&typeof e!="function"&&BT(e.length)}function LT(e){return e==="__proto__"}function Fa(e){return e==null||typeof e!="object"&&typeof e!="function"}function wh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ET(e,t){return ki(e,void 0,e,new Map,t)}function ki(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(Fa(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const a=new Array(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=ki(e[n],n,r,i,o);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;i.set(e,a);for(const[n,l]of e)a.set(n,ki(l,n,r,i,o));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const n of e)a.add(ki(n,void 0,r,i,o));return a}if(kh(e))return e.subarray();if(wh(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=ki(e[n],n,r,i,o);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,a),$e(a,e,r,i,o),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return i.set(e,a),$e(a,e,r,i,o),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return i.set(e,a),$e(a,e,r,i,o),a}if(e instanceof Error){const a=structuredClone(e);return i.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,$e(a,e,r,i,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),$e(a,e,r,i,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),$e(a,e,r,i,o),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),$e(a,e,r,i,o),a}if(typeof e=="object"&&FT(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),$e(a,e,r,i,o),a}return e}function $e(e,t,r=e,i,o){const s=[...Object.keys(t),...jp(t)];for(let a=0;a<s.length;a++){const n=s[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=ki(t[n],n,r,i,o))}}function FT(e){switch(Ea(e)){case bh:case Xp:case Vp:case Zp:case Ch:case Yp:case sm:case am:case rm:case im:case om:case Up:case xh:case Kp:case Wp:case Gp:case yh:case Hp:case Qp:case Jp:case tm:case em:return!0;default:return!1}}function AT(e,t){return ET(e,(r,i,o,s)=>{if(typeof e=="object"){if(Ea(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),$e(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case xh:case yh:case Ch:{const a=new e.constructor(e?.valueOf());return $e(a,e),a}case bh:{const a={};return $e(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Qc(e){return AT(e)}function dl(e){return e!==null&&typeof e=="object"&&Ea(e)==="[object Arguments]"}function ul(e){return typeof e=="object"&&e!==null}function MT(e){return ul(e)&&nm(e)}function Qo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Qo.Cache||Map),r}Qo.Cache=Map;function Mo(e){return wh(e)}function $T(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function OT(e){if(Fa(e))return e;if(Array.isArray(e)||wh(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function RT(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;s<r.length;s++){const a=r[s];o=Bs(o,a,i,new Map)}return o}function Bs(e,t,r,i){if(Fa(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return OT(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)t[s]=t[s]??void 0}const o=[...Object.keys(t),...jp(t)];for(let s=0;s<o.length;s++){const a=o[s];if(LT(a))continue;let n=t[a],l=e[a];if(dl(n)&&(n={...n}),dl(l)&&(l={...l}),kh(n)&&(n=Qc(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let f=0;f<d.length;f++){const u=d[f];h[u]=l[u]}l=h}else if(MT(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,n,a,e,t,i);c!==void 0?e[a]=c:Array.isArray(n)||ul(l)&&ul(n)&&(ln(l)||ln(n)||Mo(l)||Mo(n))?e[a]=Bs(l,n,r,i):l==null&&ln(n)?e[a]=Bs({},n,r,i):l==null&&Mo(n)?e[a]=Qc(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function IT(e,...t){return RT(e,...t,_T)}function Jc(e){if(e==null)return!0;if(nm(e))return typeof e.splice!="function"&&typeof e!="string"&&!kh(e)&&!Mo(e)&&!dl(e)?!1:e.length===0;if(typeof e=="object"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return $T(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var lm="",PT={curveBasis:Gs,curveBasisClosed:lv,curveBasisOpen:hv,curveBumpX:Pf,curveBumpY:Df,curveBundle:cv,curveCardinalClosed:dv,curveCardinalOpen:uv,curveCardinal:jf,curveCatmullRomClosed:fv,curveCatmullRomOpen:gv,curveCatmullRom:Hf,curveLinear:Ao,curveLinearClosed:pv,curveMonotoneX:Kf,curveMonotoneY:Zf,curveNatural:Jf,curveStep:tg,curveStepAfter:rg,curveStepBefore:eg},DT=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,NT=p(function(e,t){const r=hm(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);Rs(a),i=zt(i,[...a])}else i=r.args;if(!i)return;let o=jl(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),hm=p(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${DT.source})(?=[}][%]{2}).*
|
|
163
|
+
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),V.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=Fo.exec(e))!==null;)if(i.index===Fo.lastIndex&&Fo.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return V.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),qT=p(function(e){return e.replace(Fo,"")},"removeDirectives"),zT=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Sh(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return PT[r]??t}p(Sh,"interpolateToCurve");function cm(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?zp.sanitizeUrl(r):r}p(cm,"formatUrl");var jT=p((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){V.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function vh(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}p(vh,"distance");function dm(e){let t,r=0;e.forEach(o=>{r+=vh(o,t),t=o});const i=r/2;return Th(e,i)}p(dm,"traverseEdge");function um(e){return e.length===1?e[0]:dm(e)}p(um,"calcLabelPosition");var td=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Th=p((e,t)=>{let r,i=t;for(const o of e){if(r){const s=vh(o,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:td((1-a)*r.x+a*o.x,5),y:td((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),WT=p((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=Th(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function fm(e,t,r){const i=structuredClone(r);V.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=Th(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}p(fm,"calcTerminalLabelPosition");function _h(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}p(_h,"getStylesFromArray");var ed=0,gm=p(()=>(ed++,"id-"+Math.random().toString(36).substr(2,12)+"-"+ed),"generateId");function pm(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}p(pm,"makeRandomHex");var mm=p(e=>pm(e.length),"random"),HT=p(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),YT=p(function(e,t){const r=t.text.replace(Qi.lineBreakRegex," "),[,i]=Jo(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),ym=Qo((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Qi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=tr(`${a} `,r),c=tr(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=UT(a,t,"-",r);o.push(s,...f),s=u}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),UT=Qo((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(tr(c,i)>=t){const d=l+1,f=o.length===d,u=`${c}${r}`;s.push(f?c:u),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Bh(e,t){return Aa(e,t).height}p(Bh,"calculateTextHeight");function tr(e,t){return Aa(e,t).width}p(tr,"calculateTextWidth");var Aa=Qo((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=Jo(r),a=["sans-serif",i],n=e.split(Qi.lineBreakRegex),l=[],c=yt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const f of a){let u=0;const g={width:0,height:0,lineHeight:0};for(const m of n){const y=HT();y.text=m||lm;const x=YT(h,y).style("font-size",s).style("font-weight",o).style("font-family",f),C=(x._groups||x)[0][0].getBBox();if(C.width===0&&C.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,C.width)),u=Math.round(C.height),g.height+=u,g.lineHeight=Math.round(Math.max(g.lineHeight,u))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Di,GT=(Di=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},p(Di,"InitIDGenerator"),Di),ds,XT=p(function(e){return ds=ds||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),ds.innerHTML=e,unescape(ds.textContent)},"entityDecode");function Lh(e){return"str"in e}p(Lh,"isDetailedError");var VT=p((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Jo=p(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Ma(e,t){return IT({},e,t)}p(Ma,"cleanAndMerge");var _e={assignWithDepth:zt,wrapLabel:ym,calculateTextHeight:Bh,calculateTextWidth:tr,calculateTextDimensions:Aa,cleanAndMerge:Ma,detectInit:NT,detectDirective:hm,isSubstringInArray:zT,interpolateToCurve:Sh,calcLabelPosition:um,calcCardinalityPosition:WT,calcTerminalLabelPosition:fm,formatUrl:cm,getStylesFromArray:_h,generateId:gm,random:mm,runFunc:jT,entityDecode:XT,insertTitle:VT,isLabelCoordinateInPath:xm,parseFontSize:Jo,InitIDGenerator:GT},KT=p(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),_r=p(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),ZT=p((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Qt(e){return e??null}p(Qt,"handleUndefinedAttr");function xm(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}p(xm,"isLabelCoordinateInPath");var $a=p(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins");async function Eh(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...r].map(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=wt().fontSize?wt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=zl.fontSize]=Jo(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}p(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}p(Eh,"configureLabelImages");const QT=Object.freeze({left:0,top:0,width:16,height:16}),ra=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Cm=Object.freeze({...QT,...ra}),JT=Object.freeze({...Cm,body:"",hidden:!1}),t_=Object.freeze({width:null,height:null}),e_=Object.freeze({...t_,...ra}),r_=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return hn(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return hn(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return hn(n,r)?n:null}return null},hn=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function i_(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function rd(e,t){const r=i_(e,t);for(const i in JT)i in ra?i in e&&!(i in r)&&(r[i]=ra[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function o_(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function id(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=rd(i[n]||o[n],s)}return a(t),r.forEach(a),rd(e,s)}function s_(e,t){if(e.icons[t])return id(e,t,[]);const r=o_(e,[t])[t];return r?id(e,t,r):null}const a_=/(-?[0-9.]*[0-9]+[0-9.]*)/g,n_=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function od(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(a_);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=n_.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function l_(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("</"+t);if(o===-1||s===-1)break;const a=e.indexOf(">",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function h_(e,t){return e?"<defs>"+e+"</defs>"+t:t}function c_(e,t,r){const i=l_(e);return h_(i.defs,t+i.content+r)}const d_=e=>e==="unset"||e==="undefined"||e==="none";function u_(e,t){const r={...Cm,...e},i={...e_,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,C=m.vFlip;let k=m.rotate;x?C?k+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):C&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let S;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:S=o.height/2+o.top,y.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:S=o.width/2+o.left,y.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}k%2===1&&(o.left!==o.top&&(S=o.left,o.left=o.top,o.top=S),o.width!==o.height&&(S=o.width,o.width=o.height,o.height=S)),y.length&&(s=c_(s,'<g transform="'+y.join(" ")+'">',"</g>"))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=od(d,l/c)):(h=a==="auto"?l:a,d=n===null?od(h,c/l):n==="auto"?c:n);const f={},u=(m,y)=>{d_(y)||(f[m]=y.toString())};u("width",h),u("height",d);const g=[o.left,o.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const f_=/\sid="(\S+)"/g,sd=new Map;function g_(e){e=e.replace(/[0-9]+$/,"")||"a";const t=sd.get(e)||0;return sd.set(e,t+1),t?`${e}${t}`:e}function p_(e){const t=[];let r;for(;r=f_.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=g_(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function m_(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}var bm={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},fl=new Map,km=new Map,wm=p(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(V.debug("Registering icon pack:",t.name),"loader"in t)km.set(t.name,t.loader);else if("icons"in t)fl.set(t.name,t.icons);else throw V.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Sm=p(async(e,t)=>{const r=r_(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=fl.get(i);if(!o){const a=km.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},fl.set(i,o)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=s_(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),y_=p(async e=>{try{return await Sm(e),!0}catch{return!1}},"isIconAvailable"),eo=p(async(e,t,r)=>{let i;try{i=await Sm(e,t?.fallbackPrefix)}catch(a){V.error(a),i=bm}const o=u_(i,t),s=m_(p_(o.body),{...o.attributes,...r});return Be(s,Rt())},"getIconSVG");function Fh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ii=Fh();function vm(e){ii=e}var $o={exec:()=>null};function _t(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(me.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var x_=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),me={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},C_=/^(?:[ \t]*(?:\n|$))+/,b_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,k_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ts=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,w_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ah=/(?:[*+-]|\d{1,9}[.)])/,Tm=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_m=_t(Tm).replace(/bull/g,Ah).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),S_=_t(Tm).replace(/bull/g,Ah).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Mh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,v_=/^[^\n]+/,$h=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,T_=_t(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$h).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),__=_t(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ah).getRegex(),Oa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Oh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,B_=_t("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Oh).replace("tag",Oa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bm=_t(Mh).replace("hr",ts).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Oa).getRegex(),L_=_t(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bm).getRegex(),Rh={blockquote:L_,code:b_,def:T_,fences:k_,heading:w_,hr:ts,html:B_,lheading:_m,list:__,newline:C_,paragraph:Bm,table:$o,text:v_},ad=_t("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ts).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Oa).getRegex(),E_={...Rh,lheading:S_,table:ad,paragraph:_t(Mh).replace("hr",ts).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ad).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Oa).getRegex()},F_={...Rh,html:_t(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Oh).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$o,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_t(Mh).replace("hr",ts).replace("heading",` *#{1,6} *[^
|
|
164
|
+
]`).replace("lheading",_m).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},A_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,M_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Lm=/^( {2,}|\\)\n(?!\s*$)/,$_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ra=/[\p{P}\p{S}]/u,Ih=/[\s\p{P}\p{S}]/u,Em=/[^\s\p{P}\p{S}]/u,O_=_t(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ih).getRegex(),Fm=/(?!~)[\p{P}\p{S}]/u,R_=/(?!~)[\s\p{P}\p{S}]/u,I_=/(?:[^\s\p{P}\p{S}]|~)/u,P_=_t(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",x_?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Am=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,D_=_t(Am,"u").replace(/punct/g,Ra).getRegex(),N_=_t(Am,"u").replace(/punct/g,Fm).getRegex(),Mm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",q_=_t(Mm,"gu").replace(/notPunctSpace/g,Em).replace(/punctSpace/g,Ih).replace(/punct/g,Ra).getRegex(),z_=_t(Mm,"gu").replace(/notPunctSpace/g,I_).replace(/punctSpace/g,R_).replace(/punct/g,Fm).getRegex(),j_=_t("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Em).replace(/punctSpace/g,Ih).replace(/punct/g,Ra).getRegex(),W_=_t(/\\(punct)/,"gu").replace(/punct/g,Ra).getRegex(),H_=_t(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Y_=_t(Oh).replace("(?:-->|$)","-->").getRegex(),U_=_t("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Y_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ia=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,G_=_t(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ia).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$m=_t(/^!?\[(label)\]\[(ref)\]/).replace("label",ia).replace("ref",$h).getRegex(),Om=_t(/^!?\[(ref)\](?:\[\])?/).replace("ref",$h).getRegex(),X_=_t("reflink|nolink(?!\\()","g").replace("reflink",$m).replace("nolink",Om).getRegex(),nd=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ph={_backpedal:$o,anyPunctuation:W_,autolink:H_,blockSkip:P_,br:Lm,code:M_,del:$o,emStrongLDelim:D_,emStrongRDelimAst:q_,emStrongRDelimUnd:j_,escape:A_,link:G_,nolink:Om,punctuation:O_,reflink:$m,reflinkSearch:X_,tag:U_,text:$_,url:$o},V_={...Ph,link:_t(/^!?\[(label)\]\((.*?)\)/).replace("label",ia).getRegex(),reflink:_t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ia).getRegex()},gl={...Ph,emStrongRDelimAst:z_,emStrongLDelim:N_,url:_t(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",nd).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_t(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",nd).getRegex()},K_={...gl,br:_t(Lm).replace("{2,}","*").getRegex(),text:_t(gl.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},us={normal:Rh,gfm:E_,pedantic:F_},co={normal:Ph,gfm:gl,breaks:K_,pedantic:V_},Z_={"&":"&","<":"<",">":">",'"':""","'":"'"},ld=e=>Z_[e];function Xe(e,t){if(t){if(me.escapeTest.test(e))return e.replace(me.escapeReplace,ld)}else if(me.escapeTestNoEncode.test(e))return e.replace(me.escapeReplaceNoEncode,ld);return e}function hd(e){try{e=encodeURI(e).replace(me.percentDecode,"%")}catch{return null}return e}function cd(e,t){let r=e.replace(me.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(me.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(me.slashPipe,"|");return i}function uo(e,t,r){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function Q_(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function dd(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function J_(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
|
|
165
|
+
`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[n]=a;return n.length>=o.length?s.slice(o.length):s}).join(`
|
|
166
|
+
`)}var oa=class{options;rules;lexer;constructor(t){this.options=t||ii}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:uo(i,`
|
|
167
|
+
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=J_(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=uo(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:uo(r[0],`
|
|
168
|
+
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=uo(r[0],`
|
|
169
|
+
`).split(`
|
|
170
|
+
`),o="",s="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),n=!0;else if(!n)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
|
|
171
|
+
`),d=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
172
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
173
|
+
${h}`:h,s=s?`${s}
|
|
174
|
+
${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=f,i.length===0)break;let u=a.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let g=u,m=g.raw+`
|
|
175
|
+
`+i.join(`
|
|
176
|
+
`),y=this.blockquote(m);a[a.length-1]=y,o=o.substring(0,o.length-g.raw.length)+y.raw,s=s.substring(0,s.length-g.text.length)+y.text;break}else if(u?.type==="list"){let g=u,m=g.raw+`
|
|
177
|
+
`+i.join(`
|
|
178
|
+
`),y=this.list(m);a[a.length-1]=y,o=o.substring(0,o.length-u.raw.length)+y.raw,s=s.substring(0,s.length-g.raw.length)+y.raw,i=m.substring(a.at(-1).raw.length).split(`
|
|
179
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:a,text:s}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),o=i.length>1,s={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(`
|
|
180
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),u=t.split(`
|
|
181
|
+
`,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(u)&&(h+=u+`
|
|
182
|
+
`,t=t.substring(u.length+1),c=!0),!c){let C=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),S=this.rules.other.fencesBeginRegex(m),v=this.rules.other.headingBeginRegex(m),T=this.rules.other.htmlBeginRegex(m);for(;t;){let L=t.split(`
|
|
183
|
+
`,1)[0],_;if(u=L,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),_=u):_=u.replace(this.rules.other.tabCharGlobal," "),S.test(u)||v.test(u)||T.test(u)||C.test(u)||k.test(u))break;if(_.search(this.rules.other.nonSpaceChar)>=m||!u.trim())d+=`
|
|
184
|
+
`+_.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(f)||v.test(f)||k.test(f))break;d+=`
|
|
185
|
+
`+u}!g&&!u.trim()&&(g=!0),h+=L+`
|
|
186
|
+
`,t=t.substring(L.length+1),f=_.slice(m)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,x;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(x=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:x,loose:!1,text:d,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){let h=s.items[c].tokens.filter(f=>f.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:o,title:s}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=cd(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
187
|
+
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let n of o)this.rules.other.tableAlignRight.test(n)?a.align.push("right"):this.rules.other.tableAlignCenter.test(n)?a.align.push("center"):this.rules.other.tableAlignLeft.test(n)?a.align.push("left"):a.align.push(null);for(let n=0;n<i.length;n++)a.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:a.align[n]});for(let n of s)a.rows.push(cd(n,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
|
|
188
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=uo(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=Q_(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let o=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),dd(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[o.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return dd(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...o[0]].length-1,a,n,l=s,c=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(o=h.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(n=[...a].length,o[3]||o[4]){l+=n;continue}else if((o[5]||o[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...o[0]][0].length,f=t.slice(0,s+o.index+d+n);if(Math.min(s,n)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Oe=class pl{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ii,this.options.tokenizer=this.options.tokenizer||new oa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:me,block:us.normal,inline:co.normal};this.options.pedantic?(r.block=us.pedantic,r.inline=co.pedantic):this.options.gfm&&(r.block=us.gfm,this.options.breaks?r.inline=co.breaks:r.inline=co.gfm),this.tokenizer.rules=r}static get rules(){return{block:us,inline:co}}static lex(t,r){return new pl(r).lex(t)}static lexInline(t,r){return new pl(r).inlineTokens(t)}lex(t){t=t.replace(me.carriageReturn,`
|
|
189
|
+
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(me.tabCharGlobal," ").replace(me.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
|
|
190
|
+
`:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
191
|
+
`)?"":`
|
|
192
|
+
`)+o.raw,a.text+=`
|
|
193
|
+
`+o.text,this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
194
|
+
`)?"":`
|
|
195
|
+
`)+o.raw,a.text+=`
|
|
196
|
+
`+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),r.push(o);continue}let s=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
197
|
+
`)?"":`
|
|
198
|
+
`)+o.raw,a.text+=`
|
|
199
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o),i=s.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
200
|
+
`)?"":`
|
|
201
|
+
`)+o.raw,a.text+=`
|
|
202
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=o[2]?o[2].length:0,i=i.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(u=>{f=u.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},sa=class{options;parser;constructor(t){this.options=t||ii}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(me.notSpaceStart)?.[0],s=t.replace(me.endingNewline,"")+`
|
|
203
|
+
`;return o?'<pre><code class="language-'+Xe(o)+'">'+(i?s:Xe(s,!0))+`</code></pre>
|
|
204
|
+
`:"<pre><code>"+(i?s:Xe(s,!0))+`</code></pre>
|
|
205
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
206
|
+
${this.parser.parse(t)}</blockquote>
|
|
207
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
|
|
208
|
+
`}hr(t){return`<hr>
|
|
209
|
+
`}list(t){let r=t.ordered,i=t.start,o="";for(let n=0;n<t.items.length;n++){let l=t.items[n];o+=this.listitem(l)}let s=r?"ol":"ul",a=r&&i!==1?' start="'+i+'"':"";return"<"+s+a+`>
|
|
210
|
+
`+o+"</"+s+`>
|
|
211
|
+
`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+Xe(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
|
|
212
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
213
|
+
`}table(t){let r="",i="";for(let s=0;s<t.header.length;s++)i+=this.tablecell(t.header[s]);r+=this.tablerow({text:i});let o="";for(let s=0;s<t.rows.length;s++){let a=t.rows[s];i="";for(let n=0;n<a.length;n++)i+=this.tablecell(a[n]);o+=this.tablerow({text:i})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
214
|
+
<thead>
|
|
215
|
+
`+r+`</thead>
|
|
216
|
+
`+o+`</table>
|
|
217
|
+
`}tablerow({text:t}){return`<tr>
|
|
218
|
+
${t}</tr>
|
|
219
|
+
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
|
|
220
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Xe(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=hd(t);if(s===null)return o;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+Xe(r)+'"'),a+=">"+o+"</a>",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=hd(t);if(s===null)return Xe(i);t=s;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${Xe(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Xe(t.text)}},Dh=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Re=class ml{options;renderer;textRenderer;constructor(t){this.options=t||ii,this.options.renderer=this.options.renderer||new sa,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Dh}static parse(t,r){return new ml(r).parse(t)}static parseInline(t,r){return new ml(r).parseInline(t)}parse(t,r=!0){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=s,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let a=s;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let n=a,l=this.renderer.text(n);for(;o+1<t.length&&t[o+1].type==="text";)n=t[++o],l+=`
|
|
221
|
+
`+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=this.options.extensions.renderers[s.type].call({parser:this},s);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=n||"";continue}}let a=s;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},vo=class{options;block;constructor(t){this.options=t||ii}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Oe.lex:Oe.lexInline}provideParser(){return this.block?Re.parse:Re.parseInline}},tB=class{defaults=Fh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Re;Renderer=sa;TextRenderer=Dh;Lexer=Oe;Tokenizer=oa;Hooks=vo;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let o of t)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let s=o;for(let a of s.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of s.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let s=o;i=i.concat(this.walkTokens(s.items,r));break}default:{let s=o;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new sa(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new oa(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new vo;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=s[n];vo.passThroughHooks.has(a)?s[n]=h=>{if(this.defaults.async&&vo.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return c.call(s,f)})();let d=l.call(s,h);return c.call(s,d)}:s[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await c.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),s&&(l=l.concat(s.call(this,n))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Oe.lex(t,r??this.defaults)}parser(t,r){return Re.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?Oe.lex:Oe.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():t?Re.parse:Re.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?Oe.lex:Oe.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?Re.parse:Re.parseInline)(n,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=`
|
|
222
|
+
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Xe(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},ei=new tB;function Et(e,t){return ei.parse(e,t)}Et.options=Et.setOptions=function(e){return ei.setOptions(e),Et.defaults=ei.defaults,vm(Et.defaults),Et};Et.getDefaults=Fh;Et.defaults=ii;Et.use=function(...e){return ei.use(...e),Et.defaults=ei.defaults,vm(Et.defaults),Et};Et.walkTokens=function(e,t){return ei.walkTokens(e,t)};Et.parseInline=ei.parseInline;Et.Parser=Re;Et.parser=Re.parse;Et.Renderer=sa;Et.TextRenderer=Dh;Et.Lexer=Oe;Et.lexer=Oe.lex;Et.Tokenizer=oa;Et.Hooks=vo;Et.parse=Et;Et.options;Et.setOptions;Et.use;Et.walkTokens;Et.parseInline;Re.parse;Oe.lex;function Rm(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var o=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var d,f;return(f=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0})):n},[]);if(o.length){var s=new RegExp(`
|
|
223
|
+
[ ]{`+Math.min.apply(Math,o)+"}","g");i=i.map(function(n){return n.replace(s,`
|
|
224
|
+
`)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return t.forEach(function(n,l){var c=a.match(/(?:^|\n)( *)$/),h=c?c[1]:"",d=n;typeof n=="string"&&n.includes(`
|
|
225
|
+
`)&&(d=String(n).split(`
|
|
226
|
+
`).map(function(f,u){return u===0?f:""+h+f}).join(`
|
|
227
|
+
`)),a+=d+i[l+1]}),a}function Im(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
|
|
228
|
+
`).replace(/\n{2,}/g,`
|
|
229
|
+
`);return Rm(i)}p(Im,"preprocessMarkdown");function Pm(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(Pm,"nonMarkdownToLines");function Dm(e,t={}){const r=Im(e,t),i=Et.lexer(r),o=[[]];let s=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
|
|
230
|
+
`).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&o[s].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}p(Dm,"markdownToLines");function Nm(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}p(Nm,"nonMarkdownToHTML");function qm(e,{markdownAutoWrap:t}={}){const r=Et.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g," "):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(V.warn(`Unsupported markdown: ${o.type}`),o.raw)}return p(i,"output"),r.map(i).join("")}p(qm,"markdownToHTML");function zm(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(zm,"splitTextToChars");function jm(e,t){const r=zm(t.content);return Nh(e,[],r,t.type)}p(jm,"splitWordToFitWidth");function Nh(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?Nh(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(Nh,"splitWordToFitWidthRecursion");function Wm(e,t){if(e.some(({content:r})=>r.includes(`
|
|
231
|
+
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return aa(e,t)}p(Wm,"splitLineToFitWidth");function aa(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return aa(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=jm(t,s);r.push([n]),l.content&&e.unshift(l)}return aa(e,t,r)}p(aa,"splitLineToFitWidthRecursion");function yl(e,t){t&&e.attr("style",t)}p(yl,"applyStyle");var ud=16384;async function Hm(e,t,r,i,o=!1,s=Rt()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,ud)}px`),a.attr("height",`${Math.min(10*r,ud)}px`);const n=a.append("xhtml:div"),l=Wi(t.label)?await Wl(t.label.replace(Qi.lineBreakRegex,`
|
|
232
|
+
`),s):Be(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),yl(h,t.labelStyle),h.attr("class",`${c} ${i}`),yl(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}p(Hm,"addHtmlSpan");function Ia(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}p(Ia,"createTspan");function Ym(e,t,r){const i=e.append("text"),o=Ia(i,1,t);Pa(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}p(Ym,"computeWidthOfText");function Um(e,t,r){const i=e.append("text"),o=Ia(i,1,t);Pa(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}p(Um,"computeDimensionOfText");function Gm(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=p(u=>Ym(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:Wm(h,d);for(const u of f){const g=Ia(l,c,1.1,o);Pa(g,u),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}p(Gm,"createFormattedText");function xl(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}p(xl,"decodeHTMLEntities");function Pa(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(xl(r.content)):o.text(" "+xl(r.content))})}p(Pa,"updateTextContentAndStyles");async function Xm(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await y_(n)?await eo(n,void 0,{class:"label-icon"}):`<i class='${Be(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(Xm,"replaceIconSubstring");var ze=p(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?qm(t,h):Nm(t),f=await Xm(_r(d),h),u=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Wi(t)?u:f,labelStyle:r.replace("fill:","color:")};return await Hm(e,g,l,o,c,h)}else{const d=_r(t.replace(/<br\s*\/?>/g,"<br/>")),f=a?Dm(d.replace("<br>","<br/>"),h):Pm(d),u=Gm(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(u).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(u).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(u).select("text").attr("style",m)}return i?yt(u).selectAll("tspan.text-outer-tspan").classed("title-row",!0):yt(u).selectAll("tspan.text-outer-tspan").classed("row",!0),u}},"createText");function cn(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function eB(e,t){return e[0]===t[0]&&e[1]===t[1]}function rB(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)cn(c,n,o);const l=(function(c,h,d){const f=[];for(const C of c){const k=[...C];eB(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&f.push(k)}const u=[];h=Math.max(h,.1);const g=[];for(const C of f)for(let k=0;k<C.length-1;k++){const S=C[k],v=C[k+1];if(S[1]!==v[1]){const T=Math.min(S[1],v[1]);g.push({ymin:T,ymax:Math.max(S[1],v[1]),x:T===S[1]?S[0]:v[0],islope:(v[0]-S[0])/(v[1]-S[1])})}}if(g.sort(((C,k)=>C.ymin<k.ymin?-1:C.ymin>k.ymin?1:C.x<k.x?-1:C.x>k.x?1:C.ymax===k.ymax?0:(C.ymax-k.ymax)/Math.abs(C.ymax-k.ymax))),!g.length)return u;let m=[],y=g[0].ymin,x=0;for(;m.length||g.length;){if(g.length){let C=-1;for(let k=0;k<g.length&&!(g[k].ymin>y);k++)C=k;g.splice(0,C+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((C=>!(C.edge.ymax<=y))),m.sort(((C,k)=>C.edge.x===k.edge.x?0:(C.edge.x-k.edge.x)/Math.abs(C.edge.x-k.edge.x))),(d!==1||x%h==0)&&m.length>1)for(let C=0;C<m.length;C+=2){const k=C+1;if(k>=m.length)break;const S=m[C].edge,v=m[k].edge;u.push([[Math.round(S.x),y],[Math.round(v.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return u})(a,s,i);if(o){for(const c of a)cn(c,n,-o);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),cn(f,h,d)})(l,n,-o)}return l}function es(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),rB(e,o,i,s||1)}class qh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=es(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function Da(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class iB extends qh{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=es(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)Da([c,h])&&a.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class oB extends qh{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class sB{constructor(t){this.helper=t}fillPolygons(t,r){const i=es(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=Da(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,f=(n[0][0]+n[1][0])/2-o/4,u=Math.min(n[0][1],n[1][1]);for(let g=0;g<h;g++){const m=u+d+g*o,y=f-a+2*Math.random()*a,x=m-a+2*Math.random()*a,C=this.helper.ellipse(y,x,s,s,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class aB{constructor(t){this.helper=t}fillPolygons(t,r){const i=es(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const n=Da(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let u=0;u<l;u++){const g=u*(i+o),m=g+i,y=[h[0]+g*Math.cos(f)+c*Math.cos(f),h[1]+g*Math.sin(f)+c*Math.sin(f)],x=[h[0]+m*Math.cos(f)+c*Math.cos(f),h[1]+m*Math.sin(f)+c*Math.sin(f)];s.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}})),s}}class nB{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,s=es(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(s,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((s=>{const a=Da(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const f=2*d*r,u=2*(d+1)*r,g=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],x=[m[0]+g*Math.cos(h+Math.PI/4),m[1]+g*Math.sin(h+Math.PI/4)];o.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],i),...this.helper.doubleLineOps(x[0],x[1],y[0],y[1],i))}})),o}}const xe={};class lB{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const hB=0,dn=1,fd=2,fs={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function un(e,t){return e.type===t}function zh(e){const t=[],r=(function(a){const n=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:hB,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:dn,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:fd,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!un(s,fd);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return zh("M0,0"+e);o++,a=fs[s.text],i=s.text}else un(s,dn)?a=fs[i]:(o++,a=fs[s.text],i=s.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let l=o;l<o+a;l++){const c=r[l];if(!un(c,dn))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof fs[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=a,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function Vm(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:a,data:n}of e)switch(a){case"M":s.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function Km(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=i+(i-n),f=o+(o-l)):(d=i,f=o),t.push({key:"C",data:[d,f,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,f]=h;let u=0,g=0;r==="Q"||r==="T"?(u=i+(i-n),g=o+(o-l)):(u=i,g=o);const m=i+2*(u-i)/3,y=o+2*(g-o)/3,x=d+2*(u-d)/3,C=f+2*(g-f)/3;t.push({key:"C",data:[m,y,x,C,d,f]}),n=u,l=g,i=d,o=f;break}case"Q":{const[d,f,u,g]=h,m=i+2*(d-i)/3,y=o+2*(f-o)/3,x=u+2*(d-u)/3,C=g+2*(f-g)/3;t.push({key:"C",data:[m,y,x,C,u,g]}),n=d,l=f,i=u,o=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],g=h[3],m=h[4],y=h[5],x=h[6];d===0||f===0?(t.push({key:"C",data:[i,o,y,x,y,x]}),i=y,o=x):(i!==y||o!==x)&&(Zm(i,o,y,x,d,f,u,g,m).forEach((function(C){t.push({key:"C",data:C})})),i=y,o=x);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function fo(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Zm(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,g=0,m=0,y=0;if(c)[u,g,m,y]=c;else{[e,t]=fo(e,t,-h),[r,i]=fo(r,i,-h);const z=(e-r)/2,A=(t-i)/2;let M=z*z/(o*o)+A*A/(s*s);M>1&&(M=Math.sqrt(M),o*=M,s*=M);const F=o*o,N=s*s,P=F*N-F*A*A-N*z*z,$=F*A*A+N*z*z,q=(n===l?-1:1)*Math.sqrt(Math.abs(P/$));m=q*o*A/s+(e+r)/2,y=q*-s*z/o+(t+i)/2,u=Math.asin(parseFloat(((t-y)/s).toFixed(9))),g=Math.asin(parseFloat(((i-y)/s).toFixed(9))),e<m&&(u=Math.PI-u),r<m&&(g=Math.PI-g),u<0&&(u=2*Math.PI+u),g<0&&(g=2*Math.PI+g),l&&u>g&&(u-=2*Math.PI),!l&&g>u&&(g-=2*Math.PI)}let x=g-u;if(Math.abs(x)>120*Math.PI/180){const z=g,A=r,M=i;g=l&&g>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=Zm(r=m+o*Math.cos(g),i=y+s*Math.sin(g),A,M,o,s,a,0,l,[g,z,m,y])}x=g-u;const C=Math.cos(u),k=Math.sin(u),S=Math.cos(g),v=Math.sin(g),T=Math.tan(x/4),L=4/3*o*T,_=4/3*s*T,D=[e,t],O=[e+L*k,t-_*C],I=[r+L*v,i-_*S],j=[r,i];if(O[0]=2*D[0]-O[0],O[1]=2*D[1]-O[1],c)return[O,I,j].concat(f);{f=[O,I,j].concat(f);const z=[];for(let A=0;A<f.length;A+=3){const M=fo(f[A][0],f[A][1],h),F=fo(f[A+1][0],f[A+1][1],h),N=fo(f[A+2][0],f[A+2][1],h);z.push([M[0],M[1],F[0],F[1],N[0],N[1]])}return z}}const cB={randOffset:function(e,t){return ut(e,t)},randOffsetWithRange:function(e,t,r){return na(e,t,r)},ellipse:function(e,t,r,i,o){const s=Jm(r,i,o);return Cl(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return Br(e,t,r,i,o,!0)}};function Qm(e,t,r,i,o){return{type:"path",ops:Br(e,t,r,i,o)}}function Ls(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...Br(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...Br(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?Qm(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function dB(e,t,r,i,o){return(function(s,a){return Ls(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function gd(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=gs(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:gs(r[0],1.5*(1+.22*t.roughness),yd(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=gs(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:gs(a,1.5*(1+.22*t.roughness),yd(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function Jm(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/o;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return a+=ut(a*l,r),n+=ut(n*l,r),{increment:s,rx:a,ry:n}}function Cl(e,t,r,i){const[o,s]=xd(i.increment,e,t,i.rx,i.ry,1,i.increment*na(.1,na(.4,1,r),r),r);let a=la(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=xd(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=la(n,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function pd(e,t,r,i,o,s,a,n,l){const c=e,h=t;let d=Math.abs(r/2),f=Math.abs(i/2);d+=ut(.01*d,l),f+=ut(.01*f,l);let u=o,g=s;for(;u<0;)u+=2*Math.PI,g+=2*Math.PI;g-u>2*Math.PI&&(u=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-u)/2),x=Cd(y,c,h,d,f,u,g,1,l);if(!l.disableMultiStroke){const C=Cd(y,c,h,d,f,u,g,1.5,l);x.push(...C)}return a&&(n?x.push(...Br(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...Br(c,h,c+d*Math.cos(g),h+f*Math.sin(g),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(u),h+f*Math.sin(u)]})),{type:"path",ops:x}}function md(e,t){const r=Km(Vm(zh(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...Br(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,f,u]=n;i.push(...uB(l,c,h,d,f,u,s,t)),s=[f,u];break}case"Z":i.push(...Br(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function fn(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+ut(o,t),i[0][1]+ut(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+ut(o,t),i[a][1]+ut(o,t)]})}}return{type:"fillPath",ops:r}}function ci(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!xe[o])switch(o){case"zigzag":xe[o]||(xe[o]=new iB(i));break;case"cross-hatch":xe[o]||(xe[o]=new oB(i));break;case"dots":xe[o]||(xe[o]=new sB(i));break;case"dashed":xe[o]||(xe[o]=new aB(i));break;case"zigzag-line":xe[o]||(xe[o]=new nB(i));break;default:o="hachure",xe[o]||(xe[o]=new qh(i))}return xe[o]})(t,cB).fillPolygons(e,t)}function yd(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function ty(e){return e.randomizer||(e.randomizer=new lB(e.seed||0)),e.randomizer.next()}function na(e,t,r,i=1){return r.roughness*i*(ty(r)*(t-e)+e)}function ut(e,t,r=1){return na(-e,e,t,r)}function Br(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=bl(e,t,r,i,o,!0,!1);if(a)return n;const l=bl(e,t,r,i,o,!0,!0);return n.concat(l)}function bl(e,t,r,i,o,s,a){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,f=.2+.2*ty(o);let u=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;u=ut(u,o,c),g=ut(g,o,c);const m=[],y=()=>ut(d,o,c),x=()=>ut(h,o,c),C=o.preserveVertices;return a?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:ut(h,o,c)),t+(C?0:ut(h,o,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),g+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),g+t+2*(i-t)*f+y(),r+(C?0:y()),i+(C?0:y())]}):m.push({op:"bcurveTo",data:[u+e+(r-e)*f+x(),g+t+(i-t)*f+x(),u+e+2*(r-e)*f+x(),g+t+2*(i-t)*f+x(),r+(C?0:x()),i+(C?0:x())]}),m}function gs(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ut(t,r),e[0][1]+ut(t,r)]),i.push([e[0][0]+ut(t,r),e[0][1]+ut(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+ut(t,r),e[o][1]+ut(t,r)]),o===e.length-1&&i.push([e[o][0]+ut(t,r),e[o][1]+ut(t,r)]);return la(i,null,r)}function la(e,t,r){const i=e.length,o=[];if(i>3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*e[n+1][0]-a*e[n-1][0])/6,l[1]+(a*e[n+1][1]-a*e[n-1][1])/6],s[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],s[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...bl(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function xd(e,t,r,i,o,s,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=ut(.5,n)-Math.PI/2;c.push([ut(s,n)+t+.9*i*Math.cos(h-e),ut(s,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let f=h;f<d;f+=e){const u=[ut(s,n)+t+i*Math.cos(f),ut(s,n)+r+o*Math.sin(f)];l.push(u),c.push(u)}c.push([ut(s,n)+t+i*Math.cos(h+2*Math.PI+.5*a),ut(s,n)+r+o*Math.sin(h+2*Math.PI+.5*a)]),c.push([ut(s,n)+t+.98*i*Math.cos(h+a),ut(s,n)+r+.98*o*Math.sin(h+a)]),c.push([ut(s,n)+t+.9*i*Math.cos(h+.5*a),ut(s,n)+r+.9*o*Math.sin(h+.5*a)])}return[c,l]}function Cd(e,t,r,i,o,s,a,n,l){const c=s+ut(.1,l),h=[];h.push([ut(n,l)+t+.9*i*Math.cos(c-e),ut(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([ut(n,l)+t+i*Math.cos(d),ut(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),la(h,null,l)}function uB(e,t,r,i,o,s,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,f=n.preserveVertices;for(let u=0;u<d;u++)u===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(f?0:ut(c[0],n)),a[1]+(f?0:ut(c[0],n))]}),h=f?[o,s]:[o+ut(c[u],n),s+ut(c[u],n)],l.push({op:"bcurveTo",data:[e+ut(c[u],n),t+ut(c[u],n),r+ut(c[u],n),i+ut(c[u],n),h[0],h[1]]});return l}function go(e){return[...e]}function bd(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(go(e[0]),go(e[1]),go(e[2]),go(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const s=[],a=1-t;i.push(go(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*o[n+1][0]-a*o[n-1][0])/6,l[1]+(a*o[n+1][1]-a*o[n-1][1])/6],s[2]=[o[n+1][0]+(a*o[n][0]-a*o[n+2][0])/6,o[n+1][1]+(a*o[n][1]-a*o[n+2][1])/6],s[3]=[o[n+1][0],o[n+1][1]],i.push(s[1],s[2],s[3])}}return i}function Es(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function fB(e,t,r){const i=Es(t,r);if(i===0)return Es(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),Es(e,jr(t,r,o))}function jr(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function kl(e,t,r,i){const o=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],f=n[l+3];let u=3*h[0]-2*c[0]-f[0];u*=u;let g=3*h[1]-2*c[1]-f[1];g*=g;let m=3*d[0]-2*f[0]-c[0];m*=m;let y=3*d[1]-2*f[1]-c[1];return y*=y,u<m&&(u=m),g<y&&(g=y),u+g})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt(Es(s,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],f=jr(l,c,.5),u=jr(c,h,.5),g=jr(h,d,.5),m=jr(f,u,.5),y=jr(u,g,.5),x=jr(m,y,.5);kl([l,f,m,x],0,r,o),kl([x,y,g,d],0,r,o)}var s,a;return o}function gB(e,t){return ha(e,0,e.length,t)}function ha(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=fB(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(ha(e,t,c+1,i,s),ha(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function gn(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)kl(e,3*s,t,i);return r&&r>0?ha(i,0,i.length,r):i}const ke="none";class ca{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[Qm(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=dB(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(fn([c],a)):n.push(ci([c],a))}return a.stroke!==ke&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=Jm(i,o,a),c=Cl(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Cl(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(ci([c.estimatedPoints],a));return a.stroke!==ke&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Ls(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=pd(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=pd(t,r,i,o,s,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,g,m,y,x,C){const k=f,S=u;let v=Math.abs(g/2),T=Math.abs(m/2);v+=ut(.01*v,C),T+=ut(.01*T,C);let L=y,_=x;for(;L<0;)L+=2*Math.PI,_+=2*Math.PI;_-L>2*Math.PI&&(L=0,_=2*Math.PI);const D=(_-L)/C.curveStepCount,O=[];for(let I=L;I<=_;I+=D)O.push([k+v*Math.cos(I),S+T*Math.sin(I)]);return O.push([k+v*Math.cos(_),S+T*Math.sin(_)]),O.push([k,S]),ci([O],C)})(t,r,i,o,s,a,c));return c.stroke!==ke&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=gd(t,i);if(i.fill&&i.fill!==ke)if(i.fillStyle==="solid"){const a=gd(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...gn(bd([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...gn(bd(c),10,(1+i.roughness)/2))}a.length&&o.push(ci([a],i))}return i.stroke!==ke&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=Ls(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(fn([t],i)):o.push(ci([t],i))),i.stroke!==ke&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ke,a=i.stroke!==ke,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=Km(Vm(zh(h))),g=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...gn(x,d)),x=[]},k=()=>{C(),m.length&&(g.push(m),m=[])};for(const{key:v,data:T}of u)switch(v){case"M":k(),y=[T[0],T[1]],m.push(y);break;case"L":C(),m.push([T[0],T[1]]);break;case"C":if(!x.length){const L=m.length?m[m.length-1]:y;x.push([L[0],L[1]])}x.push([T[0],T[1]]),x.push([T[2],T[3]]),x.push([T[4],T[5]]);break;case"Z":C(),m.push([y[0],y[1]])}if(k(),!f)return g;const S=[];for(const v of g){const T=gB(v,f);T.length&&S.push(T)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=md(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=md(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(fn(l,i));else o.push(ci(l,i));return a&&(n?l.forEach((h=>{o.push(Ls(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ke};break;case"fillPath":a={d:this.opsToPath(s),stroke:ke,strokeWidth:0,fill:i.fill||ke};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ke,strokeWidth:i,fill:ke}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class pB{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ca(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const ps="http://www.w3.org/2000/svg";class mB{constructor(t,r){this.svg=t,this.gen=new ca(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(ps,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(ps,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(ps,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(ps,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var ot={canvas:(e,t)=>new pB(e,t),svg:(e,t)=>new mB(e,t),generator:e=>new ca(e),newSeed:()=>ca.newSeed()},dt=p(async(e,t,r)=>{let i;const o=t.useHtmlLabels||ir(wt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Qt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await ze(a,Be(_r(n),wt()),{useHtmlLabels:o,width:t.width||wt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},wt());let d=h.getBBox();const f=(t?.padding??0)/2;if(o){const u=h.children[0],g=yt(h);await Eh(u,n),d=u.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),pn=p(async(e,t,r)=>{const i=r.useHtmlLabels??he(wt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await ze(o,Be(_r(t),wt()),{useHtmlLabels:i,width:r.width||wt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(he(wt())){const l=s.children[0],c=yt(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),nt=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),ct=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function bt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(bt,"createPathFromPoints");function Lr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,f=t+c/2;for(let u=0;u<=50;u++){const g=u/50,m=e+g*l,y=f+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}p(Lr,"generateFullSineWavePoints");function Ho(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(Ho,"generateCirclePoints");function wl(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=p((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}p(wl,"mergePaths");var yB=p((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),oi=yB,xB=p(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=wt(),n=he(a);return await ze(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),br=xB,Fr=p((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),CB=p(async(e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=st(t),f=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),u=ir(r.flowchart.htmlLabels),g=t.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await ze(m,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let x=y.getBBox();if(u){const z=y.children[0],A=yt(y);x=z.getBoundingClientRect(),A.attr("width",x.width),A.attr("height",x.height)}const C=t.padding??0,k=t.width<=x.width+C?x.width+C:t.width;t.width<=x.width+C?t.diff=(k-t.width)/2-C:t.diff=-C;const S=t.height,v=t.y-S/2,T=t.y+S/2,L=t.x-k/2,_=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+S/3,D=g?4:0,O=x.height+2*D;let I,j;if(g){const z=Math.max(O,x.height+2*D),A=L+z,M=Math.max(0,k-z);if(t.look==="handDrawn"){const P=ot.svg(f),$=it(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),q=it(t,{roughness:.7,fill:"none",stroke:n,seed:o}),E=P.rectangle(L,v,z,S,$);I=f.insert(()=>E,":first-child");const G=P.rectangle(A,v,M,S,q);j=f.insert(()=>G,":first-child"),I.select("path:nth-child(2)").attr("style",h.join(";")),I.select("path").attr("style",d.join(";").replace("fill","stroke"))}else I=f.insert("rect",":first-child"),j=f.insert("rect",":first-child"),I.attr("class","swimlane-title").attr("style",c).attr("x",L).attr("y",v).attr("width",z).attr("height",S).attr("fill",s).attr("stroke",n),j.attr("class","swimlane-body").attr("style",c).attr("x",A).attr("y",v).attr("width",M).attr("height",S).attr("fill","none").attr("stroke",n);const F=L+z/2,N=t.y;m.attr("transform",`translate(${F}, ${N}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const z=Math.max(0,_-v),A=Math.min(O,z),M=v+A,F=Math.max(0,T-M),N=t.x-k/2;if(t.look==="handDrawn"){const q=ot.svg(f),E=it(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),G=it(t,{roughness:.7,fill:"none",stroke:n,seed:o}),U=q.rectangle(N,v,k,A,E);I=f.insert(()=>U,":first-child");const X=q.rectangle(N,M,k,F,G);j=f.insert(()=>X,":first-child"),I.select("path:nth-child(2)").attr("style",h.join(";")),I.select("path").attr("style",d.join(";").replace("fill","stroke"))}else I=f.insert("rect",":first-child"),j=f.insert("rect",":first-child"),I.attr("class","swimlane-title").attr("style",c).attr("x",N).attr("y",v).attr("width",k).attr("height",A).attr("fill",s).attr("stroke",n),j.attr("class","swimlane-body").attr("style",c).attr("x",N).attr("y",M).attr("width",k).attr("height",F).attr("fill","none").attr("stroke",n);const P=t.x-x.width/2,$=v+(A-x.height)/2;m.attr("transform",`translate(${P}, ${$})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const z=m.select("span");z&&z.attr("style",l)}return t.offsetX=0,t.width=k,t.height=S,t.offsetY=x.height-C/2,t.intersect=function(z){return oi(t,z)},{cluster:f,labelBBox:x}},"swimlane"),ey=p(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=wt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=he(r),u=d.insert("g").attr("class","cluster-label ");let g;t.labelType==="markdown"?g=await ze(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):g=await br(u,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(he(r)){const L=g.children[0],_=yt(g);m=L.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,k=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const L=ot.svg(d),_=it(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),D=L.path(Fr(C,k,y,x,0),_);S=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=$a(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const L=u.select("span");L&&L.attr("style",n)}const T=S.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=m.height-t.padding/2,t.intersect=function(L){return oi(t,L)},{cluster:d,labelBBox:m}},"rect"),bB=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return oi(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),kB=p(async(e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const u=await br(d,t.label,t.labelStyle,void 0,!0);let g=u.getBBox();if(he(r)){const D=u.children[0],O=yt(u);g=D.getBoundingClientRect(),O.attr("width",g.width),O.attr("height",g.height)}const m=0*t.padding,y=m/2,x=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height+m,k=t.height+m-g.height-6,S=t.x-x/2,v=t.y-C/2;t.width=x;const T=t.y-t.height/2-y+g.height+2;let L;if(t.look==="handDrawn"){const D=t.cssClasses.includes("statediagram-cluster-alt"),O=ot.svg(c),I=t.rx||t.ry?O.path(Fr(S,v,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):O.rectangle(S,v,x,C,{seed:o});L=c.insert(()=>I,":first-child");const j=O.rectangle(S,T,x,k,{fill:D?s:a,fillStyle:D?"hachure":"solid",stroke:l,seed:o});L=c.insert(()=>I,":first-child"),f=c.insert(()=>j)}else L=h.insert("rect",":first-child"),L.attr("class","outer").attr("x",S).attr("y",v).attr("width",x).attr("height",C).attr("data-look",t.look),f.attr("class","inner").attr("x",S).attr("y",T).attr("width",x).attr("height",k);d.attr("transform",`translate(${t.x-g.width/2}, ${v+1-(he(r)?0:3)})`);const _=L.node().getBBox();return t.height=_.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(D){return oi(t,D)},{cluster:c,labelBBox:g}},"roundedWithTitle"),wB=p(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=wt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=he(r),u=d.insert("g").attr("class","cluster-label "),g=await ze(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(he(r)){const L=g.children[0],_=yt(g);m=L.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,k=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const L=ot.svg(d),_=it(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),D=L.path(Fr(C,k,y,x,t.rx),_);S=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=$a(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const L=u.select("span");L&&L.attr("style",n)}const T=S.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=m.height-t.padding/2,t.intersect=function(L){return oi(t,L)},{cluster:d,labelBBox:m}},"kanbanSection"),SB=p((e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,f=t.y-h/2;t.width=c;let u;if(t.look==="handDrawn"){const y=ot.svg(a).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});u=a.insert(()=>y,":first-child")}else{u=n.insert("rect",":first-child");let m="outer";t.look,m="divider",u.attr("class",m).attr("x",d).attr("y",f).attr("width",c).attr("height",h).attr("data-look",t.look)}const g=u.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return oi(t,m)},{cluster:a,labelBBox:{}}},"divider"),vB=ey,TB={rect:ey,squareRect:vB,roundedWithTitle:kB,noteGroup:bB,divider:SB,kanbanSection:wB,swimlane:CB},ry=new Map,iy=p(async(e,t)=>{const r=t.shape||"rect",i=await TB[r](e,t);return ry.set(t.id,i),i},"insertCluster"),_B=p(()=>{ry=new Map},"clear");function oy(e,t){return e.intersect(t)}p(oy,"intersectNode");var BB=oy;function sy(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<s&&(h=-h),{x:o+c,y:s+h}}p(sy,"intersectEllipse");var ay=sy;function ny(e,t,r){return ay(e,t,t,r)}p(ny,"intersectCircle");var LB=ny;function ly(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,n=o*r.x+s*r.y+a,l=o*i.x+s*i.y+a,c=1e-6;if(n!==0&&l!==0&&Sl(n,l))return;const h=i.y-r.y,d=r.x-i.x,f=i.x*r.y-r.x*i.y,u=h*e.x+d*e.y+f,g=h*t.x+d*t.y+f;if(Math.abs(u)<c&&Math.abs(g)<c&&Sl(u,g))return;const m=o*d-h*s;if(m===0)return;const y=Math.abs(m/2);let x=s*f-d*a;const C=x<0?(x-y)/m:(x+y)/m;x=h*a-o*f;const k=x<0?(x-y)/m:(x+y)/m;return{x:C,y:k}}}p(ly,"intersectLine");function Sl(e,t){return e*t>0}p(Sl,"sameSign");var EB=ly;function hy(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],f=t[h<t.length-1?h+1:0],u=EB(e,r,{x:l+d.x,y:c+d.y},{x:l+f.x,y:c+f.y});u&&s.push(u)}return s.length?(s.length>1&&s.sort(function(h,d){let f=h.x-r.x,u=h.y-r.y,g=Math.sqrt(f*f+u*u),m=d.x-r.x,y=d.y-r.y,x=Math.sqrt(m*m+y*y);return g<x?-1:g===x?0:1}),s[0]):e}p(hy,"intersectPolygon");var FB=hy,et={node:BB,circle:LB,ellipse:ay,polygon:FB,rect:oi};function cy(e,t){const{labelStyles:r}=st(t);t.labelStyle=r;const i=ct(t);let o=i;i||(o="anchor");const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=ot.svg(s),c=it(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=s.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Qt(n)),nt(t,d),t.intersect=function(f){return V.info("Circle intersect",t,a,f),et.circle(t,a,f)},s}p(cy,"anchor");function vl(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,f=(i-t)/2,u=d/o,g=f/s,m=Math.sqrt(u**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*s*Math.sin(h)*(a?-1:1),C=c-y*o*Math.cos(h)*(a?-1:1),k=Math.atan2((t-C)/s,(e-x)/o);let v=Math.atan2((i-C)/s,(r-x)/o)-k;a&&v<0&&(v+=2*Math.PI),!a&&v>0&&(v-=2*Math.PI);const T=[];for(let L=0;L<20;L++){const _=L/19,D=k+_*v,O=x+o*Math.cos(D),I=C+s*Math.sin(D);T.push({x:O,y:I})}return T}p(vl,"generateArcPoints");function dy(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}p(dy,"calculateArcSagitta");async function uy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=p(D=>D+a,"calcTotalHeight"),l=p(D=>{const O=D/2;return[O/(2.5+D/50),O]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await dt(e,t,ct(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),g=dy(d,f,u),y=(t?.width?t?.width:h.width)+s*2+g-g,x=d,{cssStyles:C}=t,k=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...vl(-y/2,-x/2,-y/2,x/2,f,u,!1),{x:y/2,y:x/2},...vl(y/2,x/2,y/2,-x/2,f,u,!0)],S=ot.svg(c),v=it(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=bt(k),L=S.path(T,v),_=c.insert(()=>L,":first-child");return _.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${f/2}, 0)`),nt(t,_),t.intersect=function(D){return et.polygon(t,k,D)},c}p(uy,"bowTieRect");function mr(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(mr,"insertPolygonShape");var ms=12;async function fy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+ms),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,g=0,m=[{x:d+ms,y:u},{x:f,y:u},{x:f,y:g},{x:d,y:g},{x:d,y:u+ms},{x:d+ms,y:u}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=ot.svg(n),k=it(t,{}),S=bt(m),v=C.path(S,k);y=n.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&y.attr("style",x)}else y=mr(n,c,h,m);return i&&y.attr("style",i),nt(t,y),t.intersect=function(C){return et.polygon(t,m,C)},n}p(fy,"card");function gy(e,t){const{nodeStyles:r}=st(t);t.label="";const i=e.insert("g").attr("class",ct(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=ot.svg(i),l=it(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=bt(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return et.polygon(t,a,f)},i}p(gy,"choice");async function jh(e,t,r){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await dt(e,t,ct(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=ot.svg(s),g=it(t,{}),m=u.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Qt(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return nt(t,d),t.calcIntersect=function(u,g){const m=u.width/2;return et.circle(u,m,g)},t.intersect=function(u){return V.info("Circle intersect",t,h,u),et.circle(t,h,u)},s}p(jh,"circle");function py(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y}
|
|
233
|
+
M ${o.x},${o.y} L ${a.x},${a.y}`}p(py,"createLine");function my(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",ct(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=ot.svg(o),l=it(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=py(s),d=n.path(h,l),f=o.insert(()=>c,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),nt(t,f),t.intersect=function(u){return V.info("crossedCircle intersect",t,{radius:s,point:u}),et.circle(t,s,u)},o}p(my,"crossedCircle");function nr(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(nr,"generateCirclePoints");async function yy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ct(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+n,h=s.height+l,d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...nr(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...nr(c/2+d*2,-d,d,20,-180,-270),...nr(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...nr(c/2,h/2,d,20,0,90)],g=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...nr(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...nr(c/2+c*.1,-d,d,20,-180,-270),...nr(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...nr(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2,y:h/2+d}],m=ot.svg(o),y=it(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),k=m.path(C,y),S=bt(g),v=m.path(S,{...y}),T=o.insert("g",":first-child");return T.insert(()=>v,":first-child").attr("stroke-opacity",0),T.insert(()=>k,":first-child"),T.attr("class","text"),f&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),nt(t,T),t.intersect=function(L){return et.polygon(t,g,L)},o}p(yy,"curlyBraceLeft");function lr(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:u,y:g})}return a}p(lr,"generateCirclePoints");async function xy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ct(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...lr(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...lr(c/2+d*2,-d,d,20,-180,-270),...lr(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...lr(c/2,h/2,d,20,0,90)],g=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...lr(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...lr(c/2+d*2,-d,d,20,-180,-270),...lr(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...lr(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],m=ot.svg(o),y=it(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),k=m.path(C,y),S=bt(g),v=m.path(S,{...y}),T=o.insert("g",":first-child");return T.insert(()=>v,":first-child").attr("stroke-opacity",0),T.insert(()=>k,":first-child"),T.attr("class","text"),f&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),nt(t,T),t.intersect=function(L){return et.polygon(t,g,L)},o}p(xy,"curlyBraceRight");function re(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(re,"generateCirclePoints");async function Cy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ct(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...re(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...re(c/2+d*2,-d,d,20,-180,-270),...re(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...re(c/2,h/2,d,20,0,90)],g=[...re(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...re(-c/2-d/2,-d,d,20,0,90),...re(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...re(-c/2+d+d/2,h/2,d,30,-180,-270)],m=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...re(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...re(c/2+d*2,-d,d,20,-180,-270),...re(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...re(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2-d-d/2,y:h/2+d},...re(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...re(-c/2-d/2,-d,d,20,0,90),...re(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...re(-c/2+d+d/2,h/2,d,30,-180,-270)],y=ot.svg(o),x=it(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=bt(u).replace("Z",""),S=y.path(k,x),T=bt(g).replace("Z",""),L=y.path(T,x),_=bt(m),D=y.path(_,{...x}),O=o.insert("g",":first-child");return O.insert(()=>D,":first-child").attr("stroke-opacity",0),O.insert(()=>S,":first-child"),O.insert(()=>L,":first-child"),O.attr("class","text"),f&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),O.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),nt(t,O),t.intersect=function(I){return et.polygon(t,m,I)},o}p(Cy,"curlyBraces");async function by(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await dt(e,t,ct(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),u=f/2,{cssStyles:g}=t,m=ot.svg(c),y=it(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=f,k=x-u,S=C/4,v=[{x:k,y:0},{x:S,y:0},{x:0,y:C/2},{x:S,y:C},{x:k,y:C},...Ho(-k,-C/2,u,50,270,90)],T=bt(v),L=m.path(T,y),_=c.insert(()=>L,":first-child");return _.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(${-d/2}, ${-f/2})`),nt(t,_),t.intersect=function(D){return et.polygon(t,v,D)},c}p(by,"curvedTrapezoid");var AB=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),MB=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),$B=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),kd=8,wd=8;async function ky(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<wd&&(t.width=wd);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<kd&&(t.height=kd)}const{shapeSvg:n,bbox:l,label:c}=await dt(e,t,ct(t)),h=(t.width?t.width:l.width)+a,d=h/2,f=d/(2.5+h/50),u=(t.height?t.height:l.height)+s+f;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=ot.svg(n),x=MB(0,0,h,u,d,f),C=$B(0,f,h,u,d,f),k=it(t,{}),S=y.path(x,k),v=y.path(C,it(t,{fill:"none"}));g=n.insert(()=>v,":first-child"),g=n.insert(()=>S,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=AB(0,0,h,u,d,f);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Qt(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),nt(t,g),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(y){const x=et.rect(t,y),C=x.x-(t.x??0);if(d!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-f)){let k=f*f*(1-C*C/(d*d));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},n}p(ky,"cylinder");async function ro(e,t,r){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await dt(e,t,ct(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:f,ry:u}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(f=r.rx,u=r.ry),t.look==="handDrawn"){const m=ot.svg(s),y=it(t,{}),x=f||u?m.path(Fr(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Qt(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Qt(f)).attr("ry",Qt(u)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return nt(t,d),t.calcIntersect=function(m,y){return et.rect(m,y)},t.intersect=function(m){return et.rect(t,m)},s}p(ro,"drawRect");async function wy(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await ro(e,t,l);if(t.look==="handDrawn"){const u=ot.svg(c),g=it(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let x=null;if(y instanceof SVGGraphicsElement)x=y.getBBox();else return c;return c.insert(()=>u.line(x.x,x.y,x.x+x.width,x.y,g),".basic.label-container g.label"),c.insert(()=>u.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,g),".basic.label-container g.label"),m.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||n)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),c}p(wy,"datastore");async function Sy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ct(t)),c=n.width+o,h=n.height+s,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:g}=t,m=ot.svg(a),y=it(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:f,y:u+d},{x:-f,y:u+d},{x:-f,y:-u},{x:f,y:-u},{x:f,y:u},{x:-f,y:u},{x:-f,y:u+d}],C=m.polygon(x.map(S=>[S.x,S.y]),y),k=a.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${f+(t.padding??0)/2-(n.x-(n.left??0))}, ${u+d+(t.padding??0)/2-(n.y-(n.top??0))})`),nt(t,k),t.intersect=function(S){return et.rect(t,S)},a}p(Sy,"dividedRectangle");async function vy(e,t){const{labelStyles:r,nodeStyles:i}=st(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=ot.svg(n),g=it(t,{roughness:.2,strokeWidth:2.5}),m=it(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,g),x=u.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Qt(t.cssClasses)).attr("style",Qt(f)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=n.insert("g",":first-child");const u=d.insert("circle",":first-child"),g=d.insert("circle");d.attr("class","basic label-container").attr("style",i),u.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return nt(t,d),t.intersect=function(u){return V.info("DoubleCircle intersect",t,c,u),et.circle(t,c,u)},n}p(vy,"doublecircle");function Ty(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",ct(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=ot.svg(s),{nodeBorder:c}=r,h=it(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),nt(t,f),t.intersect=function(u){return V.info("filledCircle intersect",t,{radius:a,point:u}),et.circle(t,a,u)},s}p(Ty,"filledCircle");var Sd=10,vd=10;async function _y(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<Sd&&(t.height=Sd),t.width=(t?.width??0)-s-s/2,t.width<vd&&(t.width=vd));const{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ct(t)),c=(t?.width?t?.width:n.width)+(s??0),h=t?.height?t?.height:c+n.height,d=h,f=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:u}=t,g=ot.svg(a),m=it(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=bt(f),x=g.path(y,m),C=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return u&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=c,t.height=h,nt(t,C),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(k){return V.info("Triangle intersect",t,f,k),et.polygon(t,f,k)},a}p(_y,"flippedTriangle");function By(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=st(t);t.label="";const a=e.insert("g").attr("class",ct(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,f=ot.svg(a),u=it(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const g=f.rectangle(h,d,l,c,u),m=a.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),nt(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(x){return et.rect(t,x)},a}p(By,"forkJoin");async function Ly(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<s&&(t.height=s),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await dt(e,t,ct(t)),h=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(s,c.height))+n*2,f=d/2,{cssStyles:u}=t,g=ot.svg(l),m=it(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2,y:-d/2},{x:h/2-f,y:-d/2},...Ho(-h/2+f,0,f,50,90,270),{x:h/2-f,y:d/2},{x:-h/2,y:d/2}],x=bt(y),C=g.path(x,m),k=l.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),nt(t,k),t.intersect=function(S){return V.info("Pill intersect",t,{radius:f,point:S}),et.polygon(t,y,S)},l}p(Ly,"halfRoundedRectangle");var OB=p((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function Ey(e,t){const{labelStyles:r,nodeStyles:i}=st(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const k=(t.height??0)/o;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await dt(e,t,ct(t)),f=(t?.height?t?.height:d.height)+l,u=f/o,g=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:g-u,y:0},{x:g,y:-f/2},{x:g-u,y:-f},{x:u,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=ot.svg(h),k=it(t,{}),S=OB(0,0,g,f,u),v=C.path(S,k);y=h.insert(()=>v,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),x&&y.attr("style",x)}else y=mr(h,g,f,m);return i&&y.attr("style",i),t.width=g,t.height=f,nt(t,y),t.intersect=function(C){return et.polygon(t,m,C)},h}p(Ey,"hexagon");async function Fy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await dt(e,t,ct(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=ot.svg(o),c=it(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=bt(h),f=l.path(d,c),u=o.insert(()=>f,":first-child");return u.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",i),u.attr("transform",`translate(${-s/2}, ${-a/2})`),nt(t,u),t.intersect=function(g){return V.info("Pill intersect",t,{points:h}),et.polygon(t,h,g)},o}p(Fy,"hourglass");async function Ay(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await dt(e,t,"icon-shape default"),f=t.pos==="t",u=n,g=n,{nodeBorder:m}=r,{stylesMap:y}=to(t),x=-g/2,C=-u/2,k=t.label?8:0,S=ot.svg(c),v=it(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=S.rectangle(x,C,g,u,v),L=Math.max(g,h.width),_=u+h.height+k,D=S.rectangle(-L/2,-_/2,L,_,{...v,fill:"transparent",stroke:"none"}),O=c.insert(()=>T,":first-child"),I=c.insert(()=>D);if(t.icon){const j=c.append("g");j.html(`<g>${await eo(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const z=j.node().getBBox(),A=z.width,M=z.height,F=z.x,N=z.y;j.attr("transform",`translate(${-A/2-F},${f?h.height/2+k/2-M/2-N:-h.height/2-k/2-M/2-N})`),j.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-_/2:_/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),nt(t,I),t.intersect=function(j){if(V.info("iconSquare intersect",t,j),!t.label)return et.rect(t,j);const z=t.x??0,A=t.y??0,M=t.height??0;let F=[];return f?F=[{x:z-h.width/2,y:A-M/2},{x:z+h.width/2,y:A-M/2},{x:z+h.width/2,y:A-M/2+h.height+k},{x:z+g/2,y:A-M/2+h.height+k},{x:z+g/2,y:A+M/2},{x:z-g/2,y:A+M/2},{x:z-g/2,y:A-M/2+h.height+k},{x:z-h.width/2,y:A-M/2+h.height+k}]:F=[{x:z-g/2,y:A-M/2},{x:z+g/2,y:A-M/2},{x:z+g/2,y:A-M/2+u},{x:z+h.width/2,y:A-M/2+u},{x:z+h.width/2/2,y:A+M/2},{x:z-h.width/2,y:A+M/2},{x:z-h.width/2,y:A-M/2+u},{x:z-g/2,y:A-M/2+u}],et.polygon(t,F,j)},c}p(Ay,"icon");async function My(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await dt(e,t,"icon-shape default"),f=20,u=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=to(t),C=ot.svg(c),k=it(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=x.get("fill");k.stroke=S??y;const v=c.append("g");t.icon&&v.html(`<g>${await eo(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const T=v.node().getBBox(),L=T.width,_=T.height,D=T.x,O=T.y,I=Math.max(L,_)*Math.SQRT2+f*2,j=C.circle(0,0,I,k),z=Math.max(I,h.width),A=I+h.height+u,M=C.rectangle(-z/2,-A/2,z,A,{...k,fill:"transparent",stroke:"none"}),F=c.insert(()=>j,":first-child"),N=c.insert(()=>M);return v.attr("transform",`translate(${-L/2-D},${g?h.height/2+u/2-_/2-O:-h.height/2-u/2-_/2-O})`),v.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-A/2:A/2-h.height})`),F.attr("transform",`translate(0,${g?h.height/2+u/2:-h.height/2-u/2})`),nt(t,N),t.intersect=function(P){return V.info("iconSquare intersect",t,P),et.rect(t,P)},c}p(My,"iconCircle");async function $y(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await dt(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=to(t),k=-m/2,S=-g/2,v=t.label?8:0,T=ot.svg(c),L=it(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const _=C.get("fill");L.stroke=_??x;const D=T.path(Fr(k,S,m,g,5),L),O=Math.max(m,h.width),I=g+h.height+v,j=T.rectangle(-O/2,-I/2,O,I,{...L,fill:"transparent",stroke:"none"}),z=c.insert(()=>D,":first-child").attr("class","icon-shape2"),A=c.insert(()=>j);if(t.icon){const M=c.append("g");M.html(`<g>${await eo(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=M.node().getBBox(),N=F.width,P=F.height,$=F.x,q=F.y;M.attr("transform",`translate(${-N/2-$},${u?h.height/2+v/2-P/2-q:-h.height/2-v/2-P/2-q})`),M.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-I/2:I/2-h.height})`),z.attr("transform",`translate(0,${u?h.height/2+v/2:-h.height/2-v/2})`),nt(t,A),t.intersect=function(M){if(V.info("iconSquare intersect",t,M),!t.label)return et.rect(t,M);const F=t.x??0,N=t.y??0,P=t.height??0;let $=[];return u?$=[{x:F-h.width/2,y:N-P/2},{x:F+h.width/2,y:N-P/2},{x:F+h.width/2,y:N-P/2+h.height+v},{x:F+m/2,y:N-P/2+h.height+v},{x:F+m/2,y:N+P/2},{x:F-m/2,y:N+P/2},{x:F-m/2,y:N-P/2+h.height+v},{x:F-h.width/2,y:N-P/2+h.height+v}]:$=[{x:F-m/2,y:N-P/2},{x:F+m/2,y:N-P/2},{x:F+m/2,y:N-P/2+g},{x:F+h.width/2,y:N-P/2+g},{x:F+h.width/2/2,y:N+P/2},{x:F-h.width/2,y:N+P/2},{x:F-h.width/2,y:N-P/2+g},{x:F-m/2,y:N-P/2+g}],et.polygon(t,$,M)},c}p($y,"iconRounded");async function Oy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await dt(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=to(t),k=-m/2,S=-g/2,v=t.label?8:0,T=ot.svg(c),L=it(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const _=C.get("fill");L.stroke=_??x;const D=T.path(Fr(k,S,m,g,.1),L),O=Math.max(m,h.width),I=g+h.height+v,j=T.rectangle(-O/2,-I/2,O,I,{...L,fill:"transparent",stroke:"none"}),z=c.insert(()=>D,":first-child"),A=c.insert(()=>j);if(t.icon){const M=c.append("g");M.html(`<g>${await eo(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=M.node().getBBox(),N=F.width,P=F.height,$=F.x,q=F.y;M.attr("transform",`translate(${-N/2-$},${u?h.height/2+v/2-P/2-q:-h.height/2-v/2-P/2-q})`),M.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-I/2:I/2-h.height})`),z.attr("transform",`translate(0,${u?h.height/2+v/2:-h.height/2-v/2})`),nt(t,A),t.intersect=function(M){if(V.info("iconSquare intersect",t,M),!t.label)return et.rect(t,M);const F=t.x??0,N=t.y??0,P=t.height??0;let $=[];return u?$=[{x:F-h.width/2,y:N-P/2},{x:F+h.width/2,y:N-P/2},{x:F+h.width/2,y:N-P/2+h.height+v},{x:F+m/2,y:N-P/2+h.height+v},{x:F+m/2,y:N+P/2},{x:F-m/2,y:N+P/2},{x:F-m/2,y:N-P/2+h.height+v},{x:F-h.width/2,y:N-P/2+h.height+v}]:$=[{x:F-m/2,y:N-P/2},{x:F+m/2,y:N-P/2},{x:F+m/2,y:N-P/2+g},{x:F+h.width/2,y:N-P/2+g},{x:F+h.width/2/2,y:N+P/2},{x:F-h.width/2,y:N+P/2},{x:F-h.width/2,y:N-P/2+g},{x:F-m/2,y:N-P/2+g}],et.polygon(t,$,M)},c}p(Oy,"iconSquare");async function Ry(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=st(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:f,label:u}=await dt(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,x=t.label?8:0,C=ot.svg(d),k=it(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=C.rectangle(m,y,c,h,k),v=Math.max(c,f.width),T=h+f.height+x,L=C.rectangle(-v/2,-T/2,v,T,{...k,fill:"none",stroke:"none"}),_=d.insert(()=>S,":first-child"),D=d.insert(()=>L);if(t.img){const O=d.append("image");O.attr("href",t.img),O.attr("width",c),O.attr("height",h),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-c/2},${g?T/2-h:-T/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-x/2:h/2-f.height/2+x/2})`),_.attr("transform",`translate(0,${g?f.height/2+x/2:-f.height/2-x/2})`),nt(t,D),t.intersect=function(O){if(V.info("iconSquare intersect",t,O),!t.label)return et.rect(t,O);const I=t.x??0,j=t.y??0,z=t.height??0;let A=[];return g?A=[{x:I-f.width/2,y:j-z/2},{x:I+f.width/2,y:j-z/2},{x:I+f.width/2,y:j-z/2+f.height+x},{x:I+c/2,y:j-z/2+f.height+x},{x:I+c/2,y:j+z/2},{x:I-c/2,y:j+z/2},{x:I-c/2,y:j-z/2+f.height+x},{x:I-f.width/2,y:j-z/2+f.height+x}]:A=[{x:I-c/2,y:j-z/2},{x:I+c/2,y:j-z/2},{x:I+c/2,y:j-z/2+h},{x:I+f.width/2,y:j-z/2+h},{x:I+f.width/2/2,y:j+z/2},{x:I-f.width/2,y:j+z/2},{x:I-f.width/2,y:j-z/2+h},{x:I-c/2,y:j-z/2+h}],et.polygon(t,A,O)},d}p(Ry,"imageSquare");async function Iy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(s??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=ot.svg(n),m=it(t,{}),y=bt(d),x=g.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&f.attr("style",u)}else f=mr(n,c,h,d);return i&&f.attr("style",i),t.width=c,t.height=h,nt(t,f),t.intersect=function(g){return et.polygon(t,d,g)},n}p(Iy,"inv_trapezoid");async function Py(e,t){const{shapeSvg:r,bbox:i,label:o}=await dt(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),nt(t,s),t.intersect=function(l){return et.rect(t,l)},r}p(Py,"labelRect");async function Dy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=ot.svg(n),m=it(t,{}),y=bt(d),x=g.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=mr(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,nt(t,f),t.intersect=function(g){return et.polygon(t,d,g)},n}p(Dy,"lean_left");async function Ny(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=ot.svg(n),m=it(t,{}),y=bt(d),x=g.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=mr(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,nt(t,f),t.intersect=function(g){return et.polygon(t,d,g)},n}p(Ny,"lean_right");function qy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",ct(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=ot.svg(o),d=it(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=bt(c),u=h.path(f,d),g=o.insert(()=>u,":first-child");return g.attr("class","outer-path"),s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${a/2},${-n})`),nt(t,g),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),et.polygon(t,c,m)},o}p(qy,"lightningBolt");var RB=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),IB=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),PB=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Td=10,_d=10;async function zy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-s,t.width<_d&&(t.width=_d);const k=x/2/(2.5+x/50);t.height=(t.height??0)-a-k*3,t.height<Td&&(t.height=Td)}const{shapeSvg:n,bbox:l,label:c}=await dt(e,t,ct(t)),h=(t?.width?t?.width:l.width)+s*2,d=h/2,f=d/(2.5+h/50),u=(t?.height?t?.height:l.height)+f+a*2,g=u*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=ot.svg(n),C=IB(0,0,h,u,d,f,g),k=PB(0,f,h,u,d,f),S=it(t,{}),v=x.path(C,S),T=x.path(k,S);n.insert(()=>T,":first-child").attr("class","line"),m=n.insert(()=>v,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=RB(0,0,h,u,d,f,g);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",Qt(y)).attr("style",i)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),nt(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),t.intersect=function(x){const C=et.rect(t,x),k=C.x-(t.x??0);if(d!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let S=f*f*(1-k*k/(d*d));S>0&&(S=Math.sqrt(S)),S=f-S,x.y-(t.y??0)>0&&(S=-S),C.y+=S}return C},n}p(zy,"linedCylinder");async function jy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const S=t.width;t.width=(S??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await dt(e,t,ct(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:g}=t,m=ot.svg(n),y=it(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...Lr(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],C=m.polygon(x.map(S=>[S.x,S.y]),y),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-f/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-f/2-(l.y-(l.top??0))})`),nt(t,k),t.intersect=function(S){return et.polygon(t,x,S)},n}p(jy,"linedWaveEdgedRect");async function Wy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await dt(e,t,ct(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,u=d-2*n,g=f-2*n,m=-u/2,y=-g/2,{cssStyles:x}=t,C=ot.svg(l),k=it(t,{}),S=[{x:m-n,y:y+n},{x:m-n,y:y+g+n},{x:m+u-n,y:y+g+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y:y+g-n},{x:m+u+n,y:y+g-n},{x:m+u+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],v=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=bt(S);let L=C.path(T,k);const _=bt(v);let D=C.path(_,k);t.look!=="handDrawn"&&(L=wl(L),D=wl(D));const O=l.insert("g",":first-child");return O.insert(()=>L),O.insert(()=>D),O.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),nt(t,O),t.intersect=function(I){return et.polygon(t,S,I)},l}p(Wy,"multiRect");async function Hy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ct(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(s.width,t?.width??0)+l*2,f=Math.max(s.height,t?.height??0)+c*3,u=t.look==="neo"?f/4:f/8,g=f+(h?u/2:-u/2),m=-d/2,y=-g/2,x=10,{cssStyles:C}=t,k=Lr(m-x,y+g+x,m+d-x,y+g+x,u,.8),S=k?.[k.length-1],v=[{x:m-x,y:y+x},{x:m-x,y:y+g+x},...k,{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y:S.y-2*x},{x:m+d+x,y:S.y-2*x},{x:m+d+x,y:y-x},{x:m+x,y:y-x},{x:m+x,y},{x:m,y},{x:m,y:y+x}],T=[{x:m,y:y+x},{x:m+d-x,y:y+x},{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y},{x:m,y}],L=ot.svg(o),_=it(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const D=bt(v),O=L.path(D,_),I=bt(T),j=L.path(I,_),z=o.insert(()=>O,":first-child");return z.insert(()=>j),z.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",i),z.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-(s.width/2)-x-(s.x-(s.left??0))}, ${-(s.height/2)+x-u/2-(s.y-(s.top??0))})`),nt(t,z),t.intersect=function(A){return et.polygon(t,v,A)},o}p(Hy,"multiWaveEdgedRectangle");async function Yy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i,t.useHtmlLabels||he(Rt())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ct(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,f=-h/2,{cssStyles:u}=t,g=ot.svg(a),m=it(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,c,h,m),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),u&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",u),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),nt(t,x),t.intersect=function(C){return et.rect(t,C)},a}p(Yy,"note");var DB=p((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Uy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await dt(e,t,ct(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=ot.svg(o),g=it(t,{}),m=DB(0,0,l),y=u.path(m,g);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=mr(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),nt(t,d),t.calcIntersect=function(u,g){const m=u.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],x=et.polygon(u,y,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},o}p(Uy,"question");async function Gy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await dt(e,t,ct(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,u=-d/2,g=u/2,m=[{x:f+g,y:u},{x:f,y:0},{x:f+g,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:y}=t,x=ot.svg(n),C=it(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=bt(m),S=x.path(k,C),v=n.insert(()=>S,":first-child");return v.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${-g/2},0)`),c.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),nt(t,v),t.intersect=function(T){return et.polygon(t,m,T)},n}p(Gy,"rect_left_inv_arrow");async function Xy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await br(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(he(wt())){const _=h.children[0],D=yt(h);d=_.getBoundingClientRect(),D.attr("width",d.width),D.attr("height",d.height)}V.info("Text 2",l);const f=l||[],u=h.getBBox(),g=await br(n,Array.isArray(f)?f.join("<br/>"):f,t.labelStyle,!0,!0),m=g.children[0],y=yt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const x=(t.padding||0)/2;yt(g).attr("transform","translate( "+(d.width>u.width?0:(u.width-d.width)/2)+", "+(u.height+x+5)+")"),yt(h).attr("transform","translate( "+(d.width<u.width?0:-(u.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")");const C=d.width+(t.padding||0),k=d.height+(t.padding||0),S=-d.width/2-x,v=-d.height/2-x;let T,L;if(t.look==="handDrawn"){const _=ot.svg(s),D=it(t,{}),O=_.path(Fr(S,v,C,k,t.rx||0),D),I=_.line(-d.width/2-x,-d.height/2-x+u.height+x,d.width/2+x,-d.height/2-x+u.height+x,D);L=s.insert(()=>(V.debug("Rough node insert CXC",O),I),":first-child"),T=s.insert(()=>(V.debug("Rough node insert CXC",O),O),":first-child")}else T=a.insert("rect",":first-child"),L=a.insert("line"),T.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),L.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+u.height+x).attr("y2",-d.height/2-x+u.height+x);return nt(t,T),t.intersect=function(_){return et.rect(t,_)},s}p(Xy,"rectWithTitle");async function Vy(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return ro(e,t,o)}p(Vy,"roundedRect");var Dr=8;async function Ky(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ct(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?Dr:Dr*2),h=(t?.height??n.height)+s*2,d=c-Dr,f=h,u=Dr-c/2,g=-h/2,{cssStyles:m}=t,y=ot.svg(a),x=it(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:u,y:g},{x:u+d,y:g},{x:u+d,y:g+f},{x:u-Dr,y:g+f},{x:u-Dr,y:g},{x:u,y:g},{x:u,y:g+f}],k=y.polygon(C.map(v=>[v.x,v.y]),x),S=a.insert(()=>k,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Qt(m)),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${Dr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),nt(t,S),t.intersect=function(v){return et.rect(t,v)},a}p(Ky,"shadedProcess");async function Zy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await dt(e,t,ct(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,u=d/1.5,g=-f/2,m=-u/2,{cssStyles:y}=t,x=ot.svg(n),C=it(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=[{x:g,y:m},{x:g,y:m+u},{x:g+f,y:m+u},{x:g+f,y:m-u/2}],S=bt(k),v=x.path(S,C),T=n.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),T.attr("transform",`translate(0, ${u/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-u/4+(t.padding??0)-(l.y-(l.top??0))})`),nt(t,T),t.intersect=function(L){return et.polygon(t,k,L)},n}p(Zy,"slopedRect");async function Qy(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return ro(e,t,s)}p(Qy,"squareRect");async function Jy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:f}=t,u=ot.svg(n),g=it(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...Ho(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...Ho(h/2-d,0,d,50,270,450)],y=bt(m),x=u.path(y,g),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),nt(t,C),t.intersect=function(k){return et.polygon(t,m,k)},n}p(Jy,"stadium");async function t0(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return ro(e,t,r)}p(t0,"state");function e0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=ot.svg(h),f=it(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),g=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>u,":first-child");if(x.insert(()=>y),t.look!=="handDrawn"&&x.attr("class","outer-path"),s&&x.selectAll("path").attr("style",s),o&&x.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const C=e.node()?.ownerSVGElement?.id??"",k=C?`${C}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${k})`)}return nt(t,x),t.intersect=function(C){return et.circle(t,(t.width??0)/2,C)},h}p(e0,"stateEnd");function r0(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=ot.svg(s).circle(0,0,t.width,kT(i));a=s.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return nt(t,a),t.intersect=function(n){return et.circle(t,(t.width??7)/2,n)},s}p(r0,"stateStart");var di=8;async function i0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=(t?.width??l.width)+2*di+s,h=(t?.height??l.height)+a,d=c-2*di,f=h,u=-c/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){const y=ot.svg(n),x=it(t,{}),C=y.rectangle(u,g,d+16,f,x),k=y.line(u+di,g,u+di,g+f,x),S=y.line(u+di+d,g,u+di+d,g+f,x);n.insert(()=>k,":first-child"),n.insert(()=>S,":first-child");const v=n.insert(()=>C,":first-child"),{cssStyles:T}=t;v.attr("class","basic label-container").attr("style",Qt(T)),nt(t,v)}else{const y=mr(n,d,f,m);i&&y.attr("style",i),nt(t,y)}return t.intersect=function(y){return et.polygon(t,m,y)},n}p(i0,"subroutine");var mn=.2;async function o0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-mn*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=(t?.height?t?.height:l.height)+a*2,h=mn*c,d=mn*c,u=(t?.width?t?.width:l.width)+s*2+h-h,g=c,m=-u/2,y=-g/2,{cssStyles:x}=t,C=ot.svg(n),k=it(t,{}),S=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+g},{x:m-h/2,y:y+g}],v=[{x:m+u-h/2,y:y+g},{x:m+u+h/2,y:y+g},{x:m+u+h/2,y:y+g-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=bt(S),L=C.path(T,k),_=bt(v),D=C.path(_,{...k,fillStyle:"solid"}),O=n.insert(()=>D,":first-child");return O.insert(()=>L,":first-child"),O.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),nt(t,O),t.intersect=function(I){return et.polygon(t,S,I)},n}p(o0,"taggedRect");async function s0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await dt(e,t,ct(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,f=l+c,{cssStyles:u}=t,g=ot.svg(o),m=it(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...Lr(-n/2-n/2*.1,f/2,n/2+n/2*.1,f/2,c,.8),{x:n/2+n/2*.1,y:-f/2},{x:-n/2-n/2*.1,y:-f/2}],x=-n/2+n/2*.1,C=-f/2-d*.4,k=[{x:x+n-h,y:(C+l)*1.3},{x:x+n,y:C+l-d},{x:x+n,y:(C+l)*.9},...Lr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],S=bt(y),v=g.path(S,m),T=bt(k),L=g.path(T,{...m,fillStyle:"solid"}),_=o.insert(()=>L,":first-child");return _.insert(()=>v,":first-child"),_.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),nt(t,_),t.intersect=function(D){return et.polygon(t,y,D)},o}p(s0,"taggedWaveEdgedRectangle");async function a0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await dt(e,t,ct(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),nt(t,h),t.intersect=function(d){return et.rect(t,d)},o}p(a0,"text");var NB=p((e,t,r,i,o,s)=>`M${e},${t}
|
|
234
|
+
a${o},${s} 0,0,1 0,${-i}
|
|
235
|
+
l${r},0
|
|
236
|
+
a${o},${s} 0,0,1 0,${i}
|
|
237
|
+
M${r},${-i}
|
|
238
|
+
a${o},${s} 0,0,0 0,${i}
|
|
239
|
+
l${-r},0`,"createCylinderPathD"),qB=p((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),zB=p((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Bd=5,Ld=10;async function n0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.height<Bd&&(t.height=Bd);const x=m/2/(2.5+m/50);t.width=(t.width??0)-s-x*3,t.width<Ld&&(t.width=Ld)}const{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ct(t)),c=(t.height?t.height:n.height)+s,h=c/2,d=h/(2.5+c/50),f=(t.width?t.width:n.width)+d+s,{cssStyles:u}=t;let g;if(t.look==="handDrawn"){const m=ot.svg(a),y=qB(0,0,f,c,d,h),x=zB(0,0,f,c,d,h),C=m.path(y,it(t,{})),k=m.path(x,it(t,{fill:"none"}));g=a.insert(()=>k,":first-child"),g=a.insert(()=>C,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{const m=NB(0,0,f,c,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Qt(u)).attr("style",i),g.attr("class","basic label-container outer-path"),u&&g.selectAll("path").attr("style",u),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-d-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),nt(t,g),t.intersect=function(m){const y=et.rect(t,m),x=y.y-(t.y??0);if(h!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-d)){let C=d*d*(1-x*x/(h*h));C!=0&&(C=Math.sqrt(Math.abs(C))),C=d-C,m.x-(t.x??0)>0&&(C=-C),y.x+=C}return y},a}p(n0,"tiltedCylinder");async function l0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=ot.svg(n),m=it(t,{}),y=bt(d),x=g.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=mr(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,nt(t,f),t.intersect=function(g){return et.polygon(t,d,g)},n}p(l0,"trapezoid");async function h0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<l&&(t.height=l),t.width=(t.width??0)-s*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await dt(e,t,ct(t)),d=(t?.width?t?.width:h.width)+s*2,f=(t?.height?t?.height:h.height)+a*2,{cssStyles:u}=t,g=ot.svg(c),m=it(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-f/2},{x:d/2*.8,y:-f/2},{x:d/2,y:-f/2*.6},{x:d/2,y:f/2},{x:-d/2,y:f/2},{x:-d/2,y:-f/2*.6}],x=bt(y),C=g.path(x,m),k=c.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),nt(t,k),t.intersect=function(S){return et.polygon(t,y,S)},c}p(h0,"trapezoidalPentagon");var Ed=10,Fd=10;async function c0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.width<Fd&&(t.width=Fd),t.height=t?.height??0,t.height<Ed&&(t.height=Ed));const{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ct(t)),c=ir(wt().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+s,d=t?.height?t?.height:h+n.height,f=d,u=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:g}=t,m=ot.svg(a),y=it(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=bt(u),C=m.path(x,y),k=a.insert(()=>C,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),t.width=h,t.height=d,nt(t,k),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(S){return V.info("Triangle intersect",t,u,S),et.polygon(t,u,S)},a}p(c0,"triangle");async function d0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await dt(e,t,ct(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,u=t.look==="neo"?f/4:f/8,g=f+(n?u:-u),{cssStyles:m}=t,x=14-d,C=x>0?x/2:0,k=ot.svg(l),S=it(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const v=[{x:-d/2-C,y:g/2},...Lr(-d/2-C,g/2,d/2+C,g/2,u,.8),{x:d/2+C,y:-g/2},{x:-d/2-C,y:-g/2}],T=bt(v),L=k.path(T,S),_=l.insert(()=>L,":first-child");return _.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(0,${-u/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-f/2+(t.padding??0)-u-(c.y-(c.top??0))})`),nt(t,_),t.intersect=function(D){return et.polygon(t,v,D)},l}p(d0,"waveEdgedRectangle");async function u0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const S=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-S*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:l}=await dt(e,t,ct(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:u}=t,g=ot.svg(n),m=it(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...Lr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...Lr(c/2,-f/2,-c/2,-f/2,d,-1)],x=bt(y),C=g.path(x,m),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),nt(t,k),t.intersect=function(S){return et.polygon(t,y,S)},n}p(u0,"waveRectangle");var It=10;async function f0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-It,10),t.height=Math.max((t?.height??0)-s*2-It,10));const{shapeSvg:a,bbox:n,label:l}=await dt(e,t,ct(t)),c=(t?.width?t?.width:n.width)+o*2+It,h=(t?.height?t?.height:n.height)+s*2+It,d=c-It,f=h-It,u=-d/2,g=-f/2,{cssStyles:m}=t,y=ot.svg(a),x=it(t,{}),C=[{x:u-It,y:g-It},{x:u-It,y:g+f},{x:u+d,y:g+f},{x:u+d,y:g-It}],k=`M${u-It},${g-It} L${u+d},${g-It} L${u+d},${g+f} L${u-It},${g+f} L${u-It},${g-It}
|
|
240
|
+
M${u-It},${g} L${u+d},${g}
|
|
241
|
+
M${u},${g-It} L${u},${g+f}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.path(k,x),v=a.insert(()=>S,":first-child");return v.attr("transform",`translate(${It/2}, ${It/2})`),v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+It/2-(n.x-(n.left??0))}, ${-(n.height/2)+It/2-(n.y-(n.top??0))})`),nt(t,v),t.intersect=function(T){return et.polygon(t,C,T)},a}p(f0,"windowPane");var Ad=new Set(["redux-color","redux-dark-color"]),jB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Wh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Rt(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:Q}=Rt(),{background:Y}=Q,Z={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Y}`]};await Wh(e,Z)}const c=Rt();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:u,nodeStyles:g}=st(t);if(r.attributes.length===0&&t.label){const Q={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};tr(t.label,c)+Q.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const Y=await ro(e,t,Q);if(i!=null&&Ad.has(i)){const Z=r.colorIndex??0;Y.attr("data-color-id",`color-${Z%l.length}`)}if(!ir(c.htmlLabels)){const Z=Y.select("text"),J=Z.node()?.getBBox();Z.attr("transform",`translate(${-J.width/2}, 0)`)}return Y}c.htmlLabels||(h*=1.25,d*=1.25);let m=ct(t);m||(m="node default");const y=e.insert("g").attr("class",m).attr("id",t.domId||t.id),x=await pi(y,t.label??"",c,0,0,["name"],u);x.height+=d;let C=0;const k=[],S=[];let v=0,T=0,L=0,_=0,D=!0,O=!0;for(const Q of r.attributes){const Y=await pi(y,Q.type,c,0,C,["attribute-type"],u);v=Math.max(v,Y.width+h);const Z=await pi(y,Q.name,c,0,C,["attribute-name"],u);T=Math.max(T,Z.width+h);const J=await pi(y,Q.keys.join(),c,0,C,["attribute-keys"],u);L=Math.max(L,J.width+h);const at=await pi(y,Q.comment,c,0,C,["attribute-comment"],u);_=Math.max(_,at.width+h);const pt=Math.max(Y.height,Z.height,J.height,at.height)+d;S.push({yOffset:C,rowHeight:pt}),C+=pt}let I=4;L<=h&&(D=!1,L=0,I--),_<=h&&(O=!1,_=0,I--);const j=y.node().getBBox();if(x.width+h*2-(v+T+L+_)>0){const Q=x.width+h*2-(v+T+L+_);v+=Q/I,T+=Q/I,L>0&&(L+=Q/I),_>0&&(_+=Q/I)}const z=v+T+L+_,A=ot.svg(y),M=it(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let F=0;S.length>0&&(F=S.reduce((Q,Y)=>Q+(Y?.rowHeight??0),0));const N=Math.max(j.width+h*2,t?.width||0,z),P=Math.max((F??0)+x.height,t?.height||0),$=-N/2,q=-P/2;if(y.selectAll("g:not(:first-child)").each((Q,Y,Z)=>{const J=yt(Z[Y]),at=J.attr("transform");let pt=0,Ct=0;if(at){const Kt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(at);Kt&&(pt=parseFloat(Kt[1]),Ct=parseFloat(Kt[2]),J.attr("class").includes("attribute-name")?pt+=v:J.attr("class").includes("attribute-keys")?pt+=v+T:J.attr("class").includes("attribute-comment")&&(pt+=v+T+L))}J.attr("transform",`translate(${$+h/2+pt}, ${Ct+q+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(q+d/2)+")"),i!=null&&Ad.has(i)){const Q=r.colorIndex??0;y.attr("data-color-id",`color-${Q%l.length}`)}const E=A.rectangle($,q,N,P,M),G=y.insert(()=>E,":first-child").attr("class","outer-path").attr("style",f.join(""));k.push(0);for(const[Q,Y]of S.entries()){const J=(Q+1)%2===0&&Y.yOffset!==0,at=A.rectangle($,x.height+q+Y?.yOffset,N,Y?.rowHeight,{...M,fill:J?s:a,stroke:n});y.insert(()=>at,"g.label").attr("style",f.join("")).attr("class",`row-rect-${J?"even":"odd"}`)}const U=1e-4;let X=mi($,x.height+q,N+$,x.height+q,U),K=A.polygon(X.map(Q=>[Q.x,Q.y]),M);if(y.insert(()=>K).attr("class","divider"),X=mi(v+$,x.height+q,v+$,P+q,U),K=A.polygon(X.map(Q=>[Q.x,Q.y]),M),y.insert(()=>K).attr("class","divider"),D){const Q=v+T+$;X=mi(Q,x.height+q,Q,P+q,U),K=A.polygon(X.map(Y=>[Y.x,Y.y]),M),y.insert(()=>K).attr("class","divider")}if(O){const Q=v+T+L+$;X=mi(Q,x.height+q,Q,P+q,U),K=A.polygon(X.map(Y=>[Y.x,Y.y]),M),y.insert(()=>K).attr("class","divider")}for(const Q of k){const Y=x.height+q+Q;X=mi($,Y,N+$,Y,U),K=A.polygon(X.map(Z=>[Z.x,Z.y]),M),y.insert(()=>K).attr("class","divider")}if(nt(t,G),g&&t.look!=="handDrawn")if(i!=null&&jB.has(i))y.selectAll("path").attr("style",g);else{const Y=g.split(";")?.filter(Z=>Z.includes("stroke"))?.map(Z=>`${Z}`).join("; ");y.selectAll("path").attr("style",Y??""),y.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(Q){return et.rect(t,Q)},y}p(Wh,"erBox");async function pi(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==$n(t)&&(t=$n(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await ze(n,t,{width:tr(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(ir(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=yt(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}p(pi,"addText");function mi(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}p(mi,"lineToPolygon");async function g0(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",ct(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,f=0,u=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const C=t.annotations[0];await To(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await To(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const k=await To(c,C,m,[C.parseClassifier()]);m+=k+s}u=c.node().getBBox().height,u<=0&&(u=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const k=await To(h,C,y,[C.parseClassifier()]);y+=k+s}let x=a.node().getBBox();if(n!==null){const C=n.node().getBBox();n.attr("transform",`translate(${-C.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),x=a.node().getBBox(),c.attr("transform",`translate(0, ${d+f+o*2})`),x=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+o*4:o*2)})`),x=a.node().getBBox(),{shapeSvg:a,bbox:x}}p(g0,"textHelper");async function To(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Rt();let a="useHtmlLabels"in t?t.useHtmlLabels:ir(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Wi(n)&&(a=!0);const l=await ze(o,Kl(_r(n)),{width:tr(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],f=yt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const u=d.getElementsByTagName("img");if(u){const g=n.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...u].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",g){const C=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,S=parseInt(C,10)*5+"px";m.style.minWidth=S,m.style.maxWidth=S}else m.style.width="100%";y(m)}p(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}c=d.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{i.includes("font-weight: bolder")&&yt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=n[0]+n.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}p(To,"addText");async function p0(e,t){const r=wt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??ir(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await g0(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=st(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=ot.svg(c),y=it(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Math.max(t.width??0,h.width);let C=Math.max(t.height??0,h.height);const k=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?C+=a:l.members.length>0&&l.methods.length===0&&(C+=a*2);const S=-x/2,v=-C/2;let T=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;k&&(T=s*2);const L=m.rectangle(S-s,v-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),x+2*s,C+2*s+T,y),_=c.insert(()=>L,":first-child");_.attr("class","basic label-container outer-path");const D=_.node().getBBox(),O=c.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,I=c.select(".label-group").node().getBBox().height-(g?s/2:0)||0,j=c.select(".members-group").node().getBBox().height-(g?s/2:0)||0,z=(O+I+v+s-(v-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((A,M,F)=>{const N=yt(F[M]),P=N.attr("transform");let $=0;if(P){const U=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(P);U&&($=parseFloat(U[2]))}let q=$+v+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(N.attr("class").includes("methods-group")){const G=Math.max(j,a/2);k?q=Math.max(z,O+I+G+v+a*2+s)+a*2:q=O+I+G+v+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?q=$-a:q=$),n||(q-=4);let E=S;(N.attr("class").includes("label-group")||N.attr("class").includes("annotation-group"))&&(E=-N.node()?.getBBox().width/2||0,c.selectAll("text").each(function(G,U,X){window.getComputedStyle(X[U]).textAnchor==="middle"&&(E=0)})),N.attr("transform",`translate(${E}, ${q})`)}),l.members.length>0||l.methods.length>0||g){const A=O+I+v+s,M=m.line(D.x,A,D.x+D.width,A+.001,y);c.insert(()=>M).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(g||l.members.length>0||l.methods.length>0){const A=O+I+j+v+a*2+s,M=m.line(D.x,k?Math.max(z,A):A,D.x+D.width,(k?Math.max(z,A):A)+.001,y);c.insert(()=>M).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),_.select(":nth-child(2)").attr("style",u),c.selectAll(".divider").select("path").attr("style",u),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",u),!n){const A=RegExp(/color\s*:\s*([^;]*)/),M=A.exec(u);if(M){const F=M[0].replace("color","fill");c.selectAll("tspan").attr("style",F)}else if(d){const F=A.exec(d);if(F){const N=F[0].replace("color","fill");c.selectAll("tspan").attr("style",N)}}}return nt(t,_),t.intersect=function(A){return et.rect(t,A)},c}p(p0,"classBox");async function m0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=ct(t),{themeVariables:h}=wt(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let g;l?g=await Ve(u,`<<${o.type}>>`,0,t.labelStyle):g=await Ve(u,"<<Element>>",0,t.labelStyle);let m=g;const y=await Ve(u,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const D=await Ve(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=D;const O=await Ve(u,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=O;const I=await Ve(u,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=I,await Ve(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const D=await Ve(u,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=D,await Ve(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const x=(u.node()?.getBBox().width??200)+a,C=(u.node()?.getBBox().height??200)+a,k=-x/2,S=-C/2,v=ot.svg(u),T=it(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const L=v.rectangle(k,S,x,C,T),_=u.insert(()=>L,":first-child");if(_.attr("class","basic label-container outer-path").attr("style",i),d?.length){const D=t.colorIndex??0;u.attr("data-color-id",`color-${D%d.length}`)}if(u.selectAll(".label").each((D,O,I)=>{const j=yt(I[O]),z=j.attr("transform");let A=0,M=0;if(z){const $=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);$&&(A=parseFloat($[1]),M=parseFloat($[2]))}const F=M-C/2;let N=k+a/2;(O===0||O===1)&&(N=A),j.attr("transform",`translate(${N}, ${F+a})`)}),m>g+y+n){const D=S+g+y+n;let O;if(t.look==="neo"){const z=[[k,D],[k+x,D],[k+x,D+.001],[k,D+.001]];O=v.polygon(z,T)}else O=v.line(k,D,k+x,D,T);u.insert(()=>O).attr("class","divider")}return nt(t,_),t.intersect=function(D){return et.rect(t,D)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}p(m0,"requirementBox");async function Ve(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=wt(),a=s.htmlLabels??!0,n=await ze(o,Kl(_r(t)),{width:tr(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=yt(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(Ve,"addText");var WB=p(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function y0(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await dt(e,t,ct(t)),h=t.padding||10;let d="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const u={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await pn(f,"ticket"in t&&t.ticket||"",u):{label:g,bbox:m}=await pn(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:x}=await pn(n,"assigned"in t&&t.assigned||"",u);t.width=a;const C=10,k=t?.width||0,S=Math.max(m.height,x.height)/2,v=Math.max(l.height+C*2,t?.height||0)+S,T=-k/2,L=-v/2;c.attr("transform","translate("+(h-k/2)+", "+(-S-l.height/2)+")"),g.attr("transform","translate("+(h-k/2)+", "+(-S+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-x.width-2*s)+", "+(-S+l.height/2)+")");let _;const{rx:D,ry:O}=t,{cssStyles:I}=t;if(t.look==="handDrawn"){const j=ot.svg(n),z=it(t,{}),A=D||O?j.path(Fr(T,L,k,v,D||0),z):j.rectangle(T,L,k,v,z);_=n.insert(()=>A,":first-child"),_.attr("class","basic label-container").attr("style",I||null)}else{_=n.insert("rect",":first-child"),_.attr("class","basic label-container __APA__").attr("style",o).attr("rx",D??5).attr("ry",O??5).attr("x",T).attr("y",L).attr("width",k).attr("height",v);const j="priority"in t&&t.priority;if(j){const z=n.append("line"),A=T+2,M=L+Math.floor((D??0)/2),F=L+v-Math.floor((D??0)/2);z.attr("x1",A).attr("y1",M).attr("x2",A).attr("y2",F).attr("stroke-width","4").attr("stroke",WB(j))}}return nt(t,_),t.height=v,t.intersect=function(j){return et.rect(t,j)},n}p(y0,"kanbanItem");async function x0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await dt(e,t,ct(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,f=s.width+20,u=s.height+20,g=Math.max(l,f),m=Math.max(c,u);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const x=`M0 0
|
|
242
|
+
a${h},${h} 1 0,0 ${g*.25},${-1*m*.1}
|
|
243
|
+
a${h},${h} 1 0,0 ${g*.25},0
|
|
244
|
+
a${h},${h} 1 0,0 ${g*.25},0
|
|
245
|
+
a${h},${h} 1 0,0 ${g*.25},${m*.1}
|
|
246
|
+
|
|
247
|
+
a${h},${h} 1 0,0 ${g*.15},${m*.33}
|
|
248
|
+
a${h*.8},${h*.8} 1 0,0 0,${m*.34}
|
|
249
|
+
a${h},${h} 1 0,0 ${-1*g*.15},${m*.33}
|
|
250
|
+
|
|
251
|
+
a${h},${h} 1 0,0 ${-1*g*.25},${m*.15}
|
|
252
|
+
a${h},${h} 1 0,0 ${-1*g*.25},0
|
|
253
|
+
a${h},${h} 1 0,0 ${-1*g*.25},0
|
|
254
|
+
a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15}
|
|
255
|
+
|
|
256
|
+
a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33}
|
|
257
|
+
a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
|
|
258
|
+
a${h},${h} 1 0,0 ${g*.1},${-1*m*.33}
|
|
259
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const C=ot.svg(o),k=it(t,{}),S=C.path(x,k);y=o.insert(()=>S,":first-child"),y.attr("class","basic label-container").attr("style",Qt(d))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),nt(t,y),t.calcIntersect=function(C,k){return et.rect(C,k)},t.intersect=function(C){return V.info("Bang intersect",t,C),et.rect(t,C)},o}p(x0,"bang");async function C0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await dt(e,t,ct(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:g}=t;let m;const y=`M0 0
|
|
260
|
+
a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
|
|
261
|
+
a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}
|
|
262
|
+
a${d},${d} 1 0,1 ${l*.35},${l*.2}
|
|
263
|
+
|
|
264
|
+
a${h},${h} 1 0,1 ${l*.15},${c*.35}
|
|
265
|
+
a${u},${u} 1 0,1 ${-1*l*.15},${c*.65}
|
|
266
|
+
|
|
267
|
+
a${d},${h} 1 0,1 ${-1*l*.25},${l*.15}
|
|
268
|
+
a${f},${f} 1 0,1 ${-1*l*.5},0
|
|
269
|
+
a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
|
|
270
|
+
|
|
271
|
+
a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
|
|
272
|
+
a${u},${u} 1 0,1 ${l*.1},${-1*c*.65}
|
|
273
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const x=ot.svg(o),C=it(t,{}),k=x.path(y,C);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Qt(g))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),nt(t,m),t.calcIntersect=function(x,C){return et.rect(x,C)},t.intersect=function(x){return V.info("Cloud intersect",t,x),et.rect(t,x)},o}p(C0,"cloud");async function b0(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await dt(e,t,ct(t)),l=s.width+8*a,c=s.height+2*a,h=5,d=t.look==="neo"?`
|
|
274
|
+
M${-l/2} ${c/2-h}
|
|
275
|
+
v${-c+2*h}
|
|
276
|
+
q0,-${h} ${h},-${h}
|
|
277
|
+
h${l-2*h}
|
|
278
|
+
q${h},0 ${h},${h}
|
|
279
|
+
v${c-h}
|
|
280
|
+
H${-l/2}
|
|
281
|
+
Z
|
|
282
|
+
`:`
|
|
283
|
+
M${-l/2} ${c/2-h}
|
|
284
|
+
v${-c+2*h}
|
|
285
|
+
q0,-${h} ${h},-${h}
|
|
286
|
+
h${l-2*h}
|
|
287
|
+
q${h},0 ${h},${h}
|
|
288
|
+
v${c-2*h}
|
|
289
|
+
q0,${h} ${-h},${h}
|
|
290
|
+
h${-(l-2*h)}
|
|
291
|
+
q${-h},0 ${-h},${-h}
|
|
292
|
+
Z
|
|
293
|
+
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),nt(t,f),t.calcIntersect=function(u,g){return et.rect(u,g)},t.intersect=function(u){return et.rect(t,u)},o}p(b0,"defaultMindmapNode");async function k0(e,t){const r={padding:t.padding??0};return jh(e,t,r)}p(k0,"mindmapCircle");var HB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Qy},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Vy},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Jy},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:i0},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:ky},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:wy},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:jh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:x0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:C0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Uy},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ey},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Ny},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Dy},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:l0},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Iy},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:vy},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:a0},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:fy},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Ky},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:r0},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:e0},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:By},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Fy},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:yy},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:xy},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Cy},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:qy},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:d0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Ly},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:n0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:zy},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:by},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Sy},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:c0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:f0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Ty},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:h0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:_y},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Zy},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Hy},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Wy},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:uy},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:my},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:s0},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:o0},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:u0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Gy},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:jy}],YB=p(()=>{const t=[...Object.entries({state:t0,choice:gy,note:Yy,rectWithTitle:Xy,labelRect:Py,iconSquare:Oy,iconCircle:My,icon:Ay,iconRounded:$y,imageSquare:Ry,anchor:cy,kanbanItem:y0,mindmapCircle:k0,defaultMindmapNode:b0,classBox:p0,erBox:Wh,requirementBox:m0}),...HB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),w0=YB();function S0(e){return e in w0}p(S0,"isValidShape");var Na=new Map;async function Hh(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?w0[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Qt(t.look)),t.tooltip&&o.attr("title",t.tooltip),Na.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(Hh,"insertNode");var UB=p((e,t)=>{Na.set(t.id,e)},"setNodeElem"),GB=p(()=>{Na.clear()},"clear"),XB=p(e=>{const t=Na.get(e.id);V.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),yi=p((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),ie={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Md={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function _o(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Ot(e),t=Ot(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}p(_o,"calculateDeltaAndAngle");var Ot=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),v0=p(e=>({x:p(function(t,r,i){let o=0;const s=Ot(i[0]).x<Ot(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(ie,e.arrowTypeStart)){const{angle:u,deltaX:g}=_o(i[0],i[1]);o=ie[e.arrowTypeStart]*Math.cos(u)*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(ie,e.arrowTypeEnd)){const{angle:u,deltaX:g}=_o(i[i.length-1],i[i.length-2]);o=ie[e.arrowTypeEnd]*Math.cos(u)*(g>=0?1:-1)}const a=Math.abs(Ot(t).x-Ot(i[i.length-1]).x),n=Math.abs(Ot(t).y-Ot(i[i.length-1]).y),l=Math.abs(Ot(t).x-Ot(i[0]).x),c=Math.abs(Ot(t).y-Ot(i[0]).y),h=ie[e.arrowTypeStart],d=ie[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=s==="right"?-1:1,o-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=s==="right"?-1:1,o+=u}return Ot(t).x+o},"x"),y:p(function(t,r,i){let o=0;const s=Ot(i[0]).y<Ot(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(ie,e.arrowTypeStart)){const{angle:u,deltaY:g}=_o(i[0],i[1]);o=ie[e.arrowTypeStart]*Math.abs(Math.sin(u))*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(ie,e.arrowTypeEnd)){const{angle:u,deltaY:g}=_o(i[i.length-1],i[i.length-2]);o=ie[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(g>=0?1:-1)}const a=Math.abs(Ot(t).y-Ot(i[i.length-1]).y),n=Math.abs(Ot(t).x-Ot(i[i.length-1]).x),l=Math.abs(Ot(t).y-Ot(i[0]).y),c=Math.abs(Ot(t).x-Ot(i[0]).x),h=ie[e.arrowTypeStart],d=ie[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=s==="up"?-1:1,o-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=s==="up"?-1:1,o+=u}return Ot(t).y+o},"y")}),"getLineFunctionsWithOffset"),VB=p((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&$d(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&$d(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),KB={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},ZB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],$d=p((e,t,r,i,o,s,a=!1,n)=>{const l=KB[r],c=l&&ZB.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${g}`;if(!document.getElementById(m)){const y=document.getElementById(u);if(y){const x=y.cloneNode(!0);x.id=m,x.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",n),l.fill&&k.setAttribute("fill",n)}),y.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),QB=p(e=>typeof e=="string"?e:wt()?.flowchart?.curve,"resolveEdgeCurveType"),Yo=new Map,Zt=new Map,JB=p(()=>{Yo.clear(),Zt.clear()},"clear"),po=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),T0=p(async(e,t)=>{const r=wt();let i=he(r);const{labelStyles:o}=st(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await ze(e,t.label,{style:po(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),V.info("abc82",t,t.labelType);let h=c.getBBox(),d=h;if(i){const u=c.children[0],g=yt(c);h=u.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const u=yt(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",yi(d,i)),Yo.set(t.id,s),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await br(g,t.startLabelLeft,po(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",yi(y,i)),Zt.get(t.id)||Zt.set(t.id,{}),Zt.get(t.id).startLeft=u,Bo(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await br(g,t.startLabelRight,po(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",yi(y,i)),Zt.get(t.id)||Zt.set(t.id,{}),Zt.get(t.id).startRight=u,Bo(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await br(u,t.endLabelLeft,po(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",yi(y,i)),Zt.get(t.id)||Zt.set(t.id,{}),Zt.get(t.id).endLeft=u,Bo(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await br(u,t.endLabelRight,po(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",yi(y,i)),Zt.get(t.id)||Zt.set(t.id,{}),Zt.get(t.id).endRight=u,Bo(f,t.endLabelRight)}return c},"insertEdgeLabel");function Bo(e,t){he(wt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(Bo,"setTerminalWidth");var _0=p((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,Yo.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=wt(),{subGraphTitleTotalMargin:o}=$a(i);if(e.label){const s=Yo.get(e.id);let a=e.x,n=e.y;if(r){const l=_e.calcLabelPosition(r);V.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Zt.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=_e.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Zt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=_e.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Zt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=_e.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Zt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=_e.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),tL=p((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),eL=p((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),rL=p((e,t,r)=>{V.debug(`intersection calc abc89:
|
|
294
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
295
|
+
insidePoint : ${JSON.stringify(r)}
|
|
296
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-s:a+s;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;n=h*d/c;const f={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(f.x=t.x,f.y=t.y),h===0&&(f.x=t.x),c===0&&(f.y=t.y),V.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,f),f}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let d=c*n/h,f=r.x<t.x?r.x+h-n:r.x-h+n,u=r.y<t.y?r.y+d:r.y-d;return V.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${n}`,{_x:f,_y:u}),n===0&&(f=t.x,u=t.y),h===0&&(f=t.x),c===0&&(u=t.y),{x:f,y:u}}},"intersection"),Od=p((e,t)=>{V.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(V.info("abc88 checking point",s,t),!eL(t,s)&&!o){const a=rL(t,i,s);V.debug("abc88 inside",s,i,a),V.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?V.warn("abc88 no intersect",a,r):r.push(a),o=!0}else V.warn("abc88 outside",s,i),i=s,o||r.push(s)}),V.debug("returning points",r),r},"cutPathAtIntersect");function B0(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],a=e[i+1];(o.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(B0,"extractCornerPoints");var Rd=p(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),iL=p(function(e){const{cornerPointPositions:t}=B0(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],a=e[i],n=Rd(o,a,5),l=Rd(s,a,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let f={x:a.x,y:a.y};if(Math.abs(s.x-o.x)>10&&Math.abs(s.y-o.y)>=10){V.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const u=5;a.x===n.x?f={x:c<0?n.x-u+d:n.x+u-d,y:h<0?n.y-d:n.y+d}:f={x:c<0?n.x-d:n.x+d,y:h<0?n.y-u+d:n.y+u-d}}else V.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),oL=p((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),L0=p(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=wt();let h=t.points,d=!1;const f=o;var u=s;const g=[];for(const P in t.cssCompiledStyles)mh(P)||g.push(t.cssCompiledStyles[P]);if(c==="swimlane"){if(u.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),u.intersect(h[1])];else{const P=h.slice(1,-1),$=P[0],q=P[P.length-1],E=.5,G=Math.abs(h[h.length-1].x-q.x)<E&&Math.abs(h[h.length-1].y-q.y)<E,U=f.intersect($),X=G?q:u.intersect(q),K=Math.abs(X.x-q.x)<E&&Math.abs(X.y-q.y)<E,Y=Math.abs(U.x-$.x)<E&&Math.abs(U.y-$.y)<E?[]:[U],Z=K?[]:[X];h=[...Y,...P,...Z]}h=tL(t,h)}else u.intersect&&f.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(f.intersect(h[0])),h.push(u.intersect(h[h.length-1])));const m=btoa(JSON.stringify(h));t.toCluster&&(V.info("to cluster abc88",r.get(t.toCluster)),h=Od(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(V.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=Od(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(P=>!Number.isNaN(P.y));const x=QB(t.curve);x!=="rounded"&&(y=iL(y));let C=Ao;switch(x){case"linear":C=Ao;break;case"basis":C=Gs;break;case"cardinal":C=jf;break;case"bumpX":C=Pf;break;case"bumpY":C=Df;break;case"catmullRom":C=Hf;break;case"monotoneX":C=Kf;break;case"monotoneY":C=Zf;break;case"natural":C=Jf;break;case"step":C=tg;break;case"stepAfter":C=rg;break;case"stepBefore":C=eg;break;case"rounded":C=Ao;break;default:C=Gs}const{x:k,y:S}=v0(t),v=Rf().x(k).y(S).curve(C);let T;switch(t.thickness){case"normal":T="edge-thickness-normal";break;case"thick":T="edge-thickness-thick";break;case"invisible":T="edge-thickness-invisible";break;default:T="edge-thickness-normal"}switch(t.pattern){case"solid":T+=" edge-pattern-solid";break;case"dotted":T+=" edge-pattern-dotted";break;case"dashed":T+=" edge-pattern-dashed";break;default:T+=" edge-pattern-solid"}let L,_=x==="rounded"?E0(F0(y,t),5):v(y);const D=Array.isArray(t.style)?t.style:[t.style];let O=D.find(P=>P?.startsWith("stroke:")),I="";t.animate&&(I="edge-animation-fast"),t.animation&&(I="edge-animation-"+t.animation);let j=!1;if(t.look==="handDrawn"){const P=ot.svg(e);Object.assign([],y);const $=P.path(_,{roughness:.3,seed:l});T+=" transition",L=yt($).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+T+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",D?D.reduce((E,G)=>E+";"+G,""):"");let q=L.attr("d");L.attr("d",q),e.node().appendChild(L.node())}else{const P=g.join(";"),$=D?D.reduce((K,Q)=>K+Q+";",""):"",q=(P?P+";"+$+";":$)+";"+(D?D.reduce((K,Q)=>K+";"+Q,""):"");L=e.append("path").attr("d",_).attr("id",`${a}-${t.id}`).attr("class"," "+T+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",q),O=q.match(/stroke:([^;]+)/)?.[1],j=t.animate===!0||!!t.animation||P.includes("animation");const E=L.node(),G=typeof E.getTotalLength=="function"?E.getTotalLength():0,U=Md[t.arrowTypeStart]||0,X=Md[t.arrowTypeEnd]||0;if(t.look==="neo"&&!j){const Q=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?oL(G,U,X):`0 ${U} ${G-U-X} ${X}`}; stroke-dashoffset: 0;`;L.attr("style",Q+L.attr("style"))}}L.attr("data-edge",!0),L.attr("data-et","edge"),L.attr("data-id",t.id),L.attr("data-points",m),L.attr("data-look",Qt(t.look)),t.showPoints&&y.forEach(P=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",P.x).attr("cy",P.y)});let z="";(wt().flowchart.arrowMarkerAbsolute||wt().state.arrowMarkerAbsolute)&&(z=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,z=z.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const A=!j&&t?.look==="neo";VB(L,t,z,a,i,A,O);const M=Math.floor(h.length/2),F=h[M];_e.isLabelCoordinateInPath(F,L.attr("d"))||(d=!0);let N={};return d&&(N.updatedPath=h),N.originalPath=t.points,N},"insertEdge");function E0(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const a=e[s],n=e[s-1],l=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-n.x,h=a.y-n.y,d=l.x-a.x,f=l.y-a.y,u=Math.hypot(c,h),g=Math.hypot(d,f);if(u<o||g<o){r+=`L${a.x},${a.y}`;continue}const m=c/u,y=h/u,x=d/g,C=f/g,k=m*x+y*C,S=Math.max(-1,Math.min(1,k)),v=Math.acos(S);if(v<o||Math.abs(Math.PI-v)<o){r+=`L${a.x},${a.y}`;continue}const T=Math.min(t/Math.sin(v/2),u/2,g/2),L=a.x-m*T,_=a.y-y*T,D=a.x+x*T,O=a.y+C*T;r+=`L${L},${_}`,r+=`Q${a.x},${a.y} ${D},${O}`}}return r}p(E0,"generateRoundedPath");function Tl(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}p(Tl,"calculateDeltaAndAngle");function F0(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&ie[t.arrowTypeStart]){const o=ie[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=Tl(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&ie[t.arrowTypeEnd]){const o=ie[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=Tl(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(F0,"applyMarkerOffsetsToPoints");var sL=p((e,t,r,i)=>{t.forEach(o=>{LL[o](e,r,i)})},"insertMarkers"),aL=p((e,t,r)=>{V.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),nL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),lL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),hL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),cL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),dL=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),uL=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),fL=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),gL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),pL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),mL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),yL=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),xL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),CL=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),bL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),kL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),wL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),SL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),vL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
|
|
297
|
+
L20,10
|
|
298
|
+
M20,10
|
|
299
|
+
L0,20`)},"requirement_arrow"),TL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
|
|
300
|
+
L20,10
|
|
301
|
+
M20,10
|
|
302
|
+
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),_L=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),BL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),LL={extension:aL,composition:nL,aggregation:lL,dependency:hL,lollipop:cL,point:dL,circle:uL,cross:fL,barb:gL,barbNeo:pL,only_one:mL,zero_or_one:yL,one_or_more:xL,zero_or_more:CL,only_one_neo:bL,zero_or_one_neo:kL,one_or_more_neo:wL,zero_or_more_neo:SL,requirement_arrow:vL,requirement_contains:_L,requirement_arrow_neo:TL,requirement_contains_neo:BL},A0=sL,EL={common:Qi,getConfig:Rt,insertCluster:iy,insertEdge:L0,insertEdgeLabel:T0,insertMarkers:A0,insertNode:Hh,interpolateToCurve:Sh,labelHelper:dt,log:V,positionEdgeLabel:_0},Uo={},M0=p(e=>{for(const t of e)Uo[t.name]=t},"registerLayoutLoaders"),FL=p(()=>{M0([{name:"dagre",loader:p(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-CC9EQKtT.cjs")),"loader")},{name:"swimlane",loader:p(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-RzXk2ZsR.cjs")),"loader")},{name:"cose-bilkent",loader:p(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-BeacL0Ew.cjs")),"loader")}])},"registerDefaultLayoutLoaders");FL();var AL=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Uo))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}const i=Uo[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return o.render(e,t,EL,{algorithm:i.algorithm},r)},"render"),ML=p((e="",{fallback:t="dagre"}={})=>{if(e in Uo)return e;if(t in Uo)return V.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Yh="comm",$0="rule",O0="decl",$L="@media",OL="@import",RL="@supports",IL="@namespace",_l="@keyframes",R0="@layer",PL="@scope",DL=Math.abs,Oo=String.fromCharCode;function I0(e){return e.trim()}function Bl(e,t,r){return e.replace(t,r)}function vi(e,t){return e.charCodeAt(t)|0}function Vi(e,t,r){return e.slice(t,r)}function Ke(e){return e.length}function P0(e){return e.length}function ys(e,t){return t.push(e),e}var qa=1,Ki=1,D0=0,Le=0,qt=0,io="";function Uh(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:qa,column:Ki,length:a,return:"",siblings:n}}function NL(){return qt}function qL(){return qt=Le>0?vi(io,--Le):0,Ki--,qt===10&&(Ki=1,qa--),qt}function De(){return qt=Le<D0?vi(io,Le++):0,Ki++,qt===10&&(Ki=1,qa++),qt}function kr(){return vi(io,Le)}function Fs(){return Le}function za(e,t){return Vi(io,e,t)}function Go(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function zL(e){return qa=Ki=1,D0=Ke(io=e),Le=0,[]}function jL(e){return io="",e}function yn(e){return I0(za(Le-1,Ll(e===91?e+2:e===40?e+1:e)))}function WL(e){for(;(qt=kr())&&qt<33;)De();return Go(e)>2||Go(qt)>3?"":" "}function HL(e,t){for(;--t&&De()&&!(qt<48||qt>102||qt>57&&qt<65||qt>70&&qt<97););return za(e,Fs()+(t<6&&kr()==32&&De()==32))}function Ll(e){for(;De();)switch(qt){case e:return Le;case 34:case 39:e!==34&&e!==39&&Ll(qt);break;case 40:e===41&&Ll(e);break;case 92:De();break}return Le}function YL(e,t){for(;De()&&e+qt!==57;)if(e+qt===84&&kr()===47)break;return"/*"+za(t,Le-1)+"*"+Oo(e===47?e:De())}function UL(e){for(;!Go(kr());)De();return za(e,Le)}function GL(e){return jL(As("",null,null,null,[""],e=zL(e),0,[0],e))}function As(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,g=0,m=1,y=1,x=1,C=0,k=0,S="",v=o,T=s,L=i,_=S;y;)switch(g=k,k=De()){case 40:g!=108&&vi(_,d-1)==58?(C++,_+="("):_+=yn(k);break;case 41:C--,_+=")";break;case 34:case 39:case 91:_+=yn(k);break;case 9:case 10:case 13:case 32:if(C>0){_+=Oo(k);break}_+=WL(g);break;case 92:_+=HL(Fs()-1,7);continue;case 47:switch(kr()){case 42:case 47:ys(XL(YL(De(),Fs()),t,r,l),l),(Go(g||1)==5||Go(kr()||1)==5)&&Ke(_)&&Vi(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:n[c++]=Ke(_)*x;case 125*m:case 59:case 0:if(C>0&&k){_+=Oo(k);break}switch(k){case 0:case 125:y=0;case 59+h:x==-1&&(_=Bl(_,/\f/g,"")),u>0&&(Ke(_)-d||m===0)&&ys(u>32?Pd(_+";",i,r,d-1,l):Pd(Bl(_," ","")+";",i,r,d-2,l),l);break;case 59:_+=";";default:if(ys(L=Id(_,t,r,c,h,o,n,S,v=[],T=[],d,s),s),k===123)if(h===0)As(_,t,L,L,v,s,d,n,T);else{switch(f){case 99:if(vi(_,3)===110)break;case 108:if(vi(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?As(e,L,L,i&&ys(Id(e,L,L,0,0,o,n,S,o,v=[],d,T),T),o,T,d,n,i?v:T):As(_,L,L,L,[""],T,0,n,T)}}c=h=u=0,m=x=1,S=_="",d=a;break;case 58:d=1+Ke(_),u=g;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&qL()==125)continue}switch(_+=Oo(k),k*m){case 38:x=h>0?1:(_+="\f",-1);break;case 44:if(C>0)break;n[c++]=(Ke(_)-1)*x,x=1;break;case 64:kr()===45&&(_+=yn(De())),f=kr(),h=d=Ke(S=_+=UL(Fs())),k++;break;case 45:g===45&&Ke(_)==2&&(m=0)}}return s}function Id(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=P0(u),m=0,y=0,x=0;m<i;++m)for(var C=0,k=Vi(e,f+1,f=DL(y=a[m])),S=e;C<g;++C)(S=I0(y>0?u[C]+" "+k:Bl(k,/&\f/g,u[C])))&&(l[x++]=S);return Uh(e,t,r,o===0?$0:n,l,c,h,d)}function XL(e,t,r,i){return Uh(e,t,r,Yh,Oo(NL()),Vi(e,2,-2),0,i)}function Pd(e,t,r,i,o){return Uh(e,t,r,O0,Vi(e,0,i),Vi(e,i+1,-1),i,o)}function El(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function VL(e,t,r,i){switch(e.type){case R0:if(e.children.length)break;case OL:case IL:case O0:return e.return=e.return||e.value;case Yh:return"";case _l:return e.return=e.value+"{"+El(e.children,i)+"}";case $0:if(!Ke(e.value=e.props.join(",")))return""}return Ke(r=El(e.children,i))?e.return=e.value+"{"+r+"}":""}function KL(e){var t=P0(e);return function(r,i,o,s){for(var a="",n=0;n<t;n++)a+=e[n](r,i,o,s)||"";return a}}var N0="c4",ZL=p(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),QL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-DWjHOW7P.cjs"));return{id:N0,diagram:e}},"loader"),JL={id:N0,detector:ZL,loader:QL},tE=JL,q0="flowchart",eE=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),rE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-BY2Fc_n3.cjs"));return{id:q0,diagram:e}},"loader"),iE={id:q0,detector:eE,loader:rE},oE=iE,z0="flowchart-v2",sE=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),aE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-BY2Fc_n3.cjs"));return{id:z0,diagram:e}},"loader"),nE={id:z0,detector:sE,loader:aE},lE=nE,j0="swimlane",hE=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),cE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-BdbEkuk7.cjs"));return{id:j0,diagram:e}},"loader"),dE={id:j0,detector:hE,loader:cE},uE=dE,W0="er",fE=p(e=>/^\s*erDiagram/.test(e),"detector"),gE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-D8vW6pbx.cjs"));return{id:W0,diagram:e}},"loader"),pE={id:W0,detector:fE,loader:gE},mE=pE,H0="gitGraph",yE=p(e=>/^\s*gitGraph/.test(e),"detector"),xE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-DbYXrclf.cjs"));return{id:H0,diagram:e}},"loader"),CE={id:H0,detector:yE,loader:xE},bE=CE,Y0="gantt",kE=p(e=>/^\s*gantt/.test(e),"detector"),wE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-D8Y9jimu.cjs"));return{id:Y0,diagram:e}},"loader"),SE={id:Y0,detector:kE,loader:wE},vE=SE,U0="info",TE=p(e=>/^\s*info/.test(e),"detector"),_E=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-D5RCO_vv.cjs"));return{id:U0,diagram:e}},"loader"),BE={id:U0,detector:TE,loader:_E},G0="pie",LE=p(e=>/^\s*pie/.test(e),"detector"),EE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-Cak5M9yn.cjs"));return{id:G0,diagram:e}},"loader"),FE={id:G0,detector:LE,loader:EE},X0="quadrantChart",AE=p(e=>/^\s*quadrantChart/.test(e),"detector"),ME=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-55hF84Fw.cjs"));return{id:X0,diagram:e}},"loader"),$E={id:X0,detector:AE,loader:ME},OE=$E,V0="xychart",RE=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),IE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-By9uEzY0.cjs"));return{id:V0,diagram:e}},"loader"),PE={id:V0,detector:RE,loader:IE},DE=PE,K0="requirement",NE=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),qE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-DPs0Ihw7.cjs"));return{id:K0,diagram:e}},"loader"),zE={id:K0,detector:NE,loader:qE},jE=zE,Z0="sequence",WE=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),HE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-0J_xPyLe.cjs"));return{id:Z0,diagram:e}},"loader"),YE={id:Z0,detector:WE,loader:HE},UE=YE,Q0="class",GE=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),XE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-BZRw3Il9.cjs"));return{id:Q0,diagram:e}},"loader"),VE={id:Q0,detector:GE,loader:XE},KE=VE,J0="classDiagram",ZE=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),QE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-BZRw3Il9.cjs"));return{id:J0,diagram:e}},"loader"),JE={id:J0,detector:ZE,loader:QE},tF=JE,tx="state",eF=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),rF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-DzuNZ3I1.cjs"));return{id:tx,diagram:e}},"loader"),iF={id:tx,detector:eF,loader:rF},oF=iF,ex="stateDiagram",sF=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),aF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-pdxYI04k.cjs"));return{id:ex,diagram:e}},"loader"),nF={id:ex,detector:sF,loader:aF},lF=nF,rx="journey",hF=p(e=>/^\s*journey/.test(e),"detector"),cF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-a80p1mpy.cjs"));return{id:rx,diagram:e}},"loader"),dF={id:rx,detector:hF,loader:cF},uF=dF,fF=p((e,t,r)=>{V.debug(`rendering svg for syntax error
|
|
303
|
+
`);const i=ig(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Hl(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),ix={draw:fF},gF=ix,pF={db:{},renderer:ix,parser:{parse:p(()=>{},"parse")}},mF=pF,ox="flowchart-elk",yF=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),xF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-BY2Fc_n3.cjs"));return{id:ox,diagram:e}},"loader"),CF={id:ox,detector:yF,loader:xF},bF=CF,sx="timeline",kF=p(e=>/^\s*timeline/.test(e),"detector"),wF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./timeline-definition-FHXFAJF6--ngcmo2O.cjs"));return{id:sx,diagram:e}},"loader"),SF={id:sx,detector:kF,loader:wF},vF=SF,ax="mindmap",TF=p(e=>/^\s*mindmap/.test(e),"detector"),_F=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./mindmap-definition-LN4V7U3C-BkehNbGL.cjs"));return{id:ax,diagram:e}},"loader"),BF={id:ax,detector:TF,loader:_F},LF=BF,nx="kanban",EF=p(e=>/^\s*kanban/.test(e),"detector"),FF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./kanban-definition-HUTT4EX6-D9SadN7G.cjs"));return{id:nx,diagram:e}},"loader"),AF={id:nx,detector:EF,loader:FF},MF=AF,lx="sankey",$F=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),OF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sankeyDiagram-HTMAVEWB-C5XpxThf.cjs"));return{id:lx,diagram:e}},"loader"),RF={id:lx,detector:$F,loader:OF},IF=RF,hx="packet",PF=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),DF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-NH7WQ7WH-e_5r7YfA.cjs"));return{id:hx,diagram:e}},"loader"),NF={id:hx,detector:PF,loader:DF},cx="radar",qF=p(e=>/^\s*radar-beta/.test(e),"detector"),zF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-WEI45ONY-PgR9S6g1.cjs"));return{id:cx,diagram:e}},"loader"),jF={id:cx,detector:qF,loader:zF},dx="block",WF=p(e=>/^\s*block(-beta)?/.test(e),"detector"),HF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./blockDiagram-677ZJIJ3-09mZA62D.cjs"));return{id:dx,diagram:e}},"loader"),YF={id:dx,detector:WF,loader:HF},UF=YF,ux="treeView",GF=p(e=>/^\s*treeView-beta/.test(e),"detector"),XF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-OA4YK3LP-gAuJXOZ8.cjs"));return{id:ux,diagram:e}},"loader"),VF={id:ux,detector:GF,loader:XF},KF=VF,fx="architecture",ZF=p(e=>/^\s*architecture/.test(e),"detector"),QF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./architectureDiagram-ZJ3FMSHR-mtDK4cwq.cjs"));return{id:fx,diagram:e}},"loader"),JF={id:fx,detector:ZF,loader:QF},tA=JF,gx="eventmodeling",eA=p(e=>/^\s*eventmodeling/.test(e),"detector"),rA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-FQU43EPY-pkT8NaMb.cjs"));return{id:gx,diagram:e}},"loader"),iA={id:gx,detector:eA,loader:rA},oA=iA,px="ishikawa",sA=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),aA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ishikawaDiagram-FXEZZL3T-Csx1NBdz.cjs"));return{id:px,diagram:e}},"loader"),nA={id:px,detector:sA,loader:aA},mx="venn",lA=p(e=>/^\s*venn-beta/.test(e),"detector"),hA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./vennDiagram-L72KCM5P-rD2w7pAb.cjs"));return{id:mx,diagram:e}},"loader"),cA={id:mx,detector:lA,loader:hA},dA=cA,yx="treemap",uA=p(e=>/^\s*treemap/.test(e),"detector"),fA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-G47NLZAW-DqNB9k7X.cjs"));return{id:yx,diagram:e}},"loader"),gA={id:yx,detector:uA,loader:fA},xx="wardley",pA=p(e=>/^\s*wardley-beta/i.test(e),"detector"),mA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./wardleyDiagram-EHGQE667-DfYFaC8_.cjs"));return{id:xx,diagram:e}},"loader"),yA={id:xx,detector:pA,loader:mA},xA=yA,Cx="cynefin",CA=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),bA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./cynefinDiagram-TSTJHNR4-CB8X1jFh.cjs"));return{id:Cx,diagram:e}},"loader"),kA={id:Cx,detector:CA,loader:bA},bx="railroad",wA=p(e=>/^\s*railroad-beta/i.test(e),"detector"),SA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./railroadDiagram-RFXS5EU6-DcKZ88rg.cjs"));return{id:bx,diagram:e}},"loader"),vA={id:bx,detector:wA,loader:SA},kx="railroadEbnf",TA=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),_A=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ebnfDiagram-CCIWWBDH-y4KbiCN5.cjs"));return{id:kx,diagram:e}},"loader"),BA={id:kx,detector:TA,loader:_A},wx="railroadAbnf",LA=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),EA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./abnfDiagram-VRR7QNED-CBpBnfY2.cjs"));return{id:wx,diagram:e}},"loader"),FA={id:wx,detector:LA,loader:EA},Sx="railroadPeg",AA=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),MA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pegDiagram-2B236MQR-BfOxwgjO.cjs"));return{id:Sx,diagram:e}},"loader"),$A={id:Sx,detector:AA,loader:MA},Dd=!1,ja=p(()=>{Dd||(Dd=!0,Ns("error",mF,e=>e.toLowerCase().trim()==="error"),Ns("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Mn(bF,LF,tA),Mn(tE,MF,tF,KE,mE,vE,BE,FE,jE,UE,uE,lE,oE,vF,bE,lF,oF,uF,OE,IF,NF,DE,UF,oA,KF,jF,nA,gA,vA,BA,FA,$A,dA,xA,kA))},"addDiagrams"),OA=p(async()=>{V.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Qr).map(async([r,{detector:i,loader:o}])=>{if(o)try{Pn(r)}catch{try{const{diagram:s,id:a}=await o();Ns(a,s,i)}catch(s){throw V.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Qr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){V.error(`Failed to load ${t.length} external diagrams`);for(const r of t)V.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),RA="graphics-document document";function vx(e,t){e.attr("role",RA),t!==""&&e.attr("aria-roledescription",t)}p(vx,"setA11yDiagramInfo");function Tx(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(Tx,"addSVGa11yTitleDescription");var Vr,Fl=(Vr=class{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static async fromText(t,r={}){const i=Rt(),o=jl(t,i);t=KT(t)+`
|
|
304
|
+
`;try{Pn(o)}catch{const c=dk(o);if(!c)throw new Wu(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();Ns(h,d)}const{db:s,parser:a,renderer:n,init:l}=Pn(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new Vr(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(Vr,"Diagram"),Vr),Nd=[],IA=p(()=>{Nd.forEach(e=>{e()}),Nd=[]},"attachFunctions"),PA=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function _x(e){const t=e.match(ju);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
|
|
305
|
+
`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
|
|
306
|
+
`):t[2];let o=qp(i,{schema:Np})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}p(_x,"extractFrontMatter");var DA=p(e=>e.replace(/\r\n?/g,`
|
|
307
|
+
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),NA=p(e=>{const{text:t,metadata:r}=_x(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),qA=p(e=>{const t=_e.detectInit(e)??{},r=_e.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:qT(e),directive:t}},"processDirectives");function Gh(e){const t=DA(e),r=NA(t),i=qA(r.text),o=Ma(r.config,i.directive);return e=PA(i.text),{code:e,title:r.title,config:o}}p(Gh,"preprocessDiagram");function Bx(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(Bx,"toBase64");var zA=5e4,jA="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",WA="sandbox",HA="loose",YA="http://www.w3.org/2000/svg",UA="http://www.w3.org/1999/xlink",GA="http://www.w3.org/1999/xhtml",XA="100%",VA="100%",KA="border:0;margin:0;",ZA="margin:0",QA="allow-top-navigation-by-user-activation allow-popups",JA='The "iframe" tag is not supported by your browser.',tM=["foreignobject"],eM=["dominant-baseline"];function Xh(e){const t=Gh(e);return Ps(),nk(t.config??{}),t}p(Xh,"processAndSetConfigs");async function Lx(e,t){ja();try{const{code:r,config:i}=Xh(e);return{diagramType:(await Fx(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(Lx,"parse");var qd=p((e,t,r=[])=>{const i=Iu(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),rM=p((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=he(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Jc(l.styles)||n.forEach(c=>{r.insertRule(qd(l.id,c,l.styles),r.cssRules.length)}),Jc(l.textStyles)||r.insertRule(qd(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=In(o)+`
|
|
308
|
+
`}else i+=`${e.themeCSS}
|
|
309
|
+
`;return i+In(r)},"createCssStyles"),iM=p((e,t)=>El(GL(`${e}{${t}}`),KL([p(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===_l)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[$L,RL,R0,PL,"@container","@starting-style"],_l].includes(i.type)||(V.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Yh))},"addNamespace"),VL])),"compileCSS"),oM=p((e,t,r,i)=>{const o=rM(e,r),s=Lk(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return iM(i,s)},"createUserStyles"),sM=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=_r(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),aM=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":VA,i=Bx(`<body style="${ZA}">${e}</body>`);return`<iframe style="width:${XA};height:${r};${KA}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${QA}">
|
|
310
|
+
${JA}
|
|
311
|
+
</iframe>`},"putIntoIFrame"),zd=p((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",YA);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function Al(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(Al,"sandboxedIframe");var nM=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),lM=p(async function(e,t,r){ja();const i=Xh(t);t=i.code;const o=Rt();V.debug(o),t.length>(o?.maxTextSize??zA)&&(t=jA);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const z=yt(f?n:c).node();z&&"remove"in z&&z.remove()},"removeTempElements");let d=yt(document.body);const f=o.securityLevel===WA,u=o.securityLevel===HA,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const j=Al(yt(r),a);d=yt(j.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);zd(d,e,l,`font-family: ${g}`,UA)}else{if(nM(document,e,l,a),f){const j=Al(yt(document.body),a);d=yt(j.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");zd(d,e,l)}let m,y;try{m=await Fl.fromText(t,{title:i.title})}catch(j){if(o.suppressErrorRendering)throw h(),j;m=await Fl.fromText("error"),y=j}const x=d.select(c).node(),C=m.type,k=x.firstChild,S=k.firstChild,v=m.renderer.getClasses?.(t,m),T=oM(o,C,v,s),L=document.createElement("style");L.innerHTML=T,k.insertBefore(L,S);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(j){throw o.suppressErrorRendering?h():gF.draw(t,e,"11.16.0"),j}const _=d.select(`${c} svg`),D=m.db.getAccTitle?.(),O=m.db.getAccDescription?.();Ax(C,_,D,O),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",GA);let I=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),I=sM(I,f,ir(o.arrowMarkerAbsolute)),f){const j=d.select(c+" svg").node();I=aM(I,j)}else u||(I=qi.sanitize(I,{ADD_TAGS:tM,ADD_ATTR:eM,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(IA(),y)throw y;return h(),{diagramType:C,svg:I,bindFunctions:m.db.bindFunctions}},"render");function Ex(e={}){const t=zt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),sk(t),t?.theme&&t.theme in dr?t.themeVariables=dr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=dr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?ok(t):Pu();Nl(r.logLevel),ja()}p(Ex,"initialize");var Fx=p((e,t={})=>{const{code:r}=Gh(e);return Fl.fromText(r,t)},"getDiagramFromText");function Ax(e,t,r,i){vx(t,e),Tx(t,r,i,t.attr("id"))}p(Ax,"addA11yInfo");var ri=Object.freeze({render:lM,parse:Lx,getDiagramFromText:Fx,initialize:Ex,getConfig:Rt,setConfig:Du,getSiteConfig:Pu,updateSiteConfig:ak,reset:p(()=>{Ps()},"reset"),globalReset:p(()=>{Ps(ji)},"globalReset"),defaultConfig:ji});Nl(Rt().logLevel);Ps(Rt());var hM=p((e,t,r)=>{V.warn(e),Lh(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Mx=p(async function(e={querySelector:".mermaid"}){try{await cM(e)}catch(t){if(Lh(t)&&V.error(t.str),gr.parseError&&gr.parseError(t),!e.suppressErrors)throw V.error("Use the suppressErrors option to suppress these errors"),t}},"run"),cM=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=ri.getConfig();V.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(V.debug("Start On Load: "+i?.startOnLoad),ri.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new _e.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(V.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=Rm(_e.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=_e.detectInit(a);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await Ix(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){hM(d,n,gr.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),$x=p(function(e){ri.initialize(e)},"initialize"),dM=p(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&$x(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Mx(i)},"init"),uM=p(async(e,{lazyLoad:t=!0}={})=>{ja(),Mn(...e),t===!1&&await OA()},"registerExternalDiagrams"),Ox=p(function(){if(gr.startOnLoad){const{startOnLoad:e}=ri.getConfig();e&&gr.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Ox,!1);var fM=p(function(e){gr.parseError=e},"setParseErrorHandler"),da=[],xn=!1,Rx=p(async()=>{if(!xn){for(xn=!0;da.length>0;){const e=da.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}xn=!1}},"executeQueue"),gM=p(async(e,t)=>new Promise((r,i)=>{const o=p(()=>new Promise((s,a)=>{ri.parse(e,t).then(n=>{s(n),r(n)},n=>{V.error("Error parsing",n),gr.parseError?.(n),a(n),i(n)})}),"performCall");da.push(o),Rx().catch(i)}),"parse"),Ix=p((e,t,r)=>new Promise((i,o)=>{const s=p(()=>new Promise((a,n)=>{ri.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),gr.parseError?.(l),n(l),o(l)})}),"performCall");da.push(s),Rx().catch(o)}),"render"),pM=p(()=>Object.keys(Qr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),gr={startOnLoad:!0,mermaidAPI:ri,parse:gM,render:Ix,init:dM,run:Mx,registerExternalDiagrams:uM,registerLayoutLoaders:M0,initialize:$x,parseError:void 0,contentLoaded:Ox,setParseErrorHandler:fM,detectType:jl,registerIconPacks:wm,getRegisteredDiagramsMetadata:pM},Ml=gr;const mM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],yM=Bt("maximize-2",mM);const xM=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],CM=Bt("minimize-2",xM),Er="flex size-11 items-center justify-center rounded border p-1 shadow",bM="flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow",kM="absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",jd="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",pr="fullscreen",wM=229,SM=e=>{const t=e.ownerDocument.defaultView?.getComputedStyle(e).blockSize;t!==void 0&&(e.style.minBlockSize=t)},Wd=e=>{if(e.parentElement!==null)return e.parentElement;const t=e.getRootNode();return"host"in t?t.host:null},vM=e=>{const t=[];for(let r=Wd(e);r!==null;r=Wd(r))t.push({element:r,top:r.scrollTop,left:r.scrollLeft});return t},TM=e=>{for(const{element:t,top:r,left:i}of e)(t.scrollTop!==r||t.scrollLeft!==i)&&t.scrollTo({top:r,left:i,behavior:"instant"})},_M=e=>{e.style.removeProperty("min-block-size"),e.getAttribute("style")===""&&e.removeAttribute("style")},Vh=(e,t)=>{const[r,i]=B.useState(!1),o=B.useRef(null),s=B.useRef(null),a=B.useRef([]),n=B.useRef(!1);B.useEffect(()=>{n.current&&(n.current=!1,o.current?.querySelector(`[${e}="${pr}"]`)?.focus())},[r,e]);const l=B.useCallback(f=>{const u=o.current;if(u===null)return;const g=s.current;f&&g!==null&&(a.current=vM(g),SM(g)),u.close(),f?u.showModal():(u.show(),g!==null&&_M(g),TM(a.current),a.current=[]),n.current=!0,i(f)},[]);B.useLayoutEffect(()=>{r&&!t&&l(!1)},[r,t,l]);const c=B.useCallback(()=>l(!r),[r,l]),h=B.useCallback(f=>{!r||f.key!=="Escape"||f.defaultPrevented||f.nativeEvent.isComposing||f.keyCode===wM||(f.preventDefault(),f.stopPropagation(),l(!1))},[r,l]),d=B.useCallback(f=>{f.preventDefault(),l(!1)},[l]);return{fullscreen:r,toggle:c,dialogRef:o,dialogProps:{ref:o,open:!0,role:r?void 0:"group","data-aqmd-fullscreen-dialog":"",onKeyDown:h,onCancel:d},rootProps:{ref:s,"data-aqmd-fullscreen":r?"":void 0}}},Kh=({hook:e,fullscreen:t,labels:r,tabIndex:i,onToggle:o})=>{const s=t?r.exitFullscreen:r.fullscreen;return w.jsx("button",{type:"button",[e]:pr,tabIndex:i,onClick:o,className:Er,"aria-label":s.text,lang:s.lang,children:t?w.jsx(CM,{size:18}):w.jsx(yM,{size:18})})},Px="both-shift",Hd=Object.freeze({none:Object.freeze({panTrigger:null,zoom:!1}),zoom:Object.freeze({panTrigger:null,zoom:!0}),pan:Object.freeze({panTrigger:"drag",zoom:!1}),"pan-shift":Object.freeze({panTrigger:"shift-drag",zoom:!1}),both:Object.freeze({panTrigger:"drag",zoom:!0}),"both-shift":Object.freeze({panTrigger:"shift-drag",zoom:!0})}),BM=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),LM=Object.freeze(["none","zoom","pan","both"]),EM=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),Ms=.3,FM=3,AM=2,Wr=.5,MM=1;function Yd(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const $M=0;function Cn(e,t,r){return e.panTrigger===null||t.button!==$M?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function OM(e,t){return e.zoom&&t.shiftKey}function RM(e){if(e===null)return null;const t=e.trim().split(/[\s,]+/u),[r,i]=t.length===4?[Number(t[2]),Number(t[3])]:[Number.NaN,Number.NaN];if(!(Number.isFinite(r)&&r>0&&Number.isFinite(i)&&i>0))throw new Error(`[@aiquants/markdown] MermaidDiagram: the drawing has no usable viewBox (${JSON.stringify(e)})`);return{inline:r,block:i}}function IM(e,t){if(!(Number.isFinite(e)&&e>0&&(t===null||Number.isFinite(t)&&t>0)))throw new Error(`[@aiquants/markdown] MermaidDiagram: cannot fit a drawing ${t} px wide into a layout ${e} px wide`);return t===null?1:Math.min(1,e/t)}function PM(e){if(!(Number.isFinite(e)&&e>0&&e<=1))throw new Error(`[@aiquants/markdown] MermaidDiagram: the fit scale must be in (0, 1], got ${e}`);return{minScale:1,maxScale:AM/e}}function bn(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function mo(e,t,r,i,o){return{scale:t,x:e.x+(i.x-o.origin.x)/t-(r.x-o.origin.x)/e.scale,y:e.y+(i.y-o.origin.y)/t-(r.y-o.origin.y)/e.scale}}function DM(e,t,r){const i=(o,s,a,n)=>{const l=(0-s)/e.scale,c=(n-s-e.scale*a)/e.scale;return Math.min(Math.max(l,c),Math.max(Math.min(l,c),o))};return{scale:e.scale,x:i(e.x,t.origin.x,t.inline,r.inline),y:i(e.y,t.origin.y,t.block,r.block)}}function NM(e,t,r){return e*t.inline-r.inline>Wr||e*t.block-r.block>Wr}function qM(e,t){const r=s=>Math.hypot(s[1].x-s[0].x,s[1].y-s[0].y),i=s=>({x:(s[0].x+s[1].x)/2,y:(s[0].y+s[1].y)/2}),o=r(e);return o<MM?null:{ratio:r(t)/o,from:i(e),to:i(t)}}function Ud(e){return e*(1-Math.exp(-Ms))}function Gd(e,t,r){const i=e<-Wr||e>Wr;return t-e>r+Wr?i?0-e:0:e<-Wr?0-e:t>r+Wr?r-t:0}const Wa=Object.freeze({interactionMode:{text:"マウス操作モード",lang:"ja"},interactionModeTouch:{text:"タッチ操作モード",lang:"ja"},modeNone:{text:"操作なし",lang:"ja"},modeZoom:{text:"拡大縮小のみ",lang:"ja"},modePan:{text:"移動のみ (左ドラッグ)",lang:"ja"},modePanShift:{text:"移動のみ (Shift+ドラッグ)",lang:"ja"},modeBoth:{text:"拡大縮小+移動 (左ドラッグ)",lang:"ja"},modeBothShift:{text:"拡大縮小+移動 (Shift+ドラッグ)",lang:"ja"},modeNoneTouch:{text:"操作なし (指はページをスクロール)",lang:"ja"},modeZoomTouch:{text:"拡大縮小のみ (2 本指)",lang:"ja"},modePanTouch:{text:"移動のみ (はみ出す図を 1 本指でドラッグ)",lang:"ja"},modeBothTouch:{text:"拡大縮小+移動 (2 本指・はみ出す図は 1 本指)",lang:"ja"},zoomIn:{text:"Zoom In",lang:"en"},zoomOut:{text:"Zoom Out",lang:"en"},resetView:{text:"Reset View",lang:"en"},panUp:{text:"Pan Up",lang:"en"},panDown:{text:"Pan Down",lang:"en"},panLeft:{text:"Pan Left",lang:"en"},panRight:{text:"Pan Right",lang:"en"},...At.FULLSCREEN_CONTROL_LABEL_CATALOGS.en,fullscreenDialog:{text:"Diagram (full screen)",lang:"en"},diagram:{text:"Diagram (arrow keys pan, + and - zoom, 0 resets)",lang:"en"},retry:{text:"再試行",lang:"ja"}}),zM=ga(Wa),jM=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),WM=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),Dx="(pointer: coarse)",HM=e=>{const t=window.matchMedia(Dx);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},YM=()=>window.matchMedia(Dx).matches,UM=()=>!1,GM=()=>B.useSyncExternalStore(HM,YM,UM),Zh=(e,t)=>{const[r,i]=B.useState(null),o=r!==null&&e.includes(r)?r:e[0],s=l=>l instanceof Element?l.getAttribute(t):null;return{onKeyDown:l=>{const c=s(l.target);if(c===null||l.altKey||l.ctrlKey||l.metaKey||l.shiftKey)return;const h=e.indexOf(c);if(h===-1)return;const d=l.currentTarget.ownerDocument.defaultView?.getComputedStyle(l.currentTarget).direction==="rtl",f=d?"ArrowLeft":"ArrowRight",u=d?"ArrowRight":"ArrowLeft";let g;switch(l.key){case f:g=(h+1)%e.length;break;case u:g=(h-1+e.length)%e.length;break;case"Home":g=0;break;case"End":g=e.length-1;break;default:return}l.preventDefault(),l.currentTarget.querySelector(`[${t}="${e[g]}"]`)?.focus()},onFocus:l=>{const c=s(l.target);c!==null&&e.includes(c)&&i(c)},tabIndexOf:l=>l===o?0:-1}},Ro={side:"start",offset:0,maxWidth:null},XM=(e,t,r,i)=>{const o=l=>l>=r.low&&l+t<=r.high;if(o(i?e.right-t:e.left))return Ro;if(o(i?e.left:e.right-t))return{side:"end",offset:e.right-e.left-t,maxWidth:null};const s=r.high-r.low;if(s<=0)return Ro;const a=Math.min(t,s),n=Math.min(Math.max(i?e.right-a:e.left,r.low),r.high-a);return{side:"inside",offset:i?e.right-n-a:n-e.left,maxWidth:a<t?a:null}},Nx=({buttonHook:e,menuHook:t,label:r,icon:i,tabIndex:o,items:s})=>{const[a,n]=B.useState(null),[l,c]=B.useState(Ro),h=a!==null,d=B.useId(),f=B.useId(),u=B.useRef(null),g=B.useRef(null),m=B.useRef(null),y=()=>Array.from(m.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]),x=S=>{n(null),c(Ro),S&&g.current?.focus()};B.useLayoutEffect(()=>{const S=u.current,v=m.current;if(a===null||S===null||v===null)return;const T=v.ownerDocument.documentElement.clientWidth,L=S.closest('[role="toolbar"]')?.getBoundingClientRect(),_=L===void 0?{low:0,high:T}:{low:Math.max(0,L.left),high:Math.min(T,L.right)},D=v.ownerDocument.defaultView?.getComputedStyle(v).direction==="rtl";c(XM(S.getBoundingClientRect(),v.getBoundingClientRect().width,_,D));const O=y(),I=O.findIndex(z=>z.getAttribute("aria-checked")==="true"),j=a==="last"?O.length-1:Math.max(I,0);O[j]?.focus()},[a]),B.useEffect(()=>{const S=u.current?.ownerDocument;if(!h||S===void 0)return;const v=T=>{T.target instanceof Node&&u.current?.contains(T.target)===!0||(n(null),c(Ro))};return S.addEventListener("pointerdown",v,!0),S.addEventListener("focusin",v,!0),()=>{S.removeEventListener("pointerdown",v,!0),S.removeEventListener("focusin",v,!0)}},[h]);const C=S=>{if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),n(S.key==="ArrowUp"?"last":"chosen");return}S.key==="Escape"&&h&&(S.preventDefault(),S.stopPropagation(),x(!1))},k=S=>{const v=y(),T=v.indexOf(S.target);let L;switch(S.key){case"ArrowDown":L=(T+1)%v.length;break;case"ArrowUp":L=(T-1+v.length)%v.length;break;case"Home":L=0;break;case"End":L=v.length-1;break;case"Escape":S.preventDefault(),S.stopPropagation(),x(!0);return;default:return}S.preventDefault(),S.stopPropagation(),v[L]?.focus()};return w.jsxs("div",{ref:u,className:"relative",children:[w.jsx("button",{ref:g,id:d,type:"button",...e,tabIndex:o,onClick:()=>h?x(!1):n("chosen"),onKeyDown:C,className:Er,"aria-label":r.text,lang:r.lang,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?f:void 0,children:i}),h&&w.jsx("div",{ref:m,id:f,role:"menu","aria-labelledby":d,...t,"data-aqmd-control-menu":l.side,style:l.maxWidth===null?{insetInlineStart:l.offset}:{insetInlineStart:l.offset,maxInlineSize:l.maxWidth},onKeyDown:k,className:kM,children:s.map(S=>{const v=()=>{x(!0),S.onSelect()};return S.checked===void 0?w.jsx("button",{type:"button",role:"menuitem",tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:jd,children:w.jsx("span",{children:S.label.text})},S.key):w.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":S.checked,tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:jd,children:[w.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:S.checked?"✓":""}),w.jsx("span",{children:S.label.text})]},S.key)})})]})},Xd=new Set(["gantt"]),VM=200,KM=300,ZM=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),QM="data-aqmd-mermaid-host",JM=e=>{const t=document.createElement("div");return t.setAttribute(QM,""),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.insetBlockStart="0",t.style.insetInlineStart=`${-e}px`,t.style.width=`${e}px`,t.style.visibility="hidden",t.style.contain="strict",document.body.append(t),t};let Vd=Promise.resolve();const t5=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},Kd=e=>{e.resetStyle(),e.destroy()},kn=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",e5=Object.freeze({visibility:"hidden"}),yo="data-aqmd-mermaid-control",r5="--aqmd-mermaid-ratio";let qx=!1,$l=null;if(Ml?.initialize)try{Ml.initialize({startOnLoad:!1}),qx=!0}catch(e){$l=e instanceof Error?e:new Error(String(e))}else $l=new Error("Mermaid library or mermaid.initialize is not available.");const zx=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:o})=>{const s=B.useMemo(()=>zi(Wa,i),[i]),a=B.useId(),n=B.useId(),l=B.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),c=B.useRef(0),h=B.useRef(null),d=B.useRef(null),f=B.useRef(null),u=B.useRef(null),[g,m]=B.useState(!0),[y,x]=B.useState(null),[C,k]=B.useState(null),[S,v]=B.useState(0),T=B.useRef(!1),L=GM(),[_,D]=B.useState(t??Px),O=B.useRef(Hd[_]),I=B.useRef(!1),[j,z]=B.useState(!1);B.useEffect(()=>{t&&D(t)},[t]),B.useEffect(()=>{O.current=Hd[_],u.current?.refresh()},[_]),B.useEffect(()=>{if(m(!0),x(null),k(null),!qx){x($l?.message||"Mermaid failed to initialize globally."),m(!1);return}const Y=e.trim();if(Y===""){m(!1);return}const Z=h.current;if(!Z)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let J=!1,at=0,pt=null,Ct=Z.offsetWidth,St=null,Kt,de;const Nt=()=>{ye.disconnect(),clearTimeout(Kt)},Mt=Yt=>{St=null,Nt(),x(Yt),k(null),m(!1)},Wt=Yt=>{c.current+=1;const ue=c.current;at=ue,pt=Yt;const Fe=()=>!J&&ue===at,Ae=async()=>{const Tt=JM(Yt);try{return await Ml.render(`${l.current}-${ue}`,Y,Tt)}finally{Tt.remove()}};Vd=Vd.then(()=>Fe()?Ae().then(Tt=>{if(Fe()){if(typeof Tt.svg!="string"||Tt.svg.length===0){Mt("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}St=Tt.diagramType,k({svg:Tt.svg,bindFunctions:typeof Tt.bindFunctions=="function"?Tt.bindFunctions:null}),m(!1),Xd.has(Tt.diagramType)?Ct!==Yt&&Ht():ye.disconnect()}}).catch(Tt=>{if(Fe()){if(console.error(`[MermaidDiagram ${l.current}] Error rendering Mermaid diagram:`,Tt),t5(Tt)&&!T.current){T.current=!0,de=setTimeout(()=>v(kt=>kt+1),KM);return}Mt(Tt instanceof Error?Tt.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},Ht=()=>{clearTimeout(Kt),Kt=setTimeout(()=>{Ct>0&&Ct!==pt&&Wt(Ct)},VM)},Jt=()=>{const Yt=Z.offsetWidth;if(Yt!==Ct){if(Ct=Yt,pt===null){Yt>0&&Wt(Yt);return}St!==null&&Xd.has(St)&&Ht()}},ye=new ResizeObserver(Jt);return ye.observe(Z),Ct>0&&Wt(Ct),()=>{J=!0,Nt(),clearTimeout(de)}},[e,S]),B.useEffect(()=>{const Y=d.current;if(!Y)return;const Z=()=>{u.current=null,f.current&&(Kd(f.current),f.current=null),I.current=!1,z(!1)};if(!C){Y.innerHTML="",Z();return}Y.innerHTML=C.svg;const J=Y.querySelector("svg");let at=!1,pt;const Ct=[];if(J){let St;try{St=RM(J.getAttribute("viewBox"))}catch(Nt){console.error(`[MermaidDiagram ${l.current}] Cannot size the drawing:`,Nt),x(Nt instanceof Error?Nt.message:String(Nt)),k(null);return}const Kt=St===null?null:St.inline;St!==null&&J.style.setProperty(r5,String(St.inline/St.block));const de=()=>{if(at)return;const Nt=J.getBBox();if(!Nt||Nt.width===0||Nt.height===0){pt=setTimeout(de,100);return}f.current&&Kd(f.current);const Mt=_u(J,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:Ms,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:Yd(O.current,!1)});f.current=Mt;let Wt={minScale:1,maxScale:1};const Ht=()=>{const tt=Mt.getPan();return{scale:Mt.getScale(),x:tt.x,y:tt.y}},Jt=()=>{const tt=Y.getBoundingClientRect(),ht=J.getBoundingClientRect(),{scale:xt,x:Pt,y:Ut}=Ht();return{frameRect:tt,frame:{inline:tt.width,block:tt.height},drawing:{origin:{x:ht.left-tt.left-xt*Pt,y:ht.top-tt.top-xt*Ut},inline:ht.width/xt,block:ht.height/xt}}},ye=()=>{if(at)return;const{frame:tt,drawing:ht}=Jt(),xt=NM(Mt.getScale(),ht,tt);I.current=xt,z(xt),Mr(xt),Mt.setOptions({touchAction:Yd(O.current,xt)}),Y.style.cursor=kn(O.current,kt?.kind==="pan"&&kt.mouse)},Yt=()=>{const{drawing:tt}=Jt();tt.inline<=0||(Wt=PM(IM(tt.inline,Kt)),Mt.setOptions({minScale:Wt.minScale,maxScale:Wt.maxScale}))},ue=tt=>{const ht=Ht(),{frame:xt,drawing:Pt}=Jt(),Ut=DM({...tt,scale:bn(tt.scale,Wt)},Pt,xt);return Ut.scale===ht.scale&&Ut.x===ht.x&&Ut.y===ht.y?!1:(Mt.zoom(Ut.scale,{animate:!1,force:!0,silent:!0}),Mt.pan(Ut.x,Ut.y,{animate:!1,force:!0}),ye(),!0)},Fe=(tt,ht)=>{const{drawing:xt}=Jt();return ue(mo(Ht(),bn(tt,Wt),ht,ht,xt))},Ae=tt=>{const ht=Y.getBoundingClientRect();return{x:tt.x-ht.left,y:tt.y-ht.top}};u.current={zoomBy:tt=>{const{frame:ht}=Jt();Fe(Mt.getScale()*Math.exp(tt*Ms),{x:ht.inline/2,y:ht.block/2})},panBy:(tt,ht)=>{const{drawing:xt}=Jt(),Pt=Ht();return ue(mo(Pt,Pt.scale,{x:0,y:0},{x:tt,y:ht},xt))},reset:()=>{ue({scale:1,x:0,y:0})},panSteps:()=>{const{frame:tt}=Jt();return{x:Ud(tt.inline),y:Ud(tt.block)}},refresh:ye};const Tt=new Map;let kt=null;const je=tt=>({x:tt.clientX,y:tt.clientY}),Ar=()=>{const tt=[...Tt.values()];return tt.length===2?[tt[0],tt[1]]:null},We=tt=>{if(Tt.has(tt.pointerId)&&Tt.set(tt.pointerId,je(tt)),kt?.kind==="pinch"){const ht=Ar();if(ht===null)return;const xt=qM(kt.last,ht);if(kt={kind:"pinch",last:ht},xt===null)return;const{drawing:Pt}=Jt(),Ut=Ht();ue(mo(Ut,bn(Ut.scale*xt.ratio,Wt),Ae(xt.from),Ae(xt.to),Pt));return}if(kt?.kind==="pan"&&kt.pointerId===tt.pointerId){const ht=je(tt),{drawing:xt}=Jt(),Pt=Ht();ue(mo(Pt,Pt.scale,Ae(kt.last),Ae(ht),xt)),kt={...kt,last:ht}}},He=()=>{window.removeEventListener("pointermove",We),window.removeEventListener("pointerup",Ye),window.removeEventListener("pointercancel",Ye)},si=()=>{He(),window.addEventListener("pointermove",We),window.addEventListener("pointerup",Ye),window.addEventListener("pointercancel",Ye)},Ye=tt=>{if(Tt.delete(tt.pointerId),kt?.kind==="pinch"){const[ht]=[...Tt.entries()];kt=ht!==void 0&&Cn(O.current,{button:0,shiftKey:!1,pointerType:tt.pointerType},I.current)?{kind:"pan",pointerId:ht[0],last:ht[1],mouse:!1}:null}else kt?.kind==="pan"&&kt.pointerId===tt.pointerId&&(kt=null);kt===null&&Tt.size===0&&He(),Y.style.cursor=kn(O.current,kt?.kind==="pan"&&kt.mouse)},Me=tt=>{const ht=O.current;if(tt.pointerType==="touch"||tt.pointerType==="pen"){Tt.set(tt.pointerId,je(tt)),si();const xt=Ar();xt!==null&&ht.zoom?kt={kind:"pinch",last:xt}:Tt.size>1?kt?.kind==="pan"&&!kt.mouse&&(kt=null):Cn(ht,tt,I.current)&&(kt={kind:"pan",pointerId:tt.pointerId,last:je(tt),mouse:!1});return}Cn(ht,tt,I.current)&&(kt={kind:"pan",pointerId:tt.pointerId,last:je(tt),mouse:!0},Y.style.cursor=kn(ht,!0),si(),tt.preventDefault())},Ue=tt=>{kt!==null&&!(kt.kind==="pan"&&kt.mouse)&&tt.cancelable&&tt.preventDefault()};let ai=!1;const Mr=tt=>{tt!==ai&&(ai=tt,tt?Y.addEventListener("touchmove",Ue,{passive:!1}):Y.removeEventListener("touchmove",Ue))},$r=tt=>{const ht=tt.target;if(!(ht instanceof Element)||ht===J||!J.contains(ht))return;const xt=Y.getBoundingClientRect(),Pt=ht.getBoundingClientRect(),Ut={x:Gd(Pt.left-xt.left,Pt.right-xt.left,xt.width),y:Gd(Pt.top-xt.top,Pt.bottom-xt.top,xt.height)};if(Ut.x===0&&Ut.y===0)return;const{drawing:ni}=Jt(),Ft=Ht();ue(mo(Ft,Ft.scale,{x:0,y:0},Ut,ni))},oo=tt=>{if(!OM(O.current,tt))return;const ht=tt.deltaY===0?tt.deltaX:tt.deltaY;ht!==0&&(tt.preventDefault(),Fe(Mt.getScale()*Math.exp(Math.sign(-ht)*Ms/FM),Ae(je(tt))))},Or=new ResizeObserver(()=>{Yt(),ue(Ht()),ye()});Y.addEventListener("pointerdown",Me),Y.addEventListener("focusin",$r),Y.addEventListener("wheel",oo,{passive:!1}),J.addEventListener("panzoomchange",ye),Or.observe(Y),Ct.push(()=>{Y.removeEventListener("pointerdown",Me),Y.removeEventListener("focusin",$r),Mr(!1),Y.removeEventListener("wheel",oo),J.removeEventListener("panzoomchange",ye),Or.disconnect(),He()}),Yt(),ye()};de()}return C.bindFunctions&&C.bindFunctions(Y),()=>{at=!0,clearTimeout(pt);for(const St of Ct)St();Z()}},[C]);const A=B.useCallback(Y=>{const Z=u.current;if(Z===null||Y.target!==Y.currentTarget||Y.altKey||Y.ctrlKey||Y.metaKey)return;const J=Z.panSteps();let at;switch(Y.key){case"ArrowLeft":at=Z.panBy(J.x,0);break;case"ArrowRight":at=Z.panBy(-J.x,0);break;case"ArrowUp":at=Z.panBy(0,J.y);break;case"ArrowDown":at=Z.panBy(0,-J.y);break;case"+":case"=":Z.zoomBy(1),at=!0;break;case"-":Z.zoomBy(-1),at=!0;break;case"0":Z.reset(),at=!0;break;default:at=!1}at&&Y.preventDefault()},[]),M=B.useMemo(()=>[...j?["pan-left","pan-up","pan-down","pan-right"]:[],...r?[]:["mode"],"zoom-in","zoom-out","reset",pr],[r,j]),{onKeyDown:F,onFocus:N,tabIndexOf:P}=Zh(M,yo),$=!(g||y),{fullscreen:q,toggle:E,dialogProps:G,rootProps:U}=Vh(yo,$),X=(Y,Z,J,at,pt=!1)=>w.jsx("button",{type:"button",[yo]:Y,tabIndex:P(Y),onClick:J,style:pt?e5:void 0,className:Er,"aria-label":s[Z].text,lang:s[Z].lang,children:at},Y),K=Y=>{const Z=u.current;if(Z===null)return;const J=Z.panSteps();Z.panBy(Y.x*J.x,Y.y*J.y)};let Q;if(g)Q=w.jsx("div",{className:"flex h-32 items-center justify-center bg-white dark:bg-gray-800 dark:text-white",children:"🌀 Loading diagram..."});else if(y)Q=w.jsxs("div",{"data-aqmd-mermaid-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[w.jsxs("div",{children:["Error: ",y]}),w.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{T.current=!1,x(null),v(Y=>Y+1)},lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[w.jsx(Fn,{className:"h-4 w-4"}),s.retry.text]})]});else{const Y=s[L?"interactionModeTouch":"interactionMode"],Z=L?LM.map(J=>({value:J,label:s[WM[J]],checked:EM[_]===J})):BM.map(J=>({value:J,label:s[jM[J]],checked:_===J}));Q=w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-mermaid-toolbar":"",role:"toolbar","aria-labelledby":a,onKeyDown:F,onFocus:N,className:"mb-1 flex flex-wrap items-start justify-end gap-1",children:[w.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[X("pan-left","panLeft",()=>K({x:1,y:0}),w.jsx(g1,{size:18}),!j),X("pan-up","panUp",()=>K({x:0,y:1}),w.jsx(x1,{size:18}),!j),X("pan-down","panDown",()=>K({x:0,y:-1}),w.jsx(u1,{size:18}),!j),X("pan-right","panRight",()=>K({x:-1,y:0}),w.jsx(m1,{size:18}),!j)]}),w.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[!r&&w.jsx(Nx,{buttonHook:{[yo]:"mode"},menuHook:{"data-aqmd-mermaid-menu":""},label:Y,icon:w.jsx(k1,{size:18}),tabIndex:P("mode"),items:Z.map(({value:J,label:at,checked:pt})=>({key:J,label:at,checked:pt,onSelect:()=>D(J)}))}),X("zoom-in","zoomIn",()=>u.current?.zoomBy(1),w.jsx(Bu,{size:20})),X("zoom-out","zoomOut",()=>u.current?.zoomBy(-1),w.jsx(Lu,{size:20})),X("reset","resetView",()=>u.current?.reset(),w.jsx(Fn,{size:18}))]}),w.jsx(Kh,{hook:yo,fullscreen:q,labels:s,tabIndex:P(pr),onToggle:E})]}),w.jsx("div",{ref:d,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":j?"true":"false",role:"group",tabIndex:0,"aria-labelledby":a,onKeyDown:A,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return w.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":o,...U,children:[w.jsx("span",{id:a,hidden:!0,lang:s.diagram.lang,children:s.diagram.text}),w.jsx("span",{id:n,hidden:!0,lang:s.fullscreenDialog.lang,children:s.fullscreenDialog.text}),w.jsxs("dialog",{...G,"aria-labelledby":q?n:a,children:[w.jsx("div",{ref:h,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:ZM}),Q]})]})};zx.displayName="MermaidDiagramInternal";const Qh=B.memo(zx),i5="unicodeTextInMathMode",o5="noCharacterMetrics",s5=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,a5="consoleCommand",n5=e=>{const t=(r,i)=>o=>(i(o),e(a5,`${r} is ignored: a formula does not write to the console`),"");return{"\\message":t("\\message",r=>r.consumeArgs(1)),"\\errmessage":t("\\errmessage",r=>r.consumeArgs(1)),"\\show":t("\\show",r=>r.popToken())}},jx=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=Nr.get(r);if(i!==void 0)return Nr.delete(r),Nr.set(r,i),i;const o=h5(e,t);return Nr.set(r,o),Nr.size>l5&&Nr.delete(Nr.keys().next().value),o},l5=610,Nr=new Map,h5=(e,t)=>{const r=[],i=(s,a)=>{r.push({code:s,message:a,formula:e,displayMode:t})},o=console.warn;console.warn=(...s)=>{const[a]=s;if(s.length===1&&typeof a=="string"&&s5.test(a)){i(o5,a);return}o.apply(console,s)};try{const s=NC.renderToString(e,{displayMode:t,throwOnError:!1,macros:n5(i),strict:(a,n)=>(a!==i5&&i(a,n),"ignore")});return Object.freeze({html:s,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=o}};const c5=[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]],d5=Bt("align-horizontal-space-around",c5);const u5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],f5=Bt("chevron-down",u5);const g5=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Wx=Bt("copy",g5);const p5=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],m5=Bt("download",p5);const y5=[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]],x5=Bt("fold-horizontal",y5);const C5=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],b5=Bt("fold-vertical",C5);const k5=[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]],w5=Bt("highlighter",k5);const S5=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],v5=Bt("ruler",S5);const T5=[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]],_5=Bt("unfold-horizontal",T5);const B5=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],L5=Bt("unfold-vertical",B5),Hx=24,E5=1,F5=1,A5=24,M5=Object.freeze({}),wn=e=>{const{rows:t,cols:r}=fa.measureTsv(e);return t*r},$5=26,O5=(e,t,r,i)=>{const o=e.length>t?Math.min(i,t-Math.min(r,t)):0,s=e.slice(0,t-o).map((n,l)=>({index:l,cells:n})),a=e.slice(e.length-o).map((n,l)=>({index:e.length-o+l,cells:n}));return[...s,...a]},R5=(e,t)=>Math.max(1,Math.min(e.visibleRows,t)),I5=3,P5=e=>Math.max(1,Math.min(I5,e)),Sn=(e,t,r)=>((r?ne.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX:0)+e*Hx+ne.SPREADSHEET_SCROLLBAR_SIZE_PX)*t,D5=1,Zd=e=>Math.ceil(e)+D5,N5=(e,t)=>e>=t,ua=e=>Math.round(e*100),Qd=e=>{const t=ne.SPREADSHEET_ZOOM_STEPS.find(r=>ua(r)===e);if(t===void 0)throw new RangeError(`[@aiquants/markdown] no spreadsheet zoom step shows as ${String(e)} %`);return t},q5=(e,t,r)=>{if(t===0&&r===0)return e;const i=(e[0]?.length??0)+r,o=r===0?[...e]:e.map(s=>[...s,...Array(r).fill("")]);for(let s=0;s<t;s+=1)o.push(Array(i).fill(""));return o},Jh=e=>{let t=e.length;for(;t>1&&e[t-1].every(s=>s==="");)t-=1;const r=e[0]?.length??0;let i=r;const o=s=>{for(let a=0;a<t;a+=1)if(e[a][s]!=="")return!1;return!0};for(;i>1&&o(i-1);)i-=1;return t===0||i===0?[[""]]:t===e.length&&i===r?e:e.slice(0,t).map(s=>i===r?s:s.slice(0,i))},xs=e=>Jh(fa.parseTsv(e)),z5=["format","hyperlink","note","comments","validation"],j5=(e,t)=>{const r=new Map;let i=!1,o=!1;for(const s of t){if(!(Number.isInteger(s.row)&&Number.isInteger(s.col))||s.row<0||s.row>=e.length||s.col<0||s.col>=e[s.row].length)throw new RangeError(`[@aiquants/markdown] spreadsheet edit outside the table: row ${s.row}, column ${s.col}`);if(z5.some(l=>s[l]!==void 0&&s[l]!==null)&&(i=!0),s.text===void 0)continue;o=!0;const a=s.text.replace(/\r\n?/gu,`
|
|
312
|
+
`),n=r.get(s.row);if(n!==void 0)n[s.col]=a;else if(e[s.row][s.col]!==a){const l=[...e[s.row]];l[s.col]=a,r.set(s.row,l)}}if(r.size>0){const s=[...e];for(const[a,n]of r)s[a]=n;return{kind:"applied",matrix:s}}return i&&!o?{kind:"format-only"}:{kind:"unchanged"}},W5=e=>{const t=Jh(e).map(r=>{let i=r.length;for(;i>0&&r[i-1]==="";)i-=1;return i===r.length?r:r.slice(0,i)});return fa.serializeTsv(t).replaceAll(`\r
|
|
313
|
+
`,`
|
|
314
|
+
`)},H5=(e,t)=>{const r=e.indexOf(t);return r===-1?{echo:!1,pending:[]}:{echo:!0,pending:e.slice(r+1)}},Y5=(e,t,r,i,o)=>{const s=o==="down"?1:o==="up"?-1:0,a=o==="right"?1:o==="left"?-1:0,n=(d,f)=>d>=0&&d<t&&f>=0&&f<r,l=(d,f)=>e(d,f)!=="";let c=i.row+s,h=i.col+a;if(!n(c,h))return{row:i.row,col:i.col};if(l(i.row,i.col)&&l(c,h)){for(;n(c+s,h+a)&&l(c+s,h+a);)c+=s,h+=a;return{row:c,col:h}}for(;n(c,h);){if(l(c,h))return{row:c,col:h};c+=s,h+=a}return{row:c-s,col:h-a}},U5=/^(?:https?:\/\/|mailto:|tel:)\S+$/iu,G5=e=>U5.test(e)?e:void 0,X5=(e,t)=>{const r=`${t(e.startCol)}${e.startRow+1}`;return e.startRow===e.endRow&&e.startCol===e.endCol?r:`${r}:${t(e.endCol)}${e.endRow+1}`},V5=Object.freeze(["decreaseColumnWidth","increaseColumnWidth","autoFitColumnWidth","decreaseRowHeight","increaseRowHeight"]),K5=()=>{let e=Object.freeze({row:0,col:0});const t=new Set;return{get:()=>e,set:r=>{if(!(r.row===e.row&&r.col===e.col)){e=Object.freeze({row:r.row,col:r.col});for(const i of[...t])i()}},subscribe:r=>(t.add(r),()=>{t.delete(r)})}},xi="data-aqmd-spreadsheet-control",Z5=Object.freeze(["zoom-in","zoom-out","reset-zoom","highlight","track-size","copy","save","save-menu",pr]),Q5=({labels:e,labelledBy:t,rows:r,cols:i,canZoomIn:o,canZoomOut:s,zoom:a,onZoom:n,onResetZoom:l,highlighted:c,onToggleHighlight:h,onCopy:d,onSave:f,fullscreen:u,onToggleFullscreen:g,gridReady:m,activeCell:y,onTrackSize:x})=>{const{onKeyDown:C,onFocus:k,tabIndexOf:S}=Zh(Z5,xi),[v,T]=B.useState(!1),L=B.useId(),_=B.useRef(null),D=v&&m,O=(z,A,M,F,N,P,$=Er)=>w.jsx("button",{type:"button",[xi]:z,tabIndex:S(z),onClick:N?M:void 0,"aria-disabled":N?void 0:"true","aria-pressed":P,className:$,"aria-label":A.text,lang:A.lang,children:F}),I=ua(a),j={text:At.fillLabel(e.resetZoom.text,{percent:I}),lang:e.resetZoom.lang};return w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-spreadsheet-toolbar":"",role:"toolbar","aria-labelledby":t,onKeyDown:C,onFocus:k,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[w.jsx("span",{"data-aqmd-spreadsheet-size":"",lang:e.size.lang,className:"me-auto text-sm",children:At.fillLabel(e.size.text,{rows:r,cols:i})}),w.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[O("zoom-in",e.zoomIn,()=>n(1),w.jsx(Bu,{size:20}),m&&o),O("zoom-out",e.zoomOut,()=>n(-1),w.jsx(Lu,{size:20}),m&&s),O("reset-zoom",j,l,w.jsxs("span",{"data-aqmd-spreadsheet-zoom":"",children:[w.jsxs("span",{"data-aqmd-spreadsheet-zoom-widest":"","aria-hidden":"true",children:[ua(ne.SPREADSHEET_ZOOM_MAX)," %"]}),w.jsxs("span",{children:[I," %"]})]}),m&&a!==1,void 0,bM)]}),w.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[O("highlight",e.highlight,h,w.jsx(w5,{size:18}),m,c),w.jsx("button",{type:"button",ref:_,[xi]:"track-size",tabIndex:S("track-size"),onClick:m?()=>T(z=>!z):void 0,"aria-disabled":m?void 0:"true","aria-expanded":D,"aria-controls":D?L:void 0,className:Er,"aria-label":e.trackSize.text,lang:e.trackSize.lang,children:w.jsx(v5,{size:18})})]}),w.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[O("copy",e.copyAll,d,w.jsx(Wx,{size:18}),m),O("save",e.saveTsv,()=>f(!1),w.jsx(m5,{size:18}),!0),w.jsx(Nx,{buttonHook:{[xi]:"save-menu"},menuHook:{"data-aqmd-spreadsheet-menu":""},label:e.saveMenu,icon:w.jsx(f5,{size:18}),tabIndex:S("save-menu"),items:[{key:"save-with-bom",label:e.saveTsvWithBom,onSelect:()=>f(!0),hook:{"data-aqmd-spreadsheet-menu-item":"save-with-bom"}}]})]}),w.jsx(Kh,{hook:xi,fullscreen:u,labels:e,tabIndex:S(pr),onToggle:g})]}),D&&w.jsx(t3,{id:L,labels:e,activeCell:y,onTrackSize:x,onClose:()=>{T(!1),_.current?.focus()}})]})},J5=Object.freeze({decreaseColumnWidth:w.jsx(x5,{size:18}),increaseColumnWidth:w.jsx(_5,{size:18}),autoFitColumnWidth:w.jsx(d5,{size:18}),decreaseRowHeight:w.jsx(b5,{size:18}),increaseRowHeight:w.jsx(L5,{size:18})}),t3=({id:e,labels:t,activeCell:r,onTrackSize:i,onClose:o})=>{const s=B.useSyncExternalStore(r.subscribe,r.get,r.get),a={column:ne.columnIndexToName(s.col),row:s.row+1},n=l=>{l.key!=="Escape"||l.defaultPrevented||(l.preventDefault(),l.stopPropagation(),o())};return w.jsx("div",{id:e,"data-aqmd-spreadsheet-track-size":"",role:"group","aria-label":t.trackSize.text,lang:t.trackSize.lang,onKeyDown:n,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:V5.map(l=>w.jsx("button",{type:"button","data-aqmd-spreadsheet-track-size-control":l,onClick:()=>i(l),className:Er,"aria-label":At.fillLabel(t[l].text,a),lang:t[l].lang,children:J5[l]},l))})},e3=(e,t,r)=>{const i={v:1,rows:e.length,cols:e[0]?.length??0,clipId:r,formats:[],validations:[],cells:e.map(s=>s.map(a=>({t:a}))),wholeRows:!1,wholeCols:!1,conditionalFormats:[]},o=t.serializeClipPayload(i);return{plain:t.serializeClipboardTsv(e),html:t.serializeHtmlTable(i,o)}},r3=async(e,t,r)=>{await t.write([r({"text/plain":new Blob([e.plain],{type:"text/plain"}),"text/html":new Blob([e.html],{type:"text/html"})})])},i3="\uFEFF",o3="text/tab-separated-values;charset=utf-8",s3=(e,t)=>`${t?i3:""}${fa.serializeTsv(e)}`,a3=(e,t,r)=>{const i=r.defaultView;if(i===null)throw new Error("[@aiquants/markdown] saving a file needs a document with a window");const o=i.URL.createObjectURL(new Blob([e],{type:o3})),s=r.createElement("a");s.href=o,s.download=t,s.hidden=!0,r.body.append(s);try{s.click()}finally{s.remove(),i.setTimeout(()=>i.URL.revokeObjectURL(o),0)}},Yx=e=>{const t=B.useRef(e);B.useLayoutEffect(()=>{t.current=e});const r=e!==void 0,[i]=B.useState(()=>new Set);return B.useEffect(()=>e?.subscribe(()=>{for(const o of[...i])o()}),[e,i]),B.useMemo(()=>{if(!r)return;const o=()=>{const s=t.current;if(s===void 0)throw new Error("[@aiquants/markdown] the spreadsheet editor stand-in was called after its editor was removed");return s};return{write:s=>o().write(s),read:s=>o().read(s),undo:()=>o().undo(),redo:()=>o().redo(),subscribe:s=>(i.add(s),()=>{i.delete(s)})}},[r,i])};let $s=null,vn=null;const Ol=new Set,n3=e=>(Ol.add(e),()=>{Ol.delete(e)}),Jd=()=>$s!==null?Promise.resolve($s):(vn??=import("@aiquants/spreadsheet").then(e=>{$s=e;for(const t of Ol)t();return e},e=>{throw vn=null,e}),vn);class ui extends Error{reason;constructor(t){super(`[@aiquants/markdown] spreadsheet edit refused: ${t}`),this.name="SpreadsheetEditRefusal",this.reason=t}}const tu=e=>{console.error("[@aiquants/markdown] could not load @aiquants/spreadsheet",e)},eu=Object.freeze({row:!0,column:!0,intersection:!1}),ru=Object.freeze({row:!1,column:!1,intersection:!1}),iu=Object.freeze([Object.freeze([""])]),l3=Object.freeze({link:!1}),h3=Object.freeze({enabled:!1}),Ux=e=>e.trim().replace(/\s+/g," ").toLowerCase(),c3=e=>{const t=[];let r="",i=null;for(let o=0;o<e.length;o++){const s=e[o];s==="\\"&&o+1<e.length?(o++,r+=e[o]):i!==null?s===i?i=null:r+=s:s==='"'||s==="'"?i=s:s===","?(t.push(r),r=""):r+=s}return t.push(r),new Set(t.map(Ux))},d3=e=>{const t=e.trim(),r=t.length>=2&&(t[0]==='"'||t[0]==="'")&&t[t.length-1]===t[0];return Ux((r?t.slice(1,-1):t).replace(/\\(.)/g,"$1"))},u3=(e,t)=>{const r=c3(t);return e.fontfaces.some(i=>r.has(d3(i.family)))},f3=({matrix:e,headerRows:t,footerRows:r,visibleRows:i,headings:o,autofit:s,frame:a})=>{const n=Math.min(e[0].length,$5),l=O5(e,i,t,r),c=Array.from({length:n},(g,m)=>m),h=l[0].index>0,d=l[l.length-1].index<e.length-1,f=e[0].length>n,u=g=>o?w.jsx("td",{"aria-hidden":"true","data-aqmd-spreadsheet-static-number":"",children:g+1}):null;return w.jsxs("table",{"data-aqmd-spreadsheet-static":"","data-aqmd-spreadsheet-static-autofit":s?"":void 0,"data-aqmd-spreadsheet-static-frame":a?"":void 0,"data-aqmd-spreadsheet-static-headings":a&&o?"":void 0,"data-aqmd-spreadsheet-static-earlier-rows":a&&h?"":void 0,"data-aqmd-spreadsheet-static-more-rows":a&&d?"":void 0,"data-aqmd-spreadsheet-static-more-columns":a&&f?"":void 0,children:[s&&w.jsxs("colgroup",{children:[o&&w.jsx("col",{"data-aqmd-spreadsheet-static-band":""}),c.map(g=>w.jsx("col",{"data-aqmd-spreadsheet-static-empty":l.every(({cells:m})=>m[g]==="")?"":void 0},g))]}),w.jsxs("thead",{children:[o&&w.jsxs("tr",{"aria-hidden":"true","data-aqmd-spreadsheet-static-letters":"",children:[w.jsx("td",{}),c.map(g=>w.jsx("td",{children:ne.columnIndexToName(g)},g))]}),l.filter(({index:g})=>g<t).map(({index:g,cells:m})=>w.jsxs("tr",{children:[u(g),m.slice(0,n).map((y,x)=>w.jsx("th",{scope:"col",children:y},x))]},g))]}),w.jsx("tbody",{children:l.filter(({index:g})=>g>=t).map(({index:g,cells:m})=>w.jsxs("tr",{children:[u(g),m.slice(0,n).map((y,x)=>w.jsx("td",{children:y},x))]},g))})]})},g3=e=>{try{return{options:At.parseSpreadsheetOptions(e),unreadWord:null}}catch(t){if(t instanceof At.SpreadsheetOptionsError)return{options:null,unreadWord:t.word};throw t}},Gx=({tsv:e,meta:t,sourceLines:r,editor:i,locale:o="en",labels:s,layout:a="inline",tapScrollCircle:n,tapScrollCircleShownBy:l="host"})=>{if(!Object.hasOwn(At.SPREADSHEET_BLOCK_LABEL_CATALOGS,o))throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet locale "${String(o)}" (en and ja are supported)`);if(a!=="inline"&&a!=="fill")throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet layout "${String(a)}" (inline and fill are supported)`);if(l!=="host"&&l!=="options")throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet tap-scroll circle chooser "${String(l)}" (host and options are supported)`);const c=B.useMemo(()=>zi(At.SPREADSHEET_BLOCK_LABEL_CATALOGS[o],s),[o,s]),{options:h,unreadWord:d}=B.useMemo(()=>g3(t),[t]),f=B.useMemo(()=>wn(e),[e]),u=f>ne.SPREADSHEET_MAX_OPERATION_CELLS,g=B.useMemo(()=>Ni.parseSourceLines(r)?.first??null,[r]),[m,y]=B.useState(null),x=`${r??""}
|
|
315
|
+
${e}`,C=m===x,k=i!==void 0&&g!==null&&!C?i:void 0,S=k!==void 0,v=S&&h!==null&&h.footerRows===0?E5:0,T=S?F5:0,[L,_]=B.useState(()=>u?iu:xs(e)),[D,O]=B.useState(0),I=B.useRef(e),j=B.useRef([]),z=B.useMemo(()=>q5(L,v,T),[L,v,T]),A=B.useRef(z);A.current=z;const M=B.useSyncExternalStore(n3,()=>$s,()=>null),[F,N]=B.useState(!1),P=F&&M===null,$=h===null?null:h.zoomPercent,[q,E]=B.useState(()=>$===null?1:Qd($)),[G,U]=B.useState($);$!==G&&(U($),$!==null&&E(Qd($)));const X=h!==null&&h.toolbar===0?ru:eu,[K,Q]=B.useState(X),[Y,Z]=B.useState(X);X!==Y&&(Z(X),Q(X));const[J,at]=B.useState(null),{fullscreen:pt,toggle:Ct,dialogRef:St,dialogProps:Kt,rootProps:de}=Vh(xi,h!==null&&!u&&h.toolbar===1),Nt=B.useId(),Mt=B.useCallback((rt,mt={})=>{at($t=>({text:At.fillLabel(c[rt].text,mt),lang:c[rt].lang,serial:($t?.serial??0)+1}))},[c]);B.useEffect(()=>{if(M!==null||h===null||u)return;let rt=!0;return Jd().catch(mt=>{rt&&(tu(mt),N(!0))}),()=>{rt=!1}},[M,h,u]),B.useEffect(()=>{const rt=H5(j.current,e);if(rt.echo){j.current=rt.pending;return}const mt=k===void 0||g===null?null:k.read(g),$t=mt!==null&&wn(mt)<=ne.SPREADSHEET_MAX_OPERATION_CELLS?mt:null;if($t!==null&&$t===j.current.at(-1))return;j.current=[];const se=$t===null?e:$t;se!==I.current&&(I.current=se,_($t===null&&u?iu:xs(se)),O(Ir=>Ir+1))},[e,u,k,g]);const Wt=B.useCallback(()=>{if(k===void 0||g===null)return;const rt=k.read(g);rt===null||rt===I.current||wn(rt)>ne.SPREADSHEET_MAX_OPERATION_CELLS||(j.current=[],I.current=rt,_(xs(rt)),O(mt=>mt+1))},[k,g]);B.useEffect(()=>k?.subscribe(()=>{j.current.length>0&&Wt()}),[k,Wt]);const Ht=B.useCallback(rt=>{rt(),Wt()},[Wt]),Jt=B.useMemo(()=>k===void 0?void 0:()=>Ht(()=>k.undo()),[k,Ht]),ye=B.useMemo(()=>k===void 0?void 0:()=>Ht(()=>k.redo()),[k,Ht]),Yt=B.useRef(()=>{});Yt.current=rt=>{if(k===void 0||g===null)throw new ui("readOnly");const mt=j5(A.current,rt);if(mt.kind==="format-only")throw new ui("formatRefused");if(mt.kind==="unchanged")return;const $t=Jh(mt.matrix),se=W5($t),Ir=k.write({fenceLine:g,expected:I.current,text:se});switch(Ir){case"written":{const xr=k.read(g);if(xr===null)throw new TypeError("[@aiquants/markdown] SpreadsheetEditor.write answered written, but read finds no block on its fence line");I.current=xr,j.current=[...j.current,xr],_(xr===se?$t:xs(xr)),O(hi=>hi+1),at(null);return}case"changed":throw Wt(),new ui("editConflict");case"closesFence":throw new ui("fenceRefused");case"unwritable":throw y(x),new ui("unwritable");default:throw new TypeError(`[@aiquants/markdown] SpreadsheetEditor.write answered ${JSON.stringify(Ir)} (written, changed, closesFence or unwritable)`)}};const[ue]=B.useState(()=>({get rowCount(){return A.current.length},get colCount(){return A.current[0].length},getCellText:(rt,mt)=>A.current[rt][mt],applyEdits:(rt,mt)=>Yt.current(rt),getCellFormat:()=>M5,getCellHyperlink:(rt,mt)=>G5(A.current[rt][mt]),findDataEdge:(rt,mt)=>Y5(($t,se)=>A.current[$t][se],A.current.length,A.current[0].length,rt,mt)})),Fe=B.useCallback(rt=>{if(!(rt instanceof ui))throw rt;Mt(rt.reason)},[Mt]),Ae=B.useCallback(rt=>Mt(C?"unwritable":"readOnly"),[Mt,C]),Tt=B.useCallback(rt=>{St.current?.ownerDocument.defaultView?.open(rt,"_blank","noopener,noreferrer")},[]),kt=B.useCallback(({row:rt,displayText:mt,columnName:$t,readOnly:se})=>At.fillLabel((se===!0?c.readOnlyCellAnnouncement:c.cellAnnouncement).text,{cell:`${$t}${rt+1}`,value:mt===""?c.emptyCell.text:mt}),[c]),je=B.useCallback(({range:rt})=>At.fillLabel(c.selectionAnnouncement.text,{range:X5(rt,ne.columnIndexToName)}),[c]),Ar=B.useCallback(({axis:rt,index:mt,size:$t})=>rt==="column"?At.fillLabel(c.columnResized.text,{column:ne.columnIndexToName(mt),size:$t}):At.fillLabel(c.rowResized.text,{row:mt+1,size:$t}),[c]),We=B.useRef(null),[He]=B.useState(K5),si=B.useCallback(rt=>He.set(rt.active),[He]),Ye=B.useCallback(rt=>{We.current?.executeCommand(rt)},[]),Me=ua(q),Ue=B.useRef(Me);B.useLayoutEffect(()=>{G!==null&&(Ue.current=G)},[G]),B.useEffect(()=>{Ue.current!==Me&&(Ue.current=Me,Mt("zoomed",{percent:Me}))},[Mt,Me]);const ai=B.useCallback(rt=>E(mt=>ne.clampSpreadsheetZoom(ne.stepSpreadsheetZoom(mt,rt))),[]),Mr=B.useCallback(()=>E(1),[]),$r=K.row||K.column,oo=B.useCallback(()=>Q(rt=>rt.row||rt.column?ru:eu),[]),Or=B.useCallback(()=>{if(M===null)return;const rt=St.current?.ownerDocument.defaultView;(async()=>{if(rt==null)throw new Error("no window");const $t=e3(L,M,rt.crypto.randomUUID());await r3($t,rt.navigator.clipboard,se=>new rt.ClipboardItem(se))})().then(()=>Mt("copied"),$t=>{console.error("[@aiquants/markdown] could not copy the spreadsheet",$t),Mt("copyFailed")})},[Mt,L,M]),tt=B.useCallback(rt=>{const mt=St.current?.ownerDocument;mt!==void 0&&a3(s3(L,rt),c.fileName.text,mt)},[L,c]),ht=L.length,xt=L[0].length,Pt=h===null?0:h.frame,Ut=B.useMemo(()=>Pt===0?void 0:{startRow:0,startCol:0,endRow:ht-1,endCol:xt-1},[Pt,ht,xt]),ni=h===null?0:h.tapscroll,Ft=B.useMemo(()=>l==="host"?n:ni===1?{...n,enabled:!0,size:A5}:h3,[n,l,ni]),Lt=h===null?0:R5(h,z.length),fe=z.length,Gt=h!==null&&a==="inline"&&N5(h.visibleRows,fe),[oe,Ge]=B.useState(null),li=B.useMemo(()=>{if(h===null)return;const rt=h.headings===1,mt={"--aqmd-spreadsheet-zoom":String(q)};return a==="fill"?mt["--aqmd-spreadsheet-box-min-height"]=`${Sn(P5(fe),q,rt)}px`:Gt?mt["--aqmd-spreadsheet-box-height"]=`${Zd(oe===null?Sn(fe,q,rt):oe.height)}px`:mt["--aqmd-spreadsheet-box-height"]=`${Sn(Lt,q,rt)}px`,oe!==null&&(mt["--aqmd-spreadsheet-box-width"]=`${Zd(oe.width)}px`),h.frame>0&&(mt["--aqsp-frame-width"]=`${h.frame}px`),mt},[h,a,Gt,fe,Lt,q,oe]),yr=pt?c.fullscreenDialog:c.table,Rr=M?.Spreadsheet;return B.useLayoutEffect(()=>{const rt=We.current,mt=St.current;if(h===null||h.autofit!==1||M===null||rt===null||mt===null)return;const $t=Array.from({length:z[0].length},(xr,hi)=>hi);rt.autoFitColumns($t);const se=mt.ownerDocument.fonts;if(se===void 0)return;const Ir=xr=>{const hi=We.current;hi!==null&&u3(xr,getComputedStyle(mt).fontFamily)&&hi.autoFitColumns($t)};return se.addEventListener("loadingdone",Ir),()=>se.removeEventListener("loadingdone",Ir)},[h,M,z]),w.jsxs("div",{"data-aqmd-spreadsheet":"","data-aqmd-spreadsheet-layout":a,"data-source-lines":r,"data-aqmd-spreadsheet-editable":S?"":void 0,"data-aqmd-spreadsheet-whole":Gt?"":void 0,...de,children:[w.jsx("span",{id:Nt,hidden:!0,lang:yr.lang,children:yr.text}),w.jsxs("dialog",{...Kt,"aria-labelledby":Nt,children:[h===null?w.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:c.optionsError.lang,children:At.fillLabel(c.optionsError.text,{word:d,frozenMax:At.SPREADSHEET_OPTION_RULES.header.max,heightMax:At.SPREADSHEET_OPTION_RULES.height.max,zoomSteps:At.SPREADSHEET_ZOOM_STEP_PERCENTS.join(", "),frameMax:At.SPREADSHEET_OPTION_RULES.frame.max})}):u?w.jsx("div",{"data-aqmd-spreadsheet-error":"size",role:"alert",lang:c.tooLarge.lang,children:At.fillLabel(c.tooLarge.text,{cells:new Intl.NumberFormat(o).format(f),max:new Intl.NumberFormat(o).format(ne.SPREADSHEET_MAX_OPERATION_CELLS)})}):w.jsxs(w.Fragment,{children:[h.toolbar===1&&w.jsx(Q5,{labels:c,labelledBy:Nt,rows:ht,cols:xt,canZoomIn:q<ne.SPREADSHEET_ZOOM_MAX,canZoomOut:q>ne.SPREADSHEET_ZOOM_MIN,zoom:q,onZoom:ai,onResetZoom:Mr,highlighted:$r,onToggleHighlight:oo,onCopy:Or,onSave:tt,fullscreen:pt,onToggleFullscreen:Ct,gridReady:Rr!==void 0,activeCell:He,onTrackSize:Ye}),w.jsx("div",{"data-aqmd-spreadsheet-box":"",style:li,children:Rr===void 0?w.jsx(f3,{matrix:L,headerRows:h.headerRows,footerRows:h.footerRows,visibleRows:Lt,headings:h.headings===1,autofit:h.autofit===1,frame:h.frame>0}):w.jsx(Rr,{ref:We,adapter:ue,dataVersion:D,defaultRowHeight:Hx,frozenRows:h.headerRows,headerRows:h.headerRows,frozenTrailingRows:h.footerRows,frozenColumns:h.frozenColumns,enableFillHandle:S,readOnly:!S,labelledBy:Nt,enableResizeUI:!0,headings:h.headings===1,frame:Ut,tapScrollCircleOptions:Ft,onContentSizeChange:Ge,zoom:q,onZoomChange:E,highlight:K,onHighlightChange:Q,popovers:l3,onHyperlinkOpen:Tt,onEditRejected:Fe,onReadOnlyRejected:Ae,onUndoRequest:Jt,onRedoRequest:ye,formatCellAnnouncement:kt,formatSelectionAnnouncement:je,formatResizeAnnouncement:Ar,onSelectionChange:si,locale:o})})]}),P&&w.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[w.jsx("span",{lang:c.loadFailed.lang,children:c.loadFailed.text}),w.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:c.retry.lang,className:"ms-2 inline-flex min-h-11 min-w-11 items-center justify-center rounded border px-3 py-1 text-sm",onClick:()=>{N(!1),Jd().catch(rt=>{tu(rt),N(!0)})},children:c.retry.text})]}),w.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",children:J!==null&&w.jsx("span",{lang:J.lang,children:J.text},J.serial)})]})]})};Gx.displayName="SpreadsheetBlock";const tc=B.memo(Gx),p3=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),m3=Object.freeze({"solarized-light":Object.freeze({"#657b83":"#435860","#93a1a1":"#4b5757","#2aa198":"#005f59","#dc322f":"#ae0010","#d33682":"#a70060","#268bd2":"#00588e","#859900":"#4e5a00","#586e75":"#43585f","#cb4b16":"#9a3100","#b58900":"#6c5100","#6c71c4":"#4a4c9c"}),"github-dark-high-contrast":Object.freeze({"#272b33":"#abb1bb"})});function y3(e){const t={};for(const r in e){const i=e[r];switch(r){case"class":t.className=i;break;case"style":{const o={};for(const s of i.split(";")){const a=s.indexOf(":");if(a<=0)continue;const n=s.slice(0,a).trim(),l=s.slice(a+1).trim();n===""||l===""||(o[n.startsWith("--")?n:n.replace(/-(\w)/g,(c,h)=>h.toUpperCase())]=l)}t.style=o;break}case"tabindex":t.tabIndex=Number(i);break;default:t[r]=i}}return t}const x3=({code:e})=>{const[t,r]=B.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return w.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute top-2 right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-sm transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},C3=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const o=B.use(e),s={replace:a=>{if(a instanceof vt.Element&&a.name==="pre"){const n=y3(a.attribs),l=t?"2.2rem 0 1rem 0":"1rem 0";return n.style={...typeof n.style=="object"?n.style:{},margin:"0",padding:"0.8rem 0"},w.jsxs("div",{className:"relative",style:{margin:l},"data-aqmd-code-block":"","data-source-lines":i,children:[t&&w.jsx("div",{"data-aqmd-code-filename":"",className:"absolute -top-4 left-0 z-0 rounded-md px-2 py-0.5 text-sm",children:t}),w.jsx(x3,{code:r}),w.jsx("pre",{...n,children:vt.domToReact(a.children,s)})]})}},htmlparser2:{lowerCaseTags:!0}};return w.jsx(w.Fragment,{children:vt(o,s)})},b3=/^(diff)?:?(\w+):?([\w.-]*)?/,k3=new Map([["svg","xml"]]),w3="text",S3=e=>{const t=k3.get(e),r=t===void 0?e:t;return Ln.isSpecialLang(r)||Object.hasOwn(Ln.bundledLanguages,r)?r:w3},v3=()=>({code(e){for(const t of e.children){if(t.type!=="element")continue;const r=t.children[0];if(r?.type!=="element")continue;const i=r.children[0];if(i?.type!=="text")continue;const o=i.value;let s,a,n="";if(o.startsWith("+")?(s="+",a="add",n="bg-green-200 dark:bg-green-400/90 text-green-700"):o.startsWith("-")&&(s="-",a="remove",n="bg-red-200 dark:bg-red-400/90 text-red-700"),s&&a){t.properties.dataAqmdDiff=a,i.value=o.substring(1).trimStart();const l={type:"element",tagName:"span",properties:{className:`inline-flex items-center justify-center w-4 h-4 rounded-full select-none font-bold text-[0.5rem] mr-2 ${n}`},children:[{type:"text",value:s==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),T3=e=>{const t=b3.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},ec=({lang:e,code:t,node:r,sourceLines:i})=>{const o=e??r?.lang??void 0,s=t??r?.value??"",{isDiff:a,lang:n,filename:l}=T3(o);return n===At.SPREADSHEETS_LANGUAGE?w.jsx(tc,{tsv:s,meta:r?.meta??void 0,sourceLines:i,tapScrollCircleShownBy:"options"}):n==="mermaid"?w.jsx(Qh,{chartContent:s,sourceLines:i}):w.jsx(_3,{code:s,lang:n,isDiff:a,filename:l,sourceLines:i})},_3=({code:e,lang:t,isDiff:r,filename:i,sourceLines:o})=>{const s=B.useMemo(async()=>{const a=[];return r&&a.push(v3()),await Ln.codeToHtml(e,{lang:S3(t),themes:p3,defaultColor:!1,colorReplacements:m3,transformers:a})},[e,t,r]);return w.jsx(B.Suspense,{fallback:w.jsx("div",{className:"dark:text-white","data-source-lines":o,children:"🌀 Loading code..."}),children:w.jsx(C3,{htmlPromise:s,filename:i,code:e,sourceLines:o})})},Xx=({code:e})=>{const[t,r]=B.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return w.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-xs transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},Vx=(e,t)=>{const r=B.useMemo(()=>{try{return{kind:"rendered",html:jx(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return B.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},B3=({node:e})=>{const t=Vx(e.value,!0),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return w.jsxs("div",{className:"relative",children:[w.jsx(Xx,{code:e.value}),t.kind==="rendered"?w.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("article",{className:r,children:t.message})]})},L3=/^[a-z][a-z0-9+.-]*:/i,E3=/^[/\\]{2}/,F3=/[\t\n\r]/g,ou=32,A3=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=ou;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=ou;)r-=1;return e.slice(t,r)},Kx=e=>{const t=A3(e).replace(F3,"");return L3.test(t)||E3.test(t)},M3="text-link underline visited:text-link-visited",$3="inline-block w-fit",rc=new Set(["img","picture","video","audio","svg","canvas","iframe","object","embed","address","article","aside","blockquote","details","dialog","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","menu","nav","ol","p","pre","section","table","ul"]);[...rc].join(",");const Zx=(e,t)=>[e,t?$3:void 0,M3].filter(r=>r!==void 0&&r.trim()!=="").join(" "),O3=new Set(["id","title","lang","dir","role"]),R3=["aria-","data-footnote-"],I3=e=>{const t={};for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();(O3.has(o)||R3.some(s=>o.startsWith(s)&&o.length>s.length))&&(t[o]=i)}return Object.freeze(t)},Te=new Bn.Logger(Bn.LogLevel.INFO,"[DifyIFramePlugin]"),P3="100%",D3="600px",N3="0",q3=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,z3=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=B.useState(!0),[o,s]=B.useState(!1),a=B.useRef(null),n=B.useRef(null),l=B.useRef(null),{src:c}=e,h=B.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!Ib(x.origin,t)||q3(x.data)==="dify-chatbot-iframe-ready"&&(Te.info("Dify chatbot iframe is ready"),i(C=>C&&(s(!1),n.current&&(clearTimeout(n.current),n.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=B.useCallback(()=>{const x=a.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(k=>k&&(s(!1),!1))}catch{Te.info("Crossorigin error detected, showing auth prompt"),s(k=>k||(i(!1),!0))}},[]),f=B.useCallback(()=>{const x=window.open(c,"dify-oauth","width=500,height=600,scrollbars=yes,resizable=yes");if(!x){Te.error("ポップアップがブロックされました");return}const C=setInterval(()=>{if(x.closed){clearInterval(C),Te.info("ポップアップが閉じられました");try{Te.info("ポップアップURL:",x.location.href)}catch(S){Te.info("クロスオリジンのためURLにアクセスできません:",S)}const k=a.current;if(k?.src){const S=k.src;i(v=>v||!0),s(v=>v&&!1),k.src="",setTimeout(()=>{k.src=S,n.current=setTimeout(()=>{Te.warn("認証後タイムアウト: dify-chatbot-iframe-ready not received after auth"),d()},5e3)},100)}}},1e3);Te.info("ポップアップを開きました:"),Te.info("- 初期URL:",c),Te.info("- ウィンドウ名:","dify-oauth"),Te.info("- ウィンドウサイズ: 500x600")},[d,c]);B.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),B.useEffect(()=>{const x=setTimeout(()=>{Te.warn("Timeout: dify-chatbot-iframe-ready not received, checking iframe access"),d()},5e3);return l.current=x,()=>{l.current&&(clearTimeout(l.current),l.current=null)}},[d]),B.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:u=P3,height:g=D3,frameborder:m=N3,...y}=e.attributes;return w.jsxs("div",{className:"dify-iframe-container",children:[r&&!o&&w.jsxs("div",{className:"flex items-center justify-center rounded-lg bg-gray-50 p-8",children:[w.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-blue-600 border-b-2"}),w.jsx("span",{className:"ml-3 text-gray-600",children:"Dify チャットボットを読み込み中..."})]}),o&&w.jsxs("div",{className:"mb-4 rounded-lg border border-blue-200 bg-blue-50 p-6",children:[w.jsx("div",{className:"flex items-center",children:w.jsxs("div",{className:"text-blue-800",children:[w.jsx("h3",{className:"font-medium",children:"認証が必要です"}),w.jsx("p",{className:"mt-1 text-sm",children:"Dify チャットボットにアクセスするには OAuth 認証が必要です。 ポップアップウィンドウで認証を完了してください。"})]})}),w.jsx("div",{className:"mt-4",children:w.jsx("button",{type:"button",onClick:f,className:"rounded-md border border-gray-700 bg-gray-900 px-4 py-2 font-medium text-sm text-white shadow-lg transition-colors hover:bg-gray-800",children:"OAuth 認証を開始"})})]}),w.jsx("div",{className:`${r||o?"hidden":"block"}`,children:w.jsx("iframe",{ref:a,...vt.attributesToProps({...y,width:u,height:g,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},su=Object.freeze({dify:z3}),j3=e=>Object.hasOwn(su,e)?su[e]:null,W3=w.jsx(B.Fragment,{}),H3=(e,t,r,i,o)=>{const s=t===null?null:j3(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return w.jsx(bb,{embed:e,label:i,insideAnchor:o,children:s!==null?w.jsx(s,{embed:e,iFrameAllowedDomains:r}):w.jsx("iframe",{...vt.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},Qx=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof vt.Element&&t.name.toLowerCase()==="a")return!0;return!1},Jx=e=>e.some(t=>t instanceof vt.Element&&(rc.has(t.name)||Jx(t.children))),Y3=(e,t,r)=>{const{class:i,"data-link-kind":o,"data-doc-path":s,"data-doc-exists":a,...n}=e.attribs,l=Zx(i,Jx(e.children)),c=n.href??"",h=o,d=h==="external"||Kx(c),f=vt.domToReact(e.children,t);if(r&&c&&!d)return w.jsx(r,{href:c,kind:h,docPath:s,docExists:a===void 0?void 0:a==="true",className:l,attributes:I3(n),children:f});d&&(n.target="_blank",n.rel="noreferrer");const u={};return o!==void 0&&(u["data-link-kind"]=o),s!==void 0&&(u["data-doc-path"]=s),a!==void 0&&(u["data-doc-exists"]=a),w.jsx("a",{...vt.attributesToProps(n,"a"),className:l,...u,children:f})},tC=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:o})=>{const s={replace:a=>{if(!(a instanceof vt.Element))return;const n=a.parent instanceof vt.Element?a.parent.name:null,l=ma(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return W3;case"unwrap":return w.jsx(B.Fragment,{children:vt.domToReact(a.children,s)});case"embed":return H3(l.embed,l.pluginType,e,t.embeddedFrame,Qx(a))}if(a.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(a,l.link,s);if(h!==void 0)return h}const c=o?.(a,s);if(c!==void 0)return c;if(a.name==="a")return Y3(a,s,r)}};return s};const U3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],G3=Bt("code-xml",U3),X3=4096*4096,au=32767,V3=Object.freeze({width:0,height:0}),K3=/^\s*(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[a-zA-Z]*\s*$/u,Z3=(e,t)=>{const r=new t.DOMParser().parseFromString(e,"image/svg+xml").documentElement;return r.localName==="svg"&&[r.getAttribute("width"),r.getAttribute("height")].some(i=>i!==null&&K3.test(i))},nu=e=>Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0,Q3=(e,t)=>{const r=nu(e)?e:nu(t)?t:null;if(r===null)return null;const i=Math.min(1,Math.sqrt(X3/(r.width*r.height)),au/r.width,au/r.height);return{width:Math.max(1,Math.floor(r.width*i)),height:Math.max(1,Math.floor(r.height*i))}},J3=async(e,t,r)=>{const i=r.URL.createObjectURL(new r.Blob([e],{type:"image/svg+xml;charset=utf-8"}));try{const o=new r.Image;o.src=i,await o.decode();const s=Q3(Z3(e,r)?{width:o.naturalWidth,height:o.naturalHeight}:V3,t);if(s===null)throw new Error("[@aiquants/markdown] the SVG image has no size to draw at");const a=r.document.createElement("canvas");a.width=s.width,a.height=s.height;const n=a.getContext("2d");if(n===null)throw new Error("[@aiquants/markdown] the browser gave no 2D canvas to draw the SVG image on");return n.drawImage(o,0,0,s.width,s.height),await new Promise((l,c)=>{a.toBlob(h=>h===null?c(new Error("[@aiquants/markdown] the canvas could not encode the SVG image as a PNG")):l(h),"image/png")})}finally{r.URL.revokeObjectURL(i)}},t$=e=>/\.[Ss][Vv][Gg]$/u.test(e),eC=e=>{const t=B.useRef(e);B.useLayoutEffect(()=>{t.current=e});const r=e!==void 0;return B.useMemo(()=>{if(r)return{read:(i,o)=>{const s=t.current;return s===void 0?Promise.reject(new Error("[@aiquants/markdown] the image source stand-in was called after its reader was removed")):s.read(i,o)}}},[r])},xo="data-aqmd-svg-image-control",e$=Object.freeze(["copy","source",pr]),r$=Object.freeze(["source",pr]),i$=Object.freeze({kind:"failure",retryable:!0}),lu=(e,t,r)=>new Promise(i=>i(e.read(t,r))),o$=({paragraph:e,image:t,path:r,name:i,reader:o,labels:s})=>{const{[Ni.SOURCE_LINES_ATTRIBUTE]:a,...n}=e,[l,c]=B.useState(!1),[h,d]=B.useState(0),[f,u]=B.useState(null),[g,m]=B.useState(null),y=B.useId(),x=B.useId(),C=B.useId(),k=B.useRef(null),S=B.useRef(null),v=B.useRef(null);B.useEffect(()=>()=>S.current?.abort(),[]),B.useEffect(()=>{if(!l)return;const G=new AbortController;return lu(o,r,G.signal).then(U=>{G.signal.aborted||u({read:h,answer:U})},U=>{G.signal.aborted||(console.error("[@aiquants/markdown] the image source reader failed without an abort",U),u({read:h,answer:i$}))}),()=>G.abort()},[l,h,r,o]);const T=l&&f!==null&&f.read===h?f.answer:null,L=T!==null&&T.kind==="text"&&!T.truncated?T.text:null,_=!l||L!==null,{onKeyDown:D,onFocus:O,tabIndexOf:I}=Zh(_?e$:r$,xo),{fullscreen:j,toggle:z,dialogProps:A,rootProps:M}=Vh(xo,!0),F=G=>{m(U=>({text:s[G].text,lang:s[G].lang,serial:U===null?1:U.serial+1}))},N=()=>{if(m(null),l){c(!1);return}d(G=>G+1),c(!0)},P=()=>{k.current?.focus(),d(G=>G+1)},$=(G,U)=>{const X=G.currentTarget.ownerDocument.defaultView?.navigator.clipboard;if(X===void 0){F("copyFailed");return}X.writeText(U).then(()=>F("copied"),K=>{console.error("[@aiquants/markdown] could not copy the image source",K),F("copyFailed")})},q=G=>{const U=G.currentTarget.ownerDocument.defaultView,X=U?.navigator.clipboard;if(U===null||X===void 0||typeof U.ClipboardItem!="function"||typeof X.write!="function"){F("copyImageFailed");return}const K=v.current,Q=K===null?null:K.querySelector("img"),Y=Q===null?null:Q.getBoundingClientRect(),Z=Y===null?{width:0,height:0}:{width:Y.width,height:Y.height};S.current?.abort();const J=new AbortController;S.current=J;let at=!1;const pt=lu(o,r,J.signal).then(Ct=>{if(Ct.kind!=="text"||Ct.truncated)throw at=!0,new Error("[@aiquants/markdown] the SVG image cannot be copied whole");return J3(Ct.text,Z,U).catch(St=>{throw at=!0,console.error("[@aiquants/markdown] could not draw the SVG image as a PNG",St),St})},Ct=>{throw at=!0,J.signal.aborted||console.error("[@aiquants/markdown] the image source reader failed without an abort",Ct),Ct});pt.catch(()=>{}),X.write([new U.ClipboardItem({"image/png":pt})]).then(()=>{J.signal.aborted||F("copiedImage")},Ct=>{J.signal.aborted||(at||console.error("[@aiquants/markdown] could not copy the SVG image",Ct),F("copyImageFailed"))})};let E;return l?T===null?E=w.jsx("p",{"data-aqmd-svg-image-loading":"",lang:s.loading.lang,children:s.loading.text}):T.kind==="failure"?E=w.jsxs("div",{"data-aqmd-svg-image-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[w.jsx("p",{lang:s.failed.lang,children:s.failed.text}),T.retryable&&w.jsxs("button",{type:"button","data-aqmd-svg-image-retry":"",onClick:P,lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[w.jsx(Fn,{className:"h-4 w-4"}),s.retry.text]})]}):E=w.jsxs(w.Fragment,{children:[w.jsx("span",{id:C,hidden:!0,lang:s.sourceRegion.lang,children:At.fillLabel(s.sourceRegion.text,{name:i})}),w.jsx("pre",{"data-aqmd-svg-image-source":"",tabIndex:0,role:"region","aria-labelledby":C,children:w.jsx("code",{children:T.text})}),T.truncated&&w.jsx("p",{"data-aqmd-svg-image-truncated":"",lang:s.truncated.lang,children:s.truncated.text})]}):E=w.jsx("p",{ref:v,...vt.attributesToProps(n,"p"),"data-aqmd-svg-image-frame":"",children:t}),w.jsxs("div",{"data-aqmd-svg-image":"","data-aqmd-svg-image-view":l?"source":"image","data-source-lines":a,...M,children:[w.jsx("span",{id:y,hidden:!0,lang:s.toolbar.lang,children:s.toolbar.text}),w.jsx("span",{id:x,hidden:!0,lang:s.fullscreenDialog.lang,children:At.fillLabel(s.fullscreenDialog.text,{name:i})}),w.jsxs("dialog",{...A,"aria-labelledby":j?x:y,children:[w.jsxs("div",{"data-aqmd-svg-image-toolbar":"",role:"toolbar","aria-labelledby":y,onKeyDown:D,onFocus:O,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[_&&w.jsx("button",{type:"button",[xo]:"copy",tabIndex:I("copy"),onClick:G=>L===null?q(G):$(G,L),className:Er,"aria-label":L===null?s.copyImage.text:s.copy.text,lang:L===null?s.copyImage.lang:s.copy.lang,children:w.jsx(Wx,{size:18})}),w.jsx("button",{ref:k,type:"button",[xo]:"source",tabIndex:I("source"),"aria-pressed":l,onClick:N,className:Er,"aria-label":s.source.text,lang:s.source.lang,children:w.jsx(G3,{size:20})}),w.jsx(Kh,{hook:xo,fullscreen:j,labels:s,tabIndex:I(pr),onToggle:z})]}),E,w.jsx("p",{"data-aqmd-svg-image-notice":"",role:"status",children:g!==null&&w.jsx("span",{lang:g.lang,children:g.text},g.serial)})]})]})},Ha=Object.freeze({toolbar:{text:"SVG image",lang:"en"},source:{text:"Source",lang:"en"},sourceRegion:{text:"Source of {name}",lang:"en"},loading:{text:"Loading the source…",lang:"en"},failed:{text:"The source could not be read.",lang:"en"},retry:{text:"Try again",lang:"en"},truncated:{text:"Only the beginning of this file is shown.",lang:"en"},copy:{text:"Copy the source",lang:"en"},copied:{text:"Copied the source.",lang:"en"},copyFailed:{text:"Could not copy the source.",lang:"en"},copyImage:{text:"Copy the image",lang:"en"},copiedImage:{text:"Copied the image.",lang:"en"},copyImageFailed:{text:"Could not copy the image.",lang:"en"},...At.FULLSCREEN_CONTROL_LABEL_CATALOGS.en,fullscreenDialog:{text:"{name} (full screen)",lang:"en"}}),s$=ga(Ha),a$=({alt:e,target:t,label:r})=>w.jsxs("span",{"data-testid":"markdown-missing-image","data-asset-src":t||void 0,role:"img","aria-label":`${e?`${r} (${e})`:r}${t?`: ${t}`:""}`,className:"my-1 inline-flex max-w-full items-center gap-2 rounded-lg border border-gray-300 border-dashed bg-gray-50 px-3 py-2 text-gray-600 text-sm dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400",children:[w.jsx(sb,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),w.jsxs("span",{className:"min-w-0",children:[w.jsx("span",{className:"font-medium",children:e?`${r} (${e})`:r}),t&&w.jsx("span",{className:"ml-2 break-all font-mono text-xs dark:text-gray-300",children:t})]})]}),n$=(e,t,r)=>{const{src:i,alt:o,"data-asset-exists":s,"data-asset-src":a}=e.attribs;if(!i||i.trim()===""||s==="false")return w.jsx(a$,{alt:o,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,w.jsx("img",{alt:"",...vt.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},Xo=e=>e.map(t=>t instanceof vt.Text?t.data:t instanceof vt.Element?Xo(t.children):"").join(""),l$=(e,t)=>e.map(r=>{if(r instanceof vt.Text)return{kind:"text",text:r.data};if(!(r instanceof vt.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=ma(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),h$=(e,t,r,i)=>{const o=e.children,s=wr.placeholderLinkOf(t,l$(o,i.iFrameAllowedDomains));if(s===null)return;const a=vt.domToReact(o,r),n=w.jsx("p",{...vt.attributesToProps(e.attribs,"p"),children:a}),l=o.find(f=>f instanceof vt.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&wr.isBareLink(Xo(l.children),s)?w.jsx(Tb,{href:t,endpoint:c,size:Ze.linkCardSizeOf(i.embeds),fallback:n}):n,d=Kr.resolveEmbed(s,i.embeds.providers);return d===null?h:w.jsx(Ob,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},c$=(e,t)=>{if(Qx(e))return null;const r=e.children.filter(c=>!(c instanceof vt.Text&&Rl.test(c.data))),[i]=r;if(r.length!==1||!(i instanceof vt.Element)||i.name.toLowerCase()!=="img")return null;const o=ma(i.name,i.attribs,{parentName:"p",iFrameAllowedDomains:t});if(o.action!=="keep")return null;const{src:s,alt:a,"data-asset-src":n,"data-asset-exists":l}=o.attributes;return n===void 0||!t$(n)||s===void 0||s.trim()===""||l==="false"?null:{node:i,path:n,name:a!==void 0&&a.trim()!==""?a:n.slice(n.lastIndexOf("/")+1)}},d$={lowerCaseAttributeNames:!1},hu=2166136261,cu=16777619,Rl=/^[\t\n\f\r ]*$/u,u$=`language-${At.SPREADSHEETS_LANGUAGE}`,rC=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(u$),f$=e=>{let t=hu,r=hu;const i=(s,a)=>{for(let n=0;n<s.length;n+=1){const l=s.charCodeAt(n);r=Math.imul(r^l,cu),a&&(t=Math.imul(t^l,cu))}},o=(s,a)=>{if(s instanceof vt.Text)i("",a),i(s.data,a);else if(s instanceof vt.Element){i("",a),i(s.name,a);for(const[l,c]of Object.entries(s.attribs))l!==Ni.SOURCE_LINES_ATTRIBUTE&&(i("",a),i(l,a),i("",a),i(c,a));i("",a);const n=a&&!rC(s);for(const l of s.children)o(l,n);i("",a)}else i("\x07",a),i(s.data,a)};return o(e,!0),{fingerprint:(t>>>0).toString(36),content:(r>>>0).toString(36)}},g$=(e,t,r,i)=>{if(e==="")return{nodes:[],keys:[]};const o=vt.htmlToDOM(e,d$),s=o.filter(l=>!(l instanceof vt.Text&&Rl.test(l.data))),a=cb(s.map(f$),r);let n=0;return{nodes:o.map(l=>{if(l instanceof vt.Text&&Rl.test(l.data))return l.data;const{key:c,content:h}=a[n];return n+=1,w.jsx(ab,{content:h,label:i,text:()=>Xo([l]),children:vt.domToReact([l],t)},c)}),keys:a}},iC=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=Ze.NO_EMBEDS,embedLabels:o,mermaidInteraction:s,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,spreadsheetTapScrollCircle:h,linkComponent:d,missingImageLabel:f="Image not found",blockFailedLabel:u,imageSource:g,svgImageLabels:m,onMathDiagnostics:y})=>{Su(i);const x=yu(o),C=Yx(n),k=eC(g),S=B.useMemo(()=>zi(Ha,m),[m]),{blockFailed:v}=zi(ku,{blockFailed:u}),T={rendered:0},L=[],_=B.useRef(null),D=B.useEffectEvent(A=>{y?.(A)}),O=tC({iFrameAllowedDomains:r,embedLabels:x,linkComponent:d,renderPlaceholder:(A,M,F)=>h$(A,M,F,{embeds:i,theme:t,embedLabels:x,iFrameAllowedDomains:r}),renderKept:(A,M)=>{if(A.name==="p"&&k!==void 0){const F=c$(A,r);if(F!==null)return w.jsx(o$,{paragraph:A.attribs,image:vt.domToReact([F.node],M),path:F.path,name:F.name,reader:k,labels:S})}if(A.name==="pre"&&A.children.length===1){const F=A.children[0];if(F instanceof vt.Element&&F.name==="code"){const N=F.attribs.class??"",P=Xo(F.children),$=A.attribs[Ni.SOURCE_LINES_ATTRIBUTE];return rC(F)?w.jsx(tc,{tsv:P,meta:F.attribs[At.CODE_META_ATTRIBUTE],sourceLines:$,editor:C,locale:l,labels:c,tapScrollCircle:h,tapScrollCircleShownBy:"options"}):N.includes("language-mermaid")?w.jsx(Qh,{chartContent:P,interaction:s,labels:a,sourceLines:$}):w.jsx(ec,{lang:N.replace("language-",""),code:P,theme:t,sourceLines:$})}}if(A.name==="img")return n$(A,f,T);if(A.name==="span"&&A.attribs.class?.includes("math")){const F=A.attribs.class.includes("display");let N=Xo(A.children).trim();F?N=N.replace(/^\\\[/,"").replace(/\\\]$/,""):N=N.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:P,diagnostics:$}=jx(N,F);return L.push(...$),F?w.jsxs("span",{className:"group relative block",children:[w.jsx(Xx,{code:N}),w.jsx("span",{dangerouslySetInnerHTML:{__html:P}})]}):w.jsx("span",{dangerouslySetInnerHTML:{__html:P}})}catch(P){console.error("Failed to render math:",P);return}}}}),I=B.useRef([]),{nodes:j,keys:z}=g$(e,O,I.current,v);return B.useEffect(()=>{I.current=z},[z]),B.useEffect(()=>{_.current!==e&&(_.current=e,L.length>0&&D(L))},[e,L]),w.jsx("div",{className:"markdown-body","data-theme":t,children:j})};const p$=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],m$=Bt("triangle-alert",p$);const y$=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],x$=Bt("text-align-center",y$);const C$=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],b$=Bt("text-align-start",C$);const k$=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],w$=Bt("text-align-end",k$);const S$=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],v$=Bt("list",S$);const T$=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],_$=Bt("palette",T$);const B$=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],L$=Bt("pin",B$);const E$=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],F$=Bt("pin-off",E$),A$=e=>`#${e.id}`,M$=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},du="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",oC=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=A$,label:o,labelledBy:s})=>{if(e.length===0)return null;const a=M$(e);return w.jsx("nav",{className:`toc ${t}`,"aria-label":o,"aria-labelledby":s,children:w.jsx("ul",{className:"m-0 list-none p-0",children:e.map((n,l)=>{const c=n.id===""?null:i(n);return w.jsx("li",{style:{paddingLeft:`${(n.depth-a)*1}rem`},children:c===null?w.jsx("span",{className:`${du} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):w.jsx("a",{href:Vo(c)?c:void 0,className:`${du} text-gray-600 no-underline hover:text-blue-800 dark:text-gray-300 dark:hover:text-blue-300`,onClick:r===void 0?void 0:h=>r(n,h),title:n.text,children:n.text})},l)})})})},Tn="--aqmd-toolbar-block-overlap",$$=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i})=>{if(e.width<=0||e.height<=0)return 0;const o=e.left<t.right&&e.right>t.left,s=e.top<r+e.height&&e.top<i,a=e.bottom-r;return o&&s&&a>0?Math.ceil(a):0},sC=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,aC=Object.keys(Wa),O$=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,R$=Object.keys(At.SPREADSHEET_BLOCK_LABEL_CATALOGS.en),nC=e=>`svgImage${e.charAt(0).toUpperCase()}${e.slice(1)}`,lC=Object.keys(Ha),hC=Object.freeze({loading:{text:"Loading data...",lang:"en"},errorPrefix:{text:"Error: ",lang:"en"},defaultErrorTitle:{text:"An error occurred",lang:"en"},missingImage:{text:"Image not found",lang:"en"},...ku,styleTitle:{text:"Display Style",lang:"en"},selectStyleAria:{text:"Select display style",lang:"en"},pinStyleAria:{text:"Pin style selector",lang:"en"},unpinStyleAria:{text:"Unpin style selector",lang:"en"},openTocAria:{text:"目次を開く",lang:"ja"},tocTitle:{text:"目次",lang:"ja"},pinTocAria:{text:"目次をピン留め",lang:"ja"},unpinTocAria:{text:"目次のピン留めを解除",lang:"ja"},selectAlignAria:{text:"揃えを選択",lang:"ja"},alignTitle:{text:"揃え",lang:"ja"},pinAlignAria:{text:"揃え選択をピン留め",lang:"ja"},unpinAlignAria:{text:"揃え選択のピン留めを解除",lang:"ja"},alignLeft:{text:"左揃え",lang:"ja"},alignCenter:{text:"中央揃え",lang:"ja"},alignRight:{text:"右揃え",lang:"ja"},...Object.fromEntries(aC.map(e=>[sC(e),Wa[e]])),...Object.fromEntries(lC.map(e=>[nC(e),Ha[e]])),...pa}),I$=ga(hC),P$=e=>zi(hC,e),D$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of aC){const i=e[sC(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},N$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of R$){const i=e[O$(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},q$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of lC){const i=e[nC(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},z$=Object.keys(pa),j$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of z$){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},uu=Object.freeze({left:{labelKey:"alignLeft",Icon:b$},center:{labelKey:"alignCenter",Icon:x$},right:{labelKey:"alignRight",Icon:w$}}),W$=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),H$="100%",Y$=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",Il="24px",cC=e=>Object.freeze({position:"fixed",insetBlockStart:"var(--aqmd-toolbar-inset-block-start, 0px)",insetInlineEnd:`calc(var(--aqmd-toolbar-inset-inline-end, 0px) + ${e})`,zIndex:60,display:"flex",flexDirection:"row",alignItems:"flex-start",gap:"0.5rem",pointerEvents:"none"}),U$=cC(Il),G$=Object.freeze({position:"absolute",insetBlockStart:0,insetInlineStart:0,blockSize:"var(--aqmd-toolbar-inset-block-start, 0px)",inlineSize:"var(--aqmd-toolbar-inset-inline-end, 0px)",visibility:"hidden",pointerEvents:"none"}),X$=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,V$=8,fu=800,K$=16,Z$=(e,t)=>{const r=e.defaultView;let i;const o=()=>{e.removeEventListener("click",s,!0),e.removeEventListener("pointercancel",a,!0),i!==void 0&&r?.clearTimeout(i)};function s(n){o(),!(n.timeStamp-t.timeStamp>fu||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>K$)&&(n.preventDefault(),n.stopPropagation())}function a(n){n.pointerId===t.pointerId&&o()}e.addEventListener("click",s,!0),e.addEventListener("pointercancel",a,!0),i=r?.setTimeout(o,fu)},Q$=(e,t,r)=>{const[i,o]=B.useState(null);return B.useLayoutEffect(()=>{const s=t.current;if(!e||s===null||r===null){o(null);return}const a=s.ownerDocument.defaultView;let n=0;const l=()=>{n=0;const d=s.getBoundingClientRect(),f=s.offsetHeight>0?d.height/s.offsetHeight:1,u=a?.visualViewport??null,g=u===null?Number.POSITIVE_INFINITY:u.offsetTop+u.height,m=Math.min(r.getBoundingClientRect().bottom,g);o(Math.max(0,Math.floor((m-d.top)/f-V$)))},c=()=>{a!==null&&n===0&&(n=a.requestAnimationFrame(l))};l();const h=new ResizeObserver(c);return h.observe(r),a?.addEventListener("resize",c),a?.visualViewport?.addEventListener("resize",c),a?.visualViewport?.addEventListener("scroll",c),s.ownerDocument.addEventListener("scroll",c,!0),()=>{a!==null&&n!==0&&a.cancelAnimationFrame(n),h.disconnect(),a?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("scroll",c),s.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function _n({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:o,pinLabel:s,unpinLabel:a,isOpen:n,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:f,onPinToggle:u,popoverClassName:g,scrollBarClearance:m,boundary:y,renderBody:x}){const C=B.useRef(null),k=B.useRef(null),S=B.useRef(null),v=Q$(n,S,y),T=B.useCallback(()=>{d(),h()},[h,d]),L=B.useCallback(()=>{if(l)return;const D=C.current?.contains(document.activeElement)===!0;f(),D&&k.current?.focus()},[l,f]);B.useEffect(()=>{if(!n||l)return;const D=C.current;if(D===null)return;const O=j=>{D.contains(j.target)||(f(),j.pointerType==="touch"&&!(j.target instanceof Element&&j.target.closest("[data-aqmd-toolbar]")!==null)&&Z$(D.ownerDocument,j))},I=j=>{j.key!=="Escape"||j.defaultPrevented||j.isComposing||(j.preventDefault(),f(),k.current?.focus())};return document.addEventListener("pointerdown",O),D.addEventListener("keydown",I),()=>{document.removeEventListener("pointerdown",O),D.removeEventListener("keydown",I)}},[n,l,f]);const _=l?a:s;return w.jsxs("div",{ref:C,"data-aqmd-toolbar-menu":e,children:[w.jsx("button",{ref:k,type:"button",className:"pointer-events-auto rounded-full border border-gray-200 bg-white p-3 shadow-lg transition-colors hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700",onClick:T,"aria-label":r.text,lang:r.lang,"aria-expanded":n,children:w.jsx(t,{className:"h-5 w-5 text-gray-600 dark:text-gray-300"})}),n&&w.jsxs("div",{ref:S,"data-aqmd-toolbar-popover":e,className:`pointer-events-auto absolute end-0 top-full mt-2 box-border overflow-y-auto overscroll-contain rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-800 ${g}`,style:{zIndex:c?2:1,maxInlineSize:X$(m),maxBlockSize:v??void 0},children:[w.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[w.jsx("h3",{id:o,lang:i.lang,className:"px-2 font-bold text-gray-600 text-sm uppercase tracking-wider dark:text-gray-300",children:i.text}),w.jsx("button",{type:"button",className:"rounded p-3.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200",onClick:u,"aria-label":_.text,lang:_.lang,children:l?w.jsx(L$,{className:"h-4 w-4"}):w.jsx(F$,{className:"h-4 w-4"})})]}),x(L)]})]})}const J$=(e,t,r,i)=>{const[o,s]=B.useState(0),a=B.useRef(null);return B.useLayoutEffect(()=>{const n=e.current,l=t.current;if(r===null||n===null||l===null){a.current=null,s(0);return}const c=()=>{const g=n.getBoundingClientRect();s($$({toolbar:r.getBoundingClientRect(),content:l.getBoundingClientRect(),scrollportTop:g.top+n.clientTop,scrollportBottom:g.bottom}))};a.current=c;let h=null;const d=()=>{h===null&&(h=requestAnimationFrame(()=>{h=null,c()}))};c();const f=new ResizeObserver(c);f.observe(n),f.observe(l),f.observe(r);const u=r.querySelector("[data-aqmd-toolbar-inset-probe]");return u!==null&&f.observe(u),window.addEventListener("resize",c),window.addEventListener("scroll",d,{capture:!0,passive:!0}),()=>{a.current=null,f.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("scroll",d,{capture:!0}),h!==null&&cancelAnimationFrame(h)}},[e,t,r]),B.useLayoutEffect(()=>{a.current?.()},[i]),o},tO=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,eO=e=>{let t=null,r=e;for(;r!==null;)r.getAttribute("hidden")?.toLowerCase()==="until-found"&&(r.dispatchEvent(new Event("beforematch",{bubbles:!0})),r.removeAttribute("hidden")),r instanceof HTMLDetailsElement&&!r.open&&t!==null&&t!==Array.from(r.children).find(i=>i.localName==="summary")&&(r.open=!0),t=r,r=r.parentElement},rO=B.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:f,spreadsheetLabels:u,spreadsheetTapScrollCircle:g,imageSource:m,svgImageLabels:y,onMathDiagnostics:x}){return w.jsx("div",{className:"w-full min-w-0",children:w.jsx("div",{className:i,"data-theme":r,children:w.jsx(iC,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:f,spreadsheetLabels:u,spreadsheetTapScrollCircle:g,imageSource:m,svgImageLabels:y,onMathDiagnostics:x})})})});function dC(){const[e,t]=B.useState("toc"),[r,i]=B.useState(!1),[o,s]=B.useState(!1),[a,n]=B.useState(!1),[l,c]=B.useState(!1),[h,d]=B.useState(!1),[f,u]=B.useState(!1),g=B.useCallback(()=>t("toc"),[]),m=B.useCallback(()=>i(O=>!O),[]),y=B.useCallback(()=>i(!1),[]),x=B.useCallback(()=>c(O=>!O),[]),C=B.useCallback(()=>t("style"),[]),k=B.useCallback(()=>s(O=>!O),[]),S=B.useCallback(()=>s(!1),[]),v=B.useCallback(()=>d(O=>!O),[]),T=B.useCallback(()=>t("align"),[]),L=B.useCallback(()=>n(O=>!O),[]),_=B.useCallback(()=>n(!1),[]),D=B.useCallback(()=>u(O=>!O),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:o,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:f,activateToc:g,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:k,closeStyle:S,togglePinStyle:v,activateAlign:T,toggleAlign:L,closeAlign:_,togglePinAlign:D}}const iO=({error:e,labels:t})=>{if(B.isValidElement(e))return w.jsx("div",{className:"p-4",children:e});if(typeof e=="object"&&e!==null&&"message"in e){const i=e,o=i.title!==void 0&&i.title!=="";return w.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-6 shadow-sm backdrop-blur-sm dark:border-red-900/50 dark:bg-red-950/30",children:w.jsxs("div",{className:"flex items-start gap-3",children:[w.jsx("div",{className:"rounded-lg bg-red-100 p-2 text-red-600 dark:bg-red-900/50 dark:text-red-400",children:w.jsx(m$,{className:"h-5 w-5"})}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("h3",{lang:o?void 0:t.defaultErrorTitle.lang,className:"font-semibold text-base text-red-900 dark:text-red-200",children:o?i.title:t.defaultErrorTitle.text}),i.status&&w.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 font-medium font-mono text-red-700 text-xs dark:bg-red-900/60 dark:text-red-300",children:i.status})]}),w.jsx("p",{className:"mt-2 text-red-700 text-sm leading-relaxed dark:text-red-300/90",children:i.message})]})]})})}const r=typeof e=="string"?e:String(e);return w.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-4 text-center dark:border-red-900/50 dark:bg-red-950/30",children:w.jsxs("p",{className:"font-medium text-red-700 text-sm dark:text-red-300",children:[w.jsx("span",{lang:t.errorPrefix.lang,children:t.errorPrefix.text}),r]})})};function oO({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:o,theme:s,style:a,onStyleChange:n,availableStyles:l=so.DEFAULT_MARKDOWN_STYLES,align:c=so.DEFAULT_CONTENT_ALIGN,onAlignChange:h,showToc:d=!0,showStyle:f=!0,showAlign:u=!0,width:g,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=Ze.NO_EMBEDS,emptyMessage:k,toolbar:S,linkComponent:v,onHeadingSelect:T,headingHref:L,onMathDiagnostics:_,spreadsheetEditor:D,spreadsheetLocale:O,spreadsheetTapScrollCircle:I,imageSource:j,renderScrollBar:z,scrollBarGutter:A=0}){const M=B.useRef(null),[F,N]=B.useState(null),P=B.useCallback(Ft=>{M.current=Ft,N(Ft)},[]),[$,q]=B.useState(0),E=B.useRef(null),[G,U]=B.useState(null),X=B.useRef(null),K=B.useId(),Q=dC(),Y=S??Q,Z=B.useMemo(()=>P$(o),[o]),J=B.useMemo(()=>D$(o),[o]),at=B.useMemo(()=>N$(o),[o]),pt=B.useMemo(()=>q$(o),[o]),Ct=eC(j),St=Yx(D);Su(C);const Kt=Kr.EMBED_PROVIDER_IDS.filter(Ft=>C.providers.includes(Ft)).join(" "),de=C.linkCardEndpoint,Nt=C.linkCardSize,Mt=B.useMemo(()=>{const Ft=Kt.split(" "),Lt=Object.freeze(Kr.EMBED_PROVIDER_IDS.filter(fe=>Ft.includes(fe)));return Object.freeze(Nt===void 0?{providers:Lt,linkCardEndpoint:de}:{providers:Lt,linkCardEndpoint:de,linkCardSize:Nt})},[Kt,de,Nt]),Wt=o?.embeddedVideo,Ht=o?.embeddedPost,Jt=o?.embeddedFrame,ye=B.useMemo(()=>j$({embeddedVideo:Wt,embeddedPost:Ht,embeddedFrame:Jt}),[Wt,Ht,Jt]),Yt=B.useRef(_);B.useLayoutEffect(()=>{Yt.current=_},[_]);const ue=B.useCallback(Ft=>{Yt.current?.(Ft)},[]),Fe=k===void 0?W$:{text:k,lang:void 0},Ae=J$(M,E,G,c);if(!so.CONTENT_ALIGNS.includes(c))throw new TypeError(`[@aiquants/markdown] align must be one of ${so.CONTENT_ALIGNS.join(", ")}; got ${String(c)} (normalize it with toContentAlign)`);const Tt=Number.isFinite(y)&&y>=0?y:16;if(!Number.isFinite(A)||A<0)throw new RangeError(`[@aiquants/markdown] scrollBarGutter must be a finite number >= 0; got ${String(A)}`);const kt=z===void 0?0:A,je=B.useCallback(Ft=>{const Lt=M.current;if(Lt){const fe=Lt.querySelector("[data-theme]"),Gt=Lt.getBoundingClientRect(),oe=fe?.children;let Ge=-1,li=Number.POSITIVE_INFINITY;if(oe)for(let yr=0;yr<oe.length;yr+=1){const Rr=oe[yr],rt=Math.abs(Rr.getBoundingClientRect().top-Gt.top);rt<li&&(li=rt,Ge=yr)}if(oe&&Ge>=0){const Rr=oe[Ge].getBoundingClientRect();X.current={childIndex:Ge,offset:Rr.top-Gt.top}}else X.current=null}n(Ft)},[n]);B.useLayoutEffect(()=>{const Ft=X.current;if(!Ft)return;X.current=null;const Lt=M.current;if(!Lt)return;const Gt=Lt.querySelector("[data-theme]")?.children[Ft.childIndex];if(!Gt)return;const oe=Lt.getBoundingClientRect(),li=Gt.getBoundingClientRect().top-oe.top;Lt.scrollTop+=li-Ft.offset});const{isTocPinned:Ar,closeToc:We}=Y,He=B.useCallback((Ft,Lt)=>{if(Ar||We(),T?.(Ft,Lt)===!0)return;Lt.preventDefault();const Gt=M.current?.querySelector(`#${CSS.escape(Ft.id)}`)??document.getElementById(Ft.id);Gt&&(eO(Gt),Gt.tabIndex<0&&!Gt.hasAttribute("tabindex")&&Gt.setAttribute("tabindex","-1"),Gt.scrollIntoView({behavior:tO()?"instant":"smooth",block:"start"}),Gt.focus({preventScroll:!0}))},[We,Ar,T]),si=B.useMemo(()=>l.find(Lt=>Lt.name===a)?.className??"markdown-body",[l,a]),Ye=e?.headings??[],Me=!(i||r),Ue=Me&&e!==null,ai=Me&&e===null&&t!==null,Mr=Ue&&d&&Ye.length>0,$r=Ue&&f,Or=(Ue||ai)&&u&&typeof h=="function"&&(g!==void 0||m!==void 0),tt=B.useMemo(()=>w.jsx(oC,{headings:Ye,className:"text-sm",labelledBy:K,onHeadingSelect:He,headingHref:L}),[Ye,K,He,L]),ht=z===void 0?Il:`${$}px`,xt=B.useMemo(()=>ht===Il?U$:cC(ht),[ht]),Pt=Mr||$r||Or?w.jsxs("div",{ref:U,"data-aqmd-toolbar":!0,style:xt,children:[w.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:G$}),Or&&h&&w.jsx(_n,{menu:"align",Icon:uu[c].Icon,buttonLabel:Z.selectAlignAria,titleLabel:Z.alignTitle,pinLabel:Z.pinAlignAria,unpinLabel:Z.unpinAlignAria,isOpen:Y.isAlignOpen,isPinned:Y.isAlignPinned,isFront:Y.lastActiveMenu==="align",onActivate:Y.activateAlign,onToggle:Y.toggleAlign,onClose:Y.closeAlign,onPinToggle:Y.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:ht,boundary:F,renderBody:Ft=>w.jsx("div",{className:"space-y-1",children:so.CONTENT_ALIGNS.map(Lt=>{const{labelKey:fe,Icon:Gt}=uu[Lt],oe=Z[fe],Ge=c===Lt;return w.jsxs("button",{type:"button","aria-pressed":Ge,lang:oe.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${Ge?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{h(Lt),Ft()},children:[w.jsx(Gt,{className:"h-4 w-4"}),oe.text]},Lt)})})}),$r&&w.jsx(_n,{menu:"style",Icon:_$,buttonLabel:Z.selectStyleAria,titleLabel:Z.styleTitle,pinLabel:Z.pinStyleAria,unpinLabel:Z.unpinStyleAria,isOpen:Y.isStyleOpen,isPinned:Y.isStylePinned,isFront:Y.lastActiveMenu==="style",onActivate:Y.activateStyle,onToggle:Y.toggleStyle,onClose:Y.closeStyle,onPinToggle:Y.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:ht,boundary:F,renderBody:Ft=>w.jsx("div",{className:"space-y-1",children:l.map(Lt=>{const fe=a===Lt.name;return w.jsx("button",{type:"button","aria-pressed":fe,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${fe?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{je(Lt.name),Ft()},children:Lt.name},Lt.name)})})}),Mr&&w.jsx(_n,{menu:"toc",Icon:v$,buttonLabel:Z.openTocAria,titleLabel:Z.tocTitle,titleId:K,pinLabel:Z.pinTocAria,unpinLabel:Z.unpinTocAria,isOpen:Y.isTocOpen,isPinned:Y.isTocPinned,isFront:Y.lastActiveMenu==="toc",onActivate:Y.activateToc,onToggle:Y.toggleToc,onClose:Y.closeToc,onPinToggle:Y.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:ht,boundary:F,renderBody:()=>tt})]}):null,Ut=()=>i?w.jsxs("p",{children:[w.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",w.jsx("span",{lang:Z.loading.lang,children:Z.loading.text})]}):r?w.jsx(iO,{error:r,labels:Z}):e?w.jsx("div",{className:"relative w-full min-w-0",children:w.jsx(rO,{parseResult:e,theme:s,styleClassName:si,iFrameAllowedDomains:x,embeds:Mt,embedLabels:ye,linkComponent:v,missingImageLabel:Z.missingImage.text,blockFailedLabel:o?.blockFailed,mermaidLabels:J,spreadsheetEditor:St,spreadsheetLocale:O,spreadsheetLabels:at,spreadsheetTapScrollCircle:I,imageSource:Ct,svgImageLabels:pt,onMathDiagnostics:ue})}):t!==null?w.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):w.jsx("p",{lang:Fe.lang,children:Fe.text}),ni={containerType:"inline-size",paddingInline:kt===0?`${Tt}px`:`${Tt}px ${Tt+kt}px`,paddingBlockEnd:`${Tt}px`,paddingBlockStart:`calc(${Tt}px + var(${Tn}))`,scrollPaddingBlockStart:`var(${Tn})`,[Tn]:`${Ae}px`};return w.jsxs(Cu,{scrollerRef:P,scrollerProps:{"data-testid":"viewer","data-aqmd-scroll-container":!0,className:"grid h-full w-full overflow-x-auto overflow-y-auto *:min-w-0",style:ni},renderScrollBar:z,onBarInlineSizeChange:q,children:[Pt,w.jsx("div",{ref:E,"data-aqmd-content":!0,style:{width:g??H$,maxWidth:m,marginInline:Y$(c)},children:Ut()})]})}const uC=({node:e})=>w.jsx("del",{children:w.jsx(jt,{nodes:e.children})}),fC=({node:e})=>w.jsx("em",{children:w.jsx(jt,{nodes:e.children})}),gC=({node:e})=>w.jsx("sup",{children:w.jsxs("a",{id:`fnref-${e.identifier}`,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",href:`#fn-${e.identifier}`,children:["[",e.identifier,"]"]})}),sO=({nodes:e,theme:t="light"})=>e.length===0?null:w.jsx("section",{className:"border-[#171717] border-t pt-4 dark:border-[#464646]",children:w.jsx("ol",{className:"pl-6 text-[#686868] text-sm dark:text-[#a4a5a9]",children:e.map((r,i)=>w.jsx("li",{id:`fn-${r.identifier}`,className:i===0?"":"mt-4",children:w.jsx(jt,{nodes:r.children,theme:t})},`mdast-node-fn-${r.identifier}-${i}`))})}),pC=({node:e})=>w.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),aO=e=>e.replace(/<rt\b[^>]*>[\s\S]*?<\/rt>/gi,"").replace(/<rp\b[^>]*>[\s\S]*?<\/rp>/gi,"").replace(/<[^>]+>/g,"").replace(/ /gi," ").replace(/&/gi,"&").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&#(\d+);/g,(o,s)=>{const a=Number(s);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/&#x([0-9a-f]+);/gi,(o,s)=>{const a=Number.parseInt(s,16);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/\s+/g," ").trim(),mC=e=>{const t=r=>{if(!r||typeof r!="object")return"";if("type"in r&&r.type==="html"){const i=r.value;return typeof i=="string"?aO(i):""}if("value"in r){const i=r.value;if(typeof i=="string")return i}return"children"in r&&Array.isArray(r.children)?r.children.map(i=>t(i)).join(""):""};return e.map(r=>t(r)).join("").replace(/\s+/g," ").trim()},nO=e=>{switch(e){case 1:return"border-b-2 border-gray-300 pb-2 text-3xl font-bold dark:border-gray-600 dark:text-gray-100";case 2:return"border-b border-gray-300 pb-2 text-2xl font-semibold dark:border-gray-600 dark:text-gray-200";case 3:return"text-xl font-semibold dark:text-gray-300";default:return"text-lg font-medium dark:text-gray-400"}},yC=({node:e})=>{const t=new DC,r=`h${e.depth}`,i=e.data?.hProperties?.id,o=t.slug(mC(e.children));return w.jsx(r,{id:i||o,className:nO(e.depth),children:w.jsx(jt,{nodes:e.children})})},lO=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),hO=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=w.jsx(jt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),o=ma(e.data.tagName,lO(e.data.properties),{parentName:null,iFrameAllowedDomains:r});if(o.action==="unwrap")return i;if(o.action!=="keep"&&o.action!=="placeholder")return null;const s=e.data.tagName.toLowerCase();return w.jsx(s,{...vt.attributesToProps(o.attributes,e.data.tagName.toLowerCase()),children:i})},cO=/^\s*<(address|article|aside|blockquote|details|dialog|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h[1-6]|header|hgroup|hr|li|main|nav|ol|p|pre|section|table|ul)/i,dO=({node:e,iFrameAllowedDomains:t=[]})=>{const r=vt(e.value,tC({iFrameAllowedDomains:t,embedLabels:zC}));return Array.isArray(r)&&r.length===0?null:cO.test(e.value)?w.jsx("div",{children:r}):w.jsx("span",{children:r})},xC=({node:e})=>{if(!e.url||e.url.trim()===""||!Vo(e.url))return null;const t=e.title??"",r=e.data?.hProperties?.width,i=e.data?.hProperties?.height;return w.jsxs("span",{style:{width:r,height:i},className:"mt-4 mb-4 inline-block w-fit max-w-full",children:[w.jsx("img",{src:e.url,alt:e.alt??"",className:"mx-auto h-full w-full",width:r,height:i}),t&&w.jsx("em",{className:"block text-center text-gray-400 text-xs",children:t})]})},CC=({node:e})=>w.jsx("code",{className:"rounded-md bg-gray-200 px-1.5 py-1 font-mono text-gray-800 text-sm dark:bg-gray-700 dark:text-gray-200",children:e.value}),uO=({node:e})=>{const t=Vx(e.value,!1),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return t.kind==="rendered"?w.jsx("span",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("span",{className:r,children:t.message})},fO=new RegExp(`<(?:${[...rc].join("|")})(?=[\\s/>])`,"i"),bC=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&fO.test(t.value)||t.children!==void 0&&bC(t.children)),kC=({node:e})=>{const t=Vo(e.url)?e.url:void 0,r=t!==void 0&&Kx(t);return w.jsx("a",{className:Zx(void 0,bC(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:w.jsx(jt,{nodes:e.children})})},wC=({node:e})=>e.children.length===1&&e.children[0].type==="paragraph"?w.jsx("li",{children:w.jsx(jt,{nodes:e.children[0].children})}):w.jsx("li",{children:w.jsx(jt,{nodes:e.children})}),SC=({node:e})=>{const t=e.ordered?"ol":"ul";return w.jsx(t,{children:w.jsx(jt,{nodes:e.children})})},gO=({node:e})=>w.jsx("mark",{children:w.jsx(jt,{nodes:e.children})}),vC=({node:e})=>w.jsx("p",{children:w.jsx(jt,{nodes:e.children})}),TC=({node:e})=>w.jsx("strong",{children:w.jsx(jt,{nodes:e.children})}),pO=({node:e})=>w.jsx("sub",{children:w.jsx(jt,{nodes:e.children})}),mO=({node:e})=>w.jsx("sup",{children:w.jsx(jt,{nodes:e.children})}),gu=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},_C=({node:e})=>{const[t,...r]=e.children;return w.jsx("div",{className:"overflow-x-auto",children:w.jsxs("table",{className:"w-full border-collapse border-none",children:[w.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:w.jsx("tr",{children:t.children.map((i,o)=>{const{merged:s,colSpan:a,rowSpan:n,textAlign:l}=gu(i);return s?null:w.jsx("th",{colSpan:a,rowSpan:n,style:{textAlign:l??e.align?.[o]??void 0},className:"border border-gray-300 px-4 py-2 text-left font-semibold dark:border-gray-600 dark:text-gray-200",children:w.jsx(jt,{nodes:i.children})},`mdast-table-node-${e.type}-${o}`)})})}),w.jsx("tbody",{children:r.map((i,o)=>w.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((s,a)=>{const{merged:n,colSpan:l,rowSpan:c,textAlign:h}=gu(s);return n?null:w.jsx("td",{colSpan:l,rowSpan:c,style:{textAlign:h??e.align?.[a]??void 0},className:"border border-gray-300 px-4 py-2 dark:border-gray-600 dark:text-gray-300",children:w.jsx(jt,{nodes:s.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${o}`))})]})})},BC=({node:e})=>w.jsx(w.Fragment,{children:e.value}),LC=()=>w.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),EC=({node:e})=>{const t=e.data?.title||"";return w.jsxs("details",{className:"markdown-details",children:[w.jsx("summary",{children:t}),w.jsx("div",{className:"markdown-details-content",children:w.jsx(jt,{nodes:e.children})})]})},FC=({node:e})=>{const r=["message",e.data?.messageType||"message"].filter(Boolean).join(" ");return w.jsxs("aside",{className:r,children:[w.jsx("span",{className:"message-symbol",style:{userSelect:"none"},children:"!"}),w.jsx("div",{className:"message-content",children:w.jsx(jt,{nodes:e.children})})]})},jt=({nodes:e,theme:t="light",iFrameAllowedDomains:r=[]})=>e.map((i,o)=>{switch(i.type){case"blockquote":return w.jsx(AC,{node:i},`mdast-node-${i.type}-${o}`);case"break":return w.jsx("br",{},`mdast-node-${i.type}-${o}`);case"code":return w.jsx(ec,{node:i,theme:t},`mdast-node-${i.type}-${o}`);case"delete":return w.jsx(uC,{node:i},`mdast-node-${i.type}-${o}`);case"details":return w.jsx(EC,{node:i},`mdast-node-${i.type}-${o}`);case"emphasis":return w.jsx(fC,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteReference":return w.jsx(gC,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteDefinition":return null;case"footnote-back-link":return w.jsx(pC,{node:i},`mdast-node-${i.type}-${o}`);case"heading":return w.jsx(yC,{node:i},`mdast-node-${i.type}-${o}`);case"html":return w.jsx(dO,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${o}`);case"html-block-container":{const s=i,a=`mdast-node-${s.type}-${s.position?.start?.offset??"na"}-${s.position?.end?.offset??"na"}`;return w.jsx(hO,{node:s,theme:t,iFrameAllowedDomains:r},a)}case"image":return w.jsx(xC,{node:i},`mdast-node-${i.type}-${o}`);case"inlineCode":return w.jsx(CC,{node:i},`mdast-node-${i.type}-${o}`);case"inlineMath":return w.jsx(uO,{node:i},`mdast-node-${i.type}-${o}`);case"link":return w.jsx(kC,{node:i},`mdast-node-${i.type}-${o}`);case"listItem":return w.jsx(wC,{node:i},`mdast-node-${i.type}-${o}`);case"list":return w.jsx(SC,{node:i},`mdast-node-${i.type}-${o}`);case"mark":return w.jsx(gO,{node:i},`mdast-node-${i.type}-${o}`);case"math":return w.jsx(B3,{node:i},`mdast-node-${i.type}-${o}`);case"message":return w.jsx(FC,{node:i},`mdast-node-${i.type}-${o}`);case"paragraph":return w.jsx(vC,{node:i},`mdast-node-${i.type}-${o}`);case"strong":return w.jsx(TC,{node:i},`mdast-node-${i.type}-${o}`);case"subscript":return w.jsx(pO,{node:i},`mdast-node-${i.type}-${o}`);case"superscript":return w.jsx(mO,{node:i},`mdast-node-${i.type}-${o}`);case"table":return w.jsx(_C,{node:i},`mdast-node-${i.type}-${o}`);case"text":return w.jsx(BC,{node:i},`mdast-node-${i.type}-${o}`);case"thematicBreak":return w.jsx(LC,{},`mdast-node-${i.type}-${o}`);case"yaml":return null;default:{if(process.env.NODE_ENV==="development")return w.jsxs("div",{children:[w.jsxs("p",{style:{color:"red"},children:["Unknown node type: ",i.type]}),w.jsx("pre",{children:JSON.stringify(i,null,2)})]},`mdast-node-${i.type}-${o}`);throw new Error(`Unknown node type: ${i.type}`)}}}),AC=({node:e})=>w.jsx("blockquote",{className:"my-4 border-gray-300 border-l-4 bg-gray-50 p-4 italic dark:border-gray-500 dark:bg-gray-800 dark:text-gray-300",children:w.jsx(jt,{nodes:e.children})}),yO=/\s*\{#(.+?)\}\s*$/,xO=()=>e=>{we.visit(e,"heading",t=>{if(t.children.length===0)return;const r=t.children[t.children.length-1];if(r?.type!=="text")return;const i=r,o=i.value.match(yO);if(o){const s=o[1];t.data||(t.data={});const a=t.data,n=a.hProperties||{};n.id=s,a.hProperties=n,i.value=i.value.substring(0,o.index).trimEnd(),i.value===""&&t.children.pop()}})},CO=()=>e=>{we.visit(e,"footnoteDefinition",t=>{we.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},bO=()=>e=>{we.visit(e,"html",(t,r,i)=>{if(typeof r!="number"||!i)return;const s=t.value.trim().match(/^<a\s+href="([^"]+)"[^>]*>(.*?)<\/a>$/i);if(s){const[,a,n]=s,l={type:"link",url:a,children:[{type:"text",value:n}]};i.children.splice(r,1,l)}})},kO=()=>e=>{const t=r=>{const i=r.children;if(!i)return;let o=0;for(;o<i.length;){const s=i[o];if(s.type==="html"&&s.value.startsWith("<")&&!s.value.startsWith("</")&&s.value.match(/<([a-zA-Z0-9]+)/)){let n="",l=0;const c=[];let h=!1;for(let d=o;d<i.length;d++){const f=i[d];if(f.type==="html"){n+=f.value;const u=f.value.match(/<\/?([a-zA-Z0-9]+)/g)||[];for(const g of u){const m=g.match(/<\/?([a-zA-Z0-9]+)/);if(!m)continue;const y=m[1];g.startsWith("</")?c.length>0&&c[c.length-1]===y&&c.pop():g.startsWith("<")&&c.push(y)}}else if(f.type==="text")n+=f.value;else{c.length===0&&(h=!0);break}if(l++,c.length===0){h=!0;break}}h&&i.splice(o,l,{type:"html",value:n})}o++}};we.visit(e,"paragraph",t),we.visit(e,"tableCell",t),we.visit(e,"heading",t),we.visit(e,"emphasis",t),we.visit(e,"strong",t),we.visit(e,"delete",t)},pu=/\s*=\s*(\d+)(w|h|x|y)\s*/g,wO=()=>e=>{we.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(pu)];return{updatedText:l.replaceAll(pu,"").trim(),matches:c}},{updatedText:i,matches:o}=r(t.alt);t.alt=i;const{updatedText:s,matches:a}=r(t.title);t.title=s||null;const n=[...o,...a];if(n.length>0){t.data||(t.data={}),t.data.hProperties||(t.data.hProperties={});for(const l of n){const c=Number.parseInt(l[1],10),h=l[2];h==="w"||h==="x"?t.data.hProperties.width=c:(h==="h"||h==="y")&&(t.data.hProperties.height=c)}}})},SO=()=>e=>{we.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},mu=/^:::(message|details)\s*(.*)/,vO=()=>e=>{function t(r){const i=[];let o=0;for(;o<r.length;){const s=r[o];if(s.type==="paragraph"&&s.children[0]?.type==="text"&&s.children[0].value.trim().startsWith(":::")){const l=s.children[0].value.trim().match(mu);if(l){const c=o;let h=-1,d=1;const f=s.children.at(-1);if(s.children.length>1&&f?.type==="text"&&f.value.trim()===":::")h=c;else for(let u=c+1;u<r.length;u++){const g=r[u];if(g.type==="paragraph"&&g.children[0]?.type==="text"){const m=g.children[0].value.trim();mu.test(m)?d++:m===":::"&&d--}if(d===0){h=u;break}}if(h!==-1){const u=l[1],g=l[2];let m;if(h===c){const C=s.children.slice(1,-1);C[0]?.type==="break"&&C.shift(),C.at(-1)?.type==="break"&&C.pop(),m=C.length>0?[{type:"paragraph",children:C}]:[]}else{const C=s.children.slice(1);C[0]?.type==="break"&&C.shift();const k={type:"paragraph",children:C},v=r[h].children.slice(0,-1);v.at(-1)?.type==="break"&&v.pop();const T={type:"paragraph",children:v},L=r.slice(c+1,h);m=[k,...L,T].filter(_=>!(_.type==="paragraph"&&_.children.length===0))}const y=t(m);let x;if(u==="message"?x={type:"message",data:{messageType:g.trim()},children:y}:u==="details"&&(x={type:"details",data:{title:g.trim()},children:y}),x){i.push(x),o=h+1;continue}}}}const a={...s};"children"in a&&Array.isArray(a.children)&&(a.type==="blockquote"||a.type==="footnoteDefinition"||a.type==="message"||a.type==="details"?a.children=t(a.children):a.type==="list"&&(a.children=a.children.map(n=>({...n,children:t(n.children)})))),i.push(a),o++}return i}e.children=t(e.children)},TO=e=>{const t=[];return we.visit(e,"heading",r=>{const i=mC(r.children),o=r.data?.hProperties?.id;o&&i&&t.push({depth:r.depth,text:i,id:o})}),t};exports.BlockquoteNode=AC;exports.CodeNode=ec;exports.Color=Ne;exports.Color$1=Ji;exports.DEFAULT_MARKDOWN_EMBED_LABELS=qC;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=I$;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=zM;exports.DEFAULT_MERMAID_INTERACTION=Px;exports.DEFAULT_SVG_IMAGE_LABELS=s$;exports.DeleteNode=uC;exports.EmphasisNode=fC;exports.FootnoteBackLinkNode=pC;exports.FootnoteReferenceNode=gC;exports.FootnotesSection=sO;exports.HeadingNode=yC;exports.HostedScrollArea=Cu;exports.ImageNode=xC;exports.InlineCodeNode=CC;exports.JSON_SCHEMA=Np;exports.LinkNode=kC;exports.ListItemNode=wC;exports.ListNode=SC;exports.MarkdownRenderer=iC;exports.MarkdownViewer=oO;exports.MermaidDiagram=Qh;exports.NodesRenderer=jt;exports.ParagraphNode=vC;exports.Rgb=ge;exports.SpreadsheetBlock=tc;exports.StrongNode=TC;exports.TableNode=_C;exports.TableOfContents=oC;exports.TextNode=BC;exports.ThematicBreakNode=LC;exports.Utils=gt;exports.ZERO_WIDTH_SPACE=lm;exports.ZennDetailsNode=EC;exports.ZennMessageNode=FC;exports.__export=Fu;exports.__name=p;exports.abs=KS;exports.acos=ov;exports.adjustChannel=ql;exports.argumentsTag=bh;exports.array=$f;exports.arrayBufferTag=Vp;exports.arrayTag=Xp;exports.asin=sv;exports.assignWithDepth_default=zt;exports.at=ot;exports.atan2=ZS;exports.booleanTag=Ch;exports.calculateMathMLDimensions=wk;exports.calculateTextDimensions=Aa;exports.calculateTextHeight=Bh;exports.calculateTextWidth=tr;exports.cleanAndMerge=Ma;exports.clear=Ku;exports.clear$1=JB;exports.clear$2=_B;exports.clear2=GB;exports.color=Yi;exports.commonDb_exports=Yl;exports.common_default=Qi;exports.computeDimensionOfText=Um;exports.computeLabelTransform=yi;exports.configureLabelImages=Eh;exports.configureSvgSize=Hl;exports.constant=zr;exports.constant$1=ka;exports.cos=QS;exports.createText=ze;exports.curveBasis=Gs;exports.darken=H;exports.dataViewTag=Zp;exports.dateTag=Yp;exports.dayjs2=Au;exports.decodeEntities=_r;exports.defaultConfig2=Ak;exports.defaultConfig_default=zl;exports.define=ba;exports.distExports=zp;exports.edgeLabels=Yo;exports.epsilon=Xn;exports.extend=Jl;exports.extractHeadings=TO;exports.float32ArrayTag=sm;exports.float64ArrayTag=am;exports.generateId=gm;exports.getAccDescription=tf;exports.getAccTitle=Qu;exports.getConfig=Rt;exports.getConfig2=wt;exports.getDefaultExportFromCjs=xu;exports.getDiagramTitle=rf;exports.getEdgeId=ZT;exports.getEffectiveHtmlLabels=he;exports.getIconSVG=eo;exports.getLineFunctionsWithOffset=v0;exports.getRegisteredLayoutAlgorithm=ML;exports.getStylesFromArray=_h;exports.getSubGraphTitleMargins=$a;exports.getTag=Ea;exports.getThemeVariables3=$u;exports.getUrl=Xu;exports.getUserDefinedConfig=hk;exports.halfPi=Vn;exports.hasKatex=Wi;exports.hue=Bw;exports.insertCluster=iy;exports.insertEdge=L0;exports.insertEdgeLabel=T0;exports.insertNode=Hh;exports.int16ArrayTag=im;exports.int32ArrayTag=om;exports.int8ArrayTag=rm;exports.interpolateNumber=hr;exports.interpolateRgb=qn;exports.interpolateString=kf;exports.isDark=Ee;exports.isLabelStyle=mh;exports.isPrimitive=Fa;exports.isTypedArray=Mo;exports.isValidShape=S0;exports.lighten=W;exports.line=Rf;exports.lineBreakRegex=Zi;exports.load=qp;exports.log=V;exports.mapTag=Up;exports.markerOffsets=ie;exports.markers_default=A0;exports.max=JS;exports.min=tv;exports.nogamma=th;exports.numberTag=xh;exports.objectTag=Kp;exports.parseFontSize=Jo;exports.parseGenericTypes=$n;exports.pi=va;exports.positionEdgeLabel=_0;exports.positionNode=XB;exports.random=mm;exports.regexpTag=Wp;exports.registerIconPacks=wm;exports.remarkCustomHeadingId=xO;exports.remarkFootnoteBackLink=CO;exports.remarkHtmlAnchorToLink=bO;exports.remarkHtmlInHtml=kO;exports.remarkImageSize=wO;exports.remarkParentNode=SO;exports.remarkZennMessage=vO;exports.render=AL;exports.renderKatexSanitized=Wl;exports.rgbConvert=xf;exports.rgba=cr;exports.sanitizeText=Be;exports.select=yt;exports.selectSvgElement=ig;exports.setAccDescription=Ju;exports.setAccTitle=Zu;exports.setConfig2=Fk;exports.setDiagramTitle=ef;exports.setNodeElem=UB;exports.setTag=Gp;exports.setupGraphViewbox=Vu;exports.setupGraphViewbox2=of;exports.sin=ev;exports.sqrt=rv;exports.stringTag=yh;exports.styles2String=st;exports.symbolTag=Hp;exports.tau=iv;exports.terminalLabels=Zt;exports.uint16ArrayTag=tm;exports.uint32ArrayTag=em;exports.uint8ArrayTag=Qp;exports.uint8ClampedArrayTag=Jp;exports.unknownIcon=bm;exports.updateNodeBounds=nt;exports.useMarkdownToolbarState=dC;exports.utils_default=_e;exports.withPath=Mf;exports.wrapLabel=ym;
|