rdstudio 0.2.0__py3-none-any.whl

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 (251) hide show
  1. rdstudio/__init__.py +3 -0
  2. rdstudio/_node/rdstudio.mjs +59351 -0
  3. rdstudio/brief.py +46 -0
  4. rdstudio/build.py +218 -0
  5. rdstudio/classify.py +131 -0
  6. rdstudio/cli.py +369 -0
  7. rdstudio/config.py +115 -0
  8. rdstudio/gitlog.py +92 -0
  9. rdstudio/launcher.py +63 -0
  10. rdstudio/learner.py +187 -0
  11. rdstudio/mcp_server.py +313 -0
  12. rdstudio/okf.py +775 -0
  13. rdstudio/procedures.py +233 -0
  14. rdstudio/references.py +228 -0
  15. rdstudio/reports.py +75 -0
  16. rdstudio/scaffold.py +227 -0
  17. rdstudio/scopes.py +162 -0
  18. rdstudio/search.py +149 -0
  19. rdstudio/serve.py +214 -0
  20. rdstudio/store.py +161 -0
  21. rdstudio/templates/agents/critic.md +20 -0
  22. rdstudio/templates/agents/librarian.md +21 -0
  23. rdstudio/templates/agents/searcher.md +21 -0
  24. rdstudio/templates/agents_section.md +31 -0
  25. rdstudio/templates/claude_section.md +3 -0
  26. rdstudio/templates/knowledge/overview.md +20 -0
  27. rdstudio/templates/knowledge/tasks/bootstrap-knowledge-base.md +45 -0
  28. rdstudio/templates/skills/decision/SKILL.md +47 -0
  29. rdstudio/templates/skills/handoff/SKILL.md +18 -0
  30. rdstudio/templates/skills/ingest-ref/SKILL.md +32 -0
  31. rdstudio/templates/skills/lint-okf/SKILL.md +15 -0
  32. rdstudio/templates/skills/promote/SKILL.md +25 -0
  33. rdstudio/templates/skills/question/SKILL.md +33 -0
  34. rdstudio/templates/skills/record-okf/SKILL.md +61 -0
  35. rdstudio/templates/skills/report/SKILL.md +46 -0
  36. rdstudio/templates/skills/report/template.html +74 -0
  37. rdstudio/templates/skills/search-okf/SKILL.md +36 -0
  38. rdstudio/templates/skills/task/SKILL.md +51 -0
  39. rdstudio/web/app.js +140 -0
  40. rdstudio/web/fonts.css +48 -0
  41. rdstudio/web/icon-192.png +0 -0
  42. rdstudio/web/icon-512.png +0 -0
  43. rdstudio/web/index.html +109 -0
  44. rdstudio/web/js/data.js +125 -0
  45. rdstudio/web/js/diagrams.js +116 -0
  46. rdstudio/web/js/graph.js +396 -0
  47. rdstudio/web/js/knowledge.js +212 -0
  48. rdstudio/web/js/layout-worker.js +15 -0
  49. rdstudio/web/js/layout.js +226 -0
  50. rdstudio/web/js/learn.js +83 -0
  51. rdstudio/web/js/map.js +1293 -0
  52. rdstudio/web/js/markdown.js +173 -0
  53. rdstudio/web/js/pages.js +219 -0
  54. rdstudio/web/js/procedures.js +262 -0
  55. rdstudio/web/js/settings.js +95 -0
  56. rdstudio/web/js/util.js +99 -0
  57. rdstudio/web/report.css +35 -0
  58. rdstudio/web/report.js +104 -0
  59. rdstudio/web/style.css +566 -0
  60. rdstudio/web/sw.js +166 -0
  61. rdstudio/web/themes/cyber.css +139 -0
  62. rdstudio/web/themes/map.css +133 -0
  63. rdstudio/web/themes/notebook.css +134 -0
  64. rdstudio/web/themes/space.css +135 -0
  65. rdstudio/web/themes/studio.css +110 -0
  66. rdstudio/web/vendor/d3.min.js +2 -0
  67. rdstudio/web/vendor/fonts/atkinson-hyperlegible-next-latin-ext-wght-italic.woff2 +0 -0
  68. rdstudio/web/vendor/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2 +0 -0
  69. rdstudio/web/vendor/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2 +0 -0
  70. rdstudio/web/vendor/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2 +0 -0
  71. rdstudio/web/vendor/fonts/caveat-latin-wght-normal.woff2 +0 -0
  72. rdstudio/web/vendor/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
  73. rdstudio/web/vendor/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
  74. rdstudio/web/vendor/fonts/ibm-plex-sans-latin-wght-italic.woff2 +0 -0
  75. rdstudio/web/vendor/fonts/ibm-plex-sans-latin-wght-normal.woff2 +0 -0
  76. rdstudio/web/vendor/fonts/inter-latin-opsz-italic.woff2 +0 -0
  77. rdstudio/web/vendor/fonts/inter-latin-opsz-normal.woff2 +0 -0
  78. rdstudio/web/vendor/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
  79. rdstudio/web/vendor/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  80. rdstudio/web/vendor/fonts/literata-latin-ext-opsz-italic.woff2 +0 -0
  81. rdstudio/web/vendor/fonts/literata-latin-ext-opsz-normal.woff2 +0 -0
  82. rdstudio/web/vendor/fonts/literata-latin-opsz-italic.woff2 +0 -0
  83. rdstudio/web/vendor/fonts/literata-latin-opsz-normal.woff2 +0 -0
  84. rdstudio/web/vendor/fonts/source-sans-3-latin-wght-italic.woff2 +0 -0
  85. rdstudio/web/vendor/fonts/source-sans-3-latin-wght-normal.woff2 +0 -0
  86. rdstudio/web/vendor/fonts/source-serif-4-latin-opsz-italic.woff2 +0 -0
  87. rdstudio/web/vendor/fonts/source-serif-4-latin-opsz-normal.woff2 +0 -0
  88. rdstudio/web/vendor/hljs/github-dark.min.css +10 -0
  89. rdstudio/web/vendor/hljs/github.min.css +10 -0
  90. rdstudio/web/vendor/hljs/highlight.min.js +1262 -0
  91. rdstudio/web/vendor/hljs/julia.min.js +18 -0
  92. rdstudio/web/vendor/hljs/latex.min.js +33 -0
  93. rdstudio/web/vendor/hljs/matlab.min.js +15 -0
  94. rdstudio/web/vendor/katex/auto-render.min.js +1 -0
  95. rdstudio/web/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  96. rdstudio/web/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  97. rdstudio/web/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  98. rdstudio/web/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  99. rdstudio/web/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  100. rdstudio/web/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  101. rdstudio/web/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  102. rdstudio/web/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  103. rdstudio/web/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  104. rdstudio/web/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  105. rdstudio/web/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  106. rdstudio/web/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  107. rdstudio/web/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  108. rdstudio/web/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  109. rdstudio/web/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  110. rdstudio/web/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  111. rdstudio/web/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  112. rdstudio/web/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  113. rdstudio/web/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  114. rdstudio/web/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  115. rdstudio/web/vendor/katex/katex.min.css +1 -0
  116. rdstudio/web/vendor/katex/katex.min.js +1 -0
  117. rdstudio/web/vendor/licenses/atkinson-hyperlegible-next-OFL.txt +93 -0
  118. rdstudio/web/vendor/licenses/caveat-OFL.txt +93 -0
  119. rdstudio/web/vendor/licenses/d3-7.9.0.txt +13 -0
  120. rdstudio/web/vendor/licenses/highlightjs-cdn-assets-11.12.0.txt +29 -0
  121. rdstudio/web/vendor/licenses/ibm-plex-mono-OFL.txt +93 -0
  122. rdstudio/web/vendor/licenses/ibm-plex-sans-OFL.txt +93 -0
  123. rdstudio/web/vendor/licenses/inter-OFL.txt +93 -0
  124. rdstudio/web/vendor/licenses/jetbrains-mono-OFL.txt +93 -0
  125. rdstudio/web/vendor/licenses/katex-0.18.7.txt +21 -0
  126. rdstudio/web/vendor/licenses/literata-OFL.txt +93 -0
  127. rdstudio/web/vendor/licenses/markdown-it-15.0.2.txt +22 -0
  128. rdstudio/web/vendor/licenses/markdown-it-footnote-4.0.0.txt +22 -0
  129. rdstudio/web/vendor/licenses/markdown-it-texmath-1.0.0.txt +21 -0
  130. rdstudio/web/vendor/licenses/mermaid-12.0.0.txt +21 -0
  131. rdstudio/web/vendor/licenses/source-sans-3-OFL.txt +93 -0
  132. rdstudio/web/vendor/licenses/source-serif-4-OFL.txt +93 -0
  133. rdstudio/web/vendor/licenses/vega-6.4.0.txt +27 -0
  134. rdstudio/web/vendor/licenses/vega-embed-7.2.0.txt +27 -0
  135. rdstudio/web/vendor/licenses/vega-lite-6.4.3.txt +27 -0
  136. rdstudio/web/vendor/markdown-it-footnote.min.js +2 -0
  137. rdstudio/web/vendor/markdown-it.min.js +14 -0
  138. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/abnfDiagram-DGLNOSUI.mjs +1 -0
  139. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/architecture-7GRP2DOG-HF4J73XS.mjs +1 -0
  140. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/architectureDiagram-IU6H5EVY.mjs +36 -0
  141. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/blockDiagram-FSX6DT2V.mjs +140 -0
  142. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/c4Diagram-YNRVYILN.mjs +38 -0
  143. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-22SYA5HA.mjs +1 -0
  144. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-2FTYKNOQ.mjs +1 -0
  145. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-36VM3LGA.mjs +1 -0
  146. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-3SEI7E7V.mjs +1 -0
  147. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-3T2MNPEU.mjs +1 -0
  148. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-44AU3KAP.mjs +174 -0
  149. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-4MZOTL6B.mjs +1 -0
  150. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-52IMQVNL.mjs +1 -0
  151. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-5NYYYZGL.mjs +1 -0
  152. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-BOZ75642.mjs +15 -0
  153. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-CVBX6EWK.mjs +1 -0
  154. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-D36F7FYG.mjs +14 -0
  155. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-DEGLBX6O.mjs +213 -0
  156. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-F6PIGZHG.mjs +1 -0
  157. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-FE53TMRB.mjs +133 -0
  158. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-FNR2RGIF.mjs +1 -0
  159. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-GDOATIN3.mjs +32 -0
  160. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-H7BX327W.mjs +2 -0
  161. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-HI3EPXIC.mjs +2 -0
  162. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-JCBDXJ5W.mjs +1 -0
  163. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-JGXDHUYS.mjs +1 -0
  164. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-L2B47AAZ.mjs +1 -0
  165. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-LIEGGFIX.mjs +1 -0
  166. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-LLWYPJEZ.mjs +1 -0
  167. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-MFYRHTYG.mjs +1 -0
  168. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-MIE3LDYP.mjs +1 -0
  169. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-MLQVGYRW.mjs +1 -0
  170. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-MNT3HHAC.mjs +1 -0
  171. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-NRRTYJAG.mjs +1 -0
  172. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-OCMJQKYE.mjs +10 -0
  173. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-PKJCTQEK.mjs +339 -0
  174. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-QADHU5CF.mjs +2 -0
  175. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-QVIEFLGF.mjs +1 -0
  176. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-QX7LGXZU.mjs +1 -0
  177. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-R2KH53MI.mjs +1 -0
  178. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-RXM7Z7NK.mjs +2 -0
  179. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-S4TE5DX6.mjs +1 -0
  180. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-SDIBIOXT.mjs +1 -0
  181. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-TDFULVG6.mjs +1 -0
  182. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-TECWHJ6D.mjs +62 -0
  183. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-TINYC7RT.mjs +70 -0
  184. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-V3KJR4XU.mjs +1 -0
  185. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-VTMXW4ES.mjs +1 -0
  186. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-Y5NT6LW5.mjs +88 -0
  187. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-Y5O5OPKC.mjs +3 -0
  188. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-YZG4BXY6.mjs +1 -0
  189. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZZ52EIBP.mjs +1 -0
  190. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-v2-VV4INRHB.mjs +217 -0
  191. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/cose-bilkent-MSIMRU2B.mjs +1 -0
  192. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/cynefin-OW5HDTMX-KMPDV6GS.mjs +1 -0
  193. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/cynefinDiagram-KTGLXFXK.mjs +62 -0
  194. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/dagre-QJJCSHY4.mjs +4 -0
  195. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-2ZIM67RP.mjs +3 -0
  196. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-FYHH5O6R.mjs +24 -0
  197. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-LYLDACMS.mjs +200 -0
  198. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-TYT3HRBC.mjs +24 -0
  199. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-XVIN6YVD.mjs +30 -0
  200. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-ZO2NLLYC.mjs +41 -0
  201. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/ebnfDiagram-TU3FGH35.mjs +1 -0
  202. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/elk-GHAXNSLK.mjs +27 -0
  203. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/erDiagram-XID3VV23.mjs +99 -0
  204. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/eventmodeling-NTZA5JFV-P5QJSWSK.mjs +1 -0
  205. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/flowDiagram-WPHQAKTU.mjs +1 -0
  206. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/ganttDiagram-QACGSKG6.mjs +292 -0
  207. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/gitGraph-4MIJSDKK-V5NEQQYP.mjs +1 -0
  208. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/gitGraphDiagram-EB76O4HC.mjs +106 -0
  209. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/info-A6RAGUB7-IGBHH2L7.mjs +1 -0
  210. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/infoDiagram-343ZKIDN.mjs +2 -0
  211. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/ishikawaDiagram-UEEU5D75.mjs +70 -0
  212. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/journeyDiagram-4QTZOVLF.mjs +139 -0
  213. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/kanban-definition-VEJL4RG2.mjs +89 -0
  214. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/katex-QVRI4OIV.mjs +257 -0
  215. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/mindmap-definition-C5K5ZT7T.mjs +96 -0
  216. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/packet-AYTQ26CC-PJTKDECJ.mjs +1 -0
  217. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/pegDiagram-FHIILVJB.mjs +1 -0
  218. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/pie-WAS4IAKB-U3JFQXZN.mjs +1 -0
  219. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/pieDiagram-S76BU6V7.mjs +39 -0
  220. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/quadrantDiagram-HZBLWUZE.mjs +7 -0
  221. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/radar-RG4KPBEZ-7T2UW32D.mjs +1 -0
  222. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroad-74A4TZTK-DZY7ARDL.mjs +1 -0
  223. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroad-abnf-HS5TGJTU-LWS535ZK.mjs +1 -0
  224. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroad-ebnf-LZEXJU2U-EA3S4ZFM.mjs +1 -0
  225. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroad-peg-WCYAUIDC-DUKZONPX.mjs +1 -0
  226. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroadDiagram-R6RP3MQ2.mjs +1 -0
  227. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/requirementDiagram-SGBABQV6.mjs +84 -0
  228. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/sankeyDiagram-IM6M5BOW.mjs +40 -0
  229. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/sequenceDiagram-FGJOIFJ2.mjs +169 -0
  230. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/sizeCapture-ERV5D3W5.mjs +1 -0
  231. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/stateDiagram-v2-6KDGCZ5J.mjs +291 -0
  232. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/swimlanes-OJBUSBEF.mjs +1 -0
  233. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/swimlanesDiagram-LNXYTHDW.mjs +8 -0
  234. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/timeline-definition-7G6YQRTY.mjs +120 -0
  235. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/treeView-Q6P3EWNA-AABPVERA.mjs +1 -0
  236. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/treemap-WGGIJYW6-F2JSY3V3.mjs +1 -0
  237. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/usecaseDiagram-6Y6TMLBO.mjs +383 -0
  238. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/vennDiagram-6RODYPCK.mjs +34 -0
  239. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/wardley-WFR3VGLG-EIT5NWVN.mjs +1 -0
  240. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/wardleyDiagram-RFZKLAPA.mjs +78 -0
  241. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/xychartDiagram-TWWI2QJZ.mjs +7 -0
  242. rdstudio/web/vendor/mermaid/mermaid.esm.min.mjs +14 -0
  243. rdstudio/web/vendor/texmath.js +368 -0
  244. rdstudio/web/vendor/vega/vega-embed.min.js +7 -0
  245. rdstudio/web/vendor/vega/vega-lite.min.js +2 -0
  246. rdstudio/web/vendor/vega/vega.min.js +1 -0
  247. rdstudio-0.2.0.dist-info/METADATA +201 -0
  248. rdstudio-0.2.0.dist-info/RECORD +251 -0
  249. rdstudio-0.2.0.dist-info/WHEEL +4 -0
  250. rdstudio-0.2.0.dist-info/entry_points.txt +3 -0
  251. rdstudio-0.2.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,4 @@
1
+ import{a as Ge,b as Ae,c as C,d as ie,e as Fe,f as Q,g as Ve}from"./chunk-4MZOTL6B.mjs";import{A as U,B as ae,C as x,a as Te,b as F,c as O,d as Me,e as oe,f as je,g as X,h as l,i as S,j as W,k as b,l as De,m as Be,n as K,o as T,p as k,q as V,r as N,s as q,t as M,u as Y,v as z,w as L,x as G,y as Xe,z as P}from"./chunk-D36F7FYG.mjs";import{b as Se}from"./chunk-JCBDXJ5W.mjs";import{g as ne,h as Pe,i as Ce}from"./chunk-OCMJQKYE.mjs";import{a as Oe,c as Re,e as te}from"./chunk-MNT3HHAC.mjs";import{b as Ie}from"./chunk-TECWHJ6D.mjs";import"./chunk-F6PIGZHG.mjs";import"./chunk-JGXDHUYS.mjs";import"./chunk-TINYC7RT.mjs";import"./chunk-TDFULVG6.mjs";import"./chunk-MIE3LDYP.mjs";import"./chunk-QADHU5CF.mjs";import"./chunk-ZZ52EIBP.mjs";import{$ as Le}from"./chunk-FE53TMRB.mjs";import{b as y}from"./chunk-L2B47AAZ.mjs";import{a as s}from"./chunk-QVIEFLGF.mjs";var Z=class{static{s(this,"List")}constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,n=r._prev;if(n!==r)return Ye(n),n}enqueue(r){var n=this._sentinel;r._prev&&r._next&&Ye(r),r._next=n._next,n._next._prev=r,n._next=r,r._prev=n}toString(){for(var r=[],n=this._sentinel,t=n._prev;t!==n;)r.push(JSON.stringify(t,Vr)),t=t._prev;return"["+r.join(", ")+"]"}};function Ye(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}s(Ye,"unlink");function Vr(e,r){if(e!=="_next"&&e!=="_prev")return r}s(Vr,"filterOutLinks");var Yr=F(1);function ze(e,r){if(e.nodeCount()<=1)return[];var n=Ur(e,r||Yr),t=zr(n.graph,n.buckets,n.zeroIdx);return O(b(t,function(o){return e.outEdges(o.v,o.w)}))}s(ze,"greedyFAS");function zr(e,r,n){for(var t=[],o=r[r.length-1],a=r[0],i;e.nodeCount();){for(;i=a.dequeue();)se(e,r,n,i);for(;i=o.dequeue();)se(e,r,n,i);if(e.nodeCount()){for(var d=r.length-2;d>0;--d)if(i=r[d].dequeue(),i){t=t.concat(se(e,r,n,i,!0));break}}}return t}s(zr,"doGreedyFAS");function se(e,r,n,t,o){var a=o?[]:void 0;return l(e.inEdges(t.v),function(i){var d=e.edge(i),f=e.node(i.v);o&&a.push({v:i.v,w:i.w}),f.out-=d,de(r,n,f)}),l(e.outEdges(t.v),function(i){var d=e.edge(i),f=i.w,c=e.node(f);c.in-=d,de(r,n,c)}),e.removeNode(t.v),a}s(se,"removeNode");function Ur(e,r){var n=new x,t=0,o=0;l(e.nodes(),function(d){n.setNode(d,{v:d,in:0,out:0})}),l(e.edges(),function(d){var f=n.edge(d.v,d.w)||0,c=r(d),u=f+c;n.setEdge(d.v,d.w,u),o=Math.max(o,n.node(d.v).out+=c),t=Math.max(t,n.node(d.w).in+=c)});var a=L(o+t+3).map(function(){return new Z}),i=t+1;return l(n.nodes(),function(d){de(a,i,n.node(d))}),{graph:n,buckets:a,zeroIdx:i}}s(Ur,"buildState");function de(e,r,n){n.out?n.in?e[n.out-n.in+r].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}s(de,"assignBucket");function Ue(e){var r=e.graph().acyclicer==="greedy"?ze(e,n(e)):Wr(e);l(r,function(t){var o=e.edge(t);e.removeEdge(t),o.forwardName=t.name,o.reversed=!0,e.setEdge(t.w,t.v,o,U("rev"))});function n(t){return function(o){return t.edge(o).weight}}s(n,"weightFn")}s(Ue,"run");function Wr(e){var r=[],n={},t={};function o(a){Object.prototype.hasOwnProperty.call(t,a)||(t[a]=!0,n[a]=!0,l(e.outEdges(a),function(i){Object.prototype.hasOwnProperty.call(n,i.w)?r.push(i):o(i.w)}),delete n[a])}return s(o,"dfs"),l(e.nodes(),o),r}s(Wr,"dfsFAS");function We(e){l(e.edges(),function(r){var n=e.edge(r);if(n.reversed){e.removeEdge(r);var t=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(r.w,r.v,n,t)}})}s(We,"undo");function I(e,r,n,t){var o;do o=U(t);while(e.hasNode(o));return n.dummy=r,e.setNode(o,n),o}s(I,"addDummyNode");function He(e){var r=new x().setGraph(e.graph());return l(e.nodes(),function(n){r.setNode(n,e.node(n))}),l(e.edges(),function(n){var t=r.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);r.setEdge(n.v,n.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),r}s(He,"simplify");function $(e){var r=new x({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),function(n){e.children(n).length||r.setNode(n,e.node(n))}),l(e.edges(),function(n){r.setEdge(n,e.edge(n))}),r}s($,"asNonCompoundGraph");function fe(e,r){var n=e.x,t=e.y,o=r.x-n,a=r.y-t,i=e.width/2,d=e.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var f,c;return Math.abs(a)*i>Math.abs(o)*d?(a<0&&(d=-d),f=d*o/a,c=d):(o<0&&(i=-i),f=i,c=i*a/o),{x:n+f,y:t+c}}s(fe,"intersectRect");function j(e){var r=b(L(ue(e)+1),function(){return[]});return l(e.nodes(),function(n){var t=e.node(n),o=t.rank;k(o)||(r[o][t.order]=n)}),r}s(j,"buildLayerMatrix");function Je(e){var r=M(b(e.nodes(),function(n){return e.node(n).rank}));l(e.nodes(),function(n){var t=e.node(n);K(t,"rank")&&(t.rank-=r)})}s(Je,"normalizeRanks");function Ke(e){var r=M(b(e.nodes(),function(a){return e.node(a).rank})),n=[];l(e.nodes(),function(a){var i=e.node(a).rank-r;n[i]||(n[i]=[]),n[i].push(a)});var t=0,o=e.graph().nodeRankFactor;l(n,function(a,i){k(a)&&i%o!==0?--t:t&&l(a,function(d){e.node(d).rank+=t})})}s(Ke,"removeEmptyRanks");function ce(e,r,n,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=t),I(e,"border",o,r)}s(ce,"addBorderNode");function ue(e){return N(b(e.nodes(),function(r){var n=e.node(r).rank;if(!k(n))return n}))}s(ue,"maxRank");function Qe(e,r){var n={lhs:[],rhs:[]};return l(e,function(t){r(t)?n.lhs.push(t):n.rhs.push(t)}),n}s(Qe,"partition");function Ze(e,r){var n=oe();try{return r()}finally{console.log(e+" time: "+(oe()-n)+"ms")}}s(Ze,"time");function $e(e,r){return r()}s($e,"notime");function rr(e){function r(n){var t=e.children(n),o=e.node(n);if(t.length&&l(t,r),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,i=o.maxRank+1;a<i;++a)er(e,"borderLeft","_bl",n,o,a),er(e,"borderRight","_br",n,o,a)}}s(r,"dfs"),l(e.children(),r)}s(rr,"addBorderSegments");function er(e,r,n,t,o,a){var i={width:0,height:0,rank:a,borderType:r},d=o[r][a-1],f=I(e,"border",i,n);o[r][a]=f,e.setParent(f,t),d&&e.setEdge(d,f,{weight:1})}s(er,"addBorderNode");function tr(e){var r=e.graph().rankdir.toLowerCase();(r==="lr"||r==="rl")&&ar(e)}s(tr,"adjust");function or(e){var r=e.graph().rankdir.toLowerCase();(r==="bt"||r==="rl")&&qr(e),(r==="lr"||r==="rl")&&(Hr(e),ar(e))}s(or,"undo");function ar(e){l(e.nodes(),function(r){nr(e.node(r))}),l(e.edges(),function(r){nr(e.edge(r))})}s(ar,"swapWidthHeight");function nr(e){var r=e.width;e.width=e.height,e.height=r}s(nr,"swapWidthHeightOne");function qr(e){l(e.nodes(),function(r){le(e.node(r))}),l(e.edges(),function(r){var n=e.edge(r);l(n.points,le),Object.prototype.hasOwnProperty.call(n,"y")&&le(n)})}s(qr,"reverseY");function le(e){e.y=-e.y}s(le,"reverseYOne");function Hr(e){l(e.nodes(),function(r){he(e.node(r))}),l(e.edges(),function(r){var n=e.edge(r);l(n.points,he),Object.prototype.hasOwnProperty.call(n,"x")&&he(n)})}s(Hr,"swapXY");function he(e){var r=e.x;e.x=e.y,e.y=r}s(he,"swapXYOne");function ir(e){e.graph().dummyChains=[],l(e.edges(),function(r){Kr(e,r)})}s(ir,"run");function Kr(e,r){var n=r.v,t=e.node(n).rank,o=r.w,a=e.node(o).rank,i=r.name,d=e.edge(r),f=d.labelRank;if(a!==t+1){e.removeEdge(r);var c=void 0,u,h;for(h=0,++t;t<a;++h,++t)d.points=[],c={width:0,height:0,edgeLabel:d,edgeObj:r,rank:t},u=I(e,"edge",c,"_d"),t===f&&(c.width=d.width,c.height=d.height,c.dummy="edge-label",c.labelpos=d.labelpos),e.setEdge(n,u,{weight:d.weight},i),h===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,o,{weight:d.weight},i)}}s(Kr,"normalizeEdge");function sr(e){l(e.graph().dummyChains,function(r){var n=e.node(r),t=n.edgeLabel,o;for(e.setEdge(n.edgeObj,t);n.dummy;)o=e.successors(r)[0],e.removeNode(r),t.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height),r=o,n=e.node(r)})}s(sr,"undo");function H(e){var r={};function n(t){var o=e.node(t);if(Object.prototype.hasOwnProperty.call(r,t))return o.rank;r[t]=!0;var a=M(b(e.outEdges(t),function(i){return n(i.w)-e.edge(i).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),o.rank=a}s(n,"dfs"),l(e.sources(),n)}s(H,"longestPath");function A(e,r){return e.node(r.w).rank-e.node(r.v).rank-e.edge(r).minlen}s(A,"slack");function ee(e){var r=new x({directed:!1}),n=e.nodes()[0],t=e.nodeCount();r.setNode(n,{});for(var o,a;Qr(r,e)<t;)o=Zr(r,e),a=r.hasNode(o.v)?A(e,o):-A(e,o),$r(r,e,a);return r}s(ee,"feasibleTree");function Qr(e,r){function n(t){l(r.nodeEdges(t),function(o){var a=o.v,i=t===a?o.w:a;!e.hasNode(i)&&!A(r,o)&&(e.setNode(i,{}),e.setEdge(t,i,{}),n(i))})}return s(n,"dfs"),l(e.nodes(),n),e.nodeCount()}s(Qr,"tightTree");function Zr(e,r){return Y(r.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return A(r,n)})}s(Zr,"findMinSlackEdge");function $r(e,r,n){l(e.nodes(),function(t){r.node(t).rank+=n})}s($r,"shiftRanks");var zt=F(1);var ro=F(1);pe.CycleException=J;function pe(e){var r={},n={},t=[];function o(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new J;Object.prototype.hasOwnProperty.call(r,a)||(n[a]=!0,r[a]=!0,l(e.predecessors(a),o),delete n[a],t.push(a))}if(s(o,"visit"),l(e.sinks(),o),Xe(r)!==e.nodeCount())throw new J;return t}s(pe,"topsort");function J(){}s(J,"CycleException");J.prototype=new Error;function re(e,r,n){Te(r)||(r=[r]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],a={};return l(r,function(i){if(!e.hasNode(i))throw new Error("Graph does not have node: "+i);fr(e,i,n==="post",a,t,o)}),o}s(re,"dfs");function fr(e,r,n,t,o,a){Object.prototype.hasOwnProperty.call(t,r)||(t[r]=!0,n||a.push(r),l(o(r),function(i){fr(e,i,n,t,o,a)}),n&&a.push(r))}s(fr,"doDfs");function me(e,r){return re(e,r,"post")}s(me,"postorder");function ve(e,r){return re(e,r,"pre")}s(ve,"preorder");B.initLowLimValues=_e;B.initCutValues=we;B.calcCutValue=ur;B.leaveEdge=hr;B.enterEdge=pr;B.exchangeEdges=mr;function B(e){e=He(e),H(e);var r=ee(e);_e(r),we(r,e);for(var n,t;n=hr(r);)t=pr(r,e,n),mr(r,e,n,t)}s(B,"networkSimplex");function we(e,r){var n=me(e,e.nodes());n=n.slice(0,n.length-1),l(n,function(t){on(e,r,t)})}s(we,"initCutValues");function on(e,r,n){var t=e.node(n),o=t.parent;e.edge(n,o).cutvalue=ur(e,r,n)}s(on,"assignCutValue");function ur(e,r,n){var t=e.node(n),o=t.parent,a=!0,i=r.edge(n,o),d=0;return i||(a=!1,i=r.edge(o,n)),d=i.weight,l(r.nodeEdges(n),function(f){var c=f.v===n,u=c?f.w:f.v;if(u!==o){var h=c===a,p=r.edge(f).weight;if(d+=h?p:-p,sn(e,n,u)){var v=e.edge(n,u).cutvalue;d+=h?-v:v}}}),d}s(ur,"calcCutValue");function _e(e,r){arguments.length<2&&(r=e.nodes()[0]),lr(e,{},1,r)}s(_e,"initLowLimValues");function lr(e,r,n,t,o){var a=n,i=e.node(t);return r[t]=!0,l(e.neighbors(t),function(d){Object.prototype.hasOwnProperty.call(r,d)||(n=lr(e,r,n,d,t))}),i.low=a,i.lim=n++,o?i.parent=o:delete i.parent,n}s(lr,"dfsAssignLowLim");function hr(e){return W(e.edges(),function(r){return e.edge(r).cutvalue<0})}s(hr,"leaveEdge");function pr(e,r,n){var t=n.v,o=n.w;r.hasEdge(t,o)||(t=n.w,o=n.v);var a=e.node(t),i=e.node(o),d=a,f=!1;a.lim>i.lim&&(d=i,f=!0);var c=S(r.edges(),function(u){return f===cr(e,e.node(u.v),d)&&f!==cr(e,e.node(u.w),d)});return Y(c,function(u){return A(r,u)})}s(pr,"enterEdge");function mr(e,r,n,t){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(t.v,t.w,{}),_e(e),we(e,r),an(e,r)}s(mr,"exchangeEdges");function an(e,r){var n=W(e.nodes(),function(o){return!r.node(o).parent}),t=ve(e,n);t=t.slice(1),l(t,function(o){var a=e.node(o).parent,i=r.edge(o,a),d=!1;i||(i=r.edge(a,o),d=!0),r.node(o).rank=r.node(a).rank+(d?i.minlen:-i.minlen)})}s(an,"updateRanks");function sn(e,r,n){return e.hasEdge(r,n)}s(sn,"isTreeEdge");function cr(e,r,n){return n.low<=r.lim&&r.lim<=n.lim}s(cr,"isDescendant");function ge(e){switch(e.graph().ranker){case"network-simplex":vr(e);break;case"tight-tree":fn(e);break;case"longest-path":dn(e);break;default:vr(e)}}s(ge,"rank");var dn=H;function fn(e){H(e),ee(e)}s(fn,"tightTreeRanker");function vr(e){B(e)}s(vr,"networkSimplexRanker");function wr(e){var r=I(e,"root",{},"_root"),n=cn(e),t=N(T(n))-1,o=2*t+1;e.graph().nestingRoot=r,l(e.edges(),function(i){e.edge(i).minlen*=o});var a=un(e)+1;l(e.children(),function(i){_r(e,r,o,a,t,n,i)}),e.graph().nodeRankFactor=o}s(wr,"run");function _r(e,r,n,t,o,a,i){var d=e.children(i);if(!d.length){i!==r&&e.setEdge(r,i,{weight:0,minlen:n});return}var f=ce(e,"_bt"),c=ce(e,"_bb"),u=e.node(i);e.setParent(f,i),u.borderTop=f,e.setParent(c,i),u.borderBottom=c,l(d,function(h){_r(e,r,n,t,o,a,h);var p=e.node(h),v=p.borderTop?p.borderTop:h,_=p.borderBottom?p.borderBottom:h,w=p.borderTop?t:2*t,m=v!==_?1:o-a[i]+1;e.setEdge(f,v,{weight:w,minlen:m,nestingEdge:!0}),e.setEdge(_,c,{weight:w,minlen:m,nestingEdge:!0})}),e.parent(i)||e.setEdge(r,f,{weight:0,minlen:o+a[i]})}s(_r,"dfs");function cn(e){var r={};function n(t,o){var a=e.children(t);a&&a.length&&l(a,function(i){n(i,o+1)}),r[t]=o}return s(n,"dfs"),l(e.children(),function(t){n(t,1)}),r}s(cn,"treeDepths");function un(e){return G(e.edges(),function(r,n){return r+e.edge(n).weight},0)}s(un,"sumWeights");function gr(e){var r=e.graph();e.removeNode(r.nestingRoot),delete r.nestingRoot,l(e.edges(),function(n){var t=e.edge(n);t.nestingEdge&&e.removeEdge(n)})}s(gr,"cleanup");function yr(e,r,n){var t={},o;l(n,function(a){for(var i=e.parent(a),d,f;i;){if(d=e.parent(i),d?(f=t[d],t[d]=i):(f=o,o=i),f&&f!==i){r.setEdge(f,i);return}i=d}})}s(yr,"addSubgraphConstraints");function br(e,r,n){var t=hn(e),o=new x({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(a){return e.node(a)});return l(e.nodes(),function(a){var i=e.node(a),d=e.parent(a);(i.rank===r||i.minRank<=r&&r<=i.maxRank)&&(o.setNode(a),o.setParent(a,d||t),l(e[n](a),function(f){var c=f.v===a?f.w:f.v,u=o.edge(c,a),h=k(u)?0:u.weight;o.setEdge(c,a,{weight:e.edge(f).weight+h})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&o.setNode(a,{borderLeft:i.borderLeft[r],borderRight:i.borderRight[r]}))}),o}s(br,"buildLayerGraph");function hn(e){for(var r;e.hasNode(r=U("_root")););return r}s(hn,"createRootNode");function Er(e,r){for(var n=0,t=1;t<r.length;++t)n+=pn(e,r[t-1],r[t]);return n}s(Er,"crossCount");function pn(e,r,n){for(var t=ae(n,b(n,function(c,u){return u})),o=O(b(r,function(c){return P(b(e.outEdges(c),function(u){return{pos:t[u.w],weight:e.edge(u).weight}}),"pos")})),a=1;a<n.length;)a<<=1;var i=2*a-1;a-=1;var d=b(new Array(i),function(){return 0}),f=0;return l(o.forEach(function(c){var u=c.pos+a;d[u]+=c.weight;for(var h=0;u>0;)u%2&&(h+=d[u+1]),u=u-1>>1,d[u]+=c.weight;f+=c.weight*h})),f}s(pn,"twoLayerCrossCount");function xr(e){var r={},n=S(e.nodes(),function(d){return!e.children(d).length}),t=N(b(n,function(d){return e.node(d).rank})),o=b(L(t+1),function(){return[]});function a(d){if(!K(r,d)){r[d]=!0;var f=e.node(d);o[f.rank].push(d),l(e.successors(d),a)}}s(a,"dfs");var i=P(n,function(d){return e.node(d).rank});return l(i,a),o}s(xr,"initOrder");function kr(e,r){return b(r,function(n){var t=e.inEdges(n);if(t.length){var o=G(t,function(a,i){var d=e.edge(i),f=e.node(i.v);return{sum:a.sum+d.weight*f.order,weight:a.weight+d.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:n}})}s(kr,"barycenter");function Nr(e,r){var n={};l(e,function(o,a){var i=n[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:a};k(o.barycenter)||(i.barycenter=o.barycenter,i.weight=o.weight)}),l(r.edges(),function(o){var a=n[o.v],i=n[o.w];!k(a)&&!k(i)&&(i.indegree++,a.out.push(n[o.w]))});var t=S(n,function(o){return!o.indegree});return mn(t)}s(Nr,"resolveConflicts");function mn(e){var r=[];function n(a){return function(i){i.merged||(k(i.barycenter)||k(a.barycenter)||i.barycenter>=a.barycenter)&&vn(a,i)}}s(n,"handleIn");function t(a){return function(i){i.in.push(a),--i.indegree===0&&e.push(i)}}for(s(t,"handleOut");e.length;){var o=e.pop();r.push(o),l(o.in.reverse(),n(o)),l(o.out,t(o))}return b(S(r,function(a){return!a.merged}),function(a){return z(a,["vs","i","barycenter","weight"])})}s(mn,"doResolveConflicts");function vn(e,r){var n=0,t=0;e.weight&&(n+=e.barycenter*e.weight,t+=e.weight),r.weight&&(n+=r.barycenter*r.weight,t+=r.weight),e.vs=r.vs.concat(e.vs),e.barycenter=n/t,e.weight=t,e.i=Math.min(r.i,e.i),r.merged=!0}s(vn,"mergeEntries");function Ir(e,r){var n=Qe(e,function(u){return Object.prototype.hasOwnProperty.call(u,"barycenter")}),t=n.lhs,o=P(n.rhs,function(u){return-u.i}),a=[],i=0,d=0,f=0;t.sort(wn(!!r)),f=Lr(a,o,f),l(t,function(u){f+=u.vs.length,a.push(u.vs),i+=u.barycenter*u.weight,d+=u.weight,f=Lr(a,o,f)});var c={vs:O(a)};return d&&(c.barycenter=i/d,c.weight=d),c}s(Ir,"sort");function Lr(e,r,n){for(var t;r.length&&(t=X(r)).i<=n;)r.pop(),e.push(t.vs),n++;return n}s(Lr,"consumeUnsortable");function wn(e){return function(r,n){return r.barycenter<n.barycenter?-1:r.barycenter>n.barycenter?1:e?n.i-r.i:r.i-n.i}}s(wn,"compareWithBias");function ye(e,r,n,t){var o=e.children(r),a=e.node(r),i=a?a.borderLeft:void 0,d=a?a.borderRight:void 0,f={};i&&(o=S(o,function(_){return _!==i&&_!==d}));var c=kr(e,o);l(c,function(_){if(e.children(_.v).length){var w=ye(e,_.v,n,t);f[_.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&gn(_,w)}});var u=Nr(c,n);_n(u,f);var h=Ir(u,t);if(i&&(h.vs=O([i,h.vs,d]),e.predecessors(i).length)){var p=e.node(e.predecessors(i)[0]),v=e.node(e.predecessors(d)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+p.order+v.order)/(h.weight+2),h.weight+=2}return h}s(ye,"sortSubgraph");function _n(e,r){l(e,function(n){n.vs=O(n.vs.map(function(t){return r[t]?r[t].vs:t}))})}s(_n,"expandSubgraphs");function gn(e,r){k(e.barycenter)?(e.barycenter=r.barycenter,e.weight=r.weight):(e.barycenter=(e.barycenter*e.weight+r.barycenter*r.weight)/(e.weight+r.weight),e.weight+=r.weight)}s(gn,"mergeBarycenters");function Pr(e){var r=ue(e),n=Or(e,L(1,r+1),"inEdges"),t=Or(e,L(r-1,-1,-1),"outEdges"),o=xr(e);Sr(e,o);for(var a=Number.POSITIVE_INFINITY,i,d=0,f=0;f<4;++d,++f){yn(d%2?n:t,d%4>=2),o=j(e);var c=Er(e,o);c<a&&(f=0,i=Me(o),a=c)}Sr(e,i)}s(Pr,"order");function Or(e,r,n){return b(r,function(t){return br(e,t,n)})}s(Or,"buildLayerGraphs");function yn(e,r){var n=new x;l(e,function(t){var o=t.graph().root,a=ye(t,o,n,r);l(a.vs,function(i,d){t.node(i).order=d}),yr(t,n,a.vs)})}s(yn,"sweepLayerGraphs");function Sr(e,r){l(r,function(n){l(n,function(t,o){e.node(t).order=o})})}s(Sr,"assignOrder");function Cr(e){var r=En(e);l(e.graph().dummyChains,function(n){for(var t=e.node(n),o=t.edgeObj,a=bn(e,r,o.v,o.w),i=a.path,d=a.lca,f=0,c=i[f],u=!0;n!==o.w;){if(t=e.node(n),u){for(;(c=i[f])!==d&&e.node(c).maxRank<t.rank;)f++;c===d&&(u=!1)}if(!u){for(;f<i.length-1&&e.node(c=i[f+1]).minRank<=t.rank;)f++;c=i[f]}e.setParent(n,c),n=e.successors(n)[0]}})}s(Cr,"parentDummyChains");function bn(e,r,n,t){var o=[],a=[],i=Math.min(r[n].low,r[t].low),d=Math.max(r[n].lim,r[t].lim),f,c;f=n;do f=e.parent(f),o.push(f);while(f&&(r[f].low>i||d>r[f].lim));for(c=f,f=t;(f=e.parent(f))!==c;)a.push(f);return{path:o.concat(a.reverse()),lca:c}}s(bn,"findPath");function En(e){var r={},n=0;function t(o){var a=n;l(e.children(o),t),r[o]={low:a,lim:n++}}return s(t,"dfs"),l(e.children(),t),r}s(En,"postorder");function xn(e,r){var n={};function t(o,a){var i=0,d=0,f=o.length,c=X(a);return l(a,function(u,h){var p=Nn(e,u),v=p?e.node(p).order:f;(p||u===c)&&(l(a.slice(d,h+1),function(_){l(e.predecessors(_),function(w){var m=e.node(w),g=m.order;(g<i||v<g)&&!(m.dummy&&e.node(_).dummy)&&Rr(n,w,_)})}),d=h+1,i=v)}),a}return s(t,"visitLayer"),G(r,t),n}s(xn,"findType1Conflicts");function kn(e,r){var n={};function t(a,i,d,f,c){var u;l(L(i,d),function(h){u=a[h],e.node(u).dummy&&l(e.predecessors(u),function(p){var v=e.node(p);v.dummy&&(v.order<f||v.order>c)&&Rr(n,p,u)})})}s(t,"scan");function o(a,i){var d=-1,f,c=0;return l(i,function(u,h){if(e.node(u).dummy==="border"){var p=e.predecessors(u);p.length&&(f=e.node(p[0]).order,t(i,c,h,d,f),c=h,d=f)}t(i,c,i.length,f,a.length)}),i}return s(o,"visitLayer"),G(r,o),n}s(kn,"findType2Conflicts");function Nn(e,r){if(e.node(r).dummy)return W(e.predecessors(r),function(n){return e.node(n).dummy})}s(Nn,"findOtherInnerSegmentNode");function Rr(e,r,n){if(r>n){var t=r;r=n,n=t}Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=e[r];Object.defineProperty(o,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}s(Rr,"addConflict");function Ln(e,r,n){if(r>n){var t=r;r=n,n=t}return!!e[r]&&Object.prototype.hasOwnProperty.call(e[r],n)}s(Ln,"hasConflict");function In(e,r,n,t){var o={},a={},i={};return l(r,function(d){l(d,function(f,c){o[f]=f,a[f]=f,i[f]=c})}),l(r,function(d){var f=-1;l(d,function(c){var u=t(c);if(u.length){u=P(u,function(w){return i[w]});for(var h=(u.length-1)/2,p=Math.floor(h),v=Math.ceil(h);p<=v;++p){var _=u[p];a[c]===c&&f<i[_]&&!Ln(n,c,_)&&(a[_]=c,a[c]=o[c]=o[_],f=i[_])}}})}),{root:o,align:a}}s(In,"verticalAlignment");function On(e,r,n,t,o){var a={},i=Sn(e,r,n,o),d=o?"borderLeft":"borderRight";function f(h,p){for(var v=i.nodes(),_=v.pop(),w={};_;)w[_]?h(_):(w[_]=!0,v.push(_),v=v.concat(p(_))),_=v.pop()}s(f,"iterate");function c(h){a[h]=i.inEdges(h).reduce(function(p,v){return Math.max(p,a[v.v]+i.edge(v))},0)}s(c,"pass1");function u(h){var p=i.outEdges(h).reduce(function(_,w){return Math.min(_,a[w.w]-i.edge(w))},Number.POSITIVE_INFINITY),v=e.node(h);p!==Number.POSITIVE_INFINITY&&v.borderType!==d&&(a[h]=Math.max(a[h],p))}return s(u,"pass2"),f(c,i.predecessors.bind(i)),f(u,i.successors.bind(i)),l(t,function(h){a[h]=a[n[h]]}),a}s(On,"horizontalCompaction");function Sn(e,r,n,t){var o=new x,a=e.graph(),i=Tn(a.nodesep,a.edgesep,t);return l(r,function(d){var f;l(d,function(c){var u=n[c];if(o.setNode(u),f){var h=n[f],p=o.edge(h,u);o.setEdge(h,u,Math.max(i(e,c,f),p||0))}f=c})}),o}s(Sn,"buildBlockGraph");function Pn(e,r){return Y(T(r),function(n){var t=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return De(n,function(a,i){var d=Mn(e,i)/2;t=Math.max(a+d,t),o=Math.min(a-d,o)}),t-o})}s(Pn,"findSmallestWidthAlignment");function Cn(e,r){var n=T(r),t=M(n),o=N(n);l(["u","d"],function(a){l(["l","r"],function(i){var d=a+i,f=e[d],c;if(f!==r){var u=T(f);c=i==="l"?t-M(u):o-N(u),c&&(e[d]=V(f,function(h){return h+c}))}})})}s(Cn,"alignCoordinates");function Rn(e,r){return V(e.ul,function(n,t){if(r)return e[r.toLowerCase()][t];var o=P(b(e,t));return(o[1]+o[2])/2})}s(Rn,"balance");function Tr(e){var r=j(e),n=q(xn(e,r),kn(e,r)),t={},o;l(["u","d"],function(i){o=i==="u"?r:T(r).reverse(),l(["l","r"],function(d){d==="r"&&(o=b(o,function(h){return T(h).reverse()}));var f=(i==="u"?e.predecessors:e.successors).bind(e),c=In(e,o,n,f),u=On(e,o,c.root,c.align,d==="r");d==="r"&&(u=V(u,function(h){return-h})),t[i+d]=u})});var a=Pn(e,t);return Cn(t,a),Rn(t,e.graph().align)}s(Tr,"positionX");function Tn(e,r,n){return function(t,o,a){var i=t.node(o),d=t.node(a),f=0,c;if(f+=i.width/2,Object.prototype.hasOwnProperty.call(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":c=-i.width/2;break;case"r":c=i.width/2;break}if(c&&(f+=n?c:-c),c=0,f+=(i.dummy?r:e)/2,f+=(d.dummy?r:e)/2,f+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":c=d.width/2;break;case"r":c=-d.width/2;break}return c&&(f+=n?c:-c),c=0,f}}s(Tn,"sep");function Mn(e,r){return e.node(r).width}s(Mn,"width");function Mr(e){e=$(e),jn(e),Be(Tr(e),function(r,n){e.node(n).x=r})}s(Mr,"position");function jn(e){var r=j(e),n=e.graph().ranksep,t=0;l(r,function(o){var a=N(b(o,function(i){return e.node(i).height}));l(o,function(i){e.node(i).y=t+a/2}),t+=a+n})}s(jn,"positionY");function xe(e,r){var n=r&&r.debugTiming?Ze:$e;n("layout",()=>{var t=n(" buildLayoutGraph",()=>Wn(e));n(" runLayout",()=>Dn(t,n)),n(" updateInputGraph",()=>Bn(e,t))})}s(xe,"layout");function Dn(e,r){r(" makeSpaceForEdgeLabels",()=>qn(e)),r(" removeSelfEdges",()=>nt(e)),r(" acyclic",()=>Ue(e)),r(" nestingGraph.run",()=>wr(e)),r(" rank",()=>ge($(e))),r(" injectEdgeLabelProxies",()=>Hn(e)),r(" removeEmptyRanks",()=>Ke(e)),r(" nestingGraph.cleanup",()=>gr(e)),r(" normalizeRanks",()=>Je(e)),r(" assignRankMinMax",()=>Jn(e)),r(" removeEdgeLabelProxies",()=>Kn(e)),r(" normalize.run",()=>ir(e)),r(" parentDummyChains",()=>Cr(e)),r(" addBorderSegments",()=>rr(e)),r(" order",()=>Pr(e)),r(" insertSelfEdges",()=>tt(e)),r(" adjustCoordinateSystem",()=>tr(e)),r(" position",()=>Mr(e)),r(" positionSelfEdges",()=>ot(e)),r(" removeBorderNodes",()=>rt(e)),r(" normalize.undo",()=>sr(e)),r(" fixupEdgeLabelCoords",()=>$n(e)),r(" undoCoordinateSystem",()=>or(e)),r(" translateGraph",()=>Qn(e)),r(" assignNodeIntersects",()=>Zn(e)),r(" reversePoints",()=>et(e)),r(" acyclic.undo",()=>We(e))}s(Dn,"runLayout");function Bn(e,r){l(e.nodes(),function(n){var t=e.node(n),o=r.node(n);t&&(t.x=o.x,t.y=o.y,r.children(n).length&&(t.width=o.width,t.height=o.height))}),l(e.edges(),function(n){var t=e.edge(n),o=r.edge(n);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)}),e.graph().width=r.graph().width,e.graph().height=r.graph().height}s(Bn,"updateInputGraph");var Xn=["nodesep","edgesep","ranksep","marginx","marginy"],Gn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},An=["acyclicer","ranker","rankdir","align"],Fn=["width","height"],Vn={width:0,height:0},Yn=["minlen","weight","width","height","labeloffset"],zn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Un=["labelpos"];function Wn(e){var r=new x({multigraph:!0,compound:!0}),n=Ee(e.graph());return r.setGraph(q({},Gn,be(n,Xn),z(n,An))),l(e.nodes(),function(t){var o=Ee(e.node(t));r.setNode(t,je(be(o,Fn),Vn)),r.setParent(t,e.parent(t))}),l(e.edges(),function(t){var o=Ee(e.edge(t));r.setEdge(t,q({},zn,be(o,Yn),z(o,Un)))}),r}s(Wn,"buildLayoutGraph");function qn(e){var r=e.graph();r.ranksep/=2,l(e.edges(),function(n){var t=e.edge(n);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(r.rankdir==="TB"||r.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}s(qn,"makeSpaceForEdgeLabels");function Hn(e){l(e.edges(),function(r){var n=e.edge(r);if(n.width&&n.height){var t=e.node(r.v),o=e.node(r.w),a={rank:(o.rank-t.rank)/2+t.rank,e:r};I(e,"edge-proxy",a,"_ep")}})}s(Hn,"injectEdgeLabelProxies");function Jn(e){var r=0;l(e.nodes(),function(n){var t=e.node(n);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,r=N(r,t.maxRank))}),e.graph().maxRank=r}s(Jn,"assignRankMinMax");function Kn(e){l(e.nodes(),function(r){var n=e.node(r);n.dummy==="edge-proxy"&&(e.edge(n.e).labelRank=n.rank,e.removeNode(r))})}s(Kn,"removeEdgeLabelProxies");function Qn(e){var r=Number.POSITIVE_INFINITY,n=0,t=Number.POSITIVE_INFINITY,o=0,a=e.graph(),i=a.marginx||0,d=a.marginy||0;function f(c){var u=c.x,h=c.y,p=c.width,v=c.height;r=Math.min(r,u-p/2),n=Math.max(n,u+p/2),t=Math.min(t,h-v/2),o=Math.max(o,h+v/2)}s(f,"getExtremes"),l(e.nodes(),function(c){f(e.node(c))}),l(e.edges(),function(c){var u=e.edge(c);Object.prototype.hasOwnProperty.call(u,"x")&&f(u)}),r-=i,t-=d,l(e.nodes(),function(c){var u=e.node(c);u.x-=r,u.y-=t}),l(e.edges(),function(c){var u=e.edge(c);l(u.points,function(h){h.x-=r,h.y-=t}),Object.prototype.hasOwnProperty.call(u,"x")&&(u.x-=r),Object.prototype.hasOwnProperty.call(u,"y")&&(u.y-=t)}),a.width=n-r+i,a.height=o-t+d}s(Qn,"translateGraph");function Zn(e){l(e.edges(),function(r){var n=e.edge(r),t=e.node(r.v),o=e.node(r.w),a,i;n.points?(a=n.points[0],i=n.points[n.points.length-1]):(n.points=[],a=o,i=t),n.points.unshift(fe(t,a)),n.points.push(fe(o,i))})}s(Zn,"assignNodeIntersects");function $n(e){l(e.edges(),function(r){var n=e.edge(r);if(Object.prototype.hasOwnProperty.call(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}s($n,"fixupEdgeLabelCoords");function et(e){l(e.edges(),function(r){var n=e.edge(r);n.reversed&&n.points.reverse()})}s(et,"reversePointsForReversedEdges");function rt(e){l(e.nodes(),function(r){if(e.children(r).length){var n=e.node(r),t=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(X(n.borderLeft)),i=e.node(X(n.borderRight));n.width=Math.abs(i.x-a.x),n.height=Math.abs(o.y-t.y),n.x=a.x+n.width/2,n.y=t.y+n.height/2}}),l(e.nodes(),function(r){e.node(r).dummy==="border"&&e.removeNode(r)})}s(rt,"removeBorderNodes");function nt(e){l(e.edges(),function(r){if(r.v===r.w){var n=e.node(r.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:r,label:e.edge(r)}),e.removeEdge(r)}})}s(nt,"removeSelfEdges");function tt(e){var r=j(e);l(r,function(n){var t=0;l(n,function(o,a){var i=e.node(o);i.order=a+t,l(i.selfEdges,function(d){I(e,"selfedge",{width:d.label.width,height:d.label.height,rank:i.rank,order:a+ ++t,e:d.e,label:d.label},"_se")}),delete i.selfEdges})})}s(tt,"insertSelfEdges");function ot(e){l(e.nodes(),function(r){var n=e.node(r);if(n.dummy==="selfedge"){var t=e.node(n.e.v),o=t.x+t.width/2,a=t.y,i=n.x-o,d=t.height/2;e.setEdge(n.e,n.label),e.removeNode(r),n.label.points=[{x:o+2*i/3,y:a-d},{x:o+5*i/6,y:a-d},{x:o+i,y:a},{x:o+5*i/6,y:a+d},{x:o+2*i/3,y:a+d}],n.label.x=n.x,n.label.y=n.y}})}s(ot,"positionSelfEdges");function be(e,r){return V(z(e,r),Number)}s(be,"selectNumberAttrs");function Ee(e){var r={};return l(e,function(n,t){r[t.toLowerCase()]=n}),r}s(Ee,"canonicalize");var jr=s((e,r,n)=>Math.max(r,Math.min(n,e)),"clamp"),Dr=s((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),at=s(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),it=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],st=s((e,r,n,t,o)=>{let a=[],i=new Set;if(n.forEach(({start:u,end:h})=>{u!==t&&i.add(u),h!==t&&i.add(h)}),i.forEach(u=>{let h=e.node(u);typeof h?.x=="number"&&typeof h?.y=="number"&&a.push(h)}),a.length===0&&n.forEach(({edge:u})=>{(u.points??[]).forEach(h=>{typeof h?.x=="number"&&typeof h?.y=="number"&&a.push(h)})}),a.length===0)return Dr(o);let d=a.reduce((u,h)=>({x:u.x+h.x/a.length,y:u.y+h.y/a.length}),{x:0,y:0}),f=d.x-r.x,c=d.y-r.y;return Math.abs(f)>Math.abs(c)?f>0?"right":"left":Math.abs(c)>0?c>0?"bottom":"top":Dr(o)},"getSelfLoopSide"),dt=s((e,r="top",n=0,t=0)=>{let o=e.x,a=e.y-n,i=e.width/2,d=e.height/2,f=Math.max(36,Math.min(100,e.width*.8)),c=jr(Math.max(t,e.width*.35),36,f),u=jr(Math.min(e.width,e.height)*.45,24,48);switch(r){case"bottom":{let h=a+d;return[{x:o-c/2,y:h},{x:o-c/2,y:h+u},{x:o+c/2,y:h+u},{x:o+c/2,y:h}]}case"right":{let h=o+i;return[{x:h,y:a-c/2},{x:h+u,y:a-c/2},{x:h+u,y:a+c/2},{x:h,y:a+c/2}]}case"left":{let h=o-i;return[{x:h,y:a-c/2},{x:h-u,y:a-c/2},{x:h-u,y:a+c/2},{x:h,y:a+c/2}]}case"top":default:{let h=a-d;return[{x:o-c/2,y:h},{x:o-c/2,y:h-u},{x:o+c/2,y:h-u},{x:o+c/2,y:h}]}}},"getSelfLoopPoints"),ft=s((e,r,n="top",t=0,o={})=>{let i=e.x,d=e.y-t,f=o.width??0,c=o.height??0;switch(n){case"bottom":return{x:i,y:Math.max(...r.map(u=>u.y))+c/2+4};case"right":return{x:Math.max(...r.map(u=>u.x))+f/2+4,y:d};case"left":return{x:Math.min(...r.map(u=>u.x))-f/2-4,y:d};case"top":default:return{x:i,y:Math.min(...r.map(u=>u.y))-c/2-4}}},"getSelfLoopLabelPosition"),Xr=s((e,r=0,{mergeSelfLoops:n=!0}={})=>{let t=new Map,o=[],a=e.graph()?.rankdir;return e.edges().forEach(i=>{let d=e.edge(i);if(n&&d.selfLoop){let f=d.selfLoop.id;t.has(f)||t.set(f,[]),t.get(f).push({edge:d,start:i.v,end:i.w})}else o.push({edge:d,start:i.v,end:i.w})}),t.forEach(i=>{if(i.length!==3){i.forEach(g=>o.push(g));return}i.sort((g,R)=>g.edge.selfLoop.order-R.edge.selfLoop.order);let[d,f,c]=i,u=d.edge.originalEdge??f.edge.originalEdge??c.edge.originalEdge??f.edge,h=e.node(u.start);if(!h){i.forEach(g=>o.push(g));return}let p={width:f.edge.width,height:f.edge.height},v=st(e,h,i,u.start,a),_=dt(h,v,r,p.width??0),w=ft(h,_,v,r,p),m={...f.edge,...u,id:u.id,points:_,start:u.start,end:u.end,x:w.x,y:w.y,width:p.width,height:p.height,labelStyle:f.edge.labelStyle,fromCluster:d.edge.fromCluster??f.edge.fromCluster??c.edge.fromCluster,toCluster:d.edge.toCluster??f.edge.toCluster??c.edge.toCluster};delete m.selfLoop,delete m.originalEdge,o.push({edge:m,start:m.start,end:m.end})}),o},"getEdgesToRender"),Gr=s(async({element:e,graph:r,diagramType:n,id:t,parentCluster:o,siteConfig:a})=>{let i=r.graph().rankdir;y.trace("Dir in recursive render - dir:",i);let{clusters:d,edgePaths:f,edgeLabels:c,nodes:u,rootGroups:h}=Ge(e,{edgePathsClass:"edgePaths"});r.nodes()?y.info("Recursive render XXX",r.nodes()):y.info("No nodes found for",r),r.edges().length>0&&y.info("Recursive edges",r.edge(r.edges()[0]));let p=at(n);await Promise.all(r.nodes().map(async function(w){let m=r.node(w);if(o!==void 0){let g=JSON.parse(JSON.stringify(o.clusterData));y.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,w,`
3
+ data=`,g.height,`
4
+ Parent cluster`,o.height),r.setNode(o.id,g),r.parent(w)||(y.trace("Setting parent",w,o.id),r.setParent(w,o.id,g))}if(y.info("(Insert) Node XXX"+w+": "+JSON.stringify(r.node(w))),m?.clusterNode){y.info("Cluster identified XBX",w,m.width,r.node(w));let{ranksep:g,nodesep:R}=r.graph();m.graph.setGraph({...m.graph.graph(),ranksep:g+25,nodesep:R});let ke=await pt({element:u,graph:m.graph,diagramType:n,id:t,parentCluster:r.node(w),siteConfig:a}),Ne=ke.elem;Ie(m,Ne),m.diff=ke.diff||0,y.info("New compound node after recursive render XAX",w,"width",m.width,"height",m.height),Re(Ne,m)}else r.children(w).length>0?(y.trace("Cluster - the non recursive path XBX",w,m.id,m,m.width,"Graph:",r),y.trace(ie(m.id,r)),C.set(m.id,{id:ie(m.id,r),node:m})):(y.trace("Node - the non recursive path XAX",w,u,r.node(w),i),await Ae(u,r.node(w),{config:a,dir:i}))})),await s(async()=>{let w=r.edges().map(async function(m){let g=r.edge(m.v,m.w,m.name);if(y.info("Edge "+m.v+" -> "+m.w+": "+JSON.stringify(m)),y.info("Edge "+m.v+" -> "+m.w+": ",m," ",JSON.stringify(r.edge(m))),y.info("Fix",C,"ids:",m.v,m.w,"Translating: ",C.get(m.v),C.get(m.w)),p&&g.selfLoop){if(g.selfLoop.order!==1)return;let R={...g.originalEdge,...g,id:g.selfLoop.id,startLabelLeft:g.originalEdge?.startLabelLeft??g.startLabelLeft,startLabelRight:g.originalEdge?.startLabelRight??g.startLabelRight,endLabelLeft:g.originalEdge?.endLabelLeft??g.endLabelLeft,endLabelRight:g.originalEdge?.endLabelRight??g.endLabelRight};await ne(c,R),g.width=R.width,g.height=R.height,g.labelStyle=R.labelStyle;return}await ne(c,g)});await Promise.all(w)},"processEdges")();let{subGraphTitleTotalMargin:_}=Oe(a);return{elem:h,graph:r,groups:{clusters:d,edgePaths:f,edgeLabels:c,nodes:u,rootGroups:h},diagramType:n,id:t,mergeSelfLoops:p,subGraphTitleTotalMargin:_}},"measureDagreGraph"),Ar=s(e=>{y.info("############################################# XXX"),y.info("### Layout ### XXX"),y.info("############################################# XXX"),xe(e)},"runDagreGraphLayout"),ct=s((e,r,n)=>{let t=e.node(r);if(!t)return;let o={...t};return t?.clusterNode?o.y=(t.y??0)+n:e.children(r).length>0?o.height=(t.height??0)+n:o.y=(t.y??0)+n/2,o},"normalizeDagreNode"),Br=s((e,r)=>{it.forEach(n=>{r[n]!==void 0&&(e[n]=r[n])})},"applyDagreNodeLayout"),ut=s((e,r,n,t)=>({...e,start:e.start??r,end:e.end??n,points:(e.points??[]).map(o=>({...o,y:typeof o.y=="number"?o.y+t:o.y}))}),"normalizeDagreEdge"),lt=s((e,r)=>{let{graph:n,mergeSelfLoops:t,subGraphTitleTotalMargin:o=0}=r,a=new Map(e.nodes.map(d=>[d.id,d]));Q(n).forEach(d=>{let f=ct(n,d,o);if(!f)return;Br(n.node(d),f);let c=a.get(d);c&&Br(c,f)});let i=o/2;return e.edges=Xr(n,i,{mergeSelfLoops:t}).map(({edge:d,start:f,end:c})=>ut(d,f,c,i)),e},"applyDagreLayoutResult"),ht=s(async({elem:e,graph:r,groups:{clusters:n,edgePaths:t},diagramType:o,id:a,mergeSelfLoops:i,subGraphTitleTotalMargin:d})=>{let f=0;await Promise.all(Q(r).map(async function(h){let p=r.node(h);if(y.info("Position XBX => "+h+": ("+p.x,","+p.y,") width: ",p.width," height: ",p.height),p?.clusterNode)p.y+=d,y.info("A tainted cluster node XBX1",h,p.id,p.width,p.height,p.x,p.y,r.parent(h)),C.get(p.id).node=p,te(p);else if(r.children(h).length>0){y.info("A pure cluster node XBX1",h,p.id,p.x,p.y,p.width,p.height,r.parent(h)),p.height+=d,r.node(p.parentId);let v=p?.padding/2||0,_=p?.labelBBox?.height||0,w=_-v||0;y.debug("OffsetY",w,"labelHeight",_,"halfPadding",v),await Se(n,p),C.get(p.id).node=p}else{let v=r.node(p.parentId);p.y+=d/2,y.info("A regular node XBX1 - using the padding",p.id,"parent",p.parentId,p.width,p.height,p.x,p.y,"offsetY",p.offsetY,"parent",v,v?.offsetY,p),te(p)}}));let c=d/2;return Xr(r,c,{mergeSelfLoops:i}).forEach(function({edge:h,start:p,end:v}){y.info("Edge "+p+" -> "+v+": "+JSON.stringify(h),h),h.points.forEach(g=>g.y+=c);let _=r.node(p),w=r.node(v),m=Ce(t,h,C,o,_,w,a);Pe(h,m)}),r.nodes().forEach(function(h){let p=r.node(h);y.info(h,p.type,p.diff),p.isGroup&&(f=p.diff)}),y.warn("Returning from recursive render XAX",e,f),{elem:e,diff:f}},"paintDagreLayoutCore"),pt=s(async e=>{let r=await Gr(e);return Ar(r.graph),await ht(r)},"renderDagreSubgraph"),Fr=s(e=>{let r=new x({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(n=>{r.setNode(n.id,{...n}),n.parentId&&r.setParent(n.id,n.parentId)}),y.debug("Edges:",e.edges),e.edges.forEach(n=>{if(n.start===n.end){let t=n.start,o=t+"---"+t+"---1",a=t+"---"+t+"---2",i=r.node(t);r.setNode(o,{domId:o,id:o,parentId:i.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(o,i.parentId),r.setNode(a,{domId:a,id:a,parentId:i.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(a,i.parentId);let d=structuredClone(n),f=structuredClone(n),c=structuredClone(n),u=structuredClone(n);f.originalEdge=d,f.selfLoop={id:d.id,order:0},c.originalEdge=d,c.selfLoop={id:d.id,order:1},u.originalEdge=d,u.selfLoop={id:d.id,order:2},f.label="",f.arrowTypeEnd="none",f.endLabelLeft="",f.endLabelRight="",f.startLabelLeft="",f.id=t+"-cyclic-special-1",c.startLabelRight="",c.startLabelLeft="",c.endLabelLeft="",c.endLabelRight="",c.arrowTypeStart="none",c.arrowTypeEnd="none",c.id=t+"-cyclic-special-mid",u.label="",u.startLabelRight="",u.startLabelLeft="",u.arrowTypeStart="none",i.isGroup&&(f.fromCluster=t,u.toCluster=t),u.id=t+"-cyclic-special-2",u.arrowTypeStart="none",r.setEdge(t,o,f,t+"-cyclic-special-0"),r.setEdge(o,a,c,t+"-cyclic-special-1"),r.setEdge(a,t,u,t+"-cyclic-special-2")}else r.setEdge(n.start,n.end,{...n},n.id)}),Fe(r),{graph:r}},"prepareLayoutForDagre"),mt=s(async(e,{element:r,preparedLayout:n})=>{let t=n??Fr(e),o=Le(),a=await Gr({element:r,graph:t.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:o});return t.measuredLayout=a,a},"measureDagreLayout"),vt=s((e,r)=>{let n=r.preparedLayout?.measuredLayout;if(!n)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return Ar(n.graph),lt(e,n),n},"runDagreLayoutCore"),wt=s((e,{measure:r})=>Q(r.graph).map(n=>r.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),_t=s((e,r,{measure:n})=>e?n.graph.node(e):void 0,"getDagreEdgeNode"),ti=Ve({prepareLayout:Fr,measureLayout:mt,runLayoutCore:vt,paintOptions:{clusterDb:C,getNodes:wt,getEdgeNode:_t,skipNode:s((e,{measure:r})=>!r.graph.hasNode(e.id),"skipNode"),isCluster:s((e,{measure:r})=>r.graph.hasNode(e.id)&&(r.graph.children(e.id)??[]).length>0,"isCluster")}});export{lt as applyDagreLayoutResult,Xr as getEdgesToRender,mt as measureDagreLayout,Fr as prepareLayoutForDagre,ti as render,vt as runDagreLayoutCore};
@@ -0,0 +1,3 @@
1
+ import{a as X}from"./chunk-V3KJR4XU.mjs";import{a as K}from"./chunk-Y5O5OPKC.mjs";import"./chunk-3T2MNPEU.mjs";import"./chunk-MLQVGYRW.mjs";import"./chunk-QX7LGXZU.mjs";import"./chunk-22SYA5HA.mjs";import"./chunk-YZG4BXY6.mjs";import"./chunk-NRRTYJAG.mjs";import"./chunk-CVBX6EWK.mjs";import"./chunk-RXM7Z7NK.mjs";import"./chunk-HI3EPXIC.mjs";import"./chunk-5NYYYZGL.mjs";import"./chunk-H7BX327W.mjs";import"./chunk-LIEGGFIX.mjs";import"./chunk-LLWYPJEZ.mjs";import"./chunk-2FTYKNOQ.mjs";import"./chunk-36VM3LGA.mjs";import{f as G}from"./chunk-44AU3KAP.mjs";import{i as y,l as L,o as V}from"./chunk-QADHU5CF.mjs";import"./chunk-ZZ52EIBP.mjs";import{$ as F,B as v,T as A,U as $,V as O,W,X as H,Y as N,Z as j,da as I,j as T,u as w}from"./chunk-FE53TMRB.mjs";import{b as x,h as U}from"./chunk-L2B47AAZ.mjs";import{a}from"./chunk-QVIEFLGF.mjs";var S="position frame",B="frame positioned",P="position relation",M="relation positioned";var Z=a(function(e){x.debug("options str",e)},"setOptions"),ee=a(function(){return{}},"getOptions"),te=a(function(){ne(),A()},"clear");function ne(){R={}}a(ne,"reset");var ie=T.eventmodeling,oe=a(()=>V({...ie,...w().eventmodeling}),"getConfig"),R={};function re(){let e=se,{ast:n}=R,t=_();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,o)=>{let r=xe(i,n.dataEntities,t);e=C(e,{$kind:S,index:o,frame:i,textProps:r});let m;we(i)?(x.debug("source frame",i.sourceFrames),m=n.frames.filter(d=>i.sourceFrames.some(l=>l.$refText===d.name)),m.forEach(d=>{e=C(e,{$kind:P,index:o,frame:i,sourceFrame:d})})):e=C(e,{$kind:P,index:o,frame:i})}),e={...e,sortedSwimlanesArray:z(e.swimlanes)},e}a(re,"getState");function ae(e){R.ast=e}a(ae,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function _(){return s}a(_,"getDiagramProps");var se={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function me(e){let n=e.split(".");if(n.length===2)return n[0]}a(me,"extractNamespace");function de(e){let n=e.split(".");return n.length===2?n[1]:e}a(de,"extractName");function le(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}a(le,"findSwimlaneByNamespace");function D(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{let o=Number.parseInt(i);return o>n&&o<t}).map(i=>Number.parseInt(i)))+1}a(D,"findNextAvailableIndex");function ce(e,n){let t=me(e.entityIdentifier),i=le(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:D(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:D(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:D(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}a(ce,"calculateSwimlaneProps");function ue(e){let{themeVariables:n}=w();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}a(ue,"calculateEntityVisualProps");function xe(e,n,t){let i=w(),o=v(de(e.entityIdentifier)??"",i),r,m={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},l=`<b>${y(o,t.textMaxWidth,m)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=v(r,i),r=y(r,t.textMaxWidth,m),r=r.replaceAll(" ","&nbsp;")),e.dataReference){let b=n.find(E=>E.name===e.dataReference?.$refText);b&&(r=b.dataBlockValue,r=r.substring(r.indexOf(`{
2
+ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=v(r,i),r=y(r,t.textMaxWidth,m),r=r.replaceAll(" ","&nbsp;"),r+="<br/>")}let c=r!==void 0;c&&(l+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);let f={fontSize:m.fontSize,fontWeight:m.fontWeight,fontFamily:m.fontFamily},u=L(l,f),g=c?u.width/3:u.width,p={content:l,width:g,height:u.height};return x.debug(`[${e.name}] ${e.entityIdentifier} text`,p),p}a(xe,"calculateTextProps");function fe(e,n){let t=n,i=ue(t.frame),o={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:B,frame:t.frame,index:t.index,visual:i,dimension:o,textProps:t.textProps}]}a(fe,"decidePositionFrame");function pe(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}a(pe,"calculateX");function ge(e,n){let t=[...e.map(i=>i.r),n];return Math.max(...t)}a(ge,"calculateMaxRight");function z(e){return Object.values(e).sort((n,t)=>n.index-t.index)}a(z,"sortedSwimlanesArray");function be(e,n){let t=n,i=ce(t.frame,e.swimlanes),o;i.index in e.swimlanes?o=e.swimlanes[i.index]:o={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};let r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,m=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,d={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},l=pe(o,m,r),c=l+d.width+s.boxPadding,f=ge(Object.values(e.swimlanes),c);o.r=l+d.width,o.maxHeight=Math.max(o.maxHeight,d.height),o.height=Math.max(s.swimlaneMinHeight,o.maxHeight)+2*s.swimlanePadding;let u={x:l,y:s.swimlanePadding+o.y,r:c,dimension:d,leftSibling:!1,swimlane:o,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},g={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${o.index}`]:o},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:f},p=z(g.swimlanes);p.length>0&&(p[0].y=0);for(let b=1;b<p.length;b++){let E=p[b],k=p[b-1];E.y=k.y+k.height+s.swimlaneGap}return g}a(be,"evolveFramePositioned");function he(e,n){return e===0&&n.sourceFrames.length===0}a(he,"isFirstFrame");function we(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}a(we,"hasSourceFrame");function Y(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}a(Y,"findBoxByFrame");function ve(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){let o=e[i];if(o.swimlane.index!==n)return o}}a(ve,"findBoxByLineIndex");function ye(e,n){let t=n;if(G(t.frame)||he(t.index,t.frame))return[];let i=Y(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let o;return t.sourceFrame?o=Y(e.boxes,t.sourceFrame):o=ve(e.boxes,i.swimlane.index,t.index-1),o===void 0?[]:[{$kind:M,frame:t.frame,index:t.index,sourceBox:o,targetBox:i}]}a(ye,"decidePositionRelation");function Pe(e,n){let t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}a(Pe,"evolveRelationPositioned");var Ee={[S]:fe,[P]:ye},Fe={[B]:be,[M]:Pe};function Se(e,n){let t=Ee[n.$kind];if(t==null)return[];let i=t(e,n);return x.debug("decided events",i),i}a(Se,"decide");function Be(e,n){let t=n.reduce((i,o)=>{let r=Fe[o.$kind];return r==null?i:r(i,o)},e);return x.debug("evolve events",{state:e,newState:t,events:n}),t}a(Be,"evolve");function C(e,n){let t=Se(e,n);return Be(e,t)}a(C,"dispatch");var h={getConfig:oe,setOptions:Z,getOptions:ee,clear:te,setAccTitle:$,getAccTitle:O,getAccDescription:H,setAccDescription:W,setDiagramTitle:N,getDiagramTitle:j,setAst:ae,getDiagramProps:_,getState:re};var q={parse:a(async e=>{let n=await K("eventmodeling",e);x.debug(n),h.setAst(n),X(n,h)},"parse")};var Me=F(),De=Me?.eventmodeling;function Ce(e,n){return t=>{let i=t.swimlane.y+n.swimlanePadding,o=e.append("g").attr("class","em-box");o.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),o.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}a(Ce,"renderD3Box");function Re(e,n){return e>n}a(Re,"dirUpwards");function ke(e,n,t,i){return o=>{let r=o.sourceBox.swimlane.y+n.swimlanePadding,m=o.targetBox.swimlane.y+n.swimlanePadding,d=Re(r,m),l=o.sourceBox.x+o.sourceBox.dimension.width*2/3,c=o.targetBox.x+o.targetBox.dimension.width/3,f,u;x.debug(`rendering relation up=${d} for `,{sourceBox:o.sourceBox,targetBox:o.targetBox}),d?(f=r,u=m+o.targetBox.dimension.height):(f=r+o.sourceBox.dimension.height,u=m);let g=i.emRelationStroke??o.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",o.visual.fill).attr("stroke",g).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${l} ${f} L${c} ${u}`)}}a(ke,"renderD3Relation");function Te(e,n,t,i){return o=>{let r=e.append("g").attr("class","em-swimlane"),m=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",d=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",o.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",o.height).attr("fill",m).attr("stroke",d),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",o.y+30).text(o.label)}}a(Te,"renderD3Swimlane");var Ae=a(function(e,n,t,i){if(x.debug("in eventmodeling renderer",e+`
3
+ `,"id:",n,t),!De)throw new Error("EventModeling config not found");let o=i.db,{themeVariables:r,eventmodeling:m}=F(),d=U(`[id="${n}"]`),l=o.getDiagramProps(),c=o.getState(),f=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";c.sortedSwimlanesArray.forEach(Te(d,c.maxR,l,r)),c.boxes.forEach(Ce(d,l)),c.relations.forEach(ke(d,l,f,r)),d.append("defs").append("marker").attr("id",f).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),I(void 0,d,m?.padding??30,m?.useMaxWidth)},"draw"),J={draw:Ae};var $e=a(e=>"","getStyles"),Q=$e;var lt={parser:q,db:h,renderer:J,styles:Q};export{lt as diagram};
@@ -0,0 +1,24 @@
1
+ import{a as A}from"./chunk-V3KJR4XU.mjs";import{a as j}from"./chunk-Y5O5OPKC.mjs";import"./chunk-3T2MNPEU.mjs";import"./chunk-MLQVGYRW.mjs";import"./chunk-QX7LGXZU.mjs";import"./chunk-22SYA5HA.mjs";import"./chunk-YZG4BXY6.mjs";import"./chunk-NRRTYJAG.mjs";import"./chunk-CVBX6EWK.mjs";import"./chunk-RXM7Z7NK.mjs";import"./chunk-HI3EPXIC.mjs";import"./chunk-5NYYYZGL.mjs";import"./chunk-H7BX327W.mjs";import"./chunk-LIEGGFIX.mjs";import"./chunk-LLWYPJEZ.mjs";import"./chunk-2FTYKNOQ.mjs";import"./chunk-36VM3LGA.mjs";import"./chunk-44AU3KAP.mjs";import{a as E}from"./chunk-S4TE5DX6.mjs";import{o as b}from"./chunk-QADHU5CF.mjs";import"./chunk-ZZ52EIBP.mjs";import{P as x,T as B,U as C,V as S,W as $,X as v,Y as T,Z as W,j as P,u as w}from"./chunk-FE53TMRB.mjs";import{b as h}from"./chunk-L2B47AAZ.mjs";import{a as c}from"./chunk-QVIEFLGF.mjs";var O=P.packet,y=class{constructor(){this.packet=[];this.setAccTitle=C;this.getAccTitle=S;this.setDiagramTitle=T;this.getDiagramTitle=W;this.getAccDescription=v;this.setAccDescription=$}static{c(this,"PacketDB")}getConfig(){let t=b({...O,...w().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){B(),this.packet=[]}};var _=1e4,V=c((e,t)=>{A(e,t);let a=-1,o=[],s=1,{bitsPerRow:l}=t.getConfig();for(let{start:r,end:n,bits:d,label:p}of e.blocks){if(r!==void 0&&n!==void 0&&n<r)throw new Error(`Packet block ${r} - ${n} is invalid. End must be greater than start.`);if(r??=a+1,r!==a+1)throw new Error(`Packet block ${r} - ${n??r} is not contiguous. It should start from ${a+1}.`);if(d===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(n??=r+(d??1)-1,d??=n-r+1,a=n,h.debug(`Packet block ${r} - ${a} with label ${p}`);o.length<=l+1&&t.getPacket().length<_;){let[m,i]=q({start:r,end:n,bits:d,label:p},s,l);if(o.push(m),m.end+1===s*l&&(t.pushWord(o),o=[],s++),!i)break;({start:r,end:n,bits:d,label:p}=i)}}t.pushWord(o)},"populate"),q=c((e,t,a)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*a)return[e,void 0];let o=t*a-1,s=t*a;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:s,end:e.end,label:e.label,bits:e.end-s}]},"getNextFittingBlock"),D={parser:{yy:void 0},parse:c(async e=>{let t=await j("packet",e),a=D.parser?.yy;if(!(a instanceof y))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");h.debug(t),V(t,a)},"parse")};var L=c((e,t,a,o)=>{let s=o.db,l=s.getConfig(),{rowHeight:r,paddingY:n,bitWidth:d,bitsPerRow:p}=l,m=s.getPacket(),i=s.getDiagramTitle(),g=r+n,f=g*(m.length+1)-(i?0:r),k=d*p+2,u=E(t);u.attr("viewBox",`0 0 ${k} ${f}`),x(u,f,k,l.useMaxWidth);for(let[G,R]of m.entries())M(u,R,G,l);u.append("text").text(i).attr("x",k/2).attr("y",f-g/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),M=c((e,t,a,{rowHeight:o,paddingX:s,paddingY:l,bitWidth:r,bitsPerRow:n,showBits:d})=>{let p=e.append("g"),m=a*(o+l)+l;for(let i of t){let g=i.start%n*r+1,f=(i.end-i.start+1)*r-s;if(p.append("rect").attr("x",g).attr("y",m).attr("width",f).attr("height",o).attr("class","packetBlock"),p.append("text").attr("x",g+f/2).attr("y",m+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(i.label),!d)continue;let k=i.end===i.start,u=m-2;p.append("text").attr("x",g+(k?f/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(i.start),k||p.append("text").attr("x",g+f).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(i.end)}},"drawWord"),F={draw:L};var N={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},z=c(({packet:e}={})=>{let t=b(N,e);return`
2
+ .packetByte {
3
+ font-size: ${t.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${t.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${t.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${t.labelColor};
13
+ font-size: ${t.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${t.titleColor};
17
+ font-size: ${t.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${t.blockStrokeColor};
21
+ stroke-width: ${t.blockStrokeWidth};
22
+ fill: ${t.blockFillColor};
23
+ }
24
+ `},"styles");var gt={parser:D,get db(){return new y},renderer:F,styles:z};export{gt as diagram};
@@ -0,0 +1,200 @@
1
+ import{a as Ln}from"./chunk-BOZ75642.mjs";import{a as Fn}from"./chunk-SDIBIOXT.mjs";import{a as In}from"./chunk-R2KH53MI.mjs";import{a as Ut,b as Wt}from"./chunk-GDOATIN3.mjs";import{b as yn,c as Vn}from"./chunk-52IMQVNL.mjs";import"./chunk-MFYRHTYG.mjs";import{h as Sn}from"./chunk-3SEI7E7V.mjs";import"./chunk-JCBDXJ5W.mjs";import"./chunk-OCMJQKYE.mjs";import"./chunk-MNT3HHAC.mjs";import{h as wn}from"./chunk-TECWHJ6D.mjs";import"./chunk-F6PIGZHG.mjs";import"./chunk-JGXDHUYS.mjs";import"./chunk-TINYC7RT.mjs";import"./chunk-TDFULVG6.mjs";import{b as Cn,c as Dn,d as Tn,f as _n}from"./chunk-MIE3LDYP.mjs";import{p as $e,s as It}from"./chunk-QADHU5CF.mjs";import"./chunk-ZZ52EIBP.mjs";import{$ as le,H as pn,T as gn,U as fn,V as bn,W as mn,X as kn,Y as An,Z as En,aa as Gt,b as cn,ba as xn,c as dn,z as hn}from"./chunk-FE53TMRB.mjs";import{b as ne,h as Vt}from"./chunk-L2B47AAZ.mjs";import{a as b}from"./chunk-QVIEFLGF.mjs";var Ze={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},Yn=new Set([Ze.SHAPE_UNSUPPORTED,Ze.SHAPE_REMOVED,Ze.CONTAINMENT_VIOLATION]),oi=new Set(Object.values(Ze).filter(n=>!Yn.has(n)));var Jn=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),qn=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),Xn=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),et="roundedRect";function tt(n){return n&&(Jn.get(n)??n)}b(tt,"resolveShapeAlias");function Mn(n,i){for(let s of n)if(!s.isGroup){if((!s.shape||s.shape==="squareRect"||s.shape==="rect")&&(s.shape=et),qn.has(s.shape)){let r=`shape "${s.shape}" was removed in v0.8.1, using "${et}"`;i?.emitError?i.emitError("SHAPE_REMOVED",r,{nodeId:s.id}):ne.warn(`agentflow: ${r}`),s.shape=et;continue}if(!Xn.has(s.shape)){let r=`shape "${s.shape}" is not supported, using "${et}"`;i?.emitWarning?i.emitWarning("SHAPE_UNSUPPORTED",r,{nodeId:s.id}):ne.warn(`agentflow: ${r}`),s.shape=et}}}b(Mn,"normaliseNodeShapes");var nt=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),vn=nt.size,jt=b(n=>`af-kind-${n}`,"kindClass"),Bn=[...nt.keys()],Kt=b(n=>Math.max(1,n-vn),"containerSlotCount"),zt=b((n,i)=>{let s=vn+n%Kt(i);return i>0?s%i:s},"containerSlot");function Nn(n,i,s){let r=le().themeVariables?.borderColorArray,u=Array.isArray(r)?r.length:0,l=s.size;for(let c of n??[]){if(c.isGroup||c.shape==="collapsedGroup"){let h=s.get(String(c.id))??l++;c.colorIndex=zt(h,u);continue}let a=i(String(c.id));a&&nt.has(a)&&(c.cssClasses=`${c.cssClasses??""} ${jt(a)}`.replace(/\s+/g," ").trim())}}b(Nn,"assignColorSlots");var Rn="agentflow-",Ht=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),Qn=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),Zn={flow:"flowGroup"};function Yt(n){if(Array.isArray(n))return n.map(s=>Yt(s));if(n===null||typeof n!="object")return n;let i={};for(let s of Object.keys(n))s==="__proto__"||s==="constructor"||s==="prototype"||(i[s]=Yt(n[s]));return i}b(Yt,"stripPrototypeKeys");function $n(n){let i=!1,s=!1,r=0,u,l=[];for(let c of n.split(`
2
+ `)){if(u!==void 0){let p=c.length-c.trimStart().length;if(c.trim()===""||p>u){l.push(c);continue}u=void 0}let a=-1;for(let p=0;p<c.length;p++){let A=c[p];if(s)A==="\\"?p++:A==='"'&&(s=!1);else if(i)A==="'"&&(i=!1);else if(A==='"')s=!0;else if(A==="'")i=!0;else if(A==="#"&&(p===0||c[p-1]===" "||c[p-1]===" ")){a=p;break}else A==="["||A==="{"?r++:(A==="]"||A==="}")&&(r=Math.max(0,r-1))}if(i||s||r>0){l.push(c);continue}let h=a>=0?c.slice(0,a):c,f=a>=0?c.slice(a):"";if(/:\s*[>|][\d+-]*\s*$/.test(h)){u=c.length-c.trimStart().length,l.push(c);continue}l.push(h.replace(/,([\t ]*)$/,"$1")+f)}return l.join(`
3
+ `)}b($n,"stripLineTrailingCommas");var Lt=class{constructor(){this.vertexCounter=0;this.config=le();this.vertices=new Map;this.edges=[];this.classes=new Map;this.subGraphs=[];this.subGraphLookup=new Map;this.globalNodes=new Set;this.connectors=new Map;this.tooltips=new Map;this.subCount=0;this.firstGraphFlag=!0;this.secCount=-1;this.posCrossRef=[];this.diagramId="";this.preserveCommentsWhenParsing=!0;this.frontmatterLineOffset=0;this.elementMappings=[];this.bareVertexMappings=new WeakSet;this.diagnostics=[];this.postParseValidationRun=!1;this.funs=[];this.setAccTitle=fn;this.setAccDescription=mn;this.setDiagramTitle=An;this.getAccTitle=bn;this.getAccDescription=kn;this.getDiagramTitle=En;this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"AgentFlowDB")}sanitizeText(i){return pn.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(let s of this.vertices.values())if(s.id===i)return this.diagramId?`${this.diagramId}-${s.domId}`:s.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,s,r,u,l,c,a={},h,f){if(!i||i.trim().length===0)return;let p;if(h!==void 0){let m;h.includes(`
4
+ `)?m=h+`
5
+ `:m=`{
6
+ `+h+`
7
+ }`;try{p=Wt(m,{schema:Ut})??{}}catch(d){let g=h.includes(`
8
+ `)?$n(h):h;if(g!==h)try{p=Wt(g+`
9
+ `,{schema:Ut})??{}}catch{this.rethrowMetadataYamlError(d,h,f)}else this.rethrowMetadataYamlError(d,h,f)}p=Yt(p)}let A;if(p&&typeof p.shape=="string"){let m=p;A=m.shape;let d=tt(A);d&&d!==A&&(m.shape=d)}let C=this.subGraphLookup.get(i);if(C&&p){C.metadata={...C.metadata,...p};return}let I=this.connectors.get(i);if(I&&p){I.metadata={...I.metadata,...p};return}if(i==="connectors")return;let x=this.edges.find(m=>m.id===i);if(x){let m=p;m?.animate!==void 0&&(x.animate=m.animate),m?.animation!==void 0&&(x.animation=m.animation),m?.curve!==void 0&&(x.interpolate=m.curve),p&&(x.metadata={...x.metadata,...p});return}let M,D=this.vertices.get(i);if(D===void 0&&(D={id:i,labelType:"text",domId:Rn+i+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(i,D)),this.vertexCounter++,s!==void 0?(this.config=le(),M=this.sanitizeText(s.text.trim()),D.labelType=s.type,M.startsWith('"')&&M.endsWith('"')&&(M=M.substring(1,M.length-1)),D.text=M):D.text===void 0&&(D.text=i),r!==void 0&&(D.type=r),u?.forEach(m=>{D.styles.push(m)}),l?.forEach(m=>{D.classes.push(m)}),c!==void 0&&(D.dir=c),D.props===void 0?D.props=a:a!==void 0&&Object.assign(D.props,a),p){if(D.metadata={...D.metadata,...p},p.shape){let m=A??p.shape;if(typeof m!="string")throw this.positionedShapeError(`No such shape: ${JSON.stringify(m)}.`,f);if(m!==m.toLowerCase()||m.includes("_"))throw this.positionedShapeError(`No such shape: ${m}. Shape names should be lowercase.`,f);if(!wn(p.shape))throw this.positionedShapeError(`No such shape: ${p.shape}.`,f);D.type=p?.shape}p?.label&&(D.text=this.sanitizeText(p.label),D.labelType=this.sanitizeNodeLabelType(p?.labelType))}}positionedShapeError(i,s){let r=new Error(i);if(!s)return r;let u=s.first_line+this.frontmatterLineOffset;return Object.assign(r,{hash:{text:"",token:null,line:u-1,loc:{first_line:u,last_line:s.last_line+this.frontmatterLineOffset,first_column:s.first_column,last_column:s.last_column},expected:[]}}),r}rethrowMetadataYamlError(i,s,r){let u=i;if(!u||u.name!=="YAMLException"||!u.mark||!r)throw i;let l;try{let c=!s.includes(`
10
+ `),a=c?`{
11
+ `+s+`
12
+ }`:s+`
13
+ `,h=r.first_line+this.frontmatterLineOffset,f=r.first_column+2,p=b((m,d)=>c?{line:h,column:f+(m===1?d:0)}:{line:h+m,column:m===0?f+d:d},"toSource"),A=p(u.mark.line,u.mark.column),C=u.reason??(u.message??"").split(`
14
+ `)[0].replace(/\s*\(\d+:\d+\)\s*$/,""),I=a.split(`
15
+ `),x=[];if(c)x.push(1);else for(let m=u.mark.line-1;m<=u.mark.line+1;m++)m<0||m>=I.length||m===I.length-1&&I[m]===""&&m!==u.mark.line||x.push(m);let M=Math.max(...x.map(m=>String(p(m,0).line).length)),D=[];for(let m of x){let d=p(m,0).line,g=` ${String(d).padStart(M)} | `;D.push(g+I[m].replace(/\t/g,"\u2192")),m===u.mark.line&&D.push("-".repeat(g.length+u.mark.column)+"^")}l={message:`${C} (${A.line}:${A.column+1})
16
+
17
+ ${D.join(`
18
+ `)}`,markLine:A.line-1,markColumn:A.column,hash:{text:"",token:null,line:A.line-1,loc:{first_line:A.line,last_line:A.line,first_column:A.column,last_column:A.column+1},expected:[]}}}catch{}throw l&&(u.message=l.message,u.mark.line=l.markLine,u.mark.column=l.markColumn,u.hash=l.hash),u}addSingleLink(i,s,r,u){let a={start:i,end:s,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ne.info("abc78 Got edge...",a);let h=r.text;if(h!==void 0&&(a.text=this.sanitizeText(h.text.trim()),a.text.startsWith('"')&&a.text.endsWith('"')&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=this.sanitizeNodeLabelType(h.type)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length,r.edgeSemantic&&(a.edgeSemantic=r.edgeSemantic)),u&&!this.edges.some(f=>f.id===u))a.id=u,a.isUserDefinedId=!0;else{let f=this.edges.filter(p=>p.start===a.start&&p.end===a.end);f.length===0?a.id=It(a.start,a.end,{counter:0,prefix:"L"}):a.id=It(a.start,a.end,{counter:f.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ne.info("Pushing edge..."),this.edges.push(a);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
19
+
20
+ Initialize mermaid with maxEdges set to a higher number to allow more edges.
21
+ You cannot set this config via configuration inside the diagram as it is a secure config.
22
+ You have to call mermaid.initialize.`)}isLinkData(i){return i!==null&&typeof i=="object"&&"id"in i&&typeof i.id=="string"}addLink(i,s,r){let u=this.isLinkData(r)?r.id.replace("@",""):void 0;ne.info("addLink",i,s,u);for(let l of i)for(let c of s){let a=l===i[i.length-1],h=c===s[0];a&&h?this.addSingleLink(l,c,r,u):this.addSingleLink(l,c,r,void 0)}}updateLinkInterpolate(i,s){i.forEach(r=>{if(r==="default"){this.edges.defaultInterpolate=s;return}if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[r].interpolate=s})}updateLink(i,s){i.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=s:(this.edges[r].style=s,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(u=>u?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(i,s){let r=s.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");i.split(",").forEach(u=>{let l=this.classes.get(u);l===void 0&&(l={id:u,styles:[],textStyles:[]},this.classes.set(u,l)),r?.forEach(c=>{if(/color/.exec(c)){let a=c.replace("fill","bgFill");l.textStyles.push(a)}l.styles.push(c)})})}setDirection(i){this.direction=i.trim(),/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(i,s){for(let r of i.split(",")){let u=this.vertices.get(r);u&&u.classes.push(s);let l=this.edges.find(a=>a.id===r);l&&l.classes.push(s);let c=this.subGraphLookup.get(r);c&&c.classes.push(s)}}setTooltip(i,s){if(s!==void 0){s=this.sanitizeText(s);for(let r of i.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,s)}}setClickFun(i,s,r){if(le().securityLevel!=="loose"||s===void 0)return;let u=[];if(typeof r=="string"){u=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let c=0;c<u.length;c++){let a=u[c].trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.substr(1,a.length-2)),u[c]=a}}u.length===0&&u.push(i);let l=this.vertices.get(i);l&&(l.haveCallback=!0,this.funs.push(()=>{let c=this.lookUpDomId(i),a=document.querySelector(`[id="${c}"]`);a!==null&&a.addEventListener("click",()=>{$e.runFunc(s,...u)},!1)}))}setLink(i,s,r){i.split(",").forEach(u=>{let l=this.vertices.get(u);l!==void 0&&(l.link=$e.formatUrl(s,this.config),l.linkTarget=r)}),this.setClass(i,"clickable")}getTooltip(i){return this.tooltips.get(i)}setClickEvent(i,s,r){i.split(",").forEach(u=>{this.setClickFun(u,s,r)}),this.setClass(i,"clickable")}bindFunctions(i){this.funs.forEach(s=>{s(i)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(i){return Qn.has(i.type)}getTools(){let i=[];for(let s of this.vertices.values())this.isToolDefinition(s)&&i.push(s);return i}getClasses(){return this.classes}setupToolTips(i){let s=Sn();Vt(i).select("svg").selectAll("g.node").on("mouseover",l=>{let c=Vt(l.currentTarget),a=c.attr("title");if(a===null)return;let h=l.currentTarget?.getBoundingClientRect();s.transition().duration(200).style("opacity",".9"),s.text(c.attr("title")).style("left",window.scrollX+h.left+(h.right-h.left)/2+"px").style("top",window.scrollY+h.bottom+"px"),s.html(hn.sanitize(a)),c.classed("hover",!0)}).on("mouseout",l=>{s.transition().duration(500).style("opacity",0),Vt(l.currentTarget).classed("hover",!1)})}clear(i="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=i,this.config=le(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,gn()}setGen(i){this.version=i||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(i,s,r,u){let l=i?.text?.trim(),c=r?.text;i===r&&r?.text&&/\s/.exec(r.text)&&(l=void 0);let h=b(x=>{let M={boolean:{},number:{},string:{}},D=[],m;return{nodeList:x.filter(function(g){let L=typeof g;return g.stmt&&g.stmt==="dir"?(m=g.value,!1):g.trim()===""?!1:L in M?M[L].hasOwnProperty(g)?!1:M[L][g]=!0:D.includes(g)?!1:D.push(g)}),dir:m}},"uniq")(s.flat()),f=h.nodeList,p=h.dir,A=le().flowchart??{};if(p=p??(A.inheritDir?this.getDirection()??le().direction??void 0:void 0),this.version==="gen-1")for(let x=0;x<f.length;x++)f[x]=this.lookUpDomId(f[x]);l=l??"subGraph"+this.subCount,c=c||"",c=this.sanitizeText(c),this.subCount=this.subCount+1;let C={id:l,nodes:f.filter(x=>x!==l&&!this.globalNodes.has(x)),title:c.trim(),classes:[],dir:p,labelType:this.sanitizeNodeLabelType(r?.type),type:u??"flow"};ne.info("Adding",C.id,C.nodes,C.dir),C.nodes=this.makeUniq(C,this.subGraphs).nodes;let I=this.getPosForId(l);if(I!==-1){let x=this.subGraphs[I];for(let M of C.nodes)x.nodes.includes(M)||x.nodes.push(M);C.title&&(x.title=C.title),C.dir&&(x.dir=C.dir),C.type&&(x.type=C.type),this.subGraphLookup.set(l,x)}else this.subGraphs.push(C),this.subGraphLookup.set(l,C);return l}addGlobal(i){for(let s of i.flat()){if(typeof s!="string")continue;let r=s.trim();r!==""&&this.globalNodes.add(r)}for(let s of this.subGraphs)s.nodes=s.nodes.filter(r=>!this.globalNodes.has(r))}getPosForId(i){for(let[s,r]of this.subGraphs.entries())if(r.id===i)return s;return-1}indexNodes2(i,s){let r=this.subGraphs[s].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=s,this.subGraphs[s].id===i)return{result:!0,count:0};let u=0,l=1;for(;u<r.length;){let c=this.getPosForId(r[u]);if(c>=0){let a=this.indexNodes2(i,c);if(a.result)return{result:!0,count:l+a.count};l=l+a.count}u=u+1}return{result:!1,count:l}}getDepthFirstPos(i){return this.posCrossRef[i]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}addConnector(i,s){let r=i?.text?.trim();if(!r)return"";let u=s?.text?.trim()??"",l=u.length>0?this.sanitizeText(u):r,c=this.connectors.get(r);return c?u.length>0&&(c.text=l):(c={id:r,labelType:"text",domId:Rn+r+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:l},this.connectors.set(r,c),this.vertices.set(r,c),this.vertexCounter++),r}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(i,s){if(i==="arrow_point"&&s==="normal")return"sequence";if(i==="arrow_cross"&&s==="normal")return"failure";if(i==="arrow_open"&&s==="dotted")return"reference"}destructStartLink(i){let s=i.trim(),r="arrow_open",u="normal";return s.includes(".")&&(u="dotted"),{type:r,stroke:u}}countChar(i,s){let r=s.length,u=0;for(let l=0;l<r;++l)s[l]===i&&++u;return u}destructEndLink(i){let s=i.trim(),r=s.slice(0,-1),u="arrow_open";switch(s.slice(-1)){case"x":u="arrow_cross";break;case">":u="arrow_point";break;case"-":case".":u="arrow_open",r=s;break}let l="normal",c=r.length-1,a=this.countChar(".",r);return a>0&&(l="dotted",c=a),{type:u,stroke:l,length:c}}destructLink(i,s){let r=this.destructEndLink(i),u;return s?(u=this.destructStartLink(s),u.stroke!==r.stroke?{type:"INVALID",stroke:"INVALID"}:(u.type=r.type,u.length=r.length,{...u,edgeSemantic:this.computeEdgeSemantic(u.type,u.stroke)})):{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}}exists(i,s){for(let r of i)if(r.nodes.includes(s))return!0;return!1}makeUniq(i,s){let r=[];return i.nodes.forEach((u,l)=>{this.exists(s,u)||r.push(i.nodes[l])}),{nodes:r}}getTypeFromVertex(i){let s=typeof i.type=="string"?tt(i.type):i.type;switch(s){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return s}}findNode(i,s){return i.find(r=>r.id===s)}destructEdgeType(i){let s="none",r="arrow_point";switch(i){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":r=i;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":s=i.replace("double_",""),r=s;break}return{arrowTypeStart:s,arrowTypeEnd:r}}addNodeFromVertex(i,s,r,u,l,c){let a=r.get(i.id),h=u.get(i.id)??!1,f=this.findNode(s,i.id);if(f)f.cssStyles=i.styles,f.cssCompiledStyles=this.getCompiledStyles(i.classes),f.cssClasses=i.classes.join(" ");else{let p={id:i.id,label:i.text,labelType:i.labelType,labelStyle:"",parentId:a,padding:l.flowchart?.padding||8,cssStyles:i.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...i.classes]),cssClasses:"default "+i.classes.join(" "),dir:i.dir,domId:i.domId,look:c,link:i.link,linkTarget:i.linkTarget,tooltip:this.getTooltip(i.id),metadata:i.metadata};h?s.push({...p,isGroup:!0,shape:"rect"}):s.push({...p,isGroup:!1,shape:this.getTypeFromVertex(i),wrappingWidth:l.agentflow?.wrappingWidth,minWidth:l.agentflow?.minNodeWidth})}}getCompiledStyles(i){let s=[];for(let r of i){let u=this.classes.get(r);u?.styles&&(s=[...s,...u.styles??[]].map(l=>l.trim())),u?.textStyles&&(s=[...s,...u.textStyles??[]].map(l=>l.trim()))}return s}runPostParseValidators(){this.postParseValidationRun||(this.postParseValidationRun=!0)}getData(){this.runPostParseValidators();let i=le(),s=[],r=[],u=this.getSubGraphs(),l=new Map,c=new Map,a=new Set,h=new Map,f=b((d,g,L=new Set)=>{if(L.has(d))return;L.add(d);let R=this.subGraphLookup.get(d);if(R)for(let ie of R.nodes)ie===g||L.has(ie)||(a.add(ie),h.set(ie,g),f(ie,g,L))},"collectDescendants");for(let d of u)d.metadata?.view==="collapsed"&&!a.has(d.id)&&f(d.id,d.id);let p=b((d,g)=>{let L=new Set,R=g;for(;R!==void 0&&!L.has(R);){if(R===d)return!0;L.add(R),R=l.get(R)}return!1},"wouldCloseContainmentCycle");for(let d=u.length-1;d>=0;d--){let g=u[d];if(!a.has(g.id)){g.nodes.length>0&&c.set(g.id,!0);for(let L of g.nodes){if(p(L,g.id)){this.emitWarning(Ze.CONTAINMENT_VIOLATION,`Container "${g.id}" cannot contain "${L}" because "${L}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:L});continue}l.set(L,g.id)}}}for(let d=u.length-1;d>=0;d--){let g=u[d];if(a.has(g.id))continue;if(g.metadata?.view==="collapsed"){let R={...g.metadata,containerType:g.type};s.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:l.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:"collapsedGroup",dir:g.dir,isGroup:!1,look:i.look,metadata:R})}else s.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:l.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:Zn[g.type??"flow"],dir:g.dir,isGroup:!0,look:i.look,metadata:g.metadata})}this.getVertices().forEach(d=>{a.has(d.id)||this.addNodeFromVertex(d,s,l,c,i,i.look||"classic")});let C=this.getEdges();C.forEach((d,g)=>{let L=h.get(d.start)??d.start,R=h.get(d.end)??d.end;if(L===R&&d.start!==d.end)return;let{arrowTypeStart:ie,arrowTypeEnd:he}=this.destructEdgeType(d.type),ce=[...C.defaultStyle??[]];d.style&&ce.push(...d.style);let O={id:It(L,R,{counter:g,prefix:"L"},d.id),isUserDefinedId:d.isUserDefinedId,start:L,end:R,type:d.type??"normal",label:d.text,labelType:d.labelType,labelpos:"c",thickness:d.stroke,minlen:d.length,classes:d?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:d?.stroke==="invisible"||d?.type==="arrow_open"?"none":ie,arrowTypeEnd:d?.stroke==="invisible"||d?.type==="arrow_open"?"none":he,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(d.classes),labelStyle:ce,style:ce,pattern:d.stroke,look:i.look,animate:d.animate,animation:d.animation,curve:d.interpolate||this.edges.defaultInterpolate||i.flowchart?.curve,metadata:d.metadata};r.push(O)}),Mn(s,this);let I=new Map,x=new Map;for(let d of u){let g=l.get(d.id);g!==void 0&&x.set(g,[...x.get(g)??[],d.id])}let M=0,D=b(d=>{if(!I.has(d)){I.set(d,M++);for(let g of x.get(d)??[])D(g)}},"walkContainers");for(let d of u)l.get(d.id)===void 0&&D(d.id);let m=new Set(this.getConnectors().map(d=>d.id));return Nn(s,d=>{if(m.has(d))return"connector";let g=this.vertices.get(d);return g?this.deriveVertexKind(g,tt(g.type)):void 0},I),{nodes:s,edges:r,other:{},config:i,connectors:this.getConnectors()}}defaultConfig(){return xn.flowchart}deriveVertexKind(i,s){return this.isToolDefinition(i)?"tool":s==="hexagon"||s==="hex"?"action":s==="lean-right"||s==="lean_right"?"input":s==="lin-doc"||s==="lined-document"?"refdoc":s==="diamond"?"decision":"task"}getSemanticModel(){this.runPostParseValidators();let i=new Set(this.subGraphs.map(a=>a.id)),s=[],r=[];for(let[a,h]of this.vertices){if(i.has(a))continue;if(h.isConnector){let A={id:a};if(h.text!==void 0&&h.text!==a&&(A.title=h.text),h.metadata&&Object.keys(h.metadata).length>0){let C={};for(let[I,x]of Object.entries(h.metadata))Ht.has(I)||(C[I]=x);Object.keys(C).length>0&&(A.metadata=C)}r.push(A);continue}let f={id:a};h.text!==void 0&&(f.label=h.text);let p=typeof h.type=="string"?tt(h.type):h.type;if(p!==void 0&&(f.shape=p),f.vertexKind=this.deriveVertexKind(h,p),h.metadata&&Object.keys(h.metadata).length>0){let A={};for(let[C,I]of Object.entries(h.metadata))Ht.has(C)||(A[C]=I);Object.keys(A).length>0&&(f.metadata=A)}s.push(f)}let u=this.edges.map(a=>{let h={start:a.start,end:a.end};return a.id!==void 0&&(h.id=a.id),typeof a.text=="string"&&a.text.length>0&&(h.label=a.text),a.type!==void 0&&(h.type=a.type),a.stroke!==void 0&&(h.stroke=a.stroke),a.edgeSemantic!==void 0&&(h.edgeSemantic=a.edgeSemantic),a.length!==void 0&&(h.length=a.length),a.metadata&&Object.keys(a.metadata).length>0&&(h.metadata={...a.metadata}),h}),l=this.subGraphs.map(a=>{let h={id:a.id,nodes:[...a.nodes]};if(a.type!==void 0&&(h.type=a.type),a.title!==void 0&&(h.title=a.title),a.dir!==void 0&&(h.direction=a.dir),a.metadata&&Object.keys(a.metadata).length>0){let f={};for(let[p,A]of Object.entries(a.metadata))Ht.has(p)||(f[p]=A);Object.keys(f).length>0&&(h.metadata=f)}return h}),c={vertices:s,edges:u,subGraphs:l,connectors:r,diagnostics:this.diagnostics};return this.direction!==void 0&&(c.direction=this.direction),c}setFrontmatterLineOffset(i){this.frontmatterLineOffset=i??0}toElementPosition(i){let s=i?.first_line??0,r=i?.first_column??0,u=i?.last_line??s,l=i?.last_column??r,[c,a]=i?.range??[0,0];return{startLine:s+this.frontmatterLineOffset,startColumn:r,endLine:u+this.frontmatterLineOffset,endColumn:l,startIndex:c,endIndex:a}}pushMapping(i,s,r){if(!i)return;let u={id:i,type:s,position:this.toElementPosition(r)};return this.elementMappings.push(u),u}addVertexMapping(i,s,r,u){let l=this.pushMapping(i,"vertex",u);l&&r==null&&this.bareVertexMappings.add(l)}extendVertexMapping(i,s){if(!i||!s)return;let r=this.toElementPosition(s);for(let u=this.elementMappings.length-1;u>=0;u--){let l=this.elementMappings[u];if(l.type==="vertex"&&l.id===i){this.bareVertexMappings.has(l)&&(l.type="attachment",this.bareVertexMappings.delete(l)),(r.endLine>l.position.endLine||r.endLine===l.position.endLine&&r.endColumn>l.position.endColumn)&&(l.position.endLine=r.endLine,l.position.endColumn=r.endColumn,l.position.endIndex=r.endIndex);return}}this.pushMapping(i,"attachment",s)}addEdgeMapping(i,s,r,u){let l=Array.isArray(s)?s.map(a=>typeof a=="string"?a:a?.id??"").filter(Boolean):[],c=l.length>0?l.join(">"):"edge";this.pushMapping(c,"edge",u)}addSubgraphMapping(i,s,r,u){let l=(typeof i=="string"?i:i?.text)??"",c=this.toElementPosition(r),a=u?this.toElementPosition(u):c;l&&this.elementMappings.push({id:l,type:"subgraph",position:{startLine:c.startLine,startColumn:c.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:c.startIndex,endIndex:a.endIndex}})}addConnectorMapping(i,s,r,u){let l=i?.text?.trim()??"";if(!l)return;let c=this.toElementPosition(r),a=u?this.toElementPosition(u):c;this.elementMappings.push({id:l,type:"connector",position:{startLine:c.startLine,startColumn:c.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:c.startIndex,endIndex:a.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(i){return this.elementMappings.find(s=>s.id===i)}getElementsOnLine(i){return this.elementMappings.filter(s=>i>=s.position.startLine&&i<=s.position.endLine)}getElementAtPosition(i,s){let r=this.elementMappings.filter(l=>{let{startLine:c,startColumn:a,endLine:h,endColumn:f}=l.position;return!(i<c||i>h||i===c&&s<a||i===h&&s>f)});if(r.length===0)return;let u=b(({position:l})=>[l.endLine-l.startLine,l.endColumn-l.startColumn],"span");return r.reduce((l,c)=>{let[a,h]=u(l),[f,p]=u(c);return f!==a?f<a?c:l:p<h?c:l})}getMappingStats(){let i=0,s=0,r=0,u=0,l=0;for(let c of this.elementMappings)c.type==="vertex"?i++:c.type==="edge"?s++:c.type==="subgraph"?r++:c.type==="connector"?u++:c.type==="attachment"&&l++;return{vertices:i,edges:s,subgraphs:r,connectors:u,attachments:l,totalElements:this.elementMappings.length}}emitDiagnostic(i,s,r,u){let l=u?.nodeId??u?.edgeId,c=l?this.getElementById(l):void 0,a={id:i,severity:s,message:r,...u?.nodeId?{nodeId:u.nodeId}:{},...u?.edgeId&&!u?.nodeId?{edgeId:u.edgeId}:{},...c?{position:c.position}:{}};if(this.diagnostics.some(p=>p.id===a.id&&p.severity===a.severity&&p.message===a.message&&p.nodeId===a.nodeId&&p.edgeId===a.edgeId))return;this.diagnostics.push(a);let f=`agentflow[${i}]: ${r}`;s==="error"?ne.error(f):ne.warn(f)}emitWarning(i,s,r){this.emitDiagnostic(i,"warning",s,r)}emitError(i,s,r){this.emitDiagnostic(i,"error",s,r)}getDiagnostics(){return[...this.diagnostics]}};var ei=b(function(n,i){return i.db.getClasses()},"getClasses"),ti=b(async function(n,i,s,r){ne.debug("Drawing agentflow diagram",i);let{securityLevel:u,agentflow:l,layout:c}=le();r.db.setDiagramId(i),ne.debug("Before getData: ");let a=r.db.getData();ne.debug("Data: ",a);let h=Fn(i,u),f=r.db.getDirection();a.type=r.type,a.layoutAlgorithm=Vn(c),a.layoutAlgorithm==="dagre"&&c==="elk"&&ne.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),a.direction=f,a.nodeSpacing=l?.nodeSpacing||50,a.rankSpacing=l?.rankSpacing||50,a.markers=["point","circle","cross","hierarchy"],a.diagramId=i,ne.debug("REF1:",a),await yn(a,h);let p=l?.diagramPadding??8;$e.insertTitle(h,"agentflowTitleText",l?.titleTopMargin??0,r.db.getDiagramTitle()),In(h,p,"agentflow",l?.useMaxWidth??!0)},"draw"),On={getClasses:ei,draw:ti};var Jt=(function(){var n=b(function(De,k,E,S){for(E=E||{},S=De.length;S--;E[De[S]]=k);return E},"o"),i=[1,5],s=[1,4],r=[1,3],u=[1,6],l=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],c=[2,2],a=[1,15],h=[1,16],f=[1,17],p=[1,18],A=[1,19],C=[1,26],I=[1,27],x=[1,28],M=[1,30],D=[1,31],m=[1,32],d=[1,55],g=[1,54],L=[1,34],R=[1,35],ie=[1,36],he=[1,37],ce=[1,38],O=[1,50],G=[1,52],U=[1,48],W=[1,53],j=[1,49],K=[1,56],z=[1,51],H=[1,57],Y=[1,58],Te=[1,39],_e=[1,40],we=[1,41],Fe=[1,42],ye=[1,43],Se=[1,64],T=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],Z=[1,70],$=[1,68],ee=[1,67],te=[1,69],Me=[8,9,10,12,78,80,81],ve=[1,88],Be=[1,101],Ne=[1,106],Re=[1,105],Oe=[1,102],Pe=[1,98],Ge=[1,104],Ue=[1,100],We=[1,107],je=[1,103],Ke=[1,108],ze=[1,99],Ve=[8,9,10,11,12,43,78,80,81],q=[8,9,10,11,12,43,49,78,80,81],re=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],Xt=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],He=[47,63,92,105,108,109,112,114,117,118,119],Qt=[1,131],Zt=[1,132],it=[1,134],st=[1,133],$t=[47,63,65,77,92,105,108,109,112,114,117,118,119],rt=[1,143],at=[1,157],ot=[1,158],ut=[1,159],lt=[1,162],ct=[1,161],dt=[1,160],ht=[1,145],pt=[1,147],gt=[1,151],en=[1,139],tn=[1,140],ft=[1,152],bt=[1,153],mt=[1,154],kt=[1,155],At=[1,156],Et=[1,163],xt=[1,164],St=[1,141],Ct=[1,142],Dt=[1,149],Tt=[1,144],_t=[1,148],wt=[1,146],Ye=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],nn=[1,168],Je=[1,170],P=[8,9,10,12],ae=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],w=[1,190],X=[1,186],Q=[1,187],F=[1,191],y=[1,188],V=[1,189],qe=[80,119,122],v=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],sn=[11,109],Ce=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],pe=[1,269],ge=[1,267],fe=[1,271],be=[1,265],me=[1,266],ke=[1,268],Ae=[1,270],Ee=[1,272],Xe=[1,292],rn=[8,9,10,12,109],de=[8,9,10,11,12,63,87,108,109,112,113,114,115],Mt={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:b(function(k,E,S,o,B,e,_){var t=e.length-1;switch(B){case 2:this.$=[];break;case 3:(!Array.isArray(e[t])||e[t].length>0)&&e[t-1].push(e[t]),this.$=e[t-1];break;case 4:case 198:this.$=e[t];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:o.setDirection("TB"),this.$="TB";break;case 14:o.setDirection(e[t-1]),this.$=e[t-1];break;case 32:this.$=e[t-1].nodes;break;case 38:this.$=o.addSubGraph(e[t-6],e[t-1],e[t-4],"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(e[t-6],e[t-4],_[t-8],_[t]);break;case 39:this.$=o.addSubGraph(e[t-7],e[t-1],e[t-5],"flow"),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-3],_[t-3]),o.addSubgraphMapping&&o.addSubgraphMapping(e[t-7],e[t-5],_[t-9],_[t]);break;case 40:this.$=o.addSubGraph(e[t-3],e[t-1],{text:"",type:"text"},"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(e[t-3],{text:"",type:"text"},_[t-5],_[t]);break;case 41:this.$=o.addSubGraph(e[t-4],e[t-1],{text:"",type:"text"},"flow"),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-3],_[t-3]),o.addSubgraphMapping&&o.addSubgraphMapping(e[t-4],{text:"",type:"text"},_[t-6],_[t]);break;case 42:this.$=o.addSubGraph(void 0,e[t-1],void 0,"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(void 0,void 0,_[t-3],_[t]);break;case 43:o.addGlobal(e[t-1]),this.$=[];break;case 44:this.$=o.addConnector(e[t-4],e[t-2]),o.addConnectorMapping&&o.addConnectorMapping(e[t-4],e[t-2],_[t-6],_[t]);break;case 45:this.$=o.addConnector(e[t-5],e[t-3]),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-1],_[t-1]),o.addConnectorMapping&&o.addConnectorMapping(e[t-5],e[t-3],_[t-7],_[t]);break;case 46:this.$=o.addConnector(e[t-1],{text:"",type:"text"}),o.addConnectorMapping&&o.addConnectorMapping(e[t-1],{text:"",type:"text"},_[t-3],_[t]);break;case 47:this.$=o.addConnector(e[t-2],{text:"",type:"text"}),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-1],_[t-1]),o.addConnectorMapping&&o.addConnectorMapping(e[t-2],{text:"",type:"text"},_[t-4],_[t]);break;case 49:this.$=e[t].trim(),o.setAccTitle(this.$);break;case 50:case 51:this.$=e[t].trim(),o.setAccDescription(this.$);break;case 56:this.$=e[t-1]+e[t];break;case 57:this.$=e[t];break;case 58:o.addVertex(e[t-1][e[t-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t],_[t]),o.extendVertexMapping&&o.extendVertexMapping(e[t-1][e[t-1].length-1],_[t]),o.addLink(e[t-3].stmt,e[t-1],e[t-2]),o.addEdgeMapping&&o.addEdgeMapping(e[t-3].stmt,e[t-1],e[t-2],this._$),this.$={stmt:e[t-1],nodes:e[t-1].concat(e[t-3].nodes)};break;case 59:o.addLink(e[t-2].stmt,e[t],e[t-1]),o.addEdgeMapping&&o.addEdgeMapping(e[t-2].stmt,e[t],e[t-1],this._$),this.$={stmt:e[t],nodes:e[t].concat(e[t-2].nodes)};break;case 60:o.addLink(e[t-3].stmt,e[t-1],e[t-2]),o.addEdgeMapping&&o.addEdgeMapping(e[t-3].stmt,e[t-1],e[t-2],this._$),this.$={stmt:e[t-1],nodes:e[t-1].concat(e[t-3].nodes)};break;case 61:this.$={stmt:e[t-1],nodes:e[t-1]};break;case 62:o.addVertex(e[t-1][e[t-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t],_[t]),o.extendVertexMapping&&o.extendVertexMapping(e[t-1][e[t-1].length-1],_[t]),this.$={stmt:e[t-1],nodes:e[t-1],shapeData:e[t]};break;case 63:this.$={stmt:e[t],nodes:e[t]};break;case 64:this.$=[e[t]];break;case 65:o.addVertex(e[t-5][e[t-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t-4],_[t-4]),o.extendVertexMapping&&o.extendVertexMapping(e[t-5][e[t-5].length-1],_[t-4]),this.$=e[t-5].concat(e[t]);break;case 66:this.$=e[t-4].concat(e[t]);break;case 67:this.$=e[t];break;case 68:this.$=e[t-2],o.setClass(e[t-2],e[t]);break;case 69:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"square"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"square",this._$);break;case 70:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"doublecircle"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"doublecircle",this._$);break;case 71:this.$=e[t-5],o.addVertex(e[t-5],e[t-2],"circle"),o.addVertexMapping&&o.addVertexMapping(e[t-5],e[t-2],"circle",this._$);break;case 72:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"ellipse"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"ellipse",this._$);break;case 73:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"stadium"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"stadium",this._$);break;case 74:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"subroutine"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"subroutine",this._$);break;case 75:this.$=e[t-7],o.addVertex(e[t-7],e[t-1],"rect",void 0,void 0,void 0,Object.fromEntries([[e[t-5],e[t-3]]])),o.addVertexMapping&&o.addVertexMapping(e[t-7],e[t-1],"rect",this._$);break;case 76:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"cylinder"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"cylinder",this._$);break;case 77:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"round"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"round",this._$);break;case 78:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"diamond"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"diamond",this._$);break;case 79:this.$=e[t-5],o.addVertex(e[t-5],e[t-2],"hexagon"),o.addVertexMapping&&o.addVertexMapping(e[t-5],e[t-2],"hexagon",this._$);break;case 80:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"odd"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"odd",this._$);break;case 81:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"trapezoid"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"trapezoid",this._$);break;case 82:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"inv_trapezoid"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"inv_trapezoid",this._$);break;case 83:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"lean_right"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"lean_right",this._$);break;case 84:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"lean_left"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"lean_left",this._$);break;case 85:this.$=e[t],o.addVertex(e[t]),o.addVertexMapping&&o.addVertexMapping(e[t],void 0,void 0,this._$);break;case 86:e[t-1].text=e[t],this.$=e[t-1];break;case 87:case 88:e[t-2].text=e[t-1],this.$=e[t-2];break;case 89:this.$=e[t];break;case 90:var N=o.destructLink(e[t],e[t-2]);this.$={type:N.type,stroke:N.stroke,length:N.length,edgeSemantic:N.edgeSemantic,text:e[t-1]};break;case 91:var N=o.destructLink(e[t],e[t-2]);this.$={type:N.type,stroke:N.stroke,length:N.length,edgeSemantic:N.edgeSemantic,text:e[t-1],id:e[t-3]};break;case 92:this.$={text:e[t],type:"text"};break;case 93:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 94:this.$={text:e[t],type:"string"};break;case 95:this.$={text:e[t],type:"markdown"};break;case 96:var N=o.destructLink(e[t]);this.$={type:N.type,stroke:N.stroke,length:N.length,edgeSemantic:N.edgeSemantic};break;case 97:var N=o.destructLink(e[t]);this.$={type:N.type,stroke:N.stroke,length:N.length,edgeSemantic:N.edgeSemantic,id:e[t-1]};break;case 98:this.$=e[t-1];break;case 99:this.$={text:e[t],type:"text"};break;case 100:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 101:this.$={text:e[t],type:"string"};break;case 102:case 119:this.$={text:e[t],type:"markdown"};break;case 116:this.$={text:e[t],type:"text"};break;case 117:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 118:this.$={text:e[t],type:"text"};break;case 120:this.$=e[t-4],o.addClass(e[t-2],e[t]);break;case 121:this.$=e[t-4],o.setClass(e[t-2],e[t]);break;case 122:case 130:this.$=e[t-1],o.setClickEvent(e[t-1],e[t]);break;case 123:case 131:this.$=e[t-3],o.setClickEvent(e[t-3],e[t-2]),o.setTooltip(e[t-3],e[t]);break;case 124:this.$=e[t-2],o.setClickEvent(e[t-2],e[t-1],e[t]);break;case 125:this.$=e[t-4],o.setClickEvent(e[t-4],e[t-3],e[t-2]),o.setTooltip(e[t-4],e[t]);break;case 126:this.$=e[t-2],o.setLink(e[t-2],e[t]);break;case 127:this.$=e[t-4],o.setLink(e[t-4],e[t-2]),o.setTooltip(e[t-4],e[t]);break;case 128:this.$=e[t-4],o.setLink(e[t-4],e[t-2],e[t]);break;case 129:this.$=e[t-6],o.setLink(e[t-6],e[t-4],e[t]),o.setTooltip(e[t-6],e[t-2]);break;case 132:this.$=e[t-1],o.setLink(e[t-1],e[t]);break;case 133:this.$=e[t-3],o.setLink(e[t-3],e[t-2]),o.setTooltip(e[t-3],e[t]);break;case 134:this.$=e[t-3],o.setLink(e[t-3],e[t-2],e[t]);break;case 135:this.$=e[t-5],o.setLink(e[t-5],e[t-4],e[t]),o.setTooltip(e[t-5],e[t-2]);break;case 136:this.$=e[t-4],o.addVertex(e[t-2],void 0,void 0,e[t]);break;case 137:this.$=e[t-4],o.updateLink([e[t-2]],e[t]);break;case 138:this.$=e[t-4],o.updateLink(e[t-2],e[t]);break;case 139:this.$=e[t-8],o.updateLinkInterpolate([e[t-6]],e[t-2]),o.updateLink([e[t-6]],e[t]);break;case 140:this.$=e[t-8],o.updateLinkInterpolate(e[t-6],e[t-2]),o.updateLink(e[t-6],e[t]);break;case 141:this.$=e[t-6],o.updateLinkInterpolate([e[t-4]],e[t]);break;case 142:this.$=e[t-6],o.updateLinkInterpolate(e[t-4],e[t]);break;case 143:case 145:this.$=[e[t]];break;case 144:case 146:e[t-2].push(e[t]),this.$=e[t-2];break;case 148:this.$=e[t-1]+e[t];break;case 196:this.$=e[t];break;case 197:this.$=e[t-1]+""+e[t];break;case 199:this.$=e[t-1]+""+e[t];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,8:i,10:s,11:r,13:u},{1:[3]},n(l,c,{5:7}),{4:8,8:i,10:s,11:r,13:u},{4:9,8:i,10:s,11:r,13:u},{4:10,8:i,10:s,11:r,13:u},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},n(l,[2,10]),n(l,[2,11]),n(l,[2,12]),n(l,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:Se,16:59,19:62},n(T,[2,3]),n(T,[2,4]),n(T,[2,5]),n(T,[2,6]),n(T,[2,7]),n(T,[2,8]),n(T,[2,9]),{8:Z,9:$,10:ee,12:te,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:Z,9:$,10:ee,12:te,22:75},{8:Z,9:$,10:ee,12:te,22:76},{8:Z,9:$,10:ee,12:te,22:77},{8:Z,9:$,10:ee,12:te,22:78},{8:Z,9:$,10:ee,12:te,22:79},{8:Z,9:$,10:ee,11:[1,80],12:te,22:81},{8:Z,9:$,10:ee,12:te,22:82},{11:[1,83]},n(T,[2,48]),{39:[1,84]},{41:[1,85]},n(T,[2,51]),n(Me,[2,63],{19:86,34:87,11:Se,43:ve}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:Be,47:Ne,63:Re,83:[1,96],92:Oe,98:[1,93],100:[1,94],104:95,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze,123:97},n(T,[2,200]),n(T,[2,201]),n(T,[2,202]),n(T,[2,203]),n(T,[2,204]),n(Ve,[2,64]),n(Ve,[2,67],{49:[1,109]}),n(q,[2,85],{116:122,30:[1,110],47:d,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:g,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:O,105:G,108:U,109:W,112:j,114:K,117:z,118:H,119:Y}),n(re,[2,196]),n(re,[2,157]),n(re,[2,158]),n(re,[2,159]),n(re,[2,160]),n(re,[2,161]),n(re,[2,162]),n(re,[2,163]),n(re,[2,164]),n(re,[2,165]),n(re,[2,166]),n(re,[2,167]),n(l,[2,14]),n(l,[2,20]),n(l,[2,21]),{10:[1,123]},n(l,[2,23]),n(Xt,[2,31],{19:124,11:Se}),n(T,[2,32]),{45:125,46:44,47:d,48:45,50:46,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},n(T,[2,52]),n(T,[2,53]),n(T,[2,54]),n(T,[2,55]),n(He,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:Qt,84:Zt,119:it,122:st},{78:[1,135],80:[1,136]},n($t,[2,96]),n(T,[2,33]),n(T,[2,34]),n(T,[2,35]),n(T,[2,36]),n(T,[2,37]),{11:rt,13:at,15:ot,28:ut,29:137,33:lt,35:ct,36:dt,47:ht,63:pt,78:gt,83:en,84:tn,86:150,87:ft,88:bt,89:mt,90:kt,91:At,92:Et,93:xt,94:138,108:St,112:Ct,114:Dt,117:Tt,118:_t,119:wt},n(Ye,c,{5:165}),n(Ye,c,{5:166}),{11:rt,13:at,15:ot,28:ut,29:167,33:lt,35:ct,36:dt,47:ht,63:pt,78:gt,83:en,84:tn,86:150,87:ft,88:bt,89:mt,90:kt,91:At,92:Et,93:xt,94:138,108:St,112:Ct,114:Dt,117:Tt,118:_t,119:wt},n(T,[2,49]),n(T,[2,50]),n(Me,[2,61],{47:nn}),n(Me,[2,62],{19:169,11:Se,43:Je}),n(Ve,[2,57]),{47:d,50:171,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},{105:[1,172],106:173,108:[1,174]},{47:d,50:175,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},{47:d,50:176,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},n(P,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},n(P,[2,130],{123:181,11:[1,180],15:Be,47:Ne,63:Re,92:Oe,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze}),n(P,[2,132],{11:[1,182]}),n(ae,[2,198]),n(ae,[2,185]),n(ae,[2,186]),n(ae,[2,187]),n(ae,[2,188]),n(ae,[2,189]),n(ae,[2,190]),n(ae,[2,191]),n(ae,[2,192]),n(ae,[2,193]),n(ae,[2,194]),n(ae,[2,195]),{47:d,50:183,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},{31:184,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:192,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:194,53:[1,193],70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:195,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:196,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:197,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{112:[1,198]},{31:199,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:200,68:[1,201],70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:202,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:203,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:204,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},n(re,[2,197]),n(l,[2,22]),n(Xt,[2,30]),n(Me,[2,59],{34:205,19:206,11:Se,43:ve}),n(He,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{80:[1,210],82:211,119:it,122:st},n(qe,[2,92]),n(qe,[2,94]),n(qe,[2,95]),n(qe,[2,183]),n(qe,[2,184]),{79:212,82:130,83:Qt,84:Zt,119:it,122:st},n($t,[2,97]),{8:Z,9:$,10:ee,11:rt,12:te,13:at,15:ot,22:214,28:ut,30:[1,213],33:lt,34:215,35:ct,36:dt,43:ve,47:ht,63:pt,78:gt,86:150,87:ft,88:bt,89:mt,90:kt,91:At,92:Et,93:xt,94:216,108:St,112:Ct,114:Dt,117:Tt,118:_t,119:wt},n(v,[2,116]),n(v,[2,118]),n(v,[2,119]),n(v,[2,172]),n(v,[2,173]),n(v,[2,174]),n(v,[2,175]),n(v,[2,176]),n(v,[2,177]),n(v,[2,178]),n(v,[2,179]),n(v,[2,180]),n(v,[2,181]),n(v,[2,182]),n(v,[2,103]),n(v,[2,104]),n(v,[2,105]),n(v,[2,106]),n(v,[2,107]),n(v,[2,108]),n(v,[2,109]),n(v,[2,110]),n(v,[2,111]),n(v,[2,112]),n(v,[2,113]),n(v,[2,114]),n(v,[2,115]),{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,217],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,218],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},{8:Z,9:$,10:ee,11:rt,12:te,13:at,15:ot,22:220,28:ut,30:[1,219],33:lt,34:221,35:ct,36:dt,43:ve,47:ht,63:pt,78:gt,86:150,87:ft,88:bt,89:mt,90:kt,91:At,92:Et,93:xt,94:216,108:St,112:Ct,114:Dt,117:Tt,118:_t,119:wt},{11:Se,19:222},{47:[1,223]},n(Ve,[2,56]),{11:[1,224],47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:122,117:z,118:H,119:Y},{11:[1,225]},{11:[1,226],109:[1,227]},n(sn,[2,143]),{11:[1,228],47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:122,117:z,118:H,119:Y},{11:[1,229],47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:122,117:z,118:H,119:Y},{83:[1,230]},n(P,[2,124],{11:[1,231]}),n(P,[2,126],{11:[1,232]}),{83:[1,233]},n(ae,[2,199]),{83:[1,234],101:[1,235]},n(Ve,[2,68],{116:122,47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,117:z,118:H,119:Y}),{32:[1,236],70:w,85:237,119:F,120:y,121:V},n(Ce,[2,99]),n(Ce,[2,101]),n(Ce,[2,102]),n(Ce,[2,168]),n(Ce,[2,169]),n(Ce,[2,170]),n(Ce,[2,171]),{52:[1,238],70:w,85:237,119:F,120:y,121:V},{31:239,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{54:[1,240],70:w,85:237,119:F,120:y,121:V},{56:[1,241],70:w,85:237,119:F,120:y,121:V},{58:[1,242],70:w,85:237,119:F,120:y,121:V},{60:[1,243],70:w,85:237,119:F,120:y,121:V},{63:[1,244]},{67:[1,245],70:w,85:237,119:F,120:y,121:V},{69:[1,246],70:w,85:237,119:F,120:y,121:V},{31:247,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{32:[1,248],70:w,85:237,119:F,120:y,121:V},{70:w,72:[1,249],74:[1,250],85:237,119:F,120:y,121:V},{70:w,72:[1,252],74:[1,251],85:237,119:F,120:y,121:V},n(Me,[2,58],{19:169,11:Se,43:Je}),n(Me,[2,60],{47:nn}),n(He,[2,88]),n(He,[2,87]),{65:[1,253],70:w,85:237,119:F,120:y,121:V},n(He,[2,90]),n(qe,[2,93]),{80:[1,254],82:211,119:it,122:st},{31:255,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},n(Ye,c,{5:256}),{8:Z,9:$,10:ee,12:te,22:257,43:Je},n(v,[2,117]),n(T,[2,42]),n(T,[2,43]),{31:258,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},n(T,[2,46]),{8:Z,9:$,10:ee,12:te,22:259,43:Je},{46:260,47:d,48:45,50:46,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},{11:Se,19:261},{11:pe,63:ge,87:fe,95:262,108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{11:pe,63:ge,87:fe,95:273,107:[1,274],108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{11:pe,63:ge,87:fe,95:275,107:[1,276],108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{108:[1,277]},{11:pe,63:ge,87:fe,95:278,108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{47:d,50:279,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},n(P,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},n(P,[2,131]),n(P,[2,133],{11:[1,283]}),n(P,[2,134]),n(q,[2,69]),n(Ce,[2,100]),n(q,[2,70]),{54:[1,284],70:w,85:237,119:F,120:y,121:V},n(q,[2,77]),n(q,[2,72]),n(q,[2,73]),n(q,[2,74]),{112:[1,285]},n(q,[2,76]),n(q,[2,78]),{69:[1,286],70:w,85:237,119:F,120:y,121:V},n(q,[2,80]),n(q,[2,81]),n(q,[2,83]),n(q,[2,82]),n(q,[2,84]),n([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),n(He,[2,91]),{32:[1,287],70:w,85:237,119:F,120:y,121:V},{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,288],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},n(Ye,c,{5:289}),{32:[1,290],70:w,85:237,119:F,120:y,121:V},n(T,[2,47]),n(Ve,[2,66]),{46:291,47:d,48:45,50:46,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},n(P,[2,136],{109:Xe}),n(rn,[2,145],{111:293,11:pe,63:ge,87:fe,108:be,112:me,113:ke,114:Ae,115:Ee}),n(de,[2,147]),n(de,[2,149]),n(de,[2,150]),n(de,[2,151]),n(de,[2,152]),n(de,[2,153]),n(de,[2,154]),n(de,[2,155]),n(de,[2,156]),n(P,[2,137],{109:Xe}),{11:[1,294]},n(P,[2,138],{109:Xe}),{11:[1,295]},n(sn,[2,144]),n(P,[2,120],{109:Xe}),n(P,[2,121],{116:122,47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,117:z,118:H,119:Y}),n(P,[2,125]),n(P,[2,127],{11:[1,296]}),n(P,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:Z,9:$,10:ee,12:te,22:301,34:302,43:ve},n(T,[2,40]),{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,303],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},{8:Z,9:$,10:ee,12:te,22:304,34:305,43:ve},n(Ve,[2,65]),{11:pe,63:ge,87:fe,108:be,110:306,111:264,112:me,113:ke,114:Ae,115:Ee},n(de,[2,148]),{15:Be,47:Ne,63:Re,92:Oe,104:307,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze,123:97},{15:Be,47:Ne,63:Re,92:Oe,104:308,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze,123:97},{101:[1,309]},n(P,[2,135]),n(q,[2,71]),{31:310,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},n(q,[2,79]),n(Ye,c,{5:311}),{8:Z,9:$,10:ee,12:te,22:312,43:Je},n(T,[2,41]),n(T,[2,44]),{8:Z,9:$,10:ee,12:te,22:313,43:Je},n(rn,[2,146],{111:293,11:pe,63:ge,87:fe,108:be,112:me,113:ke,114:Ae,115:Ee}),n(P,[2,141],{123:181,11:[1,314],15:Be,47:Ne,63:Re,92:Oe,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze}),n(P,[2,142],{123:181,11:[1,315],15:Be,47:Ne,63:Re,92:Oe,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze}),n(P,[2,129]),{32:[1,316],70:w,85:237,119:F,120:y,121:V},{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,317],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},n(Ye,c,{5:318}),n(T,[2,45]),{11:pe,63:ge,87:fe,95:319,108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{11:pe,63:ge,87:fe,95:320,108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},n(q,[2,75]),n(T,[2,38]),{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,321],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},n(P,[2,139],{109:Xe}),n(P,[2,140],{109:Xe}),n(T,[2,39])],defaultActions:{},parseError:b(function(k,E){if(E.recoverable)this.trace(k);else{var S=new Error(k);throw S.hash=E,S}},"parseError"),parse:b(function(k){var E=this,S=[0],o=[],B=[null],e=[],_=this.table,t="",N=0,an=0,on=0,jn=2,un=1,Kn=e.slice.call(arguments,1),J=Object.create(this.lexer),Ie={yy:{}};for(var Bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bt)&&(Ie.yy[Bt]=this.yy[Bt]);J.setInput(k,Ie.yy),Ie.yy.lexer=J,Ie.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Nt=J.yylloc;e.push(Nt);var zn=J.options&&J.options.ranges;typeof Ie.yy.parseError=="function"?this.parseError=Ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ri(oe){S.length=S.length-2*oe,B.length=B.length-oe,e.length=e.length-oe}b(ri,"popStack");function Hn(){var oe;return oe=o.pop()||J.lex()||un,typeof oe!="number"&&(oe instanceof Array&&(o=oe,oe=o.pop()),oe=E.symbols_[oe]||oe),oe}b(Hn,"lex");for(var se,Rt,Le,ue,ai,Ot,Qe={},Ft,xe,ln,yt;;){if(Le=S[S.length-1],this.defaultActions[Le]?ue=this.defaultActions[Le]:((se===null||typeof se>"u")&&(se=Hn()),ue=_[Le]&&_[Le][se]),typeof ue>"u"||!ue.length||!ue[0]){var Pt="";yt=[];for(Ft in _[Le])this.terminals_[Ft]&&Ft>jn&&yt.push("'"+this.terminals_[Ft]+"'");J.showPosition?Pt="Parse error on line "+(N+1)+`:
23
+ `+J.showPosition()+`
24
+ Expecting `+yt.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Pt="Parse error on line "+(N+1)+": Unexpected "+(se==un?"end of input":"'"+(this.terminals_[se]||se)+"'"),this.parseError(Pt,{text:J.match,token:this.terminals_[se]||se,line:J.yylineno,loc:Nt,expected:yt})}if(ue[0]instanceof Array&&ue.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+se);switch(ue[0]){case 1:S.push(se),B.push(J.yytext),e.push(J.yylloc),S.push(ue[1]),se=null,Rt?(se=Rt,Rt=null):(an=J.yyleng,t=J.yytext,N=J.yylineno,Nt=J.yylloc,on>0&&on--);break;case 2:if(xe=this.productions_[ue[1]][1],Qe.$=B[B.length-xe],Qe._$={first_line:e[e.length-(xe||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(xe||1)].first_column,last_column:e[e.length-1].last_column},zn&&(Qe._$.range=[e[e.length-(xe||1)].range[0],e[e.length-1].range[1]]),Ot=this.performAction.apply(Qe,[t,an,N,Ie.yy,ue[1],B,e].concat(Kn)),typeof Ot<"u")return Ot;xe&&(S=S.slice(0,-1*xe*2),B=B.slice(0,-1*xe),e=e.slice(0,-1*xe)),S.push(this.productions_[ue[1]][0]),B.push(Qe.$),e.push(Qe._$),ln=_[S[S.length-2]][S[S.length-1]],S.push(ln);break;case 3:return!0}}return!0},"parse")},Wn=(function(){var De={EOF:1,parseError:b(function(E,S){if(this.yy.parser)this.yy.parser.parseError(E,S);else throw new Error(E)},"parseError"),setInput:b(function(k,E){return this.yy=E||this.yy||{},this._input=k,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var E=k.match(/(?:\r\n?|\n).*/g);return E?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),k},"input"),unput:b(function(k){var E=k.length,S=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-E),this.offset-=E;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var B=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===o.length?this.yylloc.first_column:0)+o[o.length-S.length].length-S[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
25
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(k){this.unput(this.match.slice(k))},"less"),pastInput:b(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var k=this.pastInput(),E=new Array(k.length+1).join("-");return k+this.upcomingInput()+`
26
+ `+E+"^"},"showPosition"),test_match:b(function(k,E){var S,o,B;if(this.options.backtrack_lexer&&(B={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(B.yylloc.range=this.yylloc.range.slice(0))),o=k[0].match(/(?:\r\n?|\n).*/g),o&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(k[0].length),this.matched+=k[0],S=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var e in B)this[e]=B[e];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,E,S,o;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),e=0;e<B.length;e++)if(S=this._input.match(this.rules[B[e]]),S&&(!E||S[0].length>E[0].length)){if(E=S,o=e,this.options.backtrack_lexer){if(k=this.test_match(S,B[e]),k!==!1)return k;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(k=this.test_match(E,B[o]),k!==!1?k:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
27
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var E=this.next();return E||this.lex()},"lex"),begin:b(function(E){this.conditionStack.push(E)},"begin"),popState:b(function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},"topState"),pushState:b(function(E){this.begin(E)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(E,S,o,B){var e=B;switch(o){case 0:return this.begin("acc_title"),38;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),40;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),S.yytext="",43;break;case 8:return this.pushState("shapeDataStr"),43;break;case 9:return this.popState(),43;break;case 10:let _=/\n\s*/g;return S.yytext=S.yytext.replace(_,"<br/>"),43;break;case 11:return 43;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 98;case 17:this.popState();break;case 18:return 99;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 87;case 26:return 105;case 27:return 88;case 28:return 107;case 29:return 89;case 30:return 90;case 31:return 100;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 91;case 35:return E.lex.firstGraph()&&this.begin("dir"),13;break;case 36:return 28;case 37:return 36;case 38:return 35;case 39:return 33;case 40:return 101;case 41:return 101;case 42:return 101;case 43:return 101;case 44:return this.popState(),14;break;case 45:return this.popState(),15;break;case 46:return this.popState(),15;break;case 47:return this.popState(),15;break;case 48:return this.popState(),15;break;case 49:return this.popState(),15;break;case 50:return this.popState(),15;break;case 51:return this.popState(),15;break;case 52:return this.popState(),15;break;case 53:return this.popState(),15;break;case 54:return this.popState(),15;break;case 55:return 124;case 56:return 125;case 57:return 126;case 58:return 127;case 59:return 128;case 60:return 81;case 61:return 108;case 62:return 114;case 63:return 49;case 64:return 63;case 65:return 47;case 66:return 9;case 67:return 109;case 68:return 118;case 69:return this.popState(),80;break;case 70:return this.pushState("edgeText"),78;break;case 71:return 122;case 72:return 80;case 73:break;case 74:return this.popState(),56;break;case 75:return"TEXT";case 76:return this.pushState("ellipseText"),55;break;case 77:return this.popState(),58;break;case 78:return this.pushState("text"),57;break;case 79:return this.popState(),60;break;case 80:return this.pushState("text"),59;break;case 81:return 61;case 82:return this.pushState("text"),70;break;case 83:return this.popState(),67;break;case 84:return this.pushState("text"),66;break;case 85:return this.popState(),52;break;case 86:return this.pushState("text"),51;break;case 87:break;case 88:return this.popState(),72;break;case 89:return this.popState(),74;break;case 90:return 120;case 91:return this.pushState("trapText"),71;break;case 92:return this.pushState("trapText"),73;break;case 93:return 121;case 94:return 70;case 95:return 93;case 96:return"SEP";case 97:return 92;case 98:return 118;case 99:return 114;case 100:return 47;case 101:return 8;case 102:return 112;case 103:return 117;case 104:return 119;case 105:return this.popState(),65;break;case 106:return this.pushState("text"),65;break;case 107:return this.popState(),54;break;case 108:return this.pushState("text"),53;break;case 109:return this.popState(),32;break;case 110:return this.pushState("text"),30;break;case 111:return this.popState(),69;break;case 112:return this.pushState("text"),68;break;case 113:break;case 114:return"TEXT";case 115:return"QUOTE";case 116:return 10;case 117:return 11;case 118:return 12}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:agentflow-beta\b)/,/^(?:flow\b)/,/^(?:connector\b)/,/^(?:global\b[ \t]*)/,/^(?:end\b[ \t]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--+[x>]\s*)/,/^(?:\s*--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*-\.+-\s*)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:[ \t]*%%(?!\{)[^\n]*)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},href:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},click:{rules:[21,24,33,34,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},edgeText:{rules:[21,24,69,71,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},trapText:{rules:[21,24,76,78,80,84,86,87,88,89,90,91,92,106,108,110,112],inclusive:!1},ellipseText:{rules:[21,24,73,74,75,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},text:{rules:[21,24,76,77,78,79,80,83,84,85,86,91,92,105,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr:{rules:[3,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_title:{rules:[1,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},md_string:{rules:[19,20,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},string:{rules:[21,22,23,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,76,78,80,81,82,84,86,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,108,110,112,115,116,117,118],inclusive:!0}}};return De})();Mt.lexer=Wn;function vt(){this.yy={}}return b(vt,"Parser"),vt.prototype=Mt,Mt.Parser=vt,new vt})();Jt.parser=Jt;var qt=Jt;var Pn=Object.assign({},qt);Pn.parse=n=>{let i=n.replace(/}[^\S\n]*\n/g,`}
28
+ `);return qt.parse(i)};var Gn=Pn;var ni=b(n=>{let{theme:i,bkgColorArray:s,borderColorArray:r}=n;if(!Dn(i,r))return"";let u=Tn(n.look),l=Cn(s),c=_n(n.THEME_COLOR_LIMIT,r),a=b(p=>r[p%r.length],"border"),h=b(p=>l?`fill: ${s[p%s.length]};`:"","fill"),f="";for(let p of Bn){let A=nt.get(p),C=`[data-look="${u}"].node.${jt(p)}`;f+=`
29
+
30
+ ${C} rect,
31
+ ${C} path,
32
+ ${C} polygon {
33
+ stroke: ${a(A)};
34
+ ${h(A)}
35
+ }
36
+ `}for(let p=0;p<Kt(c);p++){let A=zt(p,c),C=`[data-look="${u}"][data-color-id="color-${A}"].cluster`,I=`[data-look="${u}"][data-color-id="color-${A}"].node`,x=b(M=>`${C} ${M}, ${I} ${M}`,"rule");f+=`
37
+
38
+ ${x("rect")},
39
+ ${x("path")} {
40
+ stroke: ${a(A)};
41
+ ${h(A)}
42
+ }
43
+ `}return f},"genColor"),ii=b((n,i)=>{let s=dn,r=s(n,"r"),u=s(n,"g"),l=s(n,"b");return cn(r,u,l,i)},"fade"),si=b(n=>`${ni(n)}
44
+ .label {
45
+ font-family: ${n.fontFamily};
46
+ color: ${n.nodeTextColor||n.textColor};
47
+ }
48
+ .cluster-label text {
49
+ fill: ${n.titleColor};
50
+ }
51
+ .cluster-label span {
52
+ color: ${n.titleColor};
53
+ }
54
+ .cluster-label span p {
55
+ background-color: transparent;
56
+ }
57
+
58
+ .label text,span {
59
+ fill: ${n.nodeTextColor||n.textColor};
60
+ color: ${n.nodeTextColor||n.textColor};
61
+ }
62
+
63
+ .node rect,
64
+ .node circle,
65
+ .node ellipse,
66
+ .node polygon,
67
+ .node path {
68
+ fill: ${n.mainBkg};
69
+ stroke: ${n.nodeBorder};
70
+ stroke-width: ${n.strokeWidth??1}px;
71
+ }
72
+ .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
73
+ text-anchor: middle;
74
+ }
75
+ .node .katex path {
76
+ fill: ${n.nodeTextColor||n.textColor};
77
+ stroke: ${n.nodeTextColor||n.textColor};
78
+ stroke-width: 1px;
79
+ }
80
+
81
+ .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
82
+ text-align: center;
83
+ }
84
+ .node.clickable {
85
+ cursor: pointer;
86
+ }
87
+
88
+
89
+ .root .anchor path {
90
+ fill: ${n.lineColor} !important;
91
+ stroke-width: 0;
92
+ stroke: ${n.lineColor};
93
+ }
94
+
95
+ .arrowheadPath {
96
+ fill: ${n.arrowheadColor};
97
+ }
98
+
99
+ .edgePaths .path {
100
+ stroke: ${n.lineColor};
101
+ stroke-width: ${n.strokeWidth??2}px;
102
+ }
103
+
104
+ .flowchart-link {
105
+ stroke: ${n.lineColor};
106
+ fill: none;
107
+ }
108
+
109
+ .edgeLabel {
110
+ background-color: ${n.edgeLabelBackground};
111
+ p {
112
+ background-color: ${n.edgeLabelBackground};
113
+ }
114
+ rect {
115
+ opacity: 0.5;
116
+ background-color: ${n.edgeLabelBackground};
117
+ fill: ${n.edgeLabelBackground};
118
+ }
119
+ text-align: center;
120
+ }
121
+
122
+ /* For html labels only */
123
+ .labelBkg {
124
+ background-color: ${ii(n.edgeLabelBackground,.5)};
125
+ }
126
+
127
+ .cluster rect {
128
+ fill: ${n.clusterBkg};
129
+ stroke: ${n.clusterBorder};
130
+ stroke-width: 1px;
131
+ }
132
+
133
+ .flow-cluster rect {
134
+ fill: none;
135
+ stroke: ${n.clusterBorder};
136
+ stroke-width: 0.75px;
137
+ }
138
+
139
+ .node .collapsed-indicator {
140
+ fill: ${n.nodeBorder};
141
+ stroke: none;
142
+ stroke-width: 0;
143
+ opacity: 0.5;
144
+ }
145
+
146
+ .node .collapsed-separator {
147
+ stroke-width: 0.75px;
148
+ }
149
+
150
+ .cluster text {
151
+ fill: ${n.titleColor};
152
+ }
153
+
154
+ .cluster span {
155
+ color: ${n.titleColor};
156
+ }
157
+ /* .cluster div {
158
+ color: ${n.titleColor};
159
+ } */
160
+
161
+ div.mermaidTooltip {
162
+ position: absolute;
163
+ text-align: center;
164
+ max-width: 200px;
165
+ padding: 2px;
166
+ font-family: ${n.fontFamily};
167
+ font-size: 12px;
168
+ background: ${n.tertiaryColor};
169
+ border: 1px solid ${n.border2};
170
+ border-radius: 2px;
171
+ pointer-events: none;
172
+ z-index: 100;
173
+ }
174
+
175
+ .agentflowTitleText {
176
+ text-anchor: middle;
177
+ font-size: 18px;
178
+ fill: ${n.textColor};
179
+ }
180
+
181
+ rect.text {
182
+ fill: none;
183
+ stroke-width: 0;
184
+ }
185
+
186
+ .icon-shape, .image-shape {
187
+ background-color: ${n.edgeLabelBackground};
188
+ p {
189
+ background-color: ${n.edgeLabelBackground};
190
+ padding: 2px;
191
+ }
192
+ .label rect {
193
+ opacity: 0.5;
194
+ background-color: ${n.edgeLabelBackground};
195
+ fill: ${n.edgeLabelBackground};
196
+ }
197
+ text-align: center;
198
+ }
199
+ ${Ln()}
200
+ `,"getStyles"),Un=si;var $i={parser:Gn,get db(){return new Lt},renderer:On,styles:Un,init:b(n=>{n.agentflow??={},n.layout&&Gt({layout:n.layout}),n.flowchart??={},n.flowchart.arrowMarkerAbsolute=n.arrowMarkerAbsolute,Gt({flowchart:{arrowMarkerAbsolute:n.arrowMarkerAbsolute}})},"init")};export{$i as diagram};
@@ -0,0 +1,24 @@
1
+ import{a as ye}from"./chunk-V3KJR4XU.mjs";import{a as ue}from"./chunk-Y5O5OPKC.mjs";import"./chunk-3T2MNPEU.mjs";import"./chunk-MLQVGYRW.mjs";import"./chunk-QX7LGXZU.mjs";import"./chunk-22SYA5HA.mjs";import"./chunk-YZG4BXY6.mjs";import"./chunk-NRRTYJAG.mjs";import"./chunk-CVBX6EWK.mjs";import"./chunk-RXM7Z7NK.mjs";import"./chunk-HI3EPXIC.mjs";import"./chunk-5NYYYZGL.mjs";import"./chunk-H7BX327W.mjs";import{a as he}from"./chunk-R2KH53MI.mjs";import"./chunk-LIEGGFIX.mjs";import"./chunk-LLWYPJEZ.mjs";import"./chunk-2FTYKNOQ.mjs";import"./chunk-36VM3LGA.mjs";import"./chunk-44AU3KAP.mjs";import{a as Se}from"./chunk-S4TE5DX6.mjs";import{c as ge,d as w}from"./chunk-JGXDHUYS.mjs";import{o as W}from"./chunk-QADHU5CF.mjs";import"./chunk-ZZ52EIBP.mjs";import{P as se,T as le,U as oe,V as ne,W as ie,X as ce,Y as pe,Z as me,h as ae,j as re,u as L}from"./chunk-FE53TMRB.mjs";import{b as k,h as E,j as P,k as de,l as fe,m as I}from"./chunk-L2B47AAZ.mjs";import{a as p}from"./chunk-QVIEFLGF.mjs";var F=class{constructor(){this.nodes=[];this.levels=new Map;this.outerNodes=[];this.classes=new Map;this.setAccTitle=oe;this.getAccTitle=ne;this.setDiagramTitle=pe;this.getDiagramTitle=me;this.getAccDescription=ce;this.setAccDescription=ie}static{p(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let r=re,i=L();return W({...r.treemap,...i.treemap??{}})}addNode(r,i){this.nodes.push(r),this.levels.set(r,i),i===0&&(this.outerNodes.push(r),this.root??=r)}getRoot(){return{name:"",children:this.outerNodes}}addClass(r,i){let l=this.classes.get(r)??{id:r,styles:[],textStyles:[]},o=i.replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{ge(s)&&(l?.textStyles?l.textStyles.push(s):l.textStyles=[s]),l?.styles?l.styles.push(s):l.styles=[s]}),this.classes.set(r,l)}getClasses(){return this.classes}getStylesForClass(r){return this.classes.get(r)?.styles??[]}clear(){le(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function be(m){if(!m.length)return[];let r=[],i=[];return m.forEach(l=>{let o={name:l.name,children:l.type==="Leaf"?void 0:[]};for(o.classSelector=l?.classSelector,l?.cssCompiledStyles&&(o.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(o.value=l.value);i.length>0&&i[i.length-1].level>=l.level;)i.pop();if(i.length===0)r.push(o);else{let s=i[i.length-1].node;s.children?s.children.push(o):s.children=[o]}l.type!=="Leaf"&&i.push({node:o,level:l.level})}),r}p(be,"buildHierarchy");var Pe=p((m,r)=>{ye(m,r);let i=[];for(let s of m.TreemapRows??[])s.$type==="ClassDefStatement"&&r.addClass(s.className??"",s.styleText??"");for(let s of m.TreemapRows??[]){let d=s.item;if(!d)continue;let f=s.indent?parseInt(s.indent):0,R=Fe(d),a=d.classSelector?r.getStylesForClass(d.classSelector):[],z=a.length>0?a:void 0,x={level:f,name:R,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:z};i.push(x)}let l=be(i),o=p((s,d)=>{for(let f of s)r.addNode(f,d),f.children&&f.children.length>0&&o(f.children,d+1)},"addNodesRecursively");o(l,0)},"populate"),Fe=p(m=>m.name?String(m.name):"","getItemName"),Y={parser:{yy:void 0},parse:p(async m=>{try{let i=await ue("treemap",m);k.debug("Treemap AST:",i);let l=Y.parser?.yy;if(!(l instanceof F))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Pe(i,l)}catch(r){throw k.error("Error parsing treemap:",r),r}},"parse")};var Ae=10,A=10,B=25,ze=p((m,r,i,l)=>{let o=l.db,s=o.getConfig(),d=s.padding??Ae,f=o.getDiagramTitle(),R=o.getRoot(),{themeVariables:a}=L();if(!R)return;let z=f?30:0,x=Se(r),q=s.nodeWidth?s.nodeWidth*A:960,U=s.nodeHeight?s.nodeHeight*A:500,G=q,J=U+z;x.attr("viewBox",`0 0 ${G} ${J}`),se(x,J,G,s.useMaxWidth);let T;try{let e=s.valueFormat||",";if(e==="$0,0")T=p(t=>"$"+P(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),n=t?t[0]:"";T=p(g=>"$"+P(","+n)(g),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);T=p(n=>"$"+P(t||"")(n),"valueFormat")}else T=P(e)}catch(e){k.error("Error creating format function:",e),T=P(",")}let M=I().range(["transparent",a.cScale0,a.cScale1,a.cScale2,a.cScale3,a.cScale4,a.cScale5,a.cScale6,a.cScale7,a.cScale8,a.cScale9,a.cScale10,a.cScale11]),Ce=I().range(["transparent",a.cScalePeer0,a.cScalePeer1,a.cScalePeer2,a.cScalePeer3,a.cScalePeer4,a.cScalePeer5,a.cScalePeer6,a.cScalePeer7,a.cScalePeer8,a.cScalePeer9,a.cScalePeer10,a.cScalePeer11]),H=I().range([a.cScaleLabel0,a.cScaleLabel1,a.cScaleLabel2,a.cScaleLabel3,a.cScaleLabel4,a.cScaleLabel5,a.cScaleLabel6,a.cScaleLabel7,a.cScaleLabel8,a.cScaleLabel9,a.cScaleLabel10,a.cScaleLabel11]);f&&x.append("text").attr("x",G/2).attr("y",z/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(f);let K=x.append("g").attr("transform",`translate(0, ${z})`).attr("class","treemapContainer"),De=de(R).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),Q=fe().size([q,U]).paddingTop(e=>e.children&&e.children.length>0?B+A:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?A:0).paddingRight(e=>e.children&&e.children.length>0?A:0).paddingBottom(e=>e.children&&e.children.length>0?A:0).round(!0)(De),ve=Q.descendants().filter(e=>e.children&&e.children.length>0),V=K.selectAll(".treemapSection").data(ve).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);V.append("rect").attr("width",e=>e.x1-e.x0).attr("height",B).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),V.append("clipPath").attr("id",(e,t)=>`clip-section-${r}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",B),V.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>M(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>Ce(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";let t=w({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),V.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",B/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,t)=>`url(#clip-section-${r}-${t})`).attr("style",e=>{if(e.depth===0)return"display: none;";let t="dominant-baseline: middle; font-size: 12px; fill:"+H(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",n=w({cssCompiledStyles:e.data.cssCompiledStyles});return t+n.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;let t=E(this),n=e.data.name;t.text(n);let g=e.x1-e.x0,u=6,h;s.showValues!==!1&&e.value?h=g-10-30-10-u:h=g-u-6;let c=Math.max(15,h),D=t.node();if(D.getComputedTextLength()>c){let v=n;for(;v.length>0;){if(v=n.substring(0,v.length-1),v.length===0){t.text("..."),D.getComputedTextLength()>c&&t.text("");break}if(t.text(v+"..."),D.getComputedTextLength()<=c)break}}}),s.showValues!==!1&&V.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",B/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?T(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";let t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+H(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",n=w({cssCompiledStyles:e.data.cssCompiledStyles});return t+n.labelStyles.replace("color:","fill:")});let Z=Q.leaves(),S=Z.length>20,we=S?16:38,_=S?14:28,N=S?4:8,$=S?4:6,O=S?2:4,ee=S?8:10,X=S?1:2,j=K.selectAll(".treemapLeafGroup").data(Z).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?M(e.parent.data.name):M(e.data.name)).attr("style",e=>w({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?M(e.parent.data.name):M(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,t)=>`clip-${r}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{let t=`text-anchor: middle; dominant-baseline: middle; font-size: ${we}px;fill:`+H(e.data.name)+";",n=w({cssCompiledStyles:e.data.cssCompiledStyles});return t+n.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.data.name).each(function(e){let t=E(this),n=e.x1-e.x0,g=e.y1-e.y0,u=t.node(),h=n-2*O,C=g-2*O;if(h<ee||C<ee){t.style("display","none");return}let c=parseInt(t.style("font-size"),10),D=.6;for(;u.getComputedTextLength()>h&&c>N;)c--,t.style("font-size",`${c}px`);let y=Math.max($,Math.min(_,Math.round(c*D))),b=c+X+y;for(;b>C&&c>N&&(c--,y=Math.max($,Math.min(_,Math.round(c*D))),!(y<$&&c===N));)t.style("font-size",`${c}px`),b=c+X+y,y<=$&&b>C;t.style("font-size",`${c}px`),S?(c<N||C<N)&&t.style("display","none"):(u.getComputedTextLength()>h||c<N||C<c)&&t.style("display","none")}),s.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",t=>(t.x1-t.x0)/2).attr("y",function(t){return(t.y1-t.y0)/2}).attr("style",t=>{let n=`text-anchor: middle; dominant-baseline: hanging; font-size: ${_}px;fill:`+H(t.data.name)+";",g=w({cssCompiledStyles:t.data.cssCompiledStyles});return n+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,n)=>`url(#clip-${r}-${n})`).text(t=>t.value?T(t.value):"").each(function(t){let n=E(this),g=this.parentNode;if(!g){n.style("display","none");return}let u=E(g).select(".treemapLabel");if(u.empty()||u.style("display")==="none"){n.style("display","none");return}let h=parseFloat(u.style("font-size")),c=Math.max($,Math.min(_,Math.round(h*.6)));n.style("font-size",`${c}px`);let y=(t.y1-t.y0)/2+h/2+X;n.attr("y",y);let b=t.x1-t.x0,te=t.y1-t.y0-4,Le=b-2*O;n.node().getComputedTextLength()>Le||y+c>te||c<$?n.style("display","none"):n.style("display",null)});let Ne=s.diagramPadding??8;he(x,Ne,"flowchart",s?.useMaxWidth||!1)},"draw"),Me=p(function(m,r){return r.db.getClasses()},"getClasses"),xe={draw:ze,getClasses:Me};var Ve={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ke=p(({treemap:m}={})=>{let r=ae(),i=L(),l=W(r,i.themeVariables),o=W(Ve,m),s=o.titleColor??l.titleColor,d=o.labelColor??l.textColor,f=o.valueColor??l.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${o.sectionStrokeColor};
4
+ stroke-width: ${o.sectionStrokeWidth};
5
+ fill: ${o.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${o.leafStrokeColor};
9
+ stroke-width: ${o.leafStrokeWidth};
10
+ fill: ${o.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${d};
14
+ font-size: ${o.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${f};
18
+ font-size: ${o.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${s};
22
+ font-size: ${o.titleFontSize};
23
+ }
24
+ `},"getStyles"),Te=ke;var St={parser:Y,get db(){return new F},renderer:xe,styles:Te};export{St as diagram};