@foris/ai-agent 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (394) hide show
  1. package/dist/abap-Y8Dl9g_6.js +6 -0
  2. package/dist/actionscript-3-DZzbMeqX.js +6 -0
  3. package/dist/ada-vP6ak0IW.js +6 -0
  4. package/dist/ai-agent.es.js +6 -1391
  5. package/dist/ai-agent.umd.js +3364 -103
  6. package/dist/ai-chat-panel/ChatPanel.d.ts +1 -1
  7. package/dist/ai-chat-panel/chatPanel.constants.d.ts +17 -0
  8. package/dist/andromeeda-BIpZ7gaU.js +4 -0
  9. package/dist/angular-html-DPB4Rf0C.js +32 -0
  10. package/dist/angular-ts-CeqPwKaz.js +24 -0
  11. package/dist/apache-BUjz-sD2.js +6 -0
  12. package/dist/apex-oLhhs58q.js +6 -0
  13. package/dist/apl-Bfz1rp5e.js +17 -0
  14. package/dist/applescript-BPx7YFFu.js +6 -0
  15. package/dist/ara-Z2fSOxSw.js +6 -0
  16. package/dist/arc-DN1xn8kz.js +85 -0
  17. package/dist/architectureDiagram-VXUJARFQ-CuFlEJrK.js +4674 -0
  18. package/dist/asciidoc-B-pCoB3G.js +6 -0
  19. package/dist/asm-BTWLY5ym.js +6 -0
  20. package/dist/astro-CFFExE8Q.js +18 -0
  21. package/dist/aurora-x-BwoVEUWZ.js +4 -0
  22. package/dist/awk-Fb0P9dkn.js +6 -0
  23. package/dist/ayu-dark-CxPZkpb2.js +4 -0
  24. package/dist/ballerina-oZK-YekG.js +6 -0
  25. package/dist/bat-0FvbqU9S.js +6 -0
  26. package/dist/beancount-DqJEb89h.js +6 -0
  27. package/dist/berry-DODBq_Ff.js +6 -0
  28. package/dist/bibtex-EULQRLY5.js +6 -0
  29. package/dist/bicep-BorU73w0.js +6 -0
  30. package/dist/blade-DRRSiTQz.js +21 -0
  31. package/dist/blockDiagram-VD42YOAC-Ceho4Zhj.js +2407 -0
  32. package/dist/bsl-NkNNwerW.js +8 -0
  33. package/dist/c-eeMepfLm.js +6 -0
  34. package/dist/c4Diagram-YG6GDRKO-zPB3iQJ7.js +1585 -0
  35. package/dist/cadence-02UX7mW8.js +6 -0
  36. package/dist/cairo-DM6WF2e3.js +8 -0
  37. package/dist/catppuccin-frappe-D3cH2rXe.js +4 -0
  38. package/dist/catppuccin-latte-C0LRGUW4.js +4 -0
  39. package/dist/catppuccin-macchiato-c5wQ11TT.js +4 -0
  40. package/dist/catppuccin-mocha-WMD6Qvya.js +4 -0
  41. package/dist/channel-BC4mWQQF.js +5 -0
  42. package/dist/chunk-4BX2VUAB-BZlHuf6l.js +9 -0
  43. package/dist/chunk-55IACEB6-Dr8rgvy_.js +8 -0
  44. package/dist/chunk-B4BG7PRW-Ccllo2e-.js +1377 -0
  45. package/dist/chunk-DI55MBZ5-DvAROTIr.js +1383 -0
  46. package/dist/chunk-FMBD7UC4-CVr83prI.js +19 -0
  47. package/dist/chunk-QN33PNHL-nSyFq8_s.js +20 -0
  48. package/dist/chunk-QZHKN3VN-Dg8JYP6e.js +15 -0
  49. package/dist/chunk-TZMSLE5B-Bmj6LGNW.js +64 -0
  50. package/dist/clarity-PKm5CwqM.js +6 -0
  51. package/dist/classDiagram-2ON5EDUG-DAkxtl6o.js +22 -0
  52. package/dist/classDiagram-v2-WZHVMYZB-DAkxtl6o.js +22 -0
  53. package/dist/clojure-CXJfHrL3.js +6 -0
  54. package/dist/cmake-BJz8BOTU.js +6 -0
  55. package/dist/cobol-DYTFdEK1.js +12 -0
  56. package/dist/code-block-QI2IAROF-DN-BnDmt.js +9263 -0
  57. package/dist/codeowners-Bt9yU6NX.js +6 -0
  58. package/dist/codeql-DHkodjjI.js +6 -0
  59. package/dist/coffee-DGBR_nr_.js +8 -0
  60. package/dist/common-lisp-EVqT9Zhp.js +6 -0
  61. package/dist/components/ai-elements/artifact.d.ts +23 -0
  62. package/dist/components/ai-elements/canvas.d.ts +7 -0
  63. package/dist/components/ai-elements/chain-of-thought.d.ts +29 -0
  64. package/dist/components/ai-elements/checkpoint.d.ts +11 -0
  65. package/dist/components/ai-elements/code-block.d.ts +17 -0
  66. package/dist/components/ai-elements/confirmation.d.ts +49 -0
  67. package/dist/components/ai-elements/connection.d.ts +2 -0
  68. package/dist/components/ai-elements/context.d.ts +32 -0
  69. package/dist/components/ai-elements/controls.d.ts +4 -0
  70. package/dist/components/ai-elements/conversation.d.ts +15 -0
  71. package/dist/components/ai-elements/edge.d.ts +5 -0
  72. package/dist/components/ai-elements/image.d.ts +6 -0
  73. package/dist/components/ai-elements/inline-citation.d.ts +38 -0
  74. package/dist/components/ai-elements/loader.d.ts +5 -0
  75. package/dist/components/ai-elements/message.d.ts +46 -0
  76. package/dist/components/ai-elements/model-selector.d.ts +35 -0
  77. package/dist/components/ai-elements/node.d.ts +21 -0
  78. package/dist/components/ai-elements/open-in-chat.d.ts +28 -0
  79. package/dist/components/ai-elements/panel.d.ts +5 -0
  80. package/dist/components/ai-elements/plan.d.ts +25 -0
  81. package/dist/components/ai-elements/prompt-input.d.ts +187 -0
  82. package/dist/components/ai-elements/queue.d.ts +61 -0
  83. package/dist/components/ai-elements/reasoning.d.ts +26 -0
  84. package/dist/components/ai-elements/shimmer.d.ts +9 -0
  85. package/dist/components/ai-elements/sources.d.ts +12 -0
  86. package/dist/components/ai-elements/suggestion.d.ts +10 -0
  87. package/dist/components/ai-elements/task.d.ts +14 -0
  88. package/dist/components/ai-elements/tool.d.ts +23 -0
  89. package/dist/components/ai-elements/toolbar.d.ts +5 -0
  90. package/dist/components/ai-elements/web-preview.d.ts +34 -0
  91. package/dist/components/ui/alert.d.ts +9 -0
  92. package/dist/components/ui/badge.d.ts +9 -0
  93. package/dist/components/ui/button-group.d.ts +12 -0
  94. package/dist/components/ui/button.d.ts +10 -0
  95. package/dist/components/ui/card.d.ts +9 -0
  96. package/dist/components/ui/carousel.d.ts +19 -0
  97. package/dist/components/ui/collapsible.d.ts +6 -0
  98. package/dist/components/ui/command.d.ts +18 -0
  99. package/dist/components/ui/dialog.d.ts +15 -0
  100. package/dist/components/ui/dropdown-menu.d.ts +25 -0
  101. package/dist/components/ui/hover-card.d.ts +6 -0
  102. package/dist/components/ui/input-group.d.ts +16 -0
  103. package/dist/components/ui/input.d.ts +3 -0
  104. package/dist/components/ui/progress.d.ts +4 -0
  105. package/dist/components/ui/scroll-area.d.ts +5 -0
  106. package/dist/components/ui/select.d.ts +15 -0
  107. package/dist/components/ui/separator.d.ts +4 -0
  108. package/dist/components/ui/textarea.d.ts +3 -0
  109. package/dist/components/ui/tooltip.d.ts +7 -0
  110. package/dist/coq-B0L9upzn.js +6 -0
  111. package/dist/cose-bilkent-S5V4N54A-DwRYWoaW.js +2612 -0
  112. package/dist/cpp-ZFnOq6fV.js +19 -0
  113. package/dist/crystal-CRJyc4G-.js +18 -0
  114. package/dist/csharp-C7yUs7-w.js +6 -0
  115. package/dist/css-CECN5uSL.js +6 -0
  116. package/dist/csv-CmYOceLb.js +6 -0
  117. package/dist/cue-ZzumE7IT.js +6 -0
  118. package/dist/cypher-jpdmjtA6.js +6 -0
  119. package/dist/cytoscape.esm-ClN43hhW.js +18846 -0
  120. package/dist/d-CBagWSwH.js +6 -0
  121. package/dist/dagre-6UL2VRFP-imN1Fyg8.js +451 -0
  122. package/dist/dark-plus-pUHDTVV0.js +4 -0
  123. package/dist/dart-6ObCrKr9.js +6 -0
  124. package/dist/dax-CcDT-8dH.js +6 -0
  125. package/dist/defaultLocale-DcQU6Vee.js +177 -0
  126. package/dist/desktop-B93p9R9O.js +6 -0
  127. package/dist/diagram-PSM6KHXK-DAIDeBLn.js +544 -0
  128. package/dist/diagram-QEK2KX5R-DQFy-qK9.js +224 -0
  129. package/dist/diagram-S2PKOQOG-Hlk0Nx_Y.js +146 -0
  130. package/dist/diff-BxzP2J8R.js +6 -0
  131. package/dist/docker-CsHqm9tx.js +6 -0
  132. package/dist/dotenv-BMjVjUL1.js +6 -0
  133. package/dist/dracula-BtZx2Kac.js +4 -0
  134. package/dist/dracula-soft-BKa-aqBv.js +4 -0
  135. package/dist/dream-maker-PAx17jaB.js +6 -0
  136. package/dist/edge-B882-fmN.js +14 -0
  137. package/dist/elixir-DRzNHQCz.js +10 -0
  138. package/dist/elm-DZPAA5Qn.js +9 -0
  139. package/dist/emacs-lisp-Cfxdx5D-.js +6 -0
  140. package/dist/erDiagram-Q2GNP2WA-C8PZPSaf.js +846 -0
  141. package/dist/erb-DB1DqdBc.js +27 -0
  142. package/dist/erlang-DNcDT8Hi.js +8 -0
  143. package/dist/everforest-dark-DMCBqXCK.js +4 -0
  144. package/dist/everforest-light-BbXl82Em.js +4 -0
  145. package/dist/fennel-N4WcXuKx.js +6 -0
  146. package/dist/fish-BTDEUgqH.js +6 -0
  147. package/dist/flowDiagram-NV44I4VS-CgTiIFnt.js +1631 -0
  148. package/dist/fluent-BMXUxfv1.js +6 -0
  149. package/dist/fortran-fixed-form-DUsA-VGo.js +8 -0
  150. package/dist/fortran-free-form-DPIT_jbP.js +6 -0
  151. package/dist/fsharp-CYOiIVNx.js +8 -0
  152. package/dist/ganttDiagram-JELNMOA3-DzYZEAE_.js +2702 -0
  153. package/dist/gdresource-BwtMIoBm.js +10 -0
  154. package/dist/gdscript-BifyeYhI.js +6 -0
  155. package/dist/gdshader-Bk8fF6yr.js +6 -0
  156. package/dist/genie-DzUvd7U9.js +6 -0
  157. package/dist/gherkin-DHRaV0YP.js +6 -0
  158. package/dist/git-commit-Bd32YZ0K.js +8 -0
  159. package/dist/git-rebase-ZWUFO_T4.js +8 -0
  160. package/dist/gitGraphDiagram-NY62KEGX-CPwI-Uag.js +715 -0
  161. package/dist/github-dark-DenFmJkN.js +4 -0
  162. package/dist/github-dark-default-BJPUVz4H.js +4 -0
  163. package/dist/github-dark-dimmed-DUshB20C.js +4 -0
  164. package/dist/github-dark-high-contrast-D3aGCnF8.js +4 -0
  165. package/dist/github-light-JYsPkUQd.js +4 -0
  166. package/dist/github-light-default-D99KPAby.js +4 -0
  167. package/dist/github-light-high-contrast-BbmZE-Mp.js +4 -0
  168. package/dist/gleam-Bv284lvN.js +6 -0
  169. package/dist/glimmer-js-DkxNrfPT.js +14 -0
  170. package/dist/glimmer-ts-D6YZEmK_.js +14 -0
  171. package/dist/glsl-CkUcVZNK.js +8 -0
  172. package/dist/gnuplot-yPG9-sE_.js +6 -0
  173. package/dist/go-ChxJuLYK.js +6 -0
  174. package/dist/graph-DB2UxkYH.js +1190 -0
  175. package/dist/graphql-CBu2ehBn.js +14 -0
  176. package/dist/groovy-CJQTphOW.js +6 -0
  177. package/dist/gruvbox-dark-hard-C5HOtKIh.js +4 -0
  178. package/dist/gruvbox-dark-medium-FVgwJHuz.js +4 -0
  179. package/dist/gruvbox-dark-soft-B46F314v.js +4 -0
  180. package/dist/gruvbox-light-hard-CJD38wDZ.js +4 -0
  181. package/dist/gruvbox-light-medium-BlIhMYTA.js +4 -0
  182. package/dist/gruvbox-light-soft-DoPHyLVZ.js +4 -0
  183. package/dist/hack-DVWgrvc2.js +12 -0
  184. package/dist/haml-NZLVzu_R.js +10 -0
  185. package/dist/handlebars-mxStpSE7.js +14 -0
  186. package/dist/haskell-WeIwNIP6.js +6 -0
  187. package/dist/haxe-TztHsm5T.js +6 -0
  188. package/dist/hcl-D438OF-I.js +6 -0
  189. package/dist/hjson-DYBUbqOl.js +6 -0
  190. package/dist/hlsl-Bk8TCZNL.js +6 -0
  191. package/dist/houston-BDYrDoDW.js +4 -0
  192. package/dist/html-B50bmoVb.js +10 -0
  193. package/dist/html-derivative-ByyNxAP5.js +10 -0
  194. package/dist/http-BVIWqb92.js +19 -0
  195. package/dist/hurl-B8OTiYoQ.js +17 -0
  196. package/dist/hxml-GbqSQCLa.js +8 -0
  197. package/dist/hy-Brt5EZ7-.js +6 -0
  198. package/dist/imba-CimUv-Uh.js +6 -0
  199. package/dist/index-C2DJ8qoy.js +45435 -0
  200. package/dist/infoDiagram-WHAUD3N6-CcN7ZNYI.js +27 -0
  201. package/dist/ini-BZIuRIvJ.js +6 -0
  202. package/dist/init-DjUOC4st.js +16 -0
  203. package/dist/java-DY6VlHhP.js +6 -0
  204. package/dist/javascript-C25yR2R2.js +6 -0
  205. package/dist/jinja-CI-LSgSv.js +13 -0
  206. package/dist/jison-DdreslRX.js +8 -0
  207. package/dist/journeyDiagram-XKPGCS4Q-BACao6jz.js +840 -0
  208. package/dist/json-DxJze_jm.js +6 -0
  209. package/dist/json5-BT4Fjg39.js +6 -0
  210. package/dist/jsonc-CHjZD8gR.js +6 -0
  211. package/dist/jsonl-BGuvDmy9.js +6 -0
  212. package/dist/jsonnet-Bx2cfsXg.js +6 -0
  213. package/dist/jssm-BcADi6EI.js +6 -0
  214. package/dist/jsx-BtKADgXT.js +6 -0
  215. package/dist/julia-ll8P6QXy.js +19 -0
  216. package/dist/kanagawa-dragon-CiKur4Hl.js +4 -0
  217. package/dist/kanagawa-lotus-BKu-smKu.js +4 -0
  218. package/dist/kanagawa-wave-CQwozSzG.js +4 -0
  219. package/dist/kanban-definition-3W4ZIXB7-Jb7Xwf92.js +724 -0
  220. package/dist/katex.min-l0sNRNKZ.js +1 -0
  221. package/dist/kdl-BNOv9TC3.js +6 -0
  222. package/dist/kotlin-ByBMgTeR.js +6 -0
  223. package/dist/kusto-VWFLl2T0.js +6 -0
  224. package/dist/laserwave-6a00oqik.js +4 -0
  225. package/dist/latex-DF20280u.js +9 -0
  226. package/dist/layout-Q6wQN5dr.js +1730 -0
  227. package/dist/lean-D5yRrexI.js +6 -0
  228. package/dist/less-B1GLI2Di.js +6 -0
  229. package/dist/lib/utils.d.ts +2 -0
  230. package/dist/light-plus-CZuVqSLX.js +4 -0
  231. package/dist/linear-CxGB80S5.js +277 -0
  232. package/dist/liquid-CHzkx3jT.js +14 -0
  233. package/dist/llvm-co1rIKs3.js +6 -0
  234. package/dist/log-Al8wyEFV.js +6 -0
  235. package/dist/logo-DBa4JDzV.js +6 -0
  236. package/dist/lua-kX5WP_P5.js +8 -0
  237. package/dist/luau-DtBSxLyz.js +6 -0
  238. package/dist/make-CsMclxtr.js +6 -0
  239. package/dist/markdown-CrScaQ96.js +6 -0
  240. package/dist/marko-ls0Jg2j8.js +14 -0
  241. package/dist/material-theme-D6KBX41T.js +4 -0
  242. package/dist/material-theme-darker-CkRroheE.js +4 -0
  243. package/dist/material-theme-lighter-BUBw43Yz.js +4 -0
  244. package/dist/material-theme-ocean-ClGX14Ja.js +4 -0
  245. package/dist/material-theme-palenight-C1RVm8K1.js +4 -0
  246. package/dist/matlab-BOAaUVP0.js +6 -0
  247. package/dist/mdc-DIP5_jeM.js +15 -0
  248. package/dist/mdx-BOhZZUJ8.js +6 -0
  249. package/dist/mermaid-B0ixDHKN.js +6 -0
  250. package/dist/mermaid-NA5CF7SZ-DekDSZe_.js +6 -0
  251. package/dist/mermaid.core-xMGW442o.js +14414 -0
  252. package/dist/min-dark-C7ak0t6c.js +4 -0
  253. package/dist/min-light-CKFxVcPp.js +4 -0
  254. package/dist/mindmap-definition-VGOIOE7T-UHZgRHb7.js +790 -0
  255. package/dist/mipsasm-CTx18fBl.js +6 -0
  256. package/dist/mojo-BD611d7o.js +6 -0
  257. package/dist/monokai-C1KBYcO0.js +4 -0
  258. package/dist/move-F-dICmj2.js +6 -0
  259. package/dist/narrat-DmhDCBs-.js +6 -0
  260. package/dist/nextflow-DmSVRGjG.js +6 -0
  261. package/dist/nginx-COxS3qoU.js +9 -0
  262. package/dist/night-owl-Bm2rzalh.js +4 -0
  263. package/dist/nim-CCwXZLHG.js +21 -0
  264. package/dist/nix-BZK5F767.js +9 -0
  265. package/dist/nord-CC5OiUXg.js +4 -0
  266. package/dist/nushell-D8j3dhT-.js +6 -0
  267. package/dist/objective-c-Itk8tzmv.js +6 -0
  268. package/dist/objective-cpp-DGt5UKRO.js +6 -0
  269. package/dist/ocaml-eSVK32Eg.js +6 -0
  270. package/dist/one-dark-pro-DTA3VF0_.js +4 -0
  271. package/dist/one-light-D9sNaUtq.js +4 -0
  272. package/dist/openscad-Sp5uZ6f2.js +6 -0
  273. package/dist/ordinal-MUacOSdK.js +65 -0
  274. package/dist/pascal-xy8pJNns.js +6 -0
  275. package/dist/perl-NvKK8p2P.js +17 -0
  276. package/dist/php-CK5hNnT0.js +19 -0
  277. package/dist/pieDiagram-ADFJNKIX-CHrTFTbw.js +166 -0
  278. package/dist/pkl-C-zSNmaA.js +6 -0
  279. package/dist/plastic-CSTz3KZp.js +4 -0
  280. package/dist/plsql-pVbGZfOv.js +6 -0
  281. package/dist/po-BNfHvqmm.js +6 -0
  282. package/dist/poimandres-C-VADXHD.js +4 -0
  283. package/dist/polar-CAZahv3u.js +6 -0
  284. package/dist/postcss-05aHdL-n.js +6 -0
  285. package/dist/powerquery-DI9HkTvs.js +6 -0
  286. package/dist/powershell-Clc4ydu-.js +6 -0
  287. package/dist/prisma-FZjmVtSl.js +6 -0
  288. package/dist/prolog-C5-yg4TO.js +6 -0
  289. package/dist/proto-MmCPeFAD.js +6 -0
  290. package/dist/pug-XOw9Q1Ho.js +12 -0
  291. package/dist/puppet-CUJHmnxV.js +6 -0
  292. package/dist/purescript-rUfGld-4.js +6 -0
  293. package/dist/python-BFNSHbwJ.js +6 -0
  294. package/dist/qml-rTNXsquU.js +8 -0
  295. package/dist/qmldir-BInDYbpo.js +6 -0
  296. package/dist/qss-AeJTysr_.js +6 -0
  297. package/dist/quadrantDiagram-AYHSOK5B-CDfhMB18.js +1030 -0
  298. package/dist/r-Bm0uF0U2.js +6 -0
  299. package/dist/racket-B83wSAja.js +6 -0
  300. package/dist/raku-nEQ4ZJJ7.js +6 -0
  301. package/dist/razor-CoqPuKQU.js +12 -0
  302. package/dist/red-7y8PH7HH.js +4 -0
  303. package/dist/reg-m_s_Kiip.js +6 -0
  304. package/dist/regexp-BazyLpPg.js +6 -0
  305. package/dist/rel-BcRfyd6Q.js +6 -0
  306. package/dist/requirementDiagram-UZGBJVZJ-C0aeVQh6.js +856 -0
  307. package/dist/riscv-Ce8MAQLP.js +6 -0
  308. package/dist/rose-pine-BKc3yVeu.js +4 -0
  309. package/dist/rose-pine-dawn-BulJcPZT.js +4 -0
  310. package/dist/rose-pine-moon-j6jiXKV8.js +4 -0
  311. package/dist/rosmsg-Cz0w1km8.js +6 -0
  312. package/dist/rst-AoEjemIj.js +36 -0
  313. package/dist/ruby-CGSl8JoB.js +36 -0
  314. package/dist/rust-CLzF9zIN.js +6 -0
  315. package/dist/sankeyDiagram-TZEHDZUN-kjxRgXd2.js +830 -0
  316. package/dist/sas-fpEvgATw.js +8 -0
  317. package/dist/sass-DxHp5rTx.js +6 -0
  318. package/dist/scala-D4grkFkl.js +6 -0
  319. package/dist/scheme-BCRWuEm4.js +6 -0
  320. package/dist/scss-B1FaCqwR.js +8 -0
  321. package/dist/sdbl-B7T8abf4.js +6 -0
  322. package/dist/sequenceDiagram-WL72ISMW-Bs0jyVuH.js +2526 -0
  323. package/dist/shaderlab-Cr62-Wb4.js +8 -0
  324. package/dist/shellscript-InADTalH.js +6 -0
  325. package/dist/shellsession-DiDJNQdy.js +8 -0
  326. package/dist/slack-dark-i7wN4OET.js +4 -0
  327. package/dist/slack-ochin-ndHf0LoP.js +4 -0
  328. package/dist/smalltalk-BlI1_OkM.js +6 -0
  329. package/dist/snazzy-light-BlSJXAu4.js +4 -0
  330. package/dist/solarized-dark-UTmkh7lw.js +4 -0
  331. package/dist/solarized-light-BheCkDPT.js +4 -0
  332. package/dist/solidity-DUWnFhS6.js +6 -0
  333. package/dist/soy-YPoZ1G2p.js +10 -0
  334. package/dist/sparql-B0KWFEri.js +8 -0
  335. package/dist/splunk-CRXR8A9s.js +6 -0
  336. package/dist/sql-Cn_v3PB0.js +6 -0
  337. package/dist/ssh-config-DP-hNVbF.js +6 -0
  338. package/dist/stata-B8c5fTjX.js +8 -0
  339. package/dist/stateDiagram-FKZM4ZOC-CAWwlh9R.js +268 -0
  340. package/dist/stateDiagram-v2-4FDKWEC3-9TYlTzc3.js +21 -0
  341. package/dist/style.css +1 -1
  342. package/dist/stylus-CyKEU1Ej.js +6 -0
  343. package/dist/svelte-5UasyOg7.js +14 -0
  344. package/dist/swift-9UzSvamq.js +6 -0
  345. package/dist/synthwave-84-NU3C_KFZ.js +4 -0
  346. package/dist/system-verilog-BCm7smPJ.js +6 -0
  347. package/dist/systemd-C-4qm6XH.js +6 -0
  348. package/dist/tailwind.css +126 -0
  349. package/dist/talonscript-CFF3LF_O.js +6 -0
  350. package/dist/tasl-Cg_WBUAe.js +6 -0
  351. package/dist/tcl-DN7buRTF.js +6 -0
  352. package/dist/templ-peLZIM2D.js +12 -0
  353. package/dist/terraform-DGvcn9zM.js +6 -0
  354. package/dist/tex-DpOayVob.js +8 -0
  355. package/dist/timeline-definition-IT6M3QCI-DrPozOxH.js +805 -0
  356. package/dist/tokyo-night-DP4TmcQl.js +4 -0
  357. package/dist/toml-DY62mUL_.js +6 -0
  358. package/dist/treemap-KMMF4GRG-D_L55G0b.js +15045 -0
  359. package/dist/ts-tags-CWmBp2js.js +43 -0
  360. package/dist/tsv-BtvSkaG0.js +6 -0
  361. package/dist/tsx-B8rCNbgL.js +6 -0
  362. package/dist/turtle-_H59FV7D.js +6 -0
  363. package/dist/twig-Cpoho6oi.js +35 -0
  364. package/dist/typescript-RycA9KXf.js +6 -0
  365. package/dist/typespec-DWqp-kUU.js +6 -0
  366. package/dist/typst-D_1QKWns.js +6 -0
  367. package/dist/v-BPCNiyYe.js +6 -0
  368. package/dist/vala-uxaPR7d1.js +6 -0
  369. package/dist/vb-D8_c5-KN.js +6 -0
  370. package/dist/verilog-B-bybjPF.js +6 -0
  371. package/dist/vesper-BckBta1U.js +4 -0
  372. package/dist/vhdl-CUlNa8ac.js +6 -0
  373. package/dist/viml-DsfA-sWm.js +6 -0
  374. package/dist/vitesse-black-BoGvW84i.js +4 -0
  375. package/dist/vitesse-dark-Cym-eLtO.js +4 -0
  376. package/dist/vitesse-light-CcmG315c.js +4 -0
  377. package/dist/vue-DmFKWfEU.js +31 -0
  378. package/dist/vue-html-BB2aI7Yc.js +15 -0
  379. package/dist/vue-vine-CznNap4x.js +24 -0
  380. package/dist/vyper-CPQuu50u.js +6 -0
  381. package/dist/wasm-BBXxrAl7.js +6 -0
  382. package/dist/wasm-DQxwEHae.js +7 -0
  383. package/dist/wenyan-pbVjoM9_.js +6 -0
  384. package/dist/wgsl-DY4iK1q1.js +6 -0
  385. package/dist/wikitext-Z-MoUasO.js +6 -0
  386. package/dist/wit-CQMQOlTg.js +6 -0
  387. package/dist/wolfram-Dz4KXISs.js +6 -0
  388. package/dist/xml-C2J0sS9M.js +8 -0
  389. package/dist/xsl-CbTBIiv3.js +9 -0
  390. package/dist/xychartDiagram-PRI3JC2R-BkO8dJff.js +1345 -0
  391. package/dist/yaml-DaO7k5B1.js +6 -0
  392. package/dist/zenscript-CxBjpf9c.js +6 -0
  393. package/dist/zig-Vm0PO9wB.js +6 -0
  394. package/package.json +35 -7
@@ -0,0 +1,4674 @@
1
+ import { C as Ze, s as ke, g as qe, n as Qe, o as Je, b as Ke, c as je, _ as dt, t as _e, D as tr, E as er, ax as rr, ay as ir, l as Re, j as ar, H as nr, W as or, r as sr, az as ye, d as Ee, aA as ve, i as hr } from "./mermaid.core-xMGW442o.js";
2
+ import { p as lr } from "./chunk-4BX2VUAB-BZlHuf6l.js";
3
+ import { p as fr } from "./treemap-KMMF4GRG-D_L55G0b.js";
4
+ import { c as Se } from "./cytoscape.esm-ClN43hhW.js";
5
+ import { c as me, g as cr } from "./index-C2DJ8qoy.js";
6
+ import "react";
7
+ import "react-dom";
8
+ var Fe = { exports: {} }, ue = { exports: {} }, de = { exports: {} }, we;
9
+ function gr() {
10
+ return we || (we = 1, function(I, D) {
11
+ (function(P, N) {
12
+ I.exports = N();
13
+ })(me, function() {
14
+ return (
15
+ /******/
16
+ function(A) {
17
+ var P = {};
18
+ function N(u) {
19
+ if (P[u])
20
+ return P[u].exports;
21
+ var h = P[u] = {
22
+ /******/
23
+ i: u,
24
+ /******/
25
+ l: !1,
26
+ /******/
27
+ exports: {}
28
+ /******/
29
+ };
30
+ return A[u].call(h.exports, h, h.exports, N), h.l = !0, h.exports;
31
+ }
32
+ return N.m = A, N.c = P, N.i = function(u) {
33
+ return u;
34
+ }, N.d = function(u, h, a) {
35
+ N.o(u, h) || Object.defineProperty(u, h, {
36
+ /******/
37
+ configurable: !1,
38
+ /******/
39
+ enumerable: !0,
40
+ /******/
41
+ get: a
42
+ /******/
43
+ });
44
+ }, N.n = function(u) {
45
+ var h = u && u.__esModule ? (
46
+ /******/
47
+ function() {
48
+ return u.default;
49
+ }
50
+ ) : (
51
+ /******/
52
+ function() {
53
+ return u;
54
+ }
55
+ );
56
+ return N.d(h, "a", h), h;
57
+ }, N.o = function(u, h) {
58
+ return Object.prototype.hasOwnProperty.call(u, h);
59
+ }, N.p = "", N(N.s = 28);
60
+ }([
61
+ /* 0 */
62
+ /***/
63
+ function(A, P, N) {
64
+ function u() {
65
+ }
66
+ u.QUALITY = 1, u.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, u.DEFAULT_INCREMENTAL = !1, u.DEFAULT_ANIMATION_ON_LAYOUT = !0, u.DEFAULT_ANIMATION_DURING_LAYOUT = !1, u.DEFAULT_ANIMATION_PERIOD = 50, u.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, u.DEFAULT_GRAPH_MARGIN = 15, u.NODE_DIMENSIONS_INCLUDE_LABELS = !1, u.SIMPLE_NODE_SIZE = 40, u.SIMPLE_NODE_HALF_SIZE = u.SIMPLE_NODE_SIZE / 2, u.EMPTY_COMPOUND_NODE_SIZE = 40, u.MIN_EDGE_LENGTH = 1, u.WORLD_BOUNDARY = 1e6, u.INITIAL_WORLD_BOUNDARY = u.WORLD_BOUNDARY / 1e3, u.WORLD_CENTER_X = 1200, u.WORLD_CENTER_Y = 900, A.exports = u;
67
+ },
68
+ /* 1 */
69
+ /***/
70
+ function(A, P, N) {
71
+ var u = N(2), h = N(8), a = N(9);
72
+ function r(f, i, g) {
73
+ u.call(this, g), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = g, this.bendpoints = [], this.source = f, this.target = i;
74
+ }
75
+ r.prototype = Object.create(u.prototype);
76
+ for (var e in u)
77
+ r[e] = u[e];
78
+ r.prototype.getSource = function() {
79
+ return this.source;
80
+ }, r.prototype.getTarget = function() {
81
+ return this.target;
82
+ }, r.prototype.isInterGraph = function() {
83
+ return this.isInterGraph;
84
+ }, r.prototype.getLength = function() {
85
+ return this.length;
86
+ }, r.prototype.isOverlapingSourceAndTarget = function() {
87
+ return this.isOverlapingSourceAndTarget;
88
+ }, r.prototype.getBendpoints = function() {
89
+ return this.bendpoints;
90
+ }, r.prototype.getLca = function() {
91
+ return this.lca;
92
+ }, r.prototype.getSourceInLca = function() {
93
+ return this.sourceInLca;
94
+ }, r.prototype.getTargetInLca = function() {
95
+ return this.targetInLca;
96
+ }, r.prototype.getOtherEnd = function(f) {
97
+ if (this.source === f)
98
+ return this.target;
99
+ if (this.target === f)
100
+ return this.source;
101
+ throw "Node is not incident with this edge";
102
+ }, r.prototype.getOtherEndInGraph = function(f, i) {
103
+ for (var g = this.getOtherEnd(f), t = i.getGraphManager().getRoot(); ; ) {
104
+ if (g.getOwner() == i)
105
+ return g;
106
+ if (g.getOwner() == t)
107
+ break;
108
+ g = g.getOwner().getParent();
109
+ }
110
+ return null;
111
+ }, r.prototype.updateLength = function() {
112
+ var f = new Array(4);
113
+ this.isOverlapingSourceAndTarget = h.getIntersection(this.target.getRect(), this.source.getRect(), f), this.isOverlapingSourceAndTarget || (this.lengthX = f[0] - f[2], this.lengthY = f[1] - f[3], Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
114
+ }, r.prototype.updateLengthSimple = function() {
115
+ this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
116
+ }, A.exports = r;
117
+ },
118
+ /* 2 */
119
+ /***/
120
+ function(A, P, N) {
121
+ function u(h) {
122
+ this.vGraphObject = h;
123
+ }
124
+ A.exports = u;
125
+ },
126
+ /* 3 */
127
+ /***/
128
+ function(A, P, N) {
129
+ var u = N(2), h = N(10), a = N(13), r = N(0), e = N(16), f = N(5);
130
+ function i(t, o, s, c) {
131
+ s == null && c == null && (c = o), u.call(this, c), t.graphManager != null && (t = t.graphManager), this.estimatedSize = h.MIN_VALUE, this.inclusionTreeDepth = h.MAX_VALUE, this.vGraphObject = c, this.edges = [], this.graphManager = t, s != null && o != null ? this.rect = new a(o.x, o.y, s.width, s.height) : this.rect = new a();
132
+ }
133
+ i.prototype = Object.create(u.prototype);
134
+ for (var g in u)
135
+ i[g] = u[g];
136
+ i.prototype.getEdges = function() {
137
+ return this.edges;
138
+ }, i.prototype.getChild = function() {
139
+ return this.child;
140
+ }, i.prototype.getOwner = function() {
141
+ return this.owner;
142
+ }, i.prototype.getWidth = function() {
143
+ return this.rect.width;
144
+ }, i.prototype.setWidth = function(t) {
145
+ this.rect.width = t;
146
+ }, i.prototype.getHeight = function() {
147
+ return this.rect.height;
148
+ }, i.prototype.setHeight = function(t) {
149
+ this.rect.height = t;
150
+ }, i.prototype.getCenterX = function() {
151
+ return this.rect.x + this.rect.width / 2;
152
+ }, i.prototype.getCenterY = function() {
153
+ return this.rect.y + this.rect.height / 2;
154
+ }, i.prototype.getCenter = function() {
155
+ return new f(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
156
+ }, i.prototype.getLocation = function() {
157
+ return new f(this.rect.x, this.rect.y);
158
+ }, i.prototype.getRect = function() {
159
+ return this.rect;
160
+ }, i.prototype.getDiagonal = function() {
161
+ return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
162
+ }, i.prototype.getHalfTheDiagonal = function() {
163
+ return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
164
+ }, i.prototype.setRect = function(t, o) {
165
+ this.rect.x = t.x, this.rect.y = t.y, this.rect.width = o.width, this.rect.height = o.height;
166
+ }, i.prototype.setCenter = function(t, o) {
167
+ this.rect.x = t - this.rect.width / 2, this.rect.y = o - this.rect.height / 2;
168
+ }, i.prototype.setLocation = function(t, o) {
169
+ this.rect.x = t, this.rect.y = o;
170
+ }, i.prototype.moveBy = function(t, o) {
171
+ this.rect.x += t, this.rect.y += o;
172
+ }, i.prototype.getEdgeListToNode = function(t) {
173
+ var o = [], s = this;
174
+ return s.edges.forEach(function(c) {
175
+ if (c.target == t) {
176
+ if (c.source != s)
177
+ throw "Incorrect edge source!";
178
+ o.push(c);
179
+ }
180
+ }), o;
181
+ }, i.prototype.getEdgesBetween = function(t) {
182
+ var o = [], s = this;
183
+ return s.edges.forEach(function(c) {
184
+ if (!(c.source == s || c.target == s))
185
+ throw "Incorrect edge source and/or target";
186
+ (c.target == t || c.source == t) && o.push(c);
187
+ }), o;
188
+ }, i.prototype.getNeighborsList = function() {
189
+ var t = /* @__PURE__ */ new Set(), o = this;
190
+ return o.edges.forEach(function(s) {
191
+ if (s.source == o)
192
+ t.add(s.target);
193
+ else {
194
+ if (s.target != o)
195
+ throw "Incorrect incidency!";
196
+ t.add(s.source);
197
+ }
198
+ }), t;
199
+ }, i.prototype.withChildren = function() {
200
+ var t = /* @__PURE__ */ new Set(), o, s;
201
+ if (t.add(this), this.child != null)
202
+ for (var c = this.child.getNodes(), l = 0; l < c.length; l++)
203
+ o = c[l], s = o.withChildren(), s.forEach(function(T) {
204
+ t.add(T);
205
+ });
206
+ return t;
207
+ }, i.prototype.getNoOfChildren = function() {
208
+ var t = 0, o;
209
+ if (this.child == null)
210
+ t = 1;
211
+ else
212
+ for (var s = this.child.getNodes(), c = 0; c < s.length; c++)
213
+ o = s[c], t += o.getNoOfChildren();
214
+ return t == 0 && (t = 1), t;
215
+ }, i.prototype.getEstimatedSize = function() {
216
+ if (this.estimatedSize == h.MIN_VALUE)
217
+ throw "assert failed";
218
+ return this.estimatedSize;
219
+ }, i.prototype.calcEstimatedSize = function() {
220
+ return this.child == null ? this.estimatedSize = (this.rect.width + this.rect.height) / 2 : (this.estimatedSize = this.child.calcEstimatedSize(), this.rect.width = this.estimatedSize, this.rect.height = this.estimatedSize, this.estimatedSize);
221
+ }, i.prototype.scatter = function() {
222
+ var t, o, s = -r.INITIAL_WORLD_BOUNDARY, c = r.INITIAL_WORLD_BOUNDARY;
223
+ t = r.WORLD_CENTER_X + e.nextDouble() * (c - s) + s;
224
+ var l = -r.INITIAL_WORLD_BOUNDARY, T = r.INITIAL_WORLD_BOUNDARY;
225
+ o = r.WORLD_CENTER_Y + e.nextDouble() * (T - l) + l, this.rect.x = t, this.rect.y = o;
226
+ }, i.prototype.updateBounds = function() {
227
+ if (this.getChild() == null)
228
+ throw "assert failed";
229
+ if (this.getChild().getNodes().length != 0) {
230
+ var t = this.getChild();
231
+ if (t.updateBounds(!0), this.rect.x = t.getLeft(), this.rect.y = t.getTop(), this.setWidth(t.getRight() - t.getLeft()), this.setHeight(t.getBottom() - t.getTop()), r.NODE_DIMENSIONS_INCLUDE_LABELS) {
232
+ var o = t.getRight() - t.getLeft(), s = t.getBottom() - t.getTop();
233
+ this.labelWidth && (this.labelPosHorizontal == "left" ? (this.rect.x -= this.labelWidth, this.setWidth(o + this.labelWidth)) : this.labelPosHorizontal == "center" && this.labelWidth > o ? (this.rect.x -= (this.labelWidth - o) / 2, this.setWidth(this.labelWidth)) : this.labelPosHorizontal == "right" && this.setWidth(o + this.labelWidth)), this.labelHeight && (this.labelPosVertical == "top" ? (this.rect.y -= this.labelHeight, this.setHeight(s + this.labelHeight)) : this.labelPosVertical == "center" && this.labelHeight > s ? (this.rect.y -= (this.labelHeight - s) / 2, this.setHeight(this.labelHeight)) : this.labelPosVertical == "bottom" && this.setHeight(s + this.labelHeight));
234
+ }
235
+ }
236
+ }, i.prototype.getInclusionTreeDepth = function() {
237
+ if (this.inclusionTreeDepth == h.MAX_VALUE)
238
+ throw "assert failed";
239
+ return this.inclusionTreeDepth;
240
+ }, i.prototype.transform = function(t) {
241
+ var o = this.rect.x;
242
+ o > r.WORLD_BOUNDARY ? o = r.WORLD_BOUNDARY : o < -r.WORLD_BOUNDARY && (o = -r.WORLD_BOUNDARY);
243
+ var s = this.rect.y;
244
+ s > r.WORLD_BOUNDARY ? s = r.WORLD_BOUNDARY : s < -r.WORLD_BOUNDARY && (s = -r.WORLD_BOUNDARY);
245
+ var c = new f(o, s), l = t.inverseTransformPoint(c);
246
+ this.setLocation(l.x, l.y);
247
+ }, i.prototype.getLeft = function() {
248
+ return this.rect.x;
249
+ }, i.prototype.getRight = function() {
250
+ return this.rect.x + this.rect.width;
251
+ }, i.prototype.getTop = function() {
252
+ return this.rect.y;
253
+ }, i.prototype.getBottom = function() {
254
+ return this.rect.y + this.rect.height;
255
+ }, i.prototype.getParent = function() {
256
+ return this.owner == null ? null : this.owner.getParent();
257
+ }, A.exports = i;
258
+ },
259
+ /* 4 */
260
+ /***/
261
+ function(A, P, N) {
262
+ var u = N(0);
263
+ function h() {
264
+ }
265
+ for (var a in u)
266
+ h[a] = u[a];
267
+ h.MAX_ITERATIONS = 2500, h.DEFAULT_EDGE_LENGTH = 50, h.DEFAULT_SPRING_STRENGTH = 0.45, h.DEFAULT_REPULSION_STRENGTH = 4500, h.DEFAULT_GRAVITY_STRENGTH = 0.4, h.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, h.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, h.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, h.COOLING_ADAPTATION_FACTOR = 0.33, h.ADAPTATION_LOWER_NODE_LIMIT = 1e3, h.ADAPTATION_UPPER_NODE_LIMIT = 5e3, h.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, h.MAX_NODE_DISPLACEMENT = h.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, h.MIN_REPULSION_DIST = h.DEFAULT_EDGE_LENGTH / 10, h.CONVERGENCE_CHECK_PERIOD = 100, h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, h.MIN_EDGE_LENGTH = 1, h.GRID_CALCULATION_CHECK_PERIOD = 10, A.exports = h;
268
+ },
269
+ /* 5 */
270
+ /***/
271
+ function(A, P, N) {
272
+ function u(h, a) {
273
+ h == null && a == null ? (this.x = 0, this.y = 0) : (this.x = h, this.y = a);
274
+ }
275
+ u.prototype.getX = function() {
276
+ return this.x;
277
+ }, u.prototype.getY = function() {
278
+ return this.y;
279
+ }, u.prototype.setX = function(h) {
280
+ this.x = h;
281
+ }, u.prototype.setY = function(h) {
282
+ this.y = h;
283
+ }, u.prototype.getDifference = function(h) {
284
+ return new DimensionD(this.x - h.x, this.y - h.y);
285
+ }, u.prototype.getCopy = function() {
286
+ return new u(this.x, this.y);
287
+ }, u.prototype.translate = function(h) {
288
+ return this.x += h.width, this.y += h.height, this;
289
+ }, A.exports = u;
290
+ },
291
+ /* 6 */
292
+ /***/
293
+ function(A, P, N) {
294
+ var u = N(2), h = N(10), a = N(0), r = N(7), e = N(3), f = N(1), i = N(13), g = N(12), t = N(11);
295
+ function o(c, l, T) {
296
+ u.call(this, T), this.estimatedSize = h.MIN_VALUE, this.margin = a.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = c, l != null && l instanceof r ? this.graphManager = l : l != null && l instanceof Layout && (this.graphManager = l.graphManager);
297
+ }
298
+ o.prototype = Object.create(u.prototype);
299
+ for (var s in u)
300
+ o[s] = u[s];
301
+ o.prototype.getNodes = function() {
302
+ return this.nodes;
303
+ }, o.prototype.getEdges = function() {
304
+ return this.edges;
305
+ }, o.prototype.getGraphManager = function() {
306
+ return this.graphManager;
307
+ }, o.prototype.getParent = function() {
308
+ return this.parent;
309
+ }, o.prototype.getLeft = function() {
310
+ return this.left;
311
+ }, o.prototype.getRight = function() {
312
+ return this.right;
313
+ }, o.prototype.getTop = function() {
314
+ return this.top;
315
+ }, o.prototype.getBottom = function() {
316
+ return this.bottom;
317
+ }, o.prototype.isConnected = function() {
318
+ return this.isConnected;
319
+ }, o.prototype.add = function(c, l, T) {
320
+ if (l == null && T == null) {
321
+ var d = c;
322
+ if (this.graphManager == null)
323
+ throw "Graph has no graph mgr!";
324
+ if (this.getNodes().indexOf(d) > -1)
325
+ throw "Node already in graph!";
326
+ return d.owner = this, this.getNodes().push(d), d;
327
+ } else {
328
+ var v = c;
329
+ if (!(this.getNodes().indexOf(l) > -1 && this.getNodes().indexOf(T) > -1))
330
+ throw "Source or target not in graph!";
331
+ if (!(l.owner == T.owner && l.owner == this))
332
+ throw "Both owners must be this graph!";
333
+ return l.owner != T.owner ? null : (v.source = l, v.target = T, v.isInterGraph = !1, this.getEdges().push(v), l.edges.push(v), T != l && T.edges.push(v), v);
334
+ }
335
+ }, o.prototype.remove = function(c) {
336
+ var l = c;
337
+ if (c instanceof e) {
338
+ if (l == null)
339
+ throw "Node is null!";
340
+ if (!(l.owner != null && l.owner == this))
341
+ throw "Owner graph is invalid!";
342
+ if (this.graphManager == null)
343
+ throw "Owner graph manager is invalid!";
344
+ for (var T = l.edges.slice(), d, v = T.length, L = 0; L < v; L++)
345
+ d = T[L], d.isInterGraph ? this.graphManager.remove(d) : d.source.owner.remove(d);
346
+ var S = this.nodes.indexOf(l);
347
+ if (S == -1)
348
+ throw "Node not in owner node list!";
349
+ this.nodes.splice(S, 1);
350
+ } else if (c instanceof f) {
351
+ var d = c;
352
+ if (d == null)
353
+ throw "Edge is null!";
354
+ if (!(d.source != null && d.target != null))
355
+ throw "Source and/or target is null!";
356
+ if (!(d.source.owner != null && d.target.owner != null && d.source.owner == this && d.target.owner == this))
357
+ throw "Source and/or target owner is invalid!";
358
+ var C = d.source.edges.indexOf(d), G = d.target.edges.indexOf(d);
359
+ if (!(C > -1 && G > -1))
360
+ throw "Source and/or target doesn't know this edge!";
361
+ d.source.edges.splice(C, 1), d.target != d.source && d.target.edges.splice(G, 1);
362
+ var S = d.source.owner.getEdges().indexOf(d);
363
+ if (S == -1)
364
+ throw "Not in owner's edge list!";
365
+ d.source.owner.getEdges().splice(S, 1);
366
+ }
367
+ }, o.prototype.updateLeftTop = function() {
368
+ for (var c = h.MAX_VALUE, l = h.MAX_VALUE, T, d, v, L = this.getNodes(), S = L.length, C = 0; C < S; C++) {
369
+ var G = L[C];
370
+ T = G.getTop(), d = G.getLeft(), c > T && (c = T), l > d && (l = d);
371
+ }
372
+ return c == h.MAX_VALUE ? null : (L[0].getParent().paddingLeft != null ? v = L[0].getParent().paddingLeft : v = this.margin, this.left = l - v, this.top = c - v, new g(this.left, this.top));
373
+ }, o.prototype.updateBounds = function(c) {
374
+ for (var l = h.MAX_VALUE, T = -h.MAX_VALUE, d = h.MAX_VALUE, v = -h.MAX_VALUE, L, S, C, G, K, X = this.nodes, Q = X.length, O = 0; O < Q; O++) {
375
+ var rt = X[O];
376
+ c && rt.child != null && rt.updateBounds(), L = rt.getLeft(), S = rt.getRight(), C = rt.getTop(), G = rt.getBottom(), l > L && (l = L), T < S && (T = S), d > C && (d = C), v < G && (v = G);
377
+ }
378
+ var n = new i(l, d, T - l, v - d);
379
+ l == h.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), X[0].getParent().paddingLeft != null ? K = X[0].getParent().paddingLeft : K = this.margin, this.left = n.x - K, this.right = n.x + n.width + K, this.top = n.y - K, this.bottom = n.y + n.height + K;
380
+ }, o.calculateBounds = function(c) {
381
+ for (var l = h.MAX_VALUE, T = -h.MAX_VALUE, d = h.MAX_VALUE, v = -h.MAX_VALUE, L, S, C, G, K = c.length, X = 0; X < K; X++) {
382
+ var Q = c[X];
383
+ L = Q.getLeft(), S = Q.getRight(), C = Q.getTop(), G = Q.getBottom(), l > L && (l = L), T < S && (T = S), d > C && (d = C), v < G && (v = G);
384
+ }
385
+ var O = new i(l, d, T - l, v - d);
386
+ return O;
387
+ }, o.prototype.getInclusionTreeDepth = function() {
388
+ return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
389
+ }, o.prototype.getEstimatedSize = function() {
390
+ if (this.estimatedSize == h.MIN_VALUE)
391
+ throw "assert failed";
392
+ return this.estimatedSize;
393
+ }, o.prototype.calcEstimatedSize = function() {
394
+ for (var c = 0, l = this.nodes, T = l.length, d = 0; d < T; d++) {
395
+ var v = l[d];
396
+ c += v.calcEstimatedSize();
397
+ }
398
+ return c == 0 ? this.estimatedSize = a.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = c / Math.sqrt(this.nodes.length), this.estimatedSize;
399
+ }, o.prototype.updateConnected = function() {
400
+ var c = this;
401
+ if (this.nodes.length == 0) {
402
+ this.isConnected = !0;
403
+ return;
404
+ }
405
+ var l = new t(), T = /* @__PURE__ */ new Set(), d = this.nodes[0], v, L, S = d.withChildren();
406
+ for (S.forEach(function(O) {
407
+ l.push(O), T.add(O);
408
+ }); l.length !== 0; ) {
409
+ d = l.shift(), v = d.getEdges();
410
+ for (var C = v.length, G = 0; G < C; G++) {
411
+ var K = v[G];
412
+ if (L = K.getOtherEndInGraph(d, this), L != null && !T.has(L)) {
413
+ var X = L.withChildren();
414
+ X.forEach(function(O) {
415
+ l.push(O), T.add(O);
416
+ });
417
+ }
418
+ }
419
+ }
420
+ if (this.isConnected = !1, T.size >= this.nodes.length) {
421
+ var Q = 0;
422
+ T.forEach(function(O) {
423
+ O.owner == c && Q++;
424
+ }), Q == this.nodes.length && (this.isConnected = !0);
425
+ }
426
+ }, A.exports = o;
427
+ },
428
+ /* 7 */
429
+ /***/
430
+ function(A, P, N) {
431
+ var u, h = N(1);
432
+ function a(r) {
433
+ u = N(6), this.layout = r, this.graphs = [], this.edges = [];
434
+ }
435
+ a.prototype.addRoot = function() {
436
+ var r = this.layout.newGraph(), e = this.layout.newNode(null), f = this.add(r, e);
437
+ return this.setRootGraph(f), this.rootGraph;
438
+ }, a.prototype.add = function(r, e, f, i, g) {
439
+ if (f == null && i == null && g == null) {
440
+ if (r == null)
441
+ throw "Graph is null!";
442
+ if (e == null)
443
+ throw "Parent node is null!";
444
+ if (this.graphs.indexOf(r) > -1)
445
+ throw "Graph already in this graph mgr!";
446
+ if (this.graphs.push(r), r.parent != null)
447
+ throw "Already has a parent!";
448
+ if (e.child != null)
449
+ throw "Already has a child!";
450
+ return r.parent = e, e.child = r, r;
451
+ } else {
452
+ g = f, i = e, f = r;
453
+ var t = i.getOwner(), o = g.getOwner();
454
+ if (!(t != null && t.getGraphManager() == this))
455
+ throw "Source not in this graph mgr!";
456
+ if (!(o != null && o.getGraphManager() == this))
457
+ throw "Target not in this graph mgr!";
458
+ if (t == o)
459
+ return f.isInterGraph = !1, t.add(f, i, g);
460
+ if (f.isInterGraph = !0, f.source = i, f.target = g, this.edges.indexOf(f) > -1)
461
+ throw "Edge already in inter-graph edge list!";
462
+ if (this.edges.push(f), !(f.source != null && f.target != null))
463
+ throw "Edge source and/or target is null!";
464
+ if (!(f.source.edges.indexOf(f) == -1 && f.target.edges.indexOf(f) == -1))
465
+ throw "Edge already in source and/or target incidency list!";
466
+ return f.source.edges.push(f), f.target.edges.push(f), f;
467
+ }
468
+ }, a.prototype.remove = function(r) {
469
+ if (r instanceof u) {
470
+ var e = r;
471
+ if (e.getGraphManager() != this)
472
+ throw "Graph not in this graph mgr";
473
+ if (!(e == this.rootGraph || e.parent != null && e.parent.graphManager == this))
474
+ throw "Invalid parent node!";
475
+ var f = [];
476
+ f = f.concat(e.getEdges());
477
+ for (var i, g = f.length, t = 0; t < g; t++)
478
+ i = f[t], e.remove(i);
479
+ var o = [];
480
+ o = o.concat(e.getNodes());
481
+ var s;
482
+ g = o.length;
483
+ for (var t = 0; t < g; t++)
484
+ s = o[t], e.remove(s);
485
+ e == this.rootGraph && this.setRootGraph(null);
486
+ var c = this.graphs.indexOf(e);
487
+ this.graphs.splice(c, 1), e.parent = null;
488
+ } else if (r instanceof h) {
489
+ if (i = r, i == null)
490
+ throw "Edge is null!";
491
+ if (!i.isInterGraph)
492
+ throw "Not an inter-graph edge!";
493
+ if (!(i.source != null && i.target != null))
494
+ throw "Source and/or target is null!";
495
+ if (!(i.source.edges.indexOf(i) != -1 && i.target.edges.indexOf(i) != -1))
496
+ throw "Source and/or target doesn't know this edge!";
497
+ var c = i.source.edges.indexOf(i);
498
+ if (i.source.edges.splice(c, 1), c = i.target.edges.indexOf(i), i.target.edges.splice(c, 1), !(i.source.owner != null && i.source.owner.getGraphManager() != null))
499
+ throw "Edge owner graph or owner graph manager is null!";
500
+ if (i.source.owner.getGraphManager().edges.indexOf(i) == -1)
501
+ throw "Not in owner graph manager's edge list!";
502
+ var c = i.source.owner.getGraphManager().edges.indexOf(i);
503
+ i.source.owner.getGraphManager().edges.splice(c, 1);
504
+ }
505
+ }, a.prototype.updateBounds = function() {
506
+ this.rootGraph.updateBounds(!0);
507
+ }, a.prototype.getGraphs = function() {
508
+ return this.graphs;
509
+ }, a.prototype.getAllNodes = function() {
510
+ if (this.allNodes == null) {
511
+ for (var r = [], e = this.getGraphs(), f = e.length, i = 0; i < f; i++)
512
+ r = r.concat(e[i].getNodes());
513
+ this.allNodes = r;
514
+ }
515
+ return this.allNodes;
516
+ }, a.prototype.resetAllNodes = function() {
517
+ this.allNodes = null;
518
+ }, a.prototype.resetAllEdges = function() {
519
+ this.allEdges = null;
520
+ }, a.prototype.resetAllNodesToApplyGravitation = function() {
521
+ this.allNodesToApplyGravitation = null;
522
+ }, a.prototype.getAllEdges = function() {
523
+ if (this.allEdges == null) {
524
+ var r = [], e = this.getGraphs();
525
+ e.length;
526
+ for (var f = 0; f < e.length; f++)
527
+ r = r.concat(e[f].getEdges());
528
+ r = r.concat(this.edges), this.allEdges = r;
529
+ }
530
+ return this.allEdges;
531
+ }, a.prototype.getAllNodesToApplyGravitation = function() {
532
+ return this.allNodesToApplyGravitation;
533
+ }, a.prototype.setAllNodesToApplyGravitation = function(r) {
534
+ if (this.allNodesToApplyGravitation != null)
535
+ throw "assert failed";
536
+ this.allNodesToApplyGravitation = r;
537
+ }, a.prototype.getRoot = function() {
538
+ return this.rootGraph;
539
+ }, a.prototype.setRootGraph = function(r) {
540
+ if (r.getGraphManager() != this)
541
+ throw "Root not in this graph mgr!";
542
+ this.rootGraph = r, r.parent == null && (r.parent = this.layout.newNode("Root node"));
543
+ }, a.prototype.getLayout = function() {
544
+ return this.layout;
545
+ }, a.prototype.isOneAncestorOfOther = function(r, e) {
546
+ if (!(r != null && e != null))
547
+ throw "assert failed";
548
+ if (r == e)
549
+ return !0;
550
+ var f = r.getOwner(), i;
551
+ do {
552
+ if (i = f.getParent(), i == null)
553
+ break;
554
+ if (i == e)
555
+ return !0;
556
+ if (f = i.getOwner(), f == null)
557
+ break;
558
+ } while (!0);
559
+ f = e.getOwner();
560
+ do {
561
+ if (i = f.getParent(), i == null)
562
+ break;
563
+ if (i == r)
564
+ return !0;
565
+ if (f = i.getOwner(), f == null)
566
+ break;
567
+ } while (!0);
568
+ return !1;
569
+ }, a.prototype.calcLowestCommonAncestors = function() {
570
+ for (var r, e, f, i, g, t = this.getAllEdges(), o = t.length, s = 0; s < o; s++) {
571
+ if (r = t[s], e = r.source, f = r.target, r.lca = null, r.sourceInLca = e, r.targetInLca = f, e == f) {
572
+ r.lca = e.getOwner();
573
+ continue;
574
+ }
575
+ for (i = e.getOwner(); r.lca == null; ) {
576
+ for (r.targetInLca = f, g = f.getOwner(); r.lca == null; ) {
577
+ if (g == i) {
578
+ r.lca = g;
579
+ break;
580
+ }
581
+ if (g == this.rootGraph)
582
+ break;
583
+ if (r.lca != null)
584
+ throw "assert failed";
585
+ r.targetInLca = g.getParent(), g = r.targetInLca.getOwner();
586
+ }
587
+ if (i == this.rootGraph)
588
+ break;
589
+ r.lca == null && (r.sourceInLca = i.getParent(), i = r.sourceInLca.getOwner());
590
+ }
591
+ if (r.lca == null)
592
+ throw "assert failed";
593
+ }
594
+ }, a.prototype.calcLowestCommonAncestor = function(r, e) {
595
+ if (r == e)
596
+ return r.getOwner();
597
+ var f = r.getOwner();
598
+ do {
599
+ if (f == null)
600
+ break;
601
+ var i = e.getOwner();
602
+ do {
603
+ if (i == null)
604
+ break;
605
+ if (i == f)
606
+ return i;
607
+ i = i.getParent().getOwner();
608
+ } while (!0);
609
+ f = f.getParent().getOwner();
610
+ } while (!0);
611
+ return f;
612
+ }, a.prototype.calcInclusionTreeDepths = function(r, e) {
613
+ r == null && e == null && (r = this.rootGraph, e = 1);
614
+ for (var f, i = r.getNodes(), g = i.length, t = 0; t < g; t++)
615
+ f = i[t], f.inclusionTreeDepth = e, f.child != null && this.calcInclusionTreeDepths(f.child, e + 1);
616
+ }, a.prototype.includesInvalidEdge = function() {
617
+ for (var r, e = [], f = this.edges.length, i = 0; i < f; i++)
618
+ r = this.edges[i], this.isOneAncestorOfOther(r.source, r.target) && e.push(r);
619
+ for (var i = 0; i < e.length; i++)
620
+ this.remove(e[i]);
621
+ return !1;
622
+ }, A.exports = a;
623
+ },
624
+ /* 8 */
625
+ /***/
626
+ function(A, P, N) {
627
+ var u = N(12);
628
+ function h() {
629
+ }
630
+ h.calcSeparationAmount = function(a, r, e, f) {
631
+ if (!a.intersects(r))
632
+ throw "assert failed";
633
+ var i = new Array(2);
634
+ this.decideDirectionsForOverlappingNodes(a, r, i), e[0] = Math.min(a.getRight(), r.getRight()) - Math.max(a.x, r.x), e[1] = Math.min(a.getBottom(), r.getBottom()) - Math.max(a.y, r.y), a.getX() <= r.getX() && a.getRight() >= r.getRight() ? e[0] += Math.min(r.getX() - a.getX(), a.getRight() - r.getRight()) : r.getX() <= a.getX() && r.getRight() >= a.getRight() && (e[0] += Math.min(a.getX() - r.getX(), r.getRight() - a.getRight())), a.getY() <= r.getY() && a.getBottom() >= r.getBottom() ? e[1] += Math.min(r.getY() - a.getY(), a.getBottom() - r.getBottom()) : r.getY() <= a.getY() && r.getBottom() >= a.getBottom() && (e[1] += Math.min(a.getY() - r.getY(), r.getBottom() - a.getBottom()));
635
+ var g = Math.abs((r.getCenterY() - a.getCenterY()) / (r.getCenterX() - a.getCenterX()));
636
+ r.getCenterY() === a.getCenterY() && r.getCenterX() === a.getCenterX() && (g = 1);
637
+ var t = g * e[0], o = e[1] / g;
638
+ e[0] < o ? o = e[0] : t = e[1], e[0] = -1 * i[0] * (o / 2 + f), e[1] = -1 * i[1] * (t / 2 + f);
639
+ }, h.decideDirectionsForOverlappingNodes = function(a, r, e) {
640
+ a.getCenterX() < r.getCenterX() ? e[0] = -1 : e[0] = 1, a.getCenterY() < r.getCenterY() ? e[1] = -1 : e[1] = 1;
641
+ }, h.getIntersection2 = function(a, r, e) {
642
+ var f = a.getCenterX(), i = a.getCenterY(), g = r.getCenterX(), t = r.getCenterY();
643
+ if (a.intersects(r))
644
+ return e[0] = f, e[1] = i, e[2] = g, e[3] = t, !0;
645
+ var o = a.getX(), s = a.getY(), c = a.getRight(), l = a.getX(), T = a.getBottom(), d = a.getRight(), v = a.getWidthHalf(), L = a.getHeightHalf(), S = r.getX(), C = r.getY(), G = r.getRight(), K = r.getX(), X = r.getBottom(), Q = r.getRight(), O = r.getWidthHalf(), rt = r.getHeightHalf(), n = !1, m = !1;
646
+ if (f === g) {
647
+ if (i > t)
648
+ return e[0] = f, e[1] = s, e[2] = g, e[3] = X, !1;
649
+ if (i < t)
650
+ return e[0] = f, e[1] = T, e[2] = g, e[3] = C, !1;
651
+ } else if (i === t) {
652
+ if (f > g)
653
+ return e[0] = o, e[1] = i, e[2] = G, e[3] = t, !1;
654
+ if (f < g)
655
+ return e[0] = c, e[1] = i, e[2] = S, e[3] = t, !1;
656
+ } else {
657
+ var p = a.height / a.width, E = r.height / r.width, y = (t - i) / (g - f), R = void 0, M = void 0, F = void 0, W = void 0, x = void 0, k = void 0;
658
+ if (-p === y ? f > g ? (e[0] = l, e[1] = T, n = !0) : (e[0] = c, e[1] = s, n = !0) : p === y && (f > g ? (e[0] = o, e[1] = s, n = !0) : (e[0] = d, e[1] = T, n = !0)), -E === y ? g > f ? (e[2] = K, e[3] = X, m = !0) : (e[2] = G, e[3] = C, m = !0) : E === y && (g > f ? (e[2] = S, e[3] = C, m = !0) : (e[2] = Q, e[3] = X, m = !0)), n && m)
659
+ return !1;
660
+ if (f > g ? i > t ? (R = this.getCardinalDirection(p, y, 4), M = this.getCardinalDirection(E, y, 2)) : (R = this.getCardinalDirection(-p, y, 3), M = this.getCardinalDirection(-E, y, 1)) : i > t ? (R = this.getCardinalDirection(-p, y, 1), M = this.getCardinalDirection(-E, y, 3)) : (R = this.getCardinalDirection(p, y, 2), M = this.getCardinalDirection(E, y, 4)), !n)
661
+ switch (R) {
662
+ case 1:
663
+ W = s, F = f + -L / y, e[0] = F, e[1] = W;
664
+ break;
665
+ case 2:
666
+ F = d, W = i + v * y, e[0] = F, e[1] = W;
667
+ break;
668
+ case 3:
669
+ W = T, F = f + L / y, e[0] = F, e[1] = W;
670
+ break;
671
+ case 4:
672
+ F = l, W = i + -v * y, e[0] = F, e[1] = W;
673
+ break;
674
+ }
675
+ if (!m)
676
+ switch (M) {
677
+ case 1:
678
+ k = C, x = g + -rt / y, e[2] = x, e[3] = k;
679
+ break;
680
+ case 2:
681
+ x = Q, k = t + O * y, e[2] = x, e[3] = k;
682
+ break;
683
+ case 3:
684
+ k = X, x = g + rt / y, e[2] = x, e[3] = k;
685
+ break;
686
+ case 4:
687
+ x = K, k = t + -O * y, e[2] = x, e[3] = k;
688
+ break;
689
+ }
690
+ }
691
+ return !1;
692
+ }, h.getCardinalDirection = function(a, r, e) {
693
+ return a > r ? e : 1 + e % 4;
694
+ }, h.getIntersection = function(a, r, e, f) {
695
+ if (f == null)
696
+ return this.getIntersection2(a, r, e);
697
+ var i = a.x, g = a.y, t = r.x, o = r.y, s = e.x, c = e.y, l = f.x, T = f.y, d = void 0, v = void 0, L = void 0, S = void 0, C = void 0, G = void 0, K = void 0, X = void 0, Q = void 0;
698
+ return L = o - g, C = i - t, K = t * g - i * o, S = T - c, G = s - l, X = l * c - s * T, Q = L * G - S * C, Q === 0 ? null : (d = (C * X - G * K) / Q, v = (S * K - L * X) / Q, new u(d, v));
699
+ }, h.angleOfVector = function(a, r, e, f) {
700
+ var i = void 0;
701
+ return a !== e ? (i = Math.atan((f - r) / (e - a)), e < a ? i += Math.PI : f < r && (i += this.TWO_PI)) : f < r ? i = this.ONE_AND_HALF_PI : i = this.HALF_PI, i;
702
+ }, h.doIntersect = function(a, r, e, f) {
703
+ var i = a.x, g = a.y, t = r.x, o = r.y, s = e.x, c = e.y, l = f.x, T = f.y, d = (t - i) * (T - c) - (l - s) * (o - g);
704
+ if (d === 0)
705
+ return !1;
706
+ var v = ((T - c) * (l - i) + (s - l) * (T - g)) / d, L = ((g - o) * (l - i) + (t - i) * (T - g)) / d;
707
+ return 0 < v && v < 1 && 0 < L && L < 1;
708
+ }, h.findCircleLineIntersections = function(a, r, e, f, i, g, t) {
709
+ var o = (e - a) * (e - a) + (f - r) * (f - r), s = 2 * ((a - i) * (e - a) + (r - g) * (f - r)), c = (a - i) * (a - i) + (r - g) * (r - g) - t * t, l = s * s - 4 * o * c;
710
+ if (l >= 0) {
711
+ var T = (-s + Math.sqrt(s * s - 4 * o * c)) / (2 * o), d = (-s - Math.sqrt(s * s - 4 * o * c)) / (2 * o), v = null;
712
+ return T >= 0 && T <= 1 ? [T] : d >= 0 && d <= 1 ? [d] : v;
713
+ } else
714
+ return null;
715
+ }, h.HALF_PI = 0.5 * Math.PI, h.ONE_AND_HALF_PI = 1.5 * Math.PI, h.TWO_PI = 2 * Math.PI, h.THREE_PI = 3 * Math.PI, A.exports = h;
716
+ },
717
+ /* 9 */
718
+ /***/
719
+ function(A, P, N) {
720
+ function u() {
721
+ }
722
+ u.sign = function(h) {
723
+ return h > 0 ? 1 : h < 0 ? -1 : 0;
724
+ }, u.floor = function(h) {
725
+ return h < 0 ? Math.ceil(h) : Math.floor(h);
726
+ }, u.ceil = function(h) {
727
+ return h < 0 ? Math.floor(h) : Math.ceil(h);
728
+ }, A.exports = u;
729
+ },
730
+ /* 10 */
731
+ /***/
732
+ function(A, P, N) {
733
+ function u() {
734
+ }
735
+ u.MAX_VALUE = 2147483647, u.MIN_VALUE = -2147483648, A.exports = u;
736
+ },
737
+ /* 11 */
738
+ /***/
739
+ function(A, P, N) {
740
+ var u = /* @__PURE__ */ function() {
741
+ function i(g, t) {
742
+ for (var o = 0; o < t.length; o++) {
743
+ var s = t[o];
744
+ s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(g, s.key, s);
745
+ }
746
+ }
747
+ return function(g, t, o) {
748
+ return t && i(g.prototype, t), o && i(g, o), g;
749
+ };
750
+ }();
751
+ function h(i, g) {
752
+ if (!(i instanceof g))
753
+ throw new TypeError("Cannot call a class as a function");
754
+ }
755
+ var a = function(g) {
756
+ return { value: g, next: null, prev: null };
757
+ }, r = function(g, t, o, s) {
758
+ return g !== null ? g.next = t : s.head = t, o !== null ? o.prev = t : s.tail = t, t.prev = g, t.next = o, s.length++, t;
759
+ }, e = function(g, t) {
760
+ var o = g.prev, s = g.next;
761
+ return o !== null ? o.next = s : t.head = s, s !== null ? s.prev = o : t.tail = o, g.prev = g.next = null, t.length--, g;
762
+ }, f = function() {
763
+ function i(g) {
764
+ var t = this;
765
+ h(this, i), this.length = 0, this.head = null, this.tail = null, g != null && g.forEach(function(o) {
766
+ return t.push(o);
767
+ });
768
+ }
769
+ return u(i, [{
770
+ key: "size",
771
+ value: function() {
772
+ return this.length;
773
+ }
774
+ }, {
775
+ key: "insertBefore",
776
+ value: function(t, o) {
777
+ return r(o.prev, a(t), o, this);
778
+ }
779
+ }, {
780
+ key: "insertAfter",
781
+ value: function(t, o) {
782
+ return r(o, a(t), o.next, this);
783
+ }
784
+ }, {
785
+ key: "insertNodeBefore",
786
+ value: function(t, o) {
787
+ return r(o.prev, t, o, this);
788
+ }
789
+ }, {
790
+ key: "insertNodeAfter",
791
+ value: function(t, o) {
792
+ return r(o, t, o.next, this);
793
+ }
794
+ }, {
795
+ key: "push",
796
+ value: function(t) {
797
+ return r(this.tail, a(t), null, this);
798
+ }
799
+ }, {
800
+ key: "unshift",
801
+ value: function(t) {
802
+ return r(null, a(t), this.head, this);
803
+ }
804
+ }, {
805
+ key: "remove",
806
+ value: function(t) {
807
+ return e(t, this);
808
+ }
809
+ }, {
810
+ key: "pop",
811
+ value: function() {
812
+ return e(this.tail, this).value;
813
+ }
814
+ }, {
815
+ key: "popNode",
816
+ value: function() {
817
+ return e(this.tail, this);
818
+ }
819
+ }, {
820
+ key: "shift",
821
+ value: function() {
822
+ return e(this.head, this).value;
823
+ }
824
+ }, {
825
+ key: "shiftNode",
826
+ value: function() {
827
+ return e(this.head, this);
828
+ }
829
+ }, {
830
+ key: "get_object_at",
831
+ value: function(t) {
832
+ if (t <= this.length()) {
833
+ for (var o = 1, s = this.head; o < t; )
834
+ s = s.next, o++;
835
+ return s.value;
836
+ }
837
+ }
838
+ }, {
839
+ key: "set_object_at",
840
+ value: function(t, o) {
841
+ if (t <= this.length()) {
842
+ for (var s = 1, c = this.head; s < t; )
843
+ c = c.next, s++;
844
+ c.value = o;
845
+ }
846
+ }
847
+ }]), i;
848
+ }();
849
+ A.exports = f;
850
+ },
851
+ /* 12 */
852
+ /***/
853
+ function(A, P, N) {
854
+ function u(h, a, r) {
855
+ this.x = null, this.y = null, h == null && a == null && r == null ? (this.x = 0, this.y = 0) : typeof h == "number" && typeof a == "number" && r == null ? (this.x = h, this.y = a) : h.constructor.name == "Point" && a == null && r == null && (r = h, this.x = r.x, this.y = r.y);
856
+ }
857
+ u.prototype.getX = function() {
858
+ return this.x;
859
+ }, u.prototype.getY = function() {
860
+ return this.y;
861
+ }, u.prototype.getLocation = function() {
862
+ return new u(this.x, this.y);
863
+ }, u.prototype.setLocation = function(h, a, r) {
864
+ h.constructor.name == "Point" && a == null && r == null ? (r = h, this.setLocation(r.x, r.y)) : typeof h == "number" && typeof a == "number" && r == null && (parseInt(h) == h && parseInt(a) == a ? this.move(h, a) : (this.x = Math.floor(h + 0.5), this.y = Math.floor(a + 0.5)));
865
+ }, u.prototype.move = function(h, a) {
866
+ this.x = h, this.y = a;
867
+ }, u.prototype.translate = function(h, a) {
868
+ this.x += h, this.y += a;
869
+ }, u.prototype.equals = function(h) {
870
+ if (h.constructor.name == "Point") {
871
+ var a = h;
872
+ return this.x == a.x && this.y == a.y;
873
+ }
874
+ return this == h;
875
+ }, u.prototype.toString = function() {
876
+ return new u().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
877
+ }, A.exports = u;
878
+ },
879
+ /* 13 */
880
+ /***/
881
+ function(A, P, N) {
882
+ function u(h, a, r, e) {
883
+ this.x = 0, this.y = 0, this.width = 0, this.height = 0, h != null && a != null && r != null && e != null && (this.x = h, this.y = a, this.width = r, this.height = e);
884
+ }
885
+ u.prototype.getX = function() {
886
+ return this.x;
887
+ }, u.prototype.setX = function(h) {
888
+ this.x = h;
889
+ }, u.prototype.getY = function() {
890
+ return this.y;
891
+ }, u.prototype.setY = function(h) {
892
+ this.y = h;
893
+ }, u.prototype.getWidth = function() {
894
+ return this.width;
895
+ }, u.prototype.setWidth = function(h) {
896
+ this.width = h;
897
+ }, u.prototype.getHeight = function() {
898
+ return this.height;
899
+ }, u.prototype.setHeight = function(h) {
900
+ this.height = h;
901
+ }, u.prototype.getRight = function() {
902
+ return this.x + this.width;
903
+ }, u.prototype.getBottom = function() {
904
+ return this.y + this.height;
905
+ }, u.prototype.intersects = function(h) {
906
+ return !(this.getRight() < h.x || this.getBottom() < h.y || h.getRight() < this.x || h.getBottom() < this.y);
907
+ }, u.prototype.getCenterX = function() {
908
+ return this.x + this.width / 2;
909
+ }, u.prototype.getMinX = function() {
910
+ return this.getX();
911
+ }, u.prototype.getMaxX = function() {
912
+ return this.getX() + this.width;
913
+ }, u.prototype.getCenterY = function() {
914
+ return this.y + this.height / 2;
915
+ }, u.prototype.getMinY = function() {
916
+ return this.getY();
917
+ }, u.prototype.getMaxY = function() {
918
+ return this.getY() + this.height;
919
+ }, u.prototype.getWidthHalf = function() {
920
+ return this.width / 2;
921
+ }, u.prototype.getHeightHalf = function() {
922
+ return this.height / 2;
923
+ }, A.exports = u;
924
+ },
925
+ /* 14 */
926
+ /***/
927
+ function(A, P, N) {
928
+ var u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(a) {
929
+ return typeof a;
930
+ } : function(a) {
931
+ return a && typeof Symbol == "function" && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a;
932
+ };
933
+ function h() {
934
+ }
935
+ h.lastID = 0, h.createID = function(a) {
936
+ return h.isPrimitive(a) ? a : (a.uniqueID != null || (a.uniqueID = h.getString(), h.lastID++), a.uniqueID);
937
+ }, h.getString = function(a) {
938
+ return a == null && (a = h.lastID), "Object#" + a;
939
+ }, h.isPrimitive = function(a) {
940
+ var r = typeof a > "u" ? "undefined" : u(a);
941
+ return a == null || r != "object" && r != "function";
942
+ }, A.exports = h;
943
+ },
944
+ /* 15 */
945
+ /***/
946
+ function(A, P, N) {
947
+ function u(s) {
948
+ if (Array.isArray(s)) {
949
+ for (var c = 0, l = Array(s.length); c < s.length; c++)
950
+ l[c] = s[c];
951
+ return l;
952
+ } else
953
+ return Array.from(s);
954
+ }
955
+ var h = N(0), a = N(7), r = N(3), e = N(1), f = N(6), i = N(5), g = N(17), t = N(29);
956
+ function o(s) {
957
+ t.call(this), this.layoutQuality = h.QUALITY, this.createBendsAsNeeded = h.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = h.DEFAULT_INCREMENTAL, this.animationOnLayout = h.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = h.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = h.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = h.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new a(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, s != null && (this.isRemoteUse = s);
958
+ }
959
+ o.RANDOM_SEED = 1, o.prototype = Object.create(t.prototype), o.prototype.getGraphManager = function() {
960
+ return this.graphManager;
961
+ }, o.prototype.getAllNodes = function() {
962
+ return this.graphManager.getAllNodes();
963
+ }, o.prototype.getAllEdges = function() {
964
+ return this.graphManager.getAllEdges();
965
+ }, o.prototype.getAllNodesToApplyGravitation = function() {
966
+ return this.graphManager.getAllNodesToApplyGravitation();
967
+ }, o.prototype.newGraphManager = function() {
968
+ var s = new a(this);
969
+ return this.graphManager = s, s;
970
+ }, o.prototype.newGraph = function(s) {
971
+ return new f(null, this.graphManager, s);
972
+ }, o.prototype.newNode = function(s) {
973
+ return new r(this.graphManager, s);
974
+ }, o.prototype.newEdge = function(s) {
975
+ return new e(null, null, s);
976
+ }, o.prototype.checkLayoutSuccess = function() {
977
+ return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
978
+ }, o.prototype.runLayout = function() {
979
+ this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
980
+ var s;
981
+ return this.checkLayoutSuccess() ? s = !1 : s = this.layout(), h.ANIMATE === "during" ? !1 : (s && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, s);
982
+ }, o.prototype.doPostLayout = function() {
983
+ this.incremental || this.transform(), this.update();
984
+ }, o.prototype.update2 = function() {
985
+ if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
986
+ for (var s = this.graphManager.getAllEdges(), c = 0; c < s.length; c++)
987
+ s[c];
988
+ for (var l = this.graphManager.getRoot().getNodes(), c = 0; c < l.length; c++)
989
+ l[c];
990
+ this.update(this.graphManager.getRoot());
991
+ }
992
+ }, o.prototype.update = function(s) {
993
+ if (s == null)
994
+ this.update2();
995
+ else if (s instanceof r) {
996
+ var c = s;
997
+ if (c.getChild() != null)
998
+ for (var l = c.getChild().getNodes(), T = 0; T < l.length; T++)
999
+ update(l[T]);
1000
+ if (c.vGraphObject != null) {
1001
+ var d = c.vGraphObject;
1002
+ d.update(c);
1003
+ }
1004
+ } else if (s instanceof e) {
1005
+ var v = s;
1006
+ if (v.vGraphObject != null) {
1007
+ var L = v.vGraphObject;
1008
+ L.update(v);
1009
+ }
1010
+ } else if (s instanceof f) {
1011
+ var S = s;
1012
+ if (S.vGraphObject != null) {
1013
+ var C = S.vGraphObject;
1014
+ C.update(S);
1015
+ }
1016
+ }
1017
+ }, o.prototype.initParameters = function() {
1018
+ this.isSubLayout || (this.layoutQuality = h.QUALITY, this.animationDuringLayout = h.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = h.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = h.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = h.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = h.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = h.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
1019
+ }, o.prototype.transform = function(s) {
1020
+ if (s == null)
1021
+ this.transform(new i(0, 0));
1022
+ else {
1023
+ var c = new g(), l = this.graphManager.getRoot().updateLeftTop();
1024
+ if (l != null) {
1025
+ c.setWorldOrgX(s.x), c.setWorldOrgY(s.y), c.setDeviceOrgX(l.x), c.setDeviceOrgY(l.y);
1026
+ for (var T = this.getAllNodes(), d, v = 0; v < T.length; v++)
1027
+ d = T[v], d.transform(c);
1028
+ }
1029
+ }
1030
+ }, o.prototype.positionNodesRandomly = function(s) {
1031
+ if (s == null)
1032
+ this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
1033
+ else
1034
+ for (var c, l, T = s.getNodes(), d = 0; d < T.length; d++)
1035
+ c = T[d], l = c.getChild(), l == null || l.getNodes().length == 0 ? c.scatter() : (this.positionNodesRandomly(l), c.updateBounds());
1036
+ }, o.prototype.getFlatForest = function() {
1037
+ for (var s = [], c = !0, l = this.graphManager.getRoot().getNodes(), T = !0, d = 0; d < l.length; d++)
1038
+ l[d].getChild() != null && (T = !1);
1039
+ if (!T)
1040
+ return s;
1041
+ var v = /* @__PURE__ */ new Set(), L = [], S = /* @__PURE__ */ new Map(), C = [];
1042
+ for (C = C.concat(l); C.length > 0 && c; ) {
1043
+ for (L.push(C[0]); L.length > 0 && c; ) {
1044
+ var G = L[0];
1045
+ L.splice(0, 1), v.add(G);
1046
+ for (var K = G.getEdges(), d = 0; d < K.length; d++) {
1047
+ var X = K[d].getOtherEnd(G);
1048
+ if (S.get(G) != X)
1049
+ if (!v.has(X))
1050
+ L.push(X), S.set(X, G);
1051
+ else {
1052
+ c = !1;
1053
+ break;
1054
+ }
1055
+ }
1056
+ }
1057
+ if (!c)
1058
+ s = [];
1059
+ else {
1060
+ var Q = [].concat(u(v));
1061
+ s.push(Q);
1062
+ for (var d = 0; d < Q.length; d++) {
1063
+ var O = Q[d], rt = C.indexOf(O);
1064
+ rt > -1 && C.splice(rt, 1);
1065
+ }
1066
+ v = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Map();
1067
+ }
1068
+ }
1069
+ return s;
1070
+ }, o.prototype.createDummyNodesForBendpoints = function(s) {
1071
+ for (var c = [], l = s.source, T = this.graphManager.calcLowestCommonAncestor(s.source, s.target), d = 0; d < s.bendpoints.length; d++) {
1072
+ var v = this.newNode(null);
1073
+ v.setRect(new Point(0, 0), new Dimension(1, 1)), T.add(v);
1074
+ var L = this.newEdge(null);
1075
+ this.graphManager.add(L, l, v), c.add(v), l = v;
1076
+ }
1077
+ var L = this.newEdge(null);
1078
+ return this.graphManager.add(L, l, s.target), this.edgeToDummyNodes.set(s, c), s.isInterGraph() ? this.graphManager.remove(s) : T.remove(s), c;
1079
+ }, o.prototype.createBendpointsFromDummyNodes = function() {
1080
+ var s = [];
1081
+ s = s.concat(this.graphManager.getAllEdges()), s = [].concat(u(this.edgeToDummyNodes.keys())).concat(s);
1082
+ for (var c = 0; c < s.length; c++) {
1083
+ var l = s[c];
1084
+ if (l.bendpoints.length > 0) {
1085
+ for (var T = this.edgeToDummyNodes.get(l), d = 0; d < T.length; d++) {
1086
+ var v = T[d], L = new i(v.getCenterX(), v.getCenterY()), S = l.bendpoints.get(d);
1087
+ S.x = L.x, S.y = L.y, v.getOwner().remove(v);
1088
+ }
1089
+ this.graphManager.add(l, l.source, l.target);
1090
+ }
1091
+ }
1092
+ }, o.transform = function(s, c, l, T) {
1093
+ if (l != null && T != null) {
1094
+ var d = c;
1095
+ if (s <= 50) {
1096
+ var v = c / l;
1097
+ d -= (c - v) / 50 * (50 - s);
1098
+ } else {
1099
+ var L = c * T;
1100
+ d += (L - c) / 50 * (s - 50);
1101
+ }
1102
+ return d;
1103
+ } else {
1104
+ var S, C;
1105
+ return s <= 50 ? (S = 9 * c / 500, C = c / 10) : (S = 9 * c / 50, C = -8 * c), S * s + C;
1106
+ }
1107
+ }, o.findCenterOfTree = function(s) {
1108
+ var c = [];
1109
+ c = c.concat(s);
1110
+ var l = [], T = /* @__PURE__ */ new Map(), d = !1, v = null;
1111
+ (c.length == 1 || c.length == 2) && (d = !0, v = c[0]);
1112
+ for (var L = 0; L < c.length; L++) {
1113
+ var S = c[L], C = S.getNeighborsList().size;
1114
+ T.set(S, S.getNeighborsList().size), C == 1 && l.push(S);
1115
+ }
1116
+ var G = [];
1117
+ for (G = G.concat(l); !d; ) {
1118
+ var K = [];
1119
+ K = K.concat(G), G = [];
1120
+ for (var L = 0; L < c.length; L++) {
1121
+ var S = c[L], X = c.indexOf(S);
1122
+ X >= 0 && c.splice(X, 1);
1123
+ var Q = S.getNeighborsList();
1124
+ Q.forEach(function(n) {
1125
+ if (l.indexOf(n) < 0) {
1126
+ var m = T.get(n), p = m - 1;
1127
+ p == 1 && G.push(n), T.set(n, p);
1128
+ }
1129
+ });
1130
+ }
1131
+ l = l.concat(G), (c.length == 1 || c.length == 2) && (d = !0, v = c[0]);
1132
+ }
1133
+ return v;
1134
+ }, o.prototype.setGraphManager = function(s) {
1135
+ this.graphManager = s;
1136
+ }, A.exports = o;
1137
+ },
1138
+ /* 16 */
1139
+ /***/
1140
+ function(A, P, N) {
1141
+ function u() {
1142
+ }
1143
+ u.seed = 1, u.x = 0, u.nextDouble = function() {
1144
+ return u.x = Math.sin(u.seed++) * 1e4, u.x - Math.floor(u.x);
1145
+ }, A.exports = u;
1146
+ },
1147
+ /* 17 */
1148
+ /***/
1149
+ function(A, P, N) {
1150
+ var u = N(5);
1151
+ function h(a, r) {
1152
+ this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1153
+ }
1154
+ h.prototype.getWorldOrgX = function() {
1155
+ return this.lworldOrgX;
1156
+ }, h.prototype.setWorldOrgX = function(a) {
1157
+ this.lworldOrgX = a;
1158
+ }, h.prototype.getWorldOrgY = function() {
1159
+ return this.lworldOrgY;
1160
+ }, h.prototype.setWorldOrgY = function(a) {
1161
+ this.lworldOrgY = a;
1162
+ }, h.prototype.getWorldExtX = function() {
1163
+ return this.lworldExtX;
1164
+ }, h.prototype.setWorldExtX = function(a) {
1165
+ this.lworldExtX = a;
1166
+ }, h.prototype.getWorldExtY = function() {
1167
+ return this.lworldExtY;
1168
+ }, h.prototype.setWorldExtY = function(a) {
1169
+ this.lworldExtY = a;
1170
+ }, h.prototype.getDeviceOrgX = function() {
1171
+ return this.ldeviceOrgX;
1172
+ }, h.prototype.setDeviceOrgX = function(a) {
1173
+ this.ldeviceOrgX = a;
1174
+ }, h.prototype.getDeviceOrgY = function() {
1175
+ return this.ldeviceOrgY;
1176
+ }, h.prototype.setDeviceOrgY = function(a) {
1177
+ this.ldeviceOrgY = a;
1178
+ }, h.prototype.getDeviceExtX = function() {
1179
+ return this.ldeviceExtX;
1180
+ }, h.prototype.setDeviceExtX = function(a) {
1181
+ this.ldeviceExtX = a;
1182
+ }, h.prototype.getDeviceExtY = function() {
1183
+ return this.ldeviceExtY;
1184
+ }, h.prototype.setDeviceExtY = function(a) {
1185
+ this.ldeviceExtY = a;
1186
+ }, h.prototype.transformX = function(a) {
1187
+ var r = 0, e = this.lworldExtX;
1188
+ return e != 0 && (r = this.ldeviceOrgX + (a - this.lworldOrgX) * this.ldeviceExtX / e), r;
1189
+ }, h.prototype.transformY = function(a) {
1190
+ var r = 0, e = this.lworldExtY;
1191
+ return e != 0 && (r = this.ldeviceOrgY + (a - this.lworldOrgY) * this.ldeviceExtY / e), r;
1192
+ }, h.prototype.inverseTransformX = function(a) {
1193
+ var r = 0, e = this.ldeviceExtX;
1194
+ return e != 0 && (r = this.lworldOrgX + (a - this.ldeviceOrgX) * this.lworldExtX / e), r;
1195
+ }, h.prototype.inverseTransformY = function(a) {
1196
+ var r = 0, e = this.ldeviceExtY;
1197
+ return e != 0 && (r = this.lworldOrgY + (a - this.ldeviceOrgY) * this.lworldExtY / e), r;
1198
+ }, h.prototype.inverseTransformPoint = function(a) {
1199
+ var r = new u(this.inverseTransformX(a.x), this.inverseTransformY(a.y));
1200
+ return r;
1201
+ }, A.exports = h;
1202
+ },
1203
+ /* 18 */
1204
+ /***/
1205
+ function(A, P, N) {
1206
+ function u(t) {
1207
+ if (Array.isArray(t)) {
1208
+ for (var o = 0, s = Array(t.length); o < t.length; o++)
1209
+ s[o] = t[o];
1210
+ return s;
1211
+ } else
1212
+ return Array.from(t);
1213
+ }
1214
+ var h = N(15), a = N(4), r = N(0), e = N(8), f = N(9);
1215
+ function i() {
1216
+ h.call(this), this.useSmartIdealEdgeLengthCalculation = a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = a.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = a.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = a.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = a.MAX_ITERATIONS;
1217
+ }
1218
+ i.prototype = Object.create(h.prototype);
1219
+ for (var g in h)
1220
+ i[g] = h[g];
1221
+ i.prototype.initParameters = function() {
1222
+ h.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1223
+ }, i.prototype.calcIdealEdgeLengths = function() {
1224
+ for (var t, o, s, c, l, T, d, v = this.getGraphManager().getAllEdges(), L = 0; L < v.length; L++)
1225
+ t = v[L], o = t.idealLength, t.isInterGraph && (c = t.getSource(), l = t.getTarget(), T = t.getSourceInLca().getEstimatedSize(), d = t.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (t.idealLength += T + d - 2 * r.SIMPLE_NODE_SIZE), s = t.getLca().getInclusionTreeDepth(), t.idealLength += o * a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (c.getInclusionTreeDepth() + l.getInclusionTreeDepth() - 2 * s));
1226
+ }, i.prototype.initSpringEmbedder = function() {
1227
+ var t = this.getAllNodes().length;
1228
+ this.incremental ? (t > a.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * a.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (t - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - a.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (t > a.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(a.COOLING_ADAPTATION_FACTOR, 1 - (t - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * (1 - a.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1229
+ }, i.prototype.calcSpringForces = function() {
1230
+ for (var t = this.getAllEdges(), o, s = 0; s < t.length; s++)
1231
+ o = t[s], this.calcSpringForce(o, o.idealLength);
1232
+ }, i.prototype.calcRepulsionForces = function() {
1233
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, s, c, l, T, d = this.getAllNodes(), v;
1234
+ if (this.useFRGridVariant)
1235
+ for (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && t && this.updateGrid(), v = /* @__PURE__ */ new Set(), s = 0; s < d.length; s++)
1236
+ l = d[s], this.calculateRepulsionForceOfANode(l, v, t, o), v.add(l);
1237
+ else
1238
+ for (s = 0; s < d.length; s++)
1239
+ for (l = d[s], c = s + 1; c < d.length; c++)
1240
+ T = d[c], l.getOwner() == T.getOwner() && this.calcRepulsionForce(l, T);
1241
+ }, i.prototype.calcGravitationalForces = function() {
1242
+ for (var t, o = this.getAllNodesToApplyGravitation(), s = 0; s < o.length; s++)
1243
+ t = o[s], this.calcGravitationalForce(t);
1244
+ }, i.prototype.moveNodes = function() {
1245
+ for (var t = this.getAllNodes(), o, s = 0; s < t.length; s++)
1246
+ o = t[s], o.move();
1247
+ }, i.prototype.calcSpringForce = function(t, o) {
1248
+ var s = t.getSource(), c = t.getTarget(), l, T, d, v;
1249
+ if (this.uniformLeafNodeSizes && s.getChild() == null && c.getChild() == null)
1250
+ t.updateLengthSimple();
1251
+ else if (t.updateLength(), t.isOverlapingSourceAndTarget)
1252
+ return;
1253
+ l = t.getLength(), l != 0 && (T = t.edgeElasticity * (l - o), d = T * (t.lengthX / l), v = T * (t.lengthY / l), s.springForceX += d, s.springForceY += v, c.springForceX -= d, c.springForceY -= v);
1254
+ }, i.prototype.calcRepulsionForce = function(t, o) {
1255
+ var s = t.getRect(), c = o.getRect(), l = new Array(2), T = new Array(4), d, v, L, S, C, G, K;
1256
+ if (s.intersects(c)) {
1257
+ e.calcSeparationAmount(s, c, l, a.DEFAULT_EDGE_LENGTH / 2), G = 2 * l[0], K = 2 * l[1];
1258
+ var X = t.noOfChildren * o.noOfChildren / (t.noOfChildren + o.noOfChildren);
1259
+ t.repulsionForceX -= X * G, t.repulsionForceY -= X * K, o.repulsionForceX += X * G, o.repulsionForceY += X * K;
1260
+ } else
1261
+ this.uniformLeafNodeSizes && t.getChild() == null && o.getChild() == null ? (d = c.getCenterX() - s.getCenterX(), v = c.getCenterY() - s.getCenterY()) : (e.getIntersection(s, c, T), d = T[2] - T[0], v = T[3] - T[1]), Math.abs(d) < a.MIN_REPULSION_DIST && (d = f.sign(d) * a.MIN_REPULSION_DIST), Math.abs(v) < a.MIN_REPULSION_DIST && (v = f.sign(v) * a.MIN_REPULSION_DIST), L = d * d + v * v, S = Math.sqrt(L), C = (t.nodeRepulsion / 2 + o.nodeRepulsion / 2) * t.noOfChildren * o.noOfChildren / L, G = C * d / S, K = C * v / S, t.repulsionForceX -= G, t.repulsionForceY -= K, o.repulsionForceX += G, o.repulsionForceY += K;
1262
+ }, i.prototype.calcGravitationalForce = function(t) {
1263
+ var o, s, c, l, T, d, v, L;
1264
+ o = t.getOwner(), s = (o.getRight() + o.getLeft()) / 2, c = (o.getTop() + o.getBottom()) / 2, l = t.getCenterX() - s, T = t.getCenterY() - c, d = Math.abs(l) + t.getWidth() / 2, v = Math.abs(T) + t.getHeight() / 2, t.getOwner() == this.graphManager.getRoot() ? (L = o.getEstimatedSize() * this.gravityRangeFactor, (d > L || v > L) && (t.gravitationForceX = -this.gravityConstant * l, t.gravitationForceY = -this.gravityConstant * T)) : (L = o.getEstimatedSize() * this.compoundGravityRangeFactor, (d > L || v > L) && (t.gravitationForceX = -this.gravityConstant * l * this.compoundGravityConstant, t.gravitationForceY = -this.gravityConstant * T * this.compoundGravityConstant));
1265
+ }, i.prototype.isConverged = function() {
1266
+ var t, o = !1;
1267
+ return this.totalIterations > this.maxIterations / 3 && (o = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), t = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, t || o;
1268
+ }, i.prototype.animate = function() {
1269
+ this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1270
+ }, i.prototype.calcNoOfChildrenForAllNodes = function() {
1271
+ for (var t, o = this.graphManager.getAllNodes(), s = 0; s < o.length; s++)
1272
+ t = o[s], t.noOfChildren = t.getNoOfChildren();
1273
+ }, i.prototype.calcGrid = function(t) {
1274
+ var o = 0, s = 0;
1275
+ o = parseInt(Math.ceil((t.getRight() - t.getLeft()) / this.repulsionRange)), s = parseInt(Math.ceil((t.getBottom() - t.getTop()) / this.repulsionRange));
1276
+ for (var c = new Array(o), l = 0; l < o; l++)
1277
+ c[l] = new Array(s);
1278
+ for (var l = 0; l < o; l++)
1279
+ for (var T = 0; T < s; T++)
1280
+ c[l][T] = new Array();
1281
+ return c;
1282
+ }, i.prototype.addNodeToGrid = function(t, o, s) {
1283
+ var c = 0, l = 0, T = 0, d = 0;
1284
+ c = parseInt(Math.floor((t.getRect().x - o) / this.repulsionRange)), l = parseInt(Math.floor((t.getRect().width + t.getRect().x - o) / this.repulsionRange)), T = parseInt(Math.floor((t.getRect().y - s) / this.repulsionRange)), d = parseInt(Math.floor((t.getRect().height + t.getRect().y - s) / this.repulsionRange));
1285
+ for (var v = c; v <= l; v++)
1286
+ for (var L = T; L <= d; L++)
1287
+ this.grid[v][L].push(t), t.setGridCoordinates(c, l, T, d);
1288
+ }, i.prototype.updateGrid = function() {
1289
+ var t, o, s = this.getAllNodes();
1290
+ for (this.grid = this.calcGrid(this.graphManager.getRoot()), t = 0; t < s.length; t++)
1291
+ o = s[t], this.addNodeToGrid(o, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1292
+ }, i.prototype.calculateRepulsionForceOfANode = function(t, o, s, c) {
1293
+ if (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && s || c) {
1294
+ var l = /* @__PURE__ */ new Set();
1295
+ t.surrounding = new Array();
1296
+ for (var T, d = this.grid, v = t.startX - 1; v < t.finishX + 2; v++)
1297
+ for (var L = t.startY - 1; L < t.finishY + 2; L++)
1298
+ if (!(v < 0 || L < 0 || v >= d.length || L >= d[0].length)) {
1299
+ for (var S = 0; S < d[v][L].length; S++)
1300
+ if (T = d[v][L][S], !(t.getOwner() != T.getOwner() || t == T) && !o.has(T) && !l.has(T)) {
1301
+ var C = Math.abs(t.getCenterX() - T.getCenterX()) - (t.getWidth() / 2 + T.getWidth() / 2), G = Math.abs(t.getCenterY() - T.getCenterY()) - (t.getHeight() / 2 + T.getHeight() / 2);
1302
+ C <= this.repulsionRange && G <= this.repulsionRange && l.add(T);
1303
+ }
1304
+ }
1305
+ t.surrounding = [].concat(u(l));
1306
+ }
1307
+ for (v = 0; v < t.surrounding.length; v++)
1308
+ this.calcRepulsionForce(t, t.surrounding[v]);
1309
+ }, i.prototype.calcRepulsionRange = function() {
1310
+ return 0;
1311
+ }, A.exports = i;
1312
+ },
1313
+ /* 19 */
1314
+ /***/
1315
+ function(A, P, N) {
1316
+ var u = N(1), h = N(4);
1317
+ function a(e, f, i) {
1318
+ u.call(this, e, f, i), this.idealLength = h.DEFAULT_EDGE_LENGTH, this.edgeElasticity = h.DEFAULT_SPRING_STRENGTH;
1319
+ }
1320
+ a.prototype = Object.create(u.prototype);
1321
+ for (var r in u)
1322
+ a[r] = u[r];
1323
+ A.exports = a;
1324
+ },
1325
+ /* 20 */
1326
+ /***/
1327
+ function(A, P, N) {
1328
+ var u = N(3), h = N(4);
1329
+ function a(e, f, i, g) {
1330
+ u.call(this, e, f, i, g), this.nodeRepulsion = h.DEFAULT_REPULSION_STRENGTH, this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0, this.startX = 0, this.finishX = 0, this.startY = 0, this.finishY = 0, this.surrounding = [];
1331
+ }
1332
+ a.prototype = Object.create(u.prototype);
1333
+ for (var r in u)
1334
+ a[r] = u[r];
1335
+ a.prototype.setGridCoordinates = function(e, f, i, g) {
1336
+ this.startX = e, this.finishX = f, this.startY = i, this.finishY = g;
1337
+ }, A.exports = a;
1338
+ },
1339
+ /* 21 */
1340
+ /***/
1341
+ function(A, P, N) {
1342
+ function u(h, a) {
1343
+ this.width = 0, this.height = 0, h !== null && a !== null && (this.height = a, this.width = h);
1344
+ }
1345
+ u.prototype.getWidth = function() {
1346
+ return this.width;
1347
+ }, u.prototype.setWidth = function(h) {
1348
+ this.width = h;
1349
+ }, u.prototype.getHeight = function() {
1350
+ return this.height;
1351
+ }, u.prototype.setHeight = function(h) {
1352
+ this.height = h;
1353
+ }, A.exports = u;
1354
+ },
1355
+ /* 22 */
1356
+ /***/
1357
+ function(A, P, N) {
1358
+ var u = N(14);
1359
+ function h() {
1360
+ this.map = {}, this.keys = [];
1361
+ }
1362
+ h.prototype.put = function(a, r) {
1363
+ var e = u.createID(a);
1364
+ this.contains(e) || (this.map[e] = r, this.keys.push(a));
1365
+ }, h.prototype.contains = function(a) {
1366
+ return u.createID(a), this.map[a] != null;
1367
+ }, h.prototype.get = function(a) {
1368
+ var r = u.createID(a);
1369
+ return this.map[r];
1370
+ }, h.prototype.keySet = function() {
1371
+ return this.keys;
1372
+ }, A.exports = h;
1373
+ },
1374
+ /* 23 */
1375
+ /***/
1376
+ function(A, P, N) {
1377
+ var u = N(14);
1378
+ function h() {
1379
+ this.set = {};
1380
+ }
1381
+ h.prototype.add = function(a) {
1382
+ var r = u.createID(a);
1383
+ this.contains(r) || (this.set[r] = a);
1384
+ }, h.prototype.remove = function(a) {
1385
+ delete this.set[u.createID(a)];
1386
+ }, h.prototype.clear = function() {
1387
+ this.set = {};
1388
+ }, h.prototype.contains = function(a) {
1389
+ return this.set[u.createID(a)] == a;
1390
+ }, h.prototype.isEmpty = function() {
1391
+ return this.size() === 0;
1392
+ }, h.prototype.size = function() {
1393
+ return Object.keys(this.set).length;
1394
+ }, h.prototype.addAllTo = function(a) {
1395
+ for (var r = Object.keys(this.set), e = r.length, f = 0; f < e; f++)
1396
+ a.push(this.set[r[f]]);
1397
+ }, h.prototype.size = function() {
1398
+ return Object.keys(this.set).length;
1399
+ }, h.prototype.addAll = function(a) {
1400
+ for (var r = a.length, e = 0; e < r; e++) {
1401
+ var f = a[e];
1402
+ this.add(f);
1403
+ }
1404
+ }, A.exports = h;
1405
+ },
1406
+ /* 24 */
1407
+ /***/
1408
+ function(A, P, N) {
1409
+ function u() {
1410
+ }
1411
+ u.multMat = function(h, a) {
1412
+ for (var r = [], e = 0; e < h.length; e++) {
1413
+ r[e] = [];
1414
+ for (var f = 0; f < a[0].length; f++) {
1415
+ r[e][f] = 0;
1416
+ for (var i = 0; i < h[0].length; i++)
1417
+ r[e][f] += h[e][i] * a[i][f];
1418
+ }
1419
+ }
1420
+ return r;
1421
+ }, u.transpose = function(h) {
1422
+ for (var a = [], r = 0; r < h[0].length; r++) {
1423
+ a[r] = [];
1424
+ for (var e = 0; e < h.length; e++)
1425
+ a[r][e] = h[e][r];
1426
+ }
1427
+ return a;
1428
+ }, u.multCons = function(h, a) {
1429
+ for (var r = [], e = 0; e < h.length; e++)
1430
+ r[e] = h[e] * a;
1431
+ return r;
1432
+ }, u.minusOp = function(h, a) {
1433
+ for (var r = [], e = 0; e < h.length; e++)
1434
+ r[e] = h[e] - a[e];
1435
+ return r;
1436
+ }, u.dotProduct = function(h, a) {
1437
+ for (var r = 0, e = 0; e < h.length; e++)
1438
+ r += h[e] * a[e];
1439
+ return r;
1440
+ }, u.mag = function(h) {
1441
+ return Math.sqrt(this.dotProduct(h, h));
1442
+ }, u.normalize = function(h) {
1443
+ for (var a = [], r = this.mag(h), e = 0; e < h.length; e++)
1444
+ a[e] = h[e] / r;
1445
+ return a;
1446
+ }, u.multGamma = function(h) {
1447
+ for (var a = [], r = 0, e = 0; e < h.length; e++)
1448
+ r += h[e];
1449
+ r *= -1 / h.length;
1450
+ for (var f = 0; f < h.length; f++)
1451
+ a[f] = r + h[f];
1452
+ return a;
1453
+ }, u.multL = function(h, a, r) {
1454
+ for (var e = [], f = [], i = [], g = 0; g < a[0].length; g++) {
1455
+ for (var t = 0, o = 0; o < a.length; o++)
1456
+ t += -0.5 * a[o][g] * h[o];
1457
+ f[g] = t;
1458
+ }
1459
+ for (var s = 0; s < r.length; s++) {
1460
+ for (var c = 0, l = 0; l < r.length; l++)
1461
+ c += r[s][l] * f[l];
1462
+ i[s] = c;
1463
+ }
1464
+ for (var T = 0; T < a.length; T++) {
1465
+ for (var d = 0, v = 0; v < a[0].length; v++)
1466
+ d += a[T][v] * i[v];
1467
+ e[T] = d;
1468
+ }
1469
+ return e;
1470
+ }, A.exports = u;
1471
+ },
1472
+ /* 25 */
1473
+ /***/
1474
+ function(A, P, N) {
1475
+ var u = /* @__PURE__ */ function() {
1476
+ function e(f, i) {
1477
+ for (var g = 0; g < i.length; g++) {
1478
+ var t = i[g];
1479
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(f, t.key, t);
1480
+ }
1481
+ }
1482
+ return function(f, i, g) {
1483
+ return i && e(f.prototype, i), g && e(f, g), f;
1484
+ };
1485
+ }();
1486
+ function h(e, f) {
1487
+ if (!(e instanceof f))
1488
+ throw new TypeError("Cannot call a class as a function");
1489
+ }
1490
+ var a = N(11), r = function() {
1491
+ function e(f, i) {
1492
+ h(this, e), (i !== null || i !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1493
+ var g = void 0;
1494
+ f instanceof a ? g = f.size() : g = f.length, this._quicksort(f, 0, g - 1);
1495
+ }
1496
+ return u(e, [{
1497
+ key: "_quicksort",
1498
+ value: function(i, g, t) {
1499
+ if (g < t) {
1500
+ var o = this._partition(i, g, t);
1501
+ this._quicksort(i, g, o), this._quicksort(i, o + 1, t);
1502
+ }
1503
+ }
1504
+ }, {
1505
+ key: "_partition",
1506
+ value: function(i, g, t) {
1507
+ for (var o = this._get(i, g), s = g, c = t; ; ) {
1508
+ for (; this.compareFunction(o, this._get(i, c)); )
1509
+ c--;
1510
+ for (; this.compareFunction(this._get(i, s), o); )
1511
+ s++;
1512
+ if (s < c)
1513
+ this._swap(i, s, c), s++, c--;
1514
+ else
1515
+ return c;
1516
+ }
1517
+ }
1518
+ }, {
1519
+ key: "_get",
1520
+ value: function(i, g) {
1521
+ return i instanceof a ? i.get_object_at(g) : i[g];
1522
+ }
1523
+ }, {
1524
+ key: "_set",
1525
+ value: function(i, g, t) {
1526
+ i instanceof a ? i.set_object_at(g, t) : i[g] = t;
1527
+ }
1528
+ }, {
1529
+ key: "_swap",
1530
+ value: function(i, g, t) {
1531
+ var o = this._get(i, g);
1532
+ this._set(i, g, this._get(i, t)), this._set(i, t, o);
1533
+ }
1534
+ }, {
1535
+ key: "_defaultCompareFunction",
1536
+ value: function(i, g) {
1537
+ return g > i;
1538
+ }
1539
+ }]), e;
1540
+ }();
1541
+ A.exports = r;
1542
+ },
1543
+ /* 26 */
1544
+ /***/
1545
+ function(A, P, N) {
1546
+ function u() {
1547
+ }
1548
+ u.svd = function(h) {
1549
+ this.U = null, this.V = null, this.s = null, this.m = 0, this.n = 0, this.m = h.length, this.n = h[0].length;
1550
+ var a = Math.min(this.m, this.n);
1551
+ this.s = function(Tt) {
1552
+ for (var Ct = []; Tt-- > 0; )
1553
+ Ct.push(0);
1554
+ return Ct;
1555
+ }(Math.min(this.m + 1, this.n)), this.U = function(Tt) {
1556
+ var Ct = function Bt(bt) {
1557
+ if (bt.length == 0)
1558
+ return 0;
1559
+ for (var zt = [], St = 0; St < bt[0]; St++)
1560
+ zt.push(Bt(bt.slice(1)));
1561
+ return zt;
1562
+ };
1563
+ return Ct(Tt);
1564
+ }([this.m, a]), this.V = function(Tt) {
1565
+ var Ct = function Bt(bt) {
1566
+ if (bt.length == 0)
1567
+ return 0;
1568
+ for (var zt = [], St = 0; St < bt[0]; St++)
1569
+ zt.push(Bt(bt.slice(1)));
1570
+ return zt;
1571
+ };
1572
+ return Ct(Tt);
1573
+ }([this.n, this.n]);
1574
+ for (var r = function(Tt) {
1575
+ for (var Ct = []; Tt-- > 0; )
1576
+ Ct.push(0);
1577
+ return Ct;
1578
+ }(this.n), e = function(Tt) {
1579
+ for (var Ct = []; Tt-- > 0; )
1580
+ Ct.push(0);
1581
+ return Ct;
1582
+ }(this.m), f = !0, i = Math.min(this.m - 1, this.n), g = Math.max(0, Math.min(this.n - 2, this.m)), t = 0; t < Math.max(i, g); t++) {
1583
+ if (t < i) {
1584
+ this.s[t] = 0;
1585
+ for (var o = t; o < this.m; o++)
1586
+ this.s[t] = u.hypot(this.s[t], h[o][t]);
1587
+ if (this.s[t] !== 0) {
1588
+ h[t][t] < 0 && (this.s[t] = -this.s[t]);
1589
+ for (var s = t; s < this.m; s++)
1590
+ h[s][t] /= this.s[t];
1591
+ h[t][t] += 1;
1592
+ }
1593
+ this.s[t] = -this.s[t];
1594
+ }
1595
+ for (var c = t + 1; c < this.n; c++) {
1596
+ if (/* @__PURE__ */ function(Tt, Ct) {
1597
+ return Tt && Ct;
1598
+ }(t < i, this.s[t] !== 0)) {
1599
+ for (var l = 0, T = t; T < this.m; T++)
1600
+ l += h[T][t] * h[T][c];
1601
+ l = -l / h[t][t];
1602
+ for (var d = t; d < this.m; d++)
1603
+ h[d][c] += l * h[d][t];
1604
+ }
1605
+ r[c] = h[t][c];
1606
+ }
1607
+ if (/* @__PURE__ */ function(Tt, Ct) {
1608
+ return Ct;
1609
+ }(f, t < i))
1610
+ for (var v = t; v < this.m; v++)
1611
+ this.U[v][t] = h[v][t];
1612
+ if (t < g) {
1613
+ r[t] = 0;
1614
+ for (var L = t + 1; L < this.n; L++)
1615
+ r[t] = u.hypot(r[t], r[L]);
1616
+ if (r[t] !== 0) {
1617
+ r[t + 1] < 0 && (r[t] = -r[t]);
1618
+ for (var S = t + 1; S < this.n; S++)
1619
+ r[S] /= r[t];
1620
+ r[t + 1] += 1;
1621
+ }
1622
+ if (r[t] = -r[t], /* @__PURE__ */ function(Tt, Ct) {
1623
+ return Tt && Ct;
1624
+ }(t + 1 < this.m, r[t] !== 0)) {
1625
+ for (var C = t + 1; C < this.m; C++)
1626
+ e[C] = 0;
1627
+ for (var G = t + 1; G < this.n; G++)
1628
+ for (var K = t + 1; K < this.m; K++)
1629
+ e[K] += r[G] * h[K][G];
1630
+ for (var X = t + 1; X < this.n; X++)
1631
+ for (var Q = -r[X] / r[t + 1], O = t + 1; O < this.m; O++)
1632
+ h[O][X] += Q * e[O];
1633
+ }
1634
+ for (var rt = t + 1; rt < this.n; rt++)
1635
+ this.V[rt][t] = r[rt];
1636
+ }
1637
+ }
1638
+ var n = Math.min(this.n, this.m + 1);
1639
+ i < this.n && (this.s[i] = h[i][i]), this.m < n && (this.s[n - 1] = 0), g + 1 < n && (r[g] = h[g][n - 1]), r[n - 1] = 0;
1640
+ {
1641
+ for (var m = i; m < a; m++) {
1642
+ for (var p = 0; p < this.m; p++)
1643
+ this.U[p][m] = 0;
1644
+ this.U[m][m] = 1;
1645
+ }
1646
+ for (var E = i - 1; E >= 0; E--)
1647
+ if (this.s[E] !== 0) {
1648
+ for (var y = E + 1; y < a; y++) {
1649
+ for (var R = 0, M = E; M < this.m; M++)
1650
+ R += this.U[M][E] * this.U[M][y];
1651
+ R = -R / this.U[E][E];
1652
+ for (var F = E; F < this.m; F++)
1653
+ this.U[F][y] += R * this.U[F][E];
1654
+ }
1655
+ for (var W = E; W < this.m; W++)
1656
+ this.U[W][E] = -this.U[W][E];
1657
+ this.U[E][E] = 1 + this.U[E][E];
1658
+ for (var x = 0; x < E - 1; x++)
1659
+ this.U[x][E] = 0;
1660
+ } else {
1661
+ for (var k = 0; k < this.m; k++)
1662
+ this.U[k][E] = 0;
1663
+ this.U[E][E] = 1;
1664
+ }
1665
+ }
1666
+ for (var V = this.n - 1; V >= 0; V--) {
1667
+ if (/* @__PURE__ */ function(Tt, Ct) {
1668
+ return Tt && Ct;
1669
+ }(V < g, r[V] !== 0))
1670
+ for (var Y = V + 1; Y < a; Y++) {
1671
+ for (var et = 0, z = V + 1; z < this.n; z++)
1672
+ et += this.V[z][V] * this.V[z][Y];
1673
+ et = -et / this.V[V + 1][V];
1674
+ for (var w = V + 1; w < this.n; w++)
1675
+ this.V[w][Y] += et * this.V[w][V];
1676
+ }
1677
+ for (var H = 0; H < this.n; H++)
1678
+ this.V[H][V] = 0;
1679
+ this.V[V][V] = 1;
1680
+ }
1681
+ for (var B = n - 1, _ = Math.pow(2, -52), ht = Math.pow(2, -966); n > 0; ) {
1682
+ var q = void 0, It = void 0;
1683
+ for (q = n - 2; q >= -1 && q !== -1; q--)
1684
+ if (Math.abs(r[q]) <= ht + _ * (Math.abs(this.s[q]) + Math.abs(this.s[q + 1]))) {
1685
+ r[q] = 0;
1686
+ break;
1687
+ }
1688
+ if (q === n - 2)
1689
+ It = 4;
1690
+ else {
1691
+ var Nt = void 0;
1692
+ for (Nt = n - 1; Nt >= q && Nt !== q; Nt--) {
1693
+ var vt = (Nt !== n ? Math.abs(r[Nt]) : 0) + (Nt !== q + 1 ? Math.abs(r[Nt - 1]) : 0);
1694
+ if (Math.abs(this.s[Nt]) <= ht + _ * vt) {
1695
+ this.s[Nt] = 0;
1696
+ break;
1697
+ }
1698
+ }
1699
+ Nt === q ? It = 3 : Nt === n - 1 ? It = 1 : (It = 2, q = Nt);
1700
+ }
1701
+ switch (q++, It) {
1702
+ case 1:
1703
+ {
1704
+ var it = r[n - 2];
1705
+ r[n - 2] = 0;
1706
+ for (var gt = n - 2; gt >= q; gt--) {
1707
+ var mt = u.hypot(this.s[gt], it), At = this.s[gt] / mt, Ot = it / mt;
1708
+ this.s[gt] = mt, gt !== q && (it = -Ot * r[gt - 1], r[gt - 1] = At * r[gt - 1]);
1709
+ for (var Et = 0; Et < this.n; Et++)
1710
+ mt = At * this.V[Et][gt] + Ot * this.V[Et][n - 1], this.V[Et][n - 1] = -Ot * this.V[Et][gt] + At * this.V[Et][n - 1], this.V[Et][gt] = mt;
1711
+ }
1712
+ }
1713
+ break;
1714
+ case 2:
1715
+ {
1716
+ var Dt = r[q - 1];
1717
+ r[q - 1] = 0;
1718
+ for (var Rt = q; Rt < n; Rt++) {
1719
+ var Ht = u.hypot(this.s[Rt], Dt), Ut = this.s[Rt] / Ht, Pt = Dt / Ht;
1720
+ this.s[Rt] = Ht, Dt = -Pt * r[Rt], r[Rt] = Ut * r[Rt];
1721
+ for (var Ft = 0; Ft < this.m; Ft++)
1722
+ Ht = Ut * this.U[Ft][Rt] + Pt * this.U[Ft][q - 1], this.U[Ft][q - 1] = -Pt * this.U[Ft][Rt] + Ut * this.U[Ft][q - 1], this.U[Ft][Rt] = Ht;
1723
+ }
1724
+ }
1725
+ break;
1726
+ case 3:
1727
+ {
1728
+ var Yt = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[n - 1]), Math.abs(this.s[n - 2])), Math.abs(r[n - 2])), Math.abs(this.s[q])), Math.abs(r[q])), Vt = this.s[n - 1] / Yt, b = this.s[n - 2] / Yt, U = r[n - 2] / Yt, $ = this.s[q] / Yt, J = r[q] / Yt, Z = ((b + Vt) * (b - Vt) + U * U) / 2, at = Vt * U * (Vt * U), ct = 0;
1729
+ /* @__PURE__ */ (function(Tt, Ct) {
1730
+ return Tt || Ct;
1731
+ })(Z !== 0, at !== 0) && (ct = Math.sqrt(Z * Z + at), Z < 0 && (ct = -ct), ct = at / (Z + ct));
1732
+ for (var nt = ($ + Vt) * ($ - Vt) + ct, tt = $ * J, j = q; j < n - 1; j++) {
1733
+ var ut = u.hypot(nt, tt), Mt = nt / ut, pt = tt / ut;
1734
+ j !== q && (r[j - 1] = ut), nt = Mt * this.s[j] + pt * r[j], r[j] = Mt * r[j] - pt * this.s[j], tt = pt * this.s[j + 1], this.s[j + 1] = Mt * this.s[j + 1];
1735
+ for (var xt = 0; xt < this.n; xt++)
1736
+ ut = Mt * this.V[xt][j] + pt * this.V[xt][j + 1], this.V[xt][j + 1] = -pt * this.V[xt][j] + Mt * this.V[xt][j + 1], this.V[xt][j] = ut;
1737
+ if (ut = u.hypot(nt, tt), Mt = nt / ut, pt = tt / ut, this.s[j] = ut, nt = Mt * r[j] + pt * this.s[j + 1], this.s[j + 1] = -pt * r[j] + Mt * this.s[j + 1], tt = pt * r[j + 1], r[j + 1] = Mt * r[j + 1], j < this.m - 1)
1738
+ for (var lt = 0; lt < this.m; lt++)
1739
+ ut = Mt * this.U[lt][j] + pt * this.U[lt][j + 1], this.U[lt][j + 1] = -pt * this.U[lt][j] + Mt * this.U[lt][j + 1], this.U[lt][j] = ut;
1740
+ }
1741
+ r[n - 2] = nt;
1742
+ }
1743
+ break;
1744
+ case 4:
1745
+ {
1746
+ if (this.s[q] <= 0) {
1747
+ this.s[q] = this.s[q] < 0 ? -this.s[q] : 0;
1748
+ for (var ot = 0; ot <= B; ot++)
1749
+ this.V[ot][q] = -this.V[ot][q];
1750
+ }
1751
+ for (; q < B && !(this.s[q] >= this.s[q + 1]); ) {
1752
+ var Lt = this.s[q];
1753
+ if (this.s[q] = this.s[q + 1], this.s[q + 1] = Lt, q < this.n - 1)
1754
+ for (var ft = 0; ft < this.n; ft++)
1755
+ Lt = this.V[ft][q + 1], this.V[ft][q + 1] = this.V[ft][q], this.V[ft][q] = Lt;
1756
+ if (q < this.m - 1)
1757
+ for (var st = 0; st < this.m; st++)
1758
+ Lt = this.U[st][q + 1], this.U[st][q + 1] = this.U[st][q], this.U[st][q] = Lt;
1759
+ q++;
1760
+ }
1761
+ n--;
1762
+ }
1763
+ break;
1764
+ }
1765
+ }
1766
+ var Xt = { U: this.U, V: this.V, S: this.s };
1767
+ return Xt;
1768
+ }, u.hypot = function(h, a) {
1769
+ var r = void 0;
1770
+ return Math.abs(h) > Math.abs(a) ? (r = a / h, r = Math.abs(h) * Math.sqrt(1 + r * r)) : a != 0 ? (r = h / a, r = Math.abs(a) * Math.sqrt(1 + r * r)) : r = 0, r;
1771
+ }, A.exports = u;
1772
+ },
1773
+ /* 27 */
1774
+ /***/
1775
+ function(A, P, N) {
1776
+ var u = /* @__PURE__ */ function() {
1777
+ function r(e, f) {
1778
+ for (var i = 0; i < f.length; i++) {
1779
+ var g = f[i];
1780
+ g.enumerable = g.enumerable || !1, g.configurable = !0, "value" in g && (g.writable = !0), Object.defineProperty(e, g.key, g);
1781
+ }
1782
+ }
1783
+ return function(e, f, i) {
1784
+ return f && r(e.prototype, f), i && r(e, i), e;
1785
+ };
1786
+ }();
1787
+ function h(r, e) {
1788
+ if (!(r instanceof e))
1789
+ throw new TypeError("Cannot call a class as a function");
1790
+ }
1791
+ var a = function() {
1792
+ function r(e, f) {
1793
+ var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, g = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, t = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1794
+ h(this, r), this.sequence1 = e, this.sequence2 = f, this.match_score = i, this.mismatch_penalty = g, this.gap_penalty = t, this.iMax = e.length + 1, this.jMax = f.length + 1, this.grid = new Array(this.iMax);
1795
+ for (var o = 0; o < this.iMax; o++) {
1796
+ this.grid[o] = new Array(this.jMax);
1797
+ for (var s = 0; s < this.jMax; s++)
1798
+ this.grid[o][s] = 0;
1799
+ }
1800
+ this.tracebackGrid = new Array(this.iMax);
1801
+ for (var c = 0; c < this.iMax; c++) {
1802
+ this.tracebackGrid[c] = new Array(this.jMax);
1803
+ for (var l = 0; l < this.jMax; l++)
1804
+ this.tracebackGrid[c][l] = [null, null, null];
1805
+ }
1806
+ this.alignments = [], this.score = -1, this.computeGrids();
1807
+ }
1808
+ return u(r, [{
1809
+ key: "getScore",
1810
+ value: function() {
1811
+ return this.score;
1812
+ }
1813
+ }, {
1814
+ key: "getAlignments",
1815
+ value: function() {
1816
+ return this.alignments;
1817
+ }
1818
+ // Main dynamic programming procedure
1819
+ }, {
1820
+ key: "computeGrids",
1821
+ value: function() {
1822
+ for (var f = 1; f < this.jMax; f++)
1823
+ this.grid[0][f] = this.grid[0][f - 1] + this.gap_penalty, this.tracebackGrid[0][f] = [!1, !1, !0];
1824
+ for (var i = 1; i < this.iMax; i++)
1825
+ this.grid[i][0] = this.grid[i - 1][0] + this.gap_penalty, this.tracebackGrid[i][0] = [!1, !0, !1];
1826
+ for (var g = 1; g < this.iMax; g++)
1827
+ for (var t = 1; t < this.jMax; t++) {
1828
+ var o = void 0;
1829
+ this.sequence1[g - 1] === this.sequence2[t - 1] ? o = this.grid[g - 1][t - 1] + this.match_score : o = this.grid[g - 1][t - 1] + this.mismatch_penalty;
1830
+ var s = this.grid[g - 1][t] + this.gap_penalty, c = this.grid[g][t - 1] + this.gap_penalty, l = [o, s, c], T = this.arrayAllMaxIndexes(l);
1831
+ this.grid[g][t] = l[T[0]], this.tracebackGrid[g][t] = [T.includes(0), T.includes(1), T.includes(2)];
1832
+ }
1833
+ this.score = this.grid[this.iMax - 1][this.jMax - 1];
1834
+ }
1835
+ // Gets all possible valid sequence combinations
1836
+ }, {
1837
+ key: "alignmentTraceback",
1838
+ value: function() {
1839
+ var f = [];
1840
+ for (f.push({
1841
+ pos: [this.sequence1.length, this.sequence2.length],
1842
+ seq1: "",
1843
+ seq2: ""
1844
+ }); f[0]; ) {
1845
+ var i = f[0], g = this.tracebackGrid[i.pos[0]][i.pos[1]];
1846
+ g[0] && f.push({
1847
+ pos: [i.pos[0] - 1, i.pos[1] - 1],
1848
+ seq1: this.sequence1[i.pos[0] - 1] + i.seq1,
1849
+ seq2: this.sequence2[i.pos[1] - 1] + i.seq2
1850
+ }), g[1] && f.push({
1851
+ pos: [i.pos[0] - 1, i.pos[1]],
1852
+ seq1: this.sequence1[i.pos[0] - 1] + i.seq1,
1853
+ seq2: "-" + i.seq2
1854
+ }), g[2] && f.push({
1855
+ pos: [i.pos[0], i.pos[1] - 1],
1856
+ seq1: "-" + i.seq1,
1857
+ seq2: this.sequence2[i.pos[1] - 1] + i.seq2
1858
+ }), i.pos[0] === 0 && i.pos[1] === 0 && this.alignments.push({
1859
+ sequence1: i.seq1,
1860
+ sequence2: i.seq2
1861
+ }), f.shift();
1862
+ }
1863
+ return this.alignments;
1864
+ }
1865
+ // Helper Functions
1866
+ }, {
1867
+ key: "getAllIndexes",
1868
+ value: function(f, i) {
1869
+ for (var g = [], t = -1; (t = f.indexOf(i, t + 1)) !== -1; )
1870
+ g.push(t);
1871
+ return g;
1872
+ }
1873
+ }, {
1874
+ key: "arrayAllMaxIndexes",
1875
+ value: function(f) {
1876
+ return this.getAllIndexes(f, Math.max.apply(null, f));
1877
+ }
1878
+ }]), r;
1879
+ }();
1880
+ A.exports = a;
1881
+ },
1882
+ /* 28 */
1883
+ /***/
1884
+ function(A, P, N) {
1885
+ var u = function() {
1886
+ };
1887
+ u.FDLayout = N(18), u.FDLayoutConstants = N(4), u.FDLayoutEdge = N(19), u.FDLayoutNode = N(20), u.DimensionD = N(21), u.HashMap = N(22), u.HashSet = N(23), u.IGeometry = N(8), u.IMath = N(9), u.Integer = N(10), u.Point = N(12), u.PointD = N(5), u.RandomSeed = N(16), u.RectangleD = N(13), u.Transform = N(17), u.UniqueIDGeneretor = N(14), u.Quicksort = N(25), u.LinkedList = N(11), u.LGraphObject = N(2), u.LGraph = N(6), u.LEdge = N(1), u.LGraphManager = N(7), u.LNode = N(3), u.Layout = N(15), u.LayoutConstants = N(0), u.NeedlemanWunsch = N(27), u.Matrix = N(24), u.SVD = N(26), A.exports = u;
1888
+ },
1889
+ /* 29 */
1890
+ /***/
1891
+ function(A, P, N) {
1892
+ function u() {
1893
+ this.listeners = [];
1894
+ }
1895
+ var h = u.prototype;
1896
+ h.addListener = function(a, r) {
1897
+ this.listeners.push({
1898
+ event: a,
1899
+ callback: r
1900
+ });
1901
+ }, h.removeListener = function(a, r) {
1902
+ for (var e = this.listeners.length; e >= 0; e--) {
1903
+ var f = this.listeners[e];
1904
+ f.event === a && f.callback === r && this.listeners.splice(e, 1);
1905
+ }
1906
+ }, h.emit = function(a, r) {
1907
+ for (var e = 0; e < this.listeners.length; e++) {
1908
+ var f = this.listeners[e];
1909
+ a === f.event && f.callback(r);
1910
+ }
1911
+ }, A.exports = u;
1912
+ }
1913
+ /******/
1914
+ ])
1915
+ );
1916
+ });
1917
+ }(de)), de.exports;
1918
+ }
1919
+ var Oe;
1920
+ function ur() {
1921
+ return Oe || (Oe = 1, function(I, D) {
1922
+ (function(P, N) {
1923
+ I.exports = N(gr());
1924
+ })(me, function(A) {
1925
+ return (
1926
+ /******/
1927
+ (() => {
1928
+ var P = {
1929
+ /***/
1930
+ 45: (
1931
+ /***/
1932
+ (a, r, e) => {
1933
+ var f = {};
1934
+ f.layoutBase = e(551), f.CoSEConstants = e(806), f.CoSEEdge = e(767), f.CoSEGraph = e(880), f.CoSEGraphManager = e(578), f.CoSELayout = e(765), f.CoSENode = e(991), f.ConstraintHandler = e(902), a.exports = f;
1935
+ }
1936
+ ),
1937
+ /***/
1938
+ 806: (
1939
+ /***/
1940
+ (a, r, e) => {
1941
+ var f = e(551).FDLayoutConstants;
1942
+ function i() {
1943
+ }
1944
+ for (var g in f)
1945
+ i[g] = f[g];
1946
+ i.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, i.DEFAULT_RADIAL_SEPARATION = f.DEFAULT_EDGE_LENGTH, i.DEFAULT_COMPONENT_SEPERATION = 60, i.TILE = !0, i.TILING_PADDING_VERTICAL = 10, i.TILING_PADDING_HORIZONTAL = 10, i.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, i.ENFORCE_CONSTRAINTS = !0, i.APPLY_LAYOUT = !0, i.RELAX_MOVEMENT_ON_CONSTRAINTS = !0, i.TREE_REDUCTION_ON_INCREMENTAL = !0, i.PURE_INCREMENTAL = i.DEFAULT_INCREMENTAL, a.exports = i;
1947
+ }
1948
+ ),
1949
+ /***/
1950
+ 767: (
1951
+ /***/
1952
+ (a, r, e) => {
1953
+ var f = e(551).FDLayoutEdge;
1954
+ function i(t, o, s) {
1955
+ f.call(this, t, o, s);
1956
+ }
1957
+ i.prototype = Object.create(f.prototype);
1958
+ for (var g in f)
1959
+ i[g] = f[g];
1960
+ a.exports = i;
1961
+ }
1962
+ ),
1963
+ /***/
1964
+ 880: (
1965
+ /***/
1966
+ (a, r, e) => {
1967
+ var f = e(551).LGraph;
1968
+ function i(t, o, s) {
1969
+ f.call(this, t, o, s);
1970
+ }
1971
+ i.prototype = Object.create(f.prototype);
1972
+ for (var g in f)
1973
+ i[g] = f[g];
1974
+ a.exports = i;
1975
+ }
1976
+ ),
1977
+ /***/
1978
+ 578: (
1979
+ /***/
1980
+ (a, r, e) => {
1981
+ var f = e(551).LGraphManager;
1982
+ function i(t) {
1983
+ f.call(this, t);
1984
+ }
1985
+ i.prototype = Object.create(f.prototype);
1986
+ for (var g in f)
1987
+ i[g] = f[g];
1988
+ a.exports = i;
1989
+ }
1990
+ ),
1991
+ /***/
1992
+ 765: (
1993
+ /***/
1994
+ (a, r, e) => {
1995
+ var f = e(551).FDLayout, i = e(578), g = e(880), t = e(991), o = e(767), s = e(806), c = e(902), l = e(551).FDLayoutConstants, T = e(551).LayoutConstants, d = e(551).Point, v = e(551).PointD, L = e(551).DimensionD, S = e(551).Layout, C = e(551).Integer, G = e(551).IGeometry, K = e(551).LGraph, X = e(551).Transform, Q = e(551).LinkedList;
1996
+ function O() {
1997
+ f.call(this), this.toBeTiled = {}, this.constraints = {};
1998
+ }
1999
+ O.prototype = Object.create(f.prototype);
2000
+ for (var rt in f)
2001
+ O[rt] = f[rt];
2002
+ O.prototype.newGraphManager = function() {
2003
+ var n = new i(this);
2004
+ return this.graphManager = n, n;
2005
+ }, O.prototype.newGraph = function(n) {
2006
+ return new g(null, this.graphManager, n);
2007
+ }, O.prototype.newNode = function(n) {
2008
+ return new t(this.graphManager, n);
2009
+ }, O.prototype.newEdge = function(n) {
2010
+ return new o(null, null, n);
2011
+ }, O.prototype.initParameters = function() {
2012
+ f.prototype.initParameters.call(this, arguments), this.isSubLayout || (s.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = s.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = l.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = l.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = l.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1);
2013
+ }, O.prototype.initSpringEmbedder = function() {
2014
+ f.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / l.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = 0.04, this.coolingAdjuster = 1;
2015
+ }, O.prototype.layout = function() {
2016
+ var n = T.DEFAULT_CREATE_BENDS_AS_NEEDED;
2017
+ return n && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
2018
+ }, O.prototype.classicLayout = function() {
2019
+ if (this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(), this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity), this.calcNoOfChildrenForAllNodes(), this.graphManager.calcLowestCommonAncestors(), this.graphManager.calcInclusionTreeDepths(), this.graphManager.getRoot().calcEstimatedSize(), this.calcIdealEdgeLengths(), this.incremental) {
2020
+ if (s.TREE_REDUCTION_ON_INCREMENTAL) {
2021
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
2022
+ var m = new Set(this.getAllNodes()), p = this.nodesWithGravity.filter(function(R) {
2023
+ return m.has(R);
2024
+ });
2025
+ this.graphManager.setAllNodesToApplyGravitation(p);
2026
+ }
2027
+ } else {
2028
+ var n = this.getFlatForest();
2029
+ if (n.length > 0)
2030
+ this.positionNodesRadially(n);
2031
+ else {
2032
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
2033
+ var m = new Set(this.getAllNodes()), p = this.nodesWithGravity.filter(function(E) {
2034
+ return m.has(E);
2035
+ });
2036
+ this.graphManager.setAllNodesToApplyGravitation(p), this.positionNodesRandomly();
2037
+ }
2038
+ }
2039
+ return Object.keys(this.constraints).length > 0 && (c.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), s.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
2040
+ }, O.prototype.tick = function() {
2041
+ if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
2042
+ if (this.prunedNodesAll.length > 0)
2043
+ this.isTreeGrowing = !0;
2044
+ else
2045
+ return !0;
2046
+ if (this.totalIterations % l.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
2047
+ if (this.isConverged())
2048
+ if (this.prunedNodesAll.length > 0)
2049
+ this.isTreeGrowing = !0;
2050
+ else
2051
+ return !0;
2052
+ this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
2053
+ }
2054
+ if (this.isTreeGrowing) {
2055
+ if (this.growTreeIterations % 10 == 0)
2056
+ if (this.prunedNodesAll.length > 0) {
2057
+ this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
2058
+ var n = new Set(this.getAllNodes()), m = this.nodesWithGravity.filter(function(y) {
2059
+ return n.has(y);
2060
+ });
2061
+ this.graphManager.setAllNodesToApplyGravitation(m), this.graphManager.updateBounds(), this.updateGrid(), s.PURE_INCREMENTAL ? this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL;
2062
+ } else
2063
+ this.isTreeGrowing = !1, this.isGrowthFinished = !0;
2064
+ this.growTreeIterations++;
2065
+ }
2066
+ if (this.isGrowthFinished) {
2067
+ if (this.isConverged())
2068
+ return !0;
2069
+ this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), s.PURE_INCREMENTAL ? this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100) : this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
2070
+ }
2071
+ var p = !this.isTreeGrowing && !this.isGrowthFinished, E = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
2072
+ return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(p, E), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
2073
+ }, O.prototype.getPositionsData = function() {
2074
+ for (var n = this.graphManager.getAllNodes(), m = {}, p = 0; p < n.length; p++) {
2075
+ var E = n[p].rect, y = n[p].id;
2076
+ m[y] = {
2077
+ id: y,
2078
+ x: E.getCenterX(),
2079
+ y: E.getCenterY(),
2080
+ w: E.width,
2081
+ h: E.height
2082
+ };
2083
+ }
2084
+ return m;
2085
+ }, O.prototype.runSpringEmbedder = function() {
2086
+ this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
2087
+ var n = !1;
2088
+ if (l.ANIMATE === "during")
2089
+ this.emit("layoutstarted");
2090
+ else {
2091
+ for (; !n; )
2092
+ n = this.tick();
2093
+ this.graphManager.updateBounds();
2094
+ }
2095
+ }, O.prototype.moveNodes = function() {
2096
+ for (var n = this.getAllNodes(), m, p = 0; p < n.length; p++)
2097
+ m = n[p], m.calculateDisplacement();
2098
+ Object.keys(this.constraints).length > 0 && this.updateDisplacements();
2099
+ for (var p = 0; p < n.length; p++)
2100
+ m = n[p], m.move();
2101
+ }, O.prototype.initConstraintVariables = function() {
2102
+ var n = this;
2103
+ this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
2104
+ for (var m = this.graphManager.getAllNodes(), p = 0; p < m.length; p++) {
2105
+ var E = m[p];
2106
+ this.idToNodeMap.set(E.id, E);
2107
+ }
2108
+ var y = function w(H) {
2109
+ for (var B = H.getChild().getNodes(), _, ht = 0, q = 0; q < B.length; q++)
2110
+ _ = B[q], _.getChild() == null ? n.fixedNodeSet.has(_.id) && (ht += 100) : ht += w(_);
2111
+ return ht;
2112
+ };
2113
+ if (this.constraints.fixedNodeConstraint) {
2114
+ this.constraints.fixedNodeConstraint.forEach(function(B) {
2115
+ n.fixedNodeSet.add(B.nodeId);
2116
+ });
2117
+ for (var m = this.graphManager.getAllNodes(), E, p = 0; p < m.length; p++)
2118
+ if (E = m[p], E.getChild() != null) {
2119
+ var R = y(E);
2120
+ R > 0 && (E.fixedNodeWeight = R);
2121
+ }
2122
+ }
2123
+ if (this.constraints.relativePlacementConstraint) {
2124
+ var M = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
2125
+ if (this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(), this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(), this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set(), this.fixedNodesOnVertical = /* @__PURE__ */ new Set(), this.fixedNodeSet.forEach(function(w) {
2126
+ n.fixedNodesOnHorizontal.add(w), n.fixedNodesOnVertical.add(w);
2127
+ }), this.constraints.alignmentConstraint) {
2128
+ if (this.constraints.alignmentConstraint.vertical)
2129
+ for (var W = this.constraints.alignmentConstraint.vertical, p = 0; p < W.length; p++)
2130
+ this.dummyToNodeForVerticalAlignment.set("dummy" + p, []), W[p].forEach(function(H) {
2131
+ M.set(H, "dummy" + p), n.dummyToNodeForVerticalAlignment.get("dummy" + p).push(H), n.fixedNodeSet.has(H) && n.fixedNodesOnHorizontal.add("dummy" + p);
2132
+ });
2133
+ if (this.constraints.alignmentConstraint.horizontal)
2134
+ for (var x = this.constraints.alignmentConstraint.horizontal, p = 0; p < x.length; p++)
2135
+ this.dummyToNodeForHorizontalAlignment.set("dummy" + p, []), x[p].forEach(function(H) {
2136
+ F.set(H, "dummy" + p), n.dummyToNodeForHorizontalAlignment.get("dummy" + p).push(H), n.fixedNodeSet.has(H) && n.fixedNodesOnVertical.add("dummy" + p);
2137
+ });
2138
+ }
2139
+ if (s.RELAX_MOVEMENT_ON_CONSTRAINTS)
2140
+ this.shuffle = function(w) {
2141
+ var H, B, _;
2142
+ for (_ = w.length - 1; _ >= 2 * w.length / 3; _--)
2143
+ H = Math.floor(Math.random() * (_ + 1)), B = w[_], w[_] = w[H], w[H] = B;
2144
+ return w;
2145
+ }, this.nodesInRelativeHorizontal = [], this.nodesInRelativeVertical = [], this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map(), this.constraints.relativePlacementConstraint.forEach(function(w) {
2146
+ if (w.left) {
2147
+ var H = M.has(w.left) ? M.get(w.left) : w.left, B = M.has(w.right) ? M.get(w.right) : w.right;
2148
+ n.nodesInRelativeHorizontal.includes(H) || (n.nodesInRelativeHorizontal.push(H), n.nodeToRelativeConstraintMapHorizontal.set(H, []), n.dummyToNodeForVerticalAlignment.has(H) ? n.nodeToTempPositionMapHorizontal.set(H, n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()) : n.nodeToTempPositionMapHorizontal.set(H, n.idToNodeMap.get(H).getCenterX())), n.nodesInRelativeHorizontal.includes(B) || (n.nodesInRelativeHorizontal.push(B), n.nodeToRelativeConstraintMapHorizontal.set(B, []), n.dummyToNodeForVerticalAlignment.has(B) ? n.nodeToTempPositionMapHorizontal.set(B, n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()) : n.nodeToTempPositionMapHorizontal.set(B, n.idToNodeMap.get(B).getCenterX())), n.nodeToRelativeConstraintMapHorizontal.get(H).push({ right: B, gap: w.gap }), n.nodeToRelativeConstraintMapHorizontal.get(B).push({ left: H, gap: w.gap });
2149
+ } else {
2150
+ var _ = F.has(w.top) ? F.get(w.top) : w.top, ht = F.has(w.bottom) ? F.get(w.bottom) : w.bottom;
2151
+ n.nodesInRelativeVertical.includes(_) || (n.nodesInRelativeVertical.push(_), n.nodeToRelativeConstraintMapVertical.set(_, []), n.dummyToNodeForHorizontalAlignment.has(_) ? n.nodeToTempPositionMapVertical.set(_, n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(_)[0]).getCenterY()) : n.nodeToTempPositionMapVertical.set(_, n.idToNodeMap.get(_).getCenterY())), n.nodesInRelativeVertical.includes(ht) || (n.nodesInRelativeVertical.push(ht), n.nodeToRelativeConstraintMapVertical.set(ht, []), n.dummyToNodeForHorizontalAlignment.has(ht) ? n.nodeToTempPositionMapVertical.set(ht, n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()) : n.nodeToTempPositionMapVertical.set(ht, n.idToNodeMap.get(ht).getCenterY())), n.nodeToRelativeConstraintMapVertical.get(_).push({ bottom: ht, gap: w.gap }), n.nodeToRelativeConstraintMapVertical.get(ht).push({ top: _, gap: w.gap });
2152
+ }
2153
+ });
2154
+ else {
2155
+ var k = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map();
2156
+ this.constraints.relativePlacementConstraint.forEach(function(w) {
2157
+ if (w.left) {
2158
+ var H = M.has(w.left) ? M.get(w.left) : w.left, B = M.has(w.right) ? M.get(w.right) : w.right;
2159
+ k.has(H) ? k.get(H).push(B) : k.set(H, [B]), k.has(B) ? k.get(B).push(H) : k.set(B, [H]);
2160
+ } else {
2161
+ var _ = F.has(w.top) ? F.get(w.top) : w.top, ht = F.has(w.bottom) ? F.get(w.bottom) : w.bottom;
2162
+ V.has(_) ? V.get(_).push(ht) : V.set(_, [ht]), V.has(ht) ? V.get(ht).push(_) : V.set(ht, [_]);
2163
+ }
2164
+ });
2165
+ var Y = function(H, B) {
2166
+ var _ = [], ht = [], q = new Q(), It = /* @__PURE__ */ new Set(), Nt = 0;
2167
+ return H.forEach(function(vt, it) {
2168
+ if (!It.has(it)) {
2169
+ _[Nt] = [], ht[Nt] = !1;
2170
+ var gt = it;
2171
+ for (q.push(gt), It.add(gt), _[Nt].push(gt); q.length != 0; ) {
2172
+ gt = q.shift(), B.has(gt) && (ht[Nt] = !0);
2173
+ var mt = H.get(gt);
2174
+ mt.forEach(function(At) {
2175
+ It.has(At) || (q.push(At), It.add(At), _[Nt].push(At));
2176
+ });
2177
+ }
2178
+ Nt++;
2179
+ }
2180
+ }), { components: _, isFixed: ht };
2181
+ }, et = Y(k, n.fixedNodesOnHorizontal);
2182
+ this.componentsOnHorizontal = et.components, this.fixedComponentsOnHorizontal = et.isFixed;
2183
+ var z = Y(V, n.fixedNodesOnVertical);
2184
+ this.componentsOnVertical = z.components, this.fixedComponentsOnVertical = z.isFixed;
2185
+ }
2186
+ }
2187
+ }, O.prototype.updateDisplacements = function() {
2188
+ var n = this;
2189
+ if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function(z) {
2190
+ var w = n.idToNodeMap.get(z.nodeId);
2191
+ w.displacementX = 0, w.displacementY = 0;
2192
+ }), this.constraints.alignmentConstraint) {
2193
+ if (this.constraints.alignmentConstraint.vertical)
2194
+ for (var m = this.constraints.alignmentConstraint.vertical, p = 0; p < m.length; p++) {
2195
+ for (var E = 0, y = 0; y < m[p].length; y++) {
2196
+ if (this.fixedNodeSet.has(m[p][y])) {
2197
+ E = 0;
2198
+ break;
2199
+ }
2200
+ E += this.idToNodeMap.get(m[p][y]).displacementX;
2201
+ }
2202
+ for (var R = E / m[p].length, y = 0; y < m[p].length; y++)
2203
+ this.idToNodeMap.get(m[p][y]).displacementX = R;
2204
+ }
2205
+ if (this.constraints.alignmentConstraint.horizontal)
2206
+ for (var M = this.constraints.alignmentConstraint.horizontal, p = 0; p < M.length; p++) {
2207
+ for (var F = 0, y = 0; y < M[p].length; y++) {
2208
+ if (this.fixedNodeSet.has(M[p][y])) {
2209
+ F = 0;
2210
+ break;
2211
+ }
2212
+ F += this.idToNodeMap.get(M[p][y]).displacementY;
2213
+ }
2214
+ for (var W = F / M[p].length, y = 0; y < M[p].length; y++)
2215
+ this.idToNodeMap.get(M[p][y]).displacementY = W;
2216
+ }
2217
+ }
2218
+ if (this.constraints.relativePlacementConstraint)
2219
+ if (s.RELAX_MOVEMENT_ON_CONSTRAINTS)
2220
+ this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function(z) {
2221
+ if (!n.fixedNodesOnHorizontal.has(z)) {
2222
+ var w = 0;
2223
+ n.dummyToNodeForVerticalAlignment.has(z) ? w = n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(z)[0]).displacementX : w = n.idToNodeMap.get(z).displacementX, n.nodeToRelativeConstraintMapHorizontal.get(z).forEach(function(H) {
2224
+ if (H.right) {
2225
+ var B = n.nodeToTempPositionMapHorizontal.get(H.right) - n.nodeToTempPositionMapHorizontal.get(z) - w;
2226
+ B < H.gap && (w -= H.gap - B);
2227
+ } else {
2228
+ var B = n.nodeToTempPositionMapHorizontal.get(z) - n.nodeToTempPositionMapHorizontal.get(H.left) + w;
2229
+ B < H.gap && (w += H.gap - B);
2230
+ }
2231
+ }), n.nodeToTempPositionMapHorizontal.set(z, n.nodeToTempPositionMapHorizontal.get(z) + w), n.dummyToNodeForVerticalAlignment.has(z) ? n.dummyToNodeForVerticalAlignment.get(z).forEach(function(H) {
2232
+ n.idToNodeMap.get(H).displacementX = w;
2233
+ }) : n.idToNodeMap.get(z).displacementX = w;
2234
+ }
2235
+ }), this.nodesInRelativeVertical.forEach(function(z) {
2236
+ if (!n.fixedNodesOnHorizontal.has(z)) {
2237
+ var w = 0;
2238
+ n.dummyToNodeForHorizontalAlignment.has(z) ? w = n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(z)[0]).displacementY : w = n.idToNodeMap.get(z).displacementY, n.nodeToRelativeConstraintMapVertical.get(z).forEach(function(H) {
2239
+ if (H.bottom) {
2240
+ var B = n.nodeToTempPositionMapVertical.get(H.bottom) - n.nodeToTempPositionMapVertical.get(z) - w;
2241
+ B < H.gap && (w -= H.gap - B);
2242
+ } else {
2243
+ var B = n.nodeToTempPositionMapVertical.get(z) - n.nodeToTempPositionMapVertical.get(H.top) + w;
2244
+ B < H.gap && (w += H.gap - B);
2245
+ }
2246
+ }), n.nodeToTempPositionMapVertical.set(z, n.nodeToTempPositionMapVertical.get(z) + w), n.dummyToNodeForHorizontalAlignment.has(z) ? n.dummyToNodeForHorizontalAlignment.get(z).forEach(function(H) {
2247
+ n.idToNodeMap.get(H).displacementY = w;
2248
+ }) : n.idToNodeMap.get(z).displacementY = w;
2249
+ }
2250
+ });
2251
+ else {
2252
+ for (var p = 0; p < this.componentsOnHorizontal.length; p++) {
2253
+ var x = this.componentsOnHorizontal[p];
2254
+ if (this.fixedComponentsOnHorizontal[p])
2255
+ for (var y = 0; y < x.length; y++)
2256
+ this.dummyToNodeForVerticalAlignment.has(x[y]) ? this.dummyToNodeForVerticalAlignment.get(x[y]).forEach(function(H) {
2257
+ n.idToNodeMap.get(H).displacementX = 0;
2258
+ }) : this.idToNodeMap.get(x[y]).displacementX = 0;
2259
+ else {
2260
+ for (var k = 0, V = 0, y = 0; y < x.length; y++)
2261
+ if (this.dummyToNodeForVerticalAlignment.has(x[y])) {
2262
+ var Y = this.dummyToNodeForVerticalAlignment.get(x[y]);
2263
+ k += Y.length * this.idToNodeMap.get(Y[0]).displacementX, V += Y.length;
2264
+ } else
2265
+ k += this.idToNodeMap.get(x[y]).displacementX, V++;
2266
+ for (var et = k / V, y = 0; y < x.length; y++)
2267
+ this.dummyToNodeForVerticalAlignment.has(x[y]) ? this.dummyToNodeForVerticalAlignment.get(x[y]).forEach(function(H) {
2268
+ n.idToNodeMap.get(H).displacementX = et;
2269
+ }) : this.idToNodeMap.get(x[y]).displacementX = et;
2270
+ }
2271
+ }
2272
+ for (var p = 0; p < this.componentsOnVertical.length; p++) {
2273
+ var x = this.componentsOnVertical[p];
2274
+ if (this.fixedComponentsOnVertical[p])
2275
+ for (var y = 0; y < x.length; y++)
2276
+ this.dummyToNodeForHorizontalAlignment.has(x[y]) ? this.dummyToNodeForHorizontalAlignment.get(x[y]).forEach(function(B) {
2277
+ n.idToNodeMap.get(B).displacementY = 0;
2278
+ }) : this.idToNodeMap.get(x[y]).displacementY = 0;
2279
+ else {
2280
+ for (var k = 0, V = 0, y = 0; y < x.length; y++)
2281
+ if (this.dummyToNodeForHorizontalAlignment.has(x[y])) {
2282
+ var Y = this.dummyToNodeForHorizontalAlignment.get(x[y]);
2283
+ k += Y.length * this.idToNodeMap.get(Y[0]).displacementY, V += Y.length;
2284
+ } else
2285
+ k += this.idToNodeMap.get(x[y]).displacementY, V++;
2286
+ for (var et = k / V, y = 0; y < x.length; y++)
2287
+ this.dummyToNodeForHorizontalAlignment.has(x[y]) ? this.dummyToNodeForHorizontalAlignment.get(x[y]).forEach(function(q) {
2288
+ n.idToNodeMap.get(q).displacementY = et;
2289
+ }) : this.idToNodeMap.get(x[y]).displacementY = et;
2290
+ }
2291
+ }
2292
+ }
2293
+ }, O.prototype.calculateNodesToApplyGravitationTo = function() {
2294
+ var n = [], m, p = this.graphManager.getGraphs(), E = p.length, y;
2295
+ for (y = 0; y < E; y++)
2296
+ m = p[y], m.updateConnected(), m.isConnected || (n = n.concat(m.getNodes()));
2297
+ return n;
2298
+ }, O.prototype.createBendpoints = function() {
2299
+ var n = [];
2300
+ n = n.concat(this.graphManager.getAllEdges());
2301
+ var m = /* @__PURE__ */ new Set(), p;
2302
+ for (p = 0; p < n.length; p++) {
2303
+ var E = n[p];
2304
+ if (!m.has(E)) {
2305
+ var y = E.getSource(), R = E.getTarget();
2306
+ if (y == R)
2307
+ E.getBendpoints().push(new v()), E.getBendpoints().push(new v()), this.createDummyNodesForBendpoints(E), m.add(E);
2308
+ else {
2309
+ var M = [];
2310
+ if (M = M.concat(y.getEdgeListToNode(R)), M = M.concat(R.getEdgeListToNode(y)), !m.has(M[0])) {
2311
+ if (M.length > 1) {
2312
+ var F;
2313
+ for (F = 0; F < M.length; F++) {
2314
+ var W = M[F];
2315
+ W.getBendpoints().push(new v()), this.createDummyNodesForBendpoints(W);
2316
+ }
2317
+ }
2318
+ M.forEach(function(x) {
2319
+ m.add(x);
2320
+ });
2321
+ }
2322
+ }
2323
+ }
2324
+ if (m.size == n.length)
2325
+ break;
2326
+ }
2327
+ }, O.prototype.positionNodesRadially = function(n) {
2328
+ for (var m = new d(0, 0), p = Math.ceil(Math.sqrt(n.length)), E = 0, y = 0, R = 0, M = new v(0, 0), F = 0; F < n.length; F++) {
2329
+ F % p == 0 && (R = 0, y = E, F != 0 && (y += s.DEFAULT_COMPONENT_SEPERATION), E = 0);
2330
+ var W = n[F], x = S.findCenterOfTree(W);
2331
+ m.x = R, m.y = y, M = O.radialLayout(W, x, m), M.y > E && (E = Math.floor(M.y)), R = Math.floor(M.x + s.DEFAULT_COMPONENT_SEPERATION);
2332
+ }
2333
+ this.transform(new v(T.WORLD_CENTER_X - M.x / 2, T.WORLD_CENTER_Y - M.y / 2));
2334
+ }, O.radialLayout = function(n, m, p) {
2335
+ var E = Math.max(this.maxDiagonalInTree(n), s.DEFAULT_RADIAL_SEPARATION);
2336
+ O.branchRadialLayout(m, null, 0, 359, 0, E);
2337
+ var y = K.calculateBounds(n), R = new X();
2338
+ R.setDeviceOrgX(y.getMinX()), R.setDeviceOrgY(y.getMinY()), R.setWorldOrgX(p.x), R.setWorldOrgY(p.y);
2339
+ for (var M = 0; M < n.length; M++) {
2340
+ var F = n[M];
2341
+ F.transform(R);
2342
+ }
2343
+ var W = new v(y.getMaxX(), y.getMaxY());
2344
+ return R.inverseTransformPoint(W);
2345
+ }, O.branchRadialLayout = function(n, m, p, E, y, R) {
2346
+ var M = (E - p + 1) / 2;
2347
+ M < 0 && (M += 180);
2348
+ var F = (M + p) % 360, W = F * G.TWO_PI / 360, x = y * Math.cos(W), k = y * Math.sin(W);
2349
+ n.setCenter(x, k);
2350
+ var V = [];
2351
+ V = V.concat(n.getEdges());
2352
+ var Y = V.length;
2353
+ m != null && Y--;
2354
+ for (var et = 0, z = V.length, w, H = n.getEdgesBetween(m); H.length > 1; ) {
2355
+ var B = H[0];
2356
+ H.splice(0, 1);
2357
+ var _ = V.indexOf(B);
2358
+ _ >= 0 && V.splice(_, 1), z--, Y--;
2359
+ }
2360
+ m != null ? w = (V.indexOf(H[0]) + 1) % z : w = 0;
2361
+ for (var ht = Math.abs(E - p) / Y, q = w; et != Y; q = ++q % z) {
2362
+ var It = V[q].getOtherEnd(n);
2363
+ if (It != m) {
2364
+ var Nt = (p + et * ht) % 360, vt = (Nt + ht) % 360;
2365
+ O.branchRadialLayout(It, n, Nt, vt, y + R, R), et++;
2366
+ }
2367
+ }
2368
+ }, O.maxDiagonalInTree = function(n) {
2369
+ for (var m = C.MIN_VALUE, p = 0; p < n.length; p++) {
2370
+ var E = n[p], y = E.getDiagonal();
2371
+ y > m && (m = y);
2372
+ }
2373
+ return m;
2374
+ }, O.prototype.calcRepulsionRange = function() {
2375
+ return 2 * (this.level + 1) * this.idealEdgeLength;
2376
+ }, O.prototype.groupZeroDegreeMembers = function() {
2377
+ var n = this, m = {};
2378
+ this.memberGroups = {}, this.idToDummyNode = {};
2379
+ for (var p = [], E = this.graphManager.getAllNodes(), y = 0; y < E.length; y++) {
2380
+ var R = E[y], M = R.getParent();
2381
+ this.getNodeDegreeWithChildren(R) === 0 && (M.id == null || !this.getToBeTiled(M)) && p.push(R);
2382
+ }
2383
+ for (var y = 0; y < p.length; y++) {
2384
+ var R = p[y], F = R.getParent().id;
2385
+ typeof m[F] > "u" && (m[F] = []), m[F] = m[F].concat(R);
2386
+ }
2387
+ Object.keys(m).forEach(function(W) {
2388
+ if (m[W].length > 1) {
2389
+ var x = "DummyCompound_" + W;
2390
+ n.memberGroups[x] = m[W];
2391
+ var k = m[W][0].getParent(), V = new t(n.graphManager);
2392
+ V.id = x, V.paddingLeft = k.paddingLeft || 0, V.paddingRight = k.paddingRight || 0, V.paddingBottom = k.paddingBottom || 0, V.paddingTop = k.paddingTop || 0, n.idToDummyNode[x] = V;
2393
+ var Y = n.getGraphManager().add(n.newGraph(), V), et = k.getChild();
2394
+ et.add(V);
2395
+ for (var z = 0; z < m[W].length; z++) {
2396
+ var w = m[W][z];
2397
+ et.remove(w), Y.add(w);
2398
+ }
2399
+ }
2400
+ });
2401
+ }, O.prototype.clearCompounds = function() {
2402
+ var n = {}, m = {};
2403
+ this.performDFSOnCompounds();
2404
+ for (var p = 0; p < this.compoundOrder.length; p++)
2405
+ m[this.compoundOrder[p].id] = this.compoundOrder[p], n[this.compoundOrder[p].id] = [].concat(this.compoundOrder[p].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[p].getChild()), this.compoundOrder[p].child = null;
2406
+ this.graphManager.resetAllNodes(), this.tileCompoundMembers(n, m);
2407
+ }, O.prototype.clearZeroDegreeMembers = function() {
2408
+ var n = this, m = this.tiledZeroDegreePack = [];
2409
+ Object.keys(this.memberGroups).forEach(function(p) {
2410
+ var E = n.idToDummyNode[p];
2411
+ if (m[p] = n.tileNodes(n.memberGroups[p], E.paddingLeft + E.paddingRight), E.rect.width = m[p].width, E.rect.height = m[p].height, E.setCenter(m[p].centerX, m[p].centerY), E.labelMarginLeft = 0, E.labelMarginTop = 0, s.NODE_DIMENSIONS_INCLUDE_LABELS) {
2412
+ var y = E.rect.width, R = E.rect.height;
2413
+ E.labelWidth && (E.labelPosHorizontal == "left" ? (E.rect.x -= E.labelWidth, E.setWidth(y + E.labelWidth), E.labelMarginLeft = E.labelWidth) : E.labelPosHorizontal == "center" && E.labelWidth > y ? (E.rect.x -= (E.labelWidth - y) / 2, E.setWidth(E.labelWidth), E.labelMarginLeft = (E.labelWidth - y) / 2) : E.labelPosHorizontal == "right" && E.setWidth(y + E.labelWidth)), E.labelHeight && (E.labelPosVertical == "top" ? (E.rect.y -= E.labelHeight, E.setHeight(R + E.labelHeight), E.labelMarginTop = E.labelHeight) : E.labelPosVertical == "center" && E.labelHeight > R ? (E.rect.y -= (E.labelHeight - R) / 2, E.setHeight(E.labelHeight), E.labelMarginTop = (E.labelHeight - R) / 2) : E.labelPosVertical == "bottom" && E.setHeight(R + E.labelHeight));
2414
+ }
2415
+ });
2416
+ }, O.prototype.repopulateCompounds = function() {
2417
+ for (var n = this.compoundOrder.length - 1; n >= 0; n--) {
2418
+ var m = this.compoundOrder[n], p = m.id, E = m.paddingLeft, y = m.paddingTop, R = m.labelMarginLeft, M = m.labelMarginTop;
2419
+ this.adjustLocations(this.tiledMemberPack[p], m.rect.x, m.rect.y, E, y, R, M);
2420
+ }
2421
+ }, O.prototype.repopulateZeroDegreeMembers = function() {
2422
+ var n = this, m = this.tiledZeroDegreePack;
2423
+ Object.keys(m).forEach(function(p) {
2424
+ var E = n.idToDummyNode[p], y = E.paddingLeft, R = E.paddingTop, M = E.labelMarginLeft, F = E.labelMarginTop;
2425
+ n.adjustLocations(m[p], E.rect.x, E.rect.y, y, R, M, F);
2426
+ });
2427
+ }, O.prototype.getToBeTiled = function(n) {
2428
+ var m = n.id;
2429
+ if (this.toBeTiled[m] != null)
2430
+ return this.toBeTiled[m];
2431
+ var p = n.getChild();
2432
+ if (p == null)
2433
+ return this.toBeTiled[m] = !1, !1;
2434
+ for (var E = p.getNodes(), y = 0; y < E.length; y++) {
2435
+ var R = E[y];
2436
+ if (this.getNodeDegree(R) > 0)
2437
+ return this.toBeTiled[m] = !1, !1;
2438
+ if (R.getChild() == null) {
2439
+ this.toBeTiled[R.id] = !1;
2440
+ continue;
2441
+ }
2442
+ if (!this.getToBeTiled(R))
2443
+ return this.toBeTiled[m] = !1, !1;
2444
+ }
2445
+ return this.toBeTiled[m] = !0, !0;
2446
+ }, O.prototype.getNodeDegree = function(n) {
2447
+ n.id;
2448
+ for (var m = n.getEdges(), p = 0, E = 0; E < m.length; E++) {
2449
+ var y = m[E];
2450
+ y.getSource().id !== y.getTarget().id && (p = p + 1);
2451
+ }
2452
+ return p;
2453
+ }, O.prototype.getNodeDegreeWithChildren = function(n) {
2454
+ var m = this.getNodeDegree(n);
2455
+ if (n.getChild() == null)
2456
+ return m;
2457
+ for (var p = n.getChild().getNodes(), E = 0; E < p.length; E++) {
2458
+ var y = p[E];
2459
+ m += this.getNodeDegreeWithChildren(y);
2460
+ }
2461
+ return m;
2462
+ }, O.prototype.performDFSOnCompounds = function() {
2463
+ this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2464
+ }, O.prototype.fillCompexOrderByDFS = function(n) {
2465
+ for (var m = 0; m < n.length; m++) {
2466
+ var p = n[m];
2467
+ p.getChild() != null && this.fillCompexOrderByDFS(p.getChild().getNodes()), this.getToBeTiled(p) && this.compoundOrder.push(p);
2468
+ }
2469
+ }, O.prototype.adjustLocations = function(n, m, p, E, y, R, M) {
2470
+ m += E + R, p += y + M;
2471
+ for (var F = m, W = 0; W < n.rows.length; W++) {
2472
+ var x = n.rows[W];
2473
+ m = F;
2474
+ for (var k = 0, V = 0; V < x.length; V++) {
2475
+ var Y = x[V];
2476
+ Y.rect.x = m, Y.rect.y = p, m += Y.rect.width + n.horizontalPadding, Y.rect.height > k && (k = Y.rect.height);
2477
+ }
2478
+ p += k + n.verticalPadding;
2479
+ }
2480
+ }, O.prototype.tileCompoundMembers = function(n, m) {
2481
+ var p = this;
2482
+ this.tiledMemberPack = [], Object.keys(n).forEach(function(E) {
2483
+ var y = m[E];
2484
+ if (p.tiledMemberPack[E] = p.tileNodes(n[E], y.paddingLeft + y.paddingRight), y.rect.width = p.tiledMemberPack[E].width, y.rect.height = p.tiledMemberPack[E].height, y.setCenter(p.tiledMemberPack[E].centerX, p.tiledMemberPack[E].centerY), y.labelMarginLeft = 0, y.labelMarginTop = 0, s.NODE_DIMENSIONS_INCLUDE_LABELS) {
2485
+ var R = y.rect.width, M = y.rect.height;
2486
+ y.labelWidth && (y.labelPosHorizontal == "left" ? (y.rect.x -= y.labelWidth, y.setWidth(R + y.labelWidth), y.labelMarginLeft = y.labelWidth) : y.labelPosHorizontal == "center" && y.labelWidth > R ? (y.rect.x -= (y.labelWidth - R) / 2, y.setWidth(y.labelWidth), y.labelMarginLeft = (y.labelWidth - R) / 2) : y.labelPosHorizontal == "right" && y.setWidth(R + y.labelWidth)), y.labelHeight && (y.labelPosVertical == "top" ? (y.rect.y -= y.labelHeight, y.setHeight(M + y.labelHeight), y.labelMarginTop = y.labelHeight) : y.labelPosVertical == "center" && y.labelHeight > M ? (y.rect.y -= (y.labelHeight - M) / 2, y.setHeight(y.labelHeight), y.labelMarginTop = (y.labelHeight - M) / 2) : y.labelPosVertical == "bottom" && y.setHeight(M + y.labelHeight));
2487
+ }
2488
+ });
2489
+ }, O.prototype.tileNodes = function(n, m) {
2490
+ var p = this.tileNodesByFavoringDim(n, m, !0), E = this.tileNodesByFavoringDim(n, m, !1), y = this.getOrgRatio(p), R = this.getOrgRatio(E), M;
2491
+ return R < y ? M = E : M = p, M;
2492
+ }, O.prototype.getOrgRatio = function(n) {
2493
+ var m = n.width, p = n.height, E = m / p;
2494
+ return E < 1 && (E = 1 / E), E;
2495
+ }, O.prototype.calcIdealRowWidth = function(n, m) {
2496
+ var p = s.TILING_PADDING_VERTICAL, E = s.TILING_PADDING_HORIZONTAL, y = n.length, R = 0, M = 0, F = 0;
2497
+ n.forEach(function(z) {
2498
+ R += z.getWidth(), M += z.getHeight(), z.getWidth() > F && (F = z.getWidth());
2499
+ });
2500
+ var W = R / y, x = M / y, k = Math.pow(p - E, 2) + 4 * (W + E) * (x + p) * y, V = (E - p + Math.sqrt(k)) / (2 * (W + E)), Y;
2501
+ m ? (Y = Math.ceil(V), Y == V && Y++) : Y = Math.floor(V);
2502
+ var et = Y * (W + E) - E;
2503
+ return F > et && (et = F), et += E * 2, et;
2504
+ }, O.prototype.tileNodesByFavoringDim = function(n, m, p) {
2505
+ var E = s.TILING_PADDING_VERTICAL, y = s.TILING_PADDING_HORIZONTAL, R = s.TILING_COMPARE_BY, M = {
2506
+ rows: [],
2507
+ rowWidth: [],
2508
+ rowHeight: [],
2509
+ width: 0,
2510
+ height: m,
2511
+ // assume minHeight equals to minWidth
2512
+ verticalPadding: E,
2513
+ horizontalPadding: y,
2514
+ centerX: 0,
2515
+ centerY: 0
2516
+ };
2517
+ R && (M.idealRowWidth = this.calcIdealRowWidth(n, p));
2518
+ var F = function(w) {
2519
+ return w.rect.width * w.rect.height;
2520
+ }, W = function(w, H) {
2521
+ return F(H) - F(w);
2522
+ };
2523
+ n.sort(function(z, w) {
2524
+ var H = W;
2525
+ return M.idealRowWidth ? (H = R, H(z.id, w.id)) : H(z, w);
2526
+ });
2527
+ for (var x = 0, k = 0, V = 0; V < n.length; V++) {
2528
+ var Y = n[V];
2529
+ x += Y.getCenterX(), k += Y.getCenterY();
2530
+ }
2531
+ M.centerX = x / n.length, M.centerY = k / n.length;
2532
+ for (var V = 0; V < n.length; V++) {
2533
+ var Y = n[V];
2534
+ if (M.rows.length == 0)
2535
+ this.insertNodeToRow(M, Y, 0, m);
2536
+ else if (this.canAddHorizontal(M, Y.rect.width, Y.rect.height)) {
2537
+ var et = M.rows.length - 1;
2538
+ M.idealRowWidth || (et = this.getShortestRowIndex(M)), this.insertNodeToRow(M, Y, et, m);
2539
+ } else
2540
+ this.insertNodeToRow(M, Y, M.rows.length, m);
2541
+ this.shiftToLastRow(M);
2542
+ }
2543
+ return M;
2544
+ }, O.prototype.insertNodeToRow = function(n, m, p, E) {
2545
+ var y = E;
2546
+ if (p == n.rows.length) {
2547
+ var R = [];
2548
+ n.rows.push(R), n.rowWidth.push(y), n.rowHeight.push(0);
2549
+ }
2550
+ var M = n.rowWidth[p] + m.rect.width;
2551
+ n.rows[p].length > 0 && (M += n.horizontalPadding), n.rowWidth[p] = M, n.width < M && (n.width = M);
2552
+ var F = m.rect.height;
2553
+ p > 0 && (F += n.verticalPadding);
2554
+ var W = 0;
2555
+ F > n.rowHeight[p] && (W = n.rowHeight[p], n.rowHeight[p] = F, W = n.rowHeight[p] - W), n.height += W, n.rows[p].push(m);
2556
+ }, O.prototype.getShortestRowIndex = function(n) {
2557
+ for (var m = -1, p = Number.MAX_VALUE, E = 0; E < n.rows.length; E++)
2558
+ n.rowWidth[E] < p && (m = E, p = n.rowWidth[E]);
2559
+ return m;
2560
+ }, O.prototype.getLongestRowIndex = function(n) {
2561
+ for (var m = -1, p = Number.MIN_VALUE, E = 0; E < n.rows.length; E++)
2562
+ n.rowWidth[E] > p && (m = E, p = n.rowWidth[E]);
2563
+ return m;
2564
+ }, O.prototype.canAddHorizontal = function(n, m, p) {
2565
+ if (n.idealRowWidth) {
2566
+ var E = n.rows.length - 1, y = n.rowWidth[E];
2567
+ return y + m + n.horizontalPadding <= n.idealRowWidth;
2568
+ }
2569
+ var R = this.getShortestRowIndex(n);
2570
+ if (R < 0)
2571
+ return !0;
2572
+ var M = n.rowWidth[R];
2573
+ if (M + n.horizontalPadding + m <= n.width)
2574
+ return !0;
2575
+ var F = 0;
2576
+ n.rowHeight[R] < p && R > 0 && (F = p + n.verticalPadding - n.rowHeight[R]);
2577
+ var W;
2578
+ n.width - M >= m + n.horizontalPadding ? W = (n.height + F) / (M + m + n.horizontalPadding) : W = (n.height + F) / n.width, F = p + n.verticalPadding;
2579
+ var x;
2580
+ return n.width < m ? x = (n.height + F) / m : x = (n.height + F) / n.width, x < 1 && (x = 1 / x), W < 1 && (W = 1 / W), W < x;
2581
+ }, O.prototype.shiftToLastRow = function(n) {
2582
+ var m = this.getLongestRowIndex(n), p = n.rowWidth.length - 1, E = n.rows[m], y = E[E.length - 1], R = y.width + n.horizontalPadding;
2583
+ if (n.width - n.rowWidth[p] > R && m != p) {
2584
+ E.splice(-1, 1), n.rows[p].push(y), n.rowWidth[m] = n.rowWidth[m] - R, n.rowWidth[p] = n.rowWidth[p] + R, n.width = n.rowWidth[instance.getLongestRowIndex(n)];
2585
+ for (var M = Number.MIN_VALUE, F = 0; F < E.length; F++)
2586
+ E[F].height > M && (M = E[F].height);
2587
+ m > 0 && (M += n.verticalPadding);
2588
+ var W = n.rowHeight[m] + n.rowHeight[p];
2589
+ n.rowHeight[m] = M, n.rowHeight[p] < y.height + n.verticalPadding && (n.rowHeight[p] = y.height + n.verticalPadding);
2590
+ var x = n.rowHeight[m] + n.rowHeight[p];
2591
+ n.height += x - W, this.shiftToLastRow(n);
2592
+ }
2593
+ }, O.prototype.tilingPreLayout = function() {
2594
+ s.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2595
+ }, O.prototype.tilingPostLayout = function() {
2596
+ s.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2597
+ }, O.prototype.reduceTrees = function() {
2598
+ for (var n = [], m = !0, p; m; ) {
2599
+ var E = this.graphManager.getAllNodes(), y = [];
2600
+ m = !1;
2601
+ for (var R = 0; R < E.length; R++)
2602
+ if (p = E[R], p.getEdges().length == 1 && !p.getEdges()[0].isInterGraph && p.getChild() == null) {
2603
+ if (s.PURE_INCREMENTAL) {
2604
+ var M = p.getEdges()[0].getOtherEnd(p), F = new L(p.getCenterX() - M.getCenterX(), p.getCenterY() - M.getCenterY());
2605
+ y.push([p, p.getEdges()[0], p.getOwner(), F]);
2606
+ } else
2607
+ y.push([p, p.getEdges()[0], p.getOwner()]);
2608
+ m = !0;
2609
+ }
2610
+ if (m == !0) {
2611
+ for (var W = [], x = 0; x < y.length; x++)
2612
+ y[x][0].getEdges().length == 1 && (W.push(y[x]), y[x][0].getOwner().remove(y[x][0]));
2613
+ n.push(W), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2614
+ }
2615
+ }
2616
+ this.prunedNodesAll = n;
2617
+ }, O.prototype.growTree = function(n) {
2618
+ for (var m = n.length, p = n[m - 1], E, y = 0; y < p.length; y++)
2619
+ E = p[y], this.findPlaceforPrunedNode(E), E[2].add(E[0]), E[2].add(E[1], E[1].source, E[1].target);
2620
+ n.splice(n.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2621
+ }, O.prototype.findPlaceforPrunedNode = function(n) {
2622
+ var m, p, E = n[0];
2623
+ if (E == n[1].source ? p = n[1].target : p = n[1].source, s.PURE_INCREMENTAL)
2624
+ E.setCenter(p.getCenterX() + n[3].getWidth(), p.getCenterY() + n[3].getHeight());
2625
+ else {
2626
+ var y = p.startX, R = p.finishX, M = p.startY, F = p.finishY, W = 0, x = 0, k = 0, V = 0, Y = [W, k, x, V];
2627
+ if (M > 0)
2628
+ for (var et = y; et <= R; et++)
2629
+ Y[0] += this.grid[et][M - 1].length + this.grid[et][M].length - 1;
2630
+ if (R < this.grid.length - 1)
2631
+ for (var et = M; et <= F; et++)
2632
+ Y[1] += this.grid[R + 1][et].length + this.grid[R][et].length - 1;
2633
+ if (F < this.grid[0].length - 1)
2634
+ for (var et = y; et <= R; et++)
2635
+ Y[2] += this.grid[et][F + 1].length + this.grid[et][F].length - 1;
2636
+ if (y > 0)
2637
+ for (var et = M; et <= F; et++)
2638
+ Y[3] += this.grid[y - 1][et].length + this.grid[y][et].length - 1;
2639
+ for (var z = C.MAX_VALUE, w, H, B = 0; B < Y.length; B++)
2640
+ Y[B] < z ? (z = Y[B], w = 1, H = B) : Y[B] == z && w++;
2641
+ if (w == 3 && z == 0)
2642
+ Y[0] == 0 && Y[1] == 0 && Y[2] == 0 ? m = 1 : Y[0] == 0 && Y[1] == 0 && Y[3] == 0 ? m = 0 : Y[0] == 0 && Y[2] == 0 && Y[3] == 0 ? m = 3 : Y[1] == 0 && Y[2] == 0 && Y[3] == 0 && (m = 2);
2643
+ else if (w == 2 && z == 0) {
2644
+ var _ = Math.floor(Math.random() * 2);
2645
+ Y[0] == 0 && Y[1] == 0 ? _ == 0 ? m = 0 : m = 1 : Y[0] == 0 && Y[2] == 0 ? _ == 0 ? m = 0 : m = 2 : Y[0] == 0 && Y[3] == 0 ? _ == 0 ? m = 0 : m = 3 : Y[1] == 0 && Y[2] == 0 ? _ == 0 ? m = 1 : m = 2 : Y[1] == 0 && Y[3] == 0 ? _ == 0 ? m = 1 : m = 3 : _ == 0 ? m = 2 : m = 3;
2646
+ } else if (w == 4 && z == 0) {
2647
+ var _ = Math.floor(Math.random() * 4);
2648
+ m = _;
2649
+ } else
2650
+ m = H;
2651
+ m == 0 ? E.setCenter(p.getCenterX(), p.getCenterY() - p.getHeight() / 2 - l.DEFAULT_EDGE_LENGTH - E.getHeight() / 2) : m == 1 ? E.setCenter(p.getCenterX() + p.getWidth() / 2 + l.DEFAULT_EDGE_LENGTH + E.getWidth() / 2, p.getCenterY()) : m == 2 ? E.setCenter(p.getCenterX(), p.getCenterY() + p.getHeight() / 2 + l.DEFAULT_EDGE_LENGTH + E.getHeight() / 2) : E.setCenter(p.getCenterX() - p.getWidth() / 2 - l.DEFAULT_EDGE_LENGTH - E.getWidth() / 2, p.getCenterY());
2652
+ }
2653
+ }, a.exports = O;
2654
+ }
2655
+ ),
2656
+ /***/
2657
+ 991: (
2658
+ /***/
2659
+ (a, r, e) => {
2660
+ var f = e(551).FDLayoutNode, i = e(551).IMath;
2661
+ function g(o, s, c, l) {
2662
+ f.call(this, o, s, c, l);
2663
+ }
2664
+ g.prototype = Object.create(f.prototype);
2665
+ for (var t in f)
2666
+ g[t] = f[t];
2667
+ g.prototype.calculateDisplacement = function() {
2668
+ var o = this.graphManager.getLayout();
2669
+ this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += o.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += o.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += o.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += o.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > o.coolingFactor * o.maxNodeDisplacement && (this.displacementX = o.coolingFactor * o.maxNodeDisplacement * i.sign(this.displacementX)), Math.abs(this.displacementY) > o.coolingFactor * o.maxNodeDisplacement && (this.displacementY = o.coolingFactor * o.maxNodeDisplacement * i.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
2670
+ }, g.prototype.propogateDisplacementToChildren = function(o, s) {
2671
+ for (var c = this.getChild().getNodes(), l, T = 0; T < c.length; T++)
2672
+ l = c[T], l.getChild() == null ? (l.displacementX += o, l.displacementY += s) : l.propogateDisplacementToChildren(o, s);
2673
+ }, g.prototype.move = function() {
2674
+ var o = this.graphManager.getLayout();
2675
+ (this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), o.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY)), this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0;
2676
+ }, g.prototype.setPred1 = function(o) {
2677
+ this.pred1 = o;
2678
+ }, g.prototype.getPred1 = function() {
2679
+ return pred1;
2680
+ }, g.prototype.getPred2 = function() {
2681
+ return pred2;
2682
+ }, g.prototype.setNext = function(o) {
2683
+ this.next = o;
2684
+ }, g.prototype.getNext = function() {
2685
+ return next;
2686
+ }, g.prototype.setProcessed = function(o) {
2687
+ this.processed = o;
2688
+ }, g.prototype.isProcessed = function() {
2689
+ return processed;
2690
+ }, a.exports = g;
2691
+ }
2692
+ ),
2693
+ /***/
2694
+ 902: (
2695
+ /***/
2696
+ (a, r, e) => {
2697
+ function f(c) {
2698
+ if (Array.isArray(c)) {
2699
+ for (var l = 0, T = Array(c.length); l < c.length; l++)
2700
+ T[l] = c[l];
2701
+ return T;
2702
+ } else
2703
+ return Array.from(c);
2704
+ }
2705
+ var i = e(806), g = e(551).LinkedList, t = e(551).Matrix, o = e(551).SVD;
2706
+ function s() {
2707
+ }
2708
+ s.handleConstraints = function(c) {
2709
+ var l = {};
2710
+ l.fixedNodeConstraint = c.constraints.fixedNodeConstraint, l.alignmentConstraint = c.constraints.alignmentConstraint, l.relativePlacementConstraint = c.constraints.relativePlacementConstraint;
2711
+ for (var T = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), v = [], L = [], S = c.getAllNodes(), C = 0, G = 0; G < S.length; G++) {
2712
+ var K = S[G];
2713
+ K.getChild() == null && (d.set(K.id, C++), v.push(K.getCenterX()), L.push(K.getCenterY()), T.set(K.id, K));
2714
+ }
2715
+ l.relativePlacementConstraint && l.relativePlacementConstraint.forEach(function(b) {
2716
+ !b.gap && b.gap != 0 && (b.left ? b.gap = i.DEFAULT_EDGE_LENGTH + T.get(b.left).getWidth() / 2 + T.get(b.right).getWidth() / 2 : b.gap = i.DEFAULT_EDGE_LENGTH + T.get(b.top).getHeight() / 2 + T.get(b.bottom).getHeight() / 2);
2717
+ });
2718
+ var X = function(U, $) {
2719
+ return { x: U.x - $.x, y: U.y - $.y };
2720
+ }, Q = function(U) {
2721
+ var $ = 0, J = 0;
2722
+ return U.forEach(function(Z) {
2723
+ $ += v[d.get(Z)], J += L[d.get(Z)];
2724
+ }), { x: $ / U.size, y: J / U.size };
2725
+ }, O = function(U, $, J, Z, at) {
2726
+ function ct(lt, ot) {
2727
+ var Lt = new Set(lt), ft = !0, st = !1, Xt = void 0;
2728
+ try {
2729
+ for (var Tt = ot[Symbol.iterator](), Ct; !(ft = (Ct = Tt.next()).done); ft = !0) {
2730
+ var Bt = Ct.value;
2731
+ Lt.add(Bt);
2732
+ }
2733
+ } catch (bt) {
2734
+ st = !0, Xt = bt;
2735
+ } finally {
2736
+ try {
2737
+ !ft && Tt.return && Tt.return();
2738
+ } finally {
2739
+ if (st)
2740
+ throw Xt;
2741
+ }
2742
+ }
2743
+ return Lt;
2744
+ }
2745
+ var nt = /* @__PURE__ */ new Map();
2746
+ U.forEach(function(lt, ot) {
2747
+ nt.set(ot, 0);
2748
+ }), U.forEach(function(lt, ot) {
2749
+ lt.forEach(function(Lt) {
2750
+ nt.set(Lt.id, nt.get(Lt.id) + 1);
2751
+ });
2752
+ });
2753
+ var tt = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), ut = new g();
2754
+ nt.forEach(function(lt, ot) {
2755
+ lt == 0 ? (ut.push(ot), J || ($ == "horizontal" ? tt.set(ot, d.has(ot) ? v[d.get(ot)] : Z.get(ot)) : tt.set(ot, d.has(ot) ? L[d.get(ot)] : Z.get(ot)))) : tt.set(ot, Number.NEGATIVE_INFINITY), J && j.set(ot, /* @__PURE__ */ new Set([ot]));
2756
+ }), J && at.forEach(function(lt) {
2757
+ var ot = [];
2758
+ if (lt.forEach(function(st) {
2759
+ J.has(st) && ot.push(st);
2760
+ }), ot.length > 0) {
2761
+ var Lt = 0;
2762
+ ot.forEach(function(st) {
2763
+ $ == "horizontal" ? (tt.set(st, d.has(st) ? v[d.get(st)] : Z.get(st)), Lt += tt.get(st)) : (tt.set(st, d.has(st) ? L[d.get(st)] : Z.get(st)), Lt += tt.get(st));
2764
+ }), Lt = Lt / ot.length, lt.forEach(function(st) {
2765
+ J.has(st) || tt.set(st, Lt);
2766
+ });
2767
+ } else {
2768
+ var ft = 0;
2769
+ lt.forEach(function(st) {
2770
+ $ == "horizontal" ? ft += d.has(st) ? v[d.get(st)] : Z.get(st) : ft += d.has(st) ? L[d.get(st)] : Z.get(st);
2771
+ }), ft = ft / lt.length, lt.forEach(function(st) {
2772
+ tt.set(st, ft);
2773
+ });
2774
+ }
2775
+ });
2776
+ for (var Mt = function() {
2777
+ var ot = ut.shift(), Lt = U.get(ot);
2778
+ Lt.forEach(function(ft) {
2779
+ if (tt.get(ft.id) < tt.get(ot) + ft.gap)
2780
+ if (J && J.has(ft.id)) {
2781
+ var st = void 0;
2782
+ if ($ == "horizontal" ? st = d.has(ft.id) ? v[d.get(ft.id)] : Z.get(ft.id) : st = d.has(ft.id) ? L[d.get(ft.id)] : Z.get(ft.id), tt.set(ft.id, st), st < tt.get(ot) + ft.gap) {
2783
+ var Xt = tt.get(ot) + ft.gap - st;
2784
+ j.get(ot).forEach(function(Tt) {
2785
+ tt.set(Tt, tt.get(Tt) - Xt);
2786
+ });
2787
+ }
2788
+ } else
2789
+ tt.set(ft.id, tt.get(ot) + ft.gap);
2790
+ nt.set(ft.id, nt.get(ft.id) - 1), nt.get(ft.id) == 0 && ut.push(ft.id), J && j.set(ft.id, ct(j.get(ot), j.get(ft.id)));
2791
+ });
2792
+ }; ut.length != 0; )
2793
+ Mt();
2794
+ if (J) {
2795
+ var pt = /* @__PURE__ */ new Set();
2796
+ U.forEach(function(lt, ot) {
2797
+ lt.length == 0 && pt.add(ot);
2798
+ });
2799
+ var xt = [];
2800
+ j.forEach(function(lt, ot) {
2801
+ if (pt.has(ot)) {
2802
+ var Lt = !1, ft = !0, st = !1, Xt = void 0;
2803
+ try {
2804
+ for (var Tt = lt[Symbol.iterator](), Ct; !(ft = (Ct = Tt.next()).done); ft = !0) {
2805
+ var Bt = Ct.value;
2806
+ J.has(Bt) && (Lt = !0);
2807
+ }
2808
+ } catch (St) {
2809
+ st = !0, Xt = St;
2810
+ } finally {
2811
+ try {
2812
+ !ft && Tt.return && Tt.return();
2813
+ } finally {
2814
+ if (st)
2815
+ throw Xt;
2816
+ }
2817
+ }
2818
+ if (!Lt) {
2819
+ var bt = !1, zt = void 0;
2820
+ xt.forEach(function(St, Zt) {
2821
+ St.has([].concat(f(lt))[0]) && (bt = !0, zt = Zt);
2822
+ }), bt ? lt.forEach(function(St) {
2823
+ xt[zt].add(St);
2824
+ }) : xt.push(new Set(lt));
2825
+ }
2826
+ }
2827
+ }), xt.forEach(function(lt, ot) {
2828
+ var Lt = Number.POSITIVE_INFINITY, ft = Number.POSITIVE_INFINITY, st = Number.NEGATIVE_INFINITY, Xt = Number.NEGATIVE_INFINITY, Tt = !0, Ct = !1, Bt = void 0;
2829
+ try {
2830
+ for (var bt = lt[Symbol.iterator](), zt; !(Tt = (zt = bt.next()).done); Tt = !0) {
2831
+ var St = zt.value, Zt = void 0;
2832
+ $ == "horizontal" ? Zt = d.has(St) ? v[d.get(St)] : Z.get(St) : Zt = d.has(St) ? L[d.get(St)] : Z.get(St);
2833
+ var Kt = tt.get(St);
2834
+ Zt < Lt && (Lt = Zt), Zt > st && (st = Zt), Kt < ft && (ft = Kt), Kt > Xt && (Xt = Kt);
2835
+ }
2836
+ } catch (ee) {
2837
+ Ct = !0, Bt = ee;
2838
+ } finally {
2839
+ try {
2840
+ !Tt && bt.return && bt.return();
2841
+ } finally {
2842
+ if (Ct)
2843
+ throw Bt;
2844
+ }
2845
+ }
2846
+ var he = (Lt + st) / 2 - (ft + Xt) / 2, Qt = !0, jt = !1, _t = void 0;
2847
+ try {
2848
+ for (var Jt = lt[Symbol.iterator](), oe; !(Qt = (oe = Jt.next()).done); Qt = !0) {
2849
+ var te = oe.value;
2850
+ tt.set(te, tt.get(te) + he);
2851
+ }
2852
+ } catch (ee) {
2853
+ jt = !0, _t = ee;
2854
+ } finally {
2855
+ try {
2856
+ !Qt && Jt.return && Jt.return();
2857
+ } finally {
2858
+ if (jt)
2859
+ throw _t;
2860
+ }
2861
+ }
2862
+ });
2863
+ }
2864
+ return tt;
2865
+ }, rt = function(U) {
2866
+ var $ = 0, J = 0, Z = 0, at = 0;
2867
+ if (U.forEach(function(j) {
2868
+ j.left ? v[d.get(j.left)] - v[d.get(j.right)] >= 0 ? $++ : J++ : L[d.get(j.top)] - L[d.get(j.bottom)] >= 0 ? Z++ : at++;
2869
+ }), $ > J && Z > at)
2870
+ for (var ct = 0; ct < d.size; ct++)
2871
+ v[ct] = -1 * v[ct], L[ct] = -1 * L[ct];
2872
+ else if ($ > J)
2873
+ for (var nt = 0; nt < d.size; nt++)
2874
+ v[nt] = -1 * v[nt];
2875
+ else if (Z > at)
2876
+ for (var tt = 0; tt < d.size; tt++)
2877
+ L[tt] = -1 * L[tt];
2878
+ }, n = function(U) {
2879
+ var $ = [], J = new g(), Z = /* @__PURE__ */ new Set(), at = 0;
2880
+ return U.forEach(function(ct, nt) {
2881
+ if (!Z.has(nt)) {
2882
+ $[at] = [];
2883
+ var tt = nt;
2884
+ for (J.push(tt), Z.add(tt), $[at].push(tt); J.length != 0; ) {
2885
+ tt = J.shift();
2886
+ var j = U.get(tt);
2887
+ j.forEach(function(ut) {
2888
+ Z.has(ut.id) || (J.push(ut.id), Z.add(ut.id), $[at].push(ut.id));
2889
+ });
2890
+ }
2891
+ at++;
2892
+ }
2893
+ }), $;
2894
+ }, m = function(U) {
2895
+ var $ = /* @__PURE__ */ new Map();
2896
+ return U.forEach(function(J, Z) {
2897
+ $.set(Z, []);
2898
+ }), U.forEach(function(J, Z) {
2899
+ J.forEach(function(at) {
2900
+ $.get(Z).push(at), $.get(at.id).push({ id: Z, gap: at.gap, direction: at.direction });
2901
+ });
2902
+ }), $;
2903
+ }, p = function(U) {
2904
+ var $ = /* @__PURE__ */ new Map();
2905
+ return U.forEach(function(J, Z) {
2906
+ $.set(Z, []);
2907
+ }), U.forEach(function(J, Z) {
2908
+ J.forEach(function(at) {
2909
+ $.get(at.id).push({ id: Z, gap: at.gap, direction: at.direction });
2910
+ });
2911
+ }), $;
2912
+ }, E = [], y = [], R = !1, M = !1, F = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), k = [];
2913
+ if (l.fixedNodeConstraint && l.fixedNodeConstraint.forEach(function(b) {
2914
+ F.add(b.nodeId);
2915
+ }), l.relativePlacementConstraint && (l.relativePlacementConstraint.forEach(function(b) {
2916
+ b.left ? (W.has(b.left) ? W.get(b.left).push({ id: b.right, gap: b.gap, direction: "horizontal" }) : W.set(b.left, [{ id: b.right, gap: b.gap, direction: "horizontal" }]), W.has(b.right) || W.set(b.right, [])) : (W.has(b.top) ? W.get(b.top).push({ id: b.bottom, gap: b.gap, direction: "vertical" }) : W.set(b.top, [{ id: b.bottom, gap: b.gap, direction: "vertical" }]), W.has(b.bottom) || W.set(b.bottom, []));
2917
+ }), x = m(W), k = n(x)), i.TRANSFORM_ON_CONSTRAINT_HANDLING) {
2918
+ if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 1)
2919
+ l.fixedNodeConstraint.forEach(function(b, U) {
2920
+ E[U] = [b.position.x, b.position.y], y[U] = [v[d.get(b.nodeId)], L[d.get(b.nodeId)]];
2921
+ }), R = !0;
2922
+ else if (l.alignmentConstraint)
2923
+ (function() {
2924
+ var b = 0;
2925
+ if (l.alignmentConstraint.vertical) {
2926
+ for (var U = l.alignmentConstraint.vertical, $ = function(tt) {
2927
+ var j = /* @__PURE__ */ new Set();
2928
+ U[tt].forEach(function(pt) {
2929
+ j.add(pt);
2930
+ });
2931
+ var ut = new Set([].concat(f(j)).filter(function(pt) {
2932
+ return F.has(pt);
2933
+ })), Mt = void 0;
2934
+ ut.size > 0 ? Mt = v[d.get(ut.values().next().value)] : Mt = Q(j).x, U[tt].forEach(function(pt) {
2935
+ E[b] = [Mt, L[d.get(pt)]], y[b] = [v[d.get(pt)], L[d.get(pt)]], b++;
2936
+ });
2937
+ }, J = 0; J < U.length; J++)
2938
+ $(J);
2939
+ R = !0;
2940
+ }
2941
+ if (l.alignmentConstraint.horizontal) {
2942
+ for (var Z = l.alignmentConstraint.horizontal, at = function(tt) {
2943
+ var j = /* @__PURE__ */ new Set();
2944
+ Z[tt].forEach(function(pt) {
2945
+ j.add(pt);
2946
+ });
2947
+ var ut = new Set([].concat(f(j)).filter(function(pt) {
2948
+ return F.has(pt);
2949
+ })), Mt = void 0;
2950
+ ut.size > 0 ? Mt = v[d.get(ut.values().next().value)] : Mt = Q(j).y, Z[tt].forEach(function(pt) {
2951
+ E[b] = [v[d.get(pt)], Mt], y[b] = [v[d.get(pt)], L[d.get(pt)]], b++;
2952
+ });
2953
+ }, ct = 0; ct < Z.length; ct++)
2954
+ at(ct);
2955
+ R = !0;
2956
+ }
2957
+ l.relativePlacementConstraint && (M = !0);
2958
+ })();
2959
+ else if (l.relativePlacementConstraint) {
2960
+ for (var V = 0, Y = 0, et = 0; et < k.length; et++)
2961
+ k[et].length > V && (V = k[et].length, Y = et);
2962
+ if (V < x.size / 2)
2963
+ rt(l.relativePlacementConstraint), R = !1, M = !1;
2964
+ else {
2965
+ var z = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), H = [];
2966
+ k[Y].forEach(function(b) {
2967
+ W.get(b).forEach(function(U) {
2968
+ U.direction == "horizontal" ? (z.has(b) ? z.get(b).push(U) : z.set(b, [U]), z.has(U.id) || z.set(U.id, []), H.push({ left: b, right: U.id })) : (w.has(b) ? w.get(b).push(U) : w.set(b, [U]), w.has(U.id) || w.set(U.id, []), H.push({ top: b, bottom: U.id }));
2969
+ });
2970
+ }), rt(H), M = !1;
2971
+ var B = O(z, "horizontal"), _ = O(w, "vertical");
2972
+ k[Y].forEach(function(b, U) {
2973
+ y[U] = [v[d.get(b)], L[d.get(b)]], E[U] = [], B.has(b) ? E[U][0] = B.get(b) : E[U][0] = v[d.get(b)], _.has(b) ? E[U][1] = _.get(b) : E[U][1] = L[d.get(b)];
2974
+ }), R = !0;
2975
+ }
2976
+ }
2977
+ if (R) {
2978
+ for (var ht = void 0, q = t.transpose(E), It = t.transpose(y), Nt = 0; Nt < q.length; Nt++)
2979
+ q[Nt] = t.multGamma(q[Nt]), It[Nt] = t.multGamma(It[Nt]);
2980
+ var vt = t.multMat(q, t.transpose(It)), it = o.svd(vt);
2981
+ ht = t.multMat(it.V, t.transpose(it.U));
2982
+ for (var gt = 0; gt < d.size; gt++) {
2983
+ var mt = [v[gt], L[gt]], At = [ht[0][0], ht[1][0]], Ot = [ht[0][1], ht[1][1]];
2984
+ v[gt] = t.dotProduct(mt, At), L[gt] = t.dotProduct(mt, Ot);
2985
+ }
2986
+ M && rt(l.relativePlacementConstraint);
2987
+ }
2988
+ }
2989
+ if (i.ENFORCE_CONSTRAINTS) {
2990
+ if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 0) {
2991
+ var Et = { x: 0, y: 0 };
2992
+ l.fixedNodeConstraint.forEach(function(b, U) {
2993
+ var $ = { x: v[d.get(b.nodeId)], y: L[d.get(b.nodeId)] }, J = b.position, Z = X(J, $);
2994
+ Et.x += Z.x, Et.y += Z.y;
2995
+ }), Et.x /= l.fixedNodeConstraint.length, Et.y /= l.fixedNodeConstraint.length, v.forEach(function(b, U) {
2996
+ v[U] += Et.x;
2997
+ }), L.forEach(function(b, U) {
2998
+ L[U] += Et.y;
2999
+ }), l.fixedNodeConstraint.forEach(function(b) {
3000
+ v[d.get(b.nodeId)] = b.position.x, L[d.get(b.nodeId)] = b.position.y;
3001
+ });
3002
+ }
3003
+ if (l.alignmentConstraint) {
3004
+ if (l.alignmentConstraint.vertical)
3005
+ for (var Dt = l.alignmentConstraint.vertical, Rt = function(U) {
3006
+ var $ = /* @__PURE__ */ new Set();
3007
+ Dt[U].forEach(function(at) {
3008
+ $.add(at);
3009
+ });
3010
+ var J = new Set([].concat(f($)).filter(function(at) {
3011
+ return F.has(at);
3012
+ })), Z = void 0;
3013
+ J.size > 0 ? Z = v[d.get(J.values().next().value)] : Z = Q($).x, $.forEach(function(at) {
3014
+ F.has(at) || (v[d.get(at)] = Z);
3015
+ });
3016
+ }, Ht = 0; Ht < Dt.length; Ht++)
3017
+ Rt(Ht);
3018
+ if (l.alignmentConstraint.horizontal)
3019
+ for (var Ut = l.alignmentConstraint.horizontal, Pt = function(U) {
3020
+ var $ = /* @__PURE__ */ new Set();
3021
+ Ut[U].forEach(function(at) {
3022
+ $.add(at);
3023
+ });
3024
+ var J = new Set([].concat(f($)).filter(function(at) {
3025
+ return F.has(at);
3026
+ })), Z = void 0;
3027
+ J.size > 0 ? Z = L[d.get(J.values().next().value)] : Z = Q($).y, $.forEach(function(at) {
3028
+ F.has(at) || (L[d.get(at)] = Z);
3029
+ });
3030
+ }, Ft = 0; Ft < Ut.length; Ft++)
3031
+ Pt(Ft);
3032
+ }
3033
+ l.relativePlacementConstraint && function() {
3034
+ var b = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map(), ct = /* @__PURE__ */ new Set(), nt = /* @__PURE__ */ new Set();
3035
+ if (F.forEach(function(Gt) {
3036
+ ct.add(Gt), nt.add(Gt);
3037
+ }), l.alignmentConstraint) {
3038
+ if (l.alignmentConstraint.vertical)
3039
+ for (var tt = l.alignmentConstraint.vertical, j = function(yt) {
3040
+ $.set("dummy" + yt, []), tt[yt].forEach(function(wt) {
3041
+ b.set(wt, "dummy" + yt), $.get("dummy" + yt).push(wt), F.has(wt) && ct.add("dummy" + yt);
3042
+ }), Z.set("dummy" + yt, v[d.get(tt[yt][0])]);
3043
+ }, ut = 0; ut < tt.length; ut++)
3044
+ j(ut);
3045
+ if (l.alignmentConstraint.horizontal)
3046
+ for (var Mt = l.alignmentConstraint.horizontal, pt = function(yt) {
3047
+ J.set("dummy" + yt, []), Mt[yt].forEach(function(wt) {
3048
+ U.set(wt, "dummy" + yt), J.get("dummy" + yt).push(wt), F.has(wt) && nt.add("dummy" + yt);
3049
+ }), at.set("dummy" + yt, L[d.get(Mt[yt][0])]);
3050
+ }, xt = 0; xt < Mt.length; xt++)
3051
+ pt(xt);
3052
+ }
3053
+ var lt = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map(), Lt = function(yt) {
3054
+ W.get(yt).forEach(function(wt) {
3055
+ var kt = void 0, $t = void 0;
3056
+ wt.direction == "horizontal" ? (kt = b.get(yt) ? b.get(yt) : yt, b.get(wt.id) ? $t = { id: b.get(wt.id), gap: wt.gap, direction: wt.direction } : $t = wt, lt.has(kt) ? lt.get(kt).push($t) : lt.set(kt, [$t]), lt.has($t.id) || lt.set($t.id, [])) : (kt = U.get(yt) ? U.get(yt) : yt, U.get(wt.id) ? $t = { id: U.get(wt.id), gap: wt.gap, direction: wt.direction } : $t = wt, ot.has(kt) ? ot.get(kt).push($t) : ot.set(kt, [$t]), ot.has($t.id) || ot.set($t.id, []));
3057
+ });
3058
+ }, ft = !0, st = !1, Xt = void 0;
3059
+ try {
3060
+ for (var Tt = W.keys()[Symbol.iterator](), Ct; !(ft = (Ct = Tt.next()).done); ft = !0) {
3061
+ var Bt = Ct.value;
3062
+ Lt(Bt);
3063
+ }
3064
+ } catch (Gt) {
3065
+ st = !0, Xt = Gt;
3066
+ } finally {
3067
+ try {
3068
+ !ft && Tt.return && Tt.return();
3069
+ } finally {
3070
+ if (st)
3071
+ throw Xt;
3072
+ }
3073
+ }
3074
+ var bt = m(lt), zt = m(ot), St = n(bt), Zt = n(zt), Kt = p(lt), he = p(ot), Qt = [], jt = [];
3075
+ St.forEach(function(Gt, yt) {
3076
+ Qt[yt] = [], Gt.forEach(function(wt) {
3077
+ Kt.get(wt).length == 0 && Qt[yt].push(wt);
3078
+ });
3079
+ }), Zt.forEach(function(Gt, yt) {
3080
+ jt[yt] = [], Gt.forEach(function(wt) {
3081
+ he.get(wt).length == 0 && jt[yt].push(wt);
3082
+ });
3083
+ });
3084
+ var _t = O(lt, "horizontal", ct, Z, Qt), Jt = O(ot, "vertical", nt, at, jt), oe = function(yt) {
3085
+ $.get(yt) ? $.get(yt).forEach(function(wt) {
3086
+ v[d.get(wt)] = _t.get(yt);
3087
+ }) : v[d.get(yt)] = _t.get(yt);
3088
+ }, te = !0, ee = !1, Ne = void 0;
3089
+ try {
3090
+ for (var le = _t.keys()[Symbol.iterator](), Le; !(te = (Le = le.next()).done); te = !0) {
3091
+ var fe = Le.value;
3092
+ oe(fe);
3093
+ }
3094
+ } catch (Gt) {
3095
+ ee = !0, Ne = Gt;
3096
+ } finally {
3097
+ try {
3098
+ !te && le.return && le.return();
3099
+ } finally {
3100
+ if (ee)
3101
+ throw Ne;
3102
+ }
3103
+ }
3104
+ var $e = function(yt) {
3105
+ J.get(yt) ? J.get(yt).forEach(function(wt) {
3106
+ L[d.get(wt)] = Jt.get(yt);
3107
+ }) : L[d.get(yt)] = Jt.get(yt);
3108
+ }, ce = !0, Ce = !1, Ae = void 0;
3109
+ try {
3110
+ for (var ge = Jt.keys()[Symbol.iterator](), Me; !(ce = (Me = ge.next()).done); ce = !0) {
3111
+ var fe = Me.value;
3112
+ $e(fe);
3113
+ }
3114
+ } catch (Gt) {
3115
+ Ce = !0, Ae = Gt;
3116
+ } finally {
3117
+ try {
3118
+ !ce && ge.return && ge.return();
3119
+ } finally {
3120
+ if (Ce)
3121
+ throw Ae;
3122
+ }
3123
+ }
3124
+ }();
3125
+ }
3126
+ for (var Yt = 0; Yt < S.length; Yt++) {
3127
+ var Vt = S[Yt];
3128
+ Vt.getChild() == null && Vt.setCenter(v[d.get(Vt.id)], L[d.get(Vt.id)]);
3129
+ }
3130
+ }, a.exports = s;
3131
+ }
3132
+ ),
3133
+ /***/
3134
+ 551: (
3135
+ /***/
3136
+ (a) => {
3137
+ a.exports = A;
3138
+ }
3139
+ )
3140
+ /******/
3141
+ }, N = {};
3142
+ function u(a) {
3143
+ var r = N[a];
3144
+ if (r !== void 0)
3145
+ return r.exports;
3146
+ var e = N[a] = {
3147
+ /******/
3148
+ // no module.id needed
3149
+ /******/
3150
+ // no module.loaded needed
3151
+ /******/
3152
+ exports: {}
3153
+ /******/
3154
+ };
3155
+ return P[a](e, e.exports, u), e.exports;
3156
+ }
3157
+ var h = u(45);
3158
+ return h;
3159
+ })()
3160
+ );
3161
+ });
3162
+ }(ue)), ue.exports;
3163
+ }
3164
+ (function(I, D) {
3165
+ (function(P, N) {
3166
+ I.exports = N(ur());
3167
+ })(me, function(A) {
3168
+ return (
3169
+ /******/
3170
+ (() => {
3171
+ var P = {
3172
+ /***/
3173
+ 658: (
3174
+ /***/
3175
+ (a) => {
3176
+ a.exports = Object.assign != null ? Object.assign.bind(Object) : function(r) {
3177
+ for (var e = arguments.length, f = Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
3178
+ f[i - 1] = arguments[i];
3179
+ return f.forEach(function(g) {
3180
+ Object.keys(g).forEach(function(t) {
3181
+ return r[t] = g[t];
3182
+ });
3183
+ }), r;
3184
+ };
3185
+ }
3186
+ ),
3187
+ /***/
3188
+ 548: (
3189
+ /***/
3190
+ (a, r, e) => {
3191
+ var f = /* @__PURE__ */ function() {
3192
+ function t(o, s) {
3193
+ var c = [], l = !0, T = !1, d = void 0;
3194
+ try {
3195
+ for (var v = o[Symbol.iterator](), L; !(l = (L = v.next()).done) && (c.push(L.value), !(s && c.length === s)); l = !0)
3196
+ ;
3197
+ } catch (S) {
3198
+ T = !0, d = S;
3199
+ } finally {
3200
+ try {
3201
+ !l && v.return && v.return();
3202
+ } finally {
3203
+ if (T)
3204
+ throw d;
3205
+ }
3206
+ }
3207
+ return c;
3208
+ }
3209
+ return function(o, s) {
3210
+ if (Array.isArray(o))
3211
+ return o;
3212
+ if (Symbol.iterator in Object(o))
3213
+ return t(o, s);
3214
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
3215
+ };
3216
+ }(), i = e(140).layoutBase.LinkedList, g = {};
3217
+ g.getTopMostNodes = function(t) {
3218
+ for (var o = {}, s = 0; s < t.length; s++)
3219
+ o[t[s].id()] = !0;
3220
+ var c = t.filter(function(l, T) {
3221
+ typeof l == "number" && (l = T);
3222
+ for (var d = l.parent()[0]; d != null; ) {
3223
+ if (o[d.id()])
3224
+ return !1;
3225
+ d = d.parent()[0];
3226
+ }
3227
+ return !0;
3228
+ });
3229
+ return c;
3230
+ }, g.connectComponents = function(t, o, s, c) {
3231
+ var l = new i(), T = /* @__PURE__ */ new Set(), d = [], v = void 0, L = void 0, S = void 0, C = !1, G = 1, K = [], X = [], Q = function() {
3232
+ var rt = t.collection();
3233
+ X.push(rt);
3234
+ var n = s[0], m = t.collection();
3235
+ m.merge(n).merge(n.descendants().intersection(o)), d.push(n), m.forEach(function(y) {
3236
+ l.push(y), T.add(y), rt.merge(y);
3237
+ });
3238
+ for (var p = function() {
3239
+ n = l.shift();
3240
+ var R = t.collection();
3241
+ n.neighborhood().nodes().forEach(function(x) {
3242
+ o.intersection(n.edgesWith(x)).length > 0 && R.merge(x);
3243
+ });
3244
+ for (var M = 0; M < R.length; M++) {
3245
+ var F = R[M];
3246
+ if (v = s.intersection(F.union(F.ancestors())), v != null && !T.has(v[0])) {
3247
+ var W = v.union(v.descendants());
3248
+ W.forEach(function(x) {
3249
+ l.push(x), T.add(x), rt.merge(x), s.has(x) && d.push(x);
3250
+ });
3251
+ }
3252
+ }
3253
+ }; l.length != 0; )
3254
+ p();
3255
+ if (rt.forEach(function(y) {
3256
+ o.intersection(y.connectedEdges()).forEach(function(R) {
3257
+ rt.has(R.source()) && rt.has(R.target()) && rt.merge(R);
3258
+ });
3259
+ }), d.length == s.length && (C = !0), !C || C && G > 1) {
3260
+ L = d[0], S = L.connectedEdges().length, d.forEach(function(y) {
3261
+ y.connectedEdges().length < S && (S = y.connectedEdges().length, L = y);
3262
+ }), K.push(L.id());
3263
+ var E = t.collection();
3264
+ E.merge(d[0]), d.forEach(function(y) {
3265
+ E.merge(y);
3266
+ }), d = [], s = s.difference(E), G++;
3267
+ }
3268
+ };
3269
+ do
3270
+ Q();
3271
+ while (!C);
3272
+ return c && K.length > 0 && c.set("dummy" + (c.size + 1), K), X;
3273
+ }, g.relocateComponent = function(t, o, s) {
3274
+ if (!s.fixedNodeConstraint) {
3275
+ var c = Number.POSITIVE_INFINITY, l = Number.NEGATIVE_INFINITY, T = Number.POSITIVE_INFINITY, d = Number.NEGATIVE_INFINITY;
3276
+ if (s.quality == "draft") {
3277
+ var v = !0, L = !1, S = void 0;
3278
+ try {
3279
+ for (var C = o.nodeIndexes[Symbol.iterator](), G; !(v = (G = C.next()).done); v = !0) {
3280
+ var K = G.value, X = f(K, 2), Q = X[0], O = X[1], rt = s.cy.getElementById(Q);
3281
+ if (rt) {
3282
+ var n = rt.boundingBox(), m = o.xCoords[O] - n.w / 2, p = o.xCoords[O] + n.w / 2, E = o.yCoords[O] - n.h / 2, y = o.yCoords[O] + n.h / 2;
3283
+ m < c && (c = m), p > l && (l = p), E < T && (T = E), y > d && (d = y);
3284
+ }
3285
+ }
3286
+ } catch (x) {
3287
+ L = !0, S = x;
3288
+ } finally {
3289
+ try {
3290
+ !v && C.return && C.return();
3291
+ } finally {
3292
+ if (L)
3293
+ throw S;
3294
+ }
3295
+ }
3296
+ var R = t.x - (l + c) / 2, M = t.y - (d + T) / 2;
3297
+ o.xCoords = o.xCoords.map(function(x) {
3298
+ return x + R;
3299
+ }), o.yCoords = o.yCoords.map(function(x) {
3300
+ return x + M;
3301
+ });
3302
+ } else {
3303
+ Object.keys(o).forEach(function(x) {
3304
+ var k = o[x], V = k.getRect().x, Y = k.getRect().x + k.getRect().width, et = k.getRect().y, z = k.getRect().y + k.getRect().height;
3305
+ V < c && (c = V), Y > l && (l = Y), et < T && (T = et), z > d && (d = z);
3306
+ });
3307
+ var F = t.x - (l + c) / 2, W = t.y - (d + T) / 2;
3308
+ Object.keys(o).forEach(function(x) {
3309
+ var k = o[x];
3310
+ k.setCenter(k.getCenterX() + F, k.getCenterY() + W);
3311
+ });
3312
+ }
3313
+ }
3314
+ }, g.calcBoundingBox = function(t, o, s, c) {
3315
+ for (var l = Number.MAX_SAFE_INTEGER, T = Number.MIN_SAFE_INTEGER, d = Number.MAX_SAFE_INTEGER, v = Number.MIN_SAFE_INTEGER, L = void 0, S = void 0, C = void 0, G = void 0, K = t.descendants().not(":parent"), X = K.length, Q = 0; Q < X; Q++) {
3316
+ var O = K[Q];
3317
+ L = o[c.get(O.id())] - O.width() / 2, S = o[c.get(O.id())] + O.width() / 2, C = s[c.get(O.id())] - O.height() / 2, G = s[c.get(O.id())] + O.height() / 2, l > L && (l = L), T < S && (T = S), d > C && (d = C), v < G && (v = G);
3318
+ }
3319
+ var rt = {};
3320
+ return rt.topLeftX = l, rt.topLeftY = d, rt.width = T - l, rt.height = v - d, rt;
3321
+ }, g.calcParentsWithoutChildren = function(t, o) {
3322
+ var s = t.collection();
3323
+ return o.nodes(":parent").forEach(function(c) {
3324
+ var l = !1;
3325
+ c.children().forEach(function(T) {
3326
+ T.css("display") != "none" && (l = !0);
3327
+ }), l || s.merge(c);
3328
+ }), s;
3329
+ }, a.exports = g;
3330
+ }
3331
+ ),
3332
+ /***/
3333
+ 816: (
3334
+ /***/
3335
+ (a, r, e) => {
3336
+ var f = e(548), i = e(140).CoSELayout, g = e(140).CoSENode, t = e(140).layoutBase.PointD, o = e(140).layoutBase.DimensionD, s = e(140).layoutBase.LayoutConstants, c = e(140).layoutBase.FDLayoutConstants, l = e(140).CoSEConstants, T = function(v, L) {
3337
+ var S = v.cy, C = v.eles, G = C.nodes(), K = C.edges(), X = void 0, Q = void 0, O = void 0, rt = {};
3338
+ v.randomize && (X = L.nodeIndexes, Q = L.xCoords, O = L.yCoords);
3339
+ var n = function(x) {
3340
+ return typeof x == "function";
3341
+ }, m = function(x, k) {
3342
+ return n(x) ? x(k) : x;
3343
+ }, p = f.calcParentsWithoutChildren(S, C), E = function W(x, k, V, Y) {
3344
+ for (var et = k.length, z = 0; z < et; z++) {
3345
+ var w = k[z], H = null;
3346
+ w.intersection(p).length == 0 && (H = w.children());
3347
+ var B = void 0, _ = w.layoutDimensions({
3348
+ nodeDimensionsIncludeLabels: Y.nodeDimensionsIncludeLabels
3349
+ });
3350
+ if (w.outerWidth() != null && w.outerHeight() != null)
3351
+ if (Y.randomize)
3352
+ if (!w.isParent())
3353
+ B = x.add(new g(V.graphManager, new t(Q[X.get(w.id())] - _.w / 2, O[X.get(w.id())] - _.h / 2), new o(parseFloat(_.w), parseFloat(_.h))));
3354
+ else {
3355
+ var ht = f.calcBoundingBox(w, Q, O, X);
3356
+ w.intersection(p).length == 0 ? B = x.add(new g(V.graphManager, new t(ht.topLeftX, ht.topLeftY), new o(ht.width, ht.height))) : B = x.add(new g(V.graphManager, new t(ht.topLeftX, ht.topLeftY), new o(parseFloat(_.w), parseFloat(_.h))));
3357
+ }
3358
+ else
3359
+ B = x.add(new g(V.graphManager, new t(w.position("x") - _.w / 2, w.position("y") - _.h / 2), new o(parseFloat(_.w), parseFloat(_.h))));
3360
+ else
3361
+ B = x.add(new g(this.graphManager));
3362
+ if (B.id = w.data("id"), B.nodeRepulsion = m(Y.nodeRepulsion, w), B.paddingLeft = parseInt(w.css("padding")), B.paddingTop = parseInt(w.css("padding")), B.paddingRight = parseInt(w.css("padding")), B.paddingBottom = parseInt(w.css("padding")), Y.nodeDimensionsIncludeLabels && (B.labelWidth = w.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).w, B.labelHeight = w.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).h, B.labelPosVertical = w.css("text-valign"), B.labelPosHorizontal = w.css("text-halign")), rt[w.data("id")] = B, isNaN(B.rect.x) && (B.rect.x = 0), isNaN(B.rect.y) && (B.rect.y = 0), H != null && H.length > 0) {
3363
+ var q = void 0;
3364
+ q = V.getGraphManager().add(V.newGraph(), B), W(q, H, V, Y);
3365
+ }
3366
+ }
3367
+ }, y = function(x, k, V) {
3368
+ for (var Y = 0, et = 0, z = 0; z < V.length; z++) {
3369
+ var w = V[z], H = rt[w.data("source")], B = rt[w.data("target")];
3370
+ if (H && B && H !== B && H.getEdgesBetween(B).length == 0) {
3371
+ var _ = k.add(x.newEdge(), H, B);
3372
+ _.id = w.id(), _.idealLength = m(v.idealEdgeLength, w), _.edgeElasticity = m(v.edgeElasticity, w), Y += _.idealLength, et++;
3373
+ }
3374
+ }
3375
+ v.idealEdgeLength != null && (et > 0 ? l.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = Y / et : n(v.idealEdgeLength) ? l.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = 50 : l.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = v.idealEdgeLength, l.MIN_REPULSION_DIST = c.MIN_REPULSION_DIST = c.DEFAULT_EDGE_LENGTH / 10, l.DEFAULT_RADIAL_SEPARATION = c.DEFAULT_EDGE_LENGTH);
3376
+ }, R = function(x, k) {
3377
+ k.fixedNodeConstraint && (x.constraints.fixedNodeConstraint = k.fixedNodeConstraint), k.alignmentConstraint && (x.constraints.alignmentConstraint = k.alignmentConstraint), k.relativePlacementConstraint && (x.constraints.relativePlacementConstraint = k.relativePlacementConstraint);
3378
+ };
3379
+ v.nestingFactor != null && (l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = v.nestingFactor), v.gravity != null && (l.DEFAULT_GRAVITY_STRENGTH = c.DEFAULT_GRAVITY_STRENGTH = v.gravity), v.numIter != null && (l.MAX_ITERATIONS = c.MAX_ITERATIONS = v.numIter), v.gravityRange != null && (l.DEFAULT_GRAVITY_RANGE_FACTOR = c.DEFAULT_GRAVITY_RANGE_FACTOR = v.gravityRange), v.gravityCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_STRENGTH = c.DEFAULT_COMPOUND_GRAVITY_STRENGTH = v.gravityCompound), v.gravityRangeCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = v.gravityRangeCompound), v.initialEnergyOnIncremental != null && (l.DEFAULT_COOLING_FACTOR_INCREMENTAL = c.DEFAULT_COOLING_FACTOR_INCREMENTAL = v.initialEnergyOnIncremental), v.tilingCompareBy != null && (l.TILING_COMPARE_BY = v.tilingCompareBy), v.quality == "proof" ? s.QUALITY = 2 : s.QUALITY = 0, l.NODE_DIMENSIONS_INCLUDE_LABELS = c.NODE_DIMENSIONS_INCLUDE_LABELS = s.NODE_DIMENSIONS_INCLUDE_LABELS = v.nodeDimensionsIncludeLabels, l.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = s.DEFAULT_INCREMENTAL = !v.randomize, l.ANIMATE = c.ANIMATE = s.ANIMATE = v.animate, l.TILE = v.tile, l.TILING_PADDING_VERTICAL = typeof v.tilingPaddingVertical == "function" ? v.tilingPaddingVertical.call() : v.tilingPaddingVertical, l.TILING_PADDING_HORIZONTAL = typeof v.tilingPaddingHorizontal == "function" ? v.tilingPaddingHorizontal.call() : v.tilingPaddingHorizontal, l.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = s.DEFAULT_INCREMENTAL = !0, l.PURE_INCREMENTAL = !v.randomize, s.DEFAULT_UNIFORM_LEAF_NODE_SIZES = v.uniformNodeDimensions, v.step == "transformed" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !1), v.step == "enforced" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !1), v.step == "cose" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !0), v.step == "all" && (v.randomize ? l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0 : l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !0), v.fixedNodeConstraint || v.alignmentConstraint || v.relativePlacementConstraint ? l.TREE_REDUCTION_ON_INCREMENTAL = !1 : l.TREE_REDUCTION_ON_INCREMENTAL = !0;
3380
+ var M = new i(), F = M.newGraphManager();
3381
+ return E(F.addRoot(), f.getTopMostNodes(G), M, v), y(M, F, K), R(M, v), M.runLayout(), rt;
3382
+ };
3383
+ a.exports = { coseLayout: T };
3384
+ }
3385
+ ),
3386
+ /***/
3387
+ 212: (
3388
+ /***/
3389
+ (a, r, e) => {
3390
+ var f = /* @__PURE__ */ function() {
3391
+ function v(L, S) {
3392
+ for (var C = 0; C < S.length; C++) {
3393
+ var G = S[C];
3394
+ G.enumerable = G.enumerable || !1, G.configurable = !0, "value" in G && (G.writable = !0), Object.defineProperty(L, G.key, G);
3395
+ }
3396
+ }
3397
+ return function(L, S, C) {
3398
+ return S && v(L.prototype, S), C && v(L, C), L;
3399
+ };
3400
+ }();
3401
+ function i(v, L) {
3402
+ if (!(v instanceof L))
3403
+ throw new TypeError("Cannot call a class as a function");
3404
+ }
3405
+ var g = e(658), t = e(548), o = e(657), s = o.spectralLayout, c = e(816), l = c.coseLayout, T = Object.freeze({
3406
+ // 'draft', 'default' or 'proof'
3407
+ // - 'draft' only applies spectral layout
3408
+ // - 'default' improves the quality with subsequent CoSE layout (fast cooling rate)
3409
+ // - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate)
3410
+ quality: "default",
3411
+ // Use random node positions at beginning of layout
3412
+ // if this is set to false, then quality option must be "proof"
3413
+ randomize: !0,
3414
+ // Whether or not to animate the layout
3415
+ animate: !0,
3416
+ // Duration of animation in ms, if enabled
3417
+ animationDuration: 1e3,
3418
+ // Easing of animation, if enabled
3419
+ animationEasing: void 0,
3420
+ // Fit the viewport to the repositioned nodes
3421
+ fit: !0,
3422
+ // Padding around layout
3423
+ padding: 30,
3424
+ // Whether to include labels in node dimensions. Valid in "proof" quality
3425
+ nodeDimensionsIncludeLabels: !1,
3426
+ // Whether or not simple nodes (non-compound nodes) are of uniform dimensions
3427
+ uniformNodeDimensions: !1,
3428
+ // Whether to pack disconnected components - valid only if randomize: true
3429
+ packComponents: !0,
3430
+ // Layout step - all, transformed, enforced, cose - for debug purpose only
3431
+ step: "all",
3432
+ /* spectral layout options */
3433
+ // False for random, true for greedy
3434
+ samplingType: !0,
3435
+ // Sample size to construct distance matrix
3436
+ sampleSize: 25,
3437
+ // Separation amount between nodes
3438
+ nodeSeparation: 75,
3439
+ // Power iteration tolerance
3440
+ piTol: 1e-7,
3441
+ /* CoSE layout options */
3442
+ // Node repulsion (non overlapping) multiplier
3443
+ nodeRepulsion: function(L) {
3444
+ return 4500;
3445
+ },
3446
+ // Ideal edge (non nested) length
3447
+ idealEdgeLength: function(L) {
3448
+ return 50;
3449
+ },
3450
+ // Divisor to compute edge forces
3451
+ edgeElasticity: function(L) {
3452
+ return 0.45;
3453
+ },
3454
+ // Nesting factor (multiplier) to compute ideal edge length for nested edges
3455
+ nestingFactor: 0.1,
3456
+ // Gravity force (constant)
3457
+ gravity: 0.25,
3458
+ // Maximum number of iterations to perform
3459
+ numIter: 2500,
3460
+ // For enabling tiling
3461
+ tile: !0,
3462
+ // The function that specifies the criteria for comparing nodes while sorting them during tiling operation.
3463
+ // Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set.
3464
+ tilingCompareBy: void 0,
3465
+ // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
3466
+ tilingPaddingVertical: 10,
3467
+ // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
3468
+ tilingPaddingHorizontal: 10,
3469
+ // Gravity range (constant) for compounds
3470
+ gravityRangeCompound: 1.5,
3471
+ // Gravity force (constant) for compounds
3472
+ gravityCompound: 1,
3473
+ // Gravity range (constant)
3474
+ gravityRange: 3.8,
3475
+ // Initial cooling factor for incremental layout
3476
+ initialEnergyOnIncremental: 0.3,
3477
+ /* constraint options */
3478
+ // Fix required nodes to predefined positions
3479
+ // [{nodeId: 'n1', position: {x: 100, y: 200}, {...}]
3480
+ fixedNodeConstraint: void 0,
3481
+ // Align required nodes in vertical/horizontal direction
3482
+ // {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']}
3483
+ alignmentConstraint: void 0,
3484
+ // Place two nodes relatively in vertical/horizontal direction
3485
+ // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}]
3486
+ relativePlacementConstraint: void 0,
3487
+ /* layout event callbacks */
3488
+ ready: function() {
3489
+ },
3490
+ // on layoutready
3491
+ stop: function() {
3492
+ }
3493
+ // on layoutstop
3494
+ }), d = function() {
3495
+ function v(L) {
3496
+ i(this, v), this.options = g({}, T, L);
3497
+ }
3498
+ return f(v, [{
3499
+ key: "run",
3500
+ value: function() {
3501
+ var S = this, C = this.options, G = C.cy, K = C.eles, X = [], Q = [], O = void 0, rt = [];
3502
+ C.fixedNodeConstraint && (!Array.isArray(C.fixedNodeConstraint) || C.fixedNodeConstraint.length == 0) && (C.fixedNodeConstraint = void 0), C.alignmentConstraint && (C.alignmentConstraint.vertical && (!Array.isArray(C.alignmentConstraint.vertical) || C.alignmentConstraint.vertical.length == 0) && (C.alignmentConstraint.vertical = void 0), C.alignmentConstraint.horizontal && (!Array.isArray(C.alignmentConstraint.horizontal) || C.alignmentConstraint.horizontal.length == 0) && (C.alignmentConstraint.horizontal = void 0)), C.relativePlacementConstraint && (!Array.isArray(C.relativePlacementConstraint) || C.relativePlacementConstraint.length == 0) && (C.relativePlacementConstraint = void 0);
3503
+ var n = C.fixedNodeConstraint || C.alignmentConstraint || C.relativePlacementConstraint;
3504
+ n && (C.tile = !1, C.packComponents = !1);
3505
+ var m = void 0, p = !1;
3506
+ if (G.layoutUtilities && C.packComponents && (m = G.layoutUtilities("get"), m || (m = G.layoutUtilities()), p = !0), K.nodes().length > 0)
3507
+ if (p) {
3508
+ var R = t.getTopMostNodes(C.eles.nodes());
3509
+ if (O = t.connectComponents(G, C.eles, R), O.forEach(function(vt) {
3510
+ var it = vt.boundingBox();
3511
+ rt.push({ x: it.x1 + it.w / 2, y: it.y1 + it.h / 2 });
3512
+ }), C.randomize && O.forEach(function(vt) {
3513
+ C.eles = vt, X.push(s(C));
3514
+ }), C.quality == "default" || C.quality == "proof") {
3515
+ var M = G.collection();
3516
+ if (C.tile) {
3517
+ var F = /* @__PURE__ */ new Map(), W = [], x = [], k = 0, V = { nodeIndexes: F, xCoords: W, yCoords: x }, Y = [];
3518
+ if (O.forEach(function(vt, it) {
3519
+ vt.edges().length == 0 && (vt.nodes().forEach(function(gt, mt) {
3520
+ M.merge(vt.nodes()[mt]), gt.isParent() || (V.nodeIndexes.set(vt.nodes()[mt].id(), k++), V.xCoords.push(vt.nodes()[0].position().x), V.yCoords.push(vt.nodes()[0].position().y));
3521
+ }), Y.push(it));
3522
+ }), M.length > 1) {
3523
+ var et = M.boundingBox();
3524
+ rt.push({ x: et.x1 + et.w / 2, y: et.y1 + et.h / 2 }), O.push(M), X.push(V);
3525
+ for (var z = Y.length - 1; z >= 0; z--)
3526
+ O.splice(Y[z], 1), X.splice(Y[z], 1), rt.splice(Y[z], 1);
3527
+ }
3528
+ }
3529
+ O.forEach(function(vt, it) {
3530
+ C.eles = vt, Q.push(l(C, X[it])), t.relocateComponent(rt[it], Q[it], C);
3531
+ });
3532
+ } else
3533
+ O.forEach(function(vt, it) {
3534
+ t.relocateComponent(rt[it], X[it], C);
3535
+ });
3536
+ var w = /* @__PURE__ */ new Set();
3537
+ if (O.length > 1) {
3538
+ var H = [], B = K.filter(function(vt) {
3539
+ return vt.css("display") == "none";
3540
+ });
3541
+ O.forEach(function(vt, it) {
3542
+ var gt = void 0;
3543
+ if (C.quality == "draft" && (gt = X[it].nodeIndexes), vt.nodes().not(B).length > 0) {
3544
+ var mt = {};
3545
+ mt.edges = [], mt.nodes = [];
3546
+ var At = void 0;
3547
+ vt.nodes().not(B).forEach(function(Ot) {
3548
+ if (C.quality == "draft")
3549
+ if (!Ot.isParent())
3550
+ At = gt.get(Ot.id()), mt.nodes.push({ x: X[it].xCoords[At] - Ot.boundingbox().w / 2, y: X[it].yCoords[At] - Ot.boundingbox().h / 2, width: Ot.boundingbox().w, height: Ot.boundingbox().h });
3551
+ else {
3552
+ var Et = t.calcBoundingBox(Ot, X[it].xCoords, X[it].yCoords, gt);
3553
+ mt.nodes.push({ x: Et.topLeftX, y: Et.topLeftY, width: Et.width, height: Et.height });
3554
+ }
3555
+ else
3556
+ Q[it][Ot.id()] && mt.nodes.push({ x: Q[it][Ot.id()].getLeft(), y: Q[it][Ot.id()].getTop(), width: Q[it][Ot.id()].getWidth(), height: Q[it][Ot.id()].getHeight() });
3557
+ }), vt.edges().forEach(function(Ot) {
3558
+ var Et = Ot.source(), Dt = Ot.target();
3559
+ if (Et.css("display") != "none" && Dt.css("display") != "none")
3560
+ if (C.quality == "draft") {
3561
+ var Rt = gt.get(Et.id()), Ht = gt.get(Dt.id()), Ut = [], Pt = [];
3562
+ if (Et.isParent()) {
3563
+ var Ft = t.calcBoundingBox(Et, X[it].xCoords, X[it].yCoords, gt);
3564
+ Ut.push(Ft.topLeftX + Ft.width / 2), Ut.push(Ft.topLeftY + Ft.height / 2);
3565
+ } else
3566
+ Ut.push(X[it].xCoords[Rt]), Ut.push(X[it].yCoords[Rt]);
3567
+ if (Dt.isParent()) {
3568
+ var Yt = t.calcBoundingBox(Dt, X[it].xCoords, X[it].yCoords, gt);
3569
+ Pt.push(Yt.topLeftX + Yt.width / 2), Pt.push(Yt.topLeftY + Yt.height / 2);
3570
+ } else
3571
+ Pt.push(X[it].xCoords[Ht]), Pt.push(X[it].yCoords[Ht]);
3572
+ mt.edges.push({ startX: Ut[0], startY: Ut[1], endX: Pt[0], endY: Pt[1] });
3573
+ } else
3574
+ Q[it][Et.id()] && Q[it][Dt.id()] && mt.edges.push({ startX: Q[it][Et.id()].getCenterX(), startY: Q[it][Et.id()].getCenterY(), endX: Q[it][Dt.id()].getCenterX(), endY: Q[it][Dt.id()].getCenterY() });
3575
+ }), mt.nodes.length > 0 && (H.push(mt), w.add(it));
3576
+ }
3577
+ });
3578
+ var _ = m.packComponents(H, C.randomize).shifts;
3579
+ if (C.quality == "draft")
3580
+ X.forEach(function(vt, it) {
3581
+ var gt = vt.xCoords.map(function(At) {
3582
+ return At + _[it].dx;
3583
+ }), mt = vt.yCoords.map(function(At) {
3584
+ return At + _[it].dy;
3585
+ });
3586
+ vt.xCoords = gt, vt.yCoords = mt;
3587
+ });
3588
+ else {
3589
+ var ht = 0;
3590
+ w.forEach(function(vt) {
3591
+ Object.keys(Q[vt]).forEach(function(it) {
3592
+ var gt = Q[vt][it];
3593
+ gt.setCenter(gt.getCenterX() + _[ht].dx, gt.getCenterY() + _[ht].dy);
3594
+ }), ht++;
3595
+ });
3596
+ }
3597
+ }
3598
+ } else {
3599
+ var E = C.eles.boundingBox();
3600
+ if (rt.push({ x: E.x1 + E.w / 2, y: E.y1 + E.h / 2 }), C.randomize) {
3601
+ var y = s(C);
3602
+ X.push(y);
3603
+ }
3604
+ C.quality == "default" || C.quality == "proof" ? (Q.push(l(C, X[0])), t.relocateComponent(rt[0], Q[0], C)) : t.relocateComponent(rt[0], X[0], C);
3605
+ }
3606
+ var q = function(it, gt) {
3607
+ if (C.quality == "default" || C.quality == "proof") {
3608
+ typeof it == "number" && (it = gt);
3609
+ var mt = void 0, At = void 0, Ot = it.data("id");
3610
+ return Q.forEach(function(Dt) {
3611
+ Ot in Dt && (mt = { x: Dt[Ot].getRect().getCenterX(), y: Dt[Ot].getRect().getCenterY() }, At = Dt[Ot]);
3612
+ }), C.nodeDimensionsIncludeLabels && (At.labelWidth && (At.labelPosHorizontal == "left" ? mt.x += At.labelWidth / 2 : At.labelPosHorizontal == "right" && (mt.x -= At.labelWidth / 2)), At.labelHeight && (At.labelPosVertical == "top" ? mt.y += At.labelHeight / 2 : At.labelPosVertical == "bottom" && (mt.y -= At.labelHeight / 2))), mt == null && (mt = { x: it.position("x"), y: it.position("y") }), {
3613
+ x: mt.x,
3614
+ y: mt.y
3615
+ };
3616
+ } else {
3617
+ var Et = void 0;
3618
+ return X.forEach(function(Dt) {
3619
+ var Rt = Dt.nodeIndexes.get(it.id());
3620
+ Rt != null && (Et = { x: Dt.xCoords[Rt], y: Dt.yCoords[Rt] });
3621
+ }), Et == null && (Et = { x: it.position("x"), y: it.position("y") }), {
3622
+ x: Et.x,
3623
+ y: Et.y
3624
+ };
3625
+ }
3626
+ };
3627
+ if (C.quality == "default" || C.quality == "proof" || C.randomize) {
3628
+ var It = t.calcParentsWithoutChildren(G, K), Nt = K.filter(function(vt) {
3629
+ return vt.css("display") == "none";
3630
+ });
3631
+ C.eles = K.not(Nt), K.nodes().not(":parent").not(Nt).layoutPositions(S, C, q), It.length > 0 && It.forEach(function(vt) {
3632
+ vt.position(q(vt));
3633
+ });
3634
+ } else
3635
+ console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
3636
+ }
3637
+ }]), v;
3638
+ }();
3639
+ a.exports = d;
3640
+ }
3641
+ ),
3642
+ /***/
3643
+ 657: (
3644
+ /***/
3645
+ (a, r, e) => {
3646
+ var f = e(548), i = e(140).layoutBase.Matrix, g = e(140).layoutBase.SVD, t = function(s) {
3647
+ var c = s.cy, l = s.eles, T = l.nodes(), d = l.nodes(":parent"), v = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), C = [], G = [], K = [], X = [], Q = [], O = [], rt = [], n = [], m = void 0, p = 1e8, E = 1e-9, y = s.piTol, R = s.samplingType, M = s.nodeSeparation, F = void 0, W = function() {
3648
+ for (var U = 0, $ = 0, J = !1; $ < F; ) {
3649
+ U = Math.floor(Math.random() * m), J = !1;
3650
+ for (var Z = 0; Z < $; Z++)
3651
+ if (X[Z] == U) {
3652
+ J = !0;
3653
+ break;
3654
+ }
3655
+ if (!J)
3656
+ X[$] = U, $++;
3657
+ else
3658
+ continue;
3659
+ }
3660
+ }, x = function(U, $, J) {
3661
+ for (var Z = [], at = 0, ct = 0, nt = 0, tt = void 0, j = [], ut = 0, Mt = 1, pt = 0; pt < m; pt++)
3662
+ j[pt] = p;
3663
+ for (Z[ct] = U, j[U] = 0; ct >= at; ) {
3664
+ nt = Z[at++];
3665
+ for (var xt = C[nt], lt = 0; lt < xt.length; lt++)
3666
+ tt = L.get(xt[lt]), j[tt] == p && (j[tt] = j[nt] + 1, Z[++ct] = tt);
3667
+ O[nt][$] = j[nt] * M;
3668
+ }
3669
+ if (J) {
3670
+ for (var ot = 0; ot < m; ot++)
3671
+ O[ot][$] < Q[ot] && (Q[ot] = O[ot][$]);
3672
+ for (var Lt = 0; Lt < m; Lt++)
3673
+ Q[Lt] > ut && (ut = Q[Lt], Mt = Lt);
3674
+ }
3675
+ return Mt;
3676
+ }, k = function(U) {
3677
+ var $ = void 0;
3678
+ if (U) {
3679
+ $ = Math.floor(Math.random() * m);
3680
+ for (var Z = 0; Z < m; Z++)
3681
+ Q[Z] = p;
3682
+ for (var at = 0; at < F; at++)
3683
+ X[at] = $, $ = x($, at, U);
3684
+ } else {
3685
+ W();
3686
+ for (var J = 0; J < F; J++)
3687
+ x(X[J], J, U);
3688
+ }
3689
+ for (var ct = 0; ct < m; ct++)
3690
+ for (var nt = 0; nt < F; nt++)
3691
+ O[ct][nt] *= O[ct][nt];
3692
+ for (var tt = 0; tt < F; tt++)
3693
+ rt[tt] = [];
3694
+ for (var j = 0; j < F; j++)
3695
+ for (var ut = 0; ut < F; ut++)
3696
+ rt[j][ut] = O[X[ut]][j];
3697
+ }, V = function() {
3698
+ for (var U = g.svd(rt), $ = U.S, J = U.U, Z = U.V, at = $[0] * $[0] * $[0], ct = [], nt = 0; nt < F; nt++) {
3699
+ ct[nt] = [];
3700
+ for (var tt = 0; tt < F; tt++)
3701
+ ct[nt][tt] = 0, nt == tt && (ct[nt][tt] = $[nt] / ($[nt] * $[nt] + at / ($[nt] * $[nt])));
3702
+ }
3703
+ n = i.multMat(i.multMat(Z, ct), i.transpose(J));
3704
+ }, Y = function() {
3705
+ for (var U = void 0, $ = void 0, J = [], Z = [], at = [], ct = [], nt = 0; nt < m; nt++)
3706
+ J[nt] = Math.random(), Z[nt] = Math.random();
3707
+ J = i.normalize(J), Z = i.normalize(Z);
3708
+ for (var tt = E, j = E, ut = void 0; ; ) {
3709
+ for (var Mt = 0; Mt < m; Mt++)
3710
+ at[Mt] = J[Mt];
3711
+ if (J = i.multGamma(i.multL(i.multGamma(at), O, n)), U = i.dotProduct(at, J), J = i.normalize(J), tt = i.dotProduct(at, J), ut = Math.abs(tt / j), ut <= 1 + y && ut >= 1)
3712
+ break;
3713
+ j = tt;
3714
+ }
3715
+ for (var pt = 0; pt < m; pt++)
3716
+ at[pt] = J[pt];
3717
+ for (j = E; ; ) {
3718
+ for (var xt = 0; xt < m; xt++)
3719
+ ct[xt] = Z[xt];
3720
+ if (ct = i.minusOp(ct, i.multCons(at, i.dotProduct(at, ct))), Z = i.multGamma(i.multL(i.multGamma(ct), O, n)), $ = i.dotProduct(ct, Z), Z = i.normalize(Z), tt = i.dotProduct(ct, Z), ut = Math.abs(tt / j), ut <= 1 + y && ut >= 1)
3721
+ break;
3722
+ j = tt;
3723
+ }
3724
+ for (var lt = 0; lt < m; lt++)
3725
+ ct[lt] = Z[lt];
3726
+ G = i.multCons(at, Math.sqrt(Math.abs(U))), K = i.multCons(ct, Math.sqrt(Math.abs($)));
3727
+ };
3728
+ f.connectComponents(c, l, f.getTopMostNodes(T), v), d.forEach(function(b) {
3729
+ f.connectComponents(c, l, f.getTopMostNodes(b.descendants().intersection(l)), v);
3730
+ });
3731
+ for (var et = 0, z = 0; z < T.length; z++)
3732
+ T[z].isParent() || L.set(T[z].id(), et++);
3733
+ var w = !0, H = !1, B = void 0;
3734
+ try {
3735
+ for (var _ = v.keys()[Symbol.iterator](), ht; !(w = (ht = _.next()).done); w = !0) {
3736
+ var q = ht.value;
3737
+ L.set(q, et++);
3738
+ }
3739
+ } catch (b) {
3740
+ H = !0, B = b;
3741
+ } finally {
3742
+ try {
3743
+ !w && _.return && _.return();
3744
+ } finally {
3745
+ if (H)
3746
+ throw B;
3747
+ }
3748
+ }
3749
+ for (var It = 0; It < L.size; It++)
3750
+ C[It] = [];
3751
+ d.forEach(function(b) {
3752
+ for (var U = b.children().intersection(l); U.nodes(":childless").length == 0; )
3753
+ U = U.nodes()[0].children().intersection(l);
3754
+ var $ = 0, J = U.nodes(":childless")[0].connectedEdges().length;
3755
+ U.nodes(":childless").forEach(function(Z, at) {
3756
+ Z.connectedEdges().length < J && (J = Z.connectedEdges().length, $ = at);
3757
+ }), S.set(b.id(), U.nodes(":childless")[$].id());
3758
+ }), T.forEach(function(b) {
3759
+ var U = void 0;
3760
+ b.isParent() ? U = L.get(S.get(b.id())) : U = L.get(b.id()), b.neighborhood().nodes().forEach(function($) {
3761
+ l.intersection(b.edgesWith($)).length > 0 && ($.isParent() ? C[U].push(S.get($.id())) : C[U].push($.id()));
3762
+ });
3763
+ });
3764
+ var Nt = function(U) {
3765
+ var $ = L.get(U), J = void 0;
3766
+ v.get(U).forEach(function(Z) {
3767
+ c.getElementById(Z).isParent() ? J = S.get(Z) : J = Z, C[$].push(J), C[L.get(J)].push(U);
3768
+ });
3769
+ }, vt = !0, it = !1, gt = void 0;
3770
+ try {
3771
+ for (var mt = v.keys()[Symbol.iterator](), At; !(vt = (At = mt.next()).done); vt = !0) {
3772
+ var Ot = At.value;
3773
+ Nt(Ot);
3774
+ }
3775
+ } catch (b) {
3776
+ it = !0, gt = b;
3777
+ } finally {
3778
+ try {
3779
+ !vt && mt.return && mt.return();
3780
+ } finally {
3781
+ if (it)
3782
+ throw gt;
3783
+ }
3784
+ }
3785
+ m = L.size;
3786
+ var Et = void 0;
3787
+ if (m > 2) {
3788
+ F = m < s.sampleSize ? m : s.sampleSize;
3789
+ for (var Dt = 0; Dt < m; Dt++)
3790
+ O[Dt] = [];
3791
+ for (var Rt = 0; Rt < F; Rt++)
3792
+ n[Rt] = [];
3793
+ return s.quality == "draft" || s.step == "all" ? (k(R), V(), Y(), Et = { nodeIndexes: L, xCoords: G, yCoords: K }) : (L.forEach(function(b, U) {
3794
+ G.push(c.getElementById(U).position("x")), K.push(c.getElementById(U).position("y"));
3795
+ }), Et = { nodeIndexes: L, xCoords: G, yCoords: K }), Et;
3796
+ } else {
3797
+ var Ht = L.keys(), Ut = c.getElementById(Ht.next().value), Pt = Ut.position(), Ft = Ut.outerWidth();
3798
+ if (G.push(Pt.x), K.push(Pt.y), m == 2) {
3799
+ var Yt = c.getElementById(Ht.next().value), Vt = Yt.outerWidth();
3800
+ G.push(Pt.x + Ft / 2 + Vt / 2 + s.idealEdgeLength), K.push(Pt.y);
3801
+ }
3802
+ return Et = { nodeIndexes: L, xCoords: G, yCoords: K }, Et;
3803
+ }
3804
+ };
3805
+ a.exports = { spectralLayout: t };
3806
+ }
3807
+ ),
3808
+ /***/
3809
+ 579: (
3810
+ /***/
3811
+ (a, r, e) => {
3812
+ var f = e(212), i = function(t) {
3813
+ t && t("layout", "fcose", f);
3814
+ };
3815
+ typeof cytoscape < "u" && i(cytoscape), a.exports = i;
3816
+ }
3817
+ ),
3818
+ /***/
3819
+ 140: (
3820
+ /***/
3821
+ (a) => {
3822
+ a.exports = A;
3823
+ }
3824
+ )
3825
+ /******/
3826
+ }, N = {};
3827
+ function u(a) {
3828
+ var r = N[a];
3829
+ if (r !== void 0)
3830
+ return r.exports;
3831
+ var e = N[a] = {
3832
+ /******/
3833
+ // no module.id needed
3834
+ /******/
3835
+ // no module.loaded needed
3836
+ /******/
3837
+ exports: {}
3838
+ /******/
3839
+ };
3840
+ return P[a](e, e.exports, u), e.exports;
3841
+ }
3842
+ var h = u(579);
3843
+ return h;
3844
+ })()
3845
+ );
3846
+ });
3847
+ })(Fe);
3848
+ var dr = Fe.exports;
3849
+ const vr = /* @__PURE__ */ cr(dr);
3850
+ var De = {
3851
+ L: "left",
3852
+ R: "right",
3853
+ T: "top",
3854
+ B: "bottom"
3855
+ }, xe = {
3856
+ L: /* @__PURE__ */ dt((I) => `${I},${I / 2} 0,${I} 0,0`, "L"),
3857
+ R: /* @__PURE__ */ dt((I) => `0,${I / 2} ${I},0 ${I},${I}`, "R"),
3858
+ T: /* @__PURE__ */ dt((I) => `0,0 ${I},0 ${I / 2},${I}`, "T"),
3859
+ B: /* @__PURE__ */ dt((I) => `${I / 2},0 ${I},${I} 0,${I}`, "B")
3860
+ }, se = {
3861
+ L: /* @__PURE__ */ dt((I, D) => I - D + 2, "L"),
3862
+ R: /* @__PURE__ */ dt((I, D) => I - 2, "R"),
3863
+ T: /* @__PURE__ */ dt((I, D) => I - D + 2, "T"),
3864
+ B: /* @__PURE__ */ dt((I, D) => I - 2, "B")
3865
+ }, pr = /* @__PURE__ */ dt(function(I) {
3866
+ return Wt(I) ? I === "L" ? "R" : "L" : I === "T" ? "B" : "T";
3867
+ }, "getOppositeArchitectureDirection"), Ie = /* @__PURE__ */ dt(function(I) {
3868
+ const D = I;
3869
+ return D === "L" || D === "R" || D === "T" || D === "B";
3870
+ }, "isArchitectureDirection"), Wt = /* @__PURE__ */ dt(function(I) {
3871
+ const D = I;
3872
+ return D === "L" || D === "R";
3873
+ }, "isArchitectureDirectionX"), qt = /* @__PURE__ */ dt(function(I) {
3874
+ const D = I;
3875
+ return D === "T" || D === "B";
3876
+ }, "isArchitectureDirectionY"), Te = /* @__PURE__ */ dt(function(I, D) {
3877
+ const A = Wt(I) && qt(D), P = qt(I) && Wt(D);
3878
+ return A || P;
3879
+ }, "isArchitectureDirectionXY"), yr = /* @__PURE__ */ dt(function(I) {
3880
+ const D = I[0], A = I[1], P = Wt(D) && qt(A), N = qt(D) && Wt(A);
3881
+ return P || N;
3882
+ }, "isArchitecturePairXY"), Er = /* @__PURE__ */ dt(function(I) {
3883
+ return I !== "LL" && I !== "RR" && I !== "TT" && I !== "BB";
3884
+ }, "isValidArchitectureDirectionPair"), pe = /* @__PURE__ */ dt(function(I, D) {
3885
+ const A = `${I}${D}`;
3886
+ return Er(A) ? A : void 0;
3887
+ }, "getArchitectureDirectionPair"), mr = /* @__PURE__ */ dt(function([I, D], A) {
3888
+ const P = A[0], N = A[1];
3889
+ return Wt(P) ? qt(N) ? [I + (P === "L" ? -1 : 1), D + (N === "T" ? 1 : -1)] : [I + (P === "L" ? -1 : 1), D] : Wt(N) ? [I + (N === "L" ? 1 : -1), D + (P === "T" ? 1 : -1)] : [I, D + (P === "T" ? 1 : -1)];
3890
+ }, "shiftPositionByArchitectureDirectionPair"), Tr = /* @__PURE__ */ dt(function(I) {
3891
+ return I === "LT" || I === "TL" ? [1, 1] : I === "BL" || I === "LB" ? [1, -1] : I === "BR" || I === "RB" ? [-1, -1] : [-1, 1];
3892
+ }, "getArchitectureDirectionXYFactors"), Nr = /* @__PURE__ */ dt(function(I, D) {
3893
+ return Te(I, D) ? "bend" : Wt(I) ? "horizontal" : "vertical";
3894
+ }, "getArchitectureDirectionAlignment"), Lr = /* @__PURE__ */ dt(function(I) {
3895
+ return I.type === "service";
3896
+ }, "isArchitectureService"), Cr = /* @__PURE__ */ dt(function(I) {
3897
+ return I.type === "junction";
3898
+ }, "isArchitectureJunction"), be = /* @__PURE__ */ dt((I) => I.data(), "edgeData"), ie = /* @__PURE__ */ dt((I) => I.data(), "nodeData"), Ar = Ze.architecture, ne, Pe = (ne = class {
3899
+ constructor() {
3900
+ this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.elements = {}, this.setAccTitle = ke, this.getAccTitle = qe, this.setDiagramTitle = Qe, this.getDiagramTitle = Je, this.getAccDescription = Ke, this.setAccDescription = je, this.clear();
3901
+ }
3902
+ clear() {
3903
+ this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.dataStructures = void 0, this.elements = {}, _e();
3904
+ }
3905
+ addService({
3906
+ id: D,
3907
+ icon: A,
3908
+ in: P,
3909
+ title: N,
3910
+ iconText: u
3911
+ }) {
3912
+ if (this.registeredIds[D] !== void 0)
3913
+ throw new Error(
3914
+ `The service id [${D}] is already in use by another ${this.registeredIds[D]}`
3915
+ );
3916
+ if (P !== void 0) {
3917
+ if (D === P)
3918
+ throw new Error(`The service [${D}] cannot be placed within itself`);
3919
+ if (this.registeredIds[P] === void 0)
3920
+ throw new Error(
3921
+ `The service [${D}]'s parent does not exist. Please make sure the parent is created before this service`
3922
+ );
3923
+ if (this.registeredIds[P] === "node")
3924
+ throw new Error(`The service [${D}]'s parent is not a group`);
3925
+ }
3926
+ this.registeredIds[D] = "node", this.nodes[D] = {
3927
+ id: D,
3928
+ type: "service",
3929
+ icon: A,
3930
+ iconText: u,
3931
+ title: N,
3932
+ edges: [],
3933
+ in: P
3934
+ };
3935
+ }
3936
+ getServices() {
3937
+ return Object.values(this.nodes).filter(Lr);
3938
+ }
3939
+ addJunction({ id: D, in: A }) {
3940
+ this.registeredIds[D] = "node", this.nodes[D] = {
3941
+ id: D,
3942
+ type: "junction",
3943
+ edges: [],
3944
+ in: A
3945
+ };
3946
+ }
3947
+ getJunctions() {
3948
+ return Object.values(this.nodes).filter(Cr);
3949
+ }
3950
+ getNodes() {
3951
+ return Object.values(this.nodes);
3952
+ }
3953
+ getNode(D) {
3954
+ return this.nodes[D] ?? null;
3955
+ }
3956
+ addGroup({ id: D, icon: A, in: P, title: N }) {
3957
+ var u, h, a;
3958
+ if (((u = this.registeredIds) == null ? void 0 : u[D]) !== void 0)
3959
+ throw new Error(
3960
+ `The group id [${D}] is already in use by another ${this.registeredIds[D]}`
3961
+ );
3962
+ if (P !== void 0) {
3963
+ if (D === P)
3964
+ throw new Error(`The group [${D}] cannot be placed within itself`);
3965
+ if (((h = this.registeredIds) == null ? void 0 : h[P]) === void 0)
3966
+ throw new Error(
3967
+ `The group [${D}]'s parent does not exist. Please make sure the parent is created before this group`
3968
+ );
3969
+ if (((a = this.registeredIds) == null ? void 0 : a[P]) === "node")
3970
+ throw new Error(`The group [${D}]'s parent is not a group`);
3971
+ }
3972
+ this.registeredIds[D] = "group", this.groups[D] = {
3973
+ id: D,
3974
+ icon: A,
3975
+ title: N,
3976
+ in: P
3977
+ };
3978
+ }
3979
+ getGroups() {
3980
+ return Object.values(this.groups);
3981
+ }
3982
+ addEdge({
3983
+ lhsId: D,
3984
+ rhsId: A,
3985
+ lhsDir: P,
3986
+ rhsDir: N,
3987
+ lhsInto: u,
3988
+ rhsInto: h,
3989
+ lhsGroup: a,
3990
+ rhsGroup: r,
3991
+ title: e
3992
+ }) {
3993
+ if (!Ie(P))
3994
+ throw new Error(
3995
+ `Invalid direction given for left hand side of edge ${D}--${A}. Expected (L,R,T,B) got ${String(P)}`
3996
+ );
3997
+ if (!Ie(N))
3998
+ throw new Error(
3999
+ `Invalid direction given for right hand side of edge ${D}--${A}. Expected (L,R,T,B) got ${String(N)}`
4000
+ );
4001
+ if (this.nodes[D] === void 0 && this.groups[D] === void 0)
4002
+ throw new Error(
4003
+ `The left-hand id [${D}] does not yet exist. Please create the service/group before declaring an edge to it.`
4004
+ );
4005
+ if (this.nodes[A] === void 0 && this.groups[A] === void 0)
4006
+ throw new Error(
4007
+ `The right-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`
4008
+ );
4009
+ const f = this.nodes[D].in, i = this.nodes[A].in;
4010
+ if (a && f && i && f == i)
4011
+ throw new Error(
4012
+ `The left-hand id [${D}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
4013
+ );
4014
+ if (r && f && i && f == i)
4015
+ throw new Error(
4016
+ `The right-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
4017
+ );
4018
+ const g = {
4019
+ lhsId: D,
4020
+ lhsDir: P,
4021
+ lhsInto: u,
4022
+ lhsGroup: a,
4023
+ rhsId: A,
4024
+ rhsDir: N,
4025
+ rhsInto: h,
4026
+ rhsGroup: r,
4027
+ title: e
4028
+ };
4029
+ this.edges.push(g), this.nodes[D] && this.nodes[A] && (this.nodes[D].edges.push(this.edges[this.edges.length - 1]), this.nodes[A].edges.push(this.edges[this.edges.length - 1]));
4030
+ }
4031
+ getEdges() {
4032
+ return this.edges;
4033
+ }
4034
+ /**
4035
+ * Returns the current diagram's adjacency list, spatial map, & group alignments.
4036
+ * If they have not been created, run the algorithms to generate them.
4037
+ * @returns
4038
+ */
4039
+ getDataStructures() {
4040
+ if (this.dataStructures === void 0) {
4041
+ const D = {}, A = Object.entries(this.nodes).reduce((r, [e, f]) => (r[e] = f.edges.reduce((i, g) => {
4042
+ var s, c;
4043
+ const t = (s = this.getNode(g.lhsId)) == null ? void 0 : s.in, o = (c = this.getNode(g.rhsId)) == null ? void 0 : c.in;
4044
+ if (t && o && t !== o) {
4045
+ const l = Nr(g.lhsDir, g.rhsDir);
4046
+ l !== "bend" && (D[t] ?? (D[t] = {}), D[t][o] = l, D[o] ?? (D[o] = {}), D[o][t] = l);
4047
+ }
4048
+ if (g.lhsId === e) {
4049
+ const l = pe(g.lhsDir, g.rhsDir);
4050
+ l && (i[l] = g.rhsId);
4051
+ } else {
4052
+ const l = pe(g.rhsDir, g.lhsDir);
4053
+ l && (i[l] = g.lhsId);
4054
+ }
4055
+ return i;
4056
+ }, {}), r), {}), P = Object.keys(A)[0], N = { [P]: 1 }, u = Object.keys(A).reduce(
4057
+ (r, e) => e === P ? r : { ...r, [e]: 1 },
4058
+ {}
4059
+ ), h = /* @__PURE__ */ dt((r) => {
4060
+ const e = { [r]: [0, 0] }, f = [r];
4061
+ for (; f.length > 0; ) {
4062
+ const i = f.shift();
4063
+ if (i) {
4064
+ N[i] = 1, delete u[i];
4065
+ const g = A[i], [t, o] = e[i];
4066
+ Object.entries(g).forEach(([s, c]) => {
4067
+ N[c] || (e[c] = mr(
4068
+ [t, o],
4069
+ s
4070
+ ), f.push(c));
4071
+ });
4072
+ }
4073
+ }
4074
+ return e;
4075
+ }, "BFS"), a = [h(P)];
4076
+ for (; Object.keys(u).length > 0; )
4077
+ a.push(h(Object.keys(u)[0]));
4078
+ this.dataStructures = {
4079
+ adjList: A,
4080
+ spatialMaps: a,
4081
+ groupAlignments: D
4082
+ };
4083
+ }
4084
+ return this.dataStructures;
4085
+ }
4086
+ setElementForId(D, A) {
4087
+ this.elements[D] = A;
4088
+ }
4089
+ getElementById(D) {
4090
+ return this.elements[D];
4091
+ }
4092
+ getConfig() {
4093
+ return tr({
4094
+ ...Ar,
4095
+ ...er().architecture
4096
+ });
4097
+ }
4098
+ getConfigField(D) {
4099
+ return this.getConfig()[D];
4100
+ }
4101
+ }, dt(ne, "ArchitectureDB"), ne), Mr = /* @__PURE__ */ dt((I, D) => {
4102
+ lr(I, D), I.groups.map((A) => D.addGroup(A)), I.services.map((A) => D.addService({ ...A, type: "service" })), I.junctions.map((A) => D.addJunction({ ...A, type: "junction" })), I.edges.map((A) => D.addEdge(A));
4103
+ }, "populateDb"), Ge = {
4104
+ parser: {
4105
+ // @ts-expect-error - ArchitectureDB is not assignable to DiagramDB
4106
+ yy: void 0
4107
+ },
4108
+ parse: /* @__PURE__ */ dt(async (I) => {
4109
+ var P;
4110
+ const D = await fr("architecture", I);
4111
+ Re.debug(D);
4112
+ const A = (P = Ge.parser) == null ? void 0 : P.yy;
4113
+ if (!(A instanceof Pe))
4114
+ throw new Error(
4115
+ "parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
4116
+ );
4117
+ Mr(D, A);
4118
+ }, "parse")
4119
+ }, wr = /* @__PURE__ */ dt((I) => `
4120
+ .edge {
4121
+ stroke-width: ${I.archEdgeWidth};
4122
+ stroke: ${I.archEdgeColor};
4123
+ fill: none;
4124
+ }
4125
+
4126
+ .arrow {
4127
+ fill: ${I.archEdgeArrowColor};
4128
+ }
4129
+
4130
+ .node-bkg {
4131
+ fill: none;
4132
+ stroke: ${I.archGroupBorderColor};
4133
+ stroke-width: ${I.archGroupBorderWidth};
4134
+ stroke-dasharray: 8;
4135
+ }
4136
+ .node-icon-text {
4137
+ display: flex;
4138
+ align-items: center;
4139
+ }
4140
+
4141
+ .node-icon-text > div {
4142
+ color: #fff;
4143
+ margin: 1px;
4144
+ height: fit-content;
4145
+ text-align: center;
4146
+ overflow: hidden;
4147
+ display: -webkit-box;
4148
+ -webkit-box-orient: vertical;
4149
+ }
4150
+ `, "getStyles"), Or = wr, re = /* @__PURE__ */ dt((I) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${I}</g>`, "wrapIcon"), ae = {
4151
+ prefix: "mermaid-architecture",
4152
+ height: 80,
4153
+ width: 80,
4154
+ icons: {
4155
+ database: {
4156
+ body: re(
4157
+ '<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4158
+ )
4159
+ },
4160
+ server: {
4161
+ body: re(
4162
+ '<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>'
4163
+ )
4164
+ },
4165
+ disk: {
4166
+ body: re(
4167
+ '<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>'
4168
+ )
4169
+ },
4170
+ internet: {
4171
+ body: re(
4172
+ '<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4173
+ )
4174
+ },
4175
+ cloud: {
4176
+ body: re(
4177
+ '<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4178
+ )
4179
+ },
4180
+ unknown: rr,
4181
+ blank: {
4182
+ body: re("")
4183
+ }
4184
+ }
4185
+ }, Dr = /* @__PURE__ */ dt(async function(I, D, A) {
4186
+ const P = A.getConfigField("padding"), N = A.getConfigField("iconSize"), u = N / 2, h = N / 6, a = h / 2;
4187
+ await Promise.all(
4188
+ D.edges().map(async (r) => {
4189
+ var K, X;
4190
+ const {
4191
+ source: e,
4192
+ sourceDir: f,
4193
+ sourceArrow: i,
4194
+ sourceGroup: g,
4195
+ target: t,
4196
+ targetDir: o,
4197
+ targetArrow: s,
4198
+ targetGroup: c,
4199
+ label: l
4200
+ } = be(r);
4201
+ let { x: T, y: d } = r[0].sourceEndpoint();
4202
+ const { x: v, y: L } = r[0].midpoint();
4203
+ let { x: S, y: C } = r[0].targetEndpoint();
4204
+ const G = P + 4;
4205
+ if (g && (Wt(f) ? T += f === "L" ? -G : G : d += f === "T" ? -G : G + 18), c && (Wt(o) ? S += o === "L" ? -G : G : C += o === "T" ? -G : G + 18), !g && ((K = A.getNode(e)) == null ? void 0 : K.type) === "junction" && (Wt(f) ? T += f === "L" ? u : -u : d += f === "T" ? u : -u), !c && ((X = A.getNode(t)) == null ? void 0 : X.type) === "junction" && (Wt(o) ? S += o === "L" ? u : -u : C += o === "T" ? u : -u), r[0]._private.rscratch) {
4206
+ const Q = I.insert("g");
4207
+ if (Q.insert("path").attr("d", `M ${T},${d} L ${v},${L} L${S},${C} `).attr("class", "edge").attr("id", sr(e, t, { prefix: "L" })), i) {
4208
+ const O = Wt(f) ? se[f](T, h) : T - a, rt = qt(f) ? se[f](d, h) : d - a;
4209
+ Q.insert("polygon").attr("points", xe[f](h)).attr("transform", `translate(${O},${rt})`).attr("class", "arrow");
4210
+ }
4211
+ if (s) {
4212
+ const O = Wt(o) ? se[o](S, h) : S - a, rt = qt(o) ? se[o](C, h) : C - a;
4213
+ Q.insert("polygon").attr("points", xe[o](h)).attr("transform", `translate(${O},${rt})`).attr("class", "arrow");
4214
+ }
4215
+ if (l) {
4216
+ const O = Te(f, o) ? "XY" : Wt(f) ? "X" : "Y";
4217
+ let rt = 0;
4218
+ O === "X" ? rt = Math.abs(T - S) : O === "Y" ? rt = Math.abs(d - C) / 1.5 : rt = Math.abs(T - S) / 2;
4219
+ const n = Q.append("g");
4220
+ if (await ye(
4221
+ n,
4222
+ l,
4223
+ {
4224
+ useHtmlLabels: !1,
4225
+ width: rt,
4226
+ classes: "architecture-service-label"
4227
+ },
4228
+ Ee()
4229
+ ), n.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), O === "X")
4230
+ n.attr("transform", "translate(" + v + ", " + L + ")");
4231
+ else if (O === "Y")
4232
+ n.attr("transform", "translate(" + v + ", " + L + ") rotate(-90)");
4233
+ else if (O === "XY") {
4234
+ const m = pe(f, o);
4235
+ if (m && yr(m)) {
4236
+ const p = n.node().getBoundingClientRect(), [E, y] = Tr(m);
4237
+ n.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * E * y * 45})`);
4238
+ const R = n.node().getBoundingClientRect();
4239
+ n.attr(
4240
+ "transform",
4241
+ `
4242
+ translate(${v}, ${L - p.height / 2})
4243
+ translate(${E * R.width / 2}, ${y * R.height / 2})
4244
+ rotate(${-1 * E * y * 45}, 0, ${p.height / 2})
4245
+ `
4246
+ );
4247
+ }
4248
+ }
4249
+ }
4250
+ }
4251
+ })
4252
+ );
4253
+ }, "drawEdges"), xr = /* @__PURE__ */ dt(async function(I, D, A) {
4254
+ const N = A.getConfigField("padding") * 0.75, u = A.getConfigField("fontSize"), a = A.getConfigField("iconSize") / 2;
4255
+ await Promise.all(
4256
+ D.nodes().map(async (r) => {
4257
+ const e = ie(r);
4258
+ if (e.type === "group") {
4259
+ const { h: f, w: i, x1: g, y1: t } = r.boundingBox(), o = I.append("rect");
4260
+ o.attr("id", `group-${e.id}`).attr("x", g + a).attr("y", t + a).attr("width", i).attr("height", f).attr("class", "node-bkg");
4261
+ const s = I.append("g");
4262
+ let c = g, l = t;
4263
+ if (e.icon) {
4264
+ const T = s.append("g");
4265
+ T.html(
4266
+ `<g>${await ve(e.icon, { height: N, width: N, fallbackPrefix: ae.prefix })}</g>`
4267
+ ), T.attr(
4268
+ "transform",
4269
+ "translate(" + (c + a + 1) + ", " + (l + a + 1) + ")"
4270
+ ), c += N, l += u / 2 - 1 - 2;
4271
+ }
4272
+ if (e.label) {
4273
+ const T = s.append("g");
4274
+ await ye(
4275
+ T,
4276
+ e.label,
4277
+ {
4278
+ useHtmlLabels: !1,
4279
+ width: i,
4280
+ classes: "architecture-service-label"
4281
+ },
4282
+ Ee()
4283
+ ), T.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), T.attr(
4284
+ "transform",
4285
+ "translate(" + (c + a + 4) + ", " + (l + a + 2) + ")"
4286
+ );
4287
+ }
4288
+ A.setElementForId(e.id, o);
4289
+ }
4290
+ })
4291
+ );
4292
+ }, "drawGroups"), Ir = /* @__PURE__ */ dt(async function(I, D, A) {
4293
+ const P = Ee();
4294
+ for (const N of A) {
4295
+ const u = D.append("g"), h = I.getConfigField("iconSize");
4296
+ if (N.title) {
4297
+ const f = u.append("g");
4298
+ await ye(
4299
+ f,
4300
+ N.title,
4301
+ {
4302
+ useHtmlLabels: !1,
4303
+ width: h * 1.5,
4304
+ classes: "architecture-service-label"
4305
+ },
4306
+ P
4307
+ ), f.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), f.attr("transform", "translate(" + h / 2 + ", " + h + ")");
4308
+ }
4309
+ const a = u.append("g");
4310
+ if (N.icon)
4311
+ a.html(
4312
+ `<g>${await ve(N.icon, { height: h, width: h, fallbackPrefix: ae.prefix })}</g>`
4313
+ );
4314
+ else if (N.iconText) {
4315
+ a.html(
4316
+ `<g>${await ve("blank", { height: h, width: h, fallbackPrefix: ae.prefix })}</g>`
4317
+ );
4318
+ const g = a.append("g").append("foreignObject").attr("width", h).attr("height", h).append("div").attr("class", "node-icon-text").attr("style", `height: ${h}px;`).append("div").html(hr(N.iconText, P)), t = parseInt(
4319
+ window.getComputedStyle(g.node(), null).getPropertyValue("font-size").replace(/\D/g, "")
4320
+ ) ?? 16;
4321
+ g.attr("style", `-webkit-line-clamp: ${Math.floor((h - 2) / t)};`);
4322
+ } else
4323
+ a.append("path").attr("class", "node-bkg").attr("id", "node-" + N.id).attr(
4324
+ "d",
4325
+ `M0 ${h} v${-h} q0,-5 5,-5 h${h} q5,0 5,5 v${h} H0 Z`
4326
+ );
4327
+ u.attr("id", `service-${N.id}`).attr("class", "architecture-service");
4328
+ const { width: r, height: e } = u.node().getBBox();
4329
+ N.width = r, N.height = e, I.setElementForId(N.id, u);
4330
+ }
4331
+ return 0;
4332
+ }, "drawServices"), Rr = /* @__PURE__ */ dt(function(I, D, A) {
4333
+ A.forEach((P) => {
4334
+ const N = D.append("g"), u = I.getConfigField("iconSize");
4335
+ N.append("g").append("rect").attr("id", "node-" + P.id).attr("fill-opacity", "0").attr("width", u).attr("height", u), N.attr("class", "architecture-junction");
4336
+ const { width: a, height: r } = N._groups[0][0].getBBox();
4337
+ N.width = a, N.height = r, I.setElementForId(P.id, N);
4338
+ });
4339
+ }, "drawJunctions");
4340
+ ir([
4341
+ {
4342
+ name: ae.prefix,
4343
+ icons: ae
4344
+ }
4345
+ ]);
4346
+ Se.use(vr);
4347
+ function Ue(I, D, A) {
4348
+ I.forEach((P) => {
4349
+ D.add({
4350
+ group: "nodes",
4351
+ data: {
4352
+ type: "service",
4353
+ id: P.id,
4354
+ icon: P.icon,
4355
+ label: P.title,
4356
+ parent: P.in,
4357
+ width: A.getConfigField("iconSize"),
4358
+ height: A.getConfigField("iconSize")
4359
+ },
4360
+ classes: "node-service"
4361
+ });
4362
+ });
4363
+ }
4364
+ dt(Ue, "addServices");
4365
+ function Ye(I, D, A) {
4366
+ I.forEach((P) => {
4367
+ D.add({
4368
+ group: "nodes",
4369
+ data: {
4370
+ type: "junction",
4371
+ id: P.id,
4372
+ parent: P.in,
4373
+ width: A.getConfigField("iconSize"),
4374
+ height: A.getConfigField("iconSize")
4375
+ },
4376
+ classes: "node-junction"
4377
+ });
4378
+ });
4379
+ }
4380
+ dt(Ye, "addJunctions");
4381
+ function Xe(I, D) {
4382
+ D.nodes().map((A) => {
4383
+ const P = ie(A);
4384
+ if (P.type === "group")
4385
+ return;
4386
+ P.x = A.position().x, P.y = A.position().y, I.getElementById(P.id).attr("transform", "translate(" + (P.x || 0) + "," + (P.y || 0) + ")");
4387
+ });
4388
+ }
4389
+ dt(Xe, "positionNodes");
4390
+ function He(I, D) {
4391
+ I.forEach((A) => {
4392
+ D.add({
4393
+ group: "nodes",
4394
+ data: {
4395
+ type: "group",
4396
+ id: A.id,
4397
+ icon: A.icon,
4398
+ label: A.title,
4399
+ parent: A.in
4400
+ },
4401
+ classes: "node-group"
4402
+ });
4403
+ });
4404
+ }
4405
+ dt(He, "addGroups");
4406
+ function We(I, D) {
4407
+ I.forEach((A) => {
4408
+ const { lhsId: P, rhsId: N, lhsInto: u, lhsGroup: h, rhsInto: a, lhsDir: r, rhsDir: e, rhsGroup: f, title: i } = A, g = Te(A.lhsDir, A.rhsDir) ? "segments" : "straight", t = {
4409
+ id: `${P}-${N}`,
4410
+ label: i,
4411
+ source: P,
4412
+ sourceDir: r,
4413
+ sourceArrow: u,
4414
+ sourceGroup: h,
4415
+ sourceEndpoint: r === "L" ? "0 50%" : r === "R" ? "100% 50%" : r === "T" ? "50% 0" : "50% 100%",
4416
+ target: N,
4417
+ targetDir: e,
4418
+ targetArrow: a,
4419
+ targetGroup: f,
4420
+ targetEndpoint: e === "L" ? "0 50%" : e === "R" ? "100% 50%" : e === "T" ? "50% 0" : "50% 100%"
4421
+ };
4422
+ D.add({
4423
+ group: "edges",
4424
+ data: t,
4425
+ classes: g
4426
+ });
4427
+ });
4428
+ }
4429
+ dt(We, "addEdges");
4430
+ function Ve(I, D, A) {
4431
+ const P = /* @__PURE__ */ dt((a, r) => Object.entries(a).reduce(
4432
+ (e, [f, i]) => {
4433
+ var o;
4434
+ let g = 0;
4435
+ const t = Object.entries(i);
4436
+ if (t.length === 1)
4437
+ return e[f] = t[0][1], e;
4438
+ for (let s = 0; s < t.length - 1; s++)
4439
+ for (let c = s + 1; c < t.length; c++) {
4440
+ const [l, T] = t[s], [d, v] = t[c];
4441
+ if (((o = A[l]) == null ? void 0 : o[d]) === r)
4442
+ e[f] ?? (e[f] = []), e[f] = [...e[f], ...T, ...v];
4443
+ else if (l === "default" || d === "default")
4444
+ e[f] ?? (e[f] = []), e[f] = [...e[f], ...T, ...v];
4445
+ else {
4446
+ const S = `${f}-${g++}`;
4447
+ e[S] = T;
4448
+ const C = `${f}-${g++}`;
4449
+ e[C] = v;
4450
+ }
4451
+ }
4452
+ return e;
4453
+ },
4454
+ {}
4455
+ ), "flattenAlignments"), N = D.map((a) => {
4456
+ const r = {}, e = {};
4457
+ return Object.entries(a).forEach(([f, [i, g]]) => {
4458
+ var o, s, c;
4459
+ const t = ((o = I.getNode(f)) == null ? void 0 : o.in) ?? "default";
4460
+ r[g] ?? (r[g] = {}), (s = r[g])[t] ?? (s[t] = []), r[g][t].push(f), e[i] ?? (e[i] = {}), (c = e[i])[t] ?? (c[t] = []), e[i][t].push(f);
4461
+ }), {
4462
+ horiz: Object.values(P(r, "horizontal")).filter(
4463
+ (f) => f.length > 1
4464
+ ),
4465
+ vert: Object.values(P(e, "vertical")).filter(
4466
+ (f) => f.length > 1
4467
+ )
4468
+ };
4469
+ }), [u, h] = N.reduce(
4470
+ ([a, r], { horiz: e, vert: f }) => [
4471
+ [...a, ...e],
4472
+ [...r, ...f]
4473
+ ],
4474
+ [[], []]
4475
+ );
4476
+ return {
4477
+ horizontal: u,
4478
+ vertical: h
4479
+ };
4480
+ }
4481
+ dt(Ve, "getAlignments");
4482
+ function ze(I, D) {
4483
+ const A = [], P = /* @__PURE__ */ dt((u) => `${u[0]},${u[1]}`, "posToStr"), N = /* @__PURE__ */ dt((u) => u.split(",").map((h) => parseInt(h)), "strToPos");
4484
+ return I.forEach((u) => {
4485
+ const h = Object.fromEntries(
4486
+ Object.entries(u).map(([f, i]) => [P(i), f])
4487
+ ), a = [P([0, 0])], r = {}, e = {
4488
+ L: [-1, 0],
4489
+ R: [1, 0],
4490
+ T: [0, 1],
4491
+ B: [0, -1]
4492
+ };
4493
+ for (; a.length > 0; ) {
4494
+ const f = a.shift();
4495
+ if (f) {
4496
+ r[f] = 1;
4497
+ const i = h[f];
4498
+ if (i) {
4499
+ const g = N(f);
4500
+ Object.entries(e).forEach(([t, o]) => {
4501
+ const s = P([g[0] + o[0], g[1] + o[1]]), c = h[s];
4502
+ c && !r[s] && (a.push(s), A.push({
4503
+ [De[t]]: c,
4504
+ [De[pr(t)]]: i,
4505
+ gap: 1.5 * D.getConfigField("iconSize")
4506
+ }));
4507
+ });
4508
+ }
4509
+ }
4510
+ }
4511
+ }), A;
4512
+ }
4513
+ dt(ze, "getRelativeConstraints");
4514
+ function Be(I, D, A, P, N, { spatialMaps: u, groupAlignments: h }) {
4515
+ return new Promise((a) => {
4516
+ const r = ar("body").append("div").attr("id", "cy").attr("style", "display:none"), e = Se({
4517
+ container: document.getElementById("cy"),
4518
+ style: [
4519
+ {
4520
+ selector: "edge",
4521
+ style: {
4522
+ "curve-style": "straight",
4523
+ label: "data(label)",
4524
+ "source-endpoint": "data(sourceEndpoint)",
4525
+ "target-endpoint": "data(targetEndpoint)"
4526
+ }
4527
+ },
4528
+ {
4529
+ selector: "edge.segments",
4530
+ style: {
4531
+ "curve-style": "segments",
4532
+ "segment-weights": "0",
4533
+ "segment-distances": [0.5],
4534
+ // @ts-ignore Incorrect library types
4535
+ "edge-distances": "endpoints",
4536
+ "source-endpoint": "data(sourceEndpoint)",
4537
+ "target-endpoint": "data(targetEndpoint)"
4538
+ }
4539
+ },
4540
+ {
4541
+ selector: "node",
4542
+ style: {
4543
+ // @ts-ignore Incorrect library types
4544
+ "compound-sizing-wrt-labels": "include"
4545
+ }
4546
+ },
4547
+ {
4548
+ selector: "node[label]",
4549
+ style: {
4550
+ "text-valign": "bottom",
4551
+ "text-halign": "center",
4552
+ "font-size": `${N.getConfigField("fontSize")}px`
4553
+ }
4554
+ },
4555
+ {
4556
+ selector: ".node-service",
4557
+ style: {
4558
+ label: "data(label)",
4559
+ width: "data(width)",
4560
+ height: "data(height)"
4561
+ }
4562
+ },
4563
+ {
4564
+ selector: ".node-junction",
4565
+ style: {
4566
+ width: "data(width)",
4567
+ height: "data(height)"
4568
+ }
4569
+ },
4570
+ {
4571
+ selector: ".node-group",
4572
+ style: {
4573
+ // @ts-ignore Incorrect library types
4574
+ padding: `${N.getConfigField("padding")}px`
4575
+ }
4576
+ }
4577
+ ],
4578
+ layout: {
4579
+ name: "grid",
4580
+ boundingBox: {
4581
+ x1: 0,
4582
+ x2: 100,
4583
+ y1: 0,
4584
+ y2: 100
4585
+ }
4586
+ }
4587
+ });
4588
+ r.remove(), He(A, e), Ue(I, e, N), Ye(D, e, N), We(P, e);
4589
+ const f = Ve(N, u, h), i = ze(u, N), g = e.layout({
4590
+ name: "fcose",
4591
+ quality: "proof",
4592
+ styleEnabled: !1,
4593
+ animate: !1,
4594
+ nodeDimensionsIncludeLabels: !1,
4595
+ // Adjust the edge parameters if it passes through the border of a group
4596
+ // Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67
4597
+ idealEdgeLength(t) {
4598
+ const [o, s] = t.connectedNodes(), { parent: c } = ie(o), { parent: l } = ie(s);
4599
+ return c === l ? 1.5 * N.getConfigField("iconSize") : 0.5 * N.getConfigField("iconSize");
4600
+ },
4601
+ edgeElasticity(t) {
4602
+ const [o, s] = t.connectedNodes(), { parent: c } = ie(o), { parent: l } = ie(s);
4603
+ return c === l ? 0.45 : 1e-3;
4604
+ },
4605
+ alignmentConstraint: f,
4606
+ relativePlacementConstraint: i
4607
+ });
4608
+ g.one("layoutstop", () => {
4609
+ var o;
4610
+ function t(s, c, l, T) {
4611
+ let d, v;
4612
+ const { x: L, y: S } = s, { x: C, y: G } = c;
4613
+ v = (T - S + (L - l) * (S - G) / (L - C)) / Math.sqrt(1 + Math.pow((S - G) / (L - C), 2)), d = Math.sqrt(Math.pow(T - S, 2) + Math.pow(l - L, 2) - Math.pow(v, 2));
4614
+ const K = Math.sqrt(Math.pow(C - L, 2) + Math.pow(G - S, 2));
4615
+ d = d / K;
4616
+ let X = (C - L) * (T - S) - (G - S) * (l - L);
4617
+ switch (!0) {
4618
+ case X >= 0:
4619
+ X = 1;
4620
+ break;
4621
+ case X < 0:
4622
+ X = -1;
4623
+ break;
4624
+ }
4625
+ let Q = (C - L) * (l - L) + (G - S) * (T - S);
4626
+ switch (!0) {
4627
+ case Q >= 0:
4628
+ Q = 1;
4629
+ break;
4630
+ case Q < 0:
4631
+ Q = -1;
4632
+ break;
4633
+ }
4634
+ return v = Math.abs(v) * X, d = d * Q, {
4635
+ distances: v,
4636
+ weights: d
4637
+ };
4638
+ }
4639
+ dt(t, "getSegmentWeights"), e.startBatch();
4640
+ for (const s of Object.values(e.edges()))
4641
+ if ((o = s.data) != null && o.call(s)) {
4642
+ const { x: c, y: l } = s.source().position(), { x: T, y: d } = s.target().position();
4643
+ if (c !== T && l !== d) {
4644
+ const v = s.sourceEndpoint(), L = s.targetEndpoint(), { sourceDir: S } = be(s), [C, G] = qt(S) ? [v.x, L.y] : [L.x, v.y], { weights: K, distances: X } = t(v, L, C, G);
4645
+ s.style("segment-distances", X), s.style("segment-weights", K);
4646
+ }
4647
+ }
4648
+ e.endBatch(), g.run();
4649
+ }), g.run(), e.ready((t) => {
4650
+ Re.info("Ready", t), a(e);
4651
+ });
4652
+ });
4653
+ }
4654
+ dt(Be, "layoutArchitecture");
4655
+ var Sr = /* @__PURE__ */ dt(async (I, D, A, P) => {
4656
+ const N = P.db, u = N.getServices(), h = N.getJunctions(), a = N.getGroups(), r = N.getEdges(), e = N.getDataStructures(), f = nr(D), i = f.append("g");
4657
+ i.attr("class", "architecture-edges");
4658
+ const g = f.append("g");
4659
+ g.attr("class", "architecture-services");
4660
+ const t = f.append("g");
4661
+ t.attr("class", "architecture-groups"), await Ir(N, g, u), Rr(N, g, h);
4662
+ const o = await Be(u, h, a, r, N, e);
4663
+ await Dr(i, o, N), await xr(t, o, N), Xe(N, o), or(void 0, f, N.getConfigField("padding"), N.getConfigField("useMaxWidth"));
4664
+ }, "draw"), Fr = { draw: Sr }, Wr = {
4665
+ parser: Ge,
4666
+ get db() {
4667
+ return new Pe();
4668
+ },
4669
+ renderer: Fr,
4670
+ styles: Or
4671
+ };
4672
+ export {
4673
+ Wr as diagram
4674
+ };