@aiquants/markdown 12.2.2 → 12.3.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.
Files changed (139) hide show
  1. package/README.md +114 -17
  2. package/dist/{abnfDiagram-VRR7QNED-D7guUA6t.js → abnfDiagram-VRR7QNED-B_QmXzWv.js} +3 -3
  3. package/dist/{abnfDiagram-VRR7QNED-Bs1Lli7v.cjs → abnfDiagram-VRR7QNED-Crz-ChMJ.cjs} +1 -1
  4. package/dist/{arc-xPU6Axjw.js → arc-BKGy6Me1.js} +32 -32
  5. package/dist/{arc-BV4FYgD0.cjs → arc-CYJCyviq.cjs} +1 -1
  6. package/dist/{architectureDiagram-ZJ3FMSHR-B9UK4ETe.js → architectureDiagram-ZJ3FMSHR-CEb923Bc.js} +123 -123
  7. package/dist/{architectureDiagram-ZJ3FMSHR-CPNuH39N.cjs → architectureDiagram-ZJ3FMSHR-gTB8pttO.cjs} +1 -1
  8. package/dist/{blockDiagram-677ZJIJ3-DsIH53GY.js → blockDiagram-677ZJIJ3-CmKMdhaS.js} +166 -166
  9. package/dist/{blockDiagram-677ZJIJ3-BQmOW2vo.cjs → blockDiagram-677ZJIJ3-D7RRzjUx.cjs} +1 -1
  10. package/dist/{c4Diagram-LMCZKHZV-DaMrTY75.js → c4Diagram-LMCZKHZV-CG6fvZQo.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-BUAIHxmT.cjs → c4Diagram-LMCZKHZV-W7Qa-ecL.cjs} +1 -1
  12. package/dist/{channel-LyP4eSUH.cjs → channel-BKoPLS2j.cjs} +1 -1
  13. package/dist/{channel-DF_BgJtv.js → channel-TsF8sms_.js} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-Bv43-wHE.js → chunk-2Q5K7J3B-CopwR1m3.js} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-CxctoKh9.cjs → chunk-2Q5K7J3B-DgtYKcDs.cjs} +1 -1
  16. package/dist/{chunk-32BRIVSS-Fs4Q9289.js → chunk-32BRIVSS-BnNlhc1M.js} +1 -1
  17. package/dist/{chunk-32BRIVSS-O40GKD8W.cjs → chunk-32BRIVSS-D-6GBFtx.cjs} +1 -1
  18. package/dist/{chunk-5VM5RSS4-BxJadfPW.js → chunk-5VM5RSS4-O28FGAOF.js} +1 -1
  19. package/dist/{chunk-5VM5RSS4-6BUIzmMt.cjs → chunk-5VM5RSS4-lKwSmIqG.cjs} +1 -1
  20. package/dist/{chunk-EX3LRPZG-B5CmejZw.js → chunk-EX3LRPZG-C36gZH3_.js} +26 -26
  21. package/dist/{chunk-EX3LRPZG-KT7UGMw6.cjs → chunk-EX3LRPZG-CtFe4olX.cjs} +1 -1
  22. package/dist/{chunk-JWPE2WC7-BmpMRM-q.cjs → chunk-JWPE2WC7-5sd39cpa.cjs} +1 -1
  23. package/dist/{chunk-JWPE2WC7-2ASFd6uu.js → chunk-JWPE2WC7-DG0ebjV4.js} +1 -1
  24. package/dist/{chunk-MOJQB5TN-CNHbJr9Y.cjs → chunk-MOJQB5TN-DADVbG98.cjs} +1 -1
  25. package/dist/{chunk-MOJQB5TN-x_GeHYkj.js → chunk-MOJQB5TN-nqR_swpx.js} +15 -15
  26. package/dist/{chunk-PUDLZKDR-CRE6tWjr.cjs → chunk-PUDLZKDR-BUSFO-Gx.cjs} +1 -1
  27. package/dist/{chunk-PUDLZKDR-ClDkO_XD.js → chunk-PUDLZKDR-CD96jce3.js} +13 -13
  28. package/dist/{chunk-RYQCIY6F-B4bh38Ei.cjs → chunk-RYQCIY6F-BBTBydZd.cjs} +1 -1
  29. package/dist/{chunk-RYQCIY6F-D9aA06dU.js → chunk-RYQCIY6F-DJkrr1sD.js} +5 -5
  30. package/dist/{chunk-V7JOEXUC-DL4JcFNI.cjs → chunk-V7JOEXUC-BzCaDGop.cjs} +1 -1
  31. package/dist/{chunk-V7JOEXUC-BiZW9UKe.js → chunk-V7JOEXUC-eBy2sAXD.js} +15 -15
  32. package/dist/{chunk-VR4S4FIN-baTzFT08.js → chunk-VR4S4FIN-C-qPzUSR.js} +3 -3
  33. package/dist/{chunk-VR4S4FIN-DFtsRuwe.cjs → chunk-VR4S4FIN-CHKLwvYh.cjs} +1 -1
  34. package/dist/{chunk-XXDRQBXY-BxcvRxsO.js → chunk-XXDRQBXY-BK6HOWf6.js} +1 -1
  35. package/dist/{chunk-XXDRQBXY-CNf_MwaS.cjs → chunk-XXDRQBXY-DttkP7wv.cjs} +1 -1
  36. package/dist/{classDiagram-OUVF2IWQ-BvvlqJK5.cjs → classDiagram-OUVF2IWQ-BKruajP_.cjs} +1 -1
  37. package/dist/{classDiagram-v2-EOCWNBFH-C9kPbim-.js → classDiagram-OUVF2IWQ-CPDmG5kI.js} +2 -2
  38. package/dist/{classDiagram-v2-EOCWNBFH-BvvlqJK5.cjs → classDiagram-v2-EOCWNBFH-BKruajP_.cjs} +1 -1
  39. package/dist/{classDiagram-OUVF2IWQ-C9kPbim-.js → classDiagram-v2-EOCWNBFH-CPDmG5kI.js} +2 -2
  40. package/dist/components/CopyButton.d.ts +9 -0
  41. package/dist/components/HostedScrollArea.d.ts +2 -1
  42. package/dist/components/MarkdownRenderer.d.ts +7 -2
  43. package/dist/components/MarkdownViewer.d.ts +5 -3
  44. package/dist/components/SpreadsheetBlock.d.ts +3 -2
  45. package/dist/components/codeBlockLabels.d.ts +9 -0
  46. package/dist/components/cssLength.d.ts +1 -0
  47. package/dist/components/displayMathLabels.d.ts +11 -0
  48. package/dist/components/mathRendering.d.ts +3 -1
  49. package/dist/components/mdastNodes/CodeNode.d.ts +3 -1
  50. package/dist/components/mdastNodes/MathNode.d.ts +6 -5
  51. package/dist/components/ownPixels.d.ts +3 -0
  52. package/dist/components/toolbarOverlap.d.ts +4 -1
  53. package/dist/components/viewerLabels.d.ts +11 -1
  54. package/dist/components/viewerToolbarStyles.d.ts +2 -0
  55. package/dist/converter.wasm +0 -0
  56. package/dist/{cose-bilkent-JH36ORCC-B2Jfq4O4.js → cose-bilkent-JH36ORCC-BxO1rjEU.js} +24 -24
  57. package/dist/{cose-bilkent-JH36ORCC-BkaDxf1R.cjs → cose-bilkent-JH36ORCC-Cjfa6NyL.cjs} +1 -1
  58. package/dist/{cynefinDiagram-TSTJHNR4-DOFCbbth.cjs → cynefinDiagram-TSTJHNR4-B3boTACW.cjs} +1 -1
  59. package/dist/{cynefinDiagram-TSTJHNR4-B_S81E78.js → cynefinDiagram-TSTJHNR4-DBD-B_Un.js} +60 -60
  60. package/dist/{dagre-VKFMJZFB-OfG4Ilnm.js → dagre-VKFMJZFB-B8vZCPJg.js} +17 -17
  61. package/dist/{dagre-VKFMJZFB-DlzsylqE.cjs → dagre-VKFMJZFB-DF3Mvuas.cjs} +1 -1
  62. package/dist/{diagram-FQU43EPY-DxOsxcqP.cjs → diagram-FQU43EPY-DwhEcKWF.cjs} +1 -1
  63. package/dist/{diagram-FQU43EPY-ByLcTVdh.js → diagram-FQU43EPY-YrRTNuX-.js} +36 -36
  64. package/dist/{diagram-G47NLZAW-Bvi5tos1.cjs → diagram-G47NLZAW-CKIEbGLS.cjs} +1 -1
  65. package/dist/{diagram-G47NLZAW-CYCIYb2P.js → diagram-G47NLZAW-D4vmirJw.js} +51 -51
  66. package/dist/{diagram-NH7WQ7WH-Bg_7yw9K.cjs → diagram-NH7WQ7WH-D6wMwkLQ.cjs} +1 -1
  67. package/dist/{diagram-NH7WQ7WH-Bqq0j80J.js → diagram-NH7WQ7WH-Drekwiur.js} +10 -10
  68. package/dist/{diagram-OA4YK3LP-COAtD9n7.js → diagram-OA4YK3LP-DZsM4Fpo.js} +21 -21
  69. package/dist/{diagram-OA4YK3LP-hyjrBiQz.cjs → diagram-OA4YK3LP-DeJ7pMIO.cjs} +1 -1
  70. package/dist/{diagram-WEI45ONY-D96DJGL2.js → diagram-WEI45ONY-CjRbsbkF.js} +32 -32
  71. package/dist/{diagram-WEI45ONY-BFdJY0aA.cjs → diagram-WEI45ONY-SYHw7k8b.cjs} +1 -1
  72. package/dist/{ebnfDiagram-CCIWWBDH-NDQe8gJ3.cjs → ebnfDiagram-CCIWWBDH-23bjk9FU.cjs} +1 -1
  73. package/dist/{ebnfDiagram-CCIWWBDH-Dygu7_G3.js → ebnfDiagram-CCIWWBDH-D0kt5Zdu.js} +3 -3
  74. package/dist/{erDiagram-Q63AITRT-Bf5yvhVz.js → erDiagram-Q63AITRT-Ce4GpK2Z.js} +7 -7
  75. package/dist/{erDiagram-Q63AITRT-BKDHKBTP.cjs → erDiagram-Q63AITRT-DqFANbZx.cjs} +1 -1
  76. package/dist/{extractHeadings-BhUj7gND.js → extractHeadings-DlQcPv5N.js} +8033 -7960
  77. package/dist/extractHeadings-wWAipplS.cjs +315 -0
  78. package/dist/flowDiagram-23GEKE2U-CRC9U6qD.cjs +1 -0
  79. package/dist/flowDiagram-23GEKE2U-CRo7TM3K.js +7 -0
  80. package/dist/{ganttDiagram-NO4QXBWP-Bttape_K.cjs → ganttDiagram-NO4QXBWP-CR55KG5d.cjs} +1 -1
  81. package/dist/{ganttDiagram-NO4QXBWP-CTOI65nS.js → ganttDiagram-NO4QXBWP-DjpANtqX.js} +2 -2
  82. package/dist/{gitGraphDiagram-IHSO6WYX-n0hvDzAU.cjs → gitGraphDiagram-IHSO6WYX-BWYUn1Bi.cjs} +1 -1
  83. package/dist/{gitGraphDiagram-IHSO6WYX-B4yspiHJ.js → gitGraphDiagram-IHSO6WYX-DzhnsGXo.js} +24 -24
  84. package/dist/index.cjs +1 -1
  85. package/dist/index.client.cjs +1 -1
  86. package/dist/index.client.d.ts +3 -1
  87. package/dist/index.client.js +50 -48
  88. package/dist/index.js +50 -48
  89. package/dist/{infoDiagram-FWYZ7A6U-CfMG5ulV.cjs → infoDiagram-FWYZ7A6U-CsUGc58_.cjs} +1 -1
  90. package/dist/{infoDiagram-FWYZ7A6U-eqyOUosk.js → infoDiagram-FWYZ7A6U-hraoyboI.js} +1 -1
  91. package/dist/{ishikawaDiagram-FXEZZL3T-Dwpkd1hB.cjs → ishikawaDiagram-FXEZZL3T-D5b25aDN.cjs} +1 -1
  92. package/dist/{ishikawaDiagram-FXEZZL3T-DkB8gfl0.js → ishikawaDiagram-FXEZZL3T-cBJei3wJ.js} +32 -32
  93. package/dist/{journeyDiagram-5HDEW3XC-R4E9RVlA.cjs → journeyDiagram-5HDEW3XC-DrNyUSsx.cjs} +1 -1
  94. package/dist/{journeyDiagram-5HDEW3XC-Cz6v_GY1.js → journeyDiagram-5HDEW3XC-IkQqMl8f.js} +28 -28
  95. package/dist/{kanban-definition-HUTT4EX6-LlToxce1.cjs → kanban-definition-HUTT4EX6-CvBgN3eX.cjs} +1 -1
  96. package/dist/{kanban-definition-HUTT4EX6-DJnc67pi.js → kanban-definition-HUTT4EX6-D2UL88Cz.js} +46 -46
  97. package/dist/{linear-Cp5j01_S.js → linear-BiJV9gYf.js} +10 -10
  98. package/dist/{linear-BqZmlNA1.cjs → linear-DwqXGYLc.cjs} +1 -1
  99. package/dist/{mindmap-definition-LN4V7U3C-wGLNhfRX.cjs → mindmap-definition-LN4V7U3C-CBrUse7P.cjs} +1 -1
  100. package/dist/{mindmap-definition-LN4V7U3C-BuiPEwad.js → mindmap-definition-LN4V7U3C-CK67hf6V.js} +11 -11
  101. package/dist/{pegDiagram-2B236MQR-yS4tA5YS.cjs → pegDiagram-2B236MQR-C5pLIpKI.cjs} +1 -1
  102. package/dist/{pegDiagram-2B236MQR-sbzHIurN.js → pegDiagram-2B236MQR-CwWX4Irn.js} +3 -3
  103. package/dist/{pieDiagram-ENE6RG2P-xY1UpzaD.cjs → pieDiagram-ENE6RG2P-BKvggS7k.cjs} +1 -1
  104. package/dist/{pieDiagram-ENE6RG2P-GLpe6gyb.js → pieDiagram-ENE6RG2P-MO42pSl8.js} +68 -68
  105. package/dist/{quadrantDiagram-ABIIQ3AL-yoek8bjm.cjs → quadrantDiagram-ABIIQ3AL-BHhoAvLS.cjs} +1 -1
  106. package/dist/{quadrantDiagram-ABIIQ3AL-CBzSTD_X.js → quadrantDiagram-ABIIQ3AL-CzHgLdS3.js} +7 -7
  107. package/dist/{railroadDiagram-RFXS5EU6-CyTtxMmf.js → railroadDiagram-RFXS5EU6-Bu_Fhi5x.js} +3 -3
  108. package/dist/{railroadDiagram-RFXS5EU6-XJ0-bOpn.cjs → railroadDiagram-RFXS5EU6-CwGmOFD_.cjs} +1 -1
  109. package/dist/{requirementDiagram-TGXJPOKE-C4O93iJY.cjs → requirementDiagram-TGXJPOKE-BhdvQnjG.cjs} +1 -1
  110. package/dist/{requirementDiagram-TGXJPOKE-CtX0Ex3p.js → requirementDiagram-TGXJPOKE-CY-JYM-P.js} +18 -18
  111. package/dist/{sankeyDiagram-HTMAVEWB-CCCmDHWk.js → sankeyDiagram-HTMAVEWB-BmHtjxlW.js} +10 -10
  112. package/dist/{sankeyDiagram-HTMAVEWB-CJqzKdUJ.cjs → sankeyDiagram-HTMAVEWB-CUeYKZeQ.cjs} +1 -1
  113. package/dist/{sequenceDiagram-DBY2YBRQ-u2918iyb.js → sequenceDiagram-DBY2YBRQ-Cn2CC9BC.js} +47 -47
  114. package/dist/{sequenceDiagram-DBY2YBRQ-6pTuqYPQ.cjs → sequenceDiagram-DBY2YBRQ-GepntdDB.cjs} +1 -1
  115. package/dist/{sizeCapture-X5ZJPWSS-D-5Mwje_.js → sizeCapture-X5ZJPWSS-CZF99dy_.js} +1 -1
  116. package/dist/{sizeCapture-X5ZJPWSS-dYKopsz1.cjs → sizeCapture-X5ZJPWSS-Cd-k8xwk.cjs} +1 -1
  117. package/dist/{stateDiagram-2N3HPSRC-B02lkNbL.js → stateDiagram-2N3HPSRC-CCbBvBua.js} +18 -18
  118. package/dist/{stateDiagram-2N3HPSRC-0X9X_Ts1.cjs → stateDiagram-2N3HPSRC-D2cvrAtN.cjs} +1 -1
  119. package/dist/{stateDiagram-v2-6OUMAXLB-BBH62SQc.cjs → stateDiagram-v2-6OUMAXLB-BaktPIVY.cjs} +1 -1
  120. package/dist/{stateDiagram-v2-6OUMAXLB-Df5lWO9K.js → stateDiagram-v2-6OUMAXLB-_A1QESxx.js} +2 -2
  121. package/dist/styles/markdown.css +1 -1
  122. package/dist/styles/markdown.standalone.css +1 -1
  123. package/dist/{swimlanes-5IMT3BWC-DQP0N1po.js → swimlanes-5IMT3BWC-B-BDM_Ae.js} +3 -3
  124. package/dist/{swimlanes-5IMT3BWC-CnEU4D2p.cjs → swimlanes-5IMT3BWC-DtdLK5z3.cjs} +1 -1
  125. package/dist/{swimlanesDiagram-G3AALYLV-B-81BLvu.js → swimlanesDiagram-G3AALYLV-BysT2rWl.js} +2 -2
  126. package/dist/{swimlanesDiagram-G3AALYLV-LY6E3wIO.cjs → swimlanesDiagram-G3AALYLV-DZuQxKuB.cjs} +1 -1
  127. package/dist/{timeline-definition-FHXFAJF6-ptbJpd9Z.js → timeline-definition-FHXFAJF6-DVzdzbl1.js} +58 -58
  128. package/dist/{timeline-definition-FHXFAJF6-CgGCnkID.cjs → timeline-definition-FHXFAJF6-oFf_sUOI.cjs} +1 -1
  129. package/dist/utils/promiseTry.d.ts +1 -0
  130. package/dist/{vennDiagram-L72KCM5P-Bva8B19X.cjs → vennDiagram-L72KCM5P-Ba2FGeN1.cjs} +1 -1
  131. package/dist/{vennDiagram-L72KCM5P-CD4_4C5a.js → vennDiagram-L72KCM5P-Bm1TGZux.js} +146 -146
  132. package/dist/{wardleyDiagram-EHGQE667-DkJyYdCy.js → wardleyDiagram-EHGQE667-BC_1RAbp.js} +32 -32
  133. package/dist/{wardleyDiagram-EHGQE667-Dz50JUaA.cjs → wardleyDiagram-EHGQE667-CqB3gLCH.cjs} +1 -1
  134. package/dist/{xychartDiagram-FW5EYKEG-D3xLTJxG.js → xychartDiagram-FW5EYKEG-ClITdEhV.js} +47 -47
  135. package/dist/{xychartDiagram-FW5EYKEG-DHLZhPLl.cjs → xychartDiagram-FW5EYKEG-a1vb5UxD.cjs} +1 -1
  136. package/package.json +10 -11
  137. package/dist/extractHeadings-Bg4X-sHT.cjs +0 -315
  138. package/dist/flowDiagram-23GEKE2U-CZYLuO9g.js +0 -7
  139. package/dist/flowDiagram-23GEKE2U-t_M_A-Km.cjs +0 -1
@@ -0,0 +1,315 @@
1
+ "use strict";var HC=Object.create;var gc=Object.defineProperty;var YC=Object.getOwnPropertyDescriptor;var UC=Object.getOwnPropertyNames;var GC=Object.getPrototypeOf,XC=Object.prototype.hasOwnProperty;var VC=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of UC(t))!XC.call(e,o)&&o!==r&&gc(e,o,{get:()=>t[o],enumerable:!(i=YC(t,o))||i.enumerable});return e};var pc=(e,t,r)=>(r=e!=null?HC(GC(e)):{},VC(t||!e||!e.__esModule?gc(r,"default",{value:e,enumerable:!0}):r,e));const v=require("react"),Xe=require("./linkCards-Bjd_vW39.cjs"),Kr=require("./providers-DO2t7ks4.cjs"),no=require("./viewer-settings.cjs"),vt=require("html-react-parser"),At=require("./code-blocks-BdKjppKq.cjs"),Sr=require("./embeds.cjs"),Di=require("./source-lines.cjs"),Ra=require("./simple-logger-9yf7ypyB.cjs"),Ia=require("shiki"),Ni=require("dompurify"),se=require("@aiquants/spreadsheet/view"),kn=require("@aiquants/spreadsheet/tsv"),KC=require("github-slugger"),ZC=require("katex"),be=require("unist-util-visit"),hr=(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)},Vi=e=>{const t={};for(const r of Object.keys(e))t[r]=e[r].text;return Object.freeze(t)},wn=Object.freeze({copy:{text:"Copy the code",lang:"en"},copied:{text:"Copied the code.",lang:"en"},copyFailed:{text:"Could not copy the code.",lang:"en"}}),QC=Vi(wn),Qo=Object.freeze({copy:{text:"Copy the formula",lang:"en"},copied:{text:"Copied the formula.",lang:"en"},copyFailed:{text:"Could not copy the formula.",lang:"en"}}),JC=Vi(Qo),tb=hr(Qo,void 0),Sn=Object.freeze({embeddedVideo:{text:"embedded video",lang:"en"},embeddedPost:{text:"embedded post",lang:"en"},embeddedFrame:{text:"Embedded content",lang:"en"}}),eb=Vi(Sn),Au=e=>hr(Sn,e),rb=Au(void 0);function Mu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var as={exports:{}},ao={};var mc;function ib(){if(mc)return ao;mc=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,o,s){var n=null;if(s!==void 0&&(n=""+s),o.key!==void 0&&(n=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:n,ref:o!==void 0?o:null,props:s}}return ao.Fragment=t,ao.jsx=r,ao.jsxs=r,ao}var lo={};var yc;function ob(){return yc||(yc=1,process.env.NODE_ENV!=="production"&&(function(){function e(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===R?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case y:return"Fragment";case C:return"Profiler";case x:return"StrictMode";case B:return"Suspense";case E:return"SuspenseList";case O:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case m:return"Portal";case S:return L.displayName||"Context";case w:return(L._context.displayName||"Context")+".Consumer";case T:var U=L.render;return L=L.displayName,L||(L=U.displayName||U.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case _:return U=L.displayName||null,U!==null?U:e(L.type)||"Memo";case D:U=L._payload,L=L._init;try{return e(L(U))}catch{}}return null}function t(L){return""+L}function r(L){try{t(L);var U=!1}catch{U=!0}if(U){U=console;var z=U.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return z.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(L)}}function i(L){if(L===y)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===D)return"<...>";try{var U=e(L);return U?"<"+U+">":"<...>"}catch{return"<...>"}}function o(){var L=W.A;return L===null?null:L.getOwner()}function s(){return Error("react-stack-top-frame")}function n(L){if(j.call(L,"key")){var U=Object.getOwnPropertyDescriptor(L,"key").get;if(U&&U.isReactWarning)return!1}return L.key!==void 0}function a(L,U){function z(){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)",U))}z.isReactWarning=!0,Object.defineProperty(L,"key",{get:z,configurable:!0})}function l(){var L=e(this.type);return q[L]||(q[L]=!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.")),L=this.props.ref,L!==void 0?L:null}function c(L,U,z,X,K,Q){var G=z.ref;return L={$$typeof:g,type:L,key:U,props:z,_owner:X},(G!==void 0?G:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:l}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function h(L,U,z,X,K,Q){var G=U.children;if(G!==void 0)if(X)if(N(G)){for(X=0;X<G.length;X++)d(G[X]);Object.freeze&&Object.freeze(G)}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(G);if(j.call(U,"key")){G=e(L);var rt=Object.keys(U).filter(function(tt){return tt!=="key"});X=0<rt.length?"{key: someKey, "+rt.join(": ..., ")+": ...}":"{key: someKey}",P[G+X]||(rt=0<rt.length?"{"+rt.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,G,rt,G),P[G+X]=!0)}if(G=null,z!==void 0&&(r(z),G=""+z),n(U)&&(r(U.key),G=""+U.key),"key"in U){z={};for(var Z in U)Z!=="key"&&(z[Z]=U[Z])}else z=U;return G&&a(z,typeof L=="function"?L.displayName||L.name||"Unknown":L),c(L,G,z,o(),K,Q)}function d(L){f(L)?L._store&&(L._store.validated=1):typeof L=="object"&&L!==null&&L.$$typeof===D&&(L._payload.status==="fulfilled"?f(L._payload.value)&&L._payload.value._store&&(L._payload.value._store.validated=1):L._store&&(L._store.validated=1))}function f(L){return typeof L=="object"&&L!==null&&L.$$typeof===g}var u=v,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"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),R=Symbol.for("react.client.reference"),W=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,N=Array.isArray,$=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(L){return L()}};var F,q={},A=u.react_stack_bottom_frame.bind(u,s)(),I=$(i(s)),P={};lo.Fragment=y,lo.jsx=function(L,U,z){var X=1e4>W.recentlyCreatedOwnerStacks++;return h(L,U,z,!1,X?Error("react-stack-top-frame"):A,X?$(i(L)):I)},lo.jsxs=function(L,U,z){var X=1e4>W.recentlyCreatedOwnerStacks++;return h(L,U,z,!0,X?Error("react-stack-top-frame"):A,X?$(i(L)):I)}})()),lo}var xc;function sb(){return xc||(xc=1,process.env.NODE_ENV==="production"?as.exports=ib():as.exports=ob()),as.exports}var k=sb();const nb=new Set("px cm mm q in pc pt em rem ex rex cap rcap ch rch ic ric lh rlh vw vh vi vb vmin vmax svw svh svi svb svmin svmax lvw lvh lvi lvb lvmin lvmax dvw dvh dvi dvb dvmin dvmax cqw cqh cqi cqb cqmin cqmax".split(" ")),ab=/^(?:\d+(?:\.\d+)?|\.\d+)(?:[Ee][+-]?\d+)?([A-Za-z]+)$/u,lb=/^var\([\t\n\f\r ]*--[A-Za-z0-9_-]+[\t\n\f\r ]*\)$/u,Cc='a non-negative CSS length (an unsigned number directly followed by a length unit, such as "54px" or "3.5rem"; no sign, no %) or a custom property reference without a fallback (such as "var(--lane)")',hb=e=>{const t=ab.exec(e)?.[1];return t===void 0?lb.test(e):nb.has(t.toLowerCase())},Yl=(e,t)=>{if(typeof t=="number"){if(!Number.isFinite(t)||t<0)throw new RangeError(`[@aiquants/markdown] ${e} must be a finite number >= 0; got ${String(t)}`);return`${t}px`}if(typeof t=="string"){const r=t.trim();if(!hb(r))throw new RangeError(`[@aiquants/markdown] ${e} as a string must be ${Cc}; got ${JSON.stringify(t)}`);return r}throw new RangeError(`[@aiquants/markdown] ${e} must be a finite number >= 0 or a string that is ${Cc}; got ${String(t)}`)},Ou=.01,Eo=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},cb=e=>Math.max(0,Math.ceil(e-Ou)),db=1/256,ub=e=>e>Ou?e+db:0,bc=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),fb=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),kc=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),gb=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),pb=Object.freeze({scrollbarWidth:"none"}),vs="data-aqmd-native-scrollbars-hidden",mb=Object.freeze({[vs]:"true"}),wc=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0}),Sc=(e,t,r)=>{const i=getComputedStyle(e),o=Eo(i.width),s=e.getBoundingClientRect();if(o<=0||s.width<=0)return{barInlineSize:0,nativeBarInlineSize:0};const n=s.width/o,a=(s.width-t.getBoundingClientRect().width)/n-Eo(i.borderLeftWidth)-Eo(i.borderRightWidth);return{barInlineSize:r.getBoundingClientRect().width/n,nativeBarInlineSize:ub(a)}},yb=(e,t,r,i)=>{const o=e.style.scrollbarWidth,s=e.getAttribute(vs);if(o===i&&s===null)return Sc(e,t,r);e.style.scrollbarWidth=i,e.removeAttribute(vs);try{return Sc(e,t,r)}finally{e.style.scrollbarWidth=o,s!==null&&e.setAttribute(vs,s)}},xb=(e,t,r,i,o,s)=>{const[n,a]=v.useState(wc),l=v.useRef(o),c=v.useRef(0);return v.useLayoutEffect(()=>{l.current=o}),v.useLayoutEffect(()=>{const h=y=>{c.current!==y&&(c.current=y,l.current?.(y))},d=t.current,f=r.current,u=i.current;if(!e||d===null||f===null||u===null){a(wc),h(0);return}const g=()=>{const{barInlineSize:y,nativeBarInlineSize:x}=yb(d,f,u,s);a(C=>C.scroller===d&&C.barInlineSize===y&&C.nativeBarInlineSize===x?C:Object.freeze({scroller:d,barInlineSize:y,nativeBarInlineSize:x})),h(y)};g();const m=new ResizeObserver(g);return m.observe(d),m.observe(f),m.observe(u),window.addEventListener("resize",g),()=>{m.disconnect(),window.removeEventListener("resize",g)}},[e,t,r,i,s]),n},Cb=(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 $u({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:o,rowStyle:s,onBarInlineSizeChange:n,barInlineSize:a}){const l=v.useRef(null),c=v.useRef(null),h=v.useRef(null),d=i!==void 0,f=a===void 0?null:Yl("barInlineSize",a),u=e.style?.scrollbarWidth??"",g=xb(d,l,c,h,n,u),m=v.useCallback(w=>{l.current=w;const S=Cb(t,w);return()=>{l.current=null,S()}},[t]),y=d?{...e.style,position:"relative",boxSizing:"border-box",overflowY:"scroll",width:`calc(100% + ${g.nativeBarInlineSize}px)`,...g.nativeBarInlineSize===0?pb:void 0}:e.style,x=d&&g.nativeBarInlineSize===0,C=k.jsxs("div",{...e,...x?mb:void 0,ref:m,style:y,children:[r,d&&k.jsx("span",{ref:c,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:gb})]});return d?k.jsxs("div",{"data-aqmd-scroll-row":!0,className:o,style:s===void 0?bc:{...bc,...s},children:[k.jsx("div",{"data-aqmd-scroll-clip":!0,style:fb,children:C}),k.jsx("div",{ref:h,"data-aqmd-scroll-bar":!0,style:f===null?kc:{...kc,inlineSize:f},children:g.scroller!==null&&i(g.scroller)})]}):C}const bb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),Tc=e=>{const t=kb(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ru=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),wb=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Sb={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 Tb=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:n,...a},l)=>v.createElement("svg",{ref:l,...Sb,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Ru("lucide",o),...!s&&!wb(a)&&{"aria-hidden":"true"},...a},[...n.map(([c,h])=>v.createElement(c,h)),...Array.isArray(s)?s:[s]]));const St=(e,t)=>{const r=v.forwardRef(({className:i,...o},s)=>v.createElement(Tb,{ref:s,iconNode:t,className:Ru(`lucide-${bb(Tc(e))}`,`lucide-${e}`,i),...o}));return r.displayName=Tc(e),r};const vb=[["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"}]],_b=St("image-off",vb);class Bb extends v.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?k.jsxs("div",{"data-aqmd-block-failure":"",children:[k.jsx("p",{"data-aqmd-block-failure-notice":"",lang:this.props.label.lang,children:this.props.label.text}),k.jsx("pre",{"data-aqmd-block-failure-text":"",children:this.props.text()})]}):this.props.children}}const Iu=Object.freeze({blockFailed:{text:"This block could not be shown.",lang:"en"}}),Lb=1024,zs=(e,t)=>e.fingerprint===t.fingerprint&&e.content===t.content,Eb=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&zs(e[r],t[r]);)r+=1;let i=0;for(;i<e.length-r&&i<t.length-r&&zs(e[e.length-1-i],t[t.length-1-i]);)i+=1;const o=Array.from({length:r},(a,l)=>[l,l]),s=Array.from({length:i},(a,l)=>[e.length-i+l,t.length-i+l]),n=Fb(e,t,r,e.length-i,t.length-i);return[...o,...n,...s]},Fb=(e,t,r,i,o)=>{const s=new Set(e.slice(r,i).map(S=>S.fingerprint)),n=new Set(t.slice(r,o).map(S=>S.fingerprint)),a=[];for(let S=r;S<i;S+=1)n.has(e[S].fingerprint)&&a.push(S);const l=[];for(let S=r;S<o;S+=1)s.has(t[S].fingerprint)&&l.push(S);const c=a.length,h=l.length;if(c===0||h===0)return[];const d=(S,T)=>zs(e[a[S]],t[l[T]]),f=(S,T)=>e[a[S]].fingerprint===t[l[T]].fingerprint,u=(S,T)=>{let B=S;for(;B<c&&B+T<h&&d(B,B+T);)B+=1;return B},g=[Int32Array.of(u(0,0))],m=[Uint8Array.of(ea)],y=h-c;let x=0;for(;!(y>=-x&&y<=x&&g[x][y+x]===c);){if(x+=1,x>Lb)return[];const S=g[x-1],T=_=>_>=-(x-1)&&_<=x-1?S[_+x-1]:-1,B=new Int32Array(2*x+1).fill(-1),E=new Uint8Array(2*x+1);for(let _=-x;_<=x;_+=1){if(_<-c||_>h)continue;let D=-1,O=ea;const R=T(_);R!==-1&&R<c&&R+_<h&&f(R,R+_)&&(D=R+1,O=vc);const W=T(_+1);W!==-1&&W+1<=c&&W+1>D&&(D=W+1,O=_c);const j=T(_-1);j!==-1&&j+_<=h&&j>D&&(D=j,O=ra),D!==-1&&(B[_+x]=u(D,_),E[_+x]=O)}g.push(B),m.push(E)}const C=[];let w=y;for(let S=x;S>=0;S-=1){const T=g[S][w+S],B=m[S][w+S],E=B===_c?w+1:B===ra?w-1:w,_=B===ea?0:g[S-1][E+S-1]+(B===ra?0:1);for(let D=T-1;D>=_;D-=1)C.push([a[D],l[D+w]]);B===vc&&C.push([a[_-1],l[_-1+w]]),w=E}return C.reverse()},ea=0,vc=1,_c=2,ra=3,Ab=(e,t)=>{const r=e.map(()=>null),i=new Set;for(const[a,l]of Eb(t,e))r[l]=t[a].key,i.add(a);const o=new Map;for(const[a,l]of t.entries()){if(i.has(a))continue;const c=o.get(l.fingerprint);c===void 0?o.set(l.fingerprint,[a]):c.push(a)}const s=a=>{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=>a(c,t[f]));h!==void 0&&d!==-1&&(r[l]=t[h.splice(d,1)[0]].key)}};s(zs),s(()=>!0);const n=new Set(r.filter(a=>a!==null));return e.map((a,l)=>{let c=r[l];if(c===null){let h=0;for(;n.has(`${a.fingerprint}.${h}`);)h+=1;c=`${a.fingerprint}.${h}`,n.add(c)}return{...a,key:c}})};const Mb=[["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"}]],Ob=St("building-2",Mb);const $b=[["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"}]],Bc=St("globe",$b),Rb=/^[a-z]{2,3}$/u,Ib=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return Rb.test(t)?t:null},Pb=()=>()=>{},Db=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},Ul=()=>v.useSyncExternalStore(Pb,()=>window.location.origin,()=>null),Nb=()=>v.useSyncExternalStore(Db,()=>Ib(document.documentElement.lang),()=>null),qb=/^[1-9]\d{0,4}$/u,Lc=e=>e!==void 0&&qb.test(e.trim())?Number(e.trim()):null,zb=({embed:e,label:t,insideAnchor:r,children:i})=>{const o=Ul(),s=new URL(e.src);if(o!==null&&s.origin!==o&&!r)return i;const n=Lc(e.attributes.width),a=Lc(e.attributes.height),l=n!==null&&a!==null?{width:"100%",maxWidth:`${n}px`,aspectRatio:`${n} / ${a}`}:void 0,c=e.attributes.title,h=c===void 0?t.lang:void 0;return k.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?k.jsx("span",{lang:h,children:`${c??t.text}: ${s.hostname}`}):k.jsx("a",{href:s.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${s.hostname}`})})},Do=e=>new Promise(t=>t(e())),Pu=({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 n=0;const a=(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(;n<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,n+=1,Do(()=>d.start(AbortSignal.any([f.signal,AbortSignal.timeout(r)]))).then(u=>a(h,d,{ok:!0,value:u}),()=>a(h,d,f.signal.aborted?null:{ok:!1})).finally(()=>{n-=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())}}})},jb=Pu({concurrency:2,capacity:256,timeoutMs:15e3}),Wb="[data-aqmd-scroll-container]",Hb=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=Xe.linkCardSkipReasonOf(r.headers.get(Xe.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=Xe.linkCardMetadataOf(i);return o===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:o}},Yb=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",Ec=(e,t)=>e!==null&&new URL(e).hostname!==t?e:null,ia=({tile:e,tileKind:t,primary:r,secondary:i})=>k.jsxs("span",{className:"flex min-w-0 flex-auto items-center gap-3 px-3",children:[k.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}),k.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[k.jsx("span",{className:"truncate font-semibold text-[0.875rem] leading-5",children:r}),k.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:i})]})]}),Ub=({href:e,endpoint:t,size:r,fallback:i})=>{const o=Ul(),s=v.useRef(null),n=new URL(e),a=`${t}
7
+ ${n.href}`,[l,c]=v.useState(null);v.useEffect(()=>{const x=s.current;if(x===null||o===null)return;let C=null;const w=new IntersectionObserver(S=>{C!==null||!S.some(T=>T.isIntersecting)||(w.disconnect(),C=jb.subscribe(a,T=>Hb(Xe.linkCardRequestOf(t,new URL(e),o),T),T=>{c({key:a,outcome:T});const B=Yb(T);B!==null&&Ra.linkCardLogger.info(`No link card for ${e} (${B})`)}))},{root:x.closest(Wb),rootMargin:"100% 0px"});return w.observe(x),()=>{w.disconnect(),C?.()}},[a,t,e,o]);const h=l!==null&&l.key===a?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 k.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"?k.jsx(ia,{tile:null,tileKind:"pending",primary:n.hostname,secondary:e}):k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-2 px-4 py-3.5",children:[k.jsx("span",{"aria-hidden":"true",className:"block h-3.5 w-2/3 rounded bg-(--aqmd-link-card-border) motion-safe:animate-pulse"}),k.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem]",children:n.hostname}),k.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",w=C?Ob:Bc;return k.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:k.jsx(ia,{tile:k.jsx(w,{"aria-hidden":"true",className:"size-4"}),tileKind:C?"internal":"link",primary:n.hostname,secondary:e})})}const{metadata:f}=d,u=new URL(o).hostname,g=Ec(f.image,u),m=Ec(f.icon,u),y=f.siteName===null?n.hostname:`${f.siteName} · ${n.hostname}`;return r==="compact"?k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:k.jsx(ia,{tile:m===null?k.jsx(Bc,{"aria-hidden":"true",className:"size-4"}):k.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})}):k.jsxs("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":r,children:[k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1 px-4 py-3.5",children:[k.jsx("span",{className:"wrap-anywhere line-clamp-2 font-semibold text-[0.9375rem] leading-5",children:f.title??e}),f.description===null?null:k.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}),k.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-(--aqmd-link-card-muted) text-xs leading-4",children:[m===null?null:k.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 shrink-0 rounded-[3px]"}),k.jsx("span",{className:"truncate",children:y})]})]}),g===null?null:k.jsx("img",{src:g,alt:"",loading:"lazy",referrerPolicy:"no-referrer"})]})},Du=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&&!Xe.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&&!Xe.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${Xe.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},bo=new WeakMap;let ls=0;const Fc=e=>{if(e.source===null)return;const t=bo.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))},Gb=(e,t)=>{const r={watch:t,last:null};return bo.has(e)||(ls+=1,ls===1&&window.addEventListener("message",Fc)),bo.set(e,r),()=>{bo.get(e)===r&&(bo.delete(e),ls-=1,ls===0&&window.removeEventListener("message",Fc))}},Xb=Pu({concurrency:2,capacity:256,timeoutMs:5e3}),Vb=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()},Kb=(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`}}},Zb=Object.freeze({marginInline:0}),oa=Object.freeze({kind:"pending"}),Qb=Object.freeze({kind:"narrow"}),Jb=Object.freeze({kind:"fallback"}),t1=(e,t,r,i,o)=>{if(t===null)return oa;let s;if(e.kind==="frame")s=e.srcOf(r);else{if(i===null)return oa;s=i.ok?e.srcOf(i.value,r):null}if(s===null||new URL(s).origin===t)return Jb;const{minWidth:n,maxWidth:a}=e.layout;if(n!==null){if(o===null)return oa;if(Math.min(o,a??Number.POSITIVE_INFINITY)<n)return Qb}return{kind:"frame",src:s}},e1=({resolution:e,caption:t,fallback:r,theme:i,labels:o})=>{const s=Ul(),n=Nb(),[a,l]=v.useState(null),[c,h]=v.useState(null),d=e.kind==="lookup"?e.request.href:null,[f,u]=v.useState(null);v.useEffect(()=>{if(d!==null)return Xb.subscribe(d,_=>Vb(new URL(d),_),_=>u({key:d,outcome:_}))},[d]);const{provider:g,layout:m}=e,y=t1(e,s,{theme:i,lang:n},f!==null&&f.key===d?f.outcome:null,a),x=v.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,w=c!==null&&c.src===C?c.height:null,S=v.useCallback(_=>{if(!(_===null||_.contentWindow===null||m.kind!=="message"||C===null))return Gb(_.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 T=m.minWidth===null?null:k.jsx("span",{ref:x,"aria-hidden":"true","data-embed-measure":g.id,className:"block h-0"});if(y.kind==="narrow")return k.jsxs(k.Fragment,{children:[T,r]});const B=g.content==="video"?o.embeddedVideo:o.embeddedPost,{frame:E}=g;return k.jsxs(k.Fragment,{children:[T,k.jsxs("figure",{"data-embed-provider":g.id,"data-embed-state":y.kind,style:Zb,children:[k.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:Kb(m,w),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?k.jsx("iframe",{ref:S,src:y.src,title:`${g.name}: ${B.text}`,lang:B.lang,loading:"lazy",allow:E.allow??void 0,allowFullScreen:E.allowFullScreen,sandbox:E.sandbox,referrerPolicy:E.referrerPolicy,scrolling:E.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),k.jsx("figcaption",{className:"mt-2",children:t})]})]})},r1=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],i1=(e,t)=>Sr.allowedFrameUrlOf(e,t)!==null,o1=(e,t)=>{const r=new Map(Object.entries(e).map(([s,n])=>[s.toLowerCase(),n])),i=Sr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const o={};for(const s of r1){const n=r.get(s);if(n!==void 0)if(s==="allow"){const a=Sr.reduceFrameFeatures(n);a!==null&&(o.allow=a)}else if(s==="referrerpolicy"){const a=n.trim().toLowerCase();Sr.EMBED_FRAME_REFERRER_POLICIES.has(a)&&(o.referrerpolicy=a)}else o[s]=n}return Object.freeze({src:i.href,attributes:Object.freeze(o)})},s1=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"]),n1=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),a1=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"]),Ac="language-",l1=/[\t\n\f\r ]+/u,h1=new Set(["h1","h2","h3","h4","h5","h6"]),Mc=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),Oc="user-content-",te=["align"],ui=["width","height"],$c=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],sa=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,...ui],colgroup:["span",...te,...ui],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,...ui,"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",...ui],tbody:[...te,"valign"],td:$c,tfoot:[...te,"valign"],th:$c,thead:[...te,"valign"],time:["datetime"],tr:[...te,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...ui],wbr:[]}),na=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...ui],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),c1=new Set(["svg","g"]),d1=new Set(["href","src","cite","poster",Sr.EMBED_LINK_ATTRIBUTE]),u1=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,f1=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,g1=new Set(["left","right","center","justify","start","end"]),Jo=e=>f1.test(e.replace(u1,"")),p1=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();g1.has(o)&&(t=o)}return t===null?null:`text-align: ${t}`},m1=e=>{const t=e.split(l1).filter(r=>a1.has(r)||r.startsWith(Ac)&&r.length>Ac.length);return t.length===0?null:t.join(" ")},y1=(e,t)=>h1.has(e)||t.startsWith(Oc)&&t.length>Oc.length||Object.hasOwn(Mc,e)&&Mc[e].test(t),x1=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},ho=(e,t,r)=>{const i={};for(const[o,s]of t){if(o===Di.SOURCE_LINES_ATTRIBUTE){Di.parseSourceLines(s)!==null&&(i[o]=s);continue}if((n1.has(o)||r.includes(o)||o.startsWith("aria-")&&o.length>5)&&!(d1.has(o)&&!Jo(s))&&!(o==="fill"&&/url\s*\(/iu.test(s))&&!(o==="id"&&!y1(e,s))){if(o==="class"||o==="style"){const n=o==="class"?m1(s):p1(s);n!==null&&(i[o]=n);continue}i[o]=s}}return i},C1=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),Tn=(e,t,r)=>{const i=e.toLowerCase(),o=r.parentName===null?null:r.parentName.toLowerCase(),s=x1(t);if(o!==null&&c1.has(o)){const a=i!=="svg"&&Object.hasOwn(na,i)?na[i]:void 0;return a===void 0?{action:"remove"}:{action:"keep",attributes:ho(i,s,a)}}if(i==="svg")return{action:"keep",attributes:ho(i,s,na.svg)};if(i==="iframe"){const a=o1(Object.fromEntries(s),r.iFrameAllowedDomains);return a===null?{action:"remove"}:{action:"embed",embed:a,pluginType:s.get("data-plugin-type")??null}}if(i==="p"){const a=ho(i,s,sa.p),l=s.get(Sr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&Jo(l)?{action:"placeholder",attributes:a,link:l}:{action:"keep",attributes:a}}if(i==="input")return C1(s)?{action:"keep",attributes:ho(i,s,["type","checked","disabled"])}:{action:"remove"};if(s1.has(i))return{action:"remove"};const n=Object.hasOwn(sa,i)?sa[i]:void 0;return n===void 0?{action:"unwrap"}:{action:"keep",attributes:ho(i,s,n)}};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 b1=typeof document<"u"&&!!document.documentMode;let aa;function k1(){return aa||(aa=document.createElement("div").style)}const Rc=["webkit","moz","ms"],hs={};function Gl(e){if(hs[e])return hs[e];const t=k1();if(e in t)return hs[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=Rc.length;for(;i--;){const o=`${Rc[i]}${r}`;if(o in t)return hs[e]=o}}function cs(e,t){return parseFloat(t[Gl(e)])||0}function ds(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:cs(`${t}Left${i}`,r),right:cs(`${t}Right${i}`,r),top:cs(`${t}Top${i}`,r),bottom:cs(`${t}Bottom${i}`,r)}}function xi(e,t,r){e.style[Gl(t)]=r}function w1(e,t){const r=Gl("transform");xi(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function S1(e,{x:t,y:r,scale:i,isSVG:o},s){if(xi(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),o&&b1){const n=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",n)}}function la(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:ds(e,"margin",r),border:ds(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:ds(t,"padding",i),border:ds(t,"border",i)}}}let No={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?No={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(No={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function ha(e,t,r,i){No[e].split(" ").forEach(o=>{t.addEventListener(o,r,i)})}function ca(e,t,r){No[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function Nu(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function Pa(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,Pa(e,i);return}r=Nu(e,t),r>-1&&e.splice(r,1),e.push(t)}function T1(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=Nu(e,t);r>-1&&e.splice(r,1)}function Ic(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 da(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 v1(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 _1(e){return(e.getAttribute("class")||"").trim()}function B1(e,t){return e.nodeType===1&&` ${_1(e)} `.indexOf(` ${t} `)>-1}function L1(e,t){for(let r=e;r!=null;r=r.parentNode)if(B1(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const E1=/^http:[\w\.\/]+svg$/;function F1(e){return E1.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function A1(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const qu={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:S1,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function zu(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(!v1(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...qu,...t};const r=F1(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,xi(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="",xi(e,"transformOrigin","")}function s(I={}){for(const P in I)I.hasOwnProperty(P)&&(t[P]=I[P]);(I.hasOwnProperty("cursor")||I.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),I.hasOwnProperty("overflow")&&(i.style.overflow=I.overflow),I.hasOwnProperty("touchAction")&&(i.style.touchAction=I.touchAction,e.style.touchAction=I.touchAction)}let n=0,a=0,l=1,c=!1;m(t.startScale,{animate:!1,force:!0}),setTimeout(()=>{g(t.startX,t.startY,{animate:!1,force:!0})});function h(I,P,L){if(L.silent)return;const U=new CustomEvent(I,{detail:P});e.dispatchEvent(U)}function d(I,P,L){const U={x:n,y:a,scale:l,isSVG:r,originalEvent:L};return requestAnimationFrame(()=>{typeof P.animate=="boolean"&&(P.animate?w1(e,P):xi(e,"transition","none")),P.setTransform(e,U,P),h(I,U,P),h("panzoomchange",U,P)}),U}function f(I,P,L,U){const z={...t,...U},X={x:n,y:a,opts:z};if(!U?.force&&(z.disablePan||z.panOnlyWhenZoomed&&l===z.startScale))return X;if(I=parseFloat(I),P=parseFloat(P),z.disableXAxis||(X.x=(z.relative?n:0)+I),z.disableYAxis||(X.y=(z.relative?a:0)+P),z.contain){const K=la(e),Q=K.elem.width/l,G=K.elem.height/l,rt=Q*L,Z=G*L,tt=(rt-Q)/2,mt=(Z-G)/2;if(z.contain==="inside"){const _t=(-K.elem.margin.left-K.parent.padding.left+tt)/L,Ct=(K.parent.width-rt-K.parent.padding.left-K.elem.margin.left-K.parent.border.left-K.parent.border.right+tt)/L;X.x=Math.max(Math.min(X.x,Ct),_t);const It=(-K.elem.margin.top-K.parent.padding.top+mt)/L,xe=(K.parent.height-Z-K.parent.padding.top-K.elem.margin.top-K.parent.border.top-K.parent.border.bottom+mt)/L;X.y=Math.max(Math.min(X.y,xe),It)}else if(z.contain==="outside"){const _t=(-(rt-K.parent.width)-K.parent.padding.left-K.parent.border.left-K.parent.border.right+tt)/L,Ct=(tt-K.parent.padding.left)/L;X.x=Math.max(Math.min(X.x,Ct),_t);const It=(-(Z-K.parent.height)-K.parent.padding.top-K.parent.border.top-K.parent.border.bottom+mt)/L,xe=(mt-K.parent.padding.top)/L;X.y=Math.max(Math.min(X.y,xe),It)}}return z.roundPixels&&(X.x=Math.round(X.x),X.y=Math.round(X.y)),X}function u(I,P){const L={...t,...P},U={scale:l,opts:L};if(!P?.force&&L.disableZoom)return U;let z=t.minScale,X=t.maxScale;if(L.contain){const K=la(e),Q=K.elem.width/l,G=K.elem.height/l;if(Q>1&&G>1){const rt=K.parent.width-K.parent.border.left-K.parent.border.right,Z=K.parent.height-K.parent.border.top-K.parent.border.bottom,tt=rt/Q,mt=Z/G;t.contain==="inside"?X=Math.min(X,tt,mt):t.contain==="outside"&&(z=Math.max(z,tt,mt))}}return U.scale=Math.min(Math.max(I,z),X),U}function g(I,P,L,U){const z=f(I,P,l,L);return n!==z.x||a!==z.y?(n=z.x,a=z.y,d("panzoompan",z.opts,U)):{x:n,y:a,scale:l,isSVG:r,originalEvent:U}}function m(I,P,L){const U=u(I,P),z=U.opts;if(!P?.force&&z.disableZoom)return;I=U.scale;let X=n,K=a;if(z.focal){const G=z.focal;X=(G.x/I-G.x/l+n*I)/I,K=(G.y/I-G.y/l+a*I)/I}const Q=f(X,K,I,{relative:!1,force:!0});return n=Q.x,a=Q.y,l=I,d("panzoomzoom",z,L)}function y(I,P){const L={...t,animate:!0,...P};return m(l*Math.exp((I?1:-1)*L.step),L)}function x(I){return y(!0,I)}function C(I){return y(!1,I)}function w(I,P,L,U){const z=la(e),X={width:z.parent.width-z.parent.padding.left-z.parent.padding.right-z.parent.border.left-z.parent.border.right,height:z.parent.height-z.parent.padding.top-z.parent.padding.bottom-z.parent.border.top-z.parent.border.bottom};let K=P.clientX-z.parent.left-z.parent.padding.left-z.parent.border.left-z.elem.margin.left,Q=P.clientY-z.parent.top-z.parent.padding.top-z.parent.border.top-z.elem.margin.top;r||(K-=z.elem.width/l/2,Q-=z.elem.height/l/2);const G={x:K/X.width*(X.width*I),y:Q/X.height*(X.height*I)};return m(I,{...L,animate:!1,focal:G},U)}function S(I,P){I.preventDefault();const L={...t,...P,animate:!1},z=(I.deltaY===0&&I.deltaX?I.deltaX:I.deltaY)<0?1:-1,X=u(l*Math.exp(z*L.step/3),L).scale;return w(X,I,L,I)}function T(I){const P={...t,animate:!0,force:!0,...I};l=u(P.startScale,P).scale;const L=f(P.startX,P.startY,l,P);return n=L.x,a=L.y,d("panzoomreset",P)}let B,E,_,D,O,R;const W=[];function j(I){if(L1(I.target,t))return;Pa(W,I),c=!0,t.handleStartEvent(I),B=n,E=a,h("panzoomstart",{x:n,y:a,scale:l,isSVG:r,originalEvent:I},t);const P=Ic(W);_=P.clientX,D=P.clientY,O=l,R=da(W)}function N(I){if(!c||B===void 0||E===void 0||_===void 0||D===void 0)return;Pa(W,I);const P=Ic(W),L=W.length>1;let U=l;if(L){R===0&&(R=da(W));const z=da(W)-R;U=u(z*t.step/80+O).scale,w(U,P,{animate:!1},I)}(!L||t.pinchAndPan)&&g(B+(P.clientX-_)/U,E+(P.clientY-D)/U,{animate:!1},I)}function $(I){W.length===1&&h("panzoomend",{x:n,y:a,scale:l,isSVG:r,originalEvent:I},t),T1(W,I),c&&(c=!1,B=E=_=D=void 0)}let F=!1;function q(){F||(F=!0,ha("down",t.canvas?i:e,j),ha("move",document,N,{passive:!0}),ha("up",document,$,{passive:!0}))}function A(){F=!1,ca("down",t.canvas?i:e,j),ca("move",document,N),ca("up",document,$)}return t.noBind||q(),{bind:q,destroy:A,eventNames:No,getPan:()=>({x:n,y:a}),getScale:()=>l,getOptions:()=>A1(t),handleDown:j,handleMove:N,handleUp:$,pan:g,reset:T,resetStyle:o,setOptions:s,setStyle:(I,P)=>xi(e,I,P),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:w,zoomWithWheel:S}}zu.defaultOptions=qu;const M1=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],O1=St("arrow-down",M1);const $1=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],R1=St("arrow-left",$1);const I1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],P1=St("arrow-right",I1);const D1=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],N1=St("arrow-up",D1);const q1=[["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"}]],Da=St("refresh-cw",q1);const z1=[["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"}]],j1=St("settings-2",z1);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"}]],ju=St("zoom-in",W1);const H1=[["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"}]],Wu=St("zoom-out",H1);var Hu=Object.defineProperty,p=(e,t)=>Hu(e,"name",{value:t,configurable:!0}),Yu=(e,t)=>{for(var r in t)Hu(e,r,{get:t[r],enumerable:!0})},_s={exports:{}},Y1=_s.exports,Pc;function U1(){return Pc||(Pc=1,(function(e,t){(function(r,i){e.exports=i()})(Y1,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",n="second",a="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(N){var $=["th","st","nd","rd"],F=N%100;return"["+N+($[(F-20)%10]||$[F]||$[0])+"]"}},w=function(N,$,F){var q=String(N);return!q||q.length>=$?N:""+Array($+1-q.length).join(F)+N},S={s:w,z:function(N){var $=-N.utcOffset(),F=Math.abs($),q=Math.floor(F/60),A=F%60;return($<=0?"+":"-")+w(q,2,"0")+":"+w(A,2,"0")},m:function N($,F){if($.date()<F.date())return-N(F,$);var q=12*(F.year()-$.year())+(F.month()-$.month()),A=$.clone().add(q,d),I=F-A<0,P=$.clone().add(q+(I?-1:1),d);return+(-(q+(F-A)/(I?A-P:P-A))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:d,y:u,w:h,d:c,D:g,h:l,m:a,s:n,ms:s,Q:f}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},T="en",B={};B[T]=C;var E="$isDayjsObject",_=function(N){return N instanceof W||!(!N||!N[E])},D=function N($,F,q){var A;if(!$)return T;if(typeof $=="string"){var I=$.toLowerCase();B[I]&&(A=I),F&&(B[I]=F,A=I);var P=$.split("-");if(!A&&P.length>1)return N(P[0])}else{var L=$.name;B[L]=$,A=L}return!q&&A&&(T=A),A||!q&&T},O=function(N,$){if(_(N))return N.clone();var F=typeof $=="object"?$:{};return F.date=N,F.args=arguments,new W(F)},R=S;R.l=D,R.i=_,R.w=function(N,$){return O(N,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var W=(function(){function N(F){this.$L=D(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[E]=!0}var $=N.prototype;return $.parse=function(F){this.$d=(function(q){var A=q.date,I=q.utc;if(A===null)return new Date(NaN);if(R.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var P=A.match(y);if(P){var L=P[2]-1||0,U=(P[7]||"0").substring(0,3);return I?new Date(Date.UTC(P[1],L,P[3]||1,P[4]||0,P[5]||0,P[6]||0,U)):new Date(P[1],L,P[3]||1,P[4]||0,P[5]||0,P[6]||0,U)}}return new Date(A)})(F),this.init()},$.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()},$.$utils=function(){return R},$.isValid=function(){return this.$d.toString()!==m},$.isSame=function(F,q){var A=O(F);return this.startOf(q)<=A&&A<=this.endOf(q)},$.isAfter=function(F,q){return O(F)<this.startOf(q)},$.isBefore=function(F,q){return this.endOf(q)<O(F)},$.$g=function(F,q,A){return R.u(F)?this[q]:this.set(A,F)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(F,q){var A=this,I=!!R.u(q)||q,P=R.p(F),L=function(Z,tt){var mt=R.w(A.$u?Date.UTC(A.$y,tt,Z):new Date(A.$y,tt,Z),A);return I?mt:mt.endOf(c)},U=function(Z,tt){return R.w(A.toDate()[Z].apply(A.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(tt)),A)},z=this.$W,X=this.$M,K=this.$D,Q="set"+(this.$u?"UTC":"");switch(P){case u:return I?L(1,0):L(31,11);case d:return I?L(1,X):L(0,X+1);case h:var G=this.$locale().weekStart||0,rt=(z<G?z+7:z)-G;return L(I?K-rt:K+(6-rt),X);case c:case g:return U(Q+"Hours",0);case l:return U(Q+"Minutes",1);case a:return U(Q+"Seconds",2);case n:return U(Q+"Milliseconds",3);default:return this.clone()}},$.endOf=function(F){return this.startOf(F,!1)},$.$set=function(F,q){var A,I=R.p(F),P="set"+(this.$u?"UTC":""),L=(A={},A[c]=P+"Date",A[g]=P+"Date",A[d]=P+"Month",A[u]=P+"FullYear",A[l]=P+"Hours",A[a]=P+"Minutes",A[n]=P+"Seconds",A[s]=P+"Milliseconds",A)[I],U=I===c?this.$D+(q-this.$W):q;if(I===d||I===u){var z=this.clone().set(g,1);z.$d[L](U),z.init(),this.$d=z.set(g,Math.min(this.$D,z.daysInMonth())).$d}else L&&this.$d[L](U);return this.init(),this},$.set=function(F,q){return this.clone().$set(F,q)},$.get=function(F){return this[R.p(F)]()},$.add=function(F,q){var A,I=this;F=Number(F);var P=R.p(q),L=function(X){var K=O(I);return R.w(K.date(K.date()+Math.round(X*F)),I)};if(P===d)return this.set(d,this.$M+F);if(P===u)return this.set(u,this.$y+F);if(P===c)return L(1);if(P===h)return L(7);var U=(A={},A[a]=i,A[l]=o,A[n]=r,A)[P]||1,z=this.$d.getTime()+F*U;return R.w(z,this)},$.subtract=function(F,q){return this.add(-1*F,q)},$.format=function(F){var q=this,A=this.$locale();if(!this.isValid())return A.invalidDate||m;var I=F||"YYYY-MM-DDTHH:mm:ssZ",P=R.z(this),L=this.$H,U=this.$m,z=this.$M,X=A.weekdays,K=A.months,Q=A.meridiem,G=function(tt,mt,_t,Ct){return tt&&(tt[mt]||tt(q,I))||_t[mt].slice(0,Ct)},rt=function(tt){return R.s(L%12||12,tt,"0")},Z=Q||function(tt,mt,_t){var Ct=tt<12?"AM":"PM";return _t?Ct.toLowerCase():Ct};return I.replace(x,(function(tt,mt){return mt||(function(_t){switch(_t){case"YY":return String(q.$y).slice(-2);case"YYYY":return R.s(q.$y,4,"0");case"M":return z+1;case"MM":return R.s(z+1,2,"0");case"MMM":return G(A.monthsShort,z,K,3);case"MMMM":return G(K,z);case"D":return q.$D;case"DD":return R.s(q.$D,2,"0");case"d":return String(q.$W);case"dd":return G(A.weekdaysMin,q.$W,X,2);case"ddd":return G(A.weekdaysShort,q.$W,X,3);case"dddd":return X[q.$W];case"H":return String(L);case"HH":return R.s(L,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return Z(L,U,!0);case"A":return Z(L,U,!1);case"m":return String(U);case"mm":return R.s(U,2,"0");case"s":return String(q.$s);case"ss":return R.s(q.$s,2,"0");case"SSS":return R.s(q.$ms,3,"0");case"Z":return P}return null})(tt)||P.replace(":","")}))},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(F,q,A){var I,P=this,L=R.p(q),U=O(F),z=(U.utcOffset()-this.utcOffset())*i,X=this-U,K=function(){return R.m(P,U)};switch(L){case u:I=K()/12;break;case d:I=K();break;case f:I=K()/3;break;case h:I=(X-z)/6048e5;break;case c:I=(X-z)/864e5;break;case l:I=X/o;break;case a:I=X/i;break;case n:I=X/r;break;default:I=X}return A?I:R.a(I)},$.daysInMonth=function(){return this.endOf(d).$D},$.$locale=function(){return B[this.$L]},$.locale=function(F,q){if(!F)return this.$L;var A=this.clone(),I=D(F,q,!0);return I&&(A.$L=I),A},$.clone=function(){return R.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},N})(),j=W.prototype;return O.prototype=j,[["$ms",s],["$s",n],["$m",a],["$H",l],["$W",c],["$M",d],["$y",u],["$D",g]].forEach((function(N){j[N[1]]=function($){return this.$g($,N[0],N[1])}})),O.extend=function(N,$){return N.$i||(N($,W,O),N.$i=!0),O},O.locale=D,O.isDayjs=_,O.unix=function(N){return O(1e3*N)},O.en=B[T],O.Ls=B,O.p={},O}))})(_s)),_s.exports}var G1=U1();const Uu=Mu(G1);var or={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")},Xl=p(function(e="fatal"){let t=or.fatal;typeof e=="string"?e.toLowerCase()in or&&(t=or[e]):typeof e=="number"&&(t=e),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},t<=or.fatal&&(V.fatal=console.error?console.error.bind(console,Se("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Se("FATAL"))),t<=or.error&&(V.error=console.error?console.error.bind(console,Se("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Se("ERROR"))),t<=or.warn&&(V.warn=console.warn?console.warn.bind(console,Se("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Se("WARN"))),t<=or.info&&(V.info=console.info?console.info.bind(console,Se("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Se("INFO"))),t<=or.debug&&(V.debug=console.debug?console.debug.bind(console,Se("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Se("DEBUG"))),t<=or.trace&&(V.trace=console.debug?console.debug.bind(console,Se("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Se("TRACE")))},"setLogLevel"),Se=p(e=>`%c${Uu().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),n=(o+s)/2;if(i==="l")return n*100;if(o===s)return 0;const a=o-s,l=n>.5?a/(2-o-s):a/(o+s);if(i==="s")return l*100;switch(o){case e:return((t-r)/a+(t<r?6:0))*60;case t:return((r-e)/a+2)*60;case r:return((e-t)/a+4)*60;default:return-1}}},X1={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},V1={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},pt={channel:Bs,lang:X1,unit:V1},br={};for(let e=0;e<=255;e++)br[e]=pt.unit.dec2hex(e);const oe={ALL:0,RGB:1,HSL:2};class K1{constructor(){this.type=oe.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=oe.ALL}is(t){return this.type===t}}class Z1{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new K1}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=oe.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=pt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=pt.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=pt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=pt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=pt.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=pt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(oe.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(oe.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(oe.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(oe.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(oe.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(oe.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(oe.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(oe.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(oe.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(oe.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(oe.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(oe.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const vn=new Z1({r:0,g:0,b:0,a:0},"transparent"),ki={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ki.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,n=o>4,a=n?1:17,l=n?8:4,c=s?0:-1,h=n?255:15;return vn.set({r:(i>>l*(c+3)&h)*a,g:(i>>l*(c+2)&h)*a,b:(i>>l*(c+1)&h)*a,a:s?(i&h)*a/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${br[Math.round(t)]}${br[Math.round(r)]}${br[Math.round(i)]}${br[Math.round(o*255)]}`:`#${br[Math.round(t)]}${br[Math.round(r)]}${br[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 pt.channel.clamp.h(parseFloat(r)*.9);case"rad":return pt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return pt.channel.clamp.h(parseFloat(r)*360)}}return pt.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,n,a]=r;return vn.set({h:Hr._hue2deg(i),s:pt.channel.clamp.s(parseFloat(o)),l:pt.channel.clamp.l(parseFloat(s)),a:n?pt.channel.clamp.a(a?parseFloat(n)/100:parseFloat(n)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${pt.lang.round(t)}, ${pt.lang.round(r)}%, ${pt.lang.round(i)}%, ${o})`:`hsl(${pt.lang.round(t)}, ${pt.lang.round(r)}%, ${pt.lang.round(i)}%)`}},Fo={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=Fo.colors[e];if(t)return ki.parse(t)},stringify:e=>{const t=ki.stringify(e);for(const r in Fo.colors)if(Fo.colors[r]===t)return r}},ko={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(ko.re);if(!r)return;const[,i,o,s,n,a,l,c,h]=r;return vn.set({r:pt.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:pt.channel.clamp.g(n?parseFloat(s)*2.55:parseFloat(s)),b:pt.channel.clamp.b(l?parseFloat(a)*2.55:parseFloat(a)),a:c?pt.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(${pt.lang.round(t)}, ${pt.lang.round(r)}, ${pt.lang.round(i)}, ${pt.lang.round(o)})`:`rgb(${pt.lang.round(t)}, ${pt.lang.round(r)}, ${pt.lang.round(i)})`}},Ne={format:{keyword:Fo,hex:ki,rgb:ko,rgba:ko,hsl:Hr,hsla:Hr},parse:e=>{if(typeof e!="string")return e;const t=ki.parse(e)||ko.parse(e)||Hr.parse(e)||Fo.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(oe.HSL)||e.data.r===void 0?Hr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?ko.stringify(e):ki.stringify(e)},Gu=(e,t)=>{const r=Ne.parse(e);for(const i in t)r[i]=pt.channel.clamp[i](t[i]);return Ne.stringify(r)},cr=(e,t,r=0,i=1)=>{if(typeof e!="number")return Gu(e,{a:t});const o=vn.set({r:pt.channel.clamp.r(e),g:pt.channel.clamp.g(t),b:pt.channel.clamp.b(r),a:pt.channel.clamp.a(i)});return Ne.stringify(o)},Q1=e=>{const{r:t,g:r,b:i}=Ne.parse(e),o=.2126*pt.channel.toLinear(t)+.7152*pt.channel.toLinear(r)+.0722*pt.channel.toLinear(i);return pt.lang.round(o)},J1=e=>Q1(e)>=.5,Le=e=>!J1(e),Vl=(e,t,r)=>{const i=Ne.parse(e),o=i[t],s=pt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Ne.stringify(i)},H=(e,t)=>Vl(e,"l",t),Y=(e,t)=>Vl(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 Gu(e,i)},tk=(e,t,r=50)=>{const{r:i,g:o,b:s,a:n}=Ne.parse(e),{r:a,g:l,b:c,a:h}=Ne.parse(t),d=r/100,f=d*2-1,u=n-h,m=((f*u===-1?f:(f+u)/(1+f*u))+1)/2,y=1-m,x=i*m+a*y,C=o*m+l*y,w=s*m+c*y,S=n*d+h*(1-d);return cr(x,C,w,S)},M=(e,t=100)=>{const r=Ne.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,tk(r,e,t)};var Na=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=>Na(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]=Na(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),Ut=Na,Qe="#ffffff",Je="#f2f2f2",gt=p((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),Ti,ek=(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||gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||gt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||gt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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||Y(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10)):(this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(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]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=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.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je,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),rk=p(e=>{const t=new ek;return t.calculate(e),t},"getThemeVariables"),vi,ik=(vi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.lineColor=M(this.background),this.textColor=M(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(M("#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=Y("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Y(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||H(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(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=H(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=H(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=H(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=M(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]||M(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||H(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)]??H(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=H(this.secondaryColor,20),this.git1=H(this.pie2||this.secondaryColor,20),this.git2=H(this.pie3||this.tertiaryColor,20),this.git3=H(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=H(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=H(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=H(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=H(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||M(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||M(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||H("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||H("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||H("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||H("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||H(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||H(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||H(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||H(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(vi,"Theme"),vi),ok=p(e=>{const t=new ik;return t.calculate(e),t},"getThemeVariables"),_i,sk=(_i=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=gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.lineColor=M(this.background),this.textColor=M(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=gt(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||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(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||M(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||M(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||H(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||H(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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=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.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||Y(M(this.git0),25),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||M(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je}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(_i,"Theme"),_i),Xu=p(e=>{const t=new sk;return t.calculate(e),t},"getThemeVariables"),Bi,nk=(Bi=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=H("#cde498",10),this.primaryBorderColor=gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.primaryColor),this.lineColor=M(this.background),this.textColor=M(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=Y(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||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(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||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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=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.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||M(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je}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(Bi,"Theme"),Bi),ak=p(e=>{const t=new nk;return t.calculate(e),t},"getThemeVariables"),Li,lk=(Li=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=H(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.lineColor=M(this.background),this.textColor=M(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||H(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=H(this.contrast,55),this.border2=this.contrast,this.actorBorder=H(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]||M(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||Y(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=H(this.contrast,30),this.sectionBkgColor2=H(this.contrast,30),this.taskBorderColor=Y(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=H(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Y(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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=Y(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||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je}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),hk=p(e=>{const t=new lk;return t.calculate(e),t},"getThemeVariables"),Ei,ck=(Ei=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=gt(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||gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||gt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||gt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||M(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=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.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je}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),dk=p(e=>{const t=new ck;return t.calculate(e),t},"getThemeVariables"),Fi,uk=(Fi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(M("#323D47"),10),this.border1="#ccc",this.border2=cr(255,255,255,.25),this.arrowheadColor=M(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||gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||gt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||gt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=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.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je}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),fk=p(e=>{const t=new uk;return t.calculate(e),t},"getThemeVariables"),Ai,gk=(Ai=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=gt("#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||gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||gt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||gt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||M(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=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.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je}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),pk=p(e=>{const t=new gk;return t.calculate(e),t},"getThemeVariables"),Mi,mk=(Mi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(M("#323D47"),10),this.border1="#ccc",this.border2=cr(255,255,255,.25),this.arrowheadColor=M(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||gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||gt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||gt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=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.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je}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),yk=p(e=>{const t=new mk;return t.calculate(e),t},"getThemeVariables"),Oi,xk=(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=gt(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||gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||gt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||gt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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]||M(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=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.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je}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),Ck=p(e=>{const t=new xk;return t.calculate(e),t},"getThemeVariables"),$i,bk=($i=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(M("#323D47"),10),this.border1="#ccc",this.border2=cr(255,255,255,.25),this.arrowheadColor=M(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||gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||gt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||gt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=Y(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||Le(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=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.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||Qe,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je}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),kk=p(e=>{const t=new bk;return t.calculate(e),t},"getThemeVariables"),dr={base:{getThemeVariables:rk},dark:{getThemeVariables:ok},default:{getThemeVariables:Xu},forest:{getThemeVariables:ak},neutral:{getThemeVariables:hk},neo:{getThemeVariables:dk},"neo-dark":{getThemeVariables:fk},redux:{getThemeVariables:pk},"redux-dark":{getThemeVariables:yk},"redux-color":{getThemeVariables:Ck},"redux-dark-color":{getThemeVariables:kk}},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},Vu={...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}},Ku=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Ku(e[i],"")]:[...r,t+i],[]),"keyify"),wk=new Set(Ku(Vu,"")),Kl=Vu,Sk={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Tk=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"),js=p(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>js(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!wk.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=Sk[t];i?Tk(e[t],i):(V.debug("sanitizing object",t),js(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=Zu(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"),Zu=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"),qi=Object.freeze(Kl),tr=p(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),me=Ut({},qi),Ws,Zr=[],Ao=Ut({},qi),_n=p((e,t)=>{let r=Ut({},e),i={};for(const o of t)tf(o),i=Ut(i,o);if(r=Ut(r,i),i.theme&&i.theme in dr){const o=Ut({},Ws),s=Ut(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in dr&&(r.themeVariables=dr[r.theme].getThemeVariables(s))}return Ao=r,rf(Ao),Ao},"updateCurrentConfig"),vk=p(e=>(me=Ut({},qi),me=Ut(me,e),e.theme&&dr[e.theme]&&(me.themeVariables=dr[e.theme].getThemeVariables(e.themeVariables)),_n(me,Zr),me),"setSiteConfig"),_k=p(e=>{Ws=Ut({},e)},"saveConfigFromInitialize"),Bk=p(e=>(me=Ut(me,e),_n(me,Zr),me),"updateSiteConfig"),Qu=p(()=>Ut({},me),"getSiteConfig"),Ju=p(e=>(rf(e),Ut(Ao,e),Rt()),"setConfig"),Rt=p(()=>Ut({},Ao),"getConfig"),tf=p(e=>{e&&(["secure",...me.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"&&tf(e[t])}))},"sanitize"),Lk=p(e=>{js(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Zr.push(e),_n(me,Zr)},"addDirective"),Hs=p((e=me)=>{Zr=[],_n(e,Zr)},"reset"),Ek={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."},Dc={},ef=p(e=>{Dc[e]||(V.warn(Ek[e]),Dc[e]=!0)},"issueWarning"),rf=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&ef("LAZY_LOAD_DEPRECATED")},"checkConfig"),Fk=p(()=>{let e={};Ws&&(e=Ut(e,Ws));for(const t of Zr)e=Ut(e,t);return e},"getUserDefinedConfig"),ae=p(e=>(e.flowchart?.htmlLabels!=null&&ef("FLOWCHART_HTML_LABELS_DEPRECATED"),tr(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),of=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Mo=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Ak=/\s*%%.*\n/gm,Ri,sf=(Ri=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(Ri,"UnknownDiagramError"),Ri),Qr={},Zl=p(function(e,t){e=e.replace(of,"").replace(Mo,"").replace(Ak,`
8
+ `);for(const[r,{detector:i}]of Object.entries(Qr))if(i(e,t))return r;throw new sf(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),qa=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)nf(t,r,i)},"registerLazyLoadedDiagrams"),nf=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"),Mk=p(e=>Qr[e].loader,"getDiagramLoader"),Ki=/<br\s*\/?>/gi,Ok=p(e=>e?hf(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),$k=(()=>{let e=!1;return()=>{e||(af(),e=!0)}})();function af(){const e="data-temp-href-target";Ni.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Ni.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(af,"setupDompurifyHooks");var lf=p(e=>($k(),Ni.sanitize(e)),"removeScript"),Nc=p((e,t)=>{if(ae(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=lf(e):r!=="loose"&&(e=hf(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=Dk(e))}return e},"sanitizeMore"),_e=p((e,t)=>e&&(t.dompurifyConfig?e=Ni.sanitize(Nc(e,t),t.dompurifyConfig).toString():e=Ni.sanitize(Nc(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),Rk=p((e,t)=>typeof e=="string"?_e(e,t):e.flat().map(r=>_e(r,t)),"sanitizeTextOrArray"),Ik=p(e=>Ki.test(e),"hasBreaks"),Pk=p(e=>e.split(Ki),"splitBreaks"),Dk=p(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),hf=p(e=>e.replace(Ki,"#br#"),"breakToPlaceholder"),cf=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"),Nk=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),qk=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),za=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],n=t[i+1];zk(s,n)&&(o=s+","+n,i++,r.pop())}r.push(jk(o))}return r.join("")},"parseGenericTypes"),ja=p((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),zk=p((e,t)=>{const r=ja(e,"~"),i=ja(t,"~");return r===1&&i===1},"shouldCombineSets"),jk=p(e=>{const t=ja(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"),qc=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Wa=/\$\$(.*?)\$\$/g,zi=p(e=>(e.match(Wa)?.length??0)>0,"hasKatex"),Wk=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Ql(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"),Hk=p(async(e,t)=>{if(!zi(e))return e;if(!(qc()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Wa,"MathML is unsupported in this environment.");{const{default:r}=await import("katex"),i=t.forceLegacyMathML||!qc()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Ki).map(o=>zi(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(Wa,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Ql=p(async(e,t)=>_e(await Hk(e,t),t),"renderKatexSanitized"),Zi={getRows:Ok,sanitizeText:_e,sanitizeTextOrArray:Rk,hasBreaks:Ik,splitBreaks:Pk,lineBreakRegex:Ki,removeScript:lf,getUrl:cf,evaluate:tr,getMax:Nk,getMin:qk},Yk=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Uk=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"),Jl=p(function(e,t,r,i){const o=Uk(t,r,i);Yk(e,o)},"configureSvgSize"),df=p(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,n=o.height;V.info(`SVG bounds: ${s}x${n}`,o);let a=0,l=0;V.info(`Graph bounds: ${a}x${l}`,e),a=s+r*2,l=n+r*2,V.info(`Calculated bounds: ${a}x${l}`),Jl(t,l,a,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),Ls={};function Ha(e){return[...e.cssRules].map(t=>t.cssText).join(`
9
+ `)}p(Ha,"cssStyleSheetToString");var Gk=p((e,t,r,i)=>{let o="";return e in Ls&&Ls[e]?o=Ls[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"),Xk=p((e,t)=>{t!==void 0&&(Ls[e]=t)},"addStylesForDiagram"),Vk=Gk,th={};Yu(th,{clear:()=>uf,getAccDescription:()=>mf,getAccTitle:()=>gf,getDiagramTitle:()=>xf,setAccDescription:()=>pf,setAccTitle:()=>ff,setDiagramTitle:()=>yf});var eh="",rh="",ih="",oh=p(e=>_e(e,Rt()),"sanitizeText"),uf=p(()=>{eh="",ih="",rh=""},"clear"),ff=p(e=>{eh=oh(e).replace(/^\s+/g,"")},"setAccTitle"),gf=p(()=>eh,"getAccTitle"),pf=p(e=>{ih=oh(e).replace(/\n\s+/g,`
131
+ `)},"setAccDescription"),mf=p(()=>ih,"getAccDescription"),yf=p(e=>{rh=oh(e)},"setDiagramTitle"),xf=p(()=>rh,"getDiagramTitle"),zc=V,Kk=Xl,wt=Rt,Zk=Ju,Qk=qi,sh=p(e=>_e(e,wt()),"sanitizeText"),Cf=df,Jk=p(()=>th,"getCommonDb"),Ys={},Us=p((e,t,r)=>{Ys[e]&&zc.warn(`Diagram with id ${e} already registered. Overwriting.`),Ys[e]=t,r&&nf(e,r),Xk(e,t.styles),t.injectUtils?.(zc,Kk,wt,sh,Cf,Jk(),()=>{})},"registerDiagram"),Ya=p(e=>{if(e in Ys)return Ys[e];throw new t2(e)},"getDiagram"),Ii,t2=(Ii=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},p(Ii,"DiagramNotFoundError"),Ii),e2={value:()=>{}};function bf(){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 Es(r)}function Es(e){this._=e}function r2(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}})}Es.prototype=bf.prototype={constructor:Es,on:function(e,t){var r=this._,i=r2(e+"",r),o,s=-1,n=i.length;if(arguments.length<2){for(;++s<n;)if((o=(e=i[s]).type)&&(o=i2(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<n;)if(o=(e=i[s]).type)r[o]=jc(r[o],e.name,t);else if(t==null)for(o in r)r[o]=jc(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 Es(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 i2(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function jc(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=e2,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Ua="http://www.w3.org/1999/xhtml";const Wc={svg:"http://www.w3.org/2000/svg",xhtml:Ua,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bn(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Wc.hasOwnProperty(t)?{space:Wc[t],local:e}:e}function o2(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Ua&&t.documentElement.namespaceURI===Ua?t.createElement(e):t.createElementNS(r,e)}}function s2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function kf(e){var t=Bn(e);return(t.local?s2:o2)(t)}function n2(){}function nh(e){return e==null?n2:function(){return this.querySelector(e)}}function a2(e){typeof e!="function"&&(e=nh(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],n=s.length,a=i[o]=new Array(n),l,c,h=0;h<n;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),a[h]=c);return new ke(i,this._parents)}function l2(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function h2(){return[]}function wf(e){return e==null?h2:function(){return this.querySelectorAll(e)}}function c2(e){return function(){return l2(e.apply(this,arguments))}}function d2(e){typeof e=="function"?e=c2(e):e=wf(e);for(var t=this._groups,r=t.length,i=[],o=[],s=0;s<r;++s)for(var n=t[s],a=n.length,l,c=0;c<a;++c)(l=n[c])&&(i.push(e.call(l,l.__data__,c,n)),o.push(l));return new ke(i,o)}function Sf(e){return function(){return this.matches(e)}}function Tf(e){return function(t){return t.matches(e)}}var u2=Array.prototype.find;function f2(e){return function(){return u2.call(this.children,e)}}function g2(){return this.firstElementChild}function p2(e){return this.select(e==null?g2:f2(typeof e=="function"?e:Tf(e)))}var m2=Array.prototype.filter;function y2(){return Array.from(this.children)}function x2(e){return function(){return m2.call(this.children,e)}}function C2(e){return this.selectAll(e==null?y2:x2(typeof e=="function"?e:Tf(e)))}function b2(e){typeof e!="function"&&(e=Sf(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],n=s.length,a=i[o]=[],l,c=0;c<n;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&a.push(l);return new ke(i,this._parents)}function vf(e){return new Array(e.length)}function k2(){return new ke(this._enter||this._groups.map(vf),this._parents)}function Gs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gs.prototype={constructor:Gs,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 w2(e){return function(){return e}}function S2(e,t,r,i,o,s){for(var n=0,a,l=t.length,c=s.length;n<c;++n)(a=t[n])?(a.__data__=s[n],i[n]=a):r[n]=new Gs(e,s[n]);for(;n<l;++n)(a=t[n])&&(o[n]=a)}function T2(e,t,r,i,o,s,n){var a,l,c=new Map,h=t.length,d=s.length,f=new Array(h),u;for(a=0;a<h;++a)(l=t[a])&&(f[a]=u=n.call(l,l.__data__,a,t)+"",c.has(u)?o[a]=l:c.set(u,l));for(a=0;a<d;++a)u=n.call(e,s[a],a,s)+"",(l=c.get(u))?(i[a]=l,l.__data__=s[a],c.delete(u)):r[a]=new Gs(e,s[a]);for(a=0;a<h;++a)(l=t[a])&&c.get(f[a])===l&&(o[a]=l)}function v2(e){return e.__data__}function _2(e,t){if(!arguments.length)return Array.from(this,v2);var r=t?T2:S2,i=this._parents,o=this._groups;typeof e!="function"&&(e=w2(e));for(var s=o.length,n=new Array(s),a=new Array(s),l=new Array(s),c=0;c<s;++c){var h=i[c],d=o[c],f=d.length,u=B2(e.call(h,h&&h.__data__,c,i)),g=u.length,m=a[c]=new Array(g),y=n[c]=new Array(g),x=l[c]=new Array(f);r(h,d,m,y,x,u,t);for(var C=0,w=0,S,T;C<g;++C)if(S=m[C]){for(C>=w&&(w=C+1);!(T=y[w])&&++w<g;);S._next=T||null}}return n=new ke(n,i),n._enter=a,n._exit=l,n}function B2(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function L2(){return new ke(this._exit||this._groups.map(vf),this._parents)}function E2(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 F2(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,s=i.length,n=Math.min(o,s),a=new Array(o),l=0;l<n;++l)for(var c=r[l],h=i[l],d=c.length,f=a[l]=new Array(d),u,g=0;g<d;++g)(u=c[g]||h[g])&&(f[g]=u);for(;l<o;++l)a[l]=r[l];return new ke(a,this._parents)}function A2(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,s=i[o],n;--o>=0;)(n=i[o])&&(s&&n.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(n,s),s=n);return this}function M2(e){e||(e=O2);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 n=r[s],a=n.length,l=o[s]=new Array(a),c,h=0;h<a;++h)(c=n[h])&&(l[h]=c);l.sort(t)}return new ke(o,this._parents).order()}function O2(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function $2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function R2(){return Array.from(this)}function I2(){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 n=i[o];if(n)return n}return null}function P2(){let e=0;for(const t of this)++e;return e}function D2(){return!this.node()}function N2(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],s=0,n=o.length,a;s<n;++s)(a=o[s])&&e.call(a,a.__data__,s,o);return this}function q2(e){return function(){this.removeAttribute(e)}}function z2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function j2(e,t){return function(){this.setAttribute(e,t)}}function W2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function H2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Y2(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 U2(e,t){var r=Bn(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?z2:q2:typeof t=="function"?r.local?Y2:H2:r.local?W2:j2)(r,t))}function _f(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function G2(e){return function(){this.style.removeProperty(e)}}function X2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function V2(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function K2(e,t,r){return arguments.length>1?this.each((t==null?G2:typeof t=="function"?V2:X2)(e,t,r??"")):ji(this.node(),e)}function ji(e,t){return e.style.getPropertyValue(t)||_f(e).getComputedStyle(e,null).getPropertyValue(t)}function Z2(e){return function(){delete this[e]}}function Q2(e,t){return function(){this[e]=t}}function J2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function tw(e,t){return arguments.length>1?this.each((t==null?Z2:typeof t=="function"?J2:Q2)(e,t)):this.node()[e]}function Bf(e){return e.trim().split(/^|\s+/)}function ah(e){return e.classList||new Lf(e)}function Lf(e){this._node=e,this._names=Bf(e.getAttribute("class")||"")}Lf.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 Ef(e,t){for(var r=ah(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function Ff(e,t){for(var r=ah(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function ew(e){return function(){Ef(this,e)}}function rw(e){return function(){Ff(this,e)}}function iw(e,t){return function(){(t.apply(this,arguments)?Ef:Ff)(this,e)}}function ow(e,t){var r=Bf(e+"");if(arguments.length<2){for(var i=ah(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?iw:t?ew:rw)(r,t))}function sw(){this.textContent=""}function nw(e){return function(){this.textContent=e}}function aw(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function lw(e){return arguments.length?this.each(e==null?sw:(typeof e=="function"?aw:nw)(e)):this.node().textContent}function hw(){this.innerHTML=""}function cw(e){return function(){this.innerHTML=e}}function dw(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function uw(e){return arguments.length?this.each(e==null?hw:(typeof e=="function"?dw:cw)(e)):this.node().innerHTML}function fw(){this.nextSibling&&this.parentNode.appendChild(this)}function gw(){return this.each(fw)}function pw(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mw(){return this.each(pw)}function yw(e){var t=typeof e=="function"?e:kf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function xw(){return null}function Cw(e,t){var r=typeof e=="function"?e:kf(e),i=t==null?xw:typeof t=="function"?t:nh(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function bw(){var e=this.parentNode;e&&e.removeChild(this)}function kw(){return this.each(bw)}function ww(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Sw(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Tw(e){return this.select(e?Sw:ww)}function vw(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _w(e){return function(t){e.call(this,t,this.__data__)}}function Bw(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 Lw(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 Ew(e,t,r){return function(){var i=this.__on,o,s=_w(t);if(i){for(var n=0,a=i.length;n<a;++n)if((o=i[n]).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 Fw(e,t,r){var i=Bw(e+""),o,s=i.length,n;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,h;l<c;++l)for(o=0,h=a[l];o<s;++o)if((n=i[o]).type===h.type&&n.name===h.name)return h.value}return}for(a=t?Ew:Lw,o=0;o<s;++o)this.each(a(i[o],t,r));return this}function Af(e,t,r){var i=_f(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 Aw(e,t){return function(){return Af(this,e,t)}}function Mw(e,t){return function(){return Af(this,e,t.apply(this,arguments))}}function Ow(e,t){return this.each((typeof t=="function"?Mw:Aw)(e,t))}function*$w(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,n;o<s;++o)(n=i[o])&&(yield n)}var Mf=[null];function ke(e,t){this._groups=e,this._parents=t}function ts(){return new ke([[document.documentElement]],Mf)}function Rw(){return this}ke.prototype=ts.prototype={constructor:ke,select:a2,selectAll:d2,selectChild:p2,selectChildren:C2,filter:b2,data:_2,enter:k2,exit:L2,join:E2,merge:F2,selection:Rw,order:A2,sort:M2,call:$2,nodes:R2,node:I2,size:P2,empty:D2,each:N2,attr:U2,style:K2,property:tw,classed:ow,text:lw,html:uw,raise:gw,lower:mw,append:yw,insert:Cw,remove:kw,clone:Tw,datum:vw,on:Fw,dispatch:Ow,[Symbol.iterator]:$w};function yt(e){return typeof e=="string"?new ke([[document.querySelector(e)]],[document.documentElement]):new ke([[e]],Mf)}function Ln(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function lh(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Qi(){}var qo=.7,Xs=1/qo,wi="\\s*([+-]?\\d+)\\s*",zo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ve="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Iw=/^#([0-9a-f]{3,8})$/,Pw=new RegExp(`^rgb\\(${wi},${wi},${wi}\\)$`),Dw=new RegExp(`^rgb\\(${Ve},${Ve},${Ve}\\)$`),Nw=new RegExp(`^rgba\\(${wi},${wi},${wi},${zo}\\)$`),qw=new RegExp(`^rgba\\(${Ve},${Ve},${Ve},${zo}\\)$`),zw=new RegExp(`^hsl\\(${zo},${Ve},${Ve}\\)$`),jw=new RegExp(`^hsla\\(${zo},${Ve},${Ve},${zo}\\)$`),Hc={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};Ln(Qi,Wi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Yc,formatHex:Yc,formatHex8:Ww,formatHsl:Hw,formatRgb:Uc,toString:Uc});function Yc(){return this.rgb().formatHex()}function Ww(){return this.rgb().formatHex8()}function Hw(){return $f(this).formatHsl()}function Uc(){return this.rgb().formatRgb()}function Wi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Iw.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Gc(t):r===3?new ce(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?us(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?us(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=Pw.exec(e))?new ce(t[1],t[2],t[3],1):(t=Dw.exec(e))?new ce(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nw.exec(e))?us(t[1],t[2],t[3],t[4]):(t=qw.exec(e))?us(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zw.exec(e))?Kc(t[1],t[2]/100,t[3]/100,1):(t=jw.exec(e))?Kc(t[1],t[2]/100,t[3]/100,t[4]):Hc.hasOwnProperty(e)?Gc(Hc[e]):e==="transparent"?new ce(NaN,NaN,NaN,0):null}function Gc(e){return new ce(e>>16&255,e>>8&255,e&255,1)}function us(e,t,r,i){return i<=0&&(e=t=r=NaN),new ce(e,t,r,i)}function Of(e){return e instanceof Qi||(e=Wi(e)),e?(e=e.rgb(),new ce(e.r,e.g,e.b,e.opacity)):new ce}function Ga(e,t,r,i){return arguments.length===1?Of(e):new ce(e,t,r,i??1)}function ce(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}Ln(ce,Ga,lh(Qi,{brighter(e){return e=e==null?Xs:Math.pow(Xs,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?qo:Math.pow(qo,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ce(Xr(this.r),Xr(this.g),Xr(this.b),Vs(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:Xc,formatHex:Xc,formatHex8:Yw,formatRgb:Vc,toString:Vc}));function Xc(){return`#${Yr(this.r)}${Yr(this.g)}${Yr(this.b)}`}function Yw(){return`#${Yr(this.r)}${Yr(this.g)}${Yr(this.b)}${Yr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vc(){const e=Vs(this.opacity);return`${e===1?"rgb(":"rgba("}${Xr(this.r)}, ${Xr(this.g)}, ${Xr(this.b)}${e===1?")":`, ${e})`}`}function Vs(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 Kc(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 $f(e){if(e instanceof Ie)return new Ie(e.h,e.s,e.l,e.opacity);if(e instanceof Qi||(e=Wi(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),n=NaN,a=s-o,l=(s+o)/2;return a?(t===s?n=(r-i)/a+(r<i)*6:r===s?n=(i-t)/a+2:n=(t-r)/a+4,a/=l<.5?s+o:2-s-o,n*=60):a=l>0&&l<1?0:n,new Ie(n,a,l,e.opacity)}function Uw(e,t,r,i){return arguments.length===1?$f(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}Ln(Ie,Uw,lh(Qi,{brighter(e){return e=e==null?Xs:Math.pow(Xs,e),new Ie(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?qo:Math.pow(qo,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 ce(ua(e>=240?e-240:e+120,o,i),ua(e,o,i),ua(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Ie(Zc(this.h),fs(this.s),fs(this.l),Vs(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=Vs(this.opacity);return`${e===1?"hsl(":"hsla("}${Zc(this.h)}, ${fs(this.s)*100}%, ${fs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Zc(e){return e=(e||0)%360,e<0?e+360:e}function fs(e){return Math.max(0,Math.min(1,e||0))}function ua(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 En=e=>()=>e;function Rf(e,t){return function(r){return e+r*t}}function Gw(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 Xw(e,t){var r=t-e;return r?Rf(e,r>180||r<-180?r-360*Math.round(r/360):r):En(isNaN(e)?t:e)}function Vw(e){return(e=+e)==1?hh:function(t,r){return r-t?Gw(t,r,e):En(isNaN(t)?r:t)}}function hh(e,t){var r=t-e;return r?Rf(e,r):En(isNaN(e)?t:e)}const Xa=(function e(t){var r=Vw(t);function i(o,s){var n=r((o=Ga(o)).r,(s=Ga(s)).r),a=r(o.g,s.g),l=r(o.b,s.b),c=hh(o.opacity,s.opacity);return function(h){return o.r=n(h),o.g=a(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function lr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Va=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fa=new RegExp(Va.source,"g");function Kw(e){return function(){return e}}function Zw(e){return function(t){return e(t)+""}}function If(e,t){var r=Va.lastIndex=fa.lastIndex=0,i,o,s,n=-1,a=[],l=[];for(e=e+"",t=t+"";(i=Va.exec(e))&&(o=fa.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),a[n]?a[n]+=s:a[++n]=s),(i=i[0])===(o=o[0])?a[n]?a[n]+=o:a[++n]=o:(a[++n]=null,l.push({i:n,x:lr(i,o)})),r=fa.lastIndex;return r<t.length&&(s=t.slice(r),a[n]?a[n]+=s:a[++n]=s),a.length<2?l[0]?Zw(l[0].x):Kw(t):(t=l.length,function(c){for(var h=0,d;h<t;++h)a[(d=l[h]).i]=d.x(c);return a.join("")})}var Qc=180/Math.PI,Ka={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pf(e,t,r,i,o,s){var n,a,l;return(n=Math.sqrt(e*e+t*t))&&(e/=n,t/=n),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(a=Math.sqrt(r*r+i*i))&&(r/=a,i/=a,l/=a),e*i<t*r&&(e=-e,t=-t,l=-l,n=-n),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*Qc,skewX:Math.atan(l)*Qc,scaleX:n,scaleY:a}}var gs;function Qw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ka:Pf(t.a,t.b,t.c,t.d,t.e,t.f)}function Jw(e){return e==null||(gs||(gs=document.createElementNS("http://www.w3.org/2000/svg","g")),gs.setAttribute("transform",e),!(e=gs.transform.baseVal.consolidate()))?Ka:(e=e.matrix,Pf(e.a,e.b,e.c,e.d,e.e,e.f))}function Df(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:lr(c,d)},{i:m-2,x:lr(h,f)})}else(d||f)&&u.push("translate("+d+t+f+r)}function n(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:lr(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function a(c,h,d,f){c!==h?f.push({i:d.push(o(d)+"skewX(",null,i)-2,x:lr(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:lr(c,d)},{i:m-2,x:lr(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),n(c.rotate,h.rotate,d,f),a(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 tS=Df(Qw,"px, ","px)","deg)"),eS=Df(Jw,", ",")",")"),Hi=0,wo=0,co=0,Nf=1e3,Ks,So,Zs=0,Jr=0,Fn=0,jo=typeof performance=="object"&&performance.now?performance:Date,qf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ch(){return Jr||(qf(rS),Jr=jo.now()+Fn)}function rS(){Jr=0}function Qs(){this._call=this._time=this._next=null}Qs.prototype=zf.prototype={constructor:Qs,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?ch():+r)+(t==null?0:+t),!this._next&&So!==this&&(So?So._next=this:Ks=this,So=this),this._call=e,this._time=r,Za()},stop:function(){this._call&&(this._call=null,this._time=1/0,Za())}};function zf(e,t,r){var i=new Qs;return i.restart(e,t,r),i}function iS(){ch(),++Hi;for(var e=Ks,t;e;)(t=Jr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Hi}function Jc(){Jr=(Zs=jo.now())+Fn,Hi=wo=0;try{iS()}finally{Hi=0,sS(),Jr=0}}function oS(){var e=jo.now(),t=e-Zs;t>Nf&&(Fn-=t,Zs=e)}function sS(){for(var e,t=Ks,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:Ks=r);So=e,Za(i)}function Za(e){if(!Hi){wo&&(wo=clearTimeout(wo));var t=e-Jr;t>24?(e<1/0&&(wo=setTimeout(Jc,e-jo.now()-Fn)),co&&(co=clearInterval(co))):(co||(Zs=jo.now(),co=setInterval(oS,Nf)),Hi=1,qf(Jc))}}function td(e,t,r){var i=new Qs;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var nS=bf("start","end","cancel","interrupt"),aS=[],jf=0,ed=1,Qa=2,Fs=3,rd=4,Ja=5,As=6;function An(e,t,r,i,o,s){var n=e.__transition;if(!n)e.__transition={};else if(r in n)return;lS(e,r,{name:t,index:i,group:o,on:nS,tween:aS,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:jf})}function dh(e,t){var r=qe(e,t);if(r.state>jf)throw new Error("too late; already scheduled");return r}function er(e,t){var r=qe(e,t);if(r.state>Fs)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 lS(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=zf(s,0,r.time);function s(c){r.state=ed,r.timer.restart(n,r.delay,r.time),r.delay<=c&&n(c-r.delay)}function n(c){var h,d,f,u;if(r.state!==ed)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===Fs)return td(n);u.state===rd?(u.state=As,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+h<t&&(u.state=As,u.timer.stop(),u.on.call("cancel",e,e.__data__,u.index,u.group),delete i[h])}if(td(function(){r.state===Fs&&(r.state=rd,r.timer.restart(a,r.delay,r.time),a(c))}),r.state=Qa,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Qa){for(r.state=Fs,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 a(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=Ja,1),d=-1,f=o.length;++d<f;)o[d].call(e,h);r.state===Ja&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=As,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function hS(e,t){var r=e.__transition,i,o,s=!0,n;if(r){t=t==null?null:t+"";for(n in r){if((i=r[n]).name!==t){s=!1;continue}o=i.state>Qa&&i.state<Ja,i.state=As,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[n]}s&&delete e.__transition}}function cS(e){return this.each(function(){hS(this,e)})}function dS(e,t){var r,i;return function(){var o=er(this,e),s=o.tween;if(s!==r){i=r=s;for(var n=0,a=i.length;n<a;++n)if(i[n].name===t){i=i.slice(),i.splice(n,1);break}}o.tween=i}}function uS(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=er(this,e),n=s.tween;if(n!==i){o=(i=n).slice();for(var a={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=a;break}l===c&&o.push(a)}s.tween=o}}function fS(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=qe(this.node(),r).tween,o=0,s=i.length,n;o<s;++o)if((n=i[o]).name===e)return n.value;return null}return this.each((t==null?dS:uS)(r,e,t))}function uh(e,t,r){var i=e._id;return e.each(function(){var o=er(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return qe(o,i).value[t]}}function Wf(e,t){var r;return(typeof t=="number"?lr:t instanceof Wi?Xa:(r=Wi(t))?(t=r,Xa):If)(e,t)}function gS(e){return function(){this.removeAttribute(e)}}function pS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mS(e,t,r){var i,o=r+"",s;return function(){var n=this.getAttribute(e);return n===o?null:n===i?s:s=t(i=n,r)}}function yS(e,t,r){var i,o=r+"",s;return function(){var n=this.getAttributeNS(e.space,e.local);return n===o?null:n===i?s:s=t(i=n,r)}}function xS(e,t,r){var i,o,s;return function(){var n,a=r(this),l;return a==null?void this.removeAttribute(e):(n=this.getAttribute(e),l=a+"",n===l?null:n===i&&l===o?s:(o=l,s=t(i=n,a)))}}function CS(e,t,r){var i,o,s;return function(){var n,a=r(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(n=this.getAttributeNS(e.space,e.local),l=a+"",n===l?null:n===i&&l===o?s:(o=l,s=t(i=n,a)))}}function bS(e,t){var r=Bn(e),i=r==="transform"?eS:Wf;return this.attrTween(e,typeof t=="function"?(r.local?CS:xS)(r,i,uh(this,"attr."+e,t)):t==null?(r.local?pS:gS)(r):(r.local?yS:mS)(r,i,t))}function kS(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function wS(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function SS(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&wS(e,s)),r}return o._value=t,o}function TS(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&kS(e,s)),r}return o._value=t,o}function vS(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=Bn(e);return this.tween(r,(i.local?SS:TS)(i,t))}function _S(e,t){return function(){dh(this,e).delay=+t.apply(this,arguments)}}function BS(e,t){return t=+t,function(){dh(this,e).delay=t}}function LS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_S:BS)(t,e)):qe(this.node(),t).delay}function ES(e,t){return function(){er(this,e).duration=+t.apply(this,arguments)}}function FS(e,t){return t=+t,function(){er(this,e).duration=t}}function AS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ES:FS)(t,e)):qe(this.node(),t).duration}function MS(e,t){if(typeof t!="function")throw new Error;return function(){er(this,e).ease=t}}function OS(e){var t=this._id;return arguments.length?this.each(MS(t,e)):qe(this.node(),t).ease}function $S(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;er(this,e).ease=r}}function RS(e){if(typeof e!="function")throw new Error;return this.each($S(this._id,e))}function IS(e){typeof e!="function"&&(e=Sf(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],n=s.length,a=i[o]=[],l,c=0;c<n;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&a.push(l);return new fr(i,this._parents,this._name,this._id)}function PS(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),n=new Array(i),a=0;a<s;++a)for(var l=t[a],c=r[a],h=l.length,d=n[a]=new Array(h),f,u=0;u<h;++u)(f=l[u]||c[u])&&(d[u]=f);for(;a<i;++a)n[a]=t[a];return new fr(n,this._parents,this._name,this._id)}function DS(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 NS(e,t,r){var i,o,s=DS(t)?dh:er;return function(){var n=s(this,e),a=n.on;a!==i&&(o=(i=a).copy()).on(t,r),n.on=o}}function qS(e,t){var r=this._id;return arguments.length<2?qe(this.node(),r).on.on(e):this.each(NS(r,e,t))}function zS(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function jS(){return this.on("end.remove",zS(this._id))}function WS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=nh(e));for(var i=this._groups,o=i.length,s=new Array(o),n=0;n<o;++n)for(var a=i[n],l=a.length,c=s[n]=new Array(l),h,d,f=0;f<l;++f)(h=a[f])&&(d=e.call(h,h.__data__,f,a))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,An(c[f],t,r,f,c,qe(h,r)));return new fr(s,this._parents,t,r)}function HS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=wf(e));for(var i=this._groups,o=i.length,s=[],n=[],a=0;a<o;++a)for(var l=i[a],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])&&An(u,t,r,m,f,g);s.push(f),n.push(h)}return new fr(s,n,t,r)}var YS=ts.prototype.constructor;function US(){return new YS(this._groups,this._parents)}function GS(e,t){var r,i,o;return function(){var s=ji(this,e),n=(this.style.removeProperty(e),ji(this,e));return s===n?null:s===r&&n===i?o:o=t(r=s,i=n)}}function Hf(e){return function(){this.style.removeProperty(e)}}function XS(e,t,r){var i,o=r+"",s;return function(){var n=ji(this,e);return n===o?null:n===i?s:s=t(i=n,r)}}function VS(e,t,r){var i,o,s;return function(){var n=ji(this,e),a=r(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),ji(this,e))),n===l?null:n===i&&l===o?s:(o=l,s=t(i=n,a))}}function KS(e,t){var r,i,o,s="style."+t,n="end."+s,a;return function(){var l=er(this,e),c=l.on,h=l.value[s]==null?a||(a=Hf(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(n,o=h),l.on=i}}function ZS(e,t,r){var i=(e+="")=="transform"?tS:Wf;return t==null?this.styleTween(e,GS(e,i)).on("end.style."+e,Hf(e)):typeof t=="function"?this.styleTween(e,VS(e,i,uh(this,"style."+e,t))).each(KS(this._id,e)):this.styleTween(e,XS(e,i,t),r).on("end.style."+e,null)}function QS(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function JS(e,t,r){var i,o;function s(){var n=t.apply(this,arguments);return n!==o&&(i=(o=n)&&QS(e,n,r)),i}return s._value=t,s}function tT(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,JS(e,t,r??""))}function eT(e){return function(){this.textContent=e}}function rT(e){return function(){var t=e(this);this.textContent=t??""}}function iT(e){return this.tween("text",typeof e=="function"?rT(uh(this,"text",e)):eT(e==null?"":e+""))}function oT(e){return function(t){this.textContent=e.call(this,t)}}function sT(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&oT(o)),t}return i._value=e,i}function nT(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,sT(e))}function aT(){for(var e=this._name,t=this._id,r=Yf(),i=this._groups,o=i.length,s=0;s<o;++s)for(var n=i[s],a=n.length,l,c=0;c<a;++c)if(l=n[c]){var h=qe(l,t);An(l,e,r,c,n,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new fr(i,this._parents,e,r)}function lT(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(s,n){var a={value:n},l={value:function(){--o===0&&s()}};r.each(function(){var c=er(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),o===0&&s()})}var hT=0;function fr(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function Yf(){return++hT}var sr=ts.prototype;fr.prototype={constructor:fr,select:WS,selectAll:HS,selectChild:sr.selectChild,selectChildren:sr.selectChildren,filter:IS,merge:PS,selection:US,transition:aT,call:sr.call,nodes:sr.nodes,node:sr.node,size:sr.size,empty:sr.empty,each:sr.each,on:qS,attr:bS,attrTween:vS,style:ZS,styleTween:tT,text:iT,textTween:nT,remove:jS,tween:fS,delay:LS,duration:AS,ease:OS,easeVarying:RS,end:lT,[Symbol.iterator]:sr[Symbol.iterator]};function cT(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var dT={time:null,delay:0,duration:250,ease:cT};function uT(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 fT(e){var t,r;e instanceof fr?(t=e._id,e=e._name):(t=Yf(),(r=dT).time=ch(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var n=i[s],a=n.length,l,c=0;c<a;++c)(l=n[c])&&An(l,e,t,c,n,r||uT(l,t));return new fr(i,this._parents,e,t)}ts.prototype.interrupt=cS;ts.prototype.transition=fT;const tl=Math.PI,el=2*tl,qr=1e-6,gT=el-qr;function Uf(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function pT(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Uf;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 mT{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Uf:pT(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,n){this._append`C${+t},${+r},${+i},${+o},${this._x1=+s},${this._y1=+n}`}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 n=this._x1,a=this._y1,l=i-t,c=o-r,h=n-t,d=a-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-n,g=o-a,m=l*l+c*c,y=u*u+g*g,x=Math.sqrt(m),C=Math.sqrt(f),w=s*Math.tan((tl-Math.acos((m+f-y)/(2*x*C)))/2),S=w/C,T=w/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+T*l},${this._y1=r+T*c}`}}arc(t,r,i,o,s,n){if(t=+t,r=+r,i=+i,n=!!n,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(o),l=i*Math.sin(o),c=t+a,h=r+l,d=1^n,f=n?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%el+el),f>gT?this._append`A${i},${i},0,1,${d},${t-a},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:f>qr&&this._append`A${i},${i},0,${+(f>=tl)},${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 yT=Math.abs,xT=Math.atan2,CT=Math.cos,bT=Math.max,kT=Math.min,wT=Math.sin,ST=Math.sqrt,rl=1e-12,Mn=Math.PI,il=Mn/2,TT=2*Mn;function vT(e){return e>1?0:e<-1?Mn:Math.acos(e)}function _T(e){return e>=1?il:e<=-1?-il:Math.asin(e)}function Gf(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 mT(t)}function Xf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Vf(e){this._context=e}Vf.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 Oo(e){return new Vf(e)}function BT(e){return e[0]}function LT(e){return e[1]}function Kf(e,t){var r=zr(!0),i=null,o=Oo,s=null,n=Gf(a);e=typeof e=="function"?e:e===void 0?BT:zr(e),t=typeof t=="function"?t:t===void 0?LT:zr(t);function a(l){var c,h=(l=Xf(l)).length,d,f=!1,u;for(i==null&&(s=o(u=n())),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 a.x=function(l){return arguments.length?(e=typeof l=="function"?l:zr(+l),a):e},a.y=function(l){return arguments.length?(t=typeof l=="function"?l:zr(+l),a):t},a.defined=function(l){return arguments.length?(r=typeof l=="function"?l:zr(!!l),a):r},a.curve=function(l){return arguments.length?(o=l,i!=null&&(s=o(i)),a):o},a.context=function(l){return arguments.length?(l==null?i=s=null:s=o(i=l),a):i},a}class Zf{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 Qf(e){return new Zf(e,!0)}function Jf(e){return new Zf(e,!1)}function vr(){}function Js(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 On(e){this._context=e}On.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:Js(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:Js(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tn(e){return new On(e)}function tg(e){this._context=e}tg.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:Js(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ET(e){return new tg(e)}function eg(e){this._context=e}eg.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:Js(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function FT(e){return new eg(e)}function rg(e,t){this._basis=new On(e),this._beta=t}rg.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,n=t[r]-o,a=-1,l;++a<=r;)l=a/r,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+l*s),this._beta*t[a]+(1-this._beta)*(o+l*n));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const AT=(function e(t){function r(i){return t===1?new On(i):new rg(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function en(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 fh(e,t){this._context=e,this._k=(1-t)/6}fh.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:en(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:en(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 ig=(function e(t){function r(i){return new fh(i,t)}return r.tension=function(i){return e(+i)},r})(0);function gh(e,t){this._context=e,this._k=(1-t)/6}gh.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:en(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 MT=(function e(t){function r(i){return new gh(i,t)}return r.tension=function(i){return e(+i)},r})(0);function ph(e,t){this._context=e,this._k=(1-t)/6}ph.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:en(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 OT=(function e(t){function r(i){return new ph(i,t)}return r.tension=function(i){return e(+i)},r})(0);function mh(e,t,r){var i=e._x1,o=e._y1,s=e._x2,n=e._y2;if(e._l01_a>rl){var a=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*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>rl){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,n=(n*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,s,n,e._x2,e._y2)}function og(e,t){this._context=e,this._alpha=t}og.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:mh(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 sg=(function e(t){function r(i){return t?new og(i,t):new fh(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function ng(e,t){this._context=e,this._alpha=t}ng.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:mh(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 $T=(function e(t){function r(i){return t?new ng(i,t):new gh(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function ag(e,t){this._context=e,this._alpha=t}ag.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:mh(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 RT=(function e(t){function r(i){return t?new ag(i,t):new ph(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function lg(e){this._context=e}lg.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 IT(e){return new lg(e)}function id(e){return e<0?-1:1}function od(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),n=(r-e._y1)/(o||i<0&&-0),a=(s*o+n*i)/(i+o);return(id(s)+id(n))*Math.min(Math.abs(s),Math.abs(n),.5*Math.abs(a))||0}function sd(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function ga(e,t,r){var i=e._x0,o=e._y0,s=e._x1,n=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,o+a*t,s-a,n-a*r,s,n)}function rn(e){this._context=e}rn.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:ga(this,this._t0,sd(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,ga(this,sd(this,r=od(this,e,t)),r);break;default:ga(this,this._t0,r=od(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function hg(e){this._context=new cg(e)}(hg.prototype=Object.create(rn.prototype)).point=function(e,t){rn.prototype.point.call(this,t,e)};function cg(e){this._context=e}cg.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 dg(e){return new rn(e)}function ug(e){return new hg(e)}function fg(e){this._context=e}fg.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=nd(e),o=nd(t),s=0,n=1;n<r;++s,++n)this._context.bezierCurveTo(i[0][s],o[0][s],i[1][s],o[1][s],e[n],t[n]);(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 nd(e){var t,r=e.length-1,i,o=new Array(r),s=new Array(r),n=new Array(r);for(o[0]=0,s[0]=2,n[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,s[t]=4,n[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,s[r-1]=7,n[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/s[t-1],s[t]-=i,n[t]-=i*n[t-1];for(o[r-1]=n[r-1]/s[r-1],t=r-2;t>=0;--t)o[t]=(n[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 gg(e){return new fg(e)}function $n(e,t){this._context=e,this._t=t}$n.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 pg(e){return new $n(e,.5)}function mg(e){return new $n(e,0)}function yg(e){return new $n(e,1)}function To(e,t,r){this.k=e,this.x=t,this.y=r}To.prototype={constructor:To,scale:function(e){return e===1?this:new To(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new To(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+")"}};To.prototype;var xg=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 yh(e){return typeof e>"u"||e===null}p(yh,"isNothing");function Cg(e){return typeof e=="object"&&e!==null}p(Cg,"isObject");function bg(e){return Array.isArray(e)?e:yh(e)?[]:[e]}p(bg,"toArray");function kg(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(kg,"extend");function wg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}p(wg,"repeat");function Sg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}p(Sg,"isNegativeZero");var PT=yh,DT=Cg,NT=bg,qT=wg,zT=Sg,jT=kg,Vt={isNothing:PT,isObject:DT,toArray:NT,repeat:qT,isNegativeZero:zT,extend:jT};function xh(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(xh,"formatError");function Yi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=xh(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}p(Yi,"YAMLException$1");Yi.prototype=Object.create(Error.prototype);Yi.prototype.constructor=Yi;Yi.prototype.toString=p(function(t){return this.name+": "+xh(this,t)},"toString");var ye=Yi;function Ms(e,t,r,i,o){var s="",n="",a=Math.floor(o/2)-1;return i-t>a&&(s=" ... ",t=i-a+s.length),r-i>a&&(n=" ...",r=i+a-n.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+n,pos:i-t+s.length}}p(Ms,"getLine");function Os(e,t){return Vt.repeat(" ",t-e.length)+e}p(Os,"padStart");function Tg(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,n=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&n<0&&(n=i.length-2);n<0&&(n=i.length-1);var a="",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&&!(n-l<0);l++)c=Ms(e.buffer,i[n-l],o[n-l],e.position-(i[n]-i[n-l]),d),a=Vt.repeat(" ",t.indent)+Os((e.line-l+1).toString(),h)+" | "+c.str+`
134
+ `+a;for(c=Ms(e.buffer,i[n],o[n],e.position,d),a+=Vt.repeat(" ",t.indent)+Os((e.line+1).toString(),h)+" | "+c.str+`
135
+ `,a+=Vt.repeat("-",t.indent+h+3+c.pos)+`^
136
+ `,l=1;l<=t.linesAfter&&!(n+l>=o.length);l++)c=Ms(e.buffer,i[n+l],o[n+l],e.position-(i[n]-i[n+l]),d),a+=Vt.repeat(" ",t.indent)+Os((e.line+l+1).toString(),h)+" | "+c.str+`
137
+ `;return a.replace(/\n$/,"")}p(Tg,"makeSnippet");var WT=Tg,HT=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],YT=["scalar","sequence","mapping"];function vg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(vg,"compileStyleAliases");function _g(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(HT.indexOf(r)===-1)throw new ye('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=vg(t.styleAliases||null),YT.indexOf(this.kind)===-1)throw new ye('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(_g,"Type$1");var ne=_g;function ol(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,n){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=n)}),r[o]=i}),r}p(ol,"compileList");function Bg(){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(Bg,"compileMap");function on(e){return this.extend(e)}p(on,"Schema$1");on.prototype.extend=p(function(t){var r=[],i=[];if(t instanceof ne)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 ye("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof ne))throw new ye("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new ye("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 ye("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 ne))throw new ye("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(on.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(i),o.compiledImplicit=ol(o,"implicit"),o.compiledExplicit=ol(o,"explicit"),o.compiledTypeMap=Bg(o.compiledImplicit,o.compiledExplicit),o},"extend");var UT=on,GT=new ne("tag:yaml.org,2002:str",{kind:"scalar",construct:p(function(e){return e!==null?e:""},"construct")}),XT=new ne("tag:yaml.org,2002:seq",{kind:"sequence",construct:p(function(e){return e!==null?e:[]},"construct")}),VT=new ne("tag:yaml.org,2002:map",{kind:"mapping",construct:p(function(e){return e!==null?e:{}},"construct")}),KT=new UT({explicit:[GT,XT,VT]});function Lg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}p(Lg,"resolveYamlNull");function Eg(){return null}p(Eg,"constructYamlNull");function Fg(e){return e===null}p(Fg,"isNull");var ZT=new ne("tag:yaml.org,2002:null",{kind:"scalar",resolve:Lg,construct:Eg,predicate:Fg,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 Ag(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(Ag,"resolveYamlBoolean");function Mg(e){return e==="true"||e==="True"||e==="TRUE"}p(Mg,"constructYamlBoolean");function Og(e){return Object.prototype.toString.call(e)==="[object Boolean]"}p(Og,"isBoolean");var QT=new ne("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Ag,construct:Mg,predicate:Og,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 $g(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}p($g,"isHexCode");function Rg(e){return 48<=e&&e<=55}p(Rg,"isOctCode");function Ig(e){return 48<=e&&e<=57}p(Ig,"isDecCode");function Pg(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(!$g(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Rg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Ig(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}p(Pg,"resolveYamlInteger");function Dg(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(Dg,"constructYamlInteger");function Ng(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Vt.isNegativeZero(e)}p(Ng,"isInteger");var JT=new ne("tag:yaml.org,2002:int",{kind:"scalar",resolve:Pg,construct:Dg,predicate:Ng,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"]}}),tv=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function qg(e){return!(e===null||!tv.test(e)||e[e.length-1]==="_")}p(qg,"resolveYamlFloat");function zg(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(zg,"constructYamlFloat");var ev=/^[-+]?[0-9]+e/;function jg(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),ev.test(r)?r.replace("e",".e"):r}p(jg,"representYamlFloat");function Wg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Vt.isNegativeZero(e))}p(Wg,"isFloat");var rv=new ne("tag:yaml.org,2002:float",{kind:"scalar",resolve:qg,construct:zg,predicate:Wg,represent:jg,defaultStyle:"lowercase"}),Hg=KT.extend({implicit:[ZT,QT,JT,rv]}),iv=Hg,Yg=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ug=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 Gg(e){return e===null?!1:Yg.exec(e)!==null||Ug.exec(e)!==null}p(Gg,"resolveYamlTimestamp");function Xg(e){var t,r,i,o,s,n,a,l=0,c=null,h,d,f;if(t=Yg.exec(e),t===null&&(t=Ug.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],n=+t[5],a=+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,n,a,l)),c&&f.setTime(f.getTime()-c),f}p(Xg,"constructYamlTimestamp");function Vg(e){return e.toISOString()}p(Vg,"representYamlTimestamp");var ov=new ne("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Gg,construct:Xg,instanceOf:Date,represent:Vg});function Kg(e){return e==="<<"||e===null}p(Kg,"resolveYamlMerge");var sv=new ne("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Kg}),Ch=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
138
+ \r`;function Zg(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(Zg,"resolveYamlBinary");function Qg(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Ch,n=0,a=[];for(t=0;t<o;t++)t%4===0&&t&&(a.push(n>>16&255),a.push(n>>8&255),a.push(n&255)),n=n<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(a.push(n>>16&255),a.push(n>>8&255),a.push(n&255)):r===18?(a.push(n>>10&255),a.push(n>>2&255)):r===12&&a.push(n>>4&255),new Uint8Array(a)}p(Qg,"constructYamlBinary");function Jg(e){var t="",r=0,i,o,s=e.length,n=Ch;for(i=0;i<s;i++)i%3===0&&i&&(t+=n[r>>18&63],t+=n[r>>12&63],t+=n[r>>6&63],t+=n[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=n[r>>18&63],t+=n[r>>12&63],t+=n[r>>6&63],t+=n[r&63]):o===2?(t+=n[r>>10&63],t+=n[r>>4&63],t+=n[r<<2&63],t+=n[64]):o===1&&(t+=n[r>>2&63],t+=n[r<<4&63],t+=n[64],t+=n[64]),t}p(Jg,"representYamlBinary");function tp(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}p(tp,"isBinary");var nv=new ne("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Zg,construct:Qg,predicate:tp,represent:Jg}),av=Object.prototype.hasOwnProperty,lv=Object.prototype.toString;function ep(e){if(e===null)return!0;var t=[],r,i,o,s,n,a=e;for(r=0,i=a.length;r<i;r+=1){if(o=a[r],n=!1,lv.call(o)!=="[object Object]")return!1;for(s in o)if(av.call(o,s))if(!n)n=!0;else return!1;if(!n)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}p(ep,"resolveYamlOmap");function rp(e){return e!==null?e:[]}p(rp,"constructYamlOmap");var hv=new ne("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ep,construct:rp}),cv=Object.prototype.toString;function ip(e){if(e===null)return!0;var t,r,i,o,s,n=e;for(s=new Array(n.length),t=0,r=n.length;t<r;t+=1){if(i=n[t],cv.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}p(ip,"resolveYamlPairs");function op(e){if(e===null)return[];var t,r,i,o,s,n=e;for(s=new Array(n.length),t=0,r=n.length;t<r;t+=1)i=n[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}p(op,"constructYamlPairs");var dv=new ne("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ip,construct:op}),uv=Object.prototype.hasOwnProperty;function sp(e){if(e===null)return!0;var t,r=e;for(t in r)if(uv.call(r,t)&&r[t]!==null)return!1;return!0}p(sp,"resolveYamlSet");function np(e){return e!==null?e:{}}p(np,"constructYamlSet");var fv=new ne("tag:yaml.org,2002:set",{kind:"mapping",resolve:sp,construct:np}),ap=iv.extend({implicit:[ov,sv],explicit:[nv,hv,dv,fv]}),_r=Object.prototype.hasOwnProperty,sn=1,lp=2,hp=3,nn=4,pa=1,gv=2,ad=3,pv=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,mv=/[\x85\u2028\u2029]/,yv=/[,\[\]\{\}]/,cp=/^(?:!|!!|![a-z\-]+!)$/i,dp=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function sl(e){return Object.prototype.toString.call(e)}p(sl,"_class");function Pe(e){return e===10||e===13}p(Pe,"is_EOL");function Tr(e){return e===9||e===32}p(Tr,"is_WHITE_SPACE");function de(e){return e===9||e===32||e===10||e===13}p(de,"is_WS_OR_EOL");function Ur(e){return e===44||e===91||e===93||e===123||e===125}p(Ur,"is_FLOW_INDICATOR");function up(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}p(up,"fromHexCode");function fp(e){return e===120?2:e===117?4:e===85?8:0}p(fp,"escapedHexLen");function gp(e){return 48<=e&&e<=57?e-48:-1}p(gp,"fromDecimalCode");function nl(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(nl,"simpleEscapeSequence");function pp(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}p(pp,"charFromCodepoint");function bh(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}p(bh,"setProperty");var mp=new Array(256),yp=new Array(256);for(Pr=0;Pr<256;Pr++)mp[Pr]=nl(Pr)?1:0,yp[Pr]=nl(Pr);var Pr;function xp(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ap,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(xp,"State$1");function kh(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=WT(r),new ye(t,r)}p(kh,"generateError");function ht(e,t){throw kh(e,t)}p(ht,"throwError");function Wo(e,t){e.onWarning&&e.onWarning.call(null,kh(e,t))}p(Wo,"throwWarning");var ld={YAML:p(function(t,r,i){var o,s,n;t.version!==null&&ht(t,"duplication of %YAML directive"),i.length!==1&&ht(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&&ht(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),n=parseInt(o[2],10),s!==1&&ht(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=n<2,n!==1&&n!==2&&Wo(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function(t,r,i){var o,s;i.length!==2&&ht(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],cp.test(o)||ht(t,"ill-formed tag handle (first argument) of the TAG directive"),_r.call(t.tagMap,o)&&ht(t,'there is a previously declared suffix for "'+o+'" tag handle'),dp.test(s)||ht(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{ht(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function ur(e,t,r,i){var o,s,n,a;if(t<r){if(a=e.input.slice(t,r),i)for(o=0,s=a.length;o<s;o+=1)n=a.charCodeAt(o),n===9||32<=n&&n<=1114111||ht(e,"expected valid JSON character");else pv.test(a)&&ht(e,"the stream contains non-printable characters");e.result+=a}}p(ur,"captureSegment");function al(e,t,r,i){var o,s,n,a;for(Vt.isObject(r)||ht(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),n=0,a=o.length;n<a;n+=1)s=o[n],_r.call(t,s)||(bh(t,s,r[s]),i[s]=!0)}p(al,"mergeMappings");function Gr(e,t,r,i,o,s,n,a,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])&&ht(e,"nested arrays are not supported inside keys"),typeof o=="object"&&sl(o[c])==="[object Object]"&&(o[c]="[object Object]");if(typeof o=="object"&&sl(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)al(e,t,s[c],r);else al(e,t,s,r);else!e.json&&!_r.call(r,o)&&_r.call(t,o)&&(e.line=n||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,ht(e,"duplicated mapping key")),bh(t,o,s),delete r[o];return t}p(Gr,"storeMappingPair");function Rn(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++):ht(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}p(Rn,"readLineBreak");function Wt(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;Tr(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(Rn(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&&Wo(e,"deficient indentation"),i}p(Wt,"skipSeparationSpace");function es(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||de(r)))}p(es,"testDocumentSeparator");function In(e,t){t===1?e.result+=" ":t>1&&(e.result+=Vt.repeat(`
140
+ `,t-1))}p(In,"writeFoldedLines");function Cp(e,t,r){var i,o,s,n,a,l,c,h,d=e.kind,f=e.result,u;if(u=e.input.charCodeAt(e.position),de(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),de(o)||r&&Ur(o)))return!1;for(e.kind="scalar",e.result="",s=n=e.position,a=!1;u!==0;){if(u===58){if(o=e.input.charCodeAt(e.position+1),de(o)||r&&Ur(o))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),de(i))break}else{if(e.position===e.lineStart&&es(e)||r&&Ur(u))break;if(Pe(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,Wt(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}else{e.position=n,e.line=l,e.lineStart=c,e.lineIndent=h;break}}a&&(ur(e,s,n,!1),In(e,e.line-l),s=n=e.position,a=!1),Tr(u)||(n=e.position+1),u=e.input.charCodeAt(++e.position)}return ur(e,s,n,!1),e.result?!0:(e.kind=d,e.result=f,!1)}p(Cp,"readPlainScalar");function bp(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),In(e,Wt(e,!1,t)),i=o=e.position):e.position===e.lineStart&&es(e)?ht(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);ht(e,"unexpected end of the stream within a single quoted scalar")}p(bp,"readSingleQuotedScalar");function kp(e,t){var r,i,o,s,n,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return ur(e,r,e.position,!0),e.position++,!0;if(a===92){if(ur(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Pe(a))Wt(e,!1,t);else if(a<256&&mp[a])e.result+=yp[a],e.position++;else if((n=fp(a))>0){for(o=n,s=0;o>0;o--)a=e.input.charCodeAt(++e.position),(n=up(a))>=0?s=(s<<4)+n:ht(e,"expected hexadecimal character");e.result+=pp(s),e.position++}else ht(e,"unknown escape sequence");r=i=e.position}else Pe(a)?(ur(e,r,i,!0),In(e,Wt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&es(e)?ht(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}ht(e,"unexpected end of the stream within a double quoted scalar")}p(kp,"readDoubleQuotedScalar");function wp(e,t){var r=!0,i,o,s,n=e.tag,a,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,a=[];else if(C===123)h=125,u=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),C=e.input.charCodeAt(++e.position);C!==0;){if(Wt(e,!0,t),C=e.input.charCodeAt(e.position),C===h)return e.position++,e.tag=n,e.anchor=l,e.kind=u?"mapping":"sequence",e.result=a,!0;r?C===44&&ht(e,"expected the node content, but found ','"):ht(e,"missed comma between flow collection entries"),y=m=x=null,d=f=!1,C===63&&(c=e.input.charCodeAt(e.position+1),de(c)&&(d=f=!0,e.position++,Wt(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,ti(e,t,sn,!1,!0),y=e.tag,m=e.result,Wt(e,!0,t),C=e.input.charCodeAt(e.position),(f||e.line===i)&&C===58&&(d=!0,C=e.input.charCodeAt(++e.position),Wt(e,!0,t),ti(e,t,sn,!1,!0),x=e.result),u?Gr(e,a,g,y,m,x,i,o,s):d?a.push(Gr(e,null,g,y,m,x,i,o,s)):a.push(m),Wt(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}ht(e,"unexpected end of the stream within a flow collection")}p(wp,"readFlowCollection");function Sp(e,t){var r,i,o=pa,s=!1,n=!1,a=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)pa===o?o=d===43?ad:gv:ht(e,"repeat of a chomping mode identifier");else if((h=gp(d))>=0)h===0?ht(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):n?ht(e,"repeat of an indentation width identifier"):(a=t+h-1,n=!0);else break;if(Tr(d)){do d=e.input.charCodeAt(++e.position);while(Tr(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Pe(d)&&d!==0)}for(;d!==0;){for(Rn(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!n||e.lineIndent<a)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!n&&e.lineIndent>a&&(a=e.lineIndent),Pe(d)){l++;continue}if(e.lineIndent<a){o===ad?e.result+=Vt.repeat(`
141
+ `,s?1+l:l):o===pa&&s&&(e.result+=`
142
+ `);break}for(i?Tr(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,n=!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(Sp,"readBlockScalar");function ll(e,t){var r,i=e.tag,o=e.anchor,s=[],n,a=!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,ht(e,"tab characters must not be used in indentation")),!(l!==45||(n=e.input.charCodeAt(e.position+1),!de(n))));){if(a=!0,e.position++,Wt(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,ti(e,t,hp,!1,!0),s.push(e.result),Wt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)ht(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}p(ll,"readBlockSequence");function Tp(e,t,r){var i,o,s,n,a,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,ht(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(C===63||C===58)&&de(i))C===63?(y&&(Gr(e,d,f,u,g,null,n,a,l),u=g=m=null),x=!0,y=!0,o=!0):y?(y=!1,o=!0):ht(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(n=e.line,a=e.lineStart,l=e.position,!ti(e,r,lp,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);Tr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),de(C)||ht(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Gr(e,d,f,u,g,null,n,a,l),u=g=m=null),x=!0,y=!1,o=!1,u=e.tag,g=e.result;else if(x)ht(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=h,!0}else if(x)ht(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&&(n=e.line,a=e.lineStart,l=e.position),ti(e,t,nn,!0,o)&&(y?g=e.result:m=e.result),y||(Gr(e,d,f,u,g,m,n,a,l),u=g=m=null),Wt(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&C!==0)ht(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Gr(e,d,f,u,g,null,n,a,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=d),x}p(Tp,"readBlockMapping");function vp(e){var t,r=!1,i=!1,o,s,n;if(n=e.input.charCodeAt(e.position),n!==33)return!1;if(e.tag!==null&&ht(e,"duplication of a tag property"),n=e.input.charCodeAt(++e.position),n===60?(r=!0,n=e.input.charCodeAt(++e.position)):n===33?(i=!0,o="!!",n=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do n=e.input.charCodeAt(++e.position);while(n!==0&&n!==62);e.position<e.length?(s=e.input.slice(t,e.position),n=e.input.charCodeAt(++e.position)):ht(e,"unexpected end of the stream within a verbatim tag")}else{for(;n!==0&&!de(n);)n===33&&(i?ht(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),cp.test(o)||ht(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),n=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),yv.test(s)&&ht(e,"tag suffix cannot contain flow indicator characters")}s&&!dp.test(s)&&ht(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{ht(e,"tag name is malformed: "+s)}return r?e.tag=s:_r.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:ht(e,'undeclared tag handle "'+o+'"'),!0}p(vp,"readTagProperty");function _p(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&ht(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!de(r)&&!Ur(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&ht(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}p(_p,"readAnchorProperty");function Bp(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&&!de(i)&&!Ur(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&ht(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),_r.call(e.anchorMap,r)||ht(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Wt(e,!0,-1),!0}p(Bp,"readAlias");function ti(e,t,r,i,o){var s,n,a,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=n=a=nn===r||hp===r,i&&Wt(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;vp(e)||_p(e);)Wt(e,!0,-1)?(c=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=c||o),(l===1||nn===r)&&(sn===r||lp===r?m=t:m=t+1,y=e.position-e.lineStart,l===1?a&&(ll(e,y)||Tp(e,y,m))||wp(e,m)?h=!0:(n&&Sp(e,m)||bp(e,m)||kp(e,m)?h=!0:Bp(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&ht(e,"alias node should not have any properties")):Cp(e,m,sn===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(h=a&&ll(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"&&ht(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(_r.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||ht(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&ht(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)):ht(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 Lp(e){var t=e.position,r,i,o,s=!1,n;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(n=e.input.charCodeAt(e.position))!==0&&(Wt(e,!0,-1),n=e.input.charCodeAt(e.position),!(e.lineIndent>0||n!==37));){for(s=!0,n=e.input.charCodeAt(++e.position),r=e.position;n!==0&&!de(n);)n=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&ht(e,"directive name must not be less than one character in length");n!==0;){for(;Tr(n);)n=e.input.charCodeAt(++e.position);if(n===35){do n=e.input.charCodeAt(++e.position);while(n!==0&&!Pe(n));break}if(Pe(n))break;for(r=e.position;n!==0&&!de(n);)n=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}n!==0&&Rn(e),_r.call(ld,i)?ld[i](e,i,o):Wo(e,'unknown document directive "'+i+'"')}if(Wt(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,Wt(e,!0,-1)):s&&ht(e,"directives end mark is expected"),ti(e,e.lineIndent-1,nn,!1,!0),Wt(e,!0,-1),e.checkLineBreaks&&mv.test(e.input.slice(t,e.position))&&Wo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&es(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Wt(e,!0,-1));return}if(e.position<e.length-1)ht(e,"end of the stream or a document separator is expected");else return}p(Lp,"readDocument");function wh(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 xp(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,ht(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;)Lp(r);return r.documents}p(wh,"loadDocuments");function xv(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=wh(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}p(xv,"loadAll$1");function Ep(e,t){var r=wh(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ye("expected a single document in the stream, but found more")}}p(Ep,"load$1");var Cv=Ep,bv={load:Cv},Fp=Object.prototype.toString,Ap=Object.prototype.hasOwnProperty,Sh=65279,kv=9,Ho=10,wv=13,Sv=32,Tv=33,vv=34,hl=35,_v=37,Bv=38,Lv=39,Ev=42,Mp=44,Fv=45,an=58,Av=61,Mv=62,Ov=63,$v=64,Op=91,$p=93,Rv=96,Rp=123,Iv=124,Ip=125,le={};le[0]="\\0";le[7]="\\a";le[8]="\\b";le[9]="\\t";le[10]="\\n";le[11]="\\v";le[12]="\\f";le[13]="\\r";le[27]="\\e";le[34]='\\"';le[92]="\\\\";le[133]="\\N";le[160]="\\_";le[8232]="\\L";le[8233]="\\P";var Pv=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Dv=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Pp(e,t){var r,i,o,s,n,a,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)n=i[o],a=String(t[n]),n.slice(0,2)==="!!"&&(n="tag:yaml.org,2002:"+n.slice(2)),l=e.compiledTypeMap.fallback[n],l&&Ap.call(l.styleAliases,a)&&(a=l.styleAliases[a]),r[n]=a;return r}p(Pp,"compileStyleMap");function Dp(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 ye("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Vt.repeat("0",i-t.length)+t}p(Dp,"encodeHex");var Nv=1,Yo=2;function Np(e){this.schema=e.schema||ap,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=Pp(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==='"'?Yo:Nv,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(Np,"State");function cl(e,t){for(var r=Vt.repeat(" ",t),i=0,o=-1,s="",n,a=e.length;i<a;)o=e.indexOf(`
148
+ `,i),o===-1?(n=e.slice(i),i=a):(n=e.slice(i,o+1),i=o+1),n.length&&n!==`
149
+ `&&(s+=r),s+=n;return s}p(cl,"indentString");function ln(e,t){return`
150
+ `+Vt.repeat(" ",e.indent*t)}p(ln,"generateNextLine");function qp(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(qp,"testImplicitResolving");function Uo(e){return e===Sv||e===kv}p(Uo,"isWhitespace");function Ui(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Sh||65536<=e&&e<=1114111}p(Ui,"isPrintable");function dl(e){return Ui(e)&&e!==Sh&&e!==wv&&e!==Ho}p(dl,"isNsCharOrWhitespace");function ul(e,t,r){var i=dl(e),o=i&&!Uo(e);return(r?i:i&&e!==Mp&&e!==Op&&e!==$p&&e!==Rp&&e!==Ip)&&e!==hl&&!(t===an&&!o)||dl(t)&&!Uo(t)&&e===hl||t===an&&o}p(ul,"isPlainSafe");function zp(e){return Ui(e)&&e!==Sh&&!Uo(e)&&e!==Fv&&e!==Ov&&e!==an&&e!==Mp&&e!==Op&&e!==$p&&e!==Rp&&e!==Ip&&e!==hl&&e!==Bv&&e!==Ev&&e!==Tv&&e!==Iv&&e!==Av&&e!==Mv&&e!==Lv&&e!==vv&&e!==_v&&e!==$v&&e!==Rv}p(zp,"isPlainSafeFirst");function jp(e){return!Uo(e)&&e!==an}p(jp,"isPlainSafeLast");function Ci(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(Ci,"codePointAt");function Th(e){var t=/^\n* /;return t.test(e)}p(Th,"needIndentIndicator");var Wp=1,fl=2,Hp=3,Yp=4,fi=5;function Up(e,t,r,i,o,s,n,a){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,g=-1,m=zp(Ci(e,0))&&jp(Ci(e,e.length-1));if(t||n)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Ci(e,l),!Ui(c))return fi;m=m&&ul(c,h,a),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Ci(e,l),c===Ho)d=!0,u&&(f=f||l-g-1>i&&e[g+1]!==" ",g=l);else if(!Ui(c))return fi;m=m&&ul(c,h,a),h=c}f=f||u&&l-g-1>i&&e[g+1]!==" "}return!d&&!f?m&&!n&&!o(e)?Wp:s===Yo?fi:fl:r>9&&Th(e)?fi:n?s===Yo?fi:fl:f?Yp:Hp}p(Up,"chooseScalarStyle");function Gp(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===Yo?'""':"''";if(!e.noCompatMode&&(Pv.indexOf(t)!==-1||Dv.test(t)))return e.quotingType===Yo?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),n=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),a=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return qp(e,c)}switch(p(l,"testAmbiguity"),Up(t,a,e.indent,n,l,e.quotingType,e.forceQuotes&&!i,o)){case Wp:return t;case fl:return"'"+t.replace(/'/g,"''")+"'";case Hp:return"|"+gl(t,e.indent)+pl(cl(t,s));case Yp:return">"+gl(t,e.indent)+pl(cl(Xp(t,n),s));case fi:return'"'+Vp(t)+'"';default:throw new ye("impossible error: invalid scalar style")}})()}p(Gp,"writeScalar");function gl(e,t){var r=Th(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(gl,"blockHeader");function pl(e){return e[e.length-1]===`
155
+ `?e.slice(0,-1):e}p(pl,"dropEndingNewline");function Xp(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,ml(e.slice(0,c),t)})(),o=e[0]===`
157
+ `||e[0]===" ",s,n;n=r.exec(e);){var a=n[1],l=n[2];s=l[0]===" ",i+=a+(!o&&!s&&l!==""?`
158
+ `:"")+ml(l,t),o=s}return i}p(Xp,"foldString");function ml(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,n=0,a=0,l="";i=r.exec(e);)a=i.index,a-o>t&&(s=n>o?n:a,l+=`
159
+ `+e.slice(o,s),o=s+1),n=a;return l+=`
160
+ `,e.length-o>t&&n>o?l+=e.slice(o,n)+`
161
+ `+e.slice(n+1):l+=e.slice(o),l.slice(1)}p(ml,"foldLine");function Vp(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=Ci(e,o),i=le[r],!i&&Ui(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||Dp(r);return t}p(Vp,"escapeString");function Kp(e,t,r){var i="",o=e.tag,s,n,a;for(s=0,n=r.length;s<n;s+=1)a=r[s],e.replacer&&(a=e.replacer.call(r,String(s),a)),(Ke(e,t,a,!1,!1)||typeof a>"u"&&Ke(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}p(Kp,"writeFlowSequence");function yl(e,t,r,i){var o="",s=e.tag,n,a,l;for(n=0,a=r.length;n<a;n+=1)l=r[n],e.replacer&&(l=e.replacer.call(r,String(n),l)),(Ke(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Ke(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=ln(e,t)),e.dump&&Ho===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}p(yl,"writeBlockSequence");function Zp(e,t,r){var i="",o=e.tag,s=Object.keys(r),n,a,l,c,h;for(n=0,a=s.length;n<a;n+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),l=s[n],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),Ke(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ke(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}p(Zp,"writeFlowMapping");function Qp(e,t,r,i){var o="",s=e.tag,n=Object.keys(r),a,l,c,h,d,f;if(e.sortKeys===!0)n.sort();else if(typeof e.sortKeys=="function")n.sort(e.sortKeys);else if(e.sortKeys)throw new ye("sortKeys must be a boolean or a function");for(a=0,l=n.length;a<l;a+=1)f="",(!i||o!=="")&&(f+=ln(e,t)),c=n[a],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),Ke(e,t+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&Ho===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=ln(e,t)),Ke(e,t+1,h,!0,d)&&(e.dump&&Ho===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=s,e.dump=o||"{}"}p(Qp,"writeBlockMapping");function xl(e,t,r){var i,o,s,n,a,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,n=o.length;s<n;s+=1)if(a=o[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(r?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,Fp.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(Ap.call(a.represent,l))i=a.represent[l](t,l);else throw new ye("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(xl,"detectType");function Ke(e,t,r,i,o,s,n){e.tag=null,e.dump=r,xl(e,r,!1)||xl(e,r,!0);var a=Fp.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=a==="[object Object]"||a==="[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),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(Qp(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(Zp(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!n&&t>0?yl(e,t-1,e.dump,o):yl(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(Kp(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Gp(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ye("unacceptable kind of an object to dump "+a)}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(Ke,"writeNode");function Jp(e,t){var r=[],i=[],o,s;for(hn(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}p(Jp,"getDuplicateReferences");function hn(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)hn(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)hn(e[i[o]],t,r)}p(hn,"inspectNode");function qv(e,t){t=t||{};var r=new Np(t);r.noRefs||Jp(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Ke(r,0,i,!0,!0)?r.dump+`
162
+ `:""}p(qv,"dump$1");function zv(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(zv,"renamed");var tm=Hg,em=bv.load;var jv=p(e=>{const{handDrawnSeed:t}=wt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ji=p(e=>{const t=Wv([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Wv=p(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),vh=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"),nt=p(e=>{const{stylesArray:t}=Ji(e),r=[],i=[],o=[],s=[];return t.forEach(n=>{const a=n[0];vh(a)?r.push(n.join(":")+" !important"):(i.push(n.join(":")+" !important"),a.includes("stroke")&&o.push(n.join(":")+" !important"),a==="fill"&&s.push(n.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),ot=p((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=wt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:n}=Ji(e);return Object.assign({roughness:.7,fill:n.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:n.get("stroke")||o,seed:i,strokeWidth:n.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:Hv(n.get("stroke-dasharray"))},t)},"userNodeOverrides"),Hv=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"),ps={},Xt={},hd;function Yv(){return hd||(hd=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=/^.+(:|&colon;)/gim,Xt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Xt.relativeFirstCharacters=[".","/"],Xt.BLANK_URL="about:blank"),Xt}var cd;function Uv(){if(cd)return ps;cd=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.sanitizeUrl=s;var e=Yv();function t(n){return e.relativeFirstCharacters.indexOf(n[0])>-1}function r(n){var a=n.replace(e.ctrlCharactersRegex,"");return a.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(n){return URL.canParse(n)}function o(n){try{return decodeURIComponent(n)}catch{return n}}function s(n){if(!n)return e.BLANK_URL;var a,l=o(n.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),a=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(a&&a.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 ps}var rm=Uv();function ma(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 Gv(){}function im(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Pn(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const om="[object RegExp]",_h="[object String]",Bh="[object Number]",Lh="[object Boolean]",Eh="[object Arguments]",sm="[object Symbol]",nm="[object Date]",am="[object Map]",lm="[object Set]",hm="[object Array]",cm="[object ArrayBuffer]",dm="[object Object]",um="[object DataView]",fm="[object Uint8Array]",gm="[object Uint8ClampedArray]",pm="[object Uint16Array]",mm="[object Uint32Array]",ym="[object Int8Array]",xm="[object Int16Array]",Cm="[object Int32Array]",bm="[object Float32Array]",km="[object Float64Array]",dd=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function Fh(e){return typeof dd.Buffer<"u"&&dd.Buffer.isBuffer(e)}function Xv(e){return Number.isSafeInteger(e)&&e>=0}function wm(e){return e!=null&&typeof e!="function"&&Xv(e.length)}function Vv(e){return e==="__proto__"}function Dn(e){return e==null||typeof e!="object"&&typeof e!="function"}function Ah(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Kv(e,t){return bi(e,void 0,e,new Map,t)}function bi(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(Dn(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const n=new Array(e.length);i.set(e,n);for(let a=0;a<e.length;a++)n[a]=bi(e[a],a,r,i,o);return Object.hasOwn(e,"index")&&(n.index=e.index),Object.hasOwn(e,"input")&&(n.input=e.input),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const n=new RegExp(e.source,e.flags);return n.lastIndex=e.lastIndex,n}if(e instanceof Map){const n=new Map;i.set(e,n);for(const[a,l]of e)n.set(a,bi(l,a,r,i,o));return n}if(e instanceof Set){const n=new Set;i.set(e,n);for(const a of e)n.add(bi(a,void 0,r,i,o));return n}if(Fh(e))return e.subarray();if(Ah(e)){const n=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,n);for(let a=0;a<e.length;a++)n[a]=bi(e[a],a,r,i,o);return n}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const n=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,n),Oe(n,e,r,i,o),n}if(typeof File<"u"&&e instanceof File){const n=new File([e],e.name,{type:e.type});return i.set(e,n),Oe(n,e,r,i,o),n}if(typeof Blob<"u"&&e instanceof Blob){const n=new Blob([e],{type:e.type});return i.set(e,n),Oe(n,e,r,i,o),n}if(e instanceof Error){const n=structuredClone(e);return i.set(e,n),n.message=e.message,n.name=e.name,n.stack=e.stack,n.cause=e.cause,n.constructor=e.constructor,Oe(n,e,r,i,o),n}if(e instanceof Boolean){const n=new Boolean(e.valueOf());return i.set(e,n),Oe(n,e,r,i,o),n}if(e instanceof Number){const n=new Number(e.valueOf());return i.set(e,n),Oe(n,e,r,i,o),n}if(e instanceof String){const n=new String(e.valueOf());return i.set(e,n),Oe(n,e,r,i,o),n}if(typeof e=="object"&&Zv(e)){const n=Object.create(Object.getPrototypeOf(e));return i.set(e,n),Oe(n,e,r,i,o),n}return e}function Oe(e,t,r=e,i,o){const s=[...Object.keys(t),...im(t)];for(let n=0;n<s.length;n++){const a=s[n],l=Object.getOwnPropertyDescriptor(e,a);(l==null||l.writable)&&(e[a]=bi(t[a],a,r,i,o))}}function Zv(e){switch(Pn(e)){case Eh:case hm:case cm:case um:case Lh:case nm:case bm:case km:case ym:case xm:case Cm:case am:case Bh:case dm:case om:case lm:case _h:case sm:case fm:case gm:case pm:case mm:return!0;default:return!1}}function Qv(e,t){return Kv(e,(r,i,o,s)=>{if(typeof e=="object"){if(Pn(e)==="[object Object]"&&typeof e.constructor!="function"){const n={};return s.set(e,n),Oe(n,e,o,s),n}switch(Object.prototype.toString.call(e)){case Bh:case _h:case Lh:{const n=new e.constructor(e?.valueOf());return Oe(n,e),n}case Eh:{const n={};return Oe(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}default:return}}})}function ud(e){return Qv(e)}function Cl(e){return e!==null&&typeof e=="object"&&Pn(e)==="[object Arguments]"}function bl(e){return typeof e=="object"&&e!==null}function Jv(e){return bl(e)&&wm(e)}function rs(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 n=e.apply(this,i);return r.cache=s.set(o,n)||s,n};return r.cache=new(rs.Cache||Map),r}rs.Cache=Map;function $o(e){return Ah(e)}function t_(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function e_(e){if(Dn(e))return e;if(Array.isArray(e)||Ah(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 r_(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 n=r[s];o=$s(o,n,i,new Map)}return o}function $s(e,t,r,i){if(Dn(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return e_(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),...im(t)];for(let s=0;s<o.length;s++){const n=o[s];if(Vv(n))continue;let a=t[n],l=e[n];if(Cl(a)&&(a={...a}),Cl(l)&&(l={...l}),Fh(a)&&(a=ud(a)),Array.isArray(a))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(Jv(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,a,n,e,t,i);c!==void 0?e[n]=c:Array.isArray(a)||bl(l)&&bl(a)&&(ma(l)||ma(a)||$o(l)||$o(a))?e[n]=$s(l,a,r,i):l==null&&ma(a)?e[n]=$s({},a,r,i):l==null&&$o(a)?e[n]=ud(a):(l===void 0||a!==void 0)&&(e[n]=a)}return e}function i_(e,...t){return r_(e,...t,Gv)}function fd(e){if(e==null)return!0;if(wm(e))return typeof e.splice!="function"&&typeof e!="string"&&!Fh(e)&&!$o(e)&&!Cl(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 Sm="​",o_={curveBasis:tn,curveBasisClosed:ET,curveBasisOpen:FT,curveBumpX:Qf,curveBumpY:Jf,curveBundle:AT,curveCardinalClosed:MT,curveCardinalOpen:OT,curveCardinal:ig,curveCatmullRomClosed:$T,curveCatmullRomOpen:RT,curveCatmullRom:sg,curveLinear:Oo,curveLinearClosed:IT,curveMonotoneX:dg,curveMonotoneY:ug,curveNatural:gg,curveStep:pg,curveStepAfter:yg,curveStepBefore:mg},s_=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,n_=p(function(e,t){const r=Tm(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const n=r.map(a=>a.args);js(n),i=Ut(i,[...n])}else i=r.args;if(!i)return;let o=Zl(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),Tm=p(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${s_.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=Mo.exec(e))!==null;)if(i.index===Mo.lastIndex&&Mo.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],n=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:n})}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"),a_=p(function(e){return e.replace(Mo,"")},"removeDirectives"),l_=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Mh(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return o_[r]??t}p(Mh,"interpolateToCurve");function vm(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?rm.sanitizeUrl(r):r}p(vm,"formatUrl");var h_=p((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let n=0;n<i;n++)if(s=s[r[n]],!s){V.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function Oh(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}p(Oh,"distance");function _m(e){let t,r=0;e.forEach(o=>{r+=Oh(o,t),t=o});const i=r/2;return $h(e,i)}p(_m,"traverseEdge");function Bm(e){return e.length===1?e[0]:_m(e)}p(Bm,"calcLabelPosition");var gd=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),$h=p((e,t)=>{let r,i=t;for(const o of e){if(r){const s=Oh(o,r);if(s===0)return r;if(s<i)i-=s;else{const n=i/s;if(n<=0)return r;if(n>=1)return{x:o.x,y:o.y};if(n>0&&n<1)return{x:gd((1-n)*r.x+n*o.x,5),y:gd((1-n)*r.y+n*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),c_=p((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=$h(t,25),s=e?10:5,n=Math.atan2(t[0].y-o.y,t[0].x-o.x),a={x:0,y:0};return a.x=Math.sin(n)*s+(t[0].x+o.x)/2,a.y=-Math.cos(n)*s+(t[0].y+o.y)/2,a},"calcCardinalityPosition");function Lm(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=$h(i,o),n=10+e*.5,a=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(a+Math.PI)*n+(i[0].x+s.x)/2,l.y=-Math.cos(a+Math.PI)*n+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(a-Math.PI)*n+(i[0].x+s.x)/2-5,l.y=-Math.cos(a-Math.PI)*n+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(a)*n+(i[0].x+s.x)/2-5,l.y=-Math.cos(a)*n+(i[0].y+s.y)/2-5):(l.x=Math.sin(a)*n+(i[0].x+s.x)/2,l.y=-Math.cos(a)*n+(i[0].y+s.y)/2),l}p(Lm,"calcTerminalLabelPosition");function Rh(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(Rh,"getStylesFromArray");var pd=0,Em=p(()=>(pd++,"id-"+Math.random().toString(36).substr(2,12)+"-"+pd),"generateId");function Fm(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(Fm,"makeRandomHex");var Am=p(e=>Fm(e.length),"random"),d_=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"),u_=p(function(e,t){const r=t.text.replace(Zi.lineBreakRegex," "),[,i]=is(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"),Mm=rs((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Zi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((n,a)=>{const l=Ze(`${n} `,r),c=Ze(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=f_(n,t,"-",r);o.push(s,...f),s=u}else c+l>=t?(o.push(s),s=n):s=[s,n].filter(Boolean).join(" ");a+1===i.length&&o.push(s)}),o.filter(n=>n!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),f_=rs((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let n="";return o.forEach((a,l)=>{const c=`${n}${a}`;if(Ze(c,i)>=t){const d=l+1,f=o.length===d,u=`${c}${r}`;s.push(f?c:u),n=""}else n=c}),{hyphenatedStrings:s,remainingWord:n}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Ih(e,t){return Nn(e,t).height}p(Ih,"calculateTextHeight");function Ze(e,t){return Nn(e,t).width}p(Ze,"calculateTextWidth");var Nn=rs((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=is(r),n=["sans-serif",i],a=e.split(Zi.lineBreakRegex),l=[],c=yt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const f of n){let u=0;const g={width:0,height:0,lineHeight:0};for(const m of a){const y=d_();y.text=m||Sm;const x=u_(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}`),Pi,g_=(Pi=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},p(Pi,"InitIDGenerator"),Pi),ms,p_=p(function(e){return ms=ms||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),ms.innerHTML=e,unescape(ms.textContent)},"entityDecode");function Ph(e){return"str"in e}p(Ph,"isDetailedError");var m_=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"),is=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 qn(e,t){return i_({},e,t)}p(qn,"cleanAndMerge");var ve={assignWithDepth:Ut,wrapLabel:Mm,calculateTextHeight:Ih,calculateTextWidth:Ze,calculateTextDimensions:Nn,cleanAndMerge:qn,detectInit:n_,detectDirective:Tm,isSubstringInArray:l_,interpolateToCurve:Mh,calcLabelPosition:Bm,calcCardinalityPosition:c_,calcTerminalLabelPosition:Lm,formatUrl:vm,getStylesFromArray:Rh,generateId:Em,random:Am,runFunc:h_,entityDecode:p_,insertTitle:m_,isLabelCoordinateInPath:Om,parseFontSize:is,InitIDGenerator:g_},y_=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"),Br=p(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),x_=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 Om(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(Om,"isLabelCoordinateInPath");var zn=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 Dh(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 n(){if(o.style.display="flex",o.style.flexDirection="column",i){const a=wt().fontSize?wt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Kl.fontSize]=is(a),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}p(n,"setupImage"),setTimeout(()=>{o.complete&&n()}),o.addEventListener("error",n),o.addEventListener("load",n)})))}p(Dh,"configureLabelImages");const C_=Object.freeze({left:0,top:0,width:16,height:16}),cn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),$m=Object.freeze({...C_,...cn}),b_=Object.freeze({...$m,body:"",hidden:!1}),k_=Object.freeze({width:null,height:null}),w_=Object.freeze({...k_,...cn}),S_=(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 a=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:a};return ya(c)?c:null}const s=o[0],n=s.split("-");if(n.length>1){const a={provider:i,prefix:n.shift(),name:n.join("-")};return ya(a)?a:null}if(r&&i===""){const a={provider:i,prefix:"",name:s};return ya(a,r)?a:null}return null},ya=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function T_(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 md(e,t){const r=T_(e,t);for(const i in b_)i in cn?i in e&&!(i in r)&&(r[i]=cn[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function v_(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(n){if(r[n])return o[n]=[];if(!(n in o)){o[n]=null;const a=i[n]&&i[n].parent,l=a&&s(a);l&&(o[n]=[a].concat(l))}return o[n]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function yd(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function n(a){s=md(i[a]||o[a],s)}return n(t),r.forEach(n),md(e,s)}function __(e,t){if(e.icons[t])return yd(e,t,[]);const r=v_(e,[t])[t];return r?yd(e,t,r):null}const B_=/(-?[0-9.]*[0-9]+[0-9.]*)/g,L_=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function xd(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(B_);if(i===null||!i.length)return e;const o=[];let s=i.shift(),n=L_.test(s);for(;;){if(n){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");n=!n}}function E_(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 n=e.indexOf(">",s);if(n===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(n+1)}return{defs:r,content:e}}function F_(e,t){return e?"<defs>"+e+"</defs>"+t:t}function A_(e,t,r){const i=E_(e);return F_(i.defs,t+i.content+r)}const M_=e=>e==="unset"||e==="undefined"||e==="none";function O_(e,t){const r={...$m,...e},i={...w_,...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 w=m.rotate;x?C?w+=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(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){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}w%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=A_(s,'<g transform="'+y.join(" ")+'">',"</g>"))});const n=i.width,a=i.height,l=o.width,c=o.height;let h,d;n===null?(d=a===null?"1em":a==="auto"?c:a,h=xd(d,l/c)):(h=n==="auto"?l:n,d=a===null?xd(h,c/l):a==="auto"?c:a);const f={},u=(m,y)=>{M_(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 $_=/\sid="(\S+)"/g,Cd=new Map;function R_(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Cd.get(e)||0;return Cd.set(e,t+1),t?`${e}${t}`:e}function I_(e){const t=[];let r;for(;r=$_.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=R_(o),n=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+n+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function P_(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 Rm={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},kl=new Map,Im=new Map,Pm=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)Im.set(t.name,t.loader);else if("icons"in t)kl.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"),Dm=p(async(e,t)=>{const r=S_(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=kl.get(i);if(!o){const n=Im.get(i);if(!n)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await n(),prefix:i},kl.set(i,o)}catch(a){throw V.error(a),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=__(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),D_=p(async e=>{try{return await Dm(e),!0}catch{return!1}},"isIconAvailable"),to=p(async(e,t,r)=>{let i;try{i=await Dm(e,t?.fallbackPrefix)}catch(n){V.error(n),i=Rm}const o=O_(i,t),s=P_(I_(o.body),{...o.attributes,...r});return _e(s,Rt())},"getIconSVG");function Nh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ii=Nh();function Nm(e){ii=e}var Ro={exec:()=>null};function Bt(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let n=typeof s=="string"?s:s.source;return n=n.replace(ue.caret,"$1"),r=r.replace(o,n),i},getRegex:()=>new RegExp(r,t)};return i}var N_=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ue={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")},q_=/^(?:[ \t]*(?:\n|$))+/,z_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,j_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,os=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,W_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qh=/(?:[*+-]|\d{1,9}[.)])/,qm=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zm=Bt(qm).replace(/bull/g,qh).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(),H_=Bt(qm).replace(/bull/g,qh).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(),zh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Y_=/^[^\n]+/,jh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,U_=Bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",jh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),G_=Bt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qh).getRegex(),jn="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",Wh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,X_=Bt("^ {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",Wh).replace("tag",jn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jm=Bt(zh).replace("hr",os).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",jn).getRegex(),V_=Bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jm).getRegex(),Hh={blockquote:V_,code:z_,def:U_,fences:j_,heading:W_,hr:os,html:X_,lheading:zm,list:G_,newline:q_,paragraph:jm,table:Ro,text:Y_},bd=Bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",os).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",jn).getRegex(),K_={...Hh,lheading:H_,table:bd,paragraph:Bt(zh).replace("hr",os).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",bd).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",jn).getRegex()},Z_={...Hh,html:Bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wh).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:Ro,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bt(zh).replace("hr",os).replace("heading",` *#{1,6} *[^
164
+ ]`).replace("lheading",zm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Q_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,J_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Wm=/^( {2,}|\\)\n(?!\s*$)/,tB=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Wn=/[\p{P}\p{S}]/u,Yh=/[\s\p{P}\p{S}]/u,Hm=/[^\s\p{P}\p{S}]/u,eB=Bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yh).getRegex(),Ym=/(?!~)[\p{P}\p{S}]/u,rB=/(?!~)[\s\p{P}\p{S}]/u,iB=/(?:[^\s\p{P}\p{S}]|~)/u,oB=Bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",N_?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Um=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,sB=Bt(Um,"u").replace(/punct/g,Wn).getRegex(),nB=Bt(Um,"u").replace(/punct/g,Ym).getRegex(),Gm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",aB=Bt(Gm,"gu").replace(/notPunctSpace/g,Hm).replace(/punctSpace/g,Yh).replace(/punct/g,Wn).getRegex(),lB=Bt(Gm,"gu").replace(/notPunctSpace/g,iB).replace(/punctSpace/g,rB).replace(/punct/g,Ym).getRegex(),hB=Bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Hm).replace(/punctSpace/g,Yh).replace(/punct/g,Wn).getRegex(),cB=Bt(/\\(punct)/,"gu").replace(/punct/g,Wn).getRegex(),dB=Bt(/^<(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(),uB=Bt(Wh).replace("(?:-->|$)","-->").getRegex(),fB=Bt("^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",uB).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),dn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,gB=Bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",dn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xm=Bt(/^!?\[(label)\]\[(ref)\]/).replace("label",dn).replace("ref",jh).getRegex(),Vm=Bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",jh).getRegex(),pB=Bt("reflink|nolink(?!\\()","g").replace("reflink",Xm).replace("nolink",Vm).getRegex(),kd=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Uh={_backpedal:Ro,anyPunctuation:cB,autolink:dB,blockSkip:oB,br:Wm,code:J_,del:Ro,emStrongLDelim:sB,emStrongRDelimAst:aB,emStrongRDelimUnd:hB,escape:Q_,link:gB,nolink:Vm,punctuation:eB,reflink:Xm,reflinkSearch:pB,tag:fB,text:tB,url:Ro},mB={...Uh,link:Bt(/^!?\[(label)\]\((.*?)\)/).replace("label",dn).getRegex(),reflink:Bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",dn).getRegex()},wl={...Uh,emStrongRDelimAst:lB,emStrongLDelim:nB,url:Bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",kd).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:Bt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",kd).getRegex()},yB={...wl,br:Bt(Wm).replace("{2,}","*").getRegex(),text:Bt(wl.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ys={normal:Hh,gfm:K_,pedantic:Z_},uo={normal:Uh,gfm:wl,breaks:yB,pedantic:mB},xB={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wd=e=>xB[e];function Ye(e,t){if(t){if(ue.escapeTest.test(e))return e.replace(ue.escapeReplace,wd)}else if(ue.escapeTestNoEncode.test(e))return e.replace(ue.escapeReplaceNoEncode,wd);return e}function Sd(e){try{e=encodeURI(e).replace(ue.percentDecode,"%")}catch{return null}return e}function Td(e,t){let r=e.replace(ue.findPipe,(s,n,a)=>{let l=!1,c=n;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ue.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(ue.slashPipe,"|");return i}function fo(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 CB(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 vd(e,t,r,i,o){let s=t.href,n=t.title||null,a=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:n,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function bB(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 n=s.match(r.other.beginningSpace);if(n===null)return s;let[a]=n;return a.length>=o.length?s.slice(o.length):s}).join(`
166
+ `)}var un=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:fo(i,`
167
+ `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=bB(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=fo(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:fo(r[0],`
168
+ `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=fo(r[0],`
169
+ `).split(`
170
+ `),o="",s="",n=[];for(;i.length>0;){let a=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),a=!0;else if(!a)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,n,!0),this.lexer.state.top=f,i.length===0)break;let u=n.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);n[n.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);n[n.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(n.at(-1).raw.length).split(`
179
+ `);continue}}return{type:"blockquote",raw:o,tokens:n,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 n=this.rules.other.listItemRegex(i),a=!1;for(;t;){let c=!1,h="",d="";if(!(r=n.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),w=this.rules.other.hrRegex(m),S=this.rules.other.fencesBeginRegex(m),T=this.rules.other.headingBeginRegex(m),B=this.rules.other.htmlBeginRegex(m);for(;t;){let E=t.split(`
183
+ `,1)[0],_;if(u=E,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),_=u):_=u.replace(this.rules.other.tabCharGlobal," "),S.test(u)||T.test(u)||B.test(u)||C.test(u)||w.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)||T.test(f)||w.test(f))break;d+=`
185
+ `+u}!g&&!u.trim()&&(g=!0),h+=E+`
186
+ `,t=t.substring(E.length+1),f=_.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!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=Td(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
187
+ `):[],n={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let a of o)this.rules.other.tableAlignRight.test(a)?n.align.push("right"):this.rules.other.tableAlignCenter.test(a)?n.align.push("center"):this.rules.other.tableAlignLeft.test(a)?n.align.push("left"):n.align.push(null);for(let a=0;a<i.length;a++)n.header.push({text:i[a],tokens:this.lexer.inline(i[a]),header:!0,align:n.align[a]});for(let a of s)n.rows.push(Td(a,n.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:n.align[c]})));return n}}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 n=fo(i.slice(0,-1),"\\");if((i.length-n.length)%2===0)return}else{let n=CB(r[2],"()");if(n===-2)return;if(n>-1){let a=(r[0].indexOf("!")===0?5:4)+r[1].length+n;r[2]=r[2].substring(0,n),r[0]=r[0].substring(0,a).trim(),r[3]=""}}let o=r[2],s="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(o);n&&(o=n[1],s=n[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)),vd(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 n=i[0].charAt(0);return{type:"text",raw:n,text:n}}return vd(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,n,a,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(n=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!n)continue;if(a=[...n].length,o[3]||o[4]){l+=a;continue}else if((o[5]||o[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let d=[...o[0]][0].length,f=t.slice(0,s+o.index+d+a);if(Math.min(s,a)%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}}}},$e=class Sl{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 un,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:ue,block:ys.normal,inline:uo.normal};this.options.pedantic?(r.block=ys.pedantic,r.inline=uo.pedantic):this.options.gfm&&(r.block=ys.gfm,this.options.breaks?r.inline=uo.breaks:r.inline=uo.gfm),this.tokenizer.rules=r}static get rules(){return{block:ys,inline:uo}}static lex(t,r){return new Sl(r).lex(t)}static lexInline(t,r){return new Sl(r).inlineTokens(t)}lex(t){t=t.replace(ue.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(ue.tabCharGlobal," ").replace(ue.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(n=>(o=n.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 n=r.at(-1);o.raw.length===1&&n!==void 0?n.raw+=`
190
+ `:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let n=r.at(-1);n?.type==="paragraph"||n?.type==="text"?(n.raw+=(n.raw.endsWith(`
191
+ `)?"":`
192
+ `)+o.raw,n.text+=`
193
+ `+o.text,this.inlineQueue.at(-1).src=n.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 n=r.at(-1);n?.type==="paragraph"||n?.type==="text"?(n.raw+=(n.raw.endsWith(`
194
+ `)?"":`
195
+ `)+o.raw,n.text+=`
196
+ `+o.raw,this.inlineQueue.at(-1).src=n.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 n=1/0,a=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),typeof l=="number"&&l>=0&&(n=Math.min(n,l))}),n<1/0&&n>=0&&(s=t.substring(0,n+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let n=r.at(-1);i&&n?.type==="paragraph"?(n.raw+=(n.raw.endsWith(`
197
+ `)?"":`
198
+ `)+o.raw,n.text+=`
199
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.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 n=r.at(-1);n?.type==="text"?(n.raw+=(n.raw.endsWith(`
200
+ `)?"":`
201
+ `)+o.raw,n.text+=`
202
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):r.push(o);continue}if(t){let n="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(n);break}else throw new Error(n)}}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 n=!1,a="";for(;t;){n||(a=""),n=!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,a)){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)!=="_"&&(a=l.raw.slice(-1)),n=!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}},fn=class{options;parser;constructor(t){this.options=t||ii}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(ue.notSpaceStart)?.[0],s=t.replace(ue.endingNewline,"")+`
203
+ `;return o?'<pre><code class="language-'+Ye(o)+'">'+(i?s:Ye(s,!0))+`</code></pre>
204
+ `:"<pre><code>"+(i?s:Ye(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 a=0;a<t.items.length;a++){let l=t.items[a];o+=this.listitem(l)}let s=r?"ol":"ul",n=r&&i!==1?' start="'+i+'"':"";return"<"+s+n+`>
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+" "+Ye(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 n=t.rows[s];i="";for(let a=0;a<n.length;a++)i+=this.tablecell(n[a]);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>${Ye(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=Sd(t);if(s===null)return o;t=s;let n='<a href="'+t+'"';return r&&(n+=' title="'+Ye(r)+'"'),n+=">"+o+"</a>",n}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=Sd(t);if(s===null)return Ye(i);t=s;let n=`<img src="${t}" alt="${i}"`;return r&&(n+=` title="${Ye(r)}"`),n+=">",n}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ye(t.text)}},Gh=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 Tl{options;renderer;textRenderer;constructor(t){this.options=t||ii,this.options.renderer=this.options.renderer||new fn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Gh}static parse(t,r){return new Tl(r).parse(t)}static parseInline(t,r){return new Tl(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 a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){i+=l||"";continue}}let n=s;switch(n.type){case"space":{i+=this.renderer.space(n);continue}case"hr":{i+=this.renderer.hr(n);continue}case"heading":{i+=this.renderer.heading(n);continue}case"code":{i+=this.renderer.code(n);continue}case"table":{i+=this.renderer.table(n);continue}case"blockquote":{i+=this.renderer.blockquote(n);continue}case"list":{i+=this.renderer.list(n);continue}case"html":{i+=this.renderer.html(n);continue}case"def":{i+=this.renderer.def(n);continue}case"paragraph":{i+=this.renderer.paragraph(n);continue}case"text":{let a=n,l=this.renderer.text(a);for(;o+1<t.length&&t[o+1].type==="text";)a=t[++o],l+=`
221
+ `+this.renderer.text(a);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 a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}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 a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=a||"";continue}}let n=s;switch(n.type){case"escape":{i+=r.text(n);break}case"html":{i+=r.html(n);break}case"link":{i+=r.link(n);break}case"image":{i+=r.image(n);break}case"strong":{i+=r.strong(n);break}case"em":{i+=r.em(n);break}case"codespan":{i+=r.codespan(n);break}case"br":{i+=r.br(n);break}case"del":{i+=r.del(n);break}case"text":{i+=r.text(n);break}default:{let a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}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?$e.lex:$e.lexInline}provideParser(){return this.block?Re.parse:Re.parseInline}},kB=class{defaults=Nh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Re;Renderer=fn;TextRenderer=Gh;Lexer=$e;Tokenizer=un;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 n of s.header)i=i.concat(this.walkTokens(n.tokens,r));for(let n of s.rows)for(let a of n)i=i.concat(this.walkTokens(a.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(n=>{let a=s[n].flat(1/0);i=i.concat(this.walkTokens(a,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 n=r.renderers[s.name];n?r.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=n.apply(this,a)),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 n=r[s.level];n?n.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 fn(this.defaults);for(let n in i.renderer){if(!(n in s))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let a=n,l=i.renderer[a],c=s[a];s[a]=(...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 un(this.defaults);for(let n in i.tokenizer){if(!(n in s))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let a=n,l=i.tokenizer[a],c=s[a];s[a]=(...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 n in i.hooks){if(!(n in s))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let a=n,l=i.hooks[a],c=s[a];vo.passThroughHooks.has(n)?s[a]=h=>{if(this.defaults.async&&vo.passThroughHooksRespectAsync.has(n))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[a]=(...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,n=i.walkTokens;o.walkTokens=function(a){let l=[];return l.push(n.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return $e.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},n=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return n(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 n(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return n(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 a=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?$e.lex:$e.lexInline)(a,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(n);try{s.hooks&&(r=s.hooks.preprocess(r));let a=(s.hooks?s.hooks.provideLexer():t?$e.lex:$e.lexInline)(r,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?Re.parse:Re.parseInline)(a,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(a){return n(a)}}}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>"+Ye(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},ei=new kB;function Et(e,t){return ei.parse(e,t)}Et.options=Et.setOptions=function(e){return ei.setOptions(e),Et.defaults=ei.defaults,Nm(Et.defaults),Et};Et.getDefaults=Nh;Et.defaults=ii;Et.use=function(...e){return ei.use(...e),Et.defaults=ei.defaults,Nm(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=fn;Et.TextRenderer=Gh;Et.Lexer=$e;Et.lexer=$e.lex;Et.Tokenizer=un;Et.Hooks=vo;Et.parse=Et;Et.options;Et.setOptions;Et.use;Et.walkTokens;Et.parseInline;Re.parse;$e.lex;function Km(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(a,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?a.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})):a},[]);if(o.length){var s=new RegExp(`
223
+ [ ]{`+Math.min.apply(Math,o)+"}","g");i=i.map(function(a){return a.replace(s,`
224
+ `)})}i[0]=i[0].replace(/^\r?\n/,"");var n=i[0];return t.forEach(function(a,l){var c=n.match(/(?:^|\n)( *)$/),h=c?c[1]:"",d=a;typeof a=="string"&&a.includes(`
225
+ `)&&(d=String(a).split(`
226
+ `).map(function(f,u){return u===0?f:""+h+f}).join(`
227
+ `)),n+=d+i[l+1]}),n}function Zm(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
228
+ `).replace(/\n{2,}/g,`
229
+ `);return Km(i)}p(Zm,"preprocessMarkdown");function Qm(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(Qm,"nonMarkdownToLines");function Jm(e,t={}){const r=Zm(e,t),i=Et.lexer(r),o=[[]];let s=0;function n(a,l="normal"){a.type==="text"?a.text.split(`
230
+ `).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(f=>{f=f.replace(/&#39;/g,"'"),f&&o[s].push({content:f,type:l})})}):a.type==="strong"||a.type==="em"?a.tokens.forEach(c=>{n(c,a.type)}):a.type==="html"&&o[s].push({content:a.text,type:"normal"})}return p(n,"processNode"),i.forEach(a=>{a.type==="paragraph"?a.tokens?.forEach(l=>{n(l)}):a.type==="html"?o[s].push({content:a.text,type:"normal"}):o[s].push({content:a.raw,type:"normal"})}),o}p(Jm,"markdownToLines");function ty(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}p(ty,"nonMarkdownToHTML");function ey(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,"&nbsp;"):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(ey,"markdownToHTML");function ry(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(ry,"splitTextToChars");function iy(e,t){const r=ry(t.content);return Xh(e,[],r,t.type)}p(iy,"splitWordToFitWidth");function Xh(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,n=[...t,o];return e([{content:n.join(""),type:i}])?Xh(e,n,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(Xh,"splitWordToFitWidthRecursion");function oy(e,t){if(e.some(({content:r})=>r.includes(`
231
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return gn(e,t)}p(oy,"splitLineToFitWidth");function gn(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"},n=[...i];if(o!==""&&n.push({content:o,type:"normal"}),n.push(s),t(n))return gn(e,t,r,n);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[a,l]=iy(t,s);r.push([a]),l.content&&e.unshift(l)}return gn(e,t,r)}p(gn,"splitLineToFitWidthRecursion");function vl(e,t){t&&e.attr("style",t)}p(vl,"applyStyle");var _d=16384;async function sy(e,t,r,i,o=!1,s=Rt()){const n=e.append("foreignObject");n.attr("width",`${Math.min(10*r,_d)}px`),n.attr("height",`${Math.min(10*r,_d)}px`);const a=n.append("xhtml:div"),l=zi(t.label)?await Ql(t.label.replace(Zi.lineBreakRegex,`
232
+ `),s):_e(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=a.append("span");h.html(l),vl(h,t.labelStyle),h.attr("class",`${c} ${i}`),vl(a,t.labelStyle),a.style("display","table-cell"),a.style("white-space","nowrap"),a.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(a.style("max-width",r+"px"),a.style("text-align","center")),a.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&a.attr("class","labelBkg");let d=a.node().getBoundingClientRect();return d.width===r&&(a.style("display","table"),a.style("white-space","break-spaces"),a.style("width",r+"px"),d=a.node().getBoundingClientRect()),n.node()}p(sy,"addHtmlSpan");function Hn(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(Hn,"createTspan");function ny(e,t,r){const i=e.append("text"),o=Hn(i,1,t);Yn(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}p(ny,"computeWidthOfText");function ay(e,t,r){const i=e.append("text"),o=Hn(i,1,t);Yn(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}p(ay,"computeDimensionOfText");function ly(e,t,r,i=!1,o=!1){const n=t.append("g"),a=n.insert("rect").attr("class","background").attr("style","stroke: none"),l=n.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=p(u=>ny(n,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:oy(h,d);for(const u of f){const g=Hn(l,c,1.1,o);Yn(g,u),c++}}if(i){const h=l.node().getBBox(),d=2;return a.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),n.node()}else return l.node()}p(ly,"createFormattedText");function _l(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(_l,"decodeHTMLEntities");function Yn(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(_l(r.content)):o.text(" "+_l(r.content))})}p(Yn,"updateTextContentAndStyles");async function hy(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,n)=>(r.push((async()=>{const a=`${s}:${n}`;return await D_(a)?await to(a,void 0,{class:"label-icon"}):`<i class='${_e(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(hy,"replaceIconSubstring");var ze=p(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:n=!0,isNode:a=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,o,s,a,"addSvgBackground: ",c),s){const d=n?ey(t,h):ty(t),f=await hy(Br(d),h),u=t.replace(/\\\\/g,"\\"),g={isNode:a,label:zi(t)?u:f,labelStyle:r.replace("fill:","color:")};return await sy(e,g,l,o,c,h)}else{const d=Br(t.replace(/<br\s*\/?>/g,"<br/>")),f=n?Jm(d.replace("<br>","<br/>"),h):Qm(d),u=ly(l,e,f,t?c:!1,!a);if(a){/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 xa(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,n=Math.cos(s),a=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*n-(h-o)*a+i,l[1]=(c-i)*a+(h-o)*n+o}}}function wB(e,t){return e[0]===t[0]&&e[1]===t[1]}function SB(e,t,r,i=1){const o=r,s=Math.max(t,.1),n=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,a=[0,0];if(o)for(const c of n)xa(c,a,o);const l=(function(c,h,d){const f=[];for(const C of c){const w=[...C];wB(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&f.push(w)}const u=[];h=Math.max(h,.1);const g=[];for(const C of f)for(let w=0;w<C.length-1;w++){const S=C[w],T=C[w+1];if(S[1]!==T[1]){const B=Math.min(S[1],T[1]);g.push({ymin:B,ymax:Math.max(S[1],T[1]),x:B===S[1]?S[0]:T[0],islope:(T[0]-S[0])/(T[1]-S[1])})}}if(g.sort(((C,w)=>C.ymin<w.ymin?-1:C.ymin>w.ymin?1:C.x<w.x?-1:C.x>w.x?1:C.ymax===w.ymax?0:(C.ymax-w.ymax)/Math.abs(C.ymax-w.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 w=0;w<g.length&&!(g[w].ymin>y);w++)C=w;g.splice(0,C+1).forEach((w=>{m.push({s:y,edge:w})}))}if(m=m.filter((C=>!(C.edge.ymax<=y))),m.sort(((C,w)=>C.edge.x===w.edge.x?0:(C.edge.x-w.edge.x)/Math.abs(C.edge.x-w.edge.x))),(d!==1||x%h==0)&&m.length>1)for(let C=0;C<m.length;C+=2){const w=C+1;if(w>=m.length)break;const S=m[C].edge,T=m[w].edge;u.push([[Math.round(S.x),y],[Math.round(T.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return u})(n,s,i);if(o){for(const c of n)xa(c,a,-o);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),xa(f,h,d)})(l,a,-o)}return l}function ss(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),SB(e,o,i,s||1)}class Vh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=ss(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 Un(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 TB extends Vh{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=ss(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,n=[],a=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)Un([c,h])&&n.push([[c[0]-a,c[1]+l],[...h]],[[c[0]+a,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(n,r)}}}class vB extends Vh{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 _B{constructor(t){this.helper=t}fillPolygons(t,r){const i=ss(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 n=o/4;for(const a of t){const l=Un(a),c=l/o,h=Math.ceil(c)-1,d=l-h*o,f=(a[0][0]+a[1][0])/2-o/4,u=Math.min(a[0][1],a[1][1]);for(let g=0;g<h;g++){const m=u+d+g*o,y=f-n+2*Math.random()*n,x=m-n+2*Math.random()*n,C=this.helper.ellipse(y,x,s,s,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class BB{constructor(t){this.helper=t}fillPolygons(t,r){const i=ss(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((n=>{const a=Un(n),l=Math.floor(a/(i+o)),c=(a+o-l*(i+o))/2;let h=n[0],d=n[1];h[0]>d[0]&&(h=n[1],d=n[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 LB{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=ss(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 n=Un(s),a=Math.round(n/(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<a;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 pe={};class EB{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const FB=0,Ca=1,Bd=2,xs={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 ba(e,t){return e.type===t}function Kh(e){const t=[],r=(function(n){const a=new Array;for(;n!=="";)if(n.match(/^([ \t\r\n,]+)/))n=n.substr(RegExp.$1.length);else if(n.match(/^([aAcChHlLmMqQsStTvVzZ])/))a[a.length]={type:FB,text:RegExp.$1},n=n.substr(RegExp.$1.length);else{if(!n.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];a[a.length]={type:Ca,text:`${parseFloat(RegExp.$1)}`},n=n.substr(RegExp.$1.length)}return a[a.length]={type:Bd,text:""},a})(e);let i="BOD",o=0,s=r[o];for(;!ba(s,Bd);){let n=0;const a=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return Kh("M0,0"+e);o++,n=xs[s.text],i=s.text}else ba(s,Ca)?n=xs[i]:(o++,n=xs[s.text],i=s.text);if(!(o+n<r.length))throw new Error("Path data ended short");for(let l=o;l<o+n;l++){const c=r[l];if(!ba(c,Ca))throw new Error("Param not a number: "+i+","+c.text);a[a.length]=+c.text}if(typeof xs[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:a};t.push(l),o+=n,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function cy(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:n,data:a}of e)switch(n){case"M":s.push({key:"M",data:[...a]}),[t,r]=a,[i,o]=a;break;case"m":t+=a[0],r+=a[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...a]}),[t,r]=a;break;case"l":t+=a[0],r+=a[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...a]}),t=a[4],r=a[5];break;case"c":{const l=a.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:[...a]}),t=a[2],r=a[3];break;case"q":{const l=a.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:[...a]}),t=a[5],r=a[6];break;case"a":t+=a[5],r+=a[6],s.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],t,r]});break;case"H":s.push({key:"H",data:[...a]}),t=a[0];break;case"h":t+=a[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...a]}),r=a[0];break;case"v":r+=a[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...a]}),t=a[2],r=a[3];break;case"s":{const l=a.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:[...a]}),t=a[0],r=a[1];break;case"t":t+=a[0],r+=a[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 dy(e){const t=[];let r="",i=0,o=0,s=0,n=0,a=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,n]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],a=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-a),f=o+(o-l)):(d=i,f=o),t.push({key:"C",data:[d,f,...h]}),a=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-a),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]}),a=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]}),a=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)&&(uy(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=n}r=c}return t}function go(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function uy(e,t,r,i,o,s,n,a,l,c){const h=(d=n,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]=go(e,t,-h),[r,i]=go(r,i,-h);const j=(e-r)/2,N=(t-i)/2;let $=j*j/(o*o)+N*N/(s*s);$>1&&($=Math.sqrt($),o*=$,s*=$);const F=o*o,q=s*s,A=F*q-F*N*N-q*j*j,I=F*N*N+q*j*j,P=(a===l?-1:1)*Math.sqrt(Math.abs(A/I));m=P*o*N/s+(e+r)/2,y=P*-s*j/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 j=g,N=r,$=i;g=l&&g>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=uy(r=m+o*Math.cos(g),i=y+s*Math.sin(g),N,$,o,s,n,0,l,[g,j,m,y])}x=g-u;const C=Math.cos(u),w=Math.sin(u),S=Math.cos(g),T=Math.sin(g),B=Math.tan(x/4),E=4/3*o*B,_=4/3*s*B,D=[e,t],O=[e+E*w,t-_*C],R=[r+E*T,i-_*S],W=[r,i];if(O[0]=2*D[0]-O[0],O[1]=2*D[1]-O[1],c)return[O,R,W].concat(f);{f=[O,R,W].concat(f);const j=[];for(let N=0;N<f.length;N+=3){const $=go(f[N][0],f[N][1],h),F=go(f[N+1][0],f[N+1][1],h),q=go(f[N+2][0],f[N+2][1],h);j.push([$[0],$[1],F[0],F[1],q[0],q[1]])}return j}}const AB={randOffset:function(e,t){return ft(e,t)},randOffsetWithRange:function(e,t,r){return pn(e,t,r)},ellipse:function(e,t,r,i,o){const s=gy(r,i,o);return Bl(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return Lr(e,t,r,i,o,!0)}};function fy(e,t,r,i,o){return{type:"path",ops:Lr(e,t,r,i,o)}}function Rs(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...Lr(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...Lr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?fy(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function MB(e,t,r,i,o){return(function(s,n){return Rs(s,!0,n)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function Ld(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Cs(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:Cs(r[0],1.5*(1+.22*t.roughness),Ad(t));for(let s=1;s<r.length;s++){const n=r[s];if(n.length){const a=Cs(n,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Cs(n,1.5*(1+.22*t.roughness),Ad(t));for(const c of a)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 gy(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 n=Math.abs(e/2),a=Math.abs(t/2);const l=1-r.curveFitting;return n+=ft(n*l,r),a+=ft(a*l,r),{increment:s,rx:n,ry:a}}function Bl(e,t,r,i){const[o,s]=Md(i.increment,e,t,i.rx,i.ry,1,i.increment*pn(.1,pn(.4,1,r),r),r);let n=mn(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[a]=Md(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=mn(a,null,r);n=n.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:n}}}function Ed(e,t,r,i,o,s,n,a,l){const c=e,h=t;let d=Math.abs(r/2),f=Math.abs(i/2);d+=ft(.01*d,l),f+=ft(.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=Od(y,c,h,d,f,u,g,1,l);if(!l.disableMultiStroke){const C=Od(y,c,h,d,f,u,g,1.5,l);x.push(...C)}return n&&(a?x.push(...Lr(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...Lr(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 Fd(e,t){const r=dy(cy(Kh(e))),i=[];let o=[0,0],s=[0,0];for(const{key:n,data:a}of r)switch(n){case"M":s=[a[0],a[1]],o=[a[0],a[1]];break;case"L":i.push(...Lr(s[0],s[1],a[0],a[1],t)),s=[a[0],a[1]];break;case"C":{const[l,c,h,d,f,u]=a;i.push(...OB(l,c,h,d,f,u,s,t)),s=[f,u];break}case"Z":i.push(...Lr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function ka(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]+ft(o,t),i[0][1]+ft(o,t)]});for(let n=1;n<s;n++)r.push({op:"lineTo",data:[i[n][0]+ft(o,t),i[n][1]+ft(o,t)]})}}return{type:"fillPath",ops:r}}function hi(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!pe[o])switch(o){case"zigzag":pe[o]||(pe[o]=new TB(i));break;case"cross-hatch":pe[o]||(pe[o]=new vB(i));break;case"dots":pe[o]||(pe[o]=new _B(i));break;case"dashed":pe[o]||(pe[o]=new BB(i));break;case"zigzag-line":pe[o]||(pe[o]=new LB(i));break;default:o="hachure",pe[o]||(pe[o]=new Vh(i))}return pe[o]})(t,AB).fillPolygons(e,t)}function Ad(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function py(e){return e.randomizer||(e.randomizer=new EB(e.seed||0)),e.randomizer.next()}function pn(e,t,r,i=1){return r.roughness*i*(py(r)*(t-e)+e)}function ft(e,t,r=1){return pn(-e,e,t,r)}function Lr(e,t,r,i,o,s=!1){const n=s?o.disableMultiStrokeFill:o.disableMultiStroke,a=Ll(e,t,r,i,o,!0,!1);if(n)return a;const l=Ll(e,t,r,i,o,!0,!0);return a.concat(l)}function Ll(e,t,r,i,o,s,n){const a=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(a);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>a&&(h=l/10);const d=h/2,f=.2+.2*py(o);let u=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;u=ft(u,o,c),g=ft(g,o,c);const m=[],y=()=>ft(d,o,c),x=()=>ft(h,o,c),C=o.preserveVertices;return n?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:ft(h,o,c)),t+(C?0:ft(h,o,c))]}),n?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 Cs(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ft(t,r),e[0][1]+ft(t,r)]),i.push([e[0][0]+ft(t,r),e[0][1]+ft(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+ft(t,r),e[o][1]+ft(t,r)]),o===e.length-1&&i.push([e[o][0]+ft(t,r),e[o][1]+ft(t,r)]);return mn(i,null,r)}function mn(e,t,r){const i=e.length,o=[];if(i>3){const s=[],n=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let a=1;a+2<i;a++){const l=e[a];s[0]=[l[0],l[1]],s[1]=[l[0]+(n*e[a+1][0]-n*e[a-1][0])/6,l[1]+(n*e[a+1][1]-n*e[a-1][1])/6],s[2]=[e[a+1][0]+(n*e[a][0]-n*e[a+2][0])/6,e[a+1][1]+(n*e[a][1]-n*e[a+2][1])/6],s[3]=[e[a+1][0],e[a+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(...Ll(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function Md(e,t,r,i,o,s,n,a){const l=[],c=[];if(a.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=ft(.5,a)-Math.PI/2;c.push([ft(s,a)+t+.9*i*Math.cos(h-e),ft(s,a)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let f=h;f<d;f+=e){const u=[ft(s,a)+t+i*Math.cos(f),ft(s,a)+r+o*Math.sin(f)];l.push(u),c.push(u)}c.push([ft(s,a)+t+i*Math.cos(h+2*Math.PI+.5*n),ft(s,a)+r+o*Math.sin(h+2*Math.PI+.5*n)]),c.push([ft(s,a)+t+.98*i*Math.cos(h+n),ft(s,a)+r+.98*o*Math.sin(h+n)]),c.push([ft(s,a)+t+.9*i*Math.cos(h+.5*n),ft(s,a)+r+.9*o*Math.sin(h+.5*n)])}return[c,l]}function Od(e,t,r,i,o,s,n,a,l){const c=s+ft(.1,l),h=[];h.push([ft(a,l)+t+.9*i*Math.cos(c-e),ft(a,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=n;d+=e)h.push([ft(a,l)+t+i*Math.cos(d),ft(a,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(n),r+o*Math.sin(n)]),h.push([t+i*Math.cos(n),r+o*Math.sin(n)]),mn(h,null,l)}function OB(e,t,r,i,o,s,n,a){const l=[],c=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let h=[0,0];const d=a.disableMultiStroke?1:2,f=a.preserveVertices;for(let u=0;u<d;u++)u===0?l.push({op:"move",data:[n[0],n[1]]}):l.push({op:"move",data:[n[0]+(f?0:ft(c[0],a)),n[1]+(f?0:ft(c[0],a))]}),h=f?[o,s]:[o+ft(c[u],a),s+ft(c[u],a)],l.push({op:"bcurveTo",data:[e+ft(c[u],a),t+ft(c[u],a),r+ft(c[u],a),i+ft(c[u],a),h[0],h[1]]});return l}function po(e){return[...e]}function $d(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(po(e[0]),po(e[1]),po(e[2]),po(e[2]));else{const o=[];o.push(e[0],e[0]);for(let a=1;a<e.length;a++)o.push(e[a]),a===e.length-1&&o.push(e[a]);const s=[],n=1-t;i.push(po(o[0]));for(let a=1;a+2<o.length;a++){const l=o[a];s[0]=[l[0],l[1]],s[1]=[l[0]+(n*o[a+1][0]-n*o[a-1][0])/6,l[1]+(n*o[a+1][1]-n*o[a-1][1])/6],s[2]=[o[a+1][0]+(n*o[a][0]-n*o[a+2][0])/6,o[a+1][1]+(n*o[a][1]-n*o[a+2][1])/6],s[3]=[o[a+1][0],o[a+1][1]],i.push(s[1],s[2],s[3])}}return i}function Is(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function $B(e,t,r){const i=Is(t,r);if(i===0)return Is(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)),Is(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 El(e,t,r,i){const o=i||[];if((function(a,l){const c=a[l+0],h=a[l+1],d=a[l+2],f=a[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 a=e[t+0];o.length?(s=o[o.length-1],n=a,Math.sqrt(Is(s,n))>1&&o.push(a)):o.push(a),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);El([l,f,m,x],0,r,o),El([x,y,g,d],0,r,o)}var s,n;return o}function RB(e,t){return yn(e,0,e.length,t)}function yn(e,t,r,i,o){const s=o||[],n=e[t],a=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=$B(e[h],n,a);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(yn(e,t,c+1,i,s),yn(e,c,r,i,s)):(s.length||s.push(n),s.push(a)),s}function wa(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)El(e,3*s,t,i);return r&&r>0?yn(i,0,i.length,r):i}const Ce="none";class xn{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 n=this._o(s);return this._d("line",[fy(t,r,i,o,n)],n)}rectangle(t,r,i,o,s){const n=this._o(s),a=[],l=MB(t,r,i,o,n);if(n.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];n.fillStyle==="solid"?a.push(ka([c],n)):a.push(hi([c],n))}return n.stroke!==Ce&&a.push(l),this._d("rectangle",a,n)}ellipse(t,r,i,o,s){const n=this._o(s),a=[],l=gy(i,o,n),c=Bl(t,r,n,l);if(n.fill)if(n.fillStyle==="solid"){const h=Bl(t,r,n,l).opset;h.type="fillPath",a.push(h)}else a.push(hi([c.estimatedPoints],n));return n.stroke!==Ce&&a.push(c.opset),this._d("ellipse",a,n)}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",[Rs(t,!1,i)],i)}arc(t,r,i,o,s,n,a=!1,l){const c=this._o(l),h=[],d=Ed(t,r,i,o,s,n,a,!0,c);if(a&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=Ed(t,r,i,o,s,n,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,g,m,y,x,C){const w=f,S=u;let T=Math.abs(g/2),B=Math.abs(m/2);T+=ft(.01*T,C),B+=ft(.01*B,C);let E=y,_=x;for(;E<0;)E+=2*Math.PI,_+=2*Math.PI;_-E>2*Math.PI&&(E=0,_=2*Math.PI);const D=(_-E)/C.curveStepCount,O=[];for(let R=E;R<=_;R+=D)O.push([w+T*Math.cos(R),S+B*Math.sin(R)]);return O.push([w+T*Math.cos(_),S+B*Math.sin(_)]),O.push([w,S]),hi([O],C)})(t,r,i,o,s,n,c));return c.stroke!==Ce&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=Ld(t,i);if(i.fill&&i.fill!==Ce)if(i.fillStyle==="solid"){const n=Ld(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(n.ops)})}else{const n=[],a=t;if(a.length){const l=typeof a[0][0]=="number"?[a]:a;for(const c of l)c.length<3?n.push(...c):c.length===3?n.push(...wa($d([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):n.push(...wa($d(c),10,(1+i.roughness)/2))}n.length&&o.push(hi([n],i))}return i.stroke!==Ce&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=Rs(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(ka([t],i)):o.push(hi([t],i))),i.stroke!==Ce&&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!==Ce,n=i.stroke!==Ce,a=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=dy(cy(Kh(h))),g=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...wa(x,d)),x=[]},w=()=>{C(),m.length&&(g.push(m),m=[])};for(const{key:T,data:B}of u)switch(T){case"M":w(),y=[B[0],B[1]],m.push(y);break;case"L":C(),m.push([B[0],B[1]]);break;case"C":if(!x.length){const E=m.length?m[m.length-1]:y;x.push([E[0],E[1]])}x.push([B[0],B[1]]),x.push([B[2],B[3]]),x.push([B[4],B[5]]);break;case"Z":C(),m.push([y[0],y[1]])}if(w(),!f)return g;const S=[];for(const T of g){const B=RB(T,f);B.length&&S.push(B)}return S})(t,1,a?4-4*(i.simplification||1):(1+i.roughness)/2),c=Fd(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=Fd(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(ka(l,i));else o.push(hi(l,i));return n&&(a?l.forEach((h=>{o.push(Rs(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((n=>+n.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 n=null;switch(s.type){case"path":n={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:Ce};break;case"fillPath":n={d:this.opsToPath(s),stroke:Ce,strokeWidth:0,fill:i.fill||Ce};break;case"fillSketch":n=this.fillSketch(s,i)}n&&o.push(n)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||Ce,strokeWidth:i,fill:Ce}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class IB{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new xn(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const n of r)switch(n.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,n,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const a=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,n,s,a),o.restore();break}case"fillSketch":this.fillSketch(o,n,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 n=typeof i=="number"&&i>=0?s.data.map((a=>+a.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(n[0],n[1]);break;case"bcurveTo":t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]);break;case"lineTo":t.lineTo(n[0],n[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 n=this.gen.line(t,r,i,o,s);return this.draw(n),n}rectangle(t,r,i,o,s){const n=this.gen.rectangle(t,r,i,o,s);return this.draw(n),n}ellipse(t,r,i,o,s){const n=this.gen.ellipse(t,r,i,o,s);return this.draw(n),n}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,n,a=!1,l){const c=this.gen.arc(t,r,i,o,s,n,a,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 bs="http://www.w3.org/2000/svg";class PB{constructor(t,r){this.svg=t,this.gen=new xn(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(bs,"g"),n=t.options.fixedDecimalPlaceDigits;for(const a of r){let l=null;switch(a.type){case"path":l=o.createElementNS(bs,"path"),l.setAttribute("d",this.opsToPath(a,n)),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(bs,"path"),l.setAttribute("d",this.opsToPath(a,n)),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,a,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(bs,"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 n=this.gen.line(t,r,i,o,s);return this.draw(n)}rectangle(t,r,i,o,s){const n=this.gen.rectangle(t,r,i,o,s);return this.draw(n)}ellipse(t,r,i,o,s){const n=this.gen.ellipse(t,r,i,o,s);return this.draw(n)}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,n,a=!1,l){const c=this.gen.arc(t,r,i,o,s,n,a,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 st={canvas:(e,t)=>new IB(e,t),svg:(e,t)=>new PB(e,t),generator:e=>new xn(e),newSeed:()=>xn.newSeed()},dt=p(async(e,t,r)=>{let i;const o=t.useHtmlLabels||tr(wt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),n=s.insert("g").attr("class","label").attr("style",Qt(t.labelStyle));let a;t.label===void 0?a="":a=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await ze(n,_e(Br(a),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 Dh(u,a),d=u.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?n.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):n.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&n.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:n}},"labelHelper"),Sa=p(async(e,t,r)=>{const i=r.useHtmlLabels??ae(wt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await ze(o,_e(Br(t),wt()),{useHtmlLabels:i,width:r.width||wt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let n=s.getBBox();const a=r.padding/2;if(ae(wt())){const l=s.children[0],c=yt(s);n=l.getBoundingClientRect(),c.attr("width",n.width),c.attr("height",n.height)}return i?o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"):o.attr("transform","translate(0, "+-n.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:n,halfPadding:a,label:o}},"insertLabel"),at=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 kt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(kt,"createPathFromPoints");function Er(e,t,r,i,o,s){const n=[],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));n.push({x:m,y})}return n}p(Er,"generateFullSineWavePoints");function Go(e,t,r,i,o,s){const n=[],a=o*Math.PI/180,h=(s*Math.PI/180-a)/(i-1);for(let d=0;d<i;d++){const f=a+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);n.push({x:-u,y:-g})}return n}p(Go,"generateCirclePoints");function Fl(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"),n=p((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:n(o,"fill"),"fill-opacity":n(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:n(s,"stroke"),"stroke-width":n(s,"stroke-width")??"1","stroke-opacity":n(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const a=document.createElementNS("http://www.w3.org/2000/svg","g");return a.appendChild(r),a}p(Fl,"mergePaths");var DB=p((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,n=e.width/2,a=e.height/2,l,c;return Math.abs(s)*n>Math.abs(o)*a?(s<0&&(a=-a),l=s===0?0:a*o/s,c=a):(o<0&&(n=-n),l=n,c=o===0?0:n*s/o),{x:r+l,y:i+c}},"intersectRect"),oi=DB,NB=p(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const n=wt(),a=ae(n);return await ze(e,s,{style:r,isTitle:i,useHtmlLabels:a,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},n)},"createLabel"),kr=NB,Ar=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"),qB=p(async(e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:n}=i,a=n,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=nt(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=tr(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 j=y.children[0],N=yt(y);x=j.getBoundingClientRect(),N.attr("width",x.width),N.attr("height",x.height)}const C=t.padding??0,w=t.width<=x.width+C?x.width+C:t.width;t.width<=x.width+C?t.diff=(w-t.width)/2-C:t.diff=-C;const S=t.height,T=t.y-S/2,B=t.y+S/2,E=t.x-w/2,_=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:T+S/3,D=g?4:0,O=x.height+2*D;let R,W;if(g){const j=Math.max(O,x.height+2*D),N=E+j,$=Math.max(0,w-j);if(t.look==="handDrawn"){const A=st.svg(f),I=ot(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),P=ot(t,{roughness:.7,fill:"none",stroke:a,seed:o}),L=A.rectangle(E,T,j,S,I);R=f.insert(()=>L,":first-child");const U=A.rectangle(N,T,$,S,P);W=f.insert(()=>U,":first-child"),R.select("path:nth-child(2)").attr("style",h.join(";")),R.select("path").attr("style",d.join(";").replace("fill","stroke"))}else R=f.insert("rect",":first-child"),W=f.insert("rect",":first-child"),R.attr("class","swimlane-title").attr("style",c).attr("x",E).attr("y",T).attr("width",j).attr("height",S).attr("fill",s).attr("stroke",a),W.attr("class","swimlane-body").attr("style",c).attr("x",N).attr("y",T).attr("width",$).attr("height",S).attr("fill","none").attr("stroke",a);const F=E+j/2,q=t.y;m.attr("transform",`translate(${F}, ${q}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const j=Math.max(0,_-T),N=Math.min(O,j),$=T+N,F=Math.max(0,B-$),q=t.x-w/2;if(t.look==="handDrawn"){const P=st.svg(f),L=ot(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),U=ot(t,{roughness:.7,fill:"none",stroke:a,seed:o}),z=P.rectangle(q,T,w,N,L);R=f.insert(()=>z,":first-child");const X=P.rectangle(q,$,w,F,U);W=f.insert(()=>X,":first-child"),R.select("path:nth-child(2)").attr("style",h.join(";")),R.select("path").attr("style",d.join(";").replace("fill","stroke"))}else R=f.insert("rect",":first-child"),W=f.insert("rect",":first-child"),R.attr("class","swimlane-title").attr("style",c).attr("x",q).attr("y",T).attr("width",w).attr("height",N).attr("fill",s).attr("stroke",a),W.attr("class","swimlane-body").attr("style",c).attr("x",q).attr("y",$).attr("width",w).attr("height",F).attr("fill","none").attr("stroke",a);const A=t.x-x.width/2,I=T+(N-x.height)/2;m.attr("transform",`translate(${A}, ${I})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const j=m.select("span");j&&j.attr("style",l)}return t.offsetX=0,t.width=w,t.height=S,t.offsetY=x.height-C/2,t.intersect=function(j){return oi(t,j)},{cluster:f,labelBBox:x}},"swimlane"),my=p(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=wt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:n}=i,{labelStyles:a,nodeStyles:l,borderStyles:c,backgroundStyles:h}=nt(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ae(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 kr(u,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(ae(r)){const E=g.children[0],_=yt(g);m=E.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,w=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=st.svg(d),_=ot(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),D=E.path(Ar(C,w,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",w).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:T}=zn(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+T})`),a){const E=u.select("span");E&&E.attr("style",a)}const B=S.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return oi(t,E)},{cluster:d,labelBBox:m}},"rect"),zB=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 n=i.node().getBBox();return t.width=n.width,t.height=n.height,t.intersect=function(a){return oi(t,a)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),jB=p(async(e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:n,compositeTitleBackground:a,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 kr(d,t.label,t.labelStyle,void 0,!0);let g=u.getBBox();if(ae(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,w=t.height+m-g.height-6,S=t.x-x/2,T=t.y-C/2;t.width=x;const B=t.y-t.height/2-y+g.height+2;let E;if(t.look==="handDrawn"){const D=t.cssClasses.includes("statediagram-cluster-alt"),O=st.svg(c),R=t.rx||t.ry?O.path(Ar(S,T,x,C,10),{roughness:.7,fill:a,fillStyle:"solid",stroke:l,seed:o}):O.rectangle(S,T,x,C,{seed:o});E=c.insert(()=>R,":first-child");const W=O.rectangle(S,B,x,w,{fill:D?s:n,fillStyle:D?"hachure":"solid",stroke:l,seed:o});E=c.insert(()=>R,":first-child"),f=c.insert(()=>W)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",S).attr("y",T).attr("width",x).attr("height",C).attr("data-look",t.look),f.attr("class","inner").attr("x",S).attr("y",B).attr("width",x).attr("height",w);d.attr("transform",`translate(${t.x-g.width/2}, ${T+1-(ae(r)?0:3)})`);const _=E.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:n}=i,{labelStyles:a,nodeStyles:l,borderStyles:c,backgroundStyles:h}=nt(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ae(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(ae(r)){const E=g.children[0],_=yt(g);m=E.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,w=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=st.svg(d),_=ot(t,{roughness:.7,fill:s,stroke:n,fillWeight:4,seed:o}),D=E.path(Ar(C,w,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",w).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:T}=zn(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+T})`),a){const E=u.select("span");E&&E.attr("style",a)}const B=S.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return oi(t,E)},{cluster:d,labelBBox:m}},"kanbanSection"),HB=p((e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,n=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),a=n.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=st.svg(n).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});u=n.insert(()=>y,":first-child")}else{u=a.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:n,labelBBox:{}}},"divider"),YB=my,UB={rect:my,squareRect:YB,roundedWithTitle:jB,noteGroup:zB,divider:HB,kanbanSection:WB,swimlane:qB},yy=new Map,xy=p(async(e,t)=>{const r=t.shape||"rect",i=await UB[r](e,t);return yy.set(t.id,i),i},"insertCluster"),GB=p(()=>{yy=new Map},"clear");function Cy(e,t){return e.intersect(t)}p(Cy,"intersectNode");var XB=Cy;function by(e,t,r,i){var o=e.x,s=e.y,n=o-i.x,a=s-i.y,l=Math.sqrt(t*t*a*a+r*r*n*n),c=Math.abs(t*r*n/l);i.x<o&&(c=-c);var h=Math.abs(t*r*a/l);return i.y<s&&(h=-h),{x:o+c,y:s+h}}p(by,"intersectEllipse");var ky=by;function wy(e,t,r){return ky(e,t,t,r)}p(wy,"intersectCircle");var VB=wy;function Sy(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,n=t.x*e.y-e.x*t.y,a=o*r.x+s*r.y+n,l=o*i.x+s*i.y+n,c=1e-6;if(a!==0&&l!==0&&Al(a,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&&Al(u,g))return;const m=o*d-h*s;if(m===0)return;const y=Math.abs(m/2);let x=s*f-d*n;const C=x<0?(x-y)/m:(x+y)/m;x=h*n-o*f;const w=x<0?(x-y)/m:(x+y)/m;return{x:C,y:w}}}p(Sy,"intersectLine");function Al(e,t){return e*t>0}p(Al,"sameSign");var KB=Sy;function Ty(e,t,r){let i=e.x,o=e.y,s=[],n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){n=Math.min(n,h.x),a=Math.min(a,h.y)}):(n=Math.min(n,t.x),a=Math.min(a,t.y));let l=i-e.width/2-n,c=o-e.height/2-a;for(let h=0;h<t.length;h++){let d=t[h],f=t[h<t.length-1?h+1:0],u=KB(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(Ty,"intersectPolygon");var ZB=Ty,it={node:XB,circle:VB,ellipse:ky,polygon:ZB,rect:oi};function vy(e,t){const{labelStyles:r}=nt(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),n=1,{cssStyles:a}=t,l=st.svg(s),c=ot(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,n*2,c),d=s.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Qt(a)),at(t,d),t.intersect=function(f){return V.info("Circle intersect",t,n,f),it.circle(t,n,f)},s}p(vy,"anchor");function Ml(e,t,r,i,o,s,n){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)*(n?-1:1),C=c-y*o*Math.cos(h)*(n?-1:1),w=Math.atan2((t-C)/s,(e-x)/o);let T=Math.atan2((i-C)/s,(r-x)/o)-w;n&&T<0&&(T+=2*Math.PI),!n&&T>0&&(T-=2*Math.PI);const B=[];for(let E=0;E<20;E++){const _=E/19,D=w+_*T,O=x+o*Math.cos(D),R=C+s*Math.sin(D);B.push({x:O,y:R})}return B}p(Ml,"generateArcPoints");function _y(e,t,r){const[i,o]=[t,r].sort((s,n)=>n-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}p(_y,"calculateArcSagitta");async function By(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=t.look==="neo"?12:o,a=p(D=>D+n,"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=a(t?.height?t?.height:h.height),[f,u]=l(d),g=_y(d,f,u),y=(t?.width?t?.width:h.width)+s*2+g-g,x=d,{cssStyles:C}=t,w=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...Ml(-y/2,-x/2,-y/2,x/2,f,u,!1),{x:y/2,y:x/2},...Ml(y/2,x/2,y/2,-x/2,f,u,!0)],S=st.svg(c),T=ot(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const B=kt(w),E=S.path(B,T),_=c.insert(()=>E,":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)`),at(t,_),t.intersect=function(D){return it.polygon(t,w,D)},c}p(By,"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 ks=12;async function Ly(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,n=t.look==="neo"?24:o,{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+ks),h=(t?.height??l.height)+(t.look==="neo"?n*2:n),d=0,f=c,u=-h,g=0,m=[{x:d+ks,y:u},{x:f,y:u},{x:f,y:g},{x:d,y:g},{x:d,y:u+ks},{x:d+ks,y:u}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=st.svg(a),w=ot(t,{}),S=kt(m),T=C.path(S,w);y=a.insert(()=>T,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&y.attr("style",x)}else y=mr(a,c,h,m);return i&&y.attr("style",i),at(t,y),t.intersect=function(C){return it.polygon(t,m,C)},a}p(Ly,"card");function Ey(e,t){const{nodeStyles:r}=nt(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),n=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],a=st.svg(i),l=ot(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=kt(n),h=a.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 it.polygon(t,n,f)},i}p(Ey,"choice");async function Zh(e,t,r){const{labelStyles:i,nodeStyles:o}=nt(t);t.labelStyle=i;const{shapeSvg:s,bbox:n,halfPadding:a}=await dt(e,t,ct(t)),l=16,c=r?.padding??a,h=t.look==="neo"?n.width/2+l*2:n.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=st.svg(s),g=ot(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 at(t,d),t.calcIntersect=function(u,g){const m=u.width/2;return it.circle(u,m,g)},t.intersect=function(u){return V.info("Circle intersect",t,h,u),it.circle(t,h,u)},s}p(Zh,"circle");function Fy(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},n={x:-(i/2)*t,y:-(i/2)*r},a={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${a.x},${a.y}
233
+ M ${o.x},${o.y} L ${n.x},${n.y}`}p(Fy,"createLine");function Ay(e,t){const{labelStyles:r,nodeStyles:i}=nt(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:n}=t,a=st.svg(o),l=ot(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=a.circle(0,0,s*2,l),h=Fy(s),d=a.path(h,l),f=o.insert(()=>c,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),n&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),at(t,f),t.intersect=function(u){return V.info("crossedCircle intersect",t,{radius:s,point:u}),it.circle(t,s,u)},o}p(Ay,"crossedCircle");function nr(e,t,r,i=100,o=0,s=180){const n=[],a=o*Math.PI/180,h=(s*Math.PI/180-a)/(i-1);for(let d=0;d<i;d++){const f=a+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);n.push({x:-u,y:-g})}return n}p(nr,"generateCirclePoints");async function My(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:n}=await dt(e,t,ct(t)),a=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+a,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=st.svg(o),y=ot(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=kt(u).replace("Z",""),w=m.path(C,y),S=kt(g),T=m.path(S,{...y}),B=o.insert("g",":first-child");return B.insert(()=>T,":first-child").attr("stroke-opacity",0),B.insert(()=>w,":first-child"),B.attr("class","text"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${d}, 0)`),n.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),at(t,B),t.intersect=function(E){return it.polygon(t,g,E)},o}p(My,"curlyBraceLeft");function ar(e,t,r,i=100,o=0,s=180){const n=[],a=o*Math.PI/180,h=(s*Math.PI/180-a)/(i-1);for(let d=0;d<i;d++){const f=a+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);n.push({x:u,y:g})}return n}p(ar,"generateCirclePoints");async function Oy(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:n}=await dt(e,t,ct(t)),a=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?a*2:a),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...ar(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...ar(c/2+d*2,-d,d,20,-180,-270),...ar(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...ar(c/2,h/2,d,20,0,90)],g=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...ar(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...ar(c/2+d*2,-d,d,20,-180,-270),...ar(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...ar(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],m=st.svg(o),y=ot(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=kt(u).replace("Z",""),w=m.path(C,y),S=kt(g),T=m.path(S,{...y}),B=o.insert("g",":first-child");return B.insert(()=>T,":first-child").attr("stroke-opacity",0),B.insert(()=>w,":first-child"),B.attr("class","text"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${-d}, 0)`),n.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))})`),at(t,B),t.intersect=function(E){return it.polygon(t,g,E)},o}p(Oy,"curlyBraceRight");function re(e,t,r,i=100,o=0,s=180){const n=[],a=o*Math.PI/180,h=(s*Math.PI/180-a)/(i-1);for(let d=0;d<i;d++){const f=a+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);n.push({x:-u,y:-g})}return n}p(re,"generateCirclePoints");async function $y(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:n}=await dt(e,t,ct(t)),a=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?a*2:a),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=st.svg(o),x=ot(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=kt(u).replace("Z",""),S=y.path(w,x),B=kt(g).replace("Z",""),E=y.path(B,x),_=kt(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(()=>E,":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)`),n.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))})`),at(t,O),t.intersect=function(R){return it.polygon(t,m,R)},o}p($y,"curlyBraces");async function Ry(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=t.look==="neo"?12:o,a=20,l=5,{shapeSvg:c,bbox:h}=await dt(e,t,ct(t)),d=Math.max(a,(h.width+s*2)*1.25,t?.width??0),f=Math.max(l,h.height+n*2,t?.height??0),u=f/2,{cssStyles:g}=t,m=st.svg(c),y=ot(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=f,w=x-u,S=C/4,T=[{x:w,y:0},{x:S,y:0},{x:0,y:C/2},{x:S,y:C},{x:w,y:C},...Go(-w,-C/2,u,50,270,90)],B=kt(T),E=m.path(B,y),_=c.insert(()=>E,":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})`),at(t,_),t.intersect=function(D){return it.polygon(t,T,D)},c}p(Ry,"curvedTrapezoid");var QB=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"),JB=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"),tL=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Rd=8,Id=8;async function Iy(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,n=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-n,t.width<Id&&(t.width=Id);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<Rd&&(t.height=Rd)}const{shapeSvg:a,bbox:l,label:c}=await dt(e,t,ct(t)),h=(t.width?t.width:l.width)+n,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=st.svg(a),x=JB(0,0,h,u,d,f),C=tL(0,f,h,u,d,f),w=ot(t,{}),S=y.path(x,w),T=y.path(C,ot(t,{fill:"none"}));g=a.insert(()=>T,":first-child"),g=a.insert(()=>S,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=QB(0,0,h,u,d,f);g=a.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)})`),at(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=it.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 w=f*f*(1-C*C/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,y.y-(t.y??0)>0&&(w=-w),x.y+=w}return x},a}p(Iy,"cylinder");async function eo(e,t,r){const{labelStyles:i,nodeStyles:o}=nt(t);t.labelStyle=i;const{shapeSvg:s,bbox:n}=await dt(e,t,ct(t)),a=Math.max(n.width+r.labelPaddingX*2,t?.width||0),l=Math.max(n.height+r.labelPaddingY*2,t?.height||0),c=-a/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=st.svg(s),y=ot(t,{}),x=f||u?m.path(Ar(c,h,a,l,f||0),y):m.rectangle(c,h,a,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",a).attr("height",l);return at(t,d),t.calcIntersect=function(m,y){return it.rect(m,y)},t.intersect=function(m){return it.rect(t,m)},s}p(eo,"drawRect");async function Py(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:n,height:a}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await eo(e,t,l);if(t.look==="handDrawn"){const u=st.svg(c),g=ot(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"))||n)??0,f=(Number(h.attr("height"))||a)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),c}p(Py,"datastore");async function Dy(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:n,bbox:a,label:l}=await dt(e,t,ct(t)),c=a.width+o,h=a.height+s,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:g}=t,m=st.svg(n),y=ot(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),w=n.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),l.attr("transform",`translate(${f+(t.padding??0)/2-(a.x-(a.left??0))}, ${u+d+(t.padding??0)/2-(a.y-(a.top??0))})`),at(t,w),t.intersect=function(S){return it.rect(t,S)},n}p(Dy,"dividedRectangle");async function Ny(e,t){const{labelStyles:r,nodeStyles:i}=nt(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,n=t.look==="neo"?16:s,{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=(t?.width?t?.width/2:l.width/2)+(n??0),h=c-o;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=st.svg(a),g=ot(t,{roughness:.2,strokeWidth:2.5}),m=ot(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,g),x=u.circle(0,0,h*2,m);d=a.insert("g",":first-child"),d.attr("class",Qt(t.cssClasses)).attr("style",Qt(f)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=a.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 at(t,d),t.intersect=function(u){return V.info("DoubleCircle intersect",t,c,u),it.circle(t,c,u)},a}p(Ny,"doublecircle");function qy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=nt(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",ct(t)).attr("id",t.domId??t.id),n=7,{cssStyles:a}=t,l=st.svg(s),{nodeBorder:c}=r,h=ot(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,n*2,h),f=s.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),a&&a.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),at(t,f),t.intersect=function(u){return V.info("filledCircle intersect",t,{radius:n,point:u}),it.circle(t,n,u)},s}p(qy,"filledCircle");var Pd=10,Dd=10;async function zy(e,t){const{labelStyles:r,nodeStyles:i}=nt(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<Pd&&(t.height=Pd),t.width=(t?.width??0)-s-s/2,t.width<Dd&&(t.width=Dd));const{shapeSvg:n,bbox:a,label:l}=await dt(e,t,ct(t)),c=(t?.width?t?.width:a.width)+(s??0),h=t?.height?t?.height:c+a.height,d=h,f=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:u}=t,g=st.svg(n),m=ot(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=kt(f),x=g.path(y,m),C=n.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,at(t,C),l.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-h/2+(t.padding??0)/2+(a.y-(a.top??0))})`),t.intersect=function(w){return V.info("Triangle intersect",t,f,w),it.polygon(t,f,w)},n}p(zy,"flippedTriangle");function jy(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=nt(t);t.label="";const n=e.insert("g").attr("class",ct(t)).attr("id",t.domId??t.id),{cssStyles:a}=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=st.svg(n),u=ot(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=n.insert(()=>g,":first-child");a&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",a),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),at(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 it.rect(t,x)},n}p(jy,"forkJoin");async function Wy(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=15,s=10,n=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-a*2,t.height<s&&(t.height=s),t.width=(t?.width??0)-n*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))+n*2,d=(t?.height?t?.height:Math.max(s,c.height))+a*2,f=d/2,{cssStyles:u}=t,g=st.svg(l),m=ot(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},...Go(-h/2+f,0,f,50,90,270),{x:h/2-f,y:d/2},{x:-h/2,y:d/2}],x=kt(y),C=g.path(x,m),w=l.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),at(t,w),t.intersect=function(S){return V.info("Pill intersect",t,{radius:f,point:S}),it.polygon(t,y,S)},l}p(Wy,"halfRoundedRectangle");var eL=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 Hy(e,t){const{labelStyles:r,nodeStyles:i}=nt(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,n=70,a=32,l=t.look==="neo"?n:s,c=t.look==="neo"?a:s;if(t.width||t.height){const w=(t.height??0)/o;t.width=(t?.width??0)-2*w-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=st.svg(h),w=ot(t,{}),S=eL(0,0,g,f,u),T=C.path(S,w);y=h.insert(()=>T,":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,at(t,y),t.intersect=function(C){return it.polygon(t,m,C)},h}p(Hy,"hexagon");async function Yy(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await dt(e,t,ct(t)),s=Math.max(30,t?.width??0),n=Math.max(30,t?.height??0),{cssStyles:a}=t,l=st.svg(o),c=ot(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:n},{x:s,y:n}],d=kt(h),f=l.path(d,c),u=o.insert(()=>f,":first-child");return u.attr("class","basic label-container outer-path"),a&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",a),i&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",i),u.attr("transform",`translate(${-s/2}, ${-n/2})`),at(t,u),t.intersect=function(g){return V.info("Pill intersect",t,{points:h}),it.polygon(t,h,g)},o}p(Yy,"hourglass");async function Uy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=nt(t);t.labelStyle=o;const s=t.assetHeight??48,n=t.assetWidth??48,a=Math.max(s,n),l=i?.wrappingWidth;t.width=Math.max(a,l??0);const{shapeSvg:c,bbox:h,label:d}=await dt(e,t,"icon-shape default"),f=t.pos==="t",u=a,g=a,{nodeBorder:m}=r,{stylesMap:y}=Ji(t),x=-g/2,C=-u/2,w=t.label?8:0,S=st.svg(c),T=ot(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const B=S.rectangle(x,C,g,u,T),E=Math.max(g,h.width),_=u+h.height+w,D=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),O=c.insert(()=>B,":first-child"),R=c.insert(()=>D);if(t.icon){const W=c.append("g");W.html(`<g>${await to(t.icon,{height:a,width:a,fallbackPrefix:""})}</g>`);const j=W.node().getBBox(),N=j.width,$=j.height,F=j.x,q=j.y;W.attr("transform",`translate(${-N/2-F},${f?h.height/2+w/2-$/2-q:-h.height/2-w/2-$/2-q})`),W.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+w/2:-h.height/2-w/2})`),at(t,R),t.intersect=function(W){if(V.info("iconSquare intersect",t,W),!t.label)return it.rect(t,W);const j=t.x??0,N=t.y??0,$=t.height??0;let F=[];return f?F=[{x:j-h.width/2,y:N-$/2},{x:j+h.width/2,y:N-$/2},{x:j+h.width/2,y:N-$/2+h.height+w},{x:j+g/2,y:N-$/2+h.height+w},{x:j+g/2,y:N+$/2},{x:j-g/2,y:N+$/2},{x:j-g/2,y:N-$/2+h.height+w},{x:j-h.width/2,y:N-$/2+h.height+w}]:F=[{x:j-g/2,y:N-$/2},{x:j+g/2,y:N-$/2},{x:j+g/2,y:N-$/2+u},{x:j+h.width/2,y:N-$/2+u},{x:j+h.width/2/2,y:N+$/2},{x:j-h.width/2,y:N+$/2},{x:j-h.width/2,y:N-$/2+u},{x:j-g/2,y:N-$/2+u}],it.polygon(t,F,W)},c}p(Uy,"icon");async function Gy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=nt(t);t.labelStyle=o;const s=t.assetHeight??48,n=t.assetWidth??48,a=Math.max(s,n),l=i?.wrappingWidth;t.width=Math.max(a,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}=Ji(t),C=st.svg(c),w=ot(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=x.get("fill");w.stroke=S??y;const T=c.append("g");t.icon&&T.html(`<g>${await to(t.icon,{height:a,width:a,fallbackPrefix:""})}</g>`);const B=T.node().getBBox(),E=B.width,_=B.height,D=B.x,O=B.y,R=Math.max(E,_)*Math.SQRT2+f*2,W=C.circle(0,0,R,w),j=Math.max(R,h.width),N=R+h.height+u,$=C.rectangle(-j/2,-N/2,j,N,{...w,fill:"transparent",stroke:"none"}),F=c.insert(()=>W,":first-child"),q=c.insert(()=>$);return T.attr("transform",`translate(${-E/2-D},${g?h.height/2+u/2-_/2-O:-h.height/2-u/2-_/2-O})`),T.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-N/2:N/2-h.height})`),F.attr("transform",`translate(0,${g?h.height/2+u/2:-h.height/2-u/2})`),at(t,q),t.intersect=function(A){return V.info("iconSquare intersect",t,A),it.rect(t,A)},c}p(Gy,"iconCircle");async function Xy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=nt(t);t.labelStyle=o;const s=t.assetHeight??48,n=t.assetWidth??48,a=Math.max(s,n),l=i?.wrappingWidth;t.width=Math.max(a,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await dt(e,t,"icon-shape default"),u=t.pos==="t",g=a+d*2,m=a+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ji(t),w=-m/2,S=-g/2,T=t.label?8:0,B=st.svg(c),E=ot(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const _=C.get("fill");E.stroke=_??x;const D=B.path(Ar(w,S,m,g,5),E),O=Math.max(m,h.width),R=g+h.height+T,W=B.rectangle(-O/2,-R/2,O,R,{...E,fill:"transparent",stroke:"none"}),j=c.insert(()=>D,":first-child").attr("class","icon-shape2"),N=c.insert(()=>W);if(t.icon){const $=c.append("g");$.html(`<g>${await to(t.icon,{height:a,width:a,fallbackPrefix:""})}</g>`);const F=$.node().getBBox(),q=F.width,A=F.height,I=F.x,P=F.y;$.attr("transform",`translate(${-q/2-I},${u?h.height/2+T/2-A/2-P:-h.height/2-T/2-A/2-P})`),$.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-R/2:R/2-h.height})`),j.attr("transform",`translate(0,${u?h.height/2+T/2:-h.height/2-T/2})`),at(t,N),t.intersect=function($){if(V.info("iconSquare intersect",t,$),!t.label)return it.rect(t,$);const F=t.x??0,q=t.y??0,A=t.height??0;let I=[];return u?I=[{x:F-h.width/2,y:q-A/2},{x:F+h.width/2,y:q-A/2},{x:F+h.width/2,y:q-A/2+h.height+T},{x:F+m/2,y:q-A/2+h.height+T},{x:F+m/2,y:q+A/2},{x:F-m/2,y:q+A/2},{x:F-m/2,y:q-A/2+h.height+T},{x:F-h.width/2,y:q-A/2+h.height+T}]:I=[{x:F-m/2,y:q-A/2},{x:F+m/2,y:q-A/2},{x:F+m/2,y:q-A/2+g},{x:F+h.width/2,y:q-A/2+g},{x:F+h.width/2/2,y:q+A/2},{x:F-h.width/2,y:q+A/2},{x:F-h.width/2,y:q-A/2+g},{x:F-m/2,y:q-A/2+g}],it.polygon(t,I,$)},c}p(Xy,"iconRounded");async function Vy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=nt(t);t.labelStyle=o;const s=t.assetHeight??48,n=t.assetWidth??48,a=Math.max(s,n),l=i?.wrappingWidth;t.width=Math.max(a,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await dt(e,t,"icon-shape default"),u=t.pos==="t",g=a+d*2,m=a+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ji(t),w=-m/2,S=-g/2,T=t.label?8:0,B=st.svg(c),E=ot(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const _=C.get("fill");E.stroke=_??x;const D=B.path(Ar(w,S,m,g,.1),E),O=Math.max(m,h.width),R=g+h.height+T,W=B.rectangle(-O/2,-R/2,O,R,{...E,fill:"transparent",stroke:"none"}),j=c.insert(()=>D,":first-child"),N=c.insert(()=>W);if(t.icon){const $=c.append("g");$.html(`<g>${await to(t.icon,{height:a,width:a,fallbackPrefix:""})}</g>`);const F=$.node().getBBox(),q=F.width,A=F.height,I=F.x,P=F.y;$.attr("transform",`translate(${-q/2-I},${u?h.height/2+T/2-A/2-P:-h.height/2-T/2-A/2-P})`),$.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-R/2:R/2-h.height})`),j.attr("transform",`translate(0,${u?h.height/2+T/2:-h.height/2-T/2})`),at(t,N),t.intersect=function($){if(V.info("iconSquare intersect",t,$),!t.label)return it.rect(t,$);const F=t.x??0,q=t.y??0,A=t.height??0;let I=[];return u?I=[{x:F-h.width/2,y:q-A/2},{x:F+h.width/2,y:q-A/2},{x:F+h.width/2,y:q-A/2+h.height+T},{x:F+m/2,y:q-A/2+h.height+T},{x:F+m/2,y:q+A/2},{x:F-m/2,y:q+A/2},{x:F-m/2,y:q-A/2+h.height+T},{x:F-h.width/2,y:q-A/2+h.height+T}]:I=[{x:F-m/2,y:q-A/2},{x:F+m/2,y:q-A/2},{x:F+m/2,y:q-A/2+g},{x:F+h.width/2,y:q-A/2+g},{x:F+h.width/2/2,y:q+A/2},{x:F-h.width/2,y:q+A/2},{x:F-h.width/2,y:q-A/2+g},{x:F-m/2,y:q-A/2+g}],it.polygon(t,I,$)},c}p(Vy,"iconSquare");async function Ky(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:n}=nt(t);t.labelStyle=n;const a=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?a??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,a??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=st.svg(d),w=ot(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=C.rectangle(m,y,c,h,w),T=Math.max(c,f.width),B=h+f.height+x,E=C.rectangle(-T/2,-B/2,T,B,{...w,fill:"none",stroke:"none"}),_=d.insert(()=>S,":first-child"),D=d.insert(()=>E);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?B/2-h:-B/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})`),at(t,D),t.intersect=function(O){if(V.info("iconSquare intersect",t,O),!t.label)return it.rect(t,O);const R=t.x??0,W=t.y??0,j=t.height??0;let N=[];return g?N=[{x:R-f.width/2,y:W-j/2},{x:R+f.width/2,y:W-j/2},{x:R+f.width/2,y:W-j/2+f.height+x},{x:R+c/2,y:W-j/2+f.height+x},{x:R+c/2,y:W+j/2},{x:R-c/2,y:W+j/2},{x:R-c/2,y:W-j/2+f.height+x},{x:R-f.width/2,y:W-j/2+f.height+x}]:N=[{x:R-c/2,y:W-j/2},{x:R+c/2,y:W-j/2},{x:R+c/2,y:W-j/2+h},{x:R+f.width/2,y:W-j/2+h},{x:R+f.width/2/2,y:W+j/2},{x:R-f.width/2,y:W+j/2},{x:R-f.width/2,y:W-j/2+h},{x:R-c/2,y:W-j/2+h}],it.polygon(t,N,O)},d}p(Ky,"imageSquare");async function Zy(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=o,n=t.look==="neo"?o*2:o,{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=Math.max(l.width+(n??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=st.svg(a),m=ot(t,{}),y=kt(d),x=g.path(y,m);f=a.insert(()=>x,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&f.attr("style",u)}else f=mr(a,c,h,d);return i&&f.attr("style",i),t.width=c,t.height=h,at(t,f),t.intersect=function(g){return it.polygon(t,d,g)},a}p(Zy,"inv_trapezoid");async function Qy(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))})`),at(t,s),t.intersect=function(l){return it.rect(t,l)},r}p(Qy,"labelRect");async function Jy(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=o,n=t.look==="neo"?o*2:o,{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+n,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=st.svg(a),m=ot(t,{}),y=kt(d),x=g.path(y,m);f=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=mr(a,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,at(t,f),t.intersect=function(g){return it.polygon(t,d,g)},a}p(Jy,"lean_left");async function t0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=o,n=t.look==="neo"?o*2:o,{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+n,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=st.svg(a),m=ot(t,{}),y=kt(d),x=g.path(y,m);f=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=mr(a,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,at(t,f),t.intersect=function(g){return it.polygon(t,d,g)},a}p(t0,"lean_right");function e0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",ct(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,n=Math.max(35,t?.width??0),a=Math.max(35,t?.height??0),l=7,c=[{x:n,y:0},{x:0,y:a+l/2},{x:n-2*l,y:a+l/2},{x:0,y:2*a},{x:n,y:a-l/2},{x:2*l,y:a-l/2}],h=st.svg(o),d=ot(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=kt(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(-${n/2},${-a})`),at(t,g),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),it.polygon(t,c,m)},o}p(e0,"lightningBolt");var rL=p((e,t,r,i,o,s,n)=>[`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+n}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),iL=p((e,t,r,i,o,s,n)=>[`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+n}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),oL=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Nd=10,qd=10;async function r0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=t.look==="neo"?24:o;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-s,t.width<qd&&(t.width=qd);const w=x/2/(2.5+x/50);t.height=(t.height??0)-n-w*3,t.height<Nd&&(t.height=Nd)}const{shapeSvg:a,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+n*2,g=u*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=st.svg(a),C=iL(0,0,h,u,d,f,g),w=oL(0,f,h,u,d,f),S=ot(t,{}),T=x.path(C,S),B=x.path(w,S);a.insert(()=>B,":first-child").attr("class","line"),m=a.insert(()=>T,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=rL(0,0,h,u,d,f,g);m=a.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)})`),at(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=it.rect(t,x),w=C.x-(t.x??0);if(d!=0&&(Math.abs(w)<(t.width??0)/2||Math.abs(w)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let S=f*f*(1-w*w/(d*d));S>0&&(S=Math.sqrt(S)),S=f-S,x.y-(t.y??0)>0&&(S=-S),C.y+=S}return C},a}p(r0,"linedCylinder");async function i0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=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)-n*2,t.height<10&&(t.height=10)}const{shapeSvg:a,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)+(n??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:g}=t,m=st.svg(a),y=ot(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},...Er(-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),w=a.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),w.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))})`),at(t,w),t.intersect=function(S){return it.polygon(t,x,S)},a}p(i0,"linedWaveEdgedRect");async function o0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=t.look==="neo"?12:o,a=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*a,10),t.height=Math.max((t?.height??0)-n*2-2*a,10));const{shapeSvg:l,bbox:c,label:h}=await dt(e,t,ct(t)),d=(t?.width?t?.width:c.width)+s*2+2*a,f=(t?.height?t?.height:c.height)+n*2+2*a,u=d-2*a,g=f-2*a,m=-u/2,y=-g/2,{cssStyles:x}=t,C=st.svg(l),w=ot(t,{}),S=[{x:m-a,y:y+a},{x:m-a,y:y+g+a},{x:m+u-a,y:y+g+a},{x:m+u-a,y:y+g},{x:m+u,y:y+g},{x:m+u,y:y+g-a},{x:m+u+a,y:y+g-a},{x:m+u+a,y:y-a},{x:m+a,y:y-a},{x:m+a,y},{x:m,y},{x:m,y:y+a}],T=[{x:m,y:y+a},{x:m+u-a,y:y+a},{x:m+u-a,y:y+g},{x:m+u,y:y+g},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const B=kt(S);let E=C.path(B,w);const _=kt(T);let D=C.path(_,w);t.look!=="handDrawn"&&(E=Fl(E),D=Fl(D));const O=l.insert("g",":first-child");return O.insert(()=>E),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)-a-(c.x-(c.left??0))}, ${-(c.height/2)+a-(c.y-(c.top??0))})`),at(t,O),t.intersect=function(R){return it.polygon(t,S,R)},l}p(o0,"multiRect");async function s0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:n}=await dt(e,t,ct(t)),a=t.padding??0,l=t.look==="neo"?16:a,c=t.look==="neo"?12:a;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,w=Er(m-x,y+g+x,m+d-x,y+g+x,u,.8),S=w?.[w.length-1],T=[{x:m-x,y:y+x},{x:m-x,y:y+g+x},...w,{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}],B=[{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}],E=st.svg(o),_=ot(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const D=kt(T),O=E.path(D,_),R=kt(B),W=E.path(R,_),j=o.insert(()=>O,":first-child");return j.insert(()=>W),j.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",i),j.attr("transform",`translate(0,${-u/2})`),n.attr("transform",`translate(${-(s.width/2)-x-(s.x-(s.left??0))}, ${-(s.height/2)+x-u/2-(s.y-(s.top??0))})`),at(t,j),t.intersect=function(N){return it.polygon(t,T,N)},o}p(s0,"multiWaveEdgedRectangle");async function n0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=nt(t);t.labelStyle=i,t.useHtmlLabels||ae(Rt())||(t.centerLabel=!0);const{shapeSvg:n,bbox:a,label:l}=await dt(e,t,ct(t)),c=Math.max(a.width+(t.padding??0)*2,t?.width??0),h=Math.max(a.height+(t.padding??0)*2,t?.height??0),d=-c/2,f=-h/2,{cssStyles:u}=t,g=st.svg(n),m=ot(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=n.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(${-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),at(t,x),t.intersect=function(C){return it.rect(t,C)},n}p(n0,"note");var sL=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 a0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await dt(e,t,ct(t)),n=s.width+(t.padding??0),a=s.height+(t.padding??0),l=n+a,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=st.svg(o),g=ot(t,{}),m=sL(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),at(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=it.polygon(u,y,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},o}p(a0,"question");async function l0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,n=t.look==="neo"?12:o??0,{shapeSvg:a,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"?n*2:n),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=st.svg(a),C=ot(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=kt(m),S=x.path(w,C),T=a.insert(()=>S,":first-child");return T.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.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))})`),at(t,T),t.intersect=function(B){return it.polygon(t,m,B)},a}p(l0,"rect_left_inv_arrow");async function h0(e,t){const{labelStyles:r,nodeStyles:i}=nt(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),n=s.insert("g"),a=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await kr(a,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ae(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 kr(a,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=a.node().getBBox(),a.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")");const C=d.width+(t.padding||0),w=d.height+(t.padding||0),S=-d.width/2-x,T=-d.height/2-x;let B,E;if(t.look==="handDrawn"){const _=st.svg(s),D=ot(t,{}),O=_.path(Ar(S,T,C,w,t.rx||0),D),R=_.line(-d.width/2-x,-d.height/2-x+u.height+x,d.width/2+x,-d.height/2-x+u.height+x,D);E=s.insert(()=>(V.debug("Rough node insert CXC",O),R),":first-child"),B=s.insert(()=>(V.debug("Rough node insert CXC",O),O),":first-child")}else B=n.insert("rect",":first-child"),E=n.insert("line"),B.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)),E.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 at(t,B),t.intersect=function(_){return it.rect(t,_)},s}p(h0,"rectWithTitle");async function c0(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 eo(e,t,o)}p(c0,"roundedRect");var Dr=8;async function d0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:n,bbox:a,label:l}=await dt(e,t,ct(t)),c=(t?.width??a.width)+o*2+(t.look==="neo"?Dr:Dr*2),h=(t?.height??a.height)+s*2,d=c-Dr,f=h,u=Dr-c/2,g=-h/2,{cssStyles:m}=t,y=st.svg(n),x=ot(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}],w=y.polygon(C.map(T=>[T.x,T.y]),x),S=n.insert(()=>w,":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-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),at(t,S),t.intersect=function(T){return it.rect(t,T)},n}p(d0,"shadedProcess");async function u0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=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-n*2,10));const{shapeSvg:a,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)+n*2)*1.5,f=h,u=d/1.5,g=-f/2,m=-u/2,{cssStyles:y}=t,x=st.svg(a),C=ot(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=[{x:g,y:m},{x:g,y:m+u},{x:g+f,y:m+u},{x:g+f,y:m-u/2}],S=kt(w),T=x.path(S,C),B=a.insert(()=>T,":first-child");return B.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.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))})`),at(t,B),t.intersect=function(E){return it.polygon(t,w,E)},a}p(u0,"slopedRect");async function f0(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 eo(e,t,s)}p(f0,"squareRect");async function g0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,n=t.look==="neo"?12:o,{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=l.height+(t.look==="neo"?n*2:n),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:f}=t,u=st.svg(a),g=ot(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},...Go(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...Go(h/2-d,0,d,50,270,450)],y=kt(m),x=u.path(y,g),C=a.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),at(t,C),t.intersect=function(w){return it.polygon(t,m,w)},a}p(g0,"stadium");async function p0(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return eo(e,t,r)}p(p0,"state");function m0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=nt(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:n,stateBorder:a,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=st.svg(h),f=ot(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:n,strokeWidth:2}),g=a??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??"",w=C?`${C}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${w})`)}return at(t,x),t.intersect=function(C){return it.circle(t,(t.width??0)/2,C)},h}p(m0,"stateEnd");function y0(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 n;if(t.look==="handDrawn"){const l=st.svg(s).circle(0,0,t.width,jv(i));n=s.insert(()=>l),n.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else n=s.insert("circle",":first-child"),n.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 a=e.node()?.ownerSVGElement?.id??"",l=a?`${a}-drop-shadow-small`:"drop-shadow-small";n.attr("style",`filter:url(#${l})`)}return at(t,n),t.intersect=function(a){return it.circle(t,(t.width??7)/2,a)},s}p(y0,"stateStart");var ci=8;async function x0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,n=t.look==="neo"?12:o,{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=(t?.width??l.width)+2*ci+s,h=(t?.height??l.height)+n,d=c-2*ci,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=st.svg(a),x=ot(t,{}),C=y.rectangle(u,g,d+16,f,x),w=y.line(u+ci,g,u+ci,g+f,x),S=y.line(u+ci+d,g,u+ci+d,g+f,x);a.insert(()=>w,":first-child"),a.insert(()=>S,":first-child");const T=a.insert(()=>C,":first-child"),{cssStyles:B}=t;T.attr("class","basic label-container").attr("style",Qt(B)),at(t,T)}else{const y=mr(a,d,f,m);i&&y.attr("style",i),at(t,y)}return t.intersect=function(y){return it.polygon(t,m,y)},a}p(x0,"subroutine");var Ta=.2;async function C0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-n*2,10),t.width=Math.max((t?.width??0)-s*2-Ta*(t.height+n*2),10));const{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=(t?.height?t?.height:l.height)+n*2,h=Ta*c,d=Ta*c,u=(t?.width?t?.width:l.width)+s*2+h-h,g=c,m=-u/2,y=-g/2,{cssStyles:x}=t,C=st.svg(a),w=ot(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}],T=[{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"&&(w.roughness=0,w.fillStyle="solid");const B=kt(S),E=C.path(B,w),_=kt(T),D=C.path(_,{...w,fillStyle:"solid"}),O=a.insert(()=>D,":first-child");return O.insert(()=>E,":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),at(t,O),t.intersect=function(R){return it.polygon(t,S,R)},a}p(C0,"taggedRect");async function b0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:n}=await dt(e,t,ct(t)),a=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*a,d=.2*l,f=l+c,{cssStyles:u}=t,g=st.svg(o),m=ot(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-a/2-a/2*.1,y:f/2},...Er(-a/2-a/2*.1,f/2,a/2+a/2*.1,f/2,c,.8),{x:a/2+a/2*.1,y:-f/2},{x:-a/2-a/2*.1,y:-f/2}],x=-a/2+a/2*.1,C=-f/2-d*.4,w=[{x:x+a-h,y:(C+l)*1.3},{x:x+a,y:C+l-d},{x:x+a,y:(C+l)*.9},...Er(x+a,(C+l)*1.25,x+a-h,(C+l)*1.3,-l*.02,.5)],S=kt(y),T=g.path(S,m),B=kt(w),E=g.path(B,{...m,fillStyle:"solid"}),_=o.insert(()=>E,":first-child");return _.insert(()=>T,":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})`),n.attr("transform",`translate(${-a/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),at(t,_),t.intersect=function(D){return it.polygon(t,y,D)},o}p(b0,"taggedWaveEdgedRectangle");async function k0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await dt(e,t,ct(t)),n=Math.max(s.width+(t.padding??0),t?.width||0),a=Math.max(s.height+(t.padding??0),t?.height||0),l=-n/2,c=-a/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",n).attr("height",a),at(t,h),t.intersect=function(d){return it.rect(t,d)},o}p(k0,"text");var nL=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"),aL=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"),lL=p((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),zd=5,jd=10;async function w0(e,t){const{labelStyles:r,nodeStyles:i}=nt(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<zd&&(t.height=zd);const x=m/2/(2.5+m/50);t.width=(t.width??0)-s-x*3,t.width<jd&&(t.width=jd)}const{shapeSvg:n,bbox:a,label:l}=await dt(e,t,ct(t)),c=(t.height?t.height:a.height)+s,h=c/2,d=h/(2.5+c/50),f=(t.width?t.width:a.width)+d+s,{cssStyles:u}=t;let g;if(t.look==="handDrawn"){const m=st.svg(n),y=aL(0,0,f,c,d,h),x=lL(0,0,f,c,d,h),C=m.path(y,ot(t,{})),w=m.path(x,ot(t,{fill:"none"}));g=n.insert(()=>w,":first-child"),g=n.insert(()=>C,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{const m=nL(0,0,f,c,d,h);g=n.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(${-(a.width/2)-d-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),at(t,g),t.intersect=function(m){const y=it.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},n}p(w0,"tiltedCylinder");async function S0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),n=t.look==="neo"?o*2:o,{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+n,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=st.svg(a),m=ot(t,{}),y=kt(d),x=g.path(y,m);f=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=mr(a,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,at(t,f),t.intersect=function(g){return it.polygon(t,d,g)},a}p(S0,"trapezoid");async function T0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=t.look==="neo"?12:o,a=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-n*2,t.height<l&&(t.height=l),t.width=(t.width??0)-s*2,t.width<a&&(t.width=a));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)+n*2,{cssStyles:u}=t,g=st.svg(c),m=ot(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=kt(y),C=g.path(x,m),w=c.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),at(t,w),t.intersect=function(S){return it.polygon(t,y,S)},c}p(T0,"trapezoidalPentagon");var Wd=10,Hd=10;async function v0(e,t){const{labelStyles:r,nodeStyles:i}=nt(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<Hd&&(t.width=Hd),t.height=t?.height??0,t.height<Wd&&(t.height=Wd));const{shapeSvg:n,bbox:a,label:l}=await dt(e,t,ct(t)),c=tr(wt().flowchart?.htmlLabels),h=(t?.width?t?.width:a.width)+s,d=t?.height?t?.height:h+a.height,f=d,u=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:g}=t,m=st.svg(n),y=ot(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=kt(u),C=m.path(x,y),w=n.insert(()=>C,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),t.width=h,t.height=d,at(t,w),l.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${d/2-(a.height+(t.padding??0)/(c?2:1)-(a.y-(a.top??0)))})`),t.intersect=function(S){return V.info("Triangle intersect",t,u,S),it.polygon(t,u,S)},n}p(v0,"triangle");async function _0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=t.look==="neo"?12:o;let a=!0;(t.width||t.height)&&(a=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-n*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)+(n??0)*2,u=t.look==="neo"?f/4:f/8,g=f+(a?u:-u),{cssStyles:m}=t,x=14-d,C=x>0?x/2:0,w=st.svg(l),S=ot(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const T=[{x:-d/2-C,y:g/2},...Er(-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}],B=kt(T),E=w.path(B,S),_=l.insert(()=>E,":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))})`),at(t,_),t.intersect=function(D){return it.polygon(t,T,D)},l}p(_0,"waveEdgedRectangle");async function B0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,n=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-n-S*(20/9)),t.width=t.width-s*2}const{shapeSvg:a,bbox:l}=await dt(e,t,ct(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+n,d=h/8,f=h+d*2,{cssStyles:u}=t,g=st.svg(a),m=ot(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...Er(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...Er(c/2,-f/2,-c/2,-f/2,d,-1)],x=kt(y),C=g.path(x,m),w=a.insert(()=>C,":first-child");return w.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),at(t,w),t.intersect=function(S){return it.polygon(t,y,S)},a}p(B0,"waveRectangle");var Nt=10;async function L0(e,t){const{labelStyles:r,nodeStyles:i}=nt(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-Nt,10),t.height=Math.max((t?.height??0)-s*2-Nt,10));const{shapeSvg:n,bbox:a,label:l}=await dt(e,t,ct(t)),c=(t?.width?t?.width:a.width)+o*2+Nt,h=(t?.height?t?.height:a.height)+s*2+Nt,d=c-Nt,f=h-Nt,u=-d/2,g=-f/2,{cssStyles:m}=t,y=st.svg(n),x=ot(t,{}),C=[{x:u-Nt,y:g-Nt},{x:u-Nt,y:g+f},{x:u+d,y:g+f},{x:u+d,y:g-Nt}],w=`M${u-Nt},${g-Nt} L${u+d},${g-Nt} L${u+d},${g+f} L${u-Nt},${g+f} L${u-Nt},${g-Nt}
240
+ M${u-Nt},${g} L${u+d},${g}
241
+ M${u},${g-Nt} L${u},${g+f}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.path(w,x),T=n.insert(()=>S,":first-child");return T.attr("transform",`translate(${Nt/2}, ${Nt/2})`),T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(a.width/2)+Nt/2-(a.x-(a.left??0))}, ${-(a.height/2)+Nt/2-(a.y-(a.top??0))})`),at(t,T),t.intersect=function(B){return it.polygon(t,C,B)},n}p(L0,"windowPane");var Yd=new Set(["redux-color","redux-dark-color"]),hL=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Qh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Rt(),{rowEven:s,rowOdd:n,nodeBorder:a,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:Q}=Rt(),{background:G}=Q,rt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${G}`]};await Qh(e,rt)}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}=nt(t);if(r.attributes.length===0&&t.label){const Q={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Ze(t.label,c)+Q.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const G=await eo(e,t,Q);if(i!=null&&Yd.has(i)){const rt=r.colorIndex??0;G.attr("data-color-id",`color-${rt%l.length}`)}if(!tr(c.htmlLabels)){const rt=G.select("text"),Z=rt.node()?.getBBox();rt.attr("transform",`translate(${-Z.width/2}, 0)`)}return G}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 gi(y,t.label??"",c,0,0,["name"],u);x.height+=d;let C=0;const w=[],S=[];let T=0,B=0,E=0,_=0,D=!0,O=!0;for(const Q of r.attributes){const G=await gi(y,Q.type,c,0,C,["attribute-type"],u);T=Math.max(T,G.width+h);const rt=await gi(y,Q.name,c,0,C,["attribute-name"],u);B=Math.max(B,rt.width+h);const Z=await gi(y,Q.keys.join(),c,0,C,["attribute-keys"],u);E=Math.max(E,Z.width+h);const tt=await gi(y,Q.comment,c,0,C,["attribute-comment"],u);_=Math.max(_,tt.width+h);const mt=Math.max(G.height,rt.height,Z.height,tt.height)+d;S.push({yOffset:C,rowHeight:mt}),C+=mt}let R=4;E<=h&&(D=!1,E=0,R--),_<=h&&(O=!1,_=0,R--);const W=y.node().getBBox();if(x.width+h*2-(T+B+E+_)>0){const Q=x.width+h*2-(T+B+E+_);T+=Q/R,B+=Q/R,E>0&&(E+=Q/R),_>0&&(_+=Q/R)}const j=T+B+E+_,N=st.svg(y),$=ot(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let F=0;S.length>0&&(F=S.reduce((Q,G)=>Q+(G?.rowHeight??0),0));const q=Math.max(W.width+h*2,t?.width||0,j),A=Math.max((F??0)+x.height,t?.height||0),I=-q/2,P=-A/2;if(y.selectAll("g:not(:first-child)").each((Q,G,rt)=>{const Z=yt(rt[G]),tt=Z.attr("transform");let mt=0,_t=0;if(tt){const It=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(tt);It&&(mt=parseFloat(It[1]),_t=parseFloat(It[2]),Z.attr("class").includes("attribute-name")?mt+=T:Z.attr("class").includes("attribute-keys")?mt+=T+B:Z.attr("class").includes("attribute-comment")&&(mt+=T+B+E))}Z.attr("transform",`translate(${I+h/2+mt}, ${_t+P+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(P+d/2)+")"),i!=null&&Yd.has(i)){const Q=r.colorIndex??0;y.attr("data-color-id",`color-${Q%l.length}`)}const L=N.rectangle(I,P,q,A,$),U=y.insert(()=>L,":first-child").attr("class","outer-path").attr("style",f.join(""));w.push(0);for(const[Q,G]of S.entries()){const Z=(Q+1)%2===0&&G.yOffset!==0,tt=N.rectangle(I,x.height+P+G?.yOffset,q,G?.rowHeight,{...$,fill:Z?s:n,stroke:a});y.insert(()=>tt,"g.label").attr("style",f.join("")).attr("class",`row-rect-${Z?"even":"odd"}`)}const z=1e-4;let X=pi(I,x.height+P,q+I,x.height+P,z),K=N.polygon(X.map(Q=>[Q.x,Q.y]),$);if(y.insert(()=>K).attr("class","divider"),X=pi(T+I,x.height+P,T+I,A+P,z),K=N.polygon(X.map(Q=>[Q.x,Q.y]),$),y.insert(()=>K).attr("class","divider"),D){const Q=T+B+I;X=pi(Q,x.height+P,Q,A+P,z),K=N.polygon(X.map(G=>[G.x,G.y]),$),y.insert(()=>K).attr("class","divider")}if(O){const Q=T+B+E+I;X=pi(Q,x.height+P,Q,A+P,z),K=N.polygon(X.map(G=>[G.x,G.y]),$),y.insert(()=>K).attr("class","divider")}for(const Q of w){const G=x.height+P+Q;X=pi(I,G,q+I,G,z),K=N.polygon(X.map(rt=>[rt.x,rt.y]),$),y.insert(()=>K).attr("class","divider")}if(at(t,U),g&&t.look!=="handDrawn")if(i!=null&&hL.has(i))y.selectAll("path").attr("style",g);else{const G=g.split(";")?.filter(rt=>rt.includes("stroke"))?.map(rt=>`${rt}`).join("; ");y.selectAll("path").attr("style",G??""),y.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(Q){return it.rect(t,Q)},y}p(Qh,"erBox");async function gi(e,t,r,i=0,o=0,s=[],n=""){const a=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",n);t!==za(t)&&(t=za(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=a.node().appendChild(await ze(a,t,{width:Ze(t,r)+100,style:n,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=l.getBBox();if(tr(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(gi,"addText");function pi(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(pi,"lineToPolygon");async function E0(e,t,r,i,o=r.class.padding??12){const s=i?0:3,n=e.insert("g").attr("class",ct(t)).attr("id",t.domId||t.id);let a=null,l=null,c=null,h=null,d=0,f=0,u=0;if(a=n.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const C=t.annotations[0];await _o(a,{text:`«${C}»`},0),d=a.node().getBBox().height}l=n.insert("g").attr("class","label-group text"),await _o(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=n.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const w=await _o(c,C,m,[C.parseClassifier()]);m+=w+s}u=c.node().getBBox().height,u<=0&&(u=o/2),h=n.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const w=await _o(h,C,y,[C.parseClassifier()]);y+=w+s}let x=n.node().getBBox();if(a!==null){const C=a.node().getBBox();a.attr("transform",`translate(${-C.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),x=n.node().getBBox(),c.attr("transform",`translate(0, ${d+f+o*2})`),x=n.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+o*4:o*2)})`),x=n.node().getBBox(),{shapeSvg:n,bbox:x}}p(E0,"textHelper");async function _o(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Rt();let n="useHtmlLabels"in t?t.useHtmlLabels:tr(s.htmlLabels)??!0,a="";"text"in t?a=t.text:a=t.label,!n&&a.startsWith("\\")&&(a=a.substring(1)),zi(a)&&(n=!0);const l=await ze(o,sh(Br(a)),{width:Ze(a,s)+50,classes:"markdown-node-label",useHtmlLabels:n},s);let c,h=1;if(n){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=a.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("&gt"))&&(d.textContent=a[0]+a.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),a[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(_o,"addText");async function F0(e,t){const r=wt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,n=s,a=t.useHtmlLabels??tr(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await E0(e,t,r,a,n),{labelStyles:d,nodeStyles:f}=nt(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=st.svg(c),y=ot(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 w=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?C+=n:l.members.length>0&&l.methods.length===0&&(C+=n*2);const S=-x/2,T=-C/2;let B=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;w&&(B=s*2);const E=m.rectangle(S-s,T-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),x+2*s,C+2*s+B,y),_=c.insert(()=>E,":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,R=c.select(".label-group").node().getBBox().height-(g?s/2:0)||0,W=c.select(".members-group").node().getBBox().height-(g?s/2:0)||0,j=(O+R+T+s-(T-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((N,$,F)=>{const q=yt(F[$]),A=q.attr("transform");let I=0;if(A){const z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(A);z&&(I=parseFloat(z[2]))}let P=I+T+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(q.attr("class").includes("methods-group")){const U=Math.max(W,n/2);w?P=Math.max(j,O+R+U+T+n*2+s)+n*2:P=O+R+U+T+n*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?P=I-n:P=I),a||(P-=4);let L=S;(q.attr("class").includes("label-group")||q.attr("class").includes("annotation-group"))&&(L=-q.node()?.getBBox().width/2||0,c.selectAll("text").each(function(U,z,X){window.getComputedStyle(X[z]).textAnchor==="middle"&&(L=0)})),q.attr("transform",`translate(${L}, ${P})`)}),l.members.length>0||l.methods.length>0||g){const N=O+R+T+s,$=m.line(D.x,N,D.x+D.width,N+.001,y);c.insert(()=>$).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(g||l.members.length>0||l.methods.length>0){const N=O+R+W+T+n*2+s,$=m.line(D.x,w?Math.max(j,N):N,D.x+D.width,(w?Math.max(j,N):N)+.001,y);c.insert(()=>$).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),!a){const N=RegExp(/color\s*:\s*([^;]*)/),$=N.exec(u);if($){const F=$[0].replace("color","fill");c.selectAll("tspan").attr("style",F)}else if(d){const F=N.exec(d);if(F){const q=F[0].replace("color","fill");c.selectAll("tspan").attr("style",q)}}}return at(t,_),t.intersect=function(N){return it.rect(t,N)},c}p(F0,"classBox");async function A0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const o=t,s=t,n=20,a=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 Ue(u,`&lt;&lt;${o.type}&gt;&gt;`,0,t.labelStyle):g=await Ue(u,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let m=g;const y=await Ue(u,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+a,l){const D=await Ue(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=D;const O=await Ue(u,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=O;const R=await Ue(u,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=R,await Ue(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const D=await Ue(u,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=D,await Ue(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const x=(u.node()?.getBBox().width??200)+n,C=(u.node()?.getBBox().height??200)+n,w=-x/2,S=-C/2,T=st.svg(u),B=ot(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const E=T.rectangle(w,S,x,C,B),_=u.insert(()=>E,":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,R)=>{const W=yt(R[O]),j=W.attr("transform");let N=0,$=0;if(j){const I=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(j);I&&(N=parseFloat(I[1]),$=parseFloat(I[2]))}const F=$-C/2;let q=w+n/2;(O===0||O===1)&&(q=N),W.attr("transform",`translate(${q}, ${F+n})`)}),m>g+y+a){const D=S+g+y+a;let O;if(t.look==="neo"){const j=[[w,D],[w+x,D],[w+x,D+.001],[w,D+.001]];O=T.polygon(j,B)}else O=T.line(w,D,w+x,D,B);u.insert(()=>O).attr("class","divider")}return at(t,_),t.intersect=function(D){return it.rect(t,D)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}p(A0,"requirementBox");async function Ue(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=wt(),n=s.htmlLabels??!0,a=await ze(o,sh(Br(t)),{width:Ze(t,s)+50,classes:"markdown-node-label",useHtmlLabels:n,style:i},s);let l;if(n){const c=a.children[0],h=yt(a);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=a.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=a.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(Ue,"addText");var cL=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 M0(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=nt(t);t.labelStyle=i||"";const s=10,n=t.width;t.width=(t.width??200)-10;const{shapeSvg:a,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=a.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 Sa(f,"ticket"in t&&t.ticket||"",u):{label:g,bbox:m}=await Sa(a,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:x}=await Sa(a,"assigned"in t&&t.assigned||"",u);t.width=n;const C=10,w=t?.width||0,S=Math.max(m.height,x.height)/2,T=Math.max(l.height+C*2,t?.height||0)+S,B=-w/2,E=-T/2;c.attr("transform","translate("+(h-w/2)+", "+(-S-l.height/2)+")"),g.attr("transform","translate("+(h-w/2)+", "+(-S+l.height/2)+")"),y.attr("transform","translate("+(h+w/2-x.width-2*s)+", "+(-S+l.height/2)+")");let _;const{rx:D,ry:O}=t,{cssStyles:R}=t;if(t.look==="handDrawn"){const W=st.svg(a),j=ot(t,{}),N=D||O?W.path(Ar(B,E,w,T,D||0),j):W.rectangle(B,E,w,T,j);_=a.insert(()=>N,":first-child"),_.attr("class","basic label-container").attr("style",R||null)}else{_=a.insert("rect",":first-child"),_.attr("class","basic label-container __APA__").attr("style",o).attr("rx",D??5).attr("ry",O??5).attr("x",B).attr("y",E).attr("width",w).attr("height",T);const W="priority"in t&&t.priority;if(W){const j=a.append("line"),N=B+2,$=E+Math.floor((D??0)/2),F=E+T-Math.floor((D??0)/2);j.attr("x1",N).attr("y1",$).attr("x2",N).attr("y2",F).attr("stroke-width","4").attr("stroke",cL(W))}}return at(t,_),t.height=T,t.intersect=function(W){return it.rect(t,W)},a}p(M0,"kanbanItem");async function O0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:n,label:a}=await dt(e,t,ct(t)),l=s.width+10*n,c=s.height+8*n,h=.15*l,{cssStyles:d}=t,f=s.width+20,u=s.height+20,g=Math.max(l,f),m=Math.max(c,u);a.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=st.svg(o),w=ot(t,{}),S=C.path(x,w);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})`),at(t,y),t.calcIntersect=function(C,w){return it.rect(C,w)},t.intersect=function(C){return V.info("Bang intersect",t,C),it.rect(t,C)},o}p(O0,"bang");async function $0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:n,label:a}=await dt(e,t,ct(t)),l=s.width+2*n,c=s.height+2*n,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=st.svg(o),C=ot(t,{}),w=x.path(y,C);m=o.insert(()=>w,":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 a.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),at(t,m),t.calcIntersect=function(x,C){return it.rect(x,C)},t.intersect=function(x){return V.info("Cloud intersect",t,x),it.rect(t,x)},o}p($0,"cloud");async function R0(e,t){const{labelStyles:r,nodeStyles:i}=nt(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:n,label:a}=await dt(e,t,ct(t)),l=s.width+8*n,c=s.height+2*n,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),a.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>a.node()),at(t,f),t.calcIntersect=function(u,g){return it.rect(u,g)},t.intersect=function(u){return it.rect(t,u)},o}p(R0,"defaultMindmapNode");async function I0(e,t){const r={padding:t.padding??0};return Zh(e,t,r)}p(I0,"mindmapCircle");var dL=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:f0},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:c0},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:g0},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:x0},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Iy},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Py},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Zh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:O0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:$0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:a0},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Hy},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:t0},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Jy},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:S0},{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:Zy},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ny},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:k0},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Ly},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:d0},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:y0},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:m0},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:jy},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Yy},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:My},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Oy},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:$y},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:e0},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:_0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Wy},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:w0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:r0},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Ry},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Dy},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:v0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:L0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:qy},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:T0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:zy},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:u0},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:s0},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:o0},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:By},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Ay},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:b0},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:C0},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:B0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:l0},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:i0}],uL=p(()=>{const t=[...Object.entries({state:p0,choice:Ey,note:n0,rectWithTitle:h0,labelRect:Qy,iconSquare:Vy,iconCircle:Gy,icon:Uy,iconRounded:Xy,imageSquare:Ky,anchor:vy,kanbanItem:M0,mindmapCircle:I0,defaultMindmapNode:R0,classBox:F0,erBox:Qh,requirementBox:A0}),...dL.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),P0=uL();function D0(e){return e in P0}p(D0,"isValidShape");var Gn=new Map;async function Jh(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?P0[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let n;r.config.securityLevel==="sandbox"?n="_top":t.linkTarget&&(n=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",n??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),Gn.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(Jh,"insertNode");var fL=p((e,t)=>{Gn.set(t.id,e)},"setNodeElem"),gL=p(()=>{Gn.clear()},"clear"),pL=p(e=>{const t=Gn.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"),mi=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},Ud={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function Bo(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=$t(e),t=$t(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],n=o-r,a=s-i;return{angle:Math.atan(a/n),deltaX:n,deltaY:a}}p(Bo,"calculateDeltaAndAngle");var $t=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),N0=p(e=>({x:p(function(t,r,i){let o=0;const s=$t(i[0]).x<$t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(ie,e.arrowTypeStart)){const{angle:u,deltaX:g}=Bo(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}=Bo(i[i.length-1],i[i.length-2]);o=ie[e.arrowTypeEnd]*Math.cos(u)*(g>=0?1:-1)}const n=Math.abs($t(t).x-$t(i[i.length-1]).x),a=Math.abs($t(t).y-$t(i[i.length-1]).y),l=Math.abs($t(t).x-$t(i[0]).x),c=Math.abs($t(t).y-$t(i[0]).y),h=ie[e.arrowTypeStart],d=ie[e.arrowTypeEnd],f=1;if(n<d&&n>0&&a<d){let u=d+f-n;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 $t(t).x+o},"x"),y:p(function(t,r,i){let o=0;const s=$t(i[0]).y<$t(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(ie,e.arrowTypeStart)){const{angle:u,deltaY:g}=Bo(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}=Bo(i[i.length-1],i[i.length-2]);o=ie[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(g>=0?1:-1)}const n=Math.abs($t(t).y-$t(i[i.length-1]).y),a=Math.abs($t(t).x-$t(i[i.length-1]).x),l=Math.abs($t(t).y-$t(i[0]).y),c=Math.abs($t(t).x-$t(i[0]).x),h=ie[e.arrowTypeStart],d=ie[e.arrowTypeEnd],f=1;if(n<d&&n>0&&a<d){let u=d+f-n;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 $t(t).y+o},"y")}),"getLineFunctionsWithOffset"),mL=p((e,t,r,i,o,s=!1,n)=>{t.arrowTypeStart&&Gd(e,"start",t.arrowTypeStart,r,i,o,s,n),t.arrowTypeEnd&&Gd(e,"end",t.arrowTypeEnd,r,i,o,s,n)},"addEdgeMarkers"),yL={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}},xL=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Gd=p((e,t,r,i,o,s,n=!1,a)=>{const l=yL[r],c=l&&xL.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${o}_${s}-${h}${t==="start"?"Start":"End"}${n&&c?"-margin":""}`;if(a&&a.trim()!==""){const g=a.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(w=>{w.setAttribute("stroke",a),l.fill&&w.setAttribute("fill",a)}),y.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),CL=p(e=>typeof e=="string"?e:wt()?.flowchart?.curve,"resolveEdgeCurveType"),Xo=new Map,Zt=new Map,bL=p(()=>{Xo.clear(),Zt.clear()},"clear"),mo=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),q0=p(async(e,t)=>{const r=wt();let i=ae(r);const{labelStyles:o}=nt(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),n=s.insert("g").attr("class","label").attr("data-id",t.id),a=t.labelType==="markdown",c=await ze(e,t.label,{style:mo(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:a,width:a?void 0:void 0},r);n.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())}n.attr("transform",mi(d,i)),Xo.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 kr(g,t.startLabelLeft,mo(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",mi(y,i)),Zt.get(t.id)||Zt.set(t.id,{}),Zt.get(t.id).startLeft=u,Lo(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await kr(g,t.startLabelRight,mo(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",mi(y,i)),Zt.get(t.id)||Zt.set(t.id,{}),Zt.get(t.id).startRight=u,Lo(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await kr(u,t.endLabelLeft,mo(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",mi(y,i)),Zt.get(t.id)||Zt.set(t.id,{}),Zt.get(t.id).endLeft=u,Lo(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await kr(u,t.endLabelRight,mo(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",mi(y,i)),Zt.get(t.id)||Zt.set(t.id,{}),Zt.get(t.id).endRight=u,Lo(f,t.endLabelRight)}return c},"insertEdgeLabel");function Lo(e,t){ae(wt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(Lo,"setTerminalWidth");var z0=p((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,Xo.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=wt(),{subGraphTitleTotalMargin:o}=zn(i);if(e.label){const s=Xo.get(e.id);let n=e.x,a=e.y;if(r){const l=ve.calcLabelPosition(r);V.debug("Moving label "+e.label+" from (",n,",",a,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(n=l.x,a=l.y)}s.attr("transform",`translate(${n}, ${a+o/2})`)}if(e.startLabelLeft){const s=Zt.get(e.id).startLeft;let n=e.x,a=e.y;if(r){const l=ve.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);n=l.x,a=l.y}s.attr("transform",`translate(${n}, ${a})`)}if(e.startLabelRight){const s=Zt.get(e.id).startRight;let n=e.x,a=e.y;if(r){const l=ve.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);n=l.x,a=l.y}s.attr("transform",`translate(${n}, ${a})`)}if(e.endLabelLeft){const s=Zt.get(e.id).endLeft;let n=e.x,a=e.y;if(r){const l=ve.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);n=l.x,a=l.y}s.attr("transform",`translate(${n}, ${a})`)}if(e.endLabelRight){const s=Zt.get(e.id).endRight;let n=e.x,a=e.y;if(r){const l=ve.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);n=l.x,a=l.y}s.attr("transform",`translate(${n}, ${a})`)}},"positionEdgeLabel"),kL=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"),wL=p((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),n=e.width/2,a=e.height/2;return o>=n||s>=a},"outsideNode"),SL=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),n=e.width/2;let a=r.x<t.x?n-s:n+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)*n>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;a=h*d/c;const f={x:r.x<t.x?r.x+a:r.x-h+a,y:r.y<t.y?r.y+c-d:r.y-c+d};return a===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 ${a}`,f),f}else{r.x<t.x?a=t.x-n-i:a=i-n-t.x;let d=c*a/h,f=r.x<t.x?r.x+h-a:r.x-h+a,u=r.y<t.y?r.y+d:r.y-d;return V.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${a}`,{_x:f,_y:u}),a===0&&(f=t.x,u=t.y),h===0&&(f=t.x),c===0&&(u=t.y),{x:f,y:u}}},"intersection"),Xd=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),!wL(t,s)&&!o){const n=SL(t,i,s);V.debug("abc88 inside",s,i,n),V.debug("abc88 intersection",n,t);let a=!1;r.forEach(l=>{a=a||l.x===n.x&&l.y===n.y}),r.some(l=>l.x===n.x&&l.y===n.y)?V.warn("abc88 no intersect",n,r):r.push(n),o=!0}else V.warn("abc88 outside",s,i),i=s,o||r.push(s)}),V.debug("returning points",r),r},"cutPathAtIntersect");function j0(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],n=e[i+1];(o.x===s.x&&s.y===n.y&&Math.abs(s.x-n.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===n.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-n.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(j0,"extractCornerPoints");var Vd=p(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),n=r/s;return{x:t.x-n*i,y:t.y-n*o}},"findAdjacentPoint"),TL=p(function(e){const{cornerPointPositions:t}=j0(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],n=e[i],a=Vd(o,n,5),l=Vd(s,n,5),c=l.x-a.x,h=l.y-a.y;r.push(a);const d=Math.sqrt(2)*2;let f={x:n.x,y:n.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;n.x===a.x?f={x:c<0?a.x-u+d:a.x+u-d,y:h<0?a.y-d:a.y+d}:f={x:c<0?a.x-d:a.x+d,y:h<0?a.y-u+d:a.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"),vL=p((e,t,r)=>{const i=e-t-r,o=2,s=2,n=o+s,a=Math.floor(i/n),l=Array(a).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),W0=p(function(e,t,r,i,o,s,n,a=!1){if(!n)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 A in t.cssCompiledStyles)vh(A)||g.push(t.cssCompiledStyles[A]);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 A=h.slice(1,-1),I=A[0],P=A[A.length-1],L=.5,U=Math.abs(h[h.length-1].x-P.x)<L&&Math.abs(h[h.length-1].y-P.y)<L,z=f.intersect(I),X=U?P:u.intersect(P),K=Math.abs(X.x-P.x)<L&&Math.abs(X.y-P.y)<L,G=Math.abs(z.x-I.x)<L&&Math.abs(z.y-I.y)<L?[]:[z],rt=K?[]:[X];h=[...G,...A,...rt]}h=kL(t,h)}else u.intersect&&f.intersect&&!a&&(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=Xd(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=Xd(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(A=>!Number.isNaN(A.y));const x=CL(t.curve);x!=="rounded"&&(y=TL(y));let C=Oo;switch(x){case"linear":C=Oo;break;case"basis":C=tn;break;case"cardinal":C=ig;break;case"bumpX":C=Qf;break;case"bumpY":C=Jf;break;case"catmullRom":C=sg;break;case"monotoneX":C=dg;break;case"monotoneY":C=ug;break;case"natural":C=gg;break;case"step":C=pg;break;case"stepAfter":C=yg;break;case"stepBefore":C=mg;break;case"rounded":C=Oo;break;default:C=tn}const{x:w,y:S}=N0(t),T=Kf().x(w).y(S).curve(C);let B;switch(t.thickness){case"normal":B="edge-thickness-normal";break;case"thick":B="edge-thickness-thick";break;case"invisible":B="edge-thickness-invisible";break;default:B="edge-thickness-normal"}switch(t.pattern){case"solid":B+=" edge-pattern-solid";break;case"dotted":B+=" edge-pattern-dotted";break;case"dashed":B+=" edge-pattern-dashed";break;default:B+=" edge-pattern-solid"}let E,_=x==="rounded"?H0(Y0(y,t),5):T(y);const D=Array.isArray(t.style)?t.style:[t.style];let O=D.find(A=>A?.startsWith("stroke:")),R="";t.animate&&(R="edge-animation-fast"),t.animation&&(R="edge-animation-"+t.animation);let W=!1;if(t.look==="handDrawn"){const A=st.svg(e);Object.assign([],y);const I=A.path(_,{roughness:.3,seed:l});B+=" transition",E=yt(I).select("path").attr("id",`${n}-${t.id}`).attr("class"," "+B+(t.classes?" "+t.classes:"")+(R?" "+R:"")).attr("style",D?D.reduce((L,U)=>L+";"+U,""):"");let P=E.attr("d");E.attr("d",P),e.node().appendChild(E.node())}else{const A=g.join(";"),I=D?D.reduce((K,Q)=>K+Q+";",""):"",P=(A?A+";"+I+";":I)+";"+(D?D.reduce((K,Q)=>K+";"+Q,""):"");E=e.append("path").attr("d",_).attr("id",`${n}-${t.id}`).attr("class"," "+B+(t.classes?" "+t.classes:"")+(R?" "+R:"")).attr("style",P),O=P.match(/stroke:([^;]+)/)?.[1],W=t.animate===!0||!!t.animation||A.includes("animation");const L=E.node(),U=typeof L.getTotalLength=="function"?L.getTotalLength():0,z=Ud[t.arrowTypeStart]||0,X=Ud[t.arrowTypeEnd]||0;if(t.look==="neo"&&!W){const Q=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?vL(U,z,X):`0 ${z} ${U-z-X} ${X}`}; stroke-dashoffset: 0;`;E.attr("style",Q+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",t.id),E.attr("data-points",m),E.attr("data-look",Qt(t.look)),t.showPoints&&y.forEach(A=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",A.x).attr("cy",A.y)});let j="";(wt().flowchart.arrowMarkerAbsolute||wt().state.arrowMarkerAbsolute)&&(j=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,j=j.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const N=!W&&t?.look==="neo";mL(E,t,j,n,i,N,O);const $=Math.floor(h.length/2),F=h[$];ve.isLabelCoordinateInPath(F,E.attr("d"))||(d=!0);let q={};return d&&(q.updatedPath=h),q.originalPath=t.points,q},"insertEdge");function H0(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const n=e[s],a=e[s-1],l=e[s+1];if(s===0)r+=`M${n.x},${n.y}`;else if(s===i-1)r+=`L${n.x},${n.y}`;else{const c=n.x-a.x,h=n.y-a.y,d=l.x-n.x,f=l.y-n.y,u=Math.hypot(c,h),g=Math.hypot(d,f);if(u<o||g<o){r+=`L${n.x},${n.y}`;continue}const m=c/u,y=h/u,x=d/g,C=f/g,w=m*x+y*C,S=Math.max(-1,Math.min(1,w)),T=Math.acos(S);if(T<o||Math.abs(Math.PI-T)<o){r+=`L${n.x},${n.y}`;continue}const B=Math.min(t/Math.sin(T/2),u/2,g/2),E=n.x-m*B,_=n.y-y*B,D=n.x+x*B,O=n.y+C*B;r+=`L${E},${_}`,r+=`Q${n.x},${n.y} ${D},${O}`}}return r}p(H0,"generateRoundedPath");function Ol(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(Ol,"calculateDeltaAndAngle");function Y0(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&ie[t.arrowTypeStart]){const o=ie[t.arrowTypeStart],s=e[0],n=e[1],{angle:a}=Ol(s,n),l=o*Math.cos(a),c=o*Math.sin(a);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],n=e[i-2],{angle:a}=Ol(n,s),l=o*Math.cos(a),c=o*Math.sin(a);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(Y0,"applyMarkerOffsetsToPoints");var _L=p((e,t,r,i)=>{t.forEach(o=>{VL[o](e,r,i)})},"insertMarkers"),BL=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"),LL=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"),EL=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"),FL=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"),AL=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"),ML=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"),OL=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"),$L=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"),RL=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"),IL=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"),PL=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"),DL=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"),NL=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"),qL=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"),zL=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"),jL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:n}=o,a=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");a.append("circle").attr("fill",n??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),a.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",n??"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"),HL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:n}=o,a=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");a.append("circle").attr("fill",n??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),a.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",n??"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"),YL=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"),UL=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"),GL=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"),XL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o,n=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");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),n.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),VL={extension:BL,composition:LL,aggregation:EL,dependency:FL,lollipop:AL,point:ML,circle:OL,cross:$L,barb:RL,barbNeo:IL,only_one:PL,zero_or_one:DL,one_or_more:NL,zero_or_more:qL,only_one_neo:zL,zero_or_one_neo:jL,one_or_more_neo:WL,zero_or_more_neo:HL,requirement_arrow:YL,requirement_contains:GL,requirement_arrow_neo:UL,requirement_contains_neo:XL},U0=_L,KL={common:Zi,getConfig:Rt,insertCluster:xy,insertEdge:W0,insertEdgeLabel:q0,insertMarkers:U0,insertNode:Jh,interpolateToCurve:Mh,labelHelper:dt,log:V,positionEdgeLabel:z0},Vo={},G0=p(e=>{for(const t of e)Vo[t.name]=t},"registerLayoutLoaders"),ZL=p(()=>{G0([{name:"dagre",loader:p(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-DF3Mvuas.cjs")),"loader")},{name:"swimlane",loader:p(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-DtdLK5z3.cjs")),"loader")},{name:"cose-bilkent",loader:p(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-Cjfa6NyL.cjs")),"loader")}])},"registerDefaultLayoutLoaders");ZL();var QL=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Vo))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=Vo[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:n}=e.config,{useGradient:a,gradientStart:l,gradientStop:c}=n,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"}`),a){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,KL,{algorithm:i.algorithm},r)},"render"),JL=p((e="",{fallback:t="dagre"}={})=>{if(e in Vo)return e;if(t in Vo)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"),tc="comm",X0="rule",V0="decl",tE="@media",eE="@import",rE="@supports",iE="@namespace",$l="@keyframes",K0="@layer",oE="@scope",sE=Math.abs,Io=String.fromCharCode;function Z0(e){return e.trim()}function Rl(e,t,r){return e.replace(t,r)}function Si(e,t){return e.charCodeAt(t)|0}function Gi(e,t,r){return e.slice(t,r)}function Ge(e){return e.length}function Q0(e){return e.length}function ws(e,t){return t.push(e),e}var Xn=1,Xi=1,J0=0,Be=0,Yt=0,ro="";function ec(e,t,r,i,o,s,n,a){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:Xn,column:Xi,length:n,return:"",siblings:a}}function nE(){return Yt}function aE(){return Yt=Be>0?Si(ro,--Be):0,Xi--,Yt===10&&(Xi=1,Xn--),Yt}function De(){return Yt=Be<J0?Si(ro,Be++):0,Xi++,Yt===10&&(Xi=1,Xn++),Yt}function wr(){return Si(ro,Be)}function Ps(){return Be}function Vn(e,t){return Gi(ro,e,t)}function Ko(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 lE(e){return Xn=Xi=1,J0=Ge(ro=e),Be=0,[]}function hE(e){return ro="",e}function va(e){return Z0(Vn(Be-1,Il(e===91?e+2:e===40?e+1:e)))}function cE(e){for(;(Yt=wr())&&Yt<33;)De();return Ko(e)>2||Ko(Yt)>3?"":" "}function dE(e,t){for(;--t&&De()&&!(Yt<48||Yt>102||Yt>57&&Yt<65||Yt>70&&Yt<97););return Vn(e,Ps()+(t<6&&wr()==32&&De()==32))}function Il(e){for(;De();)switch(Yt){case e:return Be;case 34:case 39:e!==34&&e!==39&&Il(Yt);break;case 40:e===41&&Il(e);break;case 92:De();break}return Be}function uE(e,t){for(;De()&&e+Yt!==57;)if(e+Yt===84&&wr()===47)break;return"/*"+Vn(t,Be-1)+"*"+Io(e===47?e:De())}function fE(e){for(;!Ko(wr());)De();return Vn(e,Be)}function gE(e){return hE(Ds("",null,null,null,[""],e=lE(e),0,[0],e))}function Ds(e,t,r,i,o,s,n,a,l){for(var c=0,h=0,d=n,f=0,u=0,g=0,m=1,y=1,x=1,C=0,w=0,S="",T=o,B=s,E=i,_=S;y;)switch(g=w,w=De()){case 40:g!=108&&Si(_,d-1)==58?(C++,_+="("):_+=va(w);break;case 41:C--,_+=")";break;case 34:case 39:case 91:_+=va(w);break;case 9:case 10:case 13:case 32:if(C>0){_+=Io(w);break}_+=cE(g);break;case 92:_+=dE(Ps()-1,7);continue;case 47:switch(wr()){case 42:case 47:ws(pE(uE(De(),Ps()),t,r,l),l),(Ko(g||1)==5||Ko(wr()||1)==5)&&Ge(_)&&Gi(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:a[c++]=Ge(_)*x;case 125*m:case 59:case 0:if(C>0&&w){_+=Io(w);break}switch(w){case 0:case 125:y=0;case 59+h:x==-1&&(_=Rl(_,/\f/g,"")),u>0&&(Ge(_)-d||m===0)&&ws(u>32?Zd(_+";",i,r,d-1,l):Zd(Rl(_," ","")+";",i,r,d-2,l),l);break;case 59:_+=";";default:if(ws(E=Kd(_,t,r,c,h,o,a,S,T=[],B=[],d,s),s),w===123)if(h===0)Ds(_,t,E,E,T,s,d,a,B);else{switch(f){case 99:if(Si(_,3)===110)break;case 108:if(Si(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Ds(e,E,E,i&&ws(Kd(e,E,E,0,0,o,a,S,o,T=[],d,B),B),o,B,d,a,i?T:B):Ds(_,E,E,E,[""],B,0,a,B)}}c=h=u=0,m=x=1,S=_="",d=n;break;case 58:d=1+Ge(_),u=g;default:if(m<1){if(w==123)--m;else if(w==125&&m++==0&&aE()==125)continue}switch(_+=Io(w),w*m){case 38:x=h>0?1:(_+="\f",-1);break;case 44:if(C>0)break;a[c++]=(Ge(_)-1)*x,x=1;break;case 64:wr()===45&&(_+=va(De())),f=wr(),h=d=Ge(S=_+=fE(Ps())),w++;break;case 45:g===45&&Ge(_)==2&&(m=0)}}return s}function Kd(e,t,r,i,o,s,n,a,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=Q0(u),m=0,y=0,x=0;m<i;++m)for(var C=0,w=Gi(e,f+1,f=sE(y=n[m])),S=e;C<g;++C)(S=Z0(y>0?u[C]+" "+w:Rl(w,/&\f/g,u[C])))&&(l[x++]=S);return ec(e,t,r,o===0?X0:a,l,c,h,d)}function pE(e,t,r,i){return ec(e,t,r,tc,Io(nE()),Gi(e,2,-2),0,i)}function Zd(e,t,r,i,o){return ec(e,t,r,V0,Gi(e,0,i),Gi(e,i+1,-1),i,o)}function Pl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function mE(e,t,r,i){switch(e.type){case K0:if(e.children.length)break;case eE:case iE:case V0:return e.return=e.return||e.value;case tc:return"";case $l:return e.return=e.value+"{"+Pl(e.children,i)+"}";case X0:if(!Ge(e.value=e.props.join(",")))return""}return Ge(r=Pl(e.children,i))?e.return=e.value+"{"+r+"}":""}function yE(e){var t=Q0(e);return function(r,i,o,s){for(var n="",a=0;a<t;a++)n+=e[a](r,i,o,s)||"";return n}}var tx="c4",xE=p(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),CE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-W7Qa-ecL.cjs"));return{id:tx,diagram:e}},"loader"),bE={id:tx,detector:xE,loader:CE},kE=bE,ex="flowchart",wE=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),SE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-CRC9U6qD.cjs"));return{id:ex,diagram:e}},"loader"),TE={id:ex,detector:wE,loader:SE},vE=TE,rx="flowchart-v2",_E=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"),BE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-CRC9U6qD.cjs"));return{id:rx,diagram:e}},"loader"),LE={id:rx,detector:_E,loader:BE},EE=LE,ix="swimlane",FE=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),AE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-DZuQxKuB.cjs"));return{id:ix,diagram:e}},"loader"),ME={id:ix,detector:FE,loader:AE},OE=ME,ox="er",$E=p(e=>/^\s*erDiagram/.test(e),"detector"),RE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-DqFANbZx.cjs"));return{id:ox,diagram:e}},"loader"),IE={id:ox,detector:$E,loader:RE},PE=IE,sx="gitGraph",DE=p(e=>/^\s*gitGraph/.test(e),"detector"),NE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-BWYUn1Bi.cjs"));return{id:sx,diagram:e}},"loader"),qE={id:sx,detector:DE,loader:NE},zE=qE,nx="gantt",jE=p(e=>/^\s*gantt/.test(e),"detector"),WE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-CR55KG5d.cjs"));return{id:nx,diagram:e}},"loader"),HE={id:nx,detector:jE,loader:WE},YE=HE,ax="info",UE=p(e=>/^\s*info/.test(e),"detector"),GE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-CsUGc58_.cjs"));return{id:ax,diagram:e}},"loader"),XE={id:ax,detector:UE,loader:GE},lx="pie",VE=p(e=>/^\s*pie/.test(e),"detector"),KE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-BKvggS7k.cjs"));return{id:lx,diagram:e}},"loader"),ZE={id:lx,detector:VE,loader:KE},hx="quadrantChart",QE=p(e=>/^\s*quadrantChart/.test(e),"detector"),JE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-BHhoAvLS.cjs"));return{id:hx,diagram:e}},"loader"),tF={id:hx,detector:QE,loader:JE},eF=tF,cx="xychart",rF=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),iF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-a1vb5UxD.cjs"));return{id:cx,diagram:e}},"loader"),oF={id:cx,detector:rF,loader:iF},sF=oF,dx="requirement",nF=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),aF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-BhdvQnjG.cjs"));return{id:dx,diagram:e}},"loader"),lF={id:dx,detector:nF,loader:aF},hF=lF,ux="sequence",cF=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),dF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-GepntdDB.cjs"));return{id:ux,diagram:e}},"loader"),uF={id:ux,detector:cF,loader:dF},fF=uF,fx="class",gF=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),pF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-BKruajP_.cjs"));return{id:fx,diagram:e}},"loader"),mF={id:fx,detector:gF,loader:pF},yF=mF,gx="classDiagram",xF=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),CF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-BKruajP_.cjs"));return{id:gx,diagram:e}},"loader"),bF={id:gx,detector:xF,loader:CF},kF=bF,px="state",wF=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),SF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-D2cvrAtN.cjs"));return{id:px,diagram:e}},"loader"),TF={id:px,detector:wF,loader:SF},vF=TF,mx="stateDiagram",_F=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),BF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-BaktPIVY.cjs"));return{id:mx,diagram:e}},"loader"),LF={id:mx,detector:_F,loader:BF},EF=LF,yx="journey",FF=p(e=>/^\s*journey/.test(e),"detector"),AF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-DrNyUSsx.cjs"));return{id:yx,diagram:e}},"loader"),MF={id:yx,detector:FF,loader:AF},OF=MF,$F=p((e,t,r)=>{V.debug(`rendering svg for syntax error
303
+ `);const i=xg(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Jl(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"),xx={draw:$F},RF=xx,IF={db:{},renderer:xx,parser:{parse:p(()=>{},"parse")}},PF=IF,Cx="flowchart-elk",DF=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),NF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-CRC9U6qD.cjs"));return{id:Cx,diagram:e}},"loader"),qF={id:Cx,detector:DF,loader:NF},zF=qF,bx="timeline",jF=p(e=>/^\s*timeline/.test(e),"detector"),WF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./timeline-definition-FHXFAJF6-oFf_sUOI.cjs"));return{id:bx,diagram:e}},"loader"),HF={id:bx,detector:jF,loader:WF},YF=HF,kx="mindmap",UF=p(e=>/^\s*mindmap/.test(e),"detector"),GF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./mindmap-definition-LN4V7U3C-CBrUse7P.cjs"));return{id:kx,diagram:e}},"loader"),XF={id:kx,detector:UF,loader:GF},VF=XF,wx="kanban",KF=p(e=>/^\s*kanban/.test(e),"detector"),ZF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./kanban-definition-HUTT4EX6-CvBgN3eX.cjs"));return{id:wx,diagram:e}},"loader"),QF={id:wx,detector:KF,loader:ZF},JF=QF,Sx="sankey",tA=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),eA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sankeyDiagram-HTMAVEWB-CUeYKZeQ.cjs"));return{id:Sx,diagram:e}},"loader"),rA={id:Sx,detector:tA,loader:eA},iA=rA,Tx="packet",oA=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),sA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-NH7WQ7WH-D6wMwkLQ.cjs"));return{id:Tx,diagram:e}},"loader"),nA={id:Tx,detector:oA,loader:sA},vx="radar",aA=p(e=>/^\s*radar-beta/.test(e),"detector"),lA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-WEI45ONY-SYHw7k8b.cjs"));return{id:vx,diagram:e}},"loader"),hA={id:vx,detector:aA,loader:lA},_x="block",cA=p(e=>/^\s*block(-beta)?/.test(e),"detector"),dA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./blockDiagram-677ZJIJ3-D7RRzjUx.cjs"));return{id:_x,diagram:e}},"loader"),uA={id:_x,detector:cA,loader:dA},fA=uA,Bx="treeView",gA=p(e=>/^\s*treeView-beta/.test(e),"detector"),pA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-OA4YK3LP-DeJ7pMIO.cjs"));return{id:Bx,diagram:e}},"loader"),mA={id:Bx,detector:gA,loader:pA},yA=mA,Lx="architecture",xA=p(e=>/^\s*architecture/.test(e),"detector"),CA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./architectureDiagram-ZJ3FMSHR-gTB8pttO.cjs"));return{id:Lx,diagram:e}},"loader"),bA={id:Lx,detector:xA,loader:CA},kA=bA,Ex="eventmodeling",wA=p(e=>/^\s*eventmodeling/.test(e),"detector"),SA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-FQU43EPY-DwhEcKWF.cjs"));return{id:Ex,diagram:e}},"loader"),TA={id:Ex,detector:wA,loader:SA},vA=TA,Fx="ishikawa",_A=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),BA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ishikawaDiagram-FXEZZL3T-D5b25aDN.cjs"));return{id:Fx,diagram:e}},"loader"),LA={id:Fx,detector:_A,loader:BA},Ax="venn",EA=p(e=>/^\s*venn-beta/.test(e),"detector"),FA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./vennDiagram-L72KCM5P-Ba2FGeN1.cjs"));return{id:Ax,diagram:e}},"loader"),AA={id:Ax,detector:EA,loader:FA},MA=AA,Mx="treemap",OA=p(e=>/^\s*treemap/.test(e),"detector"),$A=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-G47NLZAW-CKIEbGLS.cjs"));return{id:Mx,diagram:e}},"loader"),RA={id:Mx,detector:OA,loader:$A},Ox="wardley",IA=p(e=>/^\s*wardley-beta/i.test(e),"detector"),PA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./wardleyDiagram-EHGQE667-CqB3gLCH.cjs"));return{id:Ox,diagram:e}},"loader"),DA={id:Ox,detector:IA,loader:PA},NA=DA,$x="cynefin",qA=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),zA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./cynefinDiagram-TSTJHNR4-B3boTACW.cjs"));return{id:$x,diagram:e}},"loader"),jA={id:$x,detector:qA,loader:zA},Rx="railroad",WA=p(e=>/^\s*railroad-beta/i.test(e),"detector"),HA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./railroadDiagram-RFXS5EU6-CwGmOFD_.cjs"));return{id:Rx,diagram:e}},"loader"),YA={id:Rx,detector:WA,loader:HA},Ix="railroadEbnf",UA=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),GA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ebnfDiagram-CCIWWBDH-23bjk9FU.cjs"));return{id:Ix,diagram:e}},"loader"),XA={id:Ix,detector:UA,loader:GA},Px="railroadAbnf",VA=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),KA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./abnfDiagram-VRR7QNED-Crz-ChMJ.cjs"));return{id:Px,diagram:e}},"loader"),ZA={id:Px,detector:VA,loader:KA},Dx="railroadPeg",QA=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),JA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pegDiagram-2B236MQR-C5pLIpKI.cjs"));return{id:Dx,diagram:e}},"loader"),tM={id:Dx,detector:QA,loader:JA},Qd=!1,Kn=p(()=>{Qd||(Qd=!0,Us("error",PF,e=>e.toLowerCase().trim()==="error"),Us("---",{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("---")),qa(zF,VF,kA),qa(kE,JF,kF,yF,PE,YE,XE,ZE,hF,fF,OE,EE,vE,YF,zE,EF,vF,OF,eF,iA,nA,sF,fA,vA,yA,hA,LA,RA,YA,XA,ZA,tM,MA,NA,jA))},"addDiagrams"),eM=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{Ya(r)}catch{try{const{diagram:s,id:n}=await o();Us(n,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"),rM="graphics-document document";function Nx(e,t){e.attr("role",rM),t!==""&&e.attr("aria-roledescription",t)}p(Nx,"setA11yDiagramInfo");function qx(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(qx,"addSVGa11yTitleDescription");var Vr,Dl=(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=Zl(t,i);t=y_(t)+`
304
+ `;try{Ya(o)}catch{const c=Mk(o);if(!c)throw new sf(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();Us(h,d)}const{db:s,parser:n,renderer:a,init:l}=Ya(o);return n.parser&&(n.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await n.parse(t),new Vr(o,t,s,n,a)}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),Jd=[],iM=p(()=>{Jd.forEach(e=>{e()}),Jd=[]},"attachFunctions"),oM=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function zx(e){const t=e.match(of);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
305
+ `).map(n=>n.startsWith(r)?n.slice(r.length):n).join(`
306
+ `):t[2];let o=em(i,{schema:tm})??{};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(zx,"extractFrontMatter");var sM=p(e=>e.replace(/\r\n?/g,`
307
+ `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),nM=p(e=>{const{text:t,metadata:r}=zx(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"),aM=p(e=>{const t=ve.detectInit(e)??{},r=ve.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:a_(e),directive:t}},"processDirectives");function rc(e){const t=sM(e),r=nM(t),i=aM(r.text),o=qn(r.config,i.directive);return e=oM(i.text),{code:e,title:r.title,config:o}}p(rc,"preprocessDiagram");function jx(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(jx,"toBase64");var lM=5e4,hM="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",cM="sandbox",dM="loose",uM="http://www.w3.org/2000/svg",fM="http://www.w3.org/1999/xlink",gM="http://www.w3.org/1999/xhtml",pM="100%",mM="100%",yM="border:0;margin:0;",xM="margin:0",CM="allow-top-navigation-by-user-activation allow-popups",bM='The "iframe" tag is not supported by your browser.',kM=["foreignobject"],wM=["dominant-baseline"];function ic(e){const t=rc(e);return Hs(),Lk(t.config??{}),t}p(ic,"processAndSetConfigs");async function Wx(e,t){Kn();try{const{code:r,config:i}=ic(e);return{diagramType:(await Yx(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(Wx,"parse");var tu=p((e,t,r=[])=>{const i=Zu(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),SM=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 a=ae(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{fd(l.styles)||a.forEach(c=>{r.insertRule(tu(l.id,c,l.styles),r.cssRules.length)}),fd(l.textStyles)||r.insertRule(tu(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=Ha(o)+`
308
+ `}else i+=`${e.themeCSS}
309
+ `;return i+Ha(r)},"createCssStyles"),TM=p((e,t)=>Pl(gE(`${e}{${t}}`),yE([p(function(i,o,s,n){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===$l)return;i.props=i.props.map(a=>a.startsWith(e)?a:`${e} ${a}`)}else i.type.startsWith("@")&&([...[tE,rE,K0,oE,"@container","@starting-style"],$l].includes(i.type)||(V.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=tc))},"addNamespace"),mE])),"compileCSS"),vM=p((e,t,r,i)=>{const o=SM(e,r),s=Vk(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return TM(i,s)},"createUserStyles"),_M=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=Br(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),BM=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":mM,i=jx(`<body style="${xM}">${e}</body>`);return`<iframe style="width:${pM};height:${r};${yM}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${CM}">
310
+ ${bM}
311
+ </iframe>`},"putIntoIFrame"),eu=p((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const n=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",uM);return o&&n.attr("xmlns:xlink",o),n.append("g"),e},"appendDivSvgG");function Nl(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(Nl,"sandboxedIframe");var LM=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),EM=p(async function(e,t,r){Kn();const i=ic(t);t=i.code;const o=Rt();V.debug(o),t.length>(o?.maxTextSize??lM)&&(t=hM);const s=`#${e}`,n="i"+e,a="#"+n,l="d"+e,c="#"+l,h=p(()=>{const j=yt(f?a:c).node();j&&"remove"in j&&j.remove()},"removeTempElements");let d=yt(document.body);const f=o.securityLevel===cM,u=o.securityLevel===dM,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const W=Nl(yt(r),n);d=yt(W.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);eu(d,e,l,`font-family: ${g}`,fM)}else{if(LM(document,e,l,n),f){const W=Nl(yt(document.body),n);d=yt(W.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");eu(d,e,l)}let m,y;try{m=await Dl.fromText(t,{title:i.title})}catch(W){if(o.suppressErrorRendering)throw h(),W;m=await Dl.fromText("error"),y=W}const x=d.select(c).node(),C=m.type,w=x.firstChild,S=w.firstChild,T=m.renderer.getClasses?.(t,m),B=vM(o,C,T,s),E=document.createElement("style");E.innerHTML=B,w.insertBefore(E,S);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(W){throw o.suppressErrorRendering?h():RF.draw(t,e,"11.16.0"),W}const _=d.select(`${c} svg`),D=m.db.getAccTitle?.(),O=m.db.getAccDescription?.();Ux(C,_,D,O),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",gM);let R=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),R=_M(R,f,tr(o.arrowMarkerAbsolute)),f){const W=d.select(c+" svg").node();R=BM(R,W)}else u||(R=Ni.sanitize(R,{ADD_TAGS:kM,ADD_ATTR:wM,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(iM(),y)throw y;return h(),{diagramType:C,svg:R,bindFunctions:m.db.bindFunctions}},"render");function Hx(e={}){const t=Ut({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),_k(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"?vk(t):Qu();Xl(r.logLevel),Kn()}p(Hx,"initialize");var Yx=p((e,t={})=>{const{code:r}=rc(e);return Dl.fromText(r,t)},"getDiagramFromText");function Ux(e,t,r,i){Nx(t,e),qx(t,r,i,t.attr("id"))}p(Ux,"addA11yInfo");var ri=Object.freeze({render:EM,parse:Wx,getDiagramFromText:Yx,initialize:Hx,getConfig:Rt,setConfig:Ju,getSiteConfig:Qu,updateSiteConfig:Bk,reset:p(()=>{Hs()},"reset"),globalReset:p(()=>{Hs(qi)},"globalReset"),defaultConfig:qi});Xl(Rt().logLevel);Hs(Rt());var FM=p((e,t,r)=>{V.warn(e),Ph(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"),Gx=p(async function(e={querySelector:".mermaid"}){try{await AM(e)}catch(t){if(Ph(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"),AM=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 ve.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let n;const a=[];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()}`;n=l.innerHTML,n=Km(ve.entityDecode(n)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=ve.detectInit(n);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await Zx(c,n,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){FM(d,a,gr.parseError)}}if(a.length>0)throw a[0]},"runThrowsErrors"),Xx=p(function(e){ri.initialize(e)},"initialize"),MM=p(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&Xx(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Gx(i)},"init"),OM=p(async(e,{lazyLoad:t=!0}={})=>{Kn(),qa(...e),t===!1&&await eM()},"registerExternalDiagrams"),Vx=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",Vx,!1);var $M=p(function(e){gr.parseError=e},"setParseErrorHandler"),Cn=[],_a=!1,Kx=p(async()=>{if(!_a){for(_a=!0;Cn.length>0;){const e=Cn.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}_a=!1}},"executeQueue"),RM=p(async(e,t)=>new Promise((r,i)=>{const o=p(()=>new Promise((s,n)=>{ri.parse(e,t).then(a=>{s(a),r(a)},a=>{V.error("Error parsing",a),gr.parseError?.(a),n(a),i(a)})}),"performCall");Cn.push(o),Kx().catch(i)}),"parse"),Zx=p((e,t,r)=>new Promise((i,o)=>{const s=p(()=>new Promise((n,a)=>{ri.render(e,t,r).then(l=>{n(l),i(l)},l=>{V.error("Error parsing",l),gr.parseError?.(l),a(l),o(l)})}),"performCall");Cn.push(s),Kx().catch(o)}),"render"),IM=p(()=>Object.keys(Qr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),gr={startOnLoad:!0,mermaidAPI:ri,parse:RM,render:Zx,init:MM,run:Gx,registerExternalDiagrams:OM,registerLayoutLoaders:G0,initialize:Xx,parseError:void 0,contentLoaded:Vx,setParseErrorHandler:$M,detectType:Zl,registerIconPacks:Pm,getRegisteredDiagramsMetadata:IM},ql=gr;const PM=[["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"}]],DM=St("maximize-2",PM);const NM=[["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"}]],qM=St("minimize-2",NM),Fr="flex size-11 items-center justify-center rounded border p-1 shadow",zM="flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow",jM="absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",ru="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",pr="fullscreen",WM=229,HM=e=>{const t=e.ownerDocument.defaultView?.getComputedStyle(e).blockSize;t!==void 0&&(e.style.minBlockSize=t)},iu=e=>{if(e.parentElement!==null)return e.parentElement;const t=e.getRootNode();return"host"in t?t.host:null},YM=e=>{const t=[];for(let r=iu(e);r!==null;r=iu(r))t.push({element:r,top:r.scrollTop,left:r.scrollLeft});return t},UM=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"})},GM=e=>{e.style.removeProperty("min-block-size"),e.getAttribute("style")===""&&e.removeAttribute("style")},oc=(e,t)=>{const[r,i]=v.useState(!1),o=v.useRef(null),s=v.useRef(null),n=v.useRef([]),a=v.useRef(!1);v.useEffect(()=>{a.current&&(a.current=!1,o.current?.querySelector(`[${e}="${pr}"]`)?.focus())},[r,e]);const l=v.useCallback(f=>{const u=o.current;if(u===null)return;const g=s.current;f&&g!==null&&(n.current=YM(g),HM(g)),u.close(),f?u.showModal():(u.show(),g!==null&&GM(g),UM(n.current),n.current=[]),a.current=!0,i(f)},[]);v.useLayoutEffect(()=>{r&&!t&&l(!1)},[r,t,l]);const c=v.useCallback(()=>l(!r),[r,l]),h=v.useCallback(f=>{!r||f.key!=="Escape"||f.defaultPrevented||f.nativeEvent.isComposing||f.keyCode===WM||(f.preventDefault(),f.stopPropagation(),l(!1))},[r,l]),d=v.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}}},sc=({hook:e,fullscreen:t,labels:r,tabIndex:i,onToggle:o})=>{const s=t?r.exitFullscreen:r.fullscreen;return k.jsx("button",{type:"button",[e]:pr,tabIndex:i,onClick:o,className:Fr,"aria-label":s.text,lang:s.lang,children:t?k.jsx(qM,{size:18}):k.jsx(DM,{size:18})})},Qx="both-shift",ou=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})}),XM=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),VM=Object.freeze(["none","zoom","pan","both"]),KM=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),Ns=.3,ZM=3,QM=2,Wr=.5,JM=1;function su(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const t5=0;function Ba(e,t,r){return e.panTrigger===null||t.button!==t5?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function e5(e,t){return e.zoom&&t.shiftKey}function r5(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 i5(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 o5(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:QM/e}}function La(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function yo(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 s5(e,t,r){const i=(o,s,n,a)=>{const l=(0-s)/e.scale,c=(a-s-e.scale*n)/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 n5(e,t,r){return e*t.inline-r.inline>Wr||e*t.block-r.block>Wr}function a5(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<JM?null:{ratio:r(t)/o,from:i(e),to:i(t)}}function nu(e){return e*(1-Math.exp(-Ns))}function au(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 Zn=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"}}),l5=Vi(Zn),h5=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),c5=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),Jx="(pointer: coarse)",d5=e=>{const t=window.matchMedia(Jx);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},u5=()=>window.matchMedia(Jx).matches,f5=()=>!1,g5=()=>v.useSyncExternalStore(d5,u5,f5),nc=(e,t)=>{const[r,i]=v.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}},Po={side:"start",offset:0,maxWidth:null},p5=(e,t,r,i)=>{const o=l=>l>=r.low&&l+t<=r.high;if(o(i?e.right-t:e.left))return Po;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 Po;const n=Math.min(t,s),a=Math.min(Math.max(i?e.right-n:e.left,r.low),r.high-n);return{side:"inside",offset:i?e.right-a-n:a-e.left,maxWidth:n<t?n:null}},tC=({buttonHook:e,menuHook:t,label:r,icon:i,tabIndex:o,items:s})=>{const[n,a]=v.useState(null),[l,c]=v.useState(Po),h=n!==null,d=v.useId(),f=v.useId(),u=v.useRef(null),g=v.useRef(null),m=v.useRef(null),y=()=>Array.from(m.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]),x=S=>{a(null),c(Po),S&&g.current?.focus()};v.useLayoutEffect(()=>{const S=u.current,T=m.current;if(n===null||S===null||T===null)return;const B=T.ownerDocument.documentElement.clientWidth,E=S.closest('[role="toolbar"]')?.getBoundingClientRect(),_=E===void 0?{low:0,high:B}:{low:Math.max(0,E.left),high:Math.min(B,E.right)},D=T.ownerDocument.defaultView?.getComputedStyle(T).direction==="rtl";c(p5(S.getBoundingClientRect(),T.getBoundingClientRect().width,_,D));const O=y(),R=O.findIndex(j=>j.getAttribute("aria-checked")==="true"),W=n==="last"?O.length-1:Math.max(R,0);O[W]?.focus()},[n]),v.useEffect(()=>{const S=u.current?.ownerDocument;if(!h||S===void 0)return;const T=B=>{B.target instanceof Node&&u.current?.contains(B.target)===!0||(a(null),c(Po))};return S.addEventListener("pointerdown",T,!0),S.addEventListener("focusin",T,!0),()=>{S.removeEventListener("pointerdown",T,!0),S.removeEventListener("focusin",T,!0)}},[h]);const C=S=>{if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),a(S.key==="ArrowUp"?"last":"chosen");return}S.key==="Escape"&&h&&(S.preventDefault(),S.stopPropagation(),x(!1))},w=S=>{const T=y(),B=T.indexOf(S.target);let E;switch(S.key){case"ArrowDown":E=(B+1)%T.length;break;case"ArrowUp":E=(B-1+T.length)%T.length;break;case"Home":E=0;break;case"End":E=T.length-1;break;case"Escape":S.preventDefault(),S.stopPropagation(),x(!0);return;default:return}S.preventDefault(),S.stopPropagation(),T[E]?.focus()};return k.jsxs("div",{ref:u,className:"relative",children:[k.jsx("button",{ref:g,id:d,type:"button",...e,tabIndex:o,onClick:()=>h?x(!1):a("chosen"),onKeyDown:C,className:Fr,"aria-label":r.text,lang:r.lang,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?f:void 0,children:i}),h&&k.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:w,className:jM,children:s.map(S=>{const T=()=>{x(!0),S.onSelect()};return S.checked===void 0?k.jsx("button",{type:"button",role:"menuitem",tabIndex:-1,lang:S.label.lang,...S.hook,onClick:T,className:ru,children:k.jsx("span",{children:S.label.text})},S.key):k.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":S.checked,tabIndex:-1,lang:S.label.lang,...S.hook,onClick:T,className:ru,children:[k.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:S.checked?"✓":""}),k.jsx("span",{children:S.label.text})]},S.key)})})]})},lu=new Set(["gantt"]),m5=200,y5=300,x5=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),C5="data-aqmd-mermaid-host",b5=e=>{const t=document.createElement("div");return t.setAttribute(C5,""),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 hu=Promise.resolve();const k5=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},cu=e=>{e.resetStyle(),e.destroy()},Ea=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",w5=Object.freeze({visibility:"hidden"}),xo="data-aqmd-mermaid-control",S5="--aqmd-mermaid-ratio";let eC=!1,zl=null;if(ql?.initialize)try{ql.initialize({startOnLoad:!1}),eC=!0}catch(e){zl=e instanceof Error?e:new Error(String(e))}else zl=new Error("Mermaid library or mermaid.initialize is not available.");const rC=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:o})=>{const s=v.useMemo(()=>hr(Zn,i),[i]),n=v.useId(),a=v.useId(),l=v.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),c=v.useRef(0),h=v.useRef(null),d=v.useRef(null),f=v.useRef(null),u=v.useRef(null),[g,m]=v.useState(!0),[y,x]=v.useState(null),[C,w]=v.useState(null),[S,T]=v.useState(0),B=v.useRef(!1),E=g5(),[_,D]=v.useState(t??Qx),O=v.useRef(ou[_]),R=v.useRef(!1),[W,j]=v.useState(!1);v.useEffect(()=>{t&&D(t)},[t]),v.useEffect(()=>{O.current=ou[_],u.current?.refresh()},[_]),v.useEffect(()=>{if(m(!0),x(null),w(null),!eC){x(zl?.message||"Mermaid failed to initialize globally."),m(!1);return}const G=e.trim();if(G===""){m(!1);return}const rt=h.current;if(!rt)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let Z=!1,tt=0,mt=null,_t=rt.offsetWidth,Ct=null,It,xe;const he=()=>{fe.disconnect(),clearTimeout(It)},Ht=Kt=>{Ct=null,he(),x(Kt),w(null),m(!1)},Pt=Kt=>{c.current+=1;const Jt=c.current;tt=Jt,mt=Kt;const Ee=()=>!Z&&Jt===tt,Fe=async()=>{const Ft=b5(Kt);try{return await ql.render(`${l.current}-${Jt}`,G,Ft)}finally{Ft.remove()}};hu=hu.then(()=>Ee()?Fe().then(Ft=>{if(Ee()){if(typeof Ft.svg!="string"||Ft.svg.length===0){Ht("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}Ct=Ft.diagramType,w({svg:Ft.svg,bindFunctions:typeof Ft.bindFunctions=="function"?Ft.bindFunctions:null}),m(!1),lu.has(Ft.diagramType)?_t!==Kt&&qt():fe.disconnect()}}).catch(Ft=>{if(Ee()){if(console.error(`[MermaidDiagram ${l.current}] Error rendering Mermaid diagram:`,Ft),k5(Ft)&&!B.current){B.current=!0,xe=setTimeout(()=>T(Tt=>Tt+1),y5);return}Ht(Ft instanceof Error?Ft.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},qt=()=>{clearTimeout(It),It=setTimeout(()=>{_t>0&&_t!==mt&&Pt(_t)},m5)},zt=()=>{const Kt=rt.offsetWidth;if(Kt!==_t){if(_t=Kt,mt===null){Kt>0&&Pt(Kt);return}Ct!==null&&lu.has(Ct)&&qt()}},fe=new ResizeObserver(zt);return fe.observe(rt),_t>0&&Pt(_t),()=>{Z=!0,he(),clearTimeout(xe)}},[e,S]),v.useEffect(()=>{const G=d.current;if(!G)return;const rt=()=>{u.current=null,f.current&&(cu(f.current),f.current=null),R.current=!1,j(!1)};if(!C){G.innerHTML="",rt();return}G.innerHTML=C.svg;const Z=G.querySelector("svg");let tt=!1,mt;const _t=[];if(Z){let Ct;try{Ct=r5(Z.getAttribute("viewBox"))}catch(he){console.error(`[MermaidDiagram ${l.current}] Cannot size the drawing:`,he),x(he instanceof Error?he.message:String(he)),w(null);return}const It=Ct===null?null:Ct.inline;Ct!==null&&Z.style.setProperty(S5,String(Ct.inline/Ct.block));const xe=()=>{if(tt)return;const he=Z.getBBox();if(!he||he.width===0||he.height===0){mt=setTimeout(xe,100);return}f.current&&cu(f.current);const Ht=zu(Z,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:Ns,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:su(O.current,!1)});f.current=Ht;let Pt={minScale:1,maxScale:1};const qt=()=>{const J=Ht.getPan();return{scale:Ht.getScale(),x:J.x,y:J.y}},zt=()=>{const J=G.getBoundingClientRect(),ut=Z.getBoundingClientRect(),{scale:xt,x:Dt,y:jt}=qt();return{frameRect:J,frame:{inline:J.width,block:J.height},drawing:{origin:{x:ut.left-J.left-xt*Dt,y:ut.top-J.top-xt*jt},inline:ut.width/xt,block:ut.height/xt}}},fe=()=>{if(tt)return;const{frame:J,drawing:ut}=zt(),xt=n5(Ht.getScale(),ut,J);R.current=xt,j(xt),Or(xt),Ht.setOptions({touchAction:su(O.current,xt)}),G.style.cursor=Ea(O.current,Tt?.kind==="pan"&&Tt.mouse)},Kt=()=>{const{drawing:J}=zt();J.inline<=0||(Pt=o5(i5(J.inline,It)),Ht.setOptions({minScale:Pt.minScale,maxScale:Pt.maxScale}))},Jt=J=>{const ut=qt(),{frame:xt,drawing:Dt}=zt(),jt=s5({...J,scale:La(J.scale,Pt)},Dt,xt);return jt.scale===ut.scale&&jt.x===ut.x&&jt.y===ut.y?!1:(Ht.zoom(jt.scale,{animate:!1,force:!0,silent:!0}),Ht.pan(jt.x,jt.y,{animate:!1,force:!0}),fe(),!0)},Ee=(J,ut)=>{const{drawing:xt}=zt();return Jt(yo(qt(),La(J,Pt),ut,ut,xt))},Fe=J=>{const ut=G.getBoundingClientRect();return{x:J.x-ut.left,y:J.y-ut.top}};u.current={zoomBy:J=>{const{frame:ut}=zt();Ee(Ht.getScale()*Math.exp(J*Ns),{x:ut.inline/2,y:ut.block/2})},panBy:(J,ut)=>{const{drawing:xt}=zt(),Dt=qt();return Jt(yo(Dt,Dt.scale,{x:0,y:0},{x:J,y:ut},xt))},reset:()=>{Jt({scale:1,x:0,y:0})},panSteps:()=>{const{frame:J}=zt();return{x:nu(J.inline),y:nu(J.block)}},refresh:fe};const Ft=new Map;let Tt=null;const Ae=J=>({x:J.clientX,y:J.clientY}),Mr=()=>{const J=[...Ft.values()];return J.length===2?[J[0],J[1]]:null},je=J=>{if(Ft.has(J.pointerId)&&Ft.set(J.pointerId,Ae(J)),Tt?.kind==="pinch"){const ut=Mr();if(ut===null)return;const xt=a5(Tt.last,ut);if(Tt={kind:"pinch",last:ut},xt===null)return;const{drawing:Dt}=zt(),jt=qt();Jt(yo(jt,La(jt.scale*xt.ratio,Pt),Fe(xt.from),Fe(xt.to),Dt));return}if(Tt?.kind==="pan"&&Tt.pointerId===J.pointerId){const ut=Ae(J),{drawing:xt}=zt(),Dt=qt();Jt(yo(Dt,Dt.scale,Fe(Tt.last),Fe(ut),xt)),Tt={...Tt,last:ut}}},We=()=>{window.removeEventListener("pointermove",je),window.removeEventListener("pointerup",yr),window.removeEventListener("pointercancel",yr)},rr=()=>{We(),window.addEventListener("pointermove",je),window.addEventListener("pointerup",yr),window.addEventListener("pointercancel",yr)},yr=J=>{if(Ft.delete(J.pointerId),Tt?.kind==="pinch"){const[ut]=[...Ft.entries()];Tt=ut!==void 0&&Ba(O.current,{button:0,shiftKey:!1,pointerType:J.pointerType},R.current)?{kind:"pan",pointerId:ut[0],last:ut[1],mouse:!1}:null}else Tt?.kind==="pan"&&Tt.pointerId===J.pointerId&&(Tt=null);Tt===null&&Ft.size===0&&We(),G.style.cursor=Ea(O.current,Tt?.kind==="pan"&&Tt.mouse)},si=J=>{const ut=O.current;if(J.pointerType==="touch"||J.pointerType==="pen"){Ft.set(J.pointerId,Ae(J)),rr();const xt=Mr();xt!==null&&ut.zoom?Tt={kind:"pinch",last:xt}:Ft.size>1?Tt?.kind==="pan"&&!Tt.mouse&&(Tt=null):Ba(ut,J,R.current)&&(Tt={kind:"pan",pointerId:J.pointerId,last:Ae(J),mouse:!1});return}Ba(ut,J,R.current)&&(Tt={kind:"pan",pointerId:J.pointerId,last:Ae(J),mouse:!0},G.style.cursor=Ea(ut,!0),rr(),J.preventDefault())},Me=J=>{Tt!==null&&!(Tt.kind==="pan"&&Tt.mouse)&&J.cancelable&&J.preventDefault()};let ir=!1;const Or=J=>{J!==ir&&(ir=J,J?G.addEventListener("touchmove",Me,{passive:!1}):G.removeEventListener("touchmove",Me))},ni=J=>{const ut=J.target;if(!(ut instanceof Element)||ut===Z||!Z.contains(ut))return;const xt=G.getBoundingClientRect(),Dt=ut.getBoundingClientRect(),jt={x:au(Dt.left-xt.left,Dt.right-xt.left,xt.width),y:au(Dt.top-xt.top,Dt.bottom-xt.top,xt.height)};if(jt.x===0&&jt.y===0)return;const{drawing:ai}=zt(),Rr=qt();Jt(yo(Rr,Rr.scale,{x:0,y:0},jt,ai))},xr=J=>{if(!e5(O.current,J))return;const ut=J.deltaY===0?J.deltaX:J.deltaY;ut!==0&&(J.preventDefault(),Ee(Ht.getScale()*Math.exp(Math.sign(-ut)*Ns/ZM),Fe(Ae(J))))},$r=new ResizeObserver(()=>{Kt(),Jt(qt()),fe()});G.addEventListener("pointerdown",si),G.addEventListener("focusin",ni),G.addEventListener("wheel",xr,{passive:!1}),Z.addEventListener("panzoomchange",fe),$r.observe(G),_t.push(()=>{G.removeEventListener("pointerdown",si),G.removeEventListener("focusin",ni),Or(!1),G.removeEventListener("wheel",xr),Z.removeEventListener("panzoomchange",fe),$r.disconnect(),We()}),Kt(),fe()};xe()}return C.bindFunctions&&C.bindFunctions(G),()=>{tt=!0,clearTimeout(mt);for(const Ct of _t)Ct();rt()}},[C]);const N=v.useCallback(G=>{const rt=u.current;if(rt===null||G.target!==G.currentTarget||G.altKey||G.ctrlKey||G.metaKey)return;const Z=rt.panSteps();let tt;switch(G.key){case"ArrowLeft":tt=rt.panBy(Z.x,0);break;case"ArrowRight":tt=rt.panBy(-Z.x,0);break;case"ArrowUp":tt=rt.panBy(0,Z.y);break;case"ArrowDown":tt=rt.panBy(0,-Z.y);break;case"+":case"=":rt.zoomBy(1),tt=!0;break;case"-":rt.zoomBy(-1),tt=!0;break;case"0":rt.reset(),tt=!0;break;default:tt=!1}tt&&G.preventDefault()},[]),$=v.useMemo(()=>[...W?["pan-left","pan-up","pan-down","pan-right"]:[],...r?[]:["mode"],"zoom-in","zoom-out","reset",pr],[r,W]),{onKeyDown:F,onFocus:q,tabIndexOf:A}=nc($,xo),I=!(g||y),{fullscreen:P,toggle:L,dialogProps:U,rootProps:z}=oc(xo,I),X=(G,rt,Z,tt,mt=!1)=>k.jsx("button",{type:"button",[xo]:G,tabIndex:A(G),onClick:Z,style:mt?w5:void 0,className:Fr,"aria-label":s[rt].text,lang:s[rt].lang,children:tt},G),K=G=>{const rt=u.current;if(rt===null)return;const Z=rt.panSteps();rt.panBy(G.x*Z.x,G.y*Z.y)};let Q;if(g)Q=k.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=k.jsxs("div",{"data-aqmd-mermaid-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[k.jsxs("div",{children:["Error: ",y]}),k.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{B.current=!1,x(null),T(G=>G+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:[k.jsx(Da,{className:"h-4 w-4"}),s.retry.text]})]});else{const G=s[E?"interactionModeTouch":"interactionMode"],rt=E?VM.map(Z=>({value:Z,label:s[c5[Z]],checked:KM[_]===Z})):XM.map(Z=>({value:Z,label:s[h5[Z]],checked:_===Z}));Q=k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-aqmd-mermaid-toolbar":"",role:"toolbar","aria-labelledby":n,onKeyDown:F,onFocus:q,className:"mb-1 flex flex-wrap items-start justify-end gap-1",children:[k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[X("pan-left","panLeft",()=>K({x:1,y:0}),k.jsx(R1,{size:18}),!W),X("pan-up","panUp",()=>K({x:0,y:1}),k.jsx(N1,{size:18}),!W),X("pan-down","panDown",()=>K({x:0,y:-1}),k.jsx(O1,{size:18}),!W),X("pan-right","panRight",()=>K({x:-1,y:0}),k.jsx(P1,{size:18}),!W)]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[!r&&k.jsx(tC,{buttonHook:{[xo]:"mode"},menuHook:{"data-aqmd-mermaid-menu":""},label:G,icon:k.jsx(j1,{size:18}),tabIndex:A("mode"),items:rt.map(({value:Z,label:tt,checked:mt})=>({key:Z,label:tt,checked:mt,onSelect:()=>D(Z)}))}),X("zoom-in","zoomIn",()=>u.current?.zoomBy(1),k.jsx(ju,{size:20})),X("zoom-out","zoomOut",()=>u.current?.zoomBy(-1),k.jsx(Wu,{size:20})),X("reset","resetView",()=>u.current?.reset(),k.jsx(Da,{size:18}))]}),k.jsx(sc,{hook:xo,fullscreen:P,labels:s,tabIndex:A(pr),onToggle:L})]}),k.jsx("div",{ref:d,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":W?"true":"false",role:"group",tabIndex:0,"aria-labelledby":n,onKeyDown:N,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return k.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":o,...z,children:[k.jsx("span",{id:n,hidden:!0,lang:s.diagram.lang,children:s.diagram.text}),k.jsx("span",{id:a,hidden:!0,lang:s.fullscreenDialog.lang,children:s.fullscreenDialog.text}),k.jsxs("dialog",{...U,"aria-labelledby":P?a:n,children:[k.jsx("div",{ref:h,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:x5}),Q]})]})};rC.displayName="MermaidDiagramInternal";const ac=v.memo(rC),T5="unicodeTextInMathMode",v5="noCharacterMetrics",_5=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,B5="consoleCommand",L5=e=>{const t=(r,i)=>o=>(i(o),e(B5,`${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())}},iC=(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=F5(e,t);return Nr.set(r,o),Nr.size>E5&&Nr.delete(Nr.keys().next().value),o},E5=610,Nr=new Map,F5=(e,t)=>{const r=[],i=(s,n)=>{r.push({code:s,message:n,formula:e,displayMode:t})},o=console.warn;console.warn=(...s)=>{const[n]=s;if(s.length===1&&typeof n=="string"&&_5.test(n)){i(v5,n);return}o.apply(console,s)};try{const s=ZC.renderToString(e,{displayMode:t,throwOnError:!1,macros:L5(i),strict:(n,a)=>(n!==T5&&i(n,a),"ignore")});return Object.freeze({innerHtml:Object.freeze({__html:s}),diagnostics:Object.freeze(r.map(n=>Object.freeze(n)))})}finally{console.warn=o}};const A5=[["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"}]],lc=St("copy",A5);const M5=[["path",{d:"m12 15 2 2 4-4",key:"2c609p"}],["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"}]],O5=St("copy-check",M5);const $5=[["line",{x1:"12",x2:"18",y1:"12",y2:"18",key:"1rg63v"}],["line",{x1:"12",x2:"18",y1:"18",y2:"12",key:"ebkxgr"}],["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"}]],R5=St("copy-x",$5),I5=2e3,oC=({text:e,labels:t})=>{const[r,i]=v.useState(null),o=v.useRef(0);v.useEffect(()=>{if(r===null)return;const a=setTimeout(()=>i(null),I5);return()=>clearTimeout(a)},[r]);const s=a=>{o.current+=1;const l=o.current,c=d=>{o.current===l&&i({notice:d,press:l})},h=a.currentTarget.ownerDocument.defaultView?.navigator.clipboard;if(h===void 0){c("copyFailed");return}Do(()=>h.writeText(e)).then(()=>c("copied"),d=>{console.error("[@aiquants/markdown] could not copy the text",d),c("copyFailed")})},n=r===null?lc:r.notice==="copied"?O5:R5;return k.jsxs(k.Fragment,{children:[k.jsx("button",{type:"button","data-aqmd-code-copy":"","data-aqmd-copy-outcome":r===null?"idle":r.notice==="copied"?"copied":"failed",className:"inline-flex size-11 shrink-0 items-center justify-center rounded-md transition-colors","aria-label":t.copy.text,lang:t.copy.lang,onClick:s,children:k.jsx(n,{size:18})}),k.jsx("span",{"data-aqmd-copy-notice":"",role:"status",className:"sr-only",children:r!==null&&k.jsx("span",{lang:t[r.notice].lang,children:t[r.notice].text},r.press)})]})};const P5=[["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=St("align-horizontal-space-around",P5);const N5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],q5=St("chevron-down",N5);const z5=[["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"}]],j5=St("download",z5);const W5=[["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"}]],H5=St("fold-horizontal",W5);const Y5=[["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"}]],U5=St("fold-vertical",Y5);const G5=[["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"}]],X5=St("highlighter",G5);const V5=[["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"}]],K5=St("ruler",V5);const Z5=[["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"}]],Q5=St("unfold-horizontal",Z5);const J5=[["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"}]],t3=St("unfold-vertical",J5),sC=24,e3=1,r3=1,i3=24,o3=Object.freeze({}),Fa=e=>{const{rows:t,cols:r}=kn.measureTsv(e);return t*r},s3=26,n3=(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((a,l)=>({index:l,cells:a})),n=e.slice(e.length-o).map((a,l)=>({index:e.length-o+l,cells:a}));return[...s,...n]},a3=(e,t)=>Math.max(1,Math.min(e.visibleRows,t)),l3=3,h3=e=>Math.max(1,Math.min(l3,e)),Aa=(e,t,r)=>((r?se.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX:0)+e*sC+se.SPREADSHEET_SCROLLBAR_SIZE_PX)*t,c3=1,du=e=>Math.ceil(e)+c3,d3=(e,t)=>e>=t,bn=e=>Math.round(e*100),uu=e=>{const t=se.SPREADSHEET_ZOOM_STEPS.find(r=>bn(r)===e);if(t===void 0)throw new RangeError(`[@aiquants/markdown] no spreadsheet zoom step shows as ${String(e)} %`);return t},u3=(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},hc=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 n=0;n<t;n+=1)if(e[n][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))},Ss=e=>hc(kn.parseTsv(e)),f3=["format","hyperlink","note","comments","validation"],g3=(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(f3.some(l=>s[l]!==void 0&&s[l]!==null)&&(i=!0),s.text===void 0)continue;o=!0;const n=s.text.replace(/\r\n?/gu,`
312
+ `),a=r.get(s.row);if(a!==void 0)a[s.col]=n;else if(e[s.row][s.col]!==n){const l=[...e[s.row]];l[s.col]=n,r.set(s.row,l)}}if(r.size>0){const s=[...e];for(const[n,a]of r)s[n]=a;return{kind:"applied",matrix:s}}return i&&!o?{kind:"format-only"}:{kind:"unchanged"}},p3=e=>{const t=hc(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 kn.serializeTsv(t).replaceAll(`\r
313
+ `,`
314
+ `)},m3=(e,t)=>{const r=e.indexOf(t);return r===-1?{echo:!1,pending:[]}:{echo:!0,pending:e.slice(r+1)}},y3=(e,t,r,i,o)=>{const s=o==="down"?1:o==="up"?-1:0,n=o==="right"?1:o==="left"?-1:0,a=(d,f)=>d>=0&&d<t&&f>=0&&f<r,l=(d,f)=>e(d,f)!=="";let c=i.row+s,h=i.col+n;if(!a(c,h))return{row:i.row,col:i.col};if(l(i.row,i.col)&&l(c,h)){for(;a(c+s,h+n)&&l(c+s,h+n);)c+=s,h+=n;return{row:c,col:h}}for(;a(c,h);){if(l(c,h))return{row:c,col:h};c+=s,h+=n}return{row:c-s,col:h-n}},x3=/^(?:https?:\/\/|mailto:|tel:)\S+$/iu,C3=e=>x3.test(e)?e:void 0,b3=(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}`},k3=Object.freeze(["decreaseColumnWidth","increaseColumnWidth","autoFitColumnWidth","decreaseRowHeight","increaseRowHeight"]),w3=()=>{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)})}},yi="data-aqmd-spreadsheet-control",S3=Object.freeze(["zoom-in","zoom-out","reset-zoom","highlight","track-size","copy","save","save-menu",pr]),T3=({labels:e,labelledBy:t,rows:r,cols:i,canZoomIn:o,canZoomOut:s,zoom:n,onZoom:a,onResetZoom:l,highlighted:c,onToggleHighlight:h,onCopy:d,onSave:f,fullscreen:u,onToggleFullscreen:g,gridReady:m,activeCell:y,onTrackSize:x})=>{const{onKeyDown:C,onFocus:w,tabIndexOf:S}=nc(S3,yi),[T,B]=v.useState(!1),E=v.useId(),_=v.useRef(null),D=T&&m,O=(j,N,$,F,q,A,I=Fr)=>k.jsx("button",{type:"button",[yi]:j,tabIndex:S(j),onClick:q?$:void 0,"aria-disabled":q?void 0:"true","aria-pressed":A,className:I,"aria-label":N.text,lang:N.lang,children:F}),R=bn(n),W={text:At.fillLabel(e.resetZoom.text,{percent:R}),lang:e.resetZoom.lang};return k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-aqmd-spreadsheet-toolbar":"",role:"toolbar","aria-labelledby":t,onKeyDown:C,onFocus:w,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[k.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})}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[O("zoom-in",e.zoomIn,()=>a(1),k.jsx(ju,{size:20}),m&&o),O("zoom-out",e.zoomOut,()=>a(-1),k.jsx(Wu,{size:20}),m&&s),O("reset-zoom",W,l,k.jsxs("span",{"data-aqmd-spreadsheet-zoom":"",children:[k.jsxs("span",{"data-aqmd-spreadsheet-zoom-widest":"","aria-hidden":"true",children:[bn(se.SPREADSHEET_ZOOM_MAX)," %"]}),k.jsxs("span",{children:[R," %"]})]}),m&&n!==1,void 0,zM)]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[O("highlight",e.highlight,h,k.jsx(X5,{size:18}),m,c),k.jsx("button",{type:"button",ref:_,[yi]:"track-size",tabIndex:S("track-size"),onClick:m?()=>B(j=>!j):void 0,"aria-disabled":m?void 0:"true","aria-expanded":D,"aria-controls":D?E:void 0,className:Fr,"aria-label":e.trackSize.text,lang:e.trackSize.lang,children:k.jsx(K5,{size:18})})]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[O("copy",e.copyAll,d,k.jsx(lc,{size:18}),m),O("save",e.saveTsv,()=>f(!1),k.jsx(j5,{size:18}),!0),k.jsx(tC,{buttonHook:{[yi]:"save-menu"},menuHook:{"data-aqmd-spreadsheet-menu":""},label:e.saveMenu,icon:k.jsx(q5,{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"}}]})]}),k.jsx(sc,{hook:yi,fullscreen:u,labels:e,tabIndex:S(pr),onToggle:g})]}),D&&k.jsx(_3,{id:E,labels:e,activeCell:y,onTrackSize:x,onClose:()=>{B(!1),_.current?.focus()}})]})},v3=Object.freeze({decreaseColumnWidth:k.jsx(H5,{size:18}),increaseColumnWidth:k.jsx(Q5,{size:18}),autoFitColumnWidth:k.jsx(D5,{size:18}),decreaseRowHeight:k.jsx(U5,{size:18}),increaseRowHeight:k.jsx(t3,{size:18})}),_3=({id:e,labels:t,activeCell:r,onTrackSize:i,onClose:o})=>{const s=v.useSyncExternalStore(r.subscribe,r.get,r.get),n={column:se.columnIndexToName(s.col),row:s.row+1},a=l=>{l.key!=="Escape"||l.defaultPrevented||(l.preventDefault(),l.stopPropagation(),o())};return k.jsx("div",{id:e,"data-aqmd-spreadsheet-track-size":"",role:"group","aria-label":t.trackSize.text,lang:t.trackSize.lang,onKeyDown:a,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:k3.map(l=>k.jsx("button",{type:"button","data-aqmd-spreadsheet-track-size-control":l,onClick:()=>i(l),className:Fr,"aria-label":At.fillLabel(t[l].text,n),lang:t[l].lang,children:v3[l]},l))})},B3=(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(n=>({t:n}))),wholeRows:!1,wholeCols:!1,conditionalFormats:[]},o=t.serializeClipPayload(i);return{plain:t.serializeClipboardTsv(e),html:t.serializeHtmlTable(i,o)}},L3=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"})})])},E3="\uFEFF",F3="text/tab-separated-values;charset=utf-8",A3=(e,t)=>`${t?E3:""}${kn.serializeTsv(e)}`,M3=(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:F3})),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)}},nC=e=>{const t=v.useRef(e);v.useLayoutEffect(()=>{t.current=e});const r=e!==void 0,[i]=v.useState(()=>new Set);return v.useEffect(()=>e?.subscribe(()=>{for(const o of[...i])o()}),[e,i]),v.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 qs=null,Ma=null;const jl=new Set,O3=e=>(jl.add(e),()=>{jl.delete(e)}),fu=()=>qs!==null?Promise.resolve(qs):(Ma??=import("@aiquants/spreadsheet").then(e=>{qs=e;for(const t of jl)t();return e},e=>{throw Ma=null,e}),Ma);class di extends Error{reason;constructor(t){super(`[@aiquants/markdown] spreadsheet edit refused: ${t}`),this.name="SpreadsheetEditRefusal",this.reason=t}}const gu=e=>{console.error("[@aiquants/markdown] could not load @aiquants/spreadsheet",e)},pu=Object.freeze({row:!0,column:!0,intersection:!1}),mu=Object.freeze({row:!1,column:!1,intersection:!1}),yu=Object.freeze([Object.freeze([""])]),$3=Object.freeze({link:!1}),R3=Object.freeze({enabled:!1}),aC=e=>e.trim().replace(/\s+/g," ").toLowerCase(),I3=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(aC))},P3=e=>{const t=e.trim(),r=t.length>=2&&(t[0]==='"'||t[0]==="'")&&t[t.length-1]===t[0];return aC((r?t.slice(1,-1):t).replace(/\\(.)/g,"$1"))},D3=(e,t)=>{const r=I3(t);return e.fontfaces.some(i=>r.has(P3(i.family)))},N3=({matrix:e,headerRows:t,footerRows:r,visibleRows:i,headings:o,autofit:s,frame:n})=>{const a=Math.min(e[0].length,s3),l=n3(e,i,t,r),c=Array.from({length:a},(g,m)=>m),h=l[0].index>0,d=l[l.length-1].index<e.length-1,f=e[0].length>a,u=g=>o?k.jsx("td",{"aria-hidden":"true","data-aqmd-spreadsheet-static-number":"",children:g+1}):null;return k.jsxs("table",{"data-aqmd-spreadsheet-static":"","data-aqmd-spreadsheet-static-autofit":s?"":void 0,"data-aqmd-spreadsheet-static-frame":n?"":void 0,"data-aqmd-spreadsheet-static-headings":n&&o?"":void 0,"data-aqmd-spreadsheet-static-earlier-rows":n&&h?"":void 0,"data-aqmd-spreadsheet-static-more-rows":n&&d?"":void 0,"data-aqmd-spreadsheet-static-more-columns":n&&f?"":void 0,children:[s&&k.jsxs("colgroup",{children:[o&&k.jsx("col",{"data-aqmd-spreadsheet-static-band":""}),c.map(g=>k.jsx("col",{"data-aqmd-spreadsheet-static-empty":l.every(({cells:m})=>m[g]==="")?"":void 0},g))]}),k.jsxs("thead",{children:[o&&k.jsxs("tr",{"aria-hidden":"true","data-aqmd-spreadsheet-static-letters":"",children:[k.jsx("td",{}),c.map(g=>k.jsx("td",{children:se.columnIndexToName(g)},g))]}),l.filter(({index:g})=>g<t).map(({index:g,cells:m})=>k.jsxs("tr",{children:[u(g),m.slice(0,a).map((y,x)=>k.jsx("th",{scope:"col",children:y},x))]},g))]}),k.jsx("tbody",{children:l.filter(({index:g})=>g>=t).map(({index:g,cells:m})=>k.jsxs("tr",{children:[u(g),m.slice(0,a).map((y,x)=>k.jsx("td",{children:y},x))]},g))})]})},q3=e=>{try{return{options:At.parseSpreadsheetOptions(e),unreadWord:null}}catch(t){if(t instanceof At.SpreadsheetOptionsError)return{options:null,unreadWord:t.word};throw t}},lC=({tsv:e,meta:t,sourceLines:r,editor:i,locale:o="en",labels:s,layout:n="inline",tapScrollCircle:a,tapScrollCircleShownBy:l="host",scrollBarControls:c})=>{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(n!=="inline"&&n!=="fill")throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet layout "${String(n)}" (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 h=v.useMemo(()=>hr(At.SPREADSHEET_BLOCK_LABEL_CATALOGS[o],s),[o,s]),{options:d,unreadWord:f}=v.useMemo(()=>q3(t),[t]),u=v.useMemo(()=>Fa(e),[e]),g=u>se.SPREADSHEET_MAX_OPERATION_CELLS,m=v.useMemo(()=>Di.parseSourceLines(r)?.first??null,[r]),[y,x]=v.useState(null),C=`${r??""}
315
+ ${e}`,w=y===C,S=i!==void 0&&m!==null&&!w?i:void 0,T=S!==void 0,B=T&&d!==null&&d.footerRows===0?e3:0,E=T?r3:0,[_,D]=v.useState(()=>g?yu:Ss(e)),[O,R]=v.useState(0),W=v.useRef(e),j=v.useRef([]),N=v.useMemo(()=>u3(_,B,E),[_,B,E]),$=v.useRef(N);$.current=N;const F=v.useSyncExternalStore(O3,()=>qs,()=>null),[q,A]=v.useState(!1),I=q&&F===null,P=d===null?null:d.zoomPercent,[L,U]=v.useState(()=>P===null?1:uu(P)),[z,X]=v.useState(P);P!==z&&(X(P),P!==null&&U(uu(P)));const K=d!==null&&d.toolbar===0?mu:pu,[Q,G]=v.useState(K),[rt,Z]=v.useState(K);K!==rt&&(Z(K),G(K));const[tt,mt]=v.useState(null),{fullscreen:_t,toggle:Ct,dialogRef:It,dialogProps:xe,rootProps:he}=oc(yi,d!==null&&!g&&d.toolbar===1),Ht=v.useId(),Pt=v.useCallback((et,lt={})=>{mt(bt=>({text:At.fillLabel(h[et].text,lt),lang:h[et].lang,serial:(bt?.serial??0)+1}))},[h]);v.useEffect(()=>{if(F!==null||d===null||g)return;let et=!0;return fu().catch(lt=>{et&&(gu(lt),A(!0))}),()=>{et=!1}},[F,d,g]),v.useEffect(()=>{const et=m3(j.current,e);if(et.echo){j.current=et.pending;return}const lt=S===void 0||m===null?null:S.read(m),bt=lt!==null&&Fa(lt)<=se.SPREADSHEET_MAX_OPERATION_CELLS?lt:null;if(bt!==null&&bt===j.current.at(-1))return;j.current=[];const Ot=bt===null?e:bt;Ot!==W.current&&(W.current=Ot,D(bt===null&&g?yu:Ss(Ot)),R(we=>we+1))},[e,g,S,m]);const qt=v.useCallback(()=>{if(S===void 0||m===null)return;const et=S.read(m);et===null||et===W.current||Fa(et)>se.SPREADSHEET_MAX_OPERATION_CELLS||(j.current=[],W.current=et,D(Ss(et)),R(lt=>lt+1))},[S,m]);v.useEffect(()=>S?.subscribe(()=>{j.current.length>0&&qt()}),[S,qt]);const zt=v.useCallback(et=>{et(),qt()},[qt]),fe=v.useMemo(()=>S===void 0?void 0:()=>zt(()=>S.undo()),[S,zt]),Kt=v.useMemo(()=>S===void 0?void 0:()=>zt(()=>S.redo()),[S,zt]),Jt=v.useRef(()=>{});Jt.current=et=>{if(S===void 0||m===null)throw new di("readOnly");const lt=g3($.current,et);if(lt.kind==="format-only")throw new di("formatRefused");if(lt.kind==="unchanged")return;const bt=hc(lt.matrix),Ot=p3(bt),we=S.write({fenceLine:m,expected:W.current,text:Ot});switch(we){case"written":{const ge=S.read(m);if(ge===null)throw new TypeError("[@aiquants/markdown] SpreadsheetEditor.write answered written, but read finds no block on its fence line");W.current=ge,j.current=[...j.current,ge],D(ge===Ot?bt:Ss(ge)),R(He=>He+1),mt(null);return}case"changed":throw qt(),new di("editConflict");case"closesFence":throw new di("fenceRefused");case"unwritable":throw x(C),new di("unwritable");default:throw new TypeError(`[@aiquants/markdown] SpreadsheetEditor.write answered ${JSON.stringify(we)} (written, changed, closesFence or unwritable)`)}};const[Ee]=v.useState(()=>({get rowCount(){return $.current.length},get colCount(){return $.current[0].length},getCellText:(et,lt)=>$.current[et][lt],applyEdits:(et,lt)=>Jt.current(et),getCellFormat:()=>o3,getCellHyperlink:(et,lt)=>C3($.current[et][lt]),findDataEdge:(et,lt)=>y3((bt,Ot)=>$.current[bt][Ot],$.current.length,$.current[0].length,et,lt)})),Fe=v.useCallback(et=>{if(!(et instanceof di))throw et;Pt(et.reason)},[Pt]),Ft=v.useCallback(et=>Pt(w?"unwritable":"readOnly"),[Pt,w]),Tt=v.useCallback(et=>{It.current?.ownerDocument.defaultView?.open(et,"_blank","noopener,noreferrer")},[]),Ae=v.useCallback(({row:et,displayText:lt,columnName:bt,readOnly:Ot})=>At.fillLabel((Ot===!0?h.readOnlyCellAnnouncement:h.cellAnnouncement).text,{cell:`${bt}${et+1}`,value:lt===""?h.emptyCell.text:lt}),[h]),Mr=v.useCallback(({range:et})=>At.fillLabel(h.selectionAnnouncement.text,{range:b3(et,se.columnIndexToName)}),[h]),je=v.useCallback(({axis:et,index:lt,size:bt})=>et==="column"?At.fillLabel(h.columnResized.text,{column:se.columnIndexToName(lt),size:bt}):At.fillLabel(h.rowResized.text,{row:lt+1,size:bt}),[h]),We=v.useRef(null),[rr]=v.useState(w3),yr=v.useCallback(et=>rr.set(et.active),[rr]),si=v.useCallback(et=>{We.current?.executeCommand(et)},[]),Me=bn(L),ir=v.useRef(Me);v.useLayoutEffect(()=>{z!==null&&(ir.current=z)},[z]),v.useEffect(()=>{ir.current!==Me&&(ir.current=Me,Pt("zoomed",{percent:Me}))},[Pt,Me]);const Or=v.useCallback(et=>U(lt=>se.clampSpreadsheetZoom(se.stepSpreadsheetZoom(lt,et))),[]),ni=v.useCallback(()=>U(1),[]),xr=Q.row||Q.column,$r=v.useCallback(()=>G(et=>et.row||et.column?mu:pu),[]),J=v.useCallback(()=>{if(F===null)return;const et=It.current?.ownerDocument.defaultView;(async()=>{if(et==null)throw new Error("no window");const bt=B3(_,F,et.crypto.randomUUID());await L3(bt,et.navigator.clipboard,Ot=>new et.ClipboardItem(Ot))})().then(()=>Pt("copied"),bt=>{console.error("[@aiquants/markdown] could not copy the spreadsheet",bt),Pt("copyFailed")})},[Pt,_,F]),ut=v.useCallback(et=>{const lt=It.current?.ownerDocument;lt!==void 0&&M3(A3(_,et),h.fileName.text,lt)},[_,h]),xt=_.length,Dt=_[0].length,jt=d===null?0:d.frame,ai=v.useMemo(()=>jt===0?void 0:{startRow:0,startCol:0,endRow:xt-1,endCol:Dt-1},[jt,xt,Dt]),Rr=d===null?0:d.tapscroll,Cr=v.useMemo(()=>l==="host"?a:Rr===1?{...a,enabled:!0,size:i3}:R3,[a,l,Rr]),oo=d===null?0:a3(d,N.length),Ir=N.length,so=d!==null&&n==="inline"&&d3(d.visibleRows,Ir),[li,Jn]=v.useState(null),ta=v.useMemo(()=>{if(d===null)return;const et=d.headings===1,lt={"--aqmd-spreadsheet-zoom":String(L)};return n==="fill"?lt["--aqmd-spreadsheet-box-min-height"]=`${Aa(h3(Ir),L,et)}px`:so?lt["--aqmd-spreadsheet-box-height"]=`${du(li===null?Aa(Ir,L,et):li.height)}px`:lt["--aqmd-spreadsheet-box-height"]=`${Aa(oo,L,et)}px`,li!==null&&(lt["--aqmd-spreadsheet-box-width"]=`${du(li.width)}px`),d.frame>0&&(lt["--aqsp-frame-width"]=`${d.frame}px`),lt},[d,n,so,Ir,oo,L,li]),Mt=_t?h.fullscreenDialog:h.table,Lt=F?.Spreadsheet;return v.useLayoutEffect(()=>{const et=We.current,lt=It.current;if(d===null||d.autofit!==1||F===null||et===null||lt===null)return;const bt=Array.from({length:N[0].length},(ge,He)=>He);et.autoFitColumns(bt);const Ot=lt.ownerDocument.fonts;if(Ot===void 0)return;const we=ge=>{const He=We.current;He!==null&&D3(ge,getComputedStyle(lt).fontFamily)&&He.autoFitColumns(bt)};return Ot.addEventListener("loadingdone",we),()=>Ot.removeEventListener("loadingdone",we)},[d,F,N]),k.jsxs("div",{"data-aqmd-spreadsheet":"","data-aqmd-spreadsheet-layout":n,"data-source-lines":r,"data-aqmd-spreadsheet-editable":T?"":void 0,"data-aqmd-spreadsheet-whole":so?"":void 0,...he,children:[k.jsx("span",{id:Ht,hidden:!0,lang:Mt.lang,children:Mt.text}),k.jsxs("dialog",{...xe,"aria-labelledby":Ht,children:[d===null?k.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:h.optionsError.lang,children:At.fillLabel(h.optionsError.text,{word:f,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})}):g?k.jsx("div",{"data-aqmd-spreadsheet-error":"size",role:"alert",lang:h.tooLarge.lang,children:At.fillLabel(h.tooLarge.text,{cells:new Intl.NumberFormat(o).format(u),max:new Intl.NumberFormat(o).format(se.SPREADSHEET_MAX_OPERATION_CELLS)})}):k.jsxs(k.Fragment,{children:[d.toolbar===1&&k.jsx(T3,{labels:h,labelledBy:Ht,rows:xt,cols:Dt,canZoomIn:L<se.SPREADSHEET_ZOOM_MAX,canZoomOut:L>se.SPREADSHEET_ZOOM_MIN,zoom:L,onZoom:Or,onResetZoom:ni,highlighted:xr,onToggleHighlight:$r,onCopy:J,onSave:ut,fullscreen:_t,onToggleFullscreen:Ct,gridReady:Lt!==void 0,activeCell:rr,onTrackSize:si}),k.jsx("div",{"data-aqmd-spreadsheet-box":"",style:ta,children:Lt===void 0?k.jsx(N3,{matrix:_,headerRows:d.headerRows,footerRows:d.footerRows,visibleRows:oo,headings:d.headings===1,autofit:d.autofit===1,frame:d.frame>0}):k.jsx(Lt,{ref:We,adapter:Ee,dataVersion:O,defaultRowHeight:sC,frozenRows:d.headerRows,headerRows:d.headerRows,frozenTrailingRows:d.footerRows,frozenColumns:d.frozenColumns,enableFillHandle:T,readOnly:!T,labelledBy:Ht,enableResizeUI:!0,headings:d.headings===1,frame:ai,tapScrollCircleOptions:Cr,scrollBarControls:c,onContentSizeChange:Jn,zoom:L,onZoomChange:U,highlight:Q,onHighlightChange:G,popovers:$3,onHyperlinkOpen:Tt,onEditRejected:Fe,onReadOnlyRejected:Ft,onUndoRequest:fe,onRedoRequest:Kt,formatCellAnnouncement:Ae,formatSelectionAnnouncement:Mr,formatResizeAnnouncement:je,onSelectionChange:yr,locale:o})})]}),I&&k.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[k.jsx("span",{lang:h.loadFailed.lang,children:h.loadFailed.text}),k.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:h.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:()=>{A(!1),fu().catch(et=>{gu(et),A(!0)})},children:h.retry.text})]}),k.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",children:tt!==null&&k.jsx("span",{lang:tt.lang,children:tt.text},tt.serial)})]})]})};lC.displayName="SpreadsheetBlock";const cc=v.memo(lC),z3=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),j3=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 W3(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 n=s.indexOf(":");if(n<=0)continue;const a=s.slice(0,n).trim(),l=s.slice(n+1).trim();a===""||l===""||(o[a.startsWith("--")?a:a.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 H3={margin:"1rem 0"},hC={margin:"0",padding:"0.8rem 0"},Y3=({filename:e,code:t,labels:r})=>k.jsxs("div",{"data-aqmd-code-header":"",className:"flex min-h-11 items-end justify-end gap-2",children:[e&&k.jsx("div",{"data-aqmd-code-filename":"",className:"wrap-anywhere me-auto min-w-0 rounded-md px-2 py-0.5 text-sm",children:e}),k.jsx(oC,{text:t,labels:r})]}),U3=({code:e})=>k.jsx("pre",{style:hC,tabIndex:0,"data-aqmd-code-pending":"",children:k.jsx("code",{children:e})}),G3=({htmlPromise:e})=>{const t=v.use(e),r={replace:i=>{if(i instanceof vt.Element&&i.name==="pre"){const o=W3(i.attribs);return o.style={...typeof o.style=="object"?o.style:{},...hC},k.jsx("pre",{...o,children:vt.domToReact(i.children,r)})}},htmlparser2:{lowerCaseTags:!0}};return k.jsx(k.Fragment,{children:vt(t,r)})},X3=Object.freeze({__html:""}),V3=()=>k.jsx("pre",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:X3}),K3=()=>()=>{},Z3=()=>!1,Q3=()=>!0,J3=()=>v.useSyncExternalStore(K3,Z3,Q3)&&typeof document<"u",tO=/^(diff)?:?(\w+):?([\w.-]*)?/,eO=new Map([["svg","xml"]]),rO="text",iO=e=>{const t=eO.get(e),r=t===void 0?e:t;return Ia.isSpecialLang(r)||Object.hasOwn(Ia.bundledLanguages,r)?r:rO},oO=()=>({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,n,a="";if(o.startsWith("+")?(s="+",n="add",a="bg-green-200 dark:bg-green-400/90 text-green-700"):o.startsWith("-")&&(s="-",n="remove",a="bg-red-200 dark:bg-red-400/90 text-red-700"),s&&n){t.properties.dataAqmdDiff=n,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 ${a}`},children:[{type:"text",value:s==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),sO=(e,t,r)=>Ia.codeToHtml(e,{lang:iO(t),themes:z3,defaultColor:!1,colorReplacements:j3,transformers:r?[oO()]:[]}),nO=(e,t,r)=>{let i=null;return{html:()=>(i??=sO(e,t,r),i)}},aO=({highlight:e})=>{const t=J3(),[r]=v.useState(()=>t?e:null);return r===e?k.jsx(V3,{}):k.jsx(G3,{htmlPromise:e.html()})},lO=e=>{const t=tO.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},dc=({lang:e,code:t,node:r,sourceLines:i,labels:o})=>{const s=e??r?.lang??void 0,n=t??r?.value??"",{isDiff:a,lang:l,filename:c}=lO(s);return l===At.SPREADSHEETS_LANGUAGE?k.jsx(cc,{tsv:n,meta:r?.meta??void 0,sourceLines:i,tapScrollCircleShownBy:"options"}):l==="mermaid"?k.jsx(ac,{chartContent:n,sourceLines:i}):k.jsx(hO,{code:n,lang:l,isDiff:a,filename:c,sourceLines:i,labels:o})},hO=v.memo(function({code:t,lang:r,isDiff:i,filename:o,sourceLines:s,labels:n}){const a=v.useMemo(()=>nO(t,r,i),[t,r,i]),l=v.useMemo(()=>hr(wn,n),[n]);return k.jsxs("div",{style:H3,"data-aqmd-code-block":"","data-source-lines":s,children:[k.jsx(Y3,{filename:o,code:t,labels:l}),k.jsx(v.Suspense,{fallback:k.jsx(U3,{code:t}),children:k.jsx(aO,{highlight:a})})]})}),cO=e=>{const[t,r]=v.useState(!1);return v.useEffect(()=>{if(e===null)return;let i=0;const o=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>r(e.scrollWidth>e.clientWidth))};o();const s=new ResizeObserver(o);s.observe(e);const n=new MutationObserver(o);n.observe(e,{childList:!0,subtree:!0,characterData:!0});const a=e.ownerDocument.fonts;return a?.addEventListener("loadingdone",o),()=>{cancelAnimationFrame(i),s.disconnect(),n.disconnect(),a?.removeEventListener("loadingdone",o)}},[e]),t},cC=({source:e,placement:t,labels:r,children:i})=>{const[o,s]=v.useState(null),n=cO(o),a=t==="flow"?"span":"div";return k.jsxs(a,{"data-aqmd-math-display":t,children:[k.jsx(a,{ref:s,"data-aqmd-math-scroll":"",tabIndex:n?0:void 0,children:i}),k.jsx(a,{"data-aqmd-math-copy":"",children:k.jsx(oC,{text:e,labels:r})})]})},dC=(e,t)=>{const r=v.useMemo(()=>{try{return{kind:"rendered",innerHtml:iC(e,t).innerHtml}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return v.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},dO=({node:e})=>{const t=dC(e.value,!0),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return k.jsx(cC,{source:e.value,placement:"block",labels:tb,children:t.kind==="rendered"?k.jsx("article",{className:r,dangerouslySetInnerHTML:t.innerHtml}):k.jsx("article",{className:r,children:t.message})})},uO=/^[a-z][a-z0-9+.-]*:/i,fO=/^[/\\]{2}/,gO=/[\t\n\r]/g,xu=32,pO=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=xu;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=xu;)r-=1;return e.slice(t,r)},uC=e=>{const t=pO(e).replace(gO,"");return uO.test(t)||fO.test(t)},mO="text-link underline visited:text-link-visited",yO="inline-block w-fit",uc=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"]);[...uc].join(",");const fC=(e,t)=>[e,t?yO:void 0,mO].filter(r=>r!==void 0&&r.trim()!=="").join(" "),xO=new Set(["id","title","lang","dir","role"]),CO=["aria-","data-footnote-"],bO=e=>{const t={};for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();(xO.has(o)||CO.some(s=>o.startsWith(s)&&o.length>s.length))&&(t[o]=i)}return Object.freeze(t)},Te=new Ra.Logger(Ra.LogLevel.INFO,"[DifyIFramePlugin]"),kO="100%",wO="600px",SO="0",TO=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,vO=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=v.useState(!0),[o,s]=v.useState(!1),n=v.useRef(null),a=v.useRef(null),l=v.useRef(null),{src:c}=e,h=v.useCallback(x=>{x.source===null||x.source!==n.current?.contentWindow||!i1(x.origin,t)||TO(x.data)==="dify-chatbot-iframe-ready"&&(Te.info("Dify chatbot iframe is ready"),i(C=>C&&(s(!1),a.current&&(clearTimeout(a.current),a.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=v.useCallback(()=>{const x=n.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(w=>w&&(s(!1),!1))}catch{Te.info("Crossorigin error detected, showing auth prompt"),s(w=>w||(i(!1),!0))}},[]),f=v.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 w=n.current;if(w?.src){const S=w.src;i(T=>T||!0),s(T=>T&&!1),w.src="",setTimeout(()=>{w.src=S,a.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]);v.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),v.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]),v.useEffect(()=>()=>{a.current&&(clearTimeout(a.current),a.current=null)},[]);const{width:u=kO,height:g=wO,frameborder:m=SO,...y}=e.attributes;return k.jsxs("div",{className:"dify-iframe-container",children:[r&&!o&&k.jsxs("div",{className:"flex items-center justify-center rounded-lg bg-gray-50 p-8",children:[k.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-blue-600 border-b-2"}),k.jsx("span",{className:"ml-3 text-gray-600",children:"Dify チャットボットを読み込み中..."})]}),o&&k.jsxs("div",{className:"mb-4 rounded-lg border border-blue-200 bg-blue-50 p-6",children:[k.jsx("div",{className:"flex items-center",children:k.jsxs("div",{className:"text-blue-800",children:[k.jsx("h3",{className:"font-medium",children:"認証が必要です"}),k.jsx("p",{className:"mt-1 text-sm",children:"Dify チャットボットにアクセスするには OAuth 認証が必要です。 ポップアップウィンドウで認証を完了してください。"})]})}),k.jsx("div",{className:"mt-4",children:k.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 認証を開始"})})]}),k.jsx("div",{className:`${r||o?"hidden":"block"}`,children:k.jsx("iframe",{ref:n,...vt.attributesToProps({...y,width:u,height:g,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},Cu=Object.freeze({dify:vO}),_O=e=>Object.hasOwn(Cu,e)?Cu[e]:null,BO=k.jsx(v.Fragment,{}),LO=(e,t,r,i,o)=>{const s=t===null?null:_O(t),n=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return k.jsx(zb,{embed:e,label:i,insideAnchor:o,children:s!==null?k.jsx(s,{embed:e,iFrameAllowedDomains:r}):k.jsx("iframe",{...vt.attributesToProps(e.attributes,"iframe"),...n,src:e.src})})},gC=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof vt.Element&&t.name.toLowerCase()==="a")return!0;return!1},pC=e=>e.some(t=>t instanceof vt.Element&&(uc.has(t.name)||pC(t.children))),EO=(e,t,r)=>{const{class:i,"data-link-kind":o,"data-doc-path":s,"data-doc-exists":n,...a}=e.attribs,l=fC(i,pC(e.children)),c=a.href??"",h=o,d=h==="external"||uC(c),f=vt.domToReact(e.children,t);if(r&&c&&!d)return k.jsx(r,{href:c,kind:h,docPath:s,docExists:n===void 0?void 0:n==="true",className:l,attributes:bO(a),children:f});d&&(a.target="_blank",a.rel="noreferrer");const u={};return o!==void 0&&(u["data-link-kind"]=o),s!==void 0&&(u["data-doc-path"]=s),n!==void 0&&(u["data-doc-exists"]=n),k.jsx("a",{...vt.attributesToProps(a,"a"),className:l,...u,children:f})},mC=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:o})=>{const s={replace:n=>{if(!(n instanceof vt.Element))return;const a=n.parent instanceof vt.Element?n.parent.name:null,l=Tn(n.name,n.attribs,{parentName:a,iFrameAllowedDomains:e});switch(l.action){case"remove":return BO;case"unwrap":return k.jsx(v.Fragment,{children:vt.domToReact(n.children,s)});case"embed":return LO(l.embed,l.pluginType,e,t.embeddedFrame,gC(n))}if(n.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(n,l.link,s);if(h!==void 0)return h}const c=o?.(n,s);if(c!==void 0)return c;if(n.name==="a")return EO(n,s,r)}};return s};const FO=[["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"}]],AO=St("code-xml",FO),MO=4096*4096,bu=32767,OO=Object.freeze({width:0,height:0}),$O=/^\s*(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[a-zA-Z]*\s*$/u,RO=(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&&$O.test(i))},ku=e=>Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0,IO=(e,t)=>{const r=ku(e)?e:ku(t)?t:null;if(r===null)return null;const i=Math.min(1,Math.sqrt(MO/(r.width*r.height)),bu/r.width,bu/r.height);return{width:Math.max(1,Math.floor(r.width*i)),height:Math.max(1,Math.floor(r.height*i))}},PO=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=IO(RO(e,r)?{width:o.naturalWidth,height:o.naturalHeight}:OO,t);if(s===null)throw new Error("[@aiquants/markdown] the SVG image has no size to draw at");const n=r.document.createElement("canvas");n.width=s.width,n.height=s.height;const a=n.getContext("2d");if(a===null)throw new Error("[@aiquants/markdown] the browser gave no 2D canvas to draw the SVG image on");return a.drawImage(o,0,0,s.width,s.height),await new Promise((l,c)=>{n.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)}},DO=e=>/\.[Ss][Vv][Gg]$/u.test(e),yC=e=>{const t=v.useRef(e);v.useLayoutEffect(()=>{t.current=e});const r=e!==void 0;return v.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])},Co="data-aqmd-svg-image-control",NO=Object.freeze(["copy","source",pr]),qO=Object.freeze(["source",pr]),zO=Object.freeze({kind:"failure",retryable:!0}),wu=(e,t,r)=>Do(()=>e.read(t,r)),jO=({paragraph:e,image:t,path:r,name:i,reader:o,labels:s})=>{const{[Di.SOURCE_LINES_ATTRIBUTE]:n,...a}=e,[l,c]=v.useState(!1),[h,d]=v.useState(0),[f,u]=v.useState(null),[g,m]=v.useState(null),y=v.useId(),x=v.useId(),C=v.useId(),w=v.useRef(null),S=v.useRef(null),T=v.useRef(null);v.useEffect(()=>()=>S.current?.abort(),[]),v.useEffect(()=>{if(!l)return;const z=new AbortController;return wu(o,r,z.signal).then(X=>{z.signal.aborted||u({read:h,answer:X})},X=>{z.signal.aborted||(console.error("[@aiquants/markdown] the image source reader failed without an abort",X),u({read:h,answer:zO}))}),()=>z.abort()},[l,h,r,o]);const B=l&&f!==null&&f.read===h?f.answer:null,E=B!==null&&B.kind==="text"&&!B.truncated?B.text:null,_=!l||E!==null,{onKeyDown:D,onFocus:O,tabIndexOf:R}=nc(_?NO:qO,Co),{fullscreen:W,toggle:j,dialogProps:N,rootProps:$}=oc(Co,!0),F=z=>{m(X=>({text:s[z].text,lang:s[z].lang,serial:X===null?1:X.serial+1}))},q=()=>{S.current?.abort();const z=new AbortController;return S.current=z,z},A=()=>{if(m(null),l){c(!1);return}d(z=>z+1),c(!0)},I=()=>{w.current?.focus(),d(z=>z+1)},P=(z,X)=>{const K=q(),Q=z.currentTarget.ownerDocument.defaultView?.navigator.clipboard;if(Q===void 0){F("copyFailed");return}Do(()=>Q.writeText(X)).then(()=>{K.signal.aborted||F("copied")},G=>{console.error("[@aiquants/markdown] could not copy the image source",G),K.signal.aborted||F("copyFailed")})},L=z=>{const X=q(),K=z.currentTarget.ownerDocument.defaultView,Q=K?.navigator.clipboard;if(K===null||Q===void 0||typeof K.ClipboardItem!="function"||typeof Q.write!="function"){F("copyImageFailed");return}const G=T.current,rt=G===null?null:G.querySelector("img"),Z=rt===null?null:rt.getBoundingClientRect(),tt=Z===null?{width:0,height:0}:{width:Z.width,height:Z.height};let mt=!1;const _t=wu(o,r,X.signal).then(Ct=>{if(Ct.kind!=="text"||Ct.truncated)throw mt=!0,new Error("[@aiquants/markdown] the SVG image cannot be copied whole");return PO(Ct.text,tt,K).catch(It=>{throw mt=!0,console.error("[@aiquants/markdown] could not draw the SVG image as a PNG",It),It})},Ct=>{throw mt=!0,X.signal.aborted||console.error("[@aiquants/markdown] the image source reader failed without an abort",Ct),Ct});_t.catch(()=>{}),Do(()=>Q.write([new K.ClipboardItem({"image/png":_t})])).then(()=>{X.signal.aborted||F("copiedImage")},Ct=>{X.signal.aborted||(mt||console.error("[@aiquants/markdown] could not copy the SVG image",Ct),F("copyImageFailed"))})};let U;return l?B===null?U=k.jsx("p",{"data-aqmd-svg-image-loading":"",lang:s.loading.lang,children:s.loading.text}):B.kind==="failure"?U=k.jsxs("div",{"data-aqmd-svg-image-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[k.jsx("p",{lang:s.failed.lang,children:s.failed.text}),B.retryable&&k.jsxs("button",{type:"button","data-aqmd-svg-image-retry":"",onClick:I,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:[k.jsx(Da,{className:"h-4 w-4"}),s.retry.text]})]}):U=k.jsxs(k.Fragment,{children:[k.jsx("span",{id:C,hidden:!0,lang:s.sourceRegion.lang,children:At.fillLabel(s.sourceRegion.text,{name:i})}),k.jsx("pre",{"data-aqmd-svg-image-source":"",tabIndex:0,role:"region","aria-labelledby":C,children:k.jsx("code",{children:B.text})}),B.truncated&&k.jsx("p",{"data-aqmd-svg-image-truncated":"",lang:s.truncated.lang,children:s.truncated.text})]}):U=k.jsx("p",{ref:T,...vt.attributesToProps(a,"p"),"data-aqmd-svg-image-frame":"",children:t}),k.jsxs("div",{"data-aqmd-svg-image":"","data-aqmd-svg-image-view":l?"source":"image","data-source-lines":n,...$,children:[k.jsx("span",{id:y,hidden:!0,lang:s.toolbar.lang,children:s.toolbar.text}),k.jsx("span",{id:x,hidden:!0,lang:s.fullscreenDialog.lang,children:At.fillLabel(s.fullscreenDialog.text,{name:i})}),k.jsxs("dialog",{...N,"aria-labelledby":W?x:y,children:[k.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:[_&&k.jsx("button",{type:"button",[Co]:"copy",tabIndex:R("copy"),onClick:z=>E===null?L(z):P(z,E),className:Fr,"aria-label":E===null?s.copyImage.text:s.copy.text,lang:E===null?s.copyImage.lang:s.copy.lang,children:k.jsx(lc,{size:18})}),k.jsx("button",{ref:w,type:"button",[Co]:"source",tabIndex:R("source"),"aria-pressed":l,onClick:A,className:Fr,"aria-label":s.source.text,lang:s.source.lang,children:k.jsx(AO,{size:20})}),k.jsx(sc,{hook:Co,fullscreen:W,labels:s,tabIndex:R(pr),onToggle:j})]}),U,k.jsx("p",{"data-aqmd-svg-image-notice":"",role:"status",children:g!==null&&k.jsx("span",{lang:g.lang,children:g.text},g.serial)})]})]})},Qn=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"}}),WO=Vi(Qn),HO=({alt:e,target:t,label:r})=>k.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:[k.jsx(_b,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),k.jsxs("span",{className:"min-w-0",children:[k.jsx("span",{className:"font-medium",children:e?`${r} (${e})`:r}),t&&k.jsx("span",{className:"ml-2 break-all font-mono text-xs dark:text-gray-300",children:t})]})]}),YO=(e,t,r)=>{const{src:i,alt:o,"data-asset-exists":s,"data-asset-src":n}=e.attribs;if(!i||i.trim()===""||s==="false")return k.jsx(HO,{alt:o,target:n,label:t});const a=r.rendered===0;return r.rendered+=1,k.jsx("img",{alt:"",...vt.attributesToProps({loading:a?"eager":"lazy",decoding:"async",...e.attribs})})},Zo=e=>e.map(t=>t instanceof vt.Text?t.data:t instanceof vt.Element?Zo(t.children):"").join(""),UO=(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=Tn(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),GO=(e,t,r,i)=>{const o=e.children,s=Sr.placeholderLinkOf(t,UO(o,i.iFrameAllowedDomains));if(s===null)return;const n=vt.domToReact(o,r),a=k.jsx("p",{...vt.attributesToProps(e.attribs,"p"),children:n}),l=o.find(f=>f instanceof vt.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&Sr.isBareLink(Zo(l.children),s)?k.jsx(Ub,{href:t,endpoint:c,size:Xe.linkCardSizeOf(i.embeds),fallback:a}):a,d=Kr.resolveEmbed(s,i.embeds.providers);return d===null?h:k.jsx(e1,{resolution:d,caption:n,fallback:h,theme:i.theme,labels:i.embedLabels})},XO=(e,t)=>{if(gC(e))return null;const r=e.children.filter(c=>!(c instanceof vt.Text&&Wl.test(c.data))),[i]=r;if(r.length!==1||!(i instanceof vt.Element)||i.name.toLowerCase()!=="img")return null;const o=Tn(i.name,i.attribs,{parentName:"p",iFrameAllowedDomains:t});if(o.action!=="keep")return null;const{src:s,alt:n,"data-asset-src":a,"data-asset-exists":l}=o.attributes;return a===void 0||!DO(a)||s===void 0||s.trim()===""||l==="false"?null:{node:i,path:a,name:n!==void 0&&n.trim()!==""?n:a.slice(a.lastIndexOf("/")+1)}},VO={lowerCaseAttributeNames:!1},Su=2166136261,Tu=16777619,Wl=/^[\t\n\f\r ]*$/u,KO=`language-${At.SPREADSHEETS_LANGUAGE}`,xC=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(KO),ZO=e=>{let t=Su,r=Su;const i=(s,n)=>{for(let a=0;a<s.length;a+=1){const l=s.charCodeAt(a);r=Math.imul(r^l,Tu),n&&(t=Math.imul(t^l,Tu))}},o=(s,n)=>{if(s instanceof vt.Text)i("",n),i(s.data,n);else if(s instanceof vt.Element){i("",n),i(s.name,n);for(const[l,c]of Object.entries(s.attribs))l!==Di.SOURCE_LINES_ATTRIBUTE&&(i("",n),i(l,n),i("",n),i(c,n));i("",n);const a=n&&!xC(s);for(const l of s.children)o(l,a);i("",n)}else i("\x07",n),i(s.data,n)};return o(e,!0),{fingerprint:(t>>>0).toString(36),content:(r>>>0).toString(36)}},QO=(e,t,r,i)=>{if(e==="")return{nodes:[],keys:[]};const o=vt.htmlToDOM(e,VO),s=o.filter(l=>!(l instanceof vt.Text&&Wl.test(l.data))),n=Ab(s.map(ZO),r);let a=0;return{nodes:o.map(l=>{if(l instanceof vt.Text&&Wl.test(l.data))return l.data;const{key:c,content:h}=n[a];return a+=1,k.jsx(Bb,{content:h,label:i,text:()=>Zo([l]),children:vt.domToReact([l],t)},c)}),keys:n}},CC=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=Xe.NO_EMBEDS,embedLabels:o,mermaidInteraction:s,mermaidLabels:n,codeBlockLabels:a,displayMathLabels:l,spreadsheetEditor:c,spreadsheetLocale:h,spreadsheetLabels:d,spreadsheetTapScrollCircle:f,spreadsheetScrollBarControls:u,linkComponent:g,missingImageLabel:m="Image not found",blockFailedLabel:y,imageSource:x,svgImageLabels:C,onMathDiagnostics:w})=>{Du(i);const S=Au(o),T=nC(c),B=yC(x),E=v.useMemo(()=>hr(Qn,C),[C]),_=v.useMemo(()=>hr(Qo,l),[l]),{blockFailed:D}=hr(Iu,{blockFailed:y}),O={rendered:0},R=[],W=v.useRef(null),j=v.useEffectEvent(A=>{w?.(A)}),N=mC({iFrameAllowedDomains:r,embedLabels:S,linkComponent:g,renderPlaceholder:(A,I,P)=>GO(A,I,P,{embeds:i,theme:t,embedLabels:S,iFrameAllowedDomains:r}),renderKept:(A,I)=>{if(A.name==="p"&&B!==void 0){const P=XO(A,r);if(P!==null)return k.jsx(jO,{paragraph:A.attribs,image:vt.domToReact([P.node],I),path:P.path,name:P.name,reader:B,labels:E})}if(A.name==="pre"&&A.children.length===1){const P=A.children[0];if(P instanceof vt.Element&&P.name==="code"){const L=P.attribs.class??"",U=Zo(P.children),z=A.attribs[Di.SOURCE_LINES_ATTRIBUTE];return xC(P)?k.jsx(cc,{tsv:U,meta:P.attribs[At.CODE_META_ATTRIBUTE],sourceLines:z,editor:T,locale:h,labels:d,tapScrollCircle:f,tapScrollCircleShownBy:"options",scrollBarControls:u}):L.includes("language-mermaid")?k.jsx(ac,{chartContent:U,interaction:s,labels:n,sourceLines:z}):k.jsx(dc,{lang:L.replace("language-",""),code:U,theme:t,sourceLines:z,labels:a})}}if(A.name==="img")return YO(A,m,O);if(A.name==="span"&&A.attribs.class?.includes("math")){const P=A.attribs.class.includes("display");let L=Zo(A.children).trim();P?L=L.replace(/^\\\[/,"").replace(/\\\]$/,""):L=L.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{innerHtml:U,diagnostics:z}=iC(L,P);return R.push(...z),P?k.jsx(cC,{source:L,placement:"flow",labels:_,children:k.jsx("span",{dangerouslySetInnerHTML:U})}):k.jsx("span",{dangerouslySetInnerHTML:U})}catch(U){console.error("Failed to render math:",U);return}}}}),$=v.useRef([]),{nodes:F,keys:q}=QO(e,N,$.current,D);return v.useEffect(()=>{$.current=q},[q]),v.useEffect(()=>{W.current!==e&&(W.current=e,R.length>0&&j(R))},[e,R]),k.jsx("div",{className:"markdown-body","data-theme":t,children:F})};const JO=[["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"}]],t$=St("triangle-alert",JO);const e$=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],r$=St("text-align-center",e$);const i$=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],o$=St("text-align-start",i$);const s$=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],n$=St("text-align-end",s$);const a$=[["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"}]],l$=St("list",a$);const h$=[["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"}]],c$=St("palette",h$);const d$=[["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"}]],u$=St("pin",d$);const f$=[["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"}]],g$=St("pin-off",f$),p$=e=>`#${e.id}`,m$=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},vu="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",bC=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=p$,label:o,labelledBy:s})=>{if(e.length===0)return null;const n=m$(e);return k.jsx("nav",{className:`toc ${t}`,"aria-label":o,"aria-labelledby":s,children:k.jsx("ul",{className:"m-0 list-none p-0",children:e.map((a,l)=>{const c=a.id===""?null:i(a);return k.jsx("li",{style:{paddingLeft:`${(a.depth-n)*1}rem`},children:c===null?k.jsx("span",{className:`${vu} text-gray-600 dark:text-gray-300`,title:a.text,children:a.text}):k.jsx("a",{href:Jo(c)?c:void 0,className:`${vu} 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(a,h),title:a.text,children:a.text})},l)})})})},Oa="--aqmd-toolbar-block-overlap",y$="--aqmd-toolbar-block-reach-px",x$=1/16,C$=2,b$=(e,t,r)=>{const i=C$*x$/Math.min(1,r);return t>0&&e-t<i&&t-e<1+i?t:cb(e)},k$=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i,scale:o,reach:s})=>{if(e.width<=0||e.height<=0)return 0;const n=e.left<t.right&&e.right>t.left,a=e.top<r+e.height&&e.top<i,l=e.bottom-r;return n&&a&&l>0?b$(l/o,s,o):0},io=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ts=(e,t)=>Object.fromEntries(Object.keys(t).map(r=>[io(e,r),t[r]])),w$=Object.keys(Zn),S$=Object.keys(At.SPREADSHEET_BLOCK_LABEL_CATALOGS.en),T$=Object.keys(Qn),v$=Object.keys(wn),_$=Object.keys(Qo),kC=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"},...Iu,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"},...Ts("mermaid",Zn),...Ts("svgImage",Qn),...Ts("codeBlock",wn),...Ts("displayMath",Qo),...Sn}),B$=Vi(kC),L$=e=>hr(kC,e),ns=(e,t,r)=>{const i={};if(e===void 0)return Object.freeze(i);for(const o of t){const s=e[r(o)];s!==void 0&&(i[o]=s)}return Object.freeze(i)},E$=e=>ns(e,w$,t=>io("mermaid",t)),F$=e=>ns(e,S$,t=>io("spreadsheet",t)),A$=e=>ns(e,T$,t=>io("svgImage",t)),M$=e=>ns(e,v$,t=>io("codeBlock",t)),O$=e=>ns(e,_$,t=>io("displayMath",t)),$$=Object.keys(Sn),R$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of $$){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},I$="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",P$="h-5 w-5 text-gray-600 dark:text-gray-300",_u=Object.freeze({left:{labelKey:"alignLeft",Icon:o$},center:{labelKey:"alignCenter",Icon:r$},right:{labelKey:"alignRight",Icon:n$}}),D$=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),N$="100%",q$=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",Hl="24px",wC=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"}),z$=wC(Hl),j$=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"}),W$=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,H$=8,Bu=800,Y$=16,U$=(e,t)=>{const r=e.defaultView;let i;const o=()=>{e.removeEventListener("click",s,!0),e.removeEventListener("pointercancel",n,!0),i!==void 0&&r?.clearTimeout(i)};function s(a){o(),!(a.timeStamp-t.timeStamp>Bu||Math.hypot(a.clientX-t.clientX,a.clientY-t.clientY)>Y$)&&(a.preventDefault(),a.stopPropagation())}function n(a){a.pointerId===t.pointerId&&o()}e.addEventListener("click",s,!0),e.addEventListener("pointercancel",n,!0),i=r?.setTimeout(o,Bu)},G$=(e,t,r)=>{const[i,o]=v.useState(null);return v.useLayoutEffect(()=>{const s=t.current;if(!e||s===null||r===null){o(null);return}const n=s.ownerDocument.defaultView;let a=0;const l=()=>{a=0;const d=s.getBoundingClientRect(),f=s.offsetHeight>0?d.height/s.offsetHeight:1,u=n?.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-H$)))},c=()=>{n!==null&&a===0&&(a=n.requestAnimationFrame(l))};l();const h=new ResizeObserver(c);return h.observe(r),n?.addEventListener("resize",c),n?.visualViewport?.addEventListener("resize",c),n?.visualViewport?.addEventListener("scroll",c),s.ownerDocument.addEventListener("scroll",c,!0),()=>{n!==null&&a!==0&&n.cancelAnimationFrame(a),h.disconnect(),n?.removeEventListener("resize",c),n?.visualViewport?.removeEventListener("resize",c),n?.visualViewport?.removeEventListener("scroll",c),s.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function $a({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:o,pinLabel:s,unpinLabel:n,isOpen:a,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:f,onPinToggle:u,popoverClassName:g,scrollBarClearance:m,boundary:y,renderBody:x}){const C=v.useRef(null),w=v.useRef(null),S=v.useRef(null),T=G$(a,S,y),B=v.useCallback(()=>{d(),h()},[h,d]),E=v.useCallback(()=>{if(l)return;const D=C.current?.contains(document.activeElement)===!0;f(),D&&w.current?.focus()},[l,f]);v.useEffect(()=>{if(!a||l)return;const D=C.current;if(D===null)return;const O=W=>{D.contains(W.target)||(f(),W.pointerType==="touch"&&!(W.target instanceof Element&&W.target.closest("[data-aqmd-toolbar]")!==null)&&U$(D.ownerDocument,W))},R=W=>{W.key!=="Escape"||W.defaultPrevented||W.isComposing||(W.preventDefault(),f(),w.current?.focus())};return document.addEventListener("pointerdown",O),D.addEventListener("keydown",R),()=>{document.removeEventListener("pointerdown",O),D.removeEventListener("keydown",R)}},[a,l,f]);const _=l?n:s;return k.jsxs("div",{ref:C,"data-aqmd-toolbar-menu":e,children:[k.jsx("button",{ref:w,type:"button","data-aqmd-toolbar-button":!0,className:I$,onClick:B,"aria-label":r.text,lang:r.lang,"aria-expanded":a,children:k.jsx(t,{className:P$})}),a&&k.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:W$(m),maxBlockSize:T??void 0},children:[k.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[k.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}),k.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?k.jsx(u$,{className:"h-4 w-4"}):k.jsx(g$,{className:"h-4 w-4"})})]}),x(E)]})]})}const X$=(e,t,r,i)=>{const[o,s]=v.useState(null),n=v.useRef(null);return v.useLayoutEffect(()=>{const a=e.current,l=t.current;if(r===null||a===null||l===null){n.current=null,s(null);return}const c=()=>{const g=a.getBoundingClientRect();if(g.width===0&&g.height===0)return;const m=r.getBoundingClientRect(),y=Eo(getComputedStyle(r).height);if(y<=0||m.height<=0){s(0);return}const x=m.height/y,C=Eo(getComputedStyle(a).getPropertyValue(y$));s(k$({toolbar:m,content:l.getBoundingClientRect(),scrollportTop:g.top+a.clientTop*x,scrollportBottom:g.bottom,scale:x,reach:C}))};n.current=c;let h=null;const d=()=>{h===null&&(h=requestAnimationFrame(()=>{h=null,c()}))};c();const f=new ResizeObserver(c);f.observe(a),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}),()=>{n.current=null,f.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("scroll",d,{capture:!0}),h!==null&&cancelAnimationFrame(h)}},[e,t,r]),v.useLayoutEffect(()=>{n.current?.()},[i]),o},V$=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,K$=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},Z$=v.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:o,embeds:s,embedLabels:n,linkComponent:a,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,codeBlockLabels:d,displayMathLabels:f,spreadsheetEditor:u,spreadsheetLocale:g,spreadsheetLabels:m,spreadsheetTapScrollCircle:y,spreadsheetScrollBarControls:x,imageSource:C,svgImageLabels:w,onMathDiagnostics:S}){return k.jsx("div",{className:"w-full min-w-0",children:k.jsx("div",{className:i,"data-theme":r,children:k.jsx(CC,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:o,embeds:s,embedLabels:n,linkComponent:a,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,codeBlockLabels:d,displayMathLabels:f,spreadsheetEditor:u,spreadsheetLocale:g,spreadsheetLabels:m,spreadsheetTapScrollCircle:y,spreadsheetScrollBarControls:x,imageSource:C,svgImageLabels:w,onMathDiagnostics:S})})})});function SC(){const[e,t]=v.useState("toc"),[r,i]=v.useState(!1),[o,s]=v.useState(!1),[n,a]=v.useState(!1),[l,c]=v.useState(!1),[h,d]=v.useState(!1),[f,u]=v.useState(!1),g=v.useCallback(()=>t("toc"),[]),m=v.useCallback(()=>i(O=>!O),[]),y=v.useCallback(()=>i(!1),[]),x=v.useCallback(()=>c(O=>!O),[]),C=v.useCallback(()=>t("style"),[]),w=v.useCallback(()=>s(O=>!O),[]),S=v.useCallback(()=>s(!1),[]),T=v.useCallback(()=>d(O=>!O),[]),B=v.useCallback(()=>t("align"),[]),E=v.useCallback(()=>a(O=>!O),[]),_=v.useCallback(()=>a(!1),[]),D=v.useCallback(()=>u(O=>!O),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:o,isAlignOpen:n,isTocPinned:l,isStylePinned:h,isAlignPinned:f,activateToc:g,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:w,closeStyle:S,togglePinStyle:T,activateAlign:B,toggleAlign:E,closeAlign:_,togglePinAlign:D}}const Q$=({error:e,labels:t})=>{if(v.isValidElement(e))return k.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 k.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:k.jsxs("div",{className:"flex items-start gap-3",children:[k.jsx("div",{className:"rounded-lg bg-red-100 p-2 text-red-600 dark:bg-red-900/50 dark:text-red-400",children:k.jsx(t$,{className:"h-5 w-5"})}),k.jsxs("div",{className:"min-w-0 flex-1",children:[k.jsxs("div",{className:"flex items-center justify-between gap-2",children:[k.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&&k.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})]}),k.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 k.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:k.jsxs("p",{className:"font-medium text-red-700 text-sm dark:text-red-300",children:[k.jsx("span",{lang:t.errorPrefix.lang,children:t.errorPrefix.text}),r]})})},J$=(e,t)=>e===null?`${t}px`:e,tR=e=>{const t=Yl("scrollBarGutter",e);return e===0?null:t};function eR({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:o,theme:s,style:n,onStyleChange:a,availableStyles:l=no.DEFAULT_MARKDOWN_STYLES,align:c=no.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=Xe.NO_EMBEDS,emptyMessage:w,toolbar:S,linkComponent:T,onHeadingSelect:B,headingHref:E,onMathDiagnostics:_,spreadsheetEditor:D,spreadsheetLocale:O,spreadsheetTapScrollCircle:R,spreadsheetScrollBarControls:W,imageSource:j,renderScrollBar:N,scrollBarGutter:$=0,scrollBarInlineSize:F}){const q=v.useRef(null),[A,I]=v.useState(null),P=v.useCallback(Mt=>{q.current=Mt,I(Mt)},[]),[L,U]=v.useState(0),z=v.useRef(null),[X,K]=v.useState(null),Q=v.useRef(null),G=v.useId(),rt=SC(),Z=S??rt,tt=v.useMemo(()=>L$(o),[o]),mt=v.useMemo(()=>E$(o),[o]),_t=v.useMemo(()=>F$(o),[o]),Ct=v.useMemo(()=>A$(o),[o]),It=v.useMemo(()=>M$(o),[o]),xe=v.useMemo(()=>O$(o),[o]),he=yC(j),Ht=nC(D);Du(C);const Pt=Kr.EMBED_PROVIDER_IDS.filter(Mt=>C.providers.includes(Mt)).join(" "),qt=C.linkCardEndpoint,zt=C.linkCardSize,fe=v.useMemo(()=>{const Mt=Pt.split(" "),Lt=Object.freeze(Kr.EMBED_PROVIDER_IDS.filter(et=>Mt.includes(et)));return Object.freeze(zt===void 0?{providers:Lt,linkCardEndpoint:qt}:{providers:Lt,linkCardEndpoint:qt,linkCardSize:zt})},[Pt,qt,zt]),Kt=o?.embeddedVideo,Jt=o?.embeddedPost,Ee=o?.embeddedFrame,Fe=v.useMemo(()=>R$({embeddedVideo:Kt,embeddedPost:Jt,embeddedFrame:Ee}),[Kt,Jt,Ee]),Ft=v.useRef(_);v.useLayoutEffect(()=>{Ft.current=_},[_]);const Tt=v.useCallback(Mt=>{Ft.current?.(Mt)},[]),Ae=w===void 0?D$:{text:w,lang:void 0},Mr=X$(q,z,X,c);if(!no.CONTENT_ALIGNS.includes(c))throw new TypeError(`[@aiquants/markdown] align must be one of ${no.CONTENT_ALIGNS.join(", ")}; got ${String(c)} (normalize it with toContentAlign)`);const je=Number.isFinite(y)&&y>=0?y:16,We=tR($),rr=N===void 0?null:We,yr=F===void 0?null:Yl("scrollBarInlineSize",F),si=v.useCallback(Mt=>{const Lt=q.current;if(Lt){const et=Lt.querySelector("[data-theme]"),lt=Lt.getBoundingClientRect(),bt=et?.children;let Ot=-1,we=Number.POSITIVE_INFINITY;if(bt)for(let ge=0;ge<bt.length;ge+=1){const He=bt[ge],fc=Math.abs(He.getBoundingClientRect().top-lt.top);fc<we&&(we=fc,Ot=ge)}if(bt&&Ot>=0){const He=bt[Ot].getBoundingClientRect();Q.current={childIndex:Ot,offset:He.top-lt.top}}else Q.current=null}a(Mt)},[a]);v.useLayoutEffect(()=>{const Mt=Q.current;if(!Mt)return;Q.current=null;const Lt=q.current;if(!Lt)return;const lt=Lt.querySelector("[data-theme]")?.children[Mt.childIndex];if(!lt)return;const bt=Lt.getBoundingClientRect(),we=lt.getBoundingClientRect().top-bt.top;Lt.scrollTop+=we-Mt.offset});const{isTocPinned:Me,closeToc:ir}=Z,Or=v.useCallback((Mt,Lt)=>{if(Me||ir(),B?.(Mt,Lt)===!0)return;Lt.preventDefault();const lt=q.current?.querySelector(`#${CSS.escape(Mt.id)}`)??document.getElementById(Mt.id);lt&&(K$(lt),lt.tabIndex<0&&!lt.hasAttribute("tabindex")&&lt.setAttribute("tabindex","-1"),lt.scrollIntoView({behavior:V$()?"instant":"smooth",block:"start"}),lt.focus({preventScroll:!0}))},[ir,Me,B]),ni=v.useMemo(()=>l.find(Lt=>Lt.name===n)?.className??"markdown-body",[l,n]),xr=e?.headings??[],$r=!(i||r),J=$r&&e!==null,ut=$r&&e===null&&t!==null,xt=J&&d&&xr.length>0,Dt=J&&f,jt=g!==void 0||m!==void 0,ai=(J||ut)&&u&&typeof h=="function"&&jt,Rr=v.useMemo(()=>k.jsx(bC,{headings:xr,className:"text-sm",labelledBy:G,onHeadingSelect:Or,headingHref:E}),[xr,G,Or,E]),Cr=N===void 0?Hl:J$(yr,L),oo=v.useMemo(()=>Cr===Hl?z$:wC(Cr),[Cr]),Ir=xt||Dt||ai?k.jsxs("div",{ref:K,"data-aqmd-toolbar":!0,style:oo,children:[k.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:j$}),ai&&h&&k.jsx($a,{menu:"align",Icon:_u[c].Icon,buttonLabel:tt.selectAlignAria,titleLabel:tt.alignTitle,pinLabel:tt.pinAlignAria,unpinLabel:tt.unpinAlignAria,isOpen:Z.isAlignOpen,isPinned:Z.isAlignPinned,isFront:Z.lastActiveMenu==="align",onActivate:Z.activateAlign,onToggle:Z.toggleAlign,onClose:Z.closeAlign,onPinToggle:Z.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:Cr,boundary:A,renderBody:Mt=>k.jsx("div",{className:"space-y-1",children:no.CONTENT_ALIGNS.map(Lt=>{const{labelKey:et,Icon:lt}=_u[Lt],bt=tt[et],Ot=c===Lt;return k.jsxs("button",{type:"button","aria-pressed":Ot,lang:bt.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${Ot?"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),Mt()},children:[k.jsx(lt,{className:"h-4 w-4"}),bt.text]},Lt)})})}),Dt&&k.jsx($a,{menu:"style",Icon:c$,buttonLabel:tt.selectStyleAria,titleLabel:tt.styleTitle,pinLabel:tt.pinStyleAria,unpinLabel:tt.unpinStyleAria,isOpen:Z.isStyleOpen,isPinned:Z.isStylePinned,isFront:Z.lastActiveMenu==="style",onActivate:Z.activateStyle,onToggle:Z.toggleStyle,onClose:Z.closeStyle,onPinToggle:Z.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:Cr,boundary:A,renderBody:Mt=>k.jsx("div",{className:"space-y-1",children:l.map(Lt=>{const et=n===Lt.name;return k.jsx("button",{type:"button","aria-pressed":et,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${et?"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:()=>{si(Lt.name),Mt()},children:Lt.name},Lt.name)})})}),xt&&k.jsx($a,{menu:"toc",Icon:l$,buttonLabel:tt.openTocAria,titleLabel:tt.tocTitle,titleId:G,pinLabel:tt.pinTocAria,unpinLabel:tt.unpinTocAria,isOpen:Z.isTocOpen,isPinned:Z.isTocPinned,isFront:Z.lastActiveMenu==="toc",onActivate:Z.activateToc,onToggle:Z.toggleToc,onClose:Z.closeToc,onPinToggle:Z.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:Cr,boundary:A,renderBody:()=>Rr})]}):null,so=()=>i?k.jsxs("p",{children:[k.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",k.jsx("span",{lang:tt.loading.lang,children:tt.loading.text})]}):r?k.jsx(Q$,{error:r,labels:tt}):e?k.jsx("div",{className:"relative w-full min-w-0",children:k.jsx(Z$,{parseResult:e,theme:s,styleClassName:ni,iFrameAllowedDomains:x,embeds:fe,embedLabels:Fe,linkComponent:T,missingImageLabel:tt.missingImage.text,blockFailedLabel:o?.blockFailed,mermaidLabels:mt,codeBlockLabels:It,displayMathLabels:xe,spreadsheetEditor:Ht,spreadsheetLocale:O,spreadsheetLabels:_t,spreadsheetTapScrollCircle:R,spreadsheetScrollBarControls:W,imageSource:he,svgImageLabels:Ct,onMathDiagnostics:Tt})}):t!==null?k.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):k.jsx("p",{lang:Ae.lang,children:Ae.text}),Jn={containerType:"inline-size",...rr===null?{paddingInline:`${je}px`}:{paddingInlineStart:`${je}px`,paddingInlineEnd:`calc(${je}px + ${rr})`},paddingBlockEnd:`${je}px`,paddingBlockStart:`calc(${je}px + var(${Oa}, 0px))`,scrollPaddingBlockStart:`var(${Oa}, 0px)`,...Mr===null?void 0:{[Oa]:`${Mr}px`}},ta=Ir!==null&&!jt;return k.jsxs($u,{scrollerRef:P,scrollerProps:{"data-testid":"viewer","data-aqmd-scroll-container":!0,"data-aqmd-toolbar-over-content":ta?!0:void 0,className:"grid h-full w-full overflow-x-auto overflow-y-auto *:min-w-0",style:Jn},renderScrollBar:N,barInlineSize:F,onBarInlineSizeChange:U,children:[Ir,k.jsx("div",{ref:z,"data-aqmd-content":!0,style:{width:g??N$,maxWidth:m,marginInline:q$(c)},children:so()})]})}const TC=({node:e})=>k.jsx("del",{children:k.jsx(Gt,{nodes:e.children})}),vC=({node:e})=>k.jsx("em",{children:k.jsx(Gt,{nodes:e.children})}),_C=({node:e})=>k.jsx("sup",{children:k.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,"]"]})}),rR=({nodes:e,theme:t="light"})=>e.length===0?null:k.jsx("section",{className:"border-[#171717] border-t pt-4 dark:border-[#464646]",children:k.jsx("ol",{className:"pl-6 text-[#686868] text-sm dark:text-[#a4a5a9]",children:e.map((r,i)=>k.jsx("li",{id:`fn-${r.identifier}`,className:i===0?"":"mt-4",children:k.jsx(Gt,{nodes:r.children,theme:t})},`mdast-node-fn-${r.identifier}-${i}`))})}),BC=({node:e})=>k.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),iR=e=>e.replace(/<rt\b[^>]*>[\s\S]*?<\/rt>/gi,"").replace(/<rp\b[^>]*>[\s\S]*?<\/rp>/gi,"").replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&amp;/gi,"&").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/gi,"'").replace(/&#(\d+);/g,(o,s)=>{const n=Number(s);return Number.isFinite(n)?String.fromCodePoint(n):""}).replace(/&#x([0-9a-f]+);/gi,(o,s)=>{const n=Number.parseInt(s,16);return Number.isFinite(n)?String.fromCodePoint(n):""}).replace(/\s+/g," ").trim(),LC=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"?iR(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()},oR=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"}},EC=({node:e})=>{const t=new KC,r=`h${e.depth}`,i=e.data?.hProperties?.id,o=t.slug(LC(e.children));return k.jsx(r,{id:i||o,className:oR(e.depth),children:k.jsx(Gt,{nodes:e.children})})},sR=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),nR=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=k.jsx(Gt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),o=Tn(e.data.tagName,sR(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 k.jsx(s,{...vt.attributesToProps(o.attributes,e.data.tagName.toLowerCase()),children:i})},aR=/^\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,lR=({node:e,iFrameAllowedDomains:t=[]})=>{const r=vt(e.value,mC({iFrameAllowedDomains:t,embedLabels:rb}));return Array.isArray(r)&&r.length===0?null:aR.test(e.value)?k.jsx("div",{children:r}):k.jsx("span",{children:r})},FC=({node:e})=>{if(!e.url||e.url.trim()===""||!Jo(e.url))return null;const t=e.title??"",r=e.data?.hProperties?.width,i=e.data?.hProperties?.height;return k.jsxs("span",{style:{width:r,height:i},className:"mt-4 mb-4 inline-block w-fit max-w-full",children:[k.jsx("img",{src:e.url,alt:e.alt??"",className:"mx-auto h-full w-full",width:r,height:i}),t&&k.jsx("em",{className:"block text-center text-gray-400 text-xs",children:t})]})},AC=({node:e})=>k.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}),hR=({node:e})=>{const t=dC(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"?k.jsx("span",{className:r,dangerouslySetInnerHTML:t.innerHtml}):k.jsx("span",{className:r,children:t.message})},cR=new RegExp(`<(?:${[...uc].join("|")})(?=[\\s/>])`,"i"),MC=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&cR.test(t.value)||t.children!==void 0&&MC(t.children)),OC=({node:e})=>{const t=Jo(e.url)?e.url:void 0,r=t!==void 0&&uC(t);return k.jsx("a",{className:fC(void 0,MC(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:k.jsx(Gt,{nodes:e.children})})},$C=({node:e})=>e.children.length===1&&e.children[0].type==="paragraph"?k.jsx("li",{children:k.jsx(Gt,{nodes:e.children[0].children})}):k.jsx("li",{children:k.jsx(Gt,{nodes:e.children})}),RC=({node:e})=>{const t=e.ordered?"ol":"ul";return k.jsx(t,{children:k.jsx(Gt,{nodes:e.children})})},dR=({node:e})=>k.jsx("mark",{children:k.jsx(Gt,{nodes:e.children})}),IC=({node:e})=>k.jsx("p",{children:k.jsx(Gt,{nodes:e.children})}),PC=({node:e})=>k.jsx("strong",{children:k.jsx(Gt,{nodes:e.children})}),uR=({node:e})=>k.jsx("sub",{children:k.jsx(Gt,{nodes:e.children})}),fR=({node:e})=>k.jsx("sup",{children:k.jsx(Gt,{nodes:e.children})}),Lu=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},DC=({node:e})=>{const[t,...r]=e.children;return k.jsx("div",{className:"overflow-x-auto",children:k.jsxs("table",{className:"w-full border-collapse border-none",children:[k.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:k.jsx("tr",{children:t.children.map((i,o)=>{const{merged:s,colSpan:n,rowSpan:a,textAlign:l}=Lu(i);return s?null:k.jsx("th",{colSpan:n,rowSpan:a,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:k.jsx(Gt,{nodes:i.children})},`mdast-table-node-${e.type}-${o}`)})})}),k.jsx("tbody",{children:r.map((i,o)=>k.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((s,n)=>{const{merged:a,colSpan:l,rowSpan:c,textAlign:h}=Lu(s);return a?null:k.jsx("td",{colSpan:l,rowSpan:c,style:{textAlign:h??e.align?.[n]??void 0},className:"border border-gray-300 px-4 py-2 dark:border-gray-600 dark:text-gray-300",children:k.jsx(Gt,{nodes:s.children})},`mdast-table-node-${e.type}-${n}`)})},`mdast-table-node-${e.type}-${o}`))})]})})},NC=({node:e})=>k.jsx(k.Fragment,{children:e.value}),qC=()=>k.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),zC=({node:e})=>{const t=e.data?.title||"";return k.jsxs("details",{className:"markdown-details",children:[k.jsx("summary",{children:t}),k.jsx("div",{className:"markdown-details-content",children:k.jsx(Gt,{nodes:e.children})})]})},jC=({node:e})=>{const r=["message",e.data?.messageType||"message"].filter(Boolean).join(" ");return k.jsxs("aside",{className:r,children:[k.jsx("span",{className:"message-symbol",style:{userSelect:"none"},children:"!"}),k.jsx("div",{className:"message-content",children:k.jsx(Gt,{nodes:e.children})})]})},Gt=({nodes:e,theme:t="light",iFrameAllowedDomains:r=[]})=>e.map((i,o)=>{switch(i.type){case"blockquote":return k.jsx(WC,{node:i},`mdast-node-${i.type}-${o}`);case"break":return k.jsx("br",{},`mdast-node-${i.type}-${o}`);case"code":return k.jsx(dc,{node:i,theme:t},`mdast-node-${i.type}-${o}`);case"delete":return k.jsx(TC,{node:i},`mdast-node-${i.type}-${o}`);case"details":return k.jsx(zC,{node:i},`mdast-node-${i.type}-${o}`);case"emphasis":return k.jsx(vC,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteReference":return k.jsx(_C,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteDefinition":return null;case"footnote-back-link":return k.jsx(BC,{node:i},`mdast-node-${i.type}-${o}`);case"heading":return k.jsx(EC,{node:i},`mdast-node-${i.type}-${o}`);case"html":return k.jsx(lR,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${o}`);case"html-block-container":{const s=i,n=`mdast-node-${s.type}-${s.position?.start?.offset??"na"}-${s.position?.end?.offset??"na"}`;return k.jsx(nR,{node:s,theme:t,iFrameAllowedDomains:r},n)}case"image":return k.jsx(FC,{node:i},`mdast-node-${i.type}-${o}`);case"inlineCode":return k.jsx(AC,{node:i},`mdast-node-${i.type}-${o}`);case"inlineMath":return k.jsx(hR,{node:i},`mdast-node-${i.type}-${o}`);case"link":return k.jsx(OC,{node:i},`mdast-node-${i.type}-${o}`);case"listItem":return k.jsx($C,{node:i},`mdast-node-${i.type}-${o}`);case"list":return k.jsx(RC,{node:i},`mdast-node-${i.type}-${o}`);case"mark":return k.jsx(dR,{node:i},`mdast-node-${i.type}-${o}`);case"math":return k.jsx(dO,{node:i},`mdast-node-${i.type}-${o}`);case"message":return k.jsx(jC,{node:i},`mdast-node-${i.type}-${o}`);case"paragraph":return k.jsx(IC,{node:i},`mdast-node-${i.type}-${o}`);case"strong":return k.jsx(PC,{node:i},`mdast-node-${i.type}-${o}`);case"subscript":return k.jsx(uR,{node:i},`mdast-node-${i.type}-${o}`);case"superscript":return k.jsx(fR,{node:i},`mdast-node-${i.type}-${o}`);case"table":return k.jsx(DC,{node:i},`mdast-node-${i.type}-${o}`);case"text":return k.jsx(NC,{node:i},`mdast-node-${i.type}-${o}`);case"thematicBreak":return k.jsx(qC,{},`mdast-node-${i.type}-${o}`);case"yaml":return null;default:{if(process.env.NODE_ENV==="development")return k.jsxs("div",{children:[k.jsxs("p",{style:{color:"red"},children:["Unknown node type: ",i.type]}),k.jsx("pre",{children:JSON.stringify(i,null,2)})]},`mdast-node-${i.type}-${o}`);throw new Error(`Unknown node type: ${i.type}`)}}}),WC=({node:e})=>k.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:k.jsx(Gt,{nodes:e.children})}),gR=/\s*\{#(.+?)\}\s*$/,pR=()=>e=>{be.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(gR);if(o){const s=o[1];t.data||(t.data={});const n=t.data,a=n.hProperties||{};a.id=s,n.hProperties=a,i.value=i.value.substring(0,o.index).trimEnd(),i.value===""&&t.children.pop()}})},mR=()=>e=>{be.visit(e,"footnoteDefinition",t=>{be.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},yR=()=>e=>{be.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[,n,a]=s,l={type:"link",url:n,children:[{type:"text",value:a}]};i.children.splice(r,1,l)}})},xR=()=>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 a="",l=0;const c=[];let h=!1;for(let d=o;d<i.length;d++){const f=i[d];if(f.type==="html"){a+=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")a+=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:a})}o++}};be.visit(e,"paragraph",t),be.visit(e,"tableCell",t),be.visit(e,"heading",t),be.visit(e,"emphasis",t),be.visit(e,"strong",t),be.visit(e,"delete",t)},Eu=/\s*=\s*(\d+)(w|h|x|y)\s*/g,CR=()=>e=>{be.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(Eu)];return{updatedText:l.replaceAll(Eu,"").trim(),matches:c}},{updatedText:i,matches:o}=r(t.alt);t.alt=i;const{updatedText:s,matches:n}=r(t.title);t.title=s||null;const a=[...o,...n];if(a.length>0){t.data||(t.data={}),t.data.hProperties||(t.data.hProperties={});for(const l of a){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)}}})},bR=()=>e=>{be.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},Fu=/^:::(message|details)\s*(.*)/,kR=()=>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(Fu);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();Fu.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 w={type:"paragraph",children:C},T=r[h].children.slice(0,-1);T.at(-1)?.type==="break"&&T.pop();const B={type:"paragraph",children:T},E=r.slice(c+1,h);m=[w,...E,B].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 n={...s};"children"in n&&Array.isArray(n.children)&&(n.type==="blockquote"||n.type==="footnoteDefinition"||n.type==="message"||n.type==="details"?n.children=t(n.children):n.type==="list"&&(n.children=n.children.map(a=>({...a,children:t(a.children)})))),i.push(n),o++}return i}e.children=t(e.children)},wR=e=>{const t=[];return be.visit(e,"heading",r=>{const i=LC(r.children),o=r.data?.hProperties?.id;o&&i&&t.push({depth:r.depth,text:i,id:o})}),t};exports.BlockquoteNode=WC;exports.CodeNode=dc;exports.Color=Ne;exports.Color$1=Qi;exports.DEFAULT_CODE_BLOCK_LABELS=QC;exports.DEFAULT_DISPLAY_MATH_LABELS=JC;exports.DEFAULT_MARKDOWN_EMBED_LABELS=eb;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=B$;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=l5;exports.DEFAULT_MERMAID_INTERACTION=Qx;exports.DEFAULT_SVG_IMAGE_LABELS=WO;exports.DeleteNode=TC;exports.EmphasisNode=vC;exports.FootnoteBackLinkNode=BC;exports.FootnoteReferenceNode=_C;exports.FootnotesSection=rR;exports.HeadingNode=EC;exports.HostedScrollArea=$u;exports.ImageNode=FC;exports.InlineCodeNode=AC;exports.JSON_SCHEMA=tm;exports.LinkNode=OC;exports.ListItemNode=$C;exports.ListNode=RC;exports.MarkdownRenderer=CC;exports.MarkdownViewer=eR;exports.MermaidDiagram=ac;exports.NodesRenderer=Gt;exports.ParagraphNode=IC;exports.Rgb=ce;exports.SpreadsheetBlock=cc;exports.StrongNode=PC;exports.TableNode=DC;exports.TableOfContents=bC;exports.TextNode=NC;exports.ThematicBreakNode=qC;exports.Utils=pt;exports.ZERO_WIDTH_SPACE=Sm;exports.ZennDetailsNode=zC;exports.ZennMessageNode=jC;exports.__export=Yu;exports.__name=p;exports.abs=yT;exports.acos=vT;exports.adjustChannel=Vl;exports.argumentsTag=Eh;exports.array=Xf;exports.arrayBufferTag=cm;exports.arrayTag=hm;exports.asin=_T;exports.assignWithDepth_default=Ut;exports.at=st;exports.atan2=xT;exports.booleanTag=Lh;exports.calculateMathMLDimensions=Wk;exports.calculateTextDimensions=Nn;exports.calculateTextHeight=Ih;exports.calculateTextWidth=Ze;exports.cleanAndMerge=qn;exports.clear=uf;exports.clear$1=bL;exports.clear$2=GB;exports.clear2=gL;exports.color=Wi;exports.commonDb_exports=th;exports.common_default=Zi;exports.computeDimensionOfText=ay;exports.computeLabelTransform=mi;exports.configureLabelImages=Dh;exports.configureSvgSize=Jl;exports.constant=zr;exports.constant$1=En;exports.cos=CT;exports.createText=ze;exports.curveBasis=tn;exports.darken=Y;exports.dataViewTag=um;exports.dateTag=nm;exports.dayjs2=Uu;exports.decodeEntities=Br;exports.defaultConfig2=Qk;exports.defaultConfig_default=Kl;exports.define=Ln;exports.distExports=rm;exports.edgeLabels=Xo;exports.epsilon=rl;exports.extend=lh;exports.extractHeadings=wR;exports.float32ArrayTag=bm;exports.float64ArrayTag=km;exports.generateId=Em;exports.getAccDescription=mf;exports.getAccTitle=gf;exports.getConfig=Rt;exports.getConfig2=wt;exports.getDefaultExportFromCjs=Mu;exports.getDiagramTitle=xf;exports.getEdgeId=x_;exports.getEffectiveHtmlLabels=ae;exports.getIconSVG=to;exports.getLineFunctionsWithOffset=N0;exports.getRegisteredLayoutAlgorithm=JL;exports.getStylesFromArray=Rh;exports.getSubGraphTitleMargins=zn;exports.getTag=Pn;exports.getThemeVariables3=Xu;exports.getUrl=cf;exports.getUserDefinedConfig=Fk;exports.halfPi=il;exports.hasKatex=zi;exports.hue=Xw;exports.insertCluster=xy;exports.insertEdge=W0;exports.insertEdgeLabel=q0;exports.insertNode=Jh;exports.int16ArrayTag=xm;exports.int32ArrayTag=Cm;exports.int8ArrayTag=ym;exports.interpolateNumber=lr;exports.interpolateRgb=Xa;exports.interpolateString=If;exports.isDark=Le;exports.isLabelStyle=vh;exports.isPrimitive=Dn;exports.isTypedArray=$o;exports.isValidShape=D0;exports.lighten=H;exports.line=Kf;exports.lineBreakRegex=Ki;exports.load=em;exports.log=V;exports.mapTag=am;exports.markerOffsets=ie;exports.markers_default=U0;exports.max=bT;exports.min=kT;exports.nogamma=hh;exports.numberTag=Bh;exports.objectTag=dm;exports.parseFontSize=is;exports.parseGenericTypes=za;exports.pi=Mn;exports.positionEdgeLabel=z0;exports.positionNode=pL;exports.random=Am;exports.regexpTag=om;exports.registerIconPacks=Pm;exports.remarkCustomHeadingId=pR;exports.remarkFootnoteBackLink=mR;exports.remarkHtmlAnchorToLink=yR;exports.remarkHtmlInHtml=xR;exports.remarkImageSize=CR;exports.remarkParentNode=bR;exports.remarkZennMessage=kR;exports.render=QL;exports.renderKatexSanitized=Ql;exports.rgbConvert=Of;exports.rgba=cr;exports.sanitizeText=_e;exports.select=yt;exports.selectSvgElement=xg;exports.setAccDescription=pf;exports.setAccTitle=ff;exports.setConfig2=Zk;exports.setDiagramTitle=yf;exports.setNodeElem=fL;exports.setTag=lm;exports.setupGraphViewbox=df;exports.setupGraphViewbox2=Cf;exports.sin=wT;exports.sqrt=ST;exports.stringTag=_h;exports.styles2String=nt;exports.symbolTag=sm;exports.tau=TT;exports.terminalLabels=Zt;exports.uint16ArrayTag=pm;exports.uint32ArrayTag=mm;exports.uint8ArrayTag=fm;exports.uint8ClampedArrayTag=gm;exports.unknownIcon=Rm;exports.updateNodeBounds=at;exports.useMarkdownToolbarState=SC;exports.utils_default=ve;exports.withPath=Gf;exports.wrapLabel=Mm;