@foris/ai-agent 0.9.1-beta.2 → 0.9.1-beta.3

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