ranui 0.2.1-alpha.1 → 0.2.1-alpha.4

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 (312) hide show
  1. package/dist/abnfDiagram-VRR7QNED-CH_pIv_l.cjs +1 -0
  2. package/dist/abnfDiagram-VRR7QNED-CTsqwzwi.js +95 -0
  3. package/dist/arc-D25LhgTs.cjs +1 -0
  4. package/dist/arc-DRPGof21.js +82 -0
  5. package/dist/architecture-TIHT7OUA-BbBd15_y.cjs +1 -0
  6. package/dist/architecture-TIHT7OUA-pbFO1xSx.js +5 -0
  7. package/dist/architectureDiagram-ZJ3FMSHR-8mjyXr-w.js +4279 -0
  8. package/dist/architectureDiagram-ZJ3FMSHR-D_jWFFZx.cjs +36 -0
  9. package/dist/array-By5736M5.js +7 -0
  10. package/dist/array-C3cbN3GY.cjs +1 -0
  11. package/dist/blockDiagram-677ZJIJ3-3F79MOSt.js +3321 -0
  12. package/dist/blockDiagram-677ZJIJ3-Cx35khWe.cjs +132 -0
  13. package/dist/builder.d.ts +2 -2
  14. package/dist/builder.js +39 -34
  15. package/dist/{builtin-D9djWkCE.js → builtin-1lUEp_ro.js} +83 -76
  16. package/dist/button-Cj-XSCsd.js +117 -0
  17. package/dist/button.js +1 -1
  18. package/dist/c4Diagram-LMCZKHZV-Cxn_gqu_.js +3064 -0
  19. package/dist/c4Diagram-LMCZKHZV-TRNb3Gvl.cjs +10 -0
  20. package/dist/{card-CqJa4Q_v.js → card-BHN9Xp4S.js} +2 -2
  21. package/dist/card.js +1 -1
  22. package/dist/channel-C9WSNwcS.cjs +1 -0
  23. package/dist/channel-k5-UxdcV.js +5 -0
  24. package/dist/{checkbox-CThC9-vy.js → checkbox-O_J_n1_W.js} +10 -10
  25. package/dist/checkbox.js +1 -1
  26. package/dist/chunk-2Q5K7J3B-CTMy5FII.cjs +1 -0
  27. package/dist/chunk-2Q5K7J3B-DlFVJRAn.js +15 -0
  28. package/dist/chunk-32BRIVSS-BXVdG_nV.cjs +1 -0
  29. package/dist/chunk-32BRIVSS-jAuAwMVV.js +68 -0
  30. package/dist/chunk-52WLFC77-BChUrU24.cjs +10 -0
  31. package/dist/chunk-52WLFC77-wpL7en7e.js +630 -0
  32. package/dist/chunk-5VM5RSS4-Cni2Ogq2.js +19 -0
  33. package/dist/chunk-5VM5RSS4-DudUFQ_Z.cjs +15 -0
  34. package/dist/chunk-7BUUIJ7U-9hiBbc7O.js +87 -0
  35. package/dist/chunk-7BUUIJ7U-DMv_UkjI.cjs +1 -0
  36. package/dist/chunk-C7G6YPKG-CA-DNpvI.js +71 -0
  37. package/dist/chunk-C7G6YPKG-CKEeW9TM.cjs +1 -0
  38. package/dist/chunk-EX3LRPZG-BCmf0iDq.js +2137 -0
  39. package/dist/chunk-EX3LRPZG-DbfbNdXo.cjs +231 -0
  40. package/dist/chunk-FWX5IMBZ-D11-gbhc.cjs +1 -0
  41. package/dist/chunk-FWX5IMBZ-DZ5VYvm5.js +60 -0
  42. package/dist/chunk-HOUHSVGY-BGB3dOvI.cjs +1 -0
  43. package/dist/chunk-HOUHSVGY-DRQcQeMT.js +268 -0
  44. package/dist/chunk-ICXQ74PX-BbT9JaEW.cjs +2 -0
  45. package/dist/chunk-ICXQ74PX-DR8rL-xF.js +1377 -0
  46. package/dist/chunk-JWPE2WC7-CGEmUMMZ.js +8 -0
  47. package/dist/chunk-JWPE2WC7-D8EnWK1B.cjs +1 -0
  48. package/dist/chunk-KEIR6QF5-B2Op7cFH.js +22155 -0
  49. package/dist/chunk-KEIR6QF5-C4fcHpY0.cjs +161 -0
  50. package/dist/chunk-MOJQB5TN-BC46HDyu.js +516 -0
  51. package/dist/chunk-MOJQB5TN-oOeq982_.cjs +88 -0
  52. package/dist/chunk-OGEWGWER-BV51ll2w.js +33 -0
  53. package/dist/chunk-OGEWGWER-DX8sW1dT.cjs +1 -0
  54. package/dist/chunk-PUDLZKDR-48YaqVoF.cjs +156 -0
  55. package/dist/chunk-PUDLZKDR-NdMR0Ft5.js +4282 -0
  56. package/dist/chunk-Q4XR5HBZ-3BHjjc9u.js +1709 -0
  57. package/dist/chunk-Q4XR5HBZ-aBnPq509.cjs +70 -0
  58. package/dist/chunk-RYQCIY6F-BER2T9t0.js +246 -0
  59. package/dist/chunk-RYQCIY6F-DVRzSnsI.cjs +1 -0
  60. package/dist/chunk-V7JOEXUC-Cr_hr02u.js +3467 -0
  61. package/dist/chunk-V7JOEXUC-DHizzTla.cjs +206 -0
  62. package/dist/chunk-VAUOI2AC-DfQf5L2_.cjs +1 -0
  63. package/dist/chunk-VAUOI2AC-izt0o4id.js +11 -0
  64. package/dist/chunk-VR4S4FIN-CJi5okl4.js +26 -0
  65. package/dist/chunk-VR4S4FIN-KiwnPF31.cjs +1 -0
  66. package/dist/chunk-WYO6CB5R-DDHkKowO.js +4535 -0
  67. package/dist/chunk-WYO6CB5R-u4mJNOcO.cjs +127 -0
  68. package/dist/chunk-XXDRQBXY-BB1i_53q.js +9 -0
  69. package/dist/chunk-XXDRQBXY-C8VGLZmt.cjs +1 -0
  70. package/dist/chunk-Y2CYZVJY-0JxdZxki.js +13 -0
  71. package/dist/chunk-Y2CYZVJY-DPaYLFFP.cjs +1 -0
  72. package/dist/chunk-ZGVPDNZ5-6uMbTJXy.js +3841 -0
  73. package/dist/chunk-ZGVPDNZ5-Cw5_HJba.cjs +62 -0
  74. package/dist/chunk-ZIRB5QZD-C7OH2FI2.js +1280 -0
  75. package/dist/chunk-ZIRB5QZD-aLu-4ITN.cjs +32 -0
  76. package/dist/classDiagram-OUVF2IWQ-D6rqYIh0.cjs +1 -0
  77. package/dist/classDiagram-OUVF2IWQ-Df0ghim9.js +30 -0
  78. package/dist/classDiagram-v2-EOCWNBFH-D6rqYIh0.cjs +1 -0
  79. package/dist/classDiagram-v2-EOCWNBFH-Df0ghim9.js +30 -0
  80. package/dist/{colorpicker-XNxDRcQ-.js → colorpicker-mebH0XLm.js} +8 -8
  81. package/dist/colorpicker.js +1 -1
  82. package/dist/components/glass/index.d.ts +52 -0
  83. package/dist/components/icon/core-icons.d.ts +13 -0
  84. package/dist/components/icon/index.d.ts +1 -1
  85. package/dist/components/mermaid/index.d.ts +52 -0
  86. package/dist/components/modal/index.d.ts +9 -0
  87. package/dist/content-YOKzMoc7.js +39 -0
  88. package/dist/content.js +5 -0
  89. package/dist/cose-bilkent-JH36ORCC-BUxFTdey.cjs +1 -0
  90. package/dist/cose-bilkent-JH36ORCC-DTwvJlGw.js +2353 -0
  91. package/dist/cynefin-VYW2F7L2-6c1GOGXW.cjs +1 -0
  92. package/dist/cynefin-VYW2F7L2-ALQKF7N6.js +5 -0
  93. package/dist/cynefinDiagram-TSTJHNR4-Bjt4QTVh.js +355 -0
  94. package/dist/cynefinDiagram-TSTJHNR4-ISDORSxO.cjs +62 -0
  95. package/dist/cytoscape.esm-CFq1_DTa.js +18906 -0
  96. package/dist/cytoscape.esm-pygMw4dR.cjs +321 -0
  97. package/dist/dagre-D1-W1tt6.cjs +1 -0
  98. package/dist/dagre-D8GLTwuf.js +1578 -0
  99. package/dist/dagre-VKFMJZFB-DXI69qAN.cjs +4 -0
  100. package/dist/dagre-VKFMJZFB-Dfku86Az.js +341 -0
  101. package/dist/defaultLocale-0M_kMcEH.js +184 -0
  102. package/dist/defaultLocale-DSqtvhxg.cjs +1 -0
  103. package/dist/diagram-FQU43EPY-BAiRt5eL.cjs +3 -0
  104. package/dist/diagram-FQU43EPY-BvQ5jmVn.js +452 -0
  105. package/dist/diagram-G47NLZAW-DGnmEa8u.cjs +24 -0
  106. package/dist/diagram-G47NLZAW-DT2BBA0T.js +498 -0
  107. package/dist/diagram-NH7WQ7WH-DxgkStA3.cjs +24 -0
  108. package/dist/diagram-NH7WQ7WH-W7jg4Vh8.js +135 -0
  109. package/dist/diagram-OA4YK3LP-DkvFII73.cjs +30 -0
  110. package/dist/diagram-OA4YK3LP-jU--aqQl.js +317 -0
  111. package/dist/diagram-WEI45ONY-C_Qhf4ny.js +215 -0
  112. package/dist/diagram-WEI45ONY-XvzRFmmY.cjs +41 -0
  113. package/dist/dist-C0Fwsvsq.js +70 -0
  114. package/dist/dist-C20XxSsP.cjs +1 -0
  115. package/dist/{dropdown-CCvsambb.js → dropdown-CzGAVWYC.js} +4 -4
  116. package/dist/dropdown.js +1 -1
  117. package/dist/ebnfDiagram-CCIWWBDH-Cu8bAlhC.cjs +1 -0
  118. package/dist/ebnfDiagram-CCIWWBDH-Gnr20Oc1.js +112 -0
  119. package/dist/erDiagram-Q63AITRT-CxLSa9Yv.cjs +85 -0
  120. package/dist/erDiagram-Q63AITRT-D0Hh9b-W.js +1822 -0
  121. package/dist/eventmodeling-45OFAUF4-C6VXxUn1.cjs +1 -0
  122. package/dist/eventmodeling-45OFAUF4-DMpGs2yI.js +5 -0
  123. package/dist/factory-ZNhcQ4tf.js +482 -0
  124. package/dist/flowDiagram-23GEKE2U-B6gASEYG.cjs +1 -0
  125. package/dist/flowDiagram-23GEKE2U-BY4wE2vw.js +19 -0
  126. package/dist/{form-Ceq3uJzz.js → form-B8afuJlF.js} +5 -5
  127. package/dist/form.js +1 -1
  128. package/dist/ganttDiagram-NO4QXBWP-B40Eabk0.js +3125 -0
  129. package/dist/ganttDiagram-NO4QXBWP-DZT79qJr.cjs +292 -0
  130. package/dist/gitGraph-TEB2WS4Q-BbtF3MDr.cjs +1 -0
  131. package/dist/gitGraph-TEB2WS4Q-D6Ru11Cs.js +5 -0
  132. package/dist/gitGraphDiagram-IHSO6WYX-BUJNSssA.js +754 -0
  133. package/dist/gitGraphDiagram-IHSO6WYX-DW06165m.cjs +106 -0
  134. package/dist/glass-BniIptBE.js +115 -0
  135. package/dist/glass.js +5 -0
  136. package/dist/graphlib-CCKThIKP.js +1104 -0
  137. package/dist/graphlib-Du-578Js.cjs +1 -0
  138. package/dist/{icon-C_ENrJ3F.js → icon-GZrfSeon.js} +77 -25
  139. package/dist/icon.js +1 -1
  140. package/dist/icons.js +1 -1
  141. package/dist/iife/button.iife.js +1 -1
  142. package/dist/iife/card.iife.js +1 -1
  143. package/dist/iife/checkbox.iife.js +1 -1
  144. package/dist/iife/colorpicker.iife.js +2 -2
  145. package/dist/iife/content.iife.js +1 -0
  146. package/dist/iife/dropdown.iife.js +1 -1
  147. package/dist/iife/form.iife.js +1 -1
  148. package/dist/iife/glass.iife.js +1 -0
  149. package/dist/iife/icon.iife.js +1 -1
  150. package/dist/iife/image.iife.js +1 -1
  151. package/dist/iife/input.iife.js +1 -1
  152. package/dist/iife/loading.iife.js +1 -1
  153. package/dist/iife/math.iife.js +14 -14
  154. package/dist/iife/mermaid.iife.js +3535 -0
  155. package/dist/iife/message.iife.js +1 -1
  156. package/dist/iife/modal.iife.js +1 -1
  157. package/dist/iife/player.iife.js +8 -8
  158. package/dist/iife/popover.iife.js +1 -1
  159. package/dist/iife/progress.iife.js +1 -1
  160. package/dist/iife/radar.iife.js +1 -1
  161. package/dist/iife/route.iife.js +1 -1
  162. package/dist/iife/router.iife.js +1 -1
  163. package/dist/iife/scratch.iife.js +1 -1
  164. package/dist/iife/section.iife.js +1 -1
  165. package/dist/iife/select.iife.js +2 -2
  166. package/dist/iife/skeleton.iife.js +1 -1
  167. package/dist/iife/tab.iife.js +1 -1
  168. package/dist/iife/tabpane.iife.js +1 -1
  169. package/dist/iife/theme-switch.iife.js +1 -1
  170. package/dist/{image-B7MBI5n_.js → image-CqoQfJoV.js} +4 -4
  171. package/dist/image.js +1 -1
  172. package/dist/index.cjs +38 -37
  173. package/dist/index.d.ts +8 -0
  174. package/dist/index.iife.js +3623 -88
  175. package/dist/index.js +88 -84
  176. package/dist/info-DKCQHKI2-DNOtUIin.cjs +1 -0
  177. package/dist/info-DKCQHKI2-Df7h9MSE.js +5 -0
  178. package/dist/infoDiagram-FWYZ7A6U-C8dZc-Ki.cjs +2 -0
  179. package/dist/infoDiagram-FWYZ7A6U-Dc0m9qAx.js +21 -0
  180. package/dist/init-1VpIn1S3.js +16 -0
  181. package/dist/init-CbDwVtpO.cjs +1 -0
  182. package/dist/{input-RNqdEHPf.js → input-BlwAXu7I.js} +6 -6
  183. package/dist/input.js +1 -1
  184. package/dist/ishikawaDiagram-FXEZZL3T-BugNyysB.cjs +70 -0
  185. package/dist/ishikawaDiagram-FXEZZL3T-DuFtHOmf.js +742 -0
  186. package/dist/journeyDiagram-5HDEW3XC-Bshelnhq.js +928 -0
  187. package/dist/journeyDiagram-5HDEW3XC-ItmURvA2.cjs +139 -0
  188. package/dist/kanban-definition-HUTT4EX6-BL512R2A.cjs +89 -0
  189. package/dist/kanban-definition-HUTT4EX6-Dogv2paU.js +1050 -0
  190. package/dist/katex-Cq3Y8cmK.cjs +257 -0
  191. package/dist/katex-Pg2EqTH0.js +23485 -0
  192. package/dist/line-BIPmUVxO.js +33 -0
  193. package/dist/line-CAB5QHC6.cjs +1 -0
  194. package/dist/linear-B2AM4ZBe.js +259 -0
  195. package/dist/linear-CSAfNEpl.cjs +1 -0
  196. package/dist/{link-DURZzd7u.js → link-BCrmHvXP.js} +3 -3
  197. package/dist/link.js +1 -1
  198. package/dist/{loading-B9MFI03l.js → loading-M6gWxLbm.js} +4 -4
  199. package/dist/loading.js +1 -1
  200. package/dist/map-BC2bk_rV.cjs +1 -0
  201. package/dist/map-DMSWkcq6.js +208 -0
  202. package/dist/{math-CudIwEXZ.js → math-8E-45Y8e.js} +4 -4
  203. package/dist/math.js +1 -1
  204. package/dist/mermaid-C1oQyPE3.js +261 -0
  205. package/dist/mermaid-parser.core-DYumW1vq.cjs +6 -0
  206. package/dist/mermaid-parser.core-uIDZYuBu.js +654 -0
  207. package/dist/mermaid.core-B2d5lQW2.js +1085 -0
  208. package/dist/mermaid.core-a1hgpWfs.cjs +10 -0
  209. package/dist/mermaid.js +5 -0
  210. package/dist/{message-DW7qWpEm.js → message-CNdmbeLf.js} +6 -6
  211. package/dist/message.js +1 -1
  212. package/dist/mindmap-definition-LN4V7U3C-DYZgIZym.cjs +96 -0
  213. package/dist/mindmap-definition-LN4V7U3C-f7s5ZePP.js +1070 -0
  214. package/dist/{modal-CrvGKL2B.js → modal-gRagDkTb.js} +40 -24
  215. package/dist/modal.js +1 -1
  216. package/dist/ordinal-BMN81JG2.js +64 -0
  217. package/dist/ordinal-BplLHIij.cjs +1 -0
  218. package/dist/packet-7NZHBO7P-4PLslLZJ.js +5 -0
  219. package/dist/packet-7NZHBO7P-DeyLCrSn.cjs +1 -0
  220. package/dist/path-Bja5PoYn.js +82 -0
  221. package/dist/path-DmfWsuKi.cjs +1 -0
  222. package/dist/pegDiagram-2B236MQR-B-Xeh55J.js +107 -0
  223. package/dist/pegDiagram-2B236MQR-Bo5Nj40u.cjs +1 -0
  224. package/dist/pie-RZYD4A2V-DBE9a8Kz.js +5 -0
  225. package/dist/pie-RZYD4A2V-pDNZ2ZyB.cjs +1 -0
  226. package/dist/pieDiagram-ENE6RG2P-BkSiP4iu.cjs +39 -0
  227. package/dist/pieDiagram-ENE6RG2P-CVSE95zc.js +207 -0
  228. package/dist/{player-BKQaaT7o.js → player-CAQ5Og2P.js} +196 -195
  229. package/dist/player.js +1 -1
  230. package/dist/{popover-CvYIVgUS.js → popover-BZKSLe3D.js} +22 -54
  231. package/dist/popover.js +1 -1
  232. package/dist/{progress-C6jctsFH.js → progress-vk40tuhm.js} +5 -5
  233. package/dist/progress.js +1 -1
  234. package/dist/quadrantDiagram-ABIIQ3AL-BDmdDGsh.cjs +7 -0
  235. package/dist/quadrantDiagram-ABIIQ3AL-TJ8FmqES.js +2058 -0
  236. package/dist/{radar-BUb4EzmG.js → radar-Bg0cexzU.js} +5 -5
  237. package/dist/radar-I7S5WNFK-CY5ycn2a.cjs +1 -0
  238. package/dist/radar-I7S5WNFK-DFTxtd_t.js +5 -0
  239. package/dist/radar.js +1 -1
  240. package/dist/railroad-3IZDKUUU-DALJwv16.js +5 -0
  241. package/dist/railroad-3IZDKUUU-DGzXHqt7.cjs +1 -0
  242. package/dist/railroad-abnf-AHOZXSZD-BCIHdSw6.cjs +1 -0
  243. package/dist/railroad-abnf-AHOZXSZD-CntW2udQ.js +5 -0
  244. package/dist/railroad-ebnf-EBAXGLYW-4vFZrfHF.cjs +1 -0
  245. package/dist/railroad-ebnf-EBAXGLYW-s_1ZOb_9.js +5 -0
  246. package/dist/railroad-peg-LSFZ7HO6-CaM5A0Ml.js +5 -0
  247. package/dist/railroad-peg-LSFZ7HO6-D_oFW1Bo.cjs +1 -0
  248. package/dist/railroadDiagram-RFXS5EU6-0lS5wYI7.js +83 -0
  249. package/dist/railroadDiagram-RFXS5EU6-DJKAtnQk.cjs +1 -0
  250. package/dist/ranui.css +1 -1
  251. package/dist/requirementDiagram-TGXJPOKE-Bg701bNl.cjs +84 -0
  252. package/dist/requirementDiagram-TGXJPOKE-viCQLyJd.js +2301 -0
  253. package/dist/rolldown-runtime-9ZSF5uba.js +16 -0
  254. package/dist/rolldown-runtime-CAnuVJ4g.cjs +1 -0
  255. package/dist/rough.esm-BWe9E0Nz.js +1387 -0
  256. package/dist/rough.esm-BfSi6CZE.cjs +1 -0
  257. package/dist/{route-Djrf9UR_.js → route-CGwS0cd_.js} +10 -10
  258. package/dist/route.js +1 -1
  259. package/dist/{router-BU2KhtxV.js → router-BK6DEkcN.js} +5 -5
  260. package/dist/router.js +1 -1
  261. package/dist/sankeyDiagram-HTMAVEWB-CV6_AuMF.js +974 -0
  262. package/dist/sankeyDiagram-HTMAVEWB-K-nGMsuS.cjs +40 -0
  263. package/dist/{scratch-CO4I2dIa.js → scratch-ClF1awGi.js} +2 -2
  264. package/dist/scratch.js +1 -1
  265. package/dist/{section-CsUkp8bv.js → section-BL0V7Kjf.js} +2 -2
  266. package/dist/section.js +1 -1
  267. package/dist/{select-Dn26ajJZ.js → select-BIFVbQIj.js} +13 -13
  268. package/dist/select.js +1 -1
  269. package/dist/sequenceDiagram-DBY2YBRQ-4GdkLnUr.cjs +162 -0
  270. package/dist/sequenceDiagram-DBY2YBRQ-B9WNesh2.js +4326 -0
  271. package/dist/sizeCapture-X5ZJPWSS-BUY3-n09.cjs +1 -0
  272. package/dist/sizeCapture-X5ZJPWSS-D7rGsqTl.js +48 -0
  273. package/dist/{skeleton-BuMLhvzQ.js → skeleton-D7JIbROq.js} +5 -5
  274. package/dist/skeleton.js +1 -1
  275. package/dist/src-C9EhKhbk.cjs +1 -0
  276. package/dist/src-DtRLxcYO.js +2104 -0
  277. package/dist/stateDiagram-2N3HPSRC-B7VpgjJu.cjs +1 -0
  278. package/dist/stateDiagram-2N3HPSRC-DxH4BMSh.js +237 -0
  279. package/dist/stateDiagram-v2-6OUMAXLB-CQv7GIaO.cjs +1 -0
  280. package/dist/stateDiagram-v2-6OUMAXLB-CWfn6e7n.js +30 -0
  281. package/dist/swimlanes-5IMT3BWC-DcADNGpg.js +5258 -0
  282. package/dist/swimlanes-5IMT3BWC-o-MjdPlw.cjs +1 -0
  283. package/dist/swimlanesDiagram-G3AALYLV-D-rmAGky.cjs +8 -0
  284. package/dist/swimlanesDiagram-G3AALYLV-DDtDtl1L.js +31 -0
  285. package/dist/{tab-40fDkuox.js → tab-DFVtDJb2.js} +5 -5
  286. package/dist/tab.js +1 -1
  287. package/dist/{tabpane-F4Pd7JtC.js → tabpane-C3qZGN-D.js} +5 -5
  288. package/dist/tabpane.js +1 -1
  289. package/dist/test/ssr/stream.test.d.ts +1 -0
  290. package/dist/{theme-switch-B09egc6h.js → theme-switch-BXNH5uPD.js} +45 -45
  291. package/dist/theme-switch.js +1 -1
  292. package/dist/timeline-definition-FHXFAJF6-C80VjPLh.js +1119 -0
  293. package/dist/timeline-definition-FHXFAJF6-DOwvOb3S.cjs +120 -0
  294. package/dist/treeView-QDETBFTQ-B1Ejxfpg.cjs +1 -0
  295. package/dist/treeView-QDETBFTQ-vTKOZls1.js +5 -0
  296. package/dist/treemap-6X3UGDF4-D0FeO_NX.cjs +1 -0
  297. package/dist/treemap-6X3UGDF4-Ddzv6Gqd.js +5 -0
  298. package/dist/utils/builder/core.d.ts +135 -3
  299. package/dist/utils/builder/index.d.ts +1 -1
  300. package/dist/{utils-DBfrRFoE.js → utils-D1iZnChu.js} +38 -31
  301. package/dist/vennDiagram-L72KCM5P-BYHB7OW8.js +1955 -0
  302. package/dist/vennDiagram-L72KCM5P-CidVJK6y.cjs +34 -0
  303. package/dist/wardley-OPB4EBWU-C1hXbbD4.cjs +1 -0
  304. package/dist/wardley-OPB4EBWU-DBgFLc64.js +5 -0
  305. package/dist/wardleyDiagram-EHGQE667--ubmCaWM.js +652 -0
  306. package/dist/wardleyDiagram-EHGQE667-K6ckkRZS.cjs +78 -0
  307. package/dist/xychartDiagram-FW5EYKEG-CzdokxrM.cjs +7 -0
  308. package/dist/xychartDiagram-FW5EYKEG-DLqWcTPt.js +2154 -0
  309. package/docs/BUILDER.md +170 -2
  310. package/package.json +7 -1
  311. package/dist/button-BfYw0fes.js +0 -117
  312. package/dist/factory-DCrO37si.js +0 -334
@@ -0,0 +1,4279 @@
1
+ import { n as Ve, t as de } from "./rolldown-runtime-9ZSF5uba.js";
2
+ import { n as ze } from "./mermaid-parser.core-uIDZYuBu.js";
3
+ import { n as lt } from "./chunk-Y2CYZVJY-0JxdZxki.js";
4
+ import { m as De, p as $e } from "./src-DtRLxcYO.js";
5
+ import { H as Be, J as Ze, K as ke, U as Qe, a as qe, b as Je, f as Ke, v as je, w as _e, x as ve, y as tr, z as er } from "./chunk-WYO6CB5R-DDHkKowO.js";
6
+ import { c as rr, i as ir } from "./chunk-ICXQ74PX-DR8rL-xF.js";
7
+ import { t as ar } from "./chunk-VAUOI2AC-izt0o4id.js";
8
+ import { t as nr } from "./chunk-JWPE2WC7-CGEmUMMZ.js";
9
+ import { i as or, r as sr, t as ce } from "./chunk-HOUHSVGY-DRQcQeMT.js";
10
+ import { n as pe } from "./chunk-Q4XR5HBZ-3BHjjc9u.js";
11
+ import { t as xe } from "./cytoscape.esm-CFq1_DTa.js";
12
+ var we = /* @__PURE__ */ de(((L, F) => {
13
+ (function(U, N) {
14
+ typeof L == "object" && typeof F == "object" ? F.exports = N() : typeof define == "function" && define.amd ? define([], N) : typeof L == "object" ? L.layoutBase = N() : U.layoutBase = N();
15
+ })(L, function() {
16
+ return (function(w) {
17
+ var U = {};
18
+ function N(v) {
19
+ if (U[v]) return U[v].exports;
20
+ var s = U[v] = {
21
+ i: v,
22
+ l: !1,
23
+ exports: {}
24
+ };
25
+ return w[v].call(s.exports, s, s.exports, N), s.l = !0, s.exports;
26
+ }
27
+ return N.m = w, N.c = U, N.i = function(v) {
28
+ return v;
29
+ }, N.d = function(v, s, n) {
30
+ N.o(v, s) || Object.defineProperty(v, s, {
31
+ configurable: !1,
32
+ enumerable: !0,
33
+ get: n
34
+ });
35
+ }, N.n = function(v) {
36
+ var s = v && v.__esModule ? function() {
37
+ return v.default;
38
+ } : function() {
39
+ return v;
40
+ };
41
+ return N.d(s, "a", s), s;
42
+ }, N.o = function(v, s) {
43
+ return Object.prototype.hasOwnProperty.call(v, s);
44
+ }, N.p = "", N(N.s = 28);
45
+ })([
46
+ (function(w, U, N) {
47
+ "use strict";
48
+ function v() {
49
+ }
50
+ v.QUALITY = 1, v.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, v.DEFAULT_INCREMENTAL = !1, v.DEFAULT_ANIMATION_ON_LAYOUT = !0, v.DEFAULT_ANIMATION_DURING_LAYOUT = !1, v.DEFAULT_ANIMATION_PERIOD = 50, v.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, v.DEFAULT_GRAPH_MARGIN = 15, v.NODE_DIMENSIONS_INCLUDE_LABELS = !1, v.SIMPLE_NODE_SIZE = 40, v.SIMPLE_NODE_HALF_SIZE = v.SIMPLE_NODE_SIZE / 2, v.EMPTY_COMPOUND_NODE_SIZE = 40, v.MIN_EDGE_LENGTH = 1, v.WORLD_BOUNDARY = 1e6, v.INITIAL_WORLD_BOUNDARY = v.WORLD_BOUNDARY / 1e3, v.WORLD_CENTER_X = 1200, v.WORLD_CENTER_Y = 900, w.exports = v;
51
+ }),
52
+ (function(w, U, N) {
53
+ "use strict";
54
+ var v = N(2), s = N(8), n = N(9);
55
+ function t(h, e, d) {
56
+ v.call(this, d), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = d, this.bendpoints = [], this.source = h, this.target = e;
57
+ }
58
+ t.prototype = Object.create(v.prototype);
59
+ for (var a in v) t[a] = v[a];
60
+ t.prototype.getSource = function() {
61
+ return this.source;
62
+ }, t.prototype.getTarget = function() {
63
+ return this.target;
64
+ }, t.prototype.isInterGraph = function() {
65
+ return this.isInterGraph;
66
+ }, t.prototype.getLength = function() {
67
+ return this.length;
68
+ }, t.prototype.isOverlapingSourceAndTarget = function() {
69
+ return this.isOverlapingSourceAndTarget;
70
+ }, t.prototype.getBendpoints = function() {
71
+ return this.bendpoints;
72
+ }, t.prototype.getLca = function() {
73
+ return this.lca;
74
+ }, t.prototype.getSourceInLca = function() {
75
+ return this.sourceInLca;
76
+ }, t.prototype.getTargetInLca = function() {
77
+ return this.targetInLca;
78
+ }, t.prototype.getOtherEnd = function(h) {
79
+ if (this.source === h) return this.target;
80
+ if (this.target === h) return this.source;
81
+ throw "Node is not incident with this edge";
82
+ }, t.prototype.getOtherEndInGraph = function(h, e) {
83
+ for (var d = this.getOtherEnd(h), r = e.getGraphManager().getRoot(); ; ) {
84
+ if (d.getOwner() == e) return d;
85
+ if (d.getOwner() == r) break;
86
+ d = d.getOwner().getParent();
87
+ }
88
+ return null;
89
+ }, t.prototype.updateLength = function() {
90
+ var h = new Array(4);
91
+ this.isOverlapingSourceAndTarget = s.getIntersection(this.target.getRect(), this.source.getRect(), h), this.isOverlapingSourceAndTarget || (this.lengthX = h[0] - h[2], this.lengthY = h[1] - h[3], Math.abs(this.lengthX) < 1 && (this.lengthX = n.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = n.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
92
+ }, t.prototype.updateLengthSimple = function() {
93
+ this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = n.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = n.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
94
+ }, w.exports = t;
95
+ }),
96
+ (function(w, U, N) {
97
+ "use strict";
98
+ function v(s) {
99
+ this.vGraphObject = s;
100
+ }
101
+ w.exports = v;
102
+ }),
103
+ (function(w, U, N) {
104
+ "use strict";
105
+ var v = N(2), s = N(10), n = N(13), t = N(0), a = N(16), h = N(5);
106
+ function e(r, i, f, l) {
107
+ f == null && l == null && (l = i), v.call(this, l), r.graphManager != null && (r = r.graphManager), this.estimatedSize = s.MIN_VALUE, this.inclusionTreeDepth = s.MAX_VALUE, this.vGraphObject = l, this.edges = [], this.graphManager = r, f != null && i != null ? this.rect = new n(i.x, i.y, f.width, f.height) : this.rect = new n();
108
+ }
109
+ e.prototype = Object.create(v.prototype);
110
+ for (var d in v) e[d] = v[d];
111
+ e.prototype.getEdges = function() {
112
+ return this.edges;
113
+ }, e.prototype.getChild = function() {
114
+ return this.child;
115
+ }, e.prototype.getOwner = function() {
116
+ return this.owner;
117
+ }, e.prototype.getWidth = function() {
118
+ return this.rect.width;
119
+ }, e.prototype.setWidth = function(r) {
120
+ this.rect.width = r;
121
+ }, e.prototype.getHeight = function() {
122
+ return this.rect.height;
123
+ }, e.prototype.setHeight = function(r) {
124
+ this.rect.height = r;
125
+ }, e.prototype.getCenterX = function() {
126
+ return this.rect.x + this.rect.width / 2;
127
+ }, e.prototype.getCenterY = function() {
128
+ return this.rect.y + this.rect.height / 2;
129
+ }, e.prototype.getCenter = function() {
130
+ return new h(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
131
+ }, e.prototype.getLocation = function() {
132
+ return new h(this.rect.x, this.rect.y);
133
+ }, e.prototype.getRect = function() {
134
+ return this.rect;
135
+ }, e.prototype.getDiagonal = function() {
136
+ return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
137
+ }, e.prototype.getHalfTheDiagonal = function() {
138
+ return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
139
+ }, e.prototype.setRect = function(r, i) {
140
+ this.rect.x = r.x, this.rect.y = r.y, this.rect.width = i.width, this.rect.height = i.height;
141
+ }, e.prototype.setCenter = function(r, i) {
142
+ this.rect.x = r - this.rect.width / 2, this.rect.y = i - this.rect.height / 2;
143
+ }, e.prototype.setLocation = function(r, i) {
144
+ this.rect.x = r, this.rect.y = i;
145
+ }, e.prototype.moveBy = function(r, i) {
146
+ this.rect.x += r, this.rect.y += i;
147
+ }, e.prototype.getEdgeListToNode = function(r) {
148
+ var i = [], f = this;
149
+ return f.edges.forEach(function(l) {
150
+ if (l.target == r) {
151
+ if (l.source != f) throw "Incorrect edge source!";
152
+ i.push(l);
153
+ }
154
+ }), i;
155
+ }, e.prototype.getEdgesBetween = function(r) {
156
+ var i = [], f = this;
157
+ return f.edges.forEach(function(l) {
158
+ if (!(l.source == f || l.target == f)) throw "Incorrect edge source and/or target";
159
+ (l.target == r || l.source == r) && i.push(l);
160
+ }), i;
161
+ }, e.prototype.getNeighborsList = function() {
162
+ var r = /* @__PURE__ */ new Set(), i = this;
163
+ return i.edges.forEach(function(f) {
164
+ if (f.source == i) r.add(f.target);
165
+ else {
166
+ if (f.target != i) throw "Incorrect incidency!";
167
+ r.add(f.source);
168
+ }
169
+ }), r;
170
+ }, e.prototype.withChildren = function() {
171
+ var r = /* @__PURE__ */ new Set(), i, f;
172
+ if (r.add(this), this.child != null)
173
+ for (var l = this.child.getNodes(), p = 0; p < l.length; p++)
174
+ i = l[p], f = i.withChildren(), f.forEach(function(g) {
175
+ r.add(g);
176
+ });
177
+ return r;
178
+ }, e.prototype.getNoOfChildren = function() {
179
+ var r = 0, i;
180
+ if (this.child == null) r = 1;
181
+ else
182
+ for (var f = this.child.getNodes(), l = 0; l < f.length; l++)
183
+ i = f[l], r += i.getNoOfChildren();
184
+ return r == 0 && (r = 1), r;
185
+ }, e.prototype.getEstimatedSize = function() {
186
+ if (this.estimatedSize == s.MIN_VALUE) throw "assert failed";
187
+ return this.estimatedSize;
188
+ }, e.prototype.calcEstimatedSize = function() {
189
+ 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);
190
+ }, e.prototype.scatter = function() {
191
+ var r, i, f = -t.INITIAL_WORLD_BOUNDARY, l = t.INITIAL_WORLD_BOUNDARY;
192
+ r = t.WORLD_CENTER_X + a.nextDouble() * (l - f) + f;
193
+ var p = -t.INITIAL_WORLD_BOUNDARY, g = t.INITIAL_WORLD_BOUNDARY;
194
+ i = t.WORLD_CENTER_Y + a.nextDouble() * (g - p) + p, this.rect.x = r, this.rect.y = i;
195
+ }, e.prototype.updateBounds = function() {
196
+ if (this.getChild() == null) throw "assert failed";
197
+ if (this.getChild().getNodes().length != 0) {
198
+ var r = this.getChild();
199
+ if (r.updateBounds(!0), this.rect.x = r.getLeft(), this.rect.y = r.getTop(), this.setWidth(r.getRight() - r.getLeft()), this.setHeight(r.getBottom() - r.getTop()), t.NODE_DIMENSIONS_INCLUDE_LABELS) {
200
+ var i = r.getRight() - r.getLeft(), f = r.getBottom() - r.getTop();
201
+ this.labelWidth && (this.labelPosHorizontal == "left" ? (this.rect.x -= this.labelWidth, this.setWidth(i + this.labelWidth)) : this.labelPosHorizontal == "center" && this.labelWidth > i ? (this.rect.x -= (this.labelWidth - i) / 2, this.setWidth(this.labelWidth)) : this.labelPosHorizontal == "right" && this.setWidth(i + this.labelWidth)), this.labelHeight && (this.labelPosVertical == "top" ? (this.rect.y -= this.labelHeight, this.setHeight(f + this.labelHeight)) : this.labelPosVertical == "center" && this.labelHeight > f ? (this.rect.y -= (this.labelHeight - f) / 2, this.setHeight(this.labelHeight)) : this.labelPosVertical == "bottom" && this.setHeight(f + this.labelHeight));
202
+ }
203
+ }
204
+ }, e.prototype.getInclusionTreeDepth = function() {
205
+ if (this.inclusionTreeDepth == s.MAX_VALUE) throw "assert failed";
206
+ return this.inclusionTreeDepth;
207
+ }, e.prototype.transform = function(r) {
208
+ var i = this.rect.x;
209
+ i > t.WORLD_BOUNDARY ? i = t.WORLD_BOUNDARY : i < -t.WORLD_BOUNDARY && (i = -t.WORLD_BOUNDARY);
210
+ var f = this.rect.y;
211
+ f > t.WORLD_BOUNDARY ? f = t.WORLD_BOUNDARY : f < -t.WORLD_BOUNDARY && (f = -t.WORLD_BOUNDARY);
212
+ var l = new h(i, f), p = r.inverseTransformPoint(l);
213
+ this.setLocation(p.x, p.y);
214
+ }, e.prototype.getLeft = function() {
215
+ return this.rect.x;
216
+ }, e.prototype.getRight = function() {
217
+ return this.rect.x + this.rect.width;
218
+ }, e.prototype.getTop = function() {
219
+ return this.rect.y;
220
+ }, e.prototype.getBottom = function() {
221
+ return this.rect.y + this.rect.height;
222
+ }, e.prototype.getParent = function() {
223
+ return this.owner == null ? null : this.owner.getParent();
224
+ }, w.exports = e;
225
+ }),
226
+ (function(w, U, N) {
227
+ "use strict";
228
+ var v = N(0);
229
+ function s() {
230
+ }
231
+ for (var n in v) s[n] = v[n];
232
+ s.MAX_ITERATIONS = 2500, s.DEFAULT_EDGE_LENGTH = 50, s.DEFAULT_SPRING_STRENGTH = 0.45, s.DEFAULT_REPULSION_STRENGTH = 4500, s.DEFAULT_GRAVITY_STRENGTH = 0.4, s.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, s.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, s.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, s.COOLING_ADAPTATION_FACTOR = 0.33, s.ADAPTATION_LOWER_NODE_LIMIT = 1e3, s.ADAPTATION_UPPER_NODE_LIMIT = 5e3, s.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, s.MAX_NODE_DISPLACEMENT = s.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, s.MIN_REPULSION_DIST = s.DEFAULT_EDGE_LENGTH / 10, s.CONVERGENCE_CHECK_PERIOD = 100, s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, s.MIN_EDGE_LENGTH = 1, s.GRID_CALCULATION_CHECK_PERIOD = 10, w.exports = s;
233
+ }),
234
+ (function(w, U, N) {
235
+ "use strict";
236
+ function v(s, n) {
237
+ s == null && n == null ? (this.x = 0, this.y = 0) : (this.x = s, this.y = n);
238
+ }
239
+ v.prototype.getX = function() {
240
+ return this.x;
241
+ }, v.prototype.getY = function() {
242
+ return this.y;
243
+ }, v.prototype.setX = function(s) {
244
+ this.x = s;
245
+ }, v.prototype.setY = function(s) {
246
+ this.y = s;
247
+ }, v.prototype.getDifference = function(s) {
248
+ return new DimensionD(this.x - s.x, this.y - s.y);
249
+ }, v.prototype.getCopy = function() {
250
+ return new v(this.x, this.y);
251
+ }, v.prototype.translate = function(s) {
252
+ return this.x += s.width, this.y += s.height, this;
253
+ }, w.exports = v;
254
+ }),
255
+ (function(w, U, N) {
256
+ "use strict";
257
+ var v = N(2), s = N(10), n = N(0), t = N(7), a = N(3), h = N(1), e = N(13), d = N(12), r = N(11);
258
+ function i(l, p, g) {
259
+ v.call(this, g), this.estimatedSize = s.MIN_VALUE, this.margin = n.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = l, p != null && p instanceof t ? this.graphManager = p : p != null && p instanceof Layout && (this.graphManager = p.graphManager);
260
+ }
261
+ i.prototype = Object.create(v.prototype);
262
+ for (var f in v) i[f] = v[f];
263
+ i.prototype.getNodes = function() {
264
+ return this.nodes;
265
+ }, i.prototype.getEdges = function() {
266
+ return this.edges;
267
+ }, i.prototype.getGraphManager = function() {
268
+ return this.graphManager;
269
+ }, i.prototype.getParent = function() {
270
+ return this.parent;
271
+ }, i.prototype.getLeft = function() {
272
+ return this.left;
273
+ }, i.prototype.getRight = function() {
274
+ return this.right;
275
+ }, i.prototype.getTop = function() {
276
+ return this.top;
277
+ }, i.prototype.getBottom = function() {
278
+ return this.bottom;
279
+ }, i.prototype.isConnected = function() {
280
+ return this.isConnected;
281
+ }, i.prototype.add = function(l, p, g) {
282
+ if (p == null && g == null) {
283
+ var c = l;
284
+ if (this.graphManager == null) throw "Graph has no graph mgr!";
285
+ if (this.getNodes().indexOf(c) > -1) throw "Node already in graph!";
286
+ return c.owner = this, this.getNodes().push(c), c;
287
+ } else {
288
+ var T = l;
289
+ if (!(this.getNodes().indexOf(p) > -1 && this.getNodes().indexOf(g) > -1)) throw "Source or target not in graph!";
290
+ if (!(p.owner == g.owner && p.owner == this)) throw "Both owners must be this graph!";
291
+ return p.owner != g.owner ? null : (T.source = p, T.target = g, T.isInterGraph = !1, this.getEdges().push(T), p.edges.push(T), g != p && g.edges.push(T), T);
292
+ }
293
+ }, i.prototype.remove = function(l) {
294
+ var p = l;
295
+ if (l instanceof a) {
296
+ if (p == null) throw "Node is null!";
297
+ if (!(p.owner != null && p.owner == this)) throw "Owner graph is invalid!";
298
+ if (this.graphManager == null) throw "Owner graph manager is invalid!";
299
+ for (var g = p.edges.slice(), c, T = g.length, A = 0; A < T; A++)
300
+ c = g[A], c.isInterGraph ? this.graphManager.remove(c) : c.source.owner.remove(c);
301
+ var I = this.nodes.indexOf(p);
302
+ if (I == -1) throw "Node not in owner node list!";
303
+ this.nodes.splice(I, 1);
304
+ } else if (l instanceof h) {
305
+ var c = l;
306
+ if (c == null) throw "Edge is null!";
307
+ if (!(c.source != null && c.target != null)) throw "Source and/or target is null!";
308
+ if (!(c.source.owner != null && c.target.owner != null && c.source.owner == this && c.target.owner == this)) throw "Source and/or target owner is invalid!";
309
+ var S = c.source.edges.indexOf(c), Y = c.target.edges.indexOf(c);
310
+ if (!(S > -1 && Y > -1)) throw "Source and/or target doesn't know this edge!";
311
+ c.source.edges.splice(S, 1), c.target != c.source && c.target.edges.splice(Y, 1);
312
+ var I = c.source.owner.getEdges().indexOf(c);
313
+ if (I == -1) throw "Not in owner's edge list!";
314
+ c.source.owner.getEdges().splice(I, 1);
315
+ }
316
+ }, i.prototype.updateLeftTop = function() {
317
+ for (var l = s.MAX_VALUE, p = s.MAX_VALUE, g, c, T, A = this.getNodes(), I = A.length, S = 0; S < I; S++) {
318
+ var Y = A[S];
319
+ g = Y.getTop(), c = Y.getLeft(), l > g && (l = g), p > c && (p = c);
320
+ }
321
+ return l == s.MAX_VALUE ? null : (A[0].getParent().paddingLeft != null ? T = A[0].getParent().paddingLeft : T = this.margin, this.left = p - T, this.top = l - T, new d(this.left, this.top));
322
+ }, i.prototype.updateBounds = function(l) {
323
+ for (var p = s.MAX_VALUE, g = -s.MAX_VALUE, c = s.MAX_VALUE, T = -s.MAX_VALUE, A, I, S, Y, V, z = this.nodes, x = z.length, tt = 0; tt < x; tt++) {
324
+ var o = z[tt];
325
+ l && o.child != null && o.updateBounds(), A = o.getLeft(), I = o.getRight(), S = o.getTop(), Y = o.getBottom(), p > A && (p = A), g < I && (g = I), c > S && (c = S), T < Y && (T = Y);
326
+ }
327
+ var m = new e(p, c, g - p, T - c);
328
+ p == s.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), z[0].getParent().paddingLeft != null ? V = z[0].getParent().paddingLeft : V = this.margin, this.left = m.x - V, this.right = m.x + m.width + V, this.top = m.y - V, this.bottom = m.y + m.height + V;
329
+ }, i.calculateBounds = function(l) {
330
+ for (var p = s.MAX_VALUE, g = -s.MAX_VALUE, c = s.MAX_VALUE, T = -s.MAX_VALUE, A, I, S, Y, V = l.length, z = 0; z < V; z++) {
331
+ var x = l[z];
332
+ A = x.getLeft(), I = x.getRight(), S = x.getTop(), Y = x.getBottom(), p > A && (p = A), g < I && (g = I), c > S && (c = S), T < Y && (T = Y);
333
+ }
334
+ return new e(p, c, g - p, T - c);
335
+ }, i.prototype.getInclusionTreeDepth = function() {
336
+ return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
337
+ }, i.prototype.getEstimatedSize = function() {
338
+ if (this.estimatedSize == s.MIN_VALUE) throw "assert failed";
339
+ return this.estimatedSize;
340
+ }, i.prototype.calcEstimatedSize = function() {
341
+ for (var l = 0, p = this.nodes, g = p.length, c = 0; c < g; c++) {
342
+ var T = p[c];
343
+ l += T.calcEstimatedSize();
344
+ }
345
+ return l == 0 ? this.estimatedSize = n.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = l / Math.sqrt(this.nodes.length), this.estimatedSize;
346
+ }, i.prototype.updateConnected = function() {
347
+ var l = this;
348
+ if (this.nodes.length == 0) {
349
+ this.isConnected = !0;
350
+ return;
351
+ }
352
+ var p = new r(), g = /* @__PURE__ */ new Set(), c = this.nodes[0], T, A;
353
+ for (c.withChildren().forEach(function(V) {
354
+ p.push(V), g.add(V);
355
+ }); p.length !== 0; ) {
356
+ c = p.shift(), T = c.getEdges();
357
+ for (var I = T.length, S = 0; S < I; S++)
358
+ A = T[S].getOtherEndInGraph(c, this), A != null && !g.has(A) && A.withChildren().forEach(function(V) {
359
+ p.push(V), g.add(V);
360
+ });
361
+ }
362
+ if (this.isConnected = !1, g.size >= this.nodes.length) {
363
+ var Y = 0;
364
+ g.forEach(function(V) {
365
+ V.owner == l && Y++;
366
+ }), Y == this.nodes.length && (this.isConnected = !0);
367
+ }
368
+ }, w.exports = i;
369
+ }),
370
+ (function(w, U, N) {
371
+ "use strict";
372
+ var v, s = N(1);
373
+ function n(t) {
374
+ v = N(6), this.layout = t, this.graphs = [], this.edges = [];
375
+ }
376
+ n.prototype.addRoot = function() {
377
+ var t = this.layout.newGraph(), a = this.layout.newNode(null), h = this.add(t, a);
378
+ return this.setRootGraph(h), this.rootGraph;
379
+ }, n.prototype.add = function(t, a, h, e, d) {
380
+ if (h == null && e == null && d == null) {
381
+ if (t == null) throw "Graph is null!";
382
+ if (a == null) throw "Parent node is null!";
383
+ if (this.graphs.indexOf(t) > -1) throw "Graph already in this graph mgr!";
384
+ if (this.graphs.push(t), t.parent != null) throw "Already has a parent!";
385
+ if (a.child != null) throw "Already has a child!";
386
+ return t.parent = a, a.child = t, t;
387
+ } else {
388
+ d = h, e = a, h = t;
389
+ var r = e.getOwner(), i = d.getOwner();
390
+ if (!(r != null && r.getGraphManager() == this)) throw "Source not in this graph mgr!";
391
+ if (!(i != null && i.getGraphManager() == this)) throw "Target not in this graph mgr!";
392
+ if (r == i)
393
+ return h.isInterGraph = !1, r.add(h, e, d);
394
+ if (h.isInterGraph = !0, h.source = e, h.target = d, this.edges.indexOf(h) > -1) throw "Edge already in inter-graph edge list!";
395
+ if (this.edges.push(h), !(h.source != null && h.target != null)) throw "Edge source and/or target is null!";
396
+ if (!(h.source.edges.indexOf(h) == -1 && h.target.edges.indexOf(h) == -1)) throw "Edge already in source and/or target incidency list!";
397
+ return h.source.edges.push(h), h.target.edges.push(h), h;
398
+ }
399
+ }, n.prototype.remove = function(t) {
400
+ if (t instanceof v) {
401
+ var a = t;
402
+ if (a.getGraphManager() != this) throw "Graph not in this graph mgr";
403
+ if (!(a == this.rootGraph || a.parent != null && a.parent.graphManager == this)) throw "Invalid parent node!";
404
+ var h = [];
405
+ h = h.concat(a.getEdges());
406
+ for (var e, d = h.length, r = 0; r < d; r++)
407
+ e = h[r], a.remove(e);
408
+ var i = [];
409
+ i = i.concat(a.getNodes());
410
+ var f;
411
+ d = i.length;
412
+ for (var r = 0; r < d; r++)
413
+ f = i[r], a.remove(f);
414
+ a == this.rootGraph && this.setRootGraph(null);
415
+ var l = this.graphs.indexOf(a);
416
+ this.graphs.splice(l, 1), a.parent = null;
417
+ } else if (t instanceof s) {
418
+ if (e = t, e == null) throw "Edge is null!";
419
+ if (!e.isInterGraph) throw "Not an inter-graph edge!";
420
+ if (!(e.source != null && e.target != null)) throw "Source and/or target is null!";
421
+ if (!(e.source.edges.indexOf(e) != -1 && e.target.edges.indexOf(e) != -1)) throw "Source and/or target doesn't know this edge!";
422
+ var l = e.source.edges.indexOf(e);
423
+ if (e.source.edges.splice(l, 1), l = e.target.edges.indexOf(e), e.target.edges.splice(l, 1), !(e.source.owner != null && e.source.owner.getGraphManager() != null)) throw "Edge owner graph or owner graph manager is null!";
424
+ if (e.source.owner.getGraphManager().edges.indexOf(e) == -1) throw "Not in owner graph manager's edge list!";
425
+ var l = e.source.owner.getGraphManager().edges.indexOf(e);
426
+ e.source.owner.getGraphManager().edges.splice(l, 1);
427
+ }
428
+ }, n.prototype.updateBounds = function() {
429
+ this.rootGraph.updateBounds(!0);
430
+ }, n.prototype.getGraphs = function() {
431
+ return this.graphs;
432
+ }, n.prototype.getAllNodes = function() {
433
+ if (this.allNodes == null) {
434
+ for (var t = [], a = this.getGraphs(), h = a.length, e = 0; e < h; e++) t = t.concat(a[e].getNodes());
435
+ this.allNodes = t;
436
+ }
437
+ return this.allNodes;
438
+ }, n.prototype.resetAllNodes = function() {
439
+ this.allNodes = null;
440
+ }, n.prototype.resetAllEdges = function() {
441
+ this.allEdges = null;
442
+ }, n.prototype.resetAllNodesToApplyGravitation = function() {
443
+ this.allNodesToApplyGravitation = null;
444
+ }, n.prototype.getAllEdges = function() {
445
+ if (this.allEdges == null) {
446
+ var t = [], a = this.getGraphs();
447
+ a.length;
448
+ for (var h = 0; h < a.length; h++) t = t.concat(a[h].getEdges());
449
+ t = t.concat(this.edges), this.allEdges = t;
450
+ }
451
+ return this.allEdges;
452
+ }, n.prototype.getAllNodesToApplyGravitation = function() {
453
+ return this.allNodesToApplyGravitation;
454
+ }, n.prototype.setAllNodesToApplyGravitation = function(t) {
455
+ if (this.allNodesToApplyGravitation != null) throw "assert failed";
456
+ this.allNodesToApplyGravitation = t;
457
+ }, n.prototype.getRoot = function() {
458
+ return this.rootGraph;
459
+ }, n.prototype.setRootGraph = function(t) {
460
+ if (t.getGraphManager() != this) throw "Root not in this graph mgr!";
461
+ this.rootGraph = t, t.parent == null && (t.parent = this.layout.newNode("Root node"));
462
+ }, n.prototype.getLayout = function() {
463
+ return this.layout;
464
+ }, n.prototype.isOneAncestorOfOther = function(t, a) {
465
+ if (!(t != null && a != null)) throw "assert failed";
466
+ if (t == a) return !0;
467
+ var h = t.getOwner(), e;
468
+ do {
469
+ if (e = h.getParent(), e == null) break;
470
+ if (e == a) return !0;
471
+ if (h = e.getOwner(), h == null) break;
472
+ } while (!0);
473
+ h = a.getOwner();
474
+ do {
475
+ if (e = h.getParent(), e == null) break;
476
+ if (e == t) return !0;
477
+ if (h = e.getOwner(), h == null) break;
478
+ } while (!0);
479
+ return !1;
480
+ }, n.prototype.calcLowestCommonAncestors = function() {
481
+ for (var t, a, h, e, d, r = this.getAllEdges(), i = r.length, f = 0; f < i; f++) {
482
+ if (t = r[f], a = t.source, h = t.target, t.lca = null, t.sourceInLca = a, t.targetInLca = h, a == h) {
483
+ t.lca = a.getOwner();
484
+ continue;
485
+ }
486
+ for (e = a.getOwner(); t.lca == null; ) {
487
+ for (t.targetInLca = h, d = h.getOwner(); t.lca == null; ) {
488
+ if (d == e) {
489
+ t.lca = d;
490
+ break;
491
+ }
492
+ if (d == this.rootGraph) break;
493
+ if (t.lca != null) throw "assert failed";
494
+ t.targetInLca = d.getParent(), d = t.targetInLca.getOwner();
495
+ }
496
+ if (e == this.rootGraph) break;
497
+ t.lca == null && (t.sourceInLca = e.getParent(), e = t.sourceInLca.getOwner());
498
+ }
499
+ if (t.lca == null) throw "assert failed";
500
+ }
501
+ }, n.prototype.calcLowestCommonAncestor = function(t, a) {
502
+ if (t == a) return t.getOwner();
503
+ var h = t.getOwner();
504
+ do {
505
+ if (h == null) break;
506
+ var e = a.getOwner();
507
+ do {
508
+ if (e == null) break;
509
+ if (e == h) return e;
510
+ e = e.getParent().getOwner();
511
+ } while (!0);
512
+ h = h.getParent().getOwner();
513
+ } while (!0);
514
+ return h;
515
+ }, n.prototype.calcInclusionTreeDepths = function(t, a) {
516
+ t == null && a == null && (t = this.rootGraph, a = 1);
517
+ for (var h, e = t.getNodes(), d = e.length, r = 0; r < d; r++)
518
+ h = e[r], h.inclusionTreeDepth = a, h.child != null && this.calcInclusionTreeDepths(h.child, a + 1);
519
+ }, n.prototype.includesInvalidEdge = function() {
520
+ for (var t, a = [], h = this.edges.length, e = 0; e < h; e++)
521
+ t = this.edges[e], this.isOneAncestorOfOther(t.source, t.target) && a.push(t);
522
+ for (var e = 0; e < a.length; e++) this.remove(a[e]);
523
+ return !1;
524
+ }, w.exports = n;
525
+ }),
526
+ (function(w, U, N) {
527
+ "use strict";
528
+ var v = N(12);
529
+ function s() {
530
+ }
531
+ s.calcSeparationAmount = function(n, t, a, h) {
532
+ if (!n.intersects(t)) throw "assert failed";
533
+ var e = new Array(2);
534
+ this.decideDirectionsForOverlappingNodes(n, t, e), a[0] = Math.min(n.getRight(), t.getRight()) - Math.max(n.x, t.x), a[1] = Math.min(n.getBottom(), t.getBottom()) - Math.max(n.y, t.y), n.getX() <= t.getX() && n.getRight() >= t.getRight() ? a[0] += Math.min(t.getX() - n.getX(), n.getRight() - t.getRight()) : t.getX() <= n.getX() && t.getRight() >= n.getRight() && (a[0] += Math.min(n.getX() - t.getX(), t.getRight() - n.getRight())), n.getY() <= t.getY() && n.getBottom() >= t.getBottom() ? a[1] += Math.min(t.getY() - n.getY(), n.getBottom() - t.getBottom()) : t.getY() <= n.getY() && t.getBottom() >= n.getBottom() && (a[1] += Math.min(n.getY() - t.getY(), t.getBottom() - n.getBottom()));
535
+ var d = Math.abs((t.getCenterY() - n.getCenterY()) / (t.getCenterX() - n.getCenterX()));
536
+ t.getCenterY() === n.getCenterY() && t.getCenterX() === n.getCenterX() && (d = 1);
537
+ var r = d * a[0], i = a[1] / d;
538
+ a[0] < i ? i = a[0] : r = a[1], a[0] = -1 * e[0] * (i / 2 + h), a[1] = -1 * e[1] * (r / 2 + h);
539
+ }, s.decideDirectionsForOverlappingNodes = function(n, t, a) {
540
+ n.getCenterX() < t.getCenterX() ? a[0] = -1 : a[0] = 1, n.getCenterY() < t.getCenterY() ? a[1] = -1 : a[1] = 1;
541
+ }, s.getIntersection2 = function(n, t, a) {
542
+ var h = n.getCenterX(), e = n.getCenterY(), d = t.getCenterX(), r = t.getCenterY();
543
+ if (n.intersects(t))
544
+ return a[0] = h, a[1] = e, a[2] = d, a[3] = r, !0;
545
+ var i = n.getX(), f = n.getY(), l = n.getRight(), p = n.getX(), g = n.getBottom(), c = n.getRight(), T = n.getWidthHalf(), A = n.getHeightHalf(), I = t.getX(), S = t.getY(), Y = t.getRight(), V = t.getX(), z = t.getBottom(), x = t.getRight(), tt = t.getWidthHalf(), o = t.getHeightHalf(), m = !1, u = !1;
546
+ if (h === d) {
547
+ if (e > r)
548
+ return a[0] = h, a[1] = f, a[2] = d, a[3] = z, !1;
549
+ if (e < r)
550
+ return a[0] = h, a[1] = g, a[2] = d, a[3] = S, !1;
551
+ } else if (e === r) {
552
+ if (h > d)
553
+ return a[0] = i, a[1] = e, a[2] = Y, a[3] = r, !1;
554
+ if (h < d)
555
+ return a[0] = l, a[1] = e, a[2] = I, a[3] = r, !1;
556
+ } else {
557
+ var E = n.height / n.width, y = t.height / t.width, C = (r - e) / (d - h), M = void 0, G = void 0, O = void 0, R = void 0, W = void 0, B = void 0;
558
+ if (-E === C ? h > d ? (a[0] = p, a[1] = g, m = !0) : (a[0] = l, a[1] = f, m = !0) : E === C && (h > d ? (a[0] = i, a[1] = f, m = !0) : (a[0] = c, a[1] = g, m = !0)), -y === C ? d > h ? (a[2] = V, a[3] = z, u = !0) : (a[2] = Y, a[3] = S, u = !0) : y === C && (d > h ? (a[2] = I, a[3] = S, u = !0) : (a[2] = x, a[3] = z, u = !0)), m && u) return !1;
559
+ if (h > d ? e > r ? (M = this.getCardinalDirection(E, C, 4), G = this.getCardinalDirection(y, C, 2)) : (M = this.getCardinalDirection(-E, C, 3), G = this.getCardinalDirection(-y, C, 1)) : e > r ? (M = this.getCardinalDirection(-E, C, 1), G = this.getCardinalDirection(-y, C, 3)) : (M = this.getCardinalDirection(E, C, 2), G = this.getCardinalDirection(y, C, 4)), !m) switch (M) {
560
+ case 1:
561
+ R = f, O = h + -A / C, a[0] = O, a[1] = R;
562
+ break;
563
+ case 2:
564
+ O = c, R = e + T * C, a[0] = O, a[1] = R;
565
+ break;
566
+ case 3:
567
+ R = g, O = h + A / C, a[0] = O, a[1] = R;
568
+ break;
569
+ case 4:
570
+ O = p, R = e + -T * C, a[0] = O, a[1] = R;
571
+ break;
572
+ }
573
+ if (!u) switch (G) {
574
+ case 1:
575
+ B = S, W = d + -o / C, a[2] = W, a[3] = B;
576
+ break;
577
+ case 2:
578
+ W = x, B = r + tt * C, a[2] = W, a[3] = B;
579
+ break;
580
+ case 3:
581
+ B = z, W = d + o / C, a[2] = W, a[3] = B;
582
+ break;
583
+ case 4:
584
+ W = V, B = r + -tt * C, a[2] = W, a[3] = B;
585
+ break;
586
+ }
587
+ }
588
+ return !1;
589
+ }, s.getCardinalDirection = function(n, t, a) {
590
+ return n > t ? a : 1 + a % 4;
591
+ }, s.getIntersection = function(n, t, a, h) {
592
+ if (h == null) return this.getIntersection2(n, t, a);
593
+ var e = n.x, d = n.y, r = t.x, i = t.y, f = a.x, l = a.y, p = h.x, g = h.y, c = void 0, T = void 0, A = void 0, I = void 0, S = void 0, Y = void 0, V = void 0, z = void 0, x = void 0;
594
+ return A = i - d, S = e - r, V = r * d - e * i, I = g - l, Y = f - p, z = p * l - f * g, x = A * Y - I * S, x === 0 ? null : (c = (S * z - Y * V) / x, T = (I * V - A * z) / x, new v(c, T));
595
+ }, s.angleOfVector = function(n, t, a, h) {
596
+ var e = void 0;
597
+ return n !== a ? (e = Math.atan((h - t) / (a - n)), a < n ? e += Math.PI : h < t && (e += this.TWO_PI)) : h < t ? e = this.ONE_AND_HALF_PI : e = this.HALF_PI, e;
598
+ }, s.doIntersect = function(n, t, a, h) {
599
+ var e = n.x, d = n.y, r = t.x, i = t.y, f = a.x, l = a.y, p = h.x, g = h.y, c = (r - e) * (g - l) - (p - f) * (i - d);
600
+ if (c === 0) return !1;
601
+ var T = ((g - l) * (p - e) + (f - p) * (g - d)) / c, A = ((d - i) * (p - e) + (r - e) * (g - d)) / c;
602
+ return 0 < T && T < 1 && 0 < A && A < 1;
603
+ }, s.findCircleLineIntersections = function(n, t, a, h, e, d, r) {
604
+ var i = (a - n) * (a - n) + (h - t) * (h - t), f = 2 * ((n - e) * (a - n) + (t - d) * (h - t)), l = (n - e) * (n - e) + (t - d) * (t - d) - r * r;
605
+ if (f * f - 4 * i * l >= 0) {
606
+ var p = (-f + Math.sqrt(f * f - 4 * i * l)) / (2 * i), g = (-f - Math.sqrt(f * f - 4 * i * l)) / (2 * i), c = null;
607
+ return p >= 0 && p <= 1 ? [p] : g >= 0 && g <= 1 ? [g] : c;
608
+ } else return null;
609
+ }, s.HALF_PI = 0.5 * Math.PI, s.ONE_AND_HALF_PI = 1.5 * Math.PI, s.TWO_PI = 2 * Math.PI, s.THREE_PI = 3 * Math.PI, w.exports = s;
610
+ }),
611
+ (function(w, U, N) {
612
+ "use strict";
613
+ function v() {
614
+ }
615
+ v.sign = function(s) {
616
+ return s > 0 ? 1 : s < 0 ? -1 : 0;
617
+ }, v.floor = function(s) {
618
+ return s < 0 ? Math.ceil(s) : Math.floor(s);
619
+ }, v.ceil = function(s) {
620
+ return s < 0 ? Math.floor(s) : Math.ceil(s);
621
+ }, w.exports = v;
622
+ }),
623
+ (function(w, U, N) {
624
+ "use strict";
625
+ function v() {
626
+ }
627
+ v.MAX_VALUE = 2147483647, v.MIN_VALUE = -2147483648, w.exports = v;
628
+ }),
629
+ (function(w, U, N) {
630
+ "use strict";
631
+ var v = /* @__PURE__ */ (function() {
632
+ function h(e, d) {
633
+ for (var r = 0; r < d.length; r++) {
634
+ var i = d[r];
635
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
636
+ }
637
+ }
638
+ return function(e, d, r) {
639
+ return d && h(e.prototype, d), r && h(e, r), e;
640
+ };
641
+ })();
642
+ function s(h, e) {
643
+ if (!(h instanceof e)) throw new TypeError("Cannot call a class as a function");
644
+ }
645
+ var n = function(e) {
646
+ return {
647
+ value: e,
648
+ next: null,
649
+ prev: null
650
+ };
651
+ }, t = function(e, d, r, i) {
652
+ return e !== null ? e.next = d : i.head = d, r !== null ? r.prev = d : i.tail = d, d.prev = e, d.next = r, i.length++, d;
653
+ }, a = function(e, d) {
654
+ var r = e.prev, i = e.next;
655
+ return r !== null ? r.next = i : d.head = i, i !== null ? i.prev = r : d.tail = r, e.prev = e.next = null, d.length--, e;
656
+ };
657
+ w.exports = (function() {
658
+ function h(e) {
659
+ var d = this;
660
+ s(this, h), this.length = 0, this.head = null, this.tail = null, e?.forEach(function(r) {
661
+ return d.push(r);
662
+ });
663
+ }
664
+ return v(h, [
665
+ {
666
+ key: "size",
667
+ value: function() {
668
+ return this.length;
669
+ }
670
+ },
671
+ {
672
+ key: "insertBefore",
673
+ value: function(d, r) {
674
+ return t(r.prev, n(d), r, this);
675
+ }
676
+ },
677
+ {
678
+ key: "insertAfter",
679
+ value: function(d, r) {
680
+ return t(r, n(d), r.next, this);
681
+ }
682
+ },
683
+ {
684
+ key: "insertNodeBefore",
685
+ value: function(d, r) {
686
+ return t(r.prev, d, r, this);
687
+ }
688
+ },
689
+ {
690
+ key: "insertNodeAfter",
691
+ value: function(d, r) {
692
+ return t(r, d, r.next, this);
693
+ }
694
+ },
695
+ {
696
+ key: "push",
697
+ value: function(d) {
698
+ return t(this.tail, n(d), null, this);
699
+ }
700
+ },
701
+ {
702
+ key: "unshift",
703
+ value: function(d) {
704
+ return t(null, n(d), this.head, this);
705
+ }
706
+ },
707
+ {
708
+ key: "remove",
709
+ value: function(d) {
710
+ return a(d, this);
711
+ }
712
+ },
713
+ {
714
+ key: "pop",
715
+ value: function() {
716
+ return a(this.tail, this).value;
717
+ }
718
+ },
719
+ {
720
+ key: "popNode",
721
+ value: function() {
722
+ return a(this.tail, this);
723
+ }
724
+ },
725
+ {
726
+ key: "shift",
727
+ value: function() {
728
+ return a(this.head, this).value;
729
+ }
730
+ },
731
+ {
732
+ key: "shiftNode",
733
+ value: function() {
734
+ return a(this.head, this);
735
+ }
736
+ },
737
+ {
738
+ key: "get_object_at",
739
+ value: function(d) {
740
+ if (d <= this.length()) {
741
+ for (var r = 1, i = this.head; r < d; )
742
+ i = i.next, r++;
743
+ return i.value;
744
+ }
745
+ }
746
+ },
747
+ {
748
+ key: "set_object_at",
749
+ value: function(d, r) {
750
+ if (d <= this.length()) {
751
+ for (var i = 1, f = this.head; i < d; )
752
+ f = f.next, i++;
753
+ f.value = r;
754
+ }
755
+ }
756
+ }
757
+ ]), h;
758
+ })();
759
+ }),
760
+ (function(w, U, N) {
761
+ "use strict";
762
+ function v(s, n, t) {
763
+ this.x = null, this.y = null, s == null && n == null && t == null ? (this.x = 0, this.y = 0) : typeof s == "number" && typeof n == "number" && t == null ? (this.x = s, this.y = n) : s.constructor.name == "Point" && n == null && t == null && (t = s, this.x = t.x, this.y = t.y);
764
+ }
765
+ v.prototype.getX = function() {
766
+ return this.x;
767
+ }, v.prototype.getY = function() {
768
+ return this.y;
769
+ }, v.prototype.getLocation = function() {
770
+ return new v(this.x, this.y);
771
+ }, v.prototype.setLocation = function(s, n, t) {
772
+ s.constructor.name == "Point" && n == null && t == null ? (t = s, this.setLocation(t.x, t.y)) : typeof s == "number" && typeof n == "number" && t == null && (parseInt(s) == s && parseInt(n) == n ? this.move(s, n) : (this.x = Math.floor(s + 0.5), this.y = Math.floor(n + 0.5)));
773
+ }, v.prototype.move = function(s, n) {
774
+ this.x = s, this.y = n;
775
+ }, v.prototype.translate = function(s, n) {
776
+ this.x += s, this.y += n;
777
+ }, v.prototype.equals = function(s) {
778
+ if (s.constructor.name == "Point") {
779
+ var n = s;
780
+ return this.x == n.x && this.y == n.y;
781
+ }
782
+ return this == s;
783
+ }, v.prototype.toString = function() {
784
+ return new v().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
785
+ }, w.exports = v;
786
+ }),
787
+ (function(w, U, N) {
788
+ "use strict";
789
+ function v(s, n, t, a) {
790
+ this.x = 0, this.y = 0, this.width = 0, this.height = 0, s != null && n != null && t != null && a != null && (this.x = s, this.y = n, this.width = t, this.height = a);
791
+ }
792
+ v.prototype.getX = function() {
793
+ return this.x;
794
+ }, v.prototype.setX = function(s) {
795
+ this.x = s;
796
+ }, v.prototype.getY = function() {
797
+ return this.y;
798
+ }, v.prototype.setY = function(s) {
799
+ this.y = s;
800
+ }, v.prototype.getWidth = function() {
801
+ return this.width;
802
+ }, v.prototype.setWidth = function(s) {
803
+ this.width = s;
804
+ }, v.prototype.getHeight = function() {
805
+ return this.height;
806
+ }, v.prototype.setHeight = function(s) {
807
+ this.height = s;
808
+ }, v.prototype.getRight = function() {
809
+ return this.x + this.width;
810
+ }, v.prototype.getBottom = function() {
811
+ return this.y + this.height;
812
+ }, v.prototype.intersects = function(s) {
813
+ return !(this.getRight() < s.x || this.getBottom() < s.y || s.getRight() < this.x || s.getBottom() < this.y);
814
+ }, v.prototype.getCenterX = function() {
815
+ return this.x + this.width / 2;
816
+ }, v.prototype.getMinX = function() {
817
+ return this.getX();
818
+ }, v.prototype.getMaxX = function() {
819
+ return this.getX() + this.width;
820
+ }, v.prototype.getCenterY = function() {
821
+ return this.y + this.height / 2;
822
+ }, v.prototype.getMinY = function() {
823
+ return this.getY();
824
+ }, v.prototype.getMaxY = function() {
825
+ return this.getY() + this.height;
826
+ }, v.prototype.getWidthHalf = function() {
827
+ return this.width / 2;
828
+ }, v.prototype.getHeightHalf = function() {
829
+ return this.height / 2;
830
+ }, w.exports = v;
831
+ }),
832
+ (function(w, U, N) {
833
+ "use strict";
834
+ var v = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
835
+ return typeof n;
836
+ } : function(n) {
837
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
838
+ };
839
+ function s() {
840
+ }
841
+ s.lastID = 0, s.createID = function(n) {
842
+ return s.isPrimitive(n) ? n : (n.uniqueID != null || (n.uniqueID = s.getString(), s.lastID++), n.uniqueID);
843
+ }, s.getString = function(n) {
844
+ return n == null && (n = s.lastID), "Object#" + n;
845
+ }, s.isPrimitive = function(n) {
846
+ var t = typeof n > "u" ? "undefined" : v(n);
847
+ return n == null || t != "object" && t != "function";
848
+ }, w.exports = s;
849
+ }),
850
+ (function(w, U, N) {
851
+ "use strict";
852
+ function v(f) {
853
+ if (Array.isArray(f)) {
854
+ for (var l = 0, p = Array(f.length); l < f.length; l++) p[l] = f[l];
855
+ return p;
856
+ } else return Array.from(f);
857
+ }
858
+ var s = N(0), n = N(7), t = N(3), a = N(1), h = N(6), e = N(5), d = N(17), r = N(29);
859
+ function i(f) {
860
+ r.call(this), this.layoutQuality = s.QUALITY, this.createBendsAsNeeded = s.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = s.DEFAULT_INCREMENTAL, this.animationOnLayout = s.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = s.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = s.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = s.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new n(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, f != null && (this.isRemoteUse = f);
861
+ }
862
+ i.RANDOM_SEED = 1, i.prototype = Object.create(r.prototype), i.prototype.getGraphManager = function() {
863
+ return this.graphManager;
864
+ }, i.prototype.getAllNodes = function() {
865
+ return this.graphManager.getAllNodes();
866
+ }, i.prototype.getAllEdges = function() {
867
+ return this.graphManager.getAllEdges();
868
+ }, i.prototype.getAllNodesToApplyGravitation = function() {
869
+ return this.graphManager.getAllNodesToApplyGravitation();
870
+ }, i.prototype.newGraphManager = function() {
871
+ var f = new n(this);
872
+ return this.graphManager = f, f;
873
+ }, i.prototype.newGraph = function(f) {
874
+ return new h(null, this.graphManager, f);
875
+ }, i.prototype.newNode = function(f) {
876
+ return new t(this.graphManager, f);
877
+ }, i.prototype.newEdge = function(f) {
878
+ return new a(null, null, f);
879
+ }, i.prototype.checkLayoutSuccess = function() {
880
+ return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
881
+ }, i.prototype.runLayout = function() {
882
+ this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
883
+ var f;
884
+ return this.checkLayoutSuccess() ? f = !1 : f = this.layout(), s.ANIMATE === "during" ? !1 : (f && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, f);
885
+ }, i.prototype.doPostLayout = function() {
886
+ this.incremental || this.transform(), this.update();
887
+ }, i.prototype.update2 = function() {
888
+ if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
889
+ for (var f = this.graphManager.getAllEdges(), l = 0; l < f.length; l++) f[l];
890
+ for (var p = this.graphManager.getRoot().getNodes(), l = 0; l < p.length; l++) p[l];
891
+ this.update(this.graphManager.getRoot());
892
+ }
893
+ }, i.prototype.update = function(f) {
894
+ if (f == null) this.update2();
895
+ else if (f instanceof t) {
896
+ var l = f;
897
+ if (l.getChild() != null)
898
+ for (var p = l.getChild().getNodes(), g = 0; g < p.length; g++) update(p[g]);
899
+ l.vGraphObject != null && l.vGraphObject.update(l);
900
+ } else if (f instanceof a) {
901
+ var c = f;
902
+ c.vGraphObject != null && c.vGraphObject.update(c);
903
+ } else if (f instanceof h) {
904
+ var T = f;
905
+ T.vGraphObject != null && T.vGraphObject.update(T);
906
+ }
907
+ }, i.prototype.initParameters = function() {
908
+ this.isSubLayout || (this.layoutQuality = s.QUALITY, this.animationDuringLayout = s.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = s.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = s.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = s.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = s.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = s.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
909
+ }, i.prototype.transform = function(f) {
910
+ if (f == null) this.transform(new e(0, 0));
911
+ else {
912
+ var l = new d(), p = this.graphManager.getRoot().updateLeftTop();
913
+ if (p != null) {
914
+ l.setWorldOrgX(f.x), l.setWorldOrgY(f.y), l.setDeviceOrgX(p.x), l.setDeviceOrgY(p.y);
915
+ for (var g = this.getAllNodes(), c, T = 0; T < g.length; T++)
916
+ c = g[T], c.transform(l);
917
+ }
918
+ }
919
+ }, i.prototype.positionNodesRandomly = function(f) {
920
+ if (f == null)
921
+ this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
922
+ else
923
+ for (var l, p, g = f.getNodes(), c = 0; c < g.length; c++)
924
+ l = g[c], p = l.getChild(), p == null || p.getNodes().length == 0 ? l.scatter() : (this.positionNodesRandomly(p), l.updateBounds());
925
+ }, i.prototype.getFlatForest = function() {
926
+ for (var f = [], l = !0, p = this.graphManager.getRoot().getNodes(), g = !0, c = 0; c < p.length; c++) p[c].getChild() != null && (g = !1);
927
+ if (!g) return f;
928
+ var T = /* @__PURE__ */ new Set(), A = [], I = /* @__PURE__ */ new Map(), S = [];
929
+ for (S = S.concat(p); S.length > 0 && l; ) {
930
+ for (A.push(S[0]); A.length > 0 && l; ) {
931
+ var Y = A[0];
932
+ A.splice(0, 1), T.add(Y);
933
+ for (var V = Y.getEdges(), c = 0; c < V.length; c++) {
934
+ var z = V[c].getOtherEnd(Y);
935
+ if (I.get(Y) != z) if (!T.has(z))
936
+ A.push(z), I.set(z, Y);
937
+ else {
938
+ l = !1;
939
+ break;
940
+ }
941
+ }
942
+ }
943
+ if (!l) f = [];
944
+ else {
945
+ var x = [].concat(v(T));
946
+ f.push(x);
947
+ for (var c = 0; c < x.length; c++) {
948
+ var tt = x[c], o = S.indexOf(tt);
949
+ o > -1 && S.splice(o, 1);
950
+ }
951
+ T = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Map();
952
+ }
953
+ }
954
+ return f;
955
+ }, i.prototype.createDummyNodesForBendpoints = function(f) {
956
+ for (var l = [], p = f.source, g = this.graphManager.calcLowestCommonAncestor(f.source, f.target), c = 0; c < f.bendpoints.length; c++) {
957
+ var T = this.newNode(null);
958
+ T.setRect(new Point(0, 0), new Dimension(1, 1)), g.add(T);
959
+ var A = this.newEdge(null);
960
+ this.graphManager.add(A, p, T), l.add(T), p = T;
961
+ }
962
+ var A = this.newEdge(null);
963
+ return this.graphManager.add(A, p, f.target), this.edgeToDummyNodes.set(f, l), f.isInterGraph() ? this.graphManager.remove(f) : g.remove(f), l;
964
+ }, i.prototype.createBendpointsFromDummyNodes = function() {
965
+ var f = [];
966
+ f = f.concat(this.graphManager.getAllEdges()), f = [].concat(v(this.edgeToDummyNodes.keys())).concat(f);
967
+ for (var l = 0; l < f.length; l++) {
968
+ var p = f[l];
969
+ if (p.bendpoints.length > 0) {
970
+ for (var g = this.edgeToDummyNodes.get(p), c = 0; c < g.length; c++) {
971
+ var T = g[c], A = new e(T.getCenterX(), T.getCenterY()), I = p.bendpoints.get(c);
972
+ I.x = A.x, I.y = A.y, T.getOwner().remove(T);
973
+ }
974
+ this.graphManager.add(p, p.source, p.target);
975
+ }
976
+ }
977
+ }, i.transform = function(f, l, p, g) {
978
+ if (p != null && g != null) {
979
+ var c = l;
980
+ if (f <= 50) {
981
+ var T = l / p;
982
+ c -= (l - T) / 50 * (50 - f);
983
+ } else {
984
+ var A = l * g;
985
+ c += (A - l) / 50 * (f - 50);
986
+ }
987
+ return c;
988
+ } else {
989
+ var I, S;
990
+ return f <= 50 ? (I = 9 * l / 500, S = l / 10) : (I = 9 * l / 50, S = -8 * l), I * f + S;
991
+ }
992
+ }, i.findCenterOfTree = function(f) {
993
+ var l = [];
994
+ l = l.concat(f);
995
+ var p = [], g = /* @__PURE__ */ new Map(), c = !1, T = null;
996
+ (l.length == 1 || l.length == 2) && (c = !0, T = l[0]);
997
+ for (var A = 0; A < l.length; A++) {
998
+ var I = l[A], S = I.getNeighborsList().size;
999
+ g.set(I, I.getNeighborsList().size), S == 1 && p.push(I);
1000
+ }
1001
+ var Y = [];
1002
+ for (Y = Y.concat(p); !c; ) {
1003
+ var V = [];
1004
+ V = V.concat(Y), Y = [];
1005
+ for (var A = 0; A < l.length; A++) {
1006
+ var I = l[A], z = l.indexOf(I);
1007
+ z >= 0 && l.splice(z, 1), I.getNeighborsList().forEach(function(o) {
1008
+ if (p.indexOf(o) < 0) {
1009
+ var m = g.get(o) - 1;
1010
+ m == 1 && Y.push(o), g.set(o, m);
1011
+ }
1012
+ });
1013
+ }
1014
+ p = p.concat(Y), (l.length == 1 || l.length == 2) && (c = !0, T = l[0]);
1015
+ }
1016
+ return T;
1017
+ }, i.prototype.setGraphManager = function(f) {
1018
+ this.graphManager = f;
1019
+ }, w.exports = i;
1020
+ }),
1021
+ (function(w, U, N) {
1022
+ "use strict";
1023
+ function v() {
1024
+ }
1025
+ v.seed = 1, v.x = 0, v.nextDouble = function() {
1026
+ return v.x = Math.sin(v.seed++) * 1e4, v.x - Math.floor(v.x);
1027
+ }, w.exports = v;
1028
+ }),
1029
+ (function(w, U, N) {
1030
+ "use strict";
1031
+ var v = N(5);
1032
+ function s(n, t) {
1033
+ this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1034
+ }
1035
+ s.prototype.getWorldOrgX = function() {
1036
+ return this.lworldOrgX;
1037
+ }, s.prototype.setWorldOrgX = function(n) {
1038
+ this.lworldOrgX = n;
1039
+ }, s.prototype.getWorldOrgY = function() {
1040
+ return this.lworldOrgY;
1041
+ }, s.prototype.setWorldOrgY = function(n) {
1042
+ this.lworldOrgY = n;
1043
+ }, s.prototype.getWorldExtX = function() {
1044
+ return this.lworldExtX;
1045
+ }, s.prototype.setWorldExtX = function(n) {
1046
+ this.lworldExtX = n;
1047
+ }, s.prototype.getWorldExtY = function() {
1048
+ return this.lworldExtY;
1049
+ }, s.prototype.setWorldExtY = function(n) {
1050
+ this.lworldExtY = n;
1051
+ }, s.prototype.getDeviceOrgX = function() {
1052
+ return this.ldeviceOrgX;
1053
+ }, s.prototype.setDeviceOrgX = function(n) {
1054
+ this.ldeviceOrgX = n;
1055
+ }, s.prototype.getDeviceOrgY = function() {
1056
+ return this.ldeviceOrgY;
1057
+ }, s.prototype.setDeviceOrgY = function(n) {
1058
+ this.ldeviceOrgY = n;
1059
+ }, s.prototype.getDeviceExtX = function() {
1060
+ return this.ldeviceExtX;
1061
+ }, s.prototype.setDeviceExtX = function(n) {
1062
+ this.ldeviceExtX = n;
1063
+ }, s.prototype.getDeviceExtY = function() {
1064
+ return this.ldeviceExtY;
1065
+ }, s.prototype.setDeviceExtY = function(n) {
1066
+ this.ldeviceExtY = n;
1067
+ }, s.prototype.transformX = function(n) {
1068
+ var t = 0, a = this.lworldExtX;
1069
+ return a != 0 && (t = this.ldeviceOrgX + (n - this.lworldOrgX) * this.ldeviceExtX / a), t;
1070
+ }, s.prototype.transformY = function(n) {
1071
+ var t = 0, a = this.lworldExtY;
1072
+ return a != 0 && (t = this.ldeviceOrgY + (n - this.lworldOrgY) * this.ldeviceExtY / a), t;
1073
+ }, s.prototype.inverseTransformX = function(n) {
1074
+ var t = 0, a = this.ldeviceExtX;
1075
+ return a != 0 && (t = this.lworldOrgX + (n - this.ldeviceOrgX) * this.lworldExtX / a), t;
1076
+ }, s.prototype.inverseTransformY = function(n) {
1077
+ var t = 0, a = this.ldeviceExtY;
1078
+ return a != 0 && (t = this.lworldOrgY + (n - this.ldeviceOrgY) * this.lworldExtY / a), t;
1079
+ }, s.prototype.inverseTransformPoint = function(n) {
1080
+ return new v(this.inverseTransformX(n.x), this.inverseTransformY(n.y));
1081
+ }, w.exports = s;
1082
+ }),
1083
+ (function(w, U, N) {
1084
+ "use strict";
1085
+ function v(r) {
1086
+ if (Array.isArray(r)) {
1087
+ for (var i = 0, f = Array(r.length); i < r.length; i++) f[i] = r[i];
1088
+ return f;
1089
+ } else return Array.from(r);
1090
+ }
1091
+ var s = N(15), n = N(4), t = N(0), a = N(8), h = N(9);
1092
+ function e() {
1093
+ s.call(this), this.useSmartIdealEdgeLengthCalculation = n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = n.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = n.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = n.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * n.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = n.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = n.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = n.MAX_ITERATIONS;
1094
+ }
1095
+ e.prototype = Object.create(s.prototype);
1096
+ for (var d in s) e[d] = s[d];
1097
+ e.prototype.initParameters = function() {
1098
+ s.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1099
+ }, e.prototype.calcIdealEdgeLengths = function() {
1100
+ for (var r, i, f, l, p, g, c, T = this.getGraphManager().getAllEdges(), A = 0; A < T.length; A++)
1101
+ r = T[A], i = r.idealLength, r.isInterGraph && (l = r.getSource(), p = r.getTarget(), g = r.getSourceInLca().getEstimatedSize(), c = r.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (r.idealLength += g + c - 2 * t.SIMPLE_NODE_SIZE), f = r.getLca().getInclusionTreeDepth(), r.idealLength += i * n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (l.getInclusionTreeDepth() + p.getInclusionTreeDepth() - 2 * f));
1102
+ }, e.prototype.initSpringEmbedder = function() {
1103
+ var r = this.getAllNodes().length;
1104
+ this.incremental ? (r > n.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * n.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (r - n.ADAPTATION_LOWER_NODE_LIMIT) / (n.ADAPTATION_UPPER_NODE_LIMIT - n.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - n.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = n.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (r > n.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(n.COOLING_ADAPTATION_FACTOR, 1 - (r - n.ADAPTATION_LOWER_NODE_LIMIT) / (n.ADAPTATION_UPPER_NODE_LIMIT - n.ADAPTATION_LOWER_NODE_LIMIT) * (1 - n.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = n.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.displacementThresholdPerNode = 3 * n.DEFAULT_EDGE_LENGTH / 100, this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1105
+ }, e.prototype.calcSpringForces = function() {
1106
+ for (var r = this.getAllEdges(), i, f = 0; f < r.length; f++)
1107
+ i = r[f], this.calcSpringForce(i, i.idealLength);
1108
+ }, e.prototype.calcRepulsionForces = function() {
1109
+ var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, f, l, p, g, c = this.getAllNodes(), T;
1110
+ if (this.useFRGridVariant)
1111
+ for (this.totalIterations % n.GRID_CALCULATION_CHECK_PERIOD == 1 && r && this.updateGrid(), T = /* @__PURE__ */ new Set(), f = 0; f < c.length; f++)
1112
+ p = c[f], this.calculateRepulsionForceOfANode(p, T, r, i), T.add(p);
1113
+ else for (f = 0; f < c.length; f++)
1114
+ for (p = c[f], l = f + 1; l < c.length; l++)
1115
+ g = c[l], p.getOwner() == g.getOwner() && this.calcRepulsionForce(p, g);
1116
+ }, e.prototype.calcGravitationalForces = function() {
1117
+ for (var r, i = this.getAllNodesToApplyGravitation(), f = 0; f < i.length; f++)
1118
+ r = i[f], this.calcGravitationalForce(r);
1119
+ }, e.prototype.moveNodes = function() {
1120
+ for (var r = this.getAllNodes(), i, f = 0; f < r.length; f++)
1121
+ i = r[f], i.move();
1122
+ }, e.prototype.calcSpringForce = function(r, i) {
1123
+ var f = r.getSource(), l = r.getTarget(), p, g, c, T;
1124
+ if (this.uniformLeafNodeSizes && f.getChild() == null && l.getChild() == null) r.updateLengthSimple();
1125
+ else if (r.updateLength(), r.isOverlapingSourceAndTarget) return;
1126
+ p = r.getLength(), p != 0 && (g = r.edgeElasticity * (p - i), c = g * (r.lengthX / p), T = g * (r.lengthY / p), f.springForceX += c, f.springForceY += T, l.springForceX -= c, l.springForceY -= T);
1127
+ }, e.prototype.calcRepulsionForce = function(r, i) {
1128
+ var f = r.getRect(), l = i.getRect(), p = new Array(2), g = new Array(4), c, T, A, I, S, Y, V;
1129
+ if (f.intersects(l)) {
1130
+ a.calcSeparationAmount(f, l, p, n.DEFAULT_EDGE_LENGTH / 2), Y = 2 * p[0], V = 2 * p[1];
1131
+ var z = r.noOfChildren * i.noOfChildren / (r.noOfChildren + i.noOfChildren);
1132
+ r.repulsionForceX -= z * Y, r.repulsionForceY -= z * V, i.repulsionForceX += z * Y, i.repulsionForceY += z * V;
1133
+ } else
1134
+ this.uniformLeafNodeSizes && r.getChild() == null && i.getChild() == null ? (c = l.getCenterX() - f.getCenterX(), T = l.getCenterY() - f.getCenterY()) : (a.getIntersection(f, l, g), c = g[2] - g[0], T = g[3] - g[1]), Math.abs(c) < n.MIN_REPULSION_DIST && (c = h.sign(c) * n.MIN_REPULSION_DIST), Math.abs(T) < n.MIN_REPULSION_DIST && (T = h.sign(T) * n.MIN_REPULSION_DIST), A = c * c + T * T, I = Math.sqrt(A), S = (r.nodeRepulsion / 2 + i.nodeRepulsion / 2) * r.noOfChildren * i.noOfChildren / A, Y = S * c / I, V = S * T / I, r.repulsionForceX -= Y, r.repulsionForceY -= V, i.repulsionForceX += Y, i.repulsionForceY += V;
1135
+ }, e.prototype.calcGravitationalForce = function(r) {
1136
+ var i, f, l, p, g, c, T, A;
1137
+ i = r.getOwner(), f = (i.getRight() + i.getLeft()) / 2, l = (i.getTop() + i.getBottom()) / 2, p = r.getCenterX() - f, g = r.getCenterY() - l, c = Math.abs(p) + r.getWidth() / 2, T = Math.abs(g) + r.getHeight() / 2, r.getOwner() == this.graphManager.getRoot() ? (A = i.getEstimatedSize() * this.gravityRangeFactor, (c > A || T > A) && (r.gravitationForceX = -this.gravityConstant * p, r.gravitationForceY = -this.gravityConstant * g)) : (A = i.getEstimatedSize() * this.compoundGravityRangeFactor, (c > A || T > A) && (r.gravitationForceX = -this.gravityConstant * p * this.compoundGravityConstant, r.gravitationForceY = -this.gravityConstant * g * this.compoundGravityConstant));
1138
+ }, e.prototype.isConverged = function() {
1139
+ var r, i = !1;
1140
+ return this.totalIterations > this.maxIterations / 3 && (i = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), r = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, r || i;
1141
+ }, e.prototype.animate = function() {
1142
+ this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1143
+ }, e.prototype.calcNoOfChildrenForAllNodes = function() {
1144
+ for (var r, i = this.graphManager.getAllNodes(), f = 0; f < i.length; f++)
1145
+ r = i[f], r.noOfChildren = r.getNoOfChildren();
1146
+ }, e.prototype.calcGrid = function(r) {
1147
+ var i = 0, f = 0;
1148
+ i = parseInt(Math.ceil((r.getRight() - r.getLeft()) / this.repulsionRange)), f = parseInt(Math.ceil((r.getBottom() - r.getTop()) / this.repulsionRange));
1149
+ for (var l = new Array(i), p = 0; p < i; p++) l[p] = new Array(f);
1150
+ for (var p = 0; p < i; p++) for (var g = 0; g < f; g++) l[p][g] = new Array();
1151
+ return l;
1152
+ }, e.prototype.addNodeToGrid = function(r, i, f) {
1153
+ var l = 0, p = 0, g = 0, c = 0;
1154
+ l = parseInt(Math.floor((r.getRect().x - i) / this.repulsionRange)), p = parseInt(Math.floor((r.getRect().width + r.getRect().x - i) / this.repulsionRange)), g = parseInt(Math.floor((r.getRect().y - f) / this.repulsionRange)), c = parseInt(Math.floor((r.getRect().height + r.getRect().y - f) / this.repulsionRange));
1155
+ for (var T = l; T <= p; T++) for (var A = g; A <= c; A++)
1156
+ this.grid[T][A].push(r), r.setGridCoordinates(l, p, g, c);
1157
+ }, e.prototype.updateGrid = function() {
1158
+ var r, i, f = this.getAllNodes();
1159
+ for (this.grid = this.calcGrid(this.graphManager.getRoot()), r = 0; r < f.length; r++)
1160
+ i = f[r], this.addNodeToGrid(i, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1161
+ }, e.prototype.calculateRepulsionForceOfANode = function(r, i, f, l) {
1162
+ if (this.totalIterations % n.GRID_CALCULATION_CHECK_PERIOD == 1 && f || l) {
1163
+ var p = /* @__PURE__ */ new Set();
1164
+ r.surrounding = new Array();
1165
+ for (var g, c = this.grid, T = r.startX - 1; T < r.finishX + 2; T++) for (var A = r.startY - 1; A < r.finishY + 2; A++) if (!(T < 0 || A < 0 || T >= c.length || A >= c[0].length)) {
1166
+ for (var I = 0; I < c[T][A].length; I++)
1167
+ if (g = c[T][A][I], !(r.getOwner() != g.getOwner() || r == g) && !i.has(g) && !p.has(g)) {
1168
+ var S = Math.abs(r.getCenterX() - g.getCenterX()) - (r.getWidth() / 2 + g.getWidth() / 2), Y = Math.abs(r.getCenterY() - g.getCenterY()) - (r.getHeight() / 2 + g.getHeight() / 2);
1169
+ S <= this.repulsionRange && Y <= this.repulsionRange && p.add(g);
1170
+ }
1171
+ }
1172
+ r.surrounding = [].concat(v(p));
1173
+ }
1174
+ for (T = 0; T < r.surrounding.length; T++) this.calcRepulsionForce(r, r.surrounding[T]);
1175
+ }, e.prototype.calcRepulsionRange = function() {
1176
+ return 0;
1177
+ }, w.exports = e;
1178
+ }),
1179
+ (function(w, U, N) {
1180
+ "use strict";
1181
+ var v = N(1), s = N(4);
1182
+ function n(a, h, e) {
1183
+ v.call(this, a, h, e), this.idealLength = s.DEFAULT_EDGE_LENGTH, this.edgeElasticity = s.DEFAULT_SPRING_STRENGTH;
1184
+ }
1185
+ n.prototype = Object.create(v.prototype);
1186
+ for (var t in v) n[t] = v[t];
1187
+ w.exports = n;
1188
+ }),
1189
+ (function(w, U, N) {
1190
+ "use strict";
1191
+ var v = N(3), s = N(4);
1192
+ function n(a, h, e, d) {
1193
+ v.call(this, a, h, e, d), this.nodeRepulsion = s.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 = [];
1194
+ }
1195
+ n.prototype = Object.create(v.prototype);
1196
+ for (var t in v) n[t] = v[t];
1197
+ n.prototype.setGridCoordinates = function(a, h, e, d) {
1198
+ this.startX = a, this.finishX = h, this.startY = e, this.finishY = d;
1199
+ }, w.exports = n;
1200
+ }),
1201
+ (function(w, U, N) {
1202
+ "use strict";
1203
+ function v(s, n) {
1204
+ this.width = 0, this.height = 0, s !== null && n !== null && (this.height = n, this.width = s);
1205
+ }
1206
+ v.prototype.getWidth = function() {
1207
+ return this.width;
1208
+ }, v.prototype.setWidth = function(s) {
1209
+ this.width = s;
1210
+ }, v.prototype.getHeight = function() {
1211
+ return this.height;
1212
+ }, v.prototype.setHeight = function(s) {
1213
+ this.height = s;
1214
+ }, w.exports = v;
1215
+ }),
1216
+ (function(w, U, N) {
1217
+ "use strict";
1218
+ var v = N(14);
1219
+ function s() {
1220
+ this.map = {}, this.keys = [];
1221
+ }
1222
+ s.prototype.put = function(n, t) {
1223
+ var a = v.createID(n);
1224
+ this.contains(a) || (this.map[a] = t, this.keys.push(n));
1225
+ }, s.prototype.contains = function(n) {
1226
+ return v.createID(n), this.map[n] != null;
1227
+ }, s.prototype.get = function(n) {
1228
+ var t = v.createID(n);
1229
+ return this.map[t];
1230
+ }, s.prototype.keySet = function() {
1231
+ return this.keys;
1232
+ }, w.exports = s;
1233
+ }),
1234
+ (function(w, U, N) {
1235
+ "use strict";
1236
+ var v = N(14);
1237
+ function s() {
1238
+ this.set = {};
1239
+ }
1240
+ s.prototype.add = function(n) {
1241
+ var t = v.createID(n);
1242
+ this.contains(t) || (this.set[t] = n);
1243
+ }, s.prototype.remove = function(n) {
1244
+ delete this.set[v.createID(n)];
1245
+ }, s.prototype.clear = function() {
1246
+ this.set = {};
1247
+ }, s.prototype.contains = function(n) {
1248
+ return this.set[v.createID(n)] == n;
1249
+ }, s.prototype.isEmpty = function() {
1250
+ return this.size() === 0;
1251
+ }, s.prototype.size = function() {
1252
+ return Object.keys(this.set).length;
1253
+ }, s.prototype.addAllTo = function(n) {
1254
+ for (var t = Object.keys(this.set), a = t.length, h = 0; h < a; h++) n.push(this.set[t[h]]);
1255
+ }, s.prototype.size = function() {
1256
+ return Object.keys(this.set).length;
1257
+ }, s.prototype.addAll = function(n) {
1258
+ for (var t = n.length, a = 0; a < t; a++) {
1259
+ var h = n[a];
1260
+ this.add(h);
1261
+ }
1262
+ }, w.exports = s;
1263
+ }),
1264
+ (function(w, U, N) {
1265
+ "use strict";
1266
+ function v() {
1267
+ }
1268
+ v.multMat = function(s, n) {
1269
+ for (var t = [], a = 0; a < s.length; a++) {
1270
+ t[a] = [];
1271
+ for (var h = 0; h < n[0].length; h++) {
1272
+ t[a][h] = 0;
1273
+ for (var e = 0; e < s[0].length; e++) t[a][h] += s[a][e] * n[e][h];
1274
+ }
1275
+ }
1276
+ return t;
1277
+ }, v.transpose = function(s) {
1278
+ for (var n = [], t = 0; t < s[0].length; t++) {
1279
+ n[t] = [];
1280
+ for (var a = 0; a < s.length; a++) n[t][a] = s[a][t];
1281
+ }
1282
+ return n;
1283
+ }, v.multCons = function(s, n) {
1284
+ for (var t = [], a = 0; a < s.length; a++) t[a] = s[a] * n;
1285
+ return t;
1286
+ }, v.minusOp = function(s, n) {
1287
+ for (var t = [], a = 0; a < s.length; a++) t[a] = s[a] - n[a];
1288
+ return t;
1289
+ }, v.dotProduct = function(s, n) {
1290
+ for (var t = 0, a = 0; a < s.length; a++) t += s[a] * n[a];
1291
+ return t;
1292
+ }, v.mag = function(s) {
1293
+ return Math.sqrt(this.dotProduct(s, s));
1294
+ }, v.normalize = function(s) {
1295
+ for (var n = [], t = this.mag(s), a = 0; a < s.length; a++) n[a] = s[a] / t;
1296
+ return n;
1297
+ }, v.multGamma = function(s) {
1298
+ for (var n = [], t = 0, a = 0; a < s.length; a++) t += s[a];
1299
+ t *= -1 / s.length;
1300
+ for (var h = 0; h < s.length; h++) n[h] = t + s[h];
1301
+ return n;
1302
+ }, v.multL = function(s, n, t) {
1303
+ for (var a = [], h = [], e = [], d = 0; d < n[0].length; d++) {
1304
+ for (var r = 0, i = 0; i < n.length; i++) r += -0.5 * n[i][d] * s[i];
1305
+ h[d] = r;
1306
+ }
1307
+ for (var f = 0; f < t.length; f++) {
1308
+ for (var l = 0, p = 0; p < t.length; p++) l += t[f][p] * h[p];
1309
+ e[f] = l;
1310
+ }
1311
+ for (var g = 0; g < n.length; g++) {
1312
+ for (var c = 0, T = 0; T < n[0].length; T++) c += n[g][T] * e[T];
1313
+ a[g] = c;
1314
+ }
1315
+ return a;
1316
+ }, w.exports = v;
1317
+ }),
1318
+ (function(w, U, N) {
1319
+ "use strict";
1320
+ var v = /* @__PURE__ */ (function() {
1321
+ function t(a, h) {
1322
+ for (var e = 0; e < h.length; e++) {
1323
+ var d = h[e];
1324
+ d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(a, d.key, d);
1325
+ }
1326
+ }
1327
+ return function(a, h, e) {
1328
+ return h && t(a.prototype, h), e && t(a, e), a;
1329
+ };
1330
+ })();
1331
+ function s(t, a) {
1332
+ if (!(t instanceof a)) throw new TypeError("Cannot call a class as a function");
1333
+ }
1334
+ var n = N(11);
1335
+ w.exports = (function() {
1336
+ function t(a, h) {
1337
+ s(this, t), (h !== null || h !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1338
+ var e = void 0;
1339
+ a instanceof n ? e = a.size() : e = a.length, this._quicksort(a, 0, e - 1);
1340
+ }
1341
+ return v(t, [
1342
+ {
1343
+ key: "_quicksort",
1344
+ value: function(h, e, d) {
1345
+ if (e < d) {
1346
+ var r = this._partition(h, e, d);
1347
+ this._quicksort(h, e, r), this._quicksort(h, r + 1, d);
1348
+ }
1349
+ }
1350
+ },
1351
+ {
1352
+ key: "_partition",
1353
+ value: function(h, e, d) {
1354
+ for (var r = this._get(h, e), i = e, f = d; ; ) {
1355
+ for (; this.compareFunction(r, this._get(h, f)); ) f--;
1356
+ for (; this.compareFunction(this._get(h, i), r); ) i++;
1357
+ if (i < f)
1358
+ this._swap(h, i, f), i++, f--;
1359
+ else return f;
1360
+ }
1361
+ }
1362
+ },
1363
+ {
1364
+ key: "_get",
1365
+ value: function(h, e) {
1366
+ return h instanceof n ? h.get_object_at(e) : h[e];
1367
+ }
1368
+ },
1369
+ {
1370
+ key: "_set",
1371
+ value: function(h, e, d) {
1372
+ h instanceof n ? h.set_object_at(e, d) : h[e] = d;
1373
+ }
1374
+ },
1375
+ {
1376
+ key: "_swap",
1377
+ value: function(h, e, d) {
1378
+ var r = this._get(h, e);
1379
+ this._set(h, e, this._get(h, d)), this._set(h, d, r);
1380
+ }
1381
+ },
1382
+ {
1383
+ key: "_defaultCompareFunction",
1384
+ value: function(h, e) {
1385
+ return e > h;
1386
+ }
1387
+ }
1388
+ ]), t;
1389
+ })();
1390
+ }),
1391
+ (function(w, U, N) {
1392
+ "use strict";
1393
+ function v() {
1394
+ }
1395
+ v.svd = function(s) {
1396
+ this.U = null, this.V = null, this.s = null, this.m = 0, this.n = 0, this.m = s.length, this.n = s[0].length;
1397
+ var n = Math.min(this.m, this.n);
1398
+ this.s = (function(Ot) {
1399
+ for (var Tt = []; Ot-- > 0; ) Tt.push(0);
1400
+ return Tt;
1401
+ })(Math.min(this.m + 1, this.n)), this.U = (function(Ot) {
1402
+ return (function Tt(Xt) {
1403
+ if (Xt.length == 0) return 0;
1404
+ for (var St = [], Ut = 0; Ut < Xt[0]; Ut++) St.push(Tt(Xt.slice(1)));
1405
+ return St;
1406
+ })(Ot);
1407
+ })([this.m, n]), this.V = (function(Ot) {
1408
+ return (function Tt(Xt) {
1409
+ if (Xt.length == 0) return 0;
1410
+ for (var St = [], Ut = 0; Ut < Xt[0]; Ut++) St.push(Tt(Xt.slice(1)));
1411
+ return St;
1412
+ })(Ot);
1413
+ })([this.n, this.n]);
1414
+ for (var t = (function(Ot) {
1415
+ for (var Tt = []; Ot-- > 0; ) Tt.push(0);
1416
+ return Tt;
1417
+ })(this.n), a = (function(Ot) {
1418
+ for (var Tt = []; Ot-- > 0; ) Tt.push(0);
1419
+ return Tt;
1420
+ })(this.m), h = !0, e = !0, d = Math.min(this.m - 1, this.n), r = Math.max(0, Math.min(this.n - 2, this.m)), i = 0; i < Math.max(d, r); i++) {
1421
+ if (i < d) {
1422
+ this.s[i] = 0;
1423
+ for (var f = i; f < this.m; f++) this.s[i] = v.hypot(this.s[i], s[f][i]);
1424
+ if (this.s[i] !== 0) {
1425
+ s[i][i] < 0 && (this.s[i] = -this.s[i]);
1426
+ for (var l = i; l < this.m; l++) s[l][i] /= this.s[i];
1427
+ s[i][i] += 1;
1428
+ }
1429
+ this.s[i] = -this.s[i];
1430
+ }
1431
+ for (var p = i + 1; p < this.n; p++) {
1432
+ if (/* @__PURE__ */ (function(Ot, Tt) {
1433
+ return Ot && Tt;
1434
+ })(i < d, this.s[i] !== 0)) {
1435
+ for (var g = 0, c = i; c < this.m; c++) g += s[c][i] * s[c][p];
1436
+ g = -g / s[i][i];
1437
+ for (var T = i; T < this.m; T++) s[T][p] += g * s[T][i];
1438
+ }
1439
+ t[p] = s[i][p];
1440
+ }
1441
+ if (/* @__PURE__ */ (function(Ot, Tt) {
1442
+ return Ot && Tt;
1443
+ })(h, i < d)) for (var A = i; A < this.m; A++) this.U[A][i] = s[A][i];
1444
+ if (i < r) {
1445
+ t[i] = 0;
1446
+ for (var I = i + 1; I < this.n; I++) t[i] = v.hypot(t[i], t[I]);
1447
+ if (t[i] !== 0) {
1448
+ t[i + 1] < 0 && (t[i] = -t[i]);
1449
+ for (var S = i + 1; S < this.n; S++) t[S] /= t[i];
1450
+ t[i + 1] += 1;
1451
+ }
1452
+ if (t[i] = -t[i], /* @__PURE__ */ (function(Ot, Tt) {
1453
+ return Ot && Tt;
1454
+ })(i + 1 < this.m, t[i] !== 0)) {
1455
+ for (var Y = i + 1; Y < this.m; Y++) a[Y] = 0;
1456
+ for (var V = i + 1; V < this.n; V++) for (var z = i + 1; z < this.m; z++) a[z] += t[V] * s[z][V];
1457
+ for (var x = i + 1; x < this.n; x++)
1458
+ for (var tt = -t[x] / t[i + 1], o = i + 1; o < this.m; o++) s[o][x] += tt * a[o];
1459
+ }
1460
+ if (e) for (var m = i + 1; m < this.n; m++) this.V[m][i] = t[m];
1461
+ }
1462
+ }
1463
+ var u = Math.min(this.n, this.m + 1);
1464
+ if (d < this.n && (this.s[d] = s[d][d]), this.m < u && (this.s[u - 1] = 0), r + 1 < u && (t[r] = s[r][u - 1]), t[u - 1] = 0, h) {
1465
+ for (var E = d; E < n; E++) {
1466
+ for (var y = 0; y < this.m; y++) this.U[y][E] = 0;
1467
+ this.U[E][E] = 1;
1468
+ }
1469
+ for (var C = d - 1; C >= 0; C--) if (this.s[C] !== 0) {
1470
+ for (var M = C + 1; M < n; M++) {
1471
+ for (var G = 0, O = C; O < this.m; O++) G += this.U[O][C] * this.U[O][M];
1472
+ G = -G / this.U[C][C];
1473
+ for (var R = C; R < this.m; R++) this.U[R][M] += G * this.U[R][C];
1474
+ }
1475
+ for (var W = C; W < this.m; W++) this.U[W][C] = -this.U[W][C];
1476
+ this.U[C][C] = 1 + this.U[C][C];
1477
+ for (var B = 0; B < C - 1; B++) this.U[B][C] = 0;
1478
+ } else {
1479
+ for (var rt = 0; rt < this.m; rt++) this.U[rt][C] = 0;
1480
+ this.U[C][C] = 1;
1481
+ }
1482
+ }
1483
+ if (e) for (var K = this.n - 1; K >= 0; K--) {
1484
+ if (/* @__PURE__ */ (function(Ot, Tt) {
1485
+ return Ot && Tt;
1486
+ })(K < r, t[K] !== 0)) for (var P = K + 1; P < n; P++) {
1487
+ for (var b = 0, X = K + 1; X < this.n; X++) b += this.V[X][K] * this.V[X][P];
1488
+ b = -b / this.V[K + 1][K];
1489
+ for (var J = K + 1; J < this.n; J++) this.V[J][P] += b * this.V[J][K];
1490
+ }
1491
+ for (var at = 0; at < this.n; at++) this.V[at][K] = 0;
1492
+ this.V[K][K] = 1;
1493
+ }
1494
+ for (var q = u - 1, Z = 0, Et = Math.pow(2, -52), ft = Math.pow(2, -966); u > 0; ) {
1495
+ var k = void 0, mt = void 0;
1496
+ for (k = u - 2; k >= -1 && k !== -1; k--)
1497
+ if (Math.abs(t[k]) <= ft + Et * (Math.abs(this.s[k]) + Math.abs(this.s[k + 1]))) {
1498
+ t[k] = 0;
1499
+ break;
1500
+ }
1501
+ if (k === u - 2) mt = 4;
1502
+ else {
1503
+ var ot = void 0;
1504
+ for (ot = u - 1; ot >= k && ot !== k; ot--) {
1505
+ var wt = (ot !== u ? Math.abs(t[ot]) : 0) + (ot !== k + 1 ? Math.abs(t[ot - 1]) : 0);
1506
+ if (Math.abs(this.s[ot]) <= ft + Et * wt) {
1507
+ this.s[ot] = 0;
1508
+ break;
1509
+ }
1510
+ }
1511
+ ot === k ? mt = 3 : ot === u - 1 ? mt = 1 : (mt = 2, k = ot);
1512
+ }
1513
+ switch (k++, mt) {
1514
+ case 1:
1515
+ var Wt = t[u - 2];
1516
+ t[u - 2] = 0;
1517
+ for (var Dt = u - 2; Dt >= k; Dt--) {
1518
+ var xt = v.hypot(this.s[Dt], Wt), Gt = this.s[Dt] / xt, Vt = Wt / xt;
1519
+ if (this.s[Dt] = xt, Dt !== k && (Wt = -Vt * t[Dt - 1], t[Dt - 1] = Gt * t[Dt - 1]), e) for (var Ft = 0; Ft < this.n; Ft++)
1520
+ xt = Gt * this.V[Ft][Dt] + Vt * this.V[Ft][u - 1], this.V[Ft][u - 1] = -Vt * this.V[Ft][Dt] + Gt * this.V[Ft][u - 1], this.V[Ft][Dt] = xt;
1521
+ }
1522
+ break;
1523
+ case 2:
1524
+ var $t = t[k - 1];
1525
+ t[k - 1] = 0;
1526
+ for (var Yt = k; Yt < u; Yt++) {
1527
+ var Bt = v.hypot(this.s[Yt], $t), Ct = this.s[Yt] / Bt, gt = $t / Bt;
1528
+ if (this.s[Yt] = Bt, $t = -gt * t[Yt], t[Yt] = Ct * t[Yt], h) for (var D = 0; D < this.m; D++)
1529
+ Bt = Ct * this.U[D][Yt] + gt * this.U[D][k - 1], this.U[D][k - 1] = -gt * this.U[D][Yt] + Ct * this.U[D][k - 1], this.U[D][Yt] = Bt;
1530
+ }
1531
+ break;
1532
+ case 3:
1533
+ var H = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[u - 1]), Math.abs(this.s[u - 2])), Math.abs(t[u - 2])), Math.abs(this.s[k])), Math.abs(t[k])), $ = this.s[u - 1] / H, _ = this.s[u - 2] / H, Q = t[u - 2] / H, j = this.s[k] / H, pt = t[k] / H, ct = ((_ + $) * (_ - $) + Q * Q) / 2, it = $ * Q * ($ * Q), dt = 0;
1534
+ /* @__PURE__ */ (function(Ot, Tt) {
1535
+ return Ot || Tt;
1536
+ })(ct !== 0, it !== 0) && (dt = Math.sqrt(ct * ct + it), ct < 0 && (dt = -dt), dt = it / (ct + dt));
1537
+ for (var Lt = (j + $) * (j - $) + dt, Mt = j * pt, et = k; et < u - 1; et++) {
1538
+ var Nt = v.hypot(Lt, Mt), st = Lt / Nt, nt = Mt / Nt;
1539
+ if (et !== k && (t[et - 1] = Nt), Lt = st * this.s[et] + nt * t[et], t[et] = st * t[et] - nt * this.s[et], Mt = nt * this.s[et + 1], this.s[et + 1] = st * this.s[et + 1], e) for (var ht = 0; ht < this.n; ht++)
1540
+ Nt = st * this.V[ht][et] + nt * this.V[ht][et + 1], this.V[ht][et + 1] = -nt * this.V[ht][et] + st * this.V[ht][et + 1], this.V[ht][et] = Nt;
1541
+ if (Nt = v.hypot(Lt, Mt), st = Lt / Nt, nt = Mt / Nt, this.s[et] = Nt, Lt = st * t[et] + nt * this.s[et + 1], this.s[et + 1] = -nt * t[et] + st * this.s[et + 1], Mt = nt * t[et + 1], t[et + 1] = st * t[et + 1], h && et < this.m - 1) for (var yt = 0; yt < this.m; yt++)
1542
+ Nt = st * this.U[yt][et] + nt * this.U[yt][et + 1], this.U[yt][et + 1] = -nt * this.U[yt][et] + st * this.U[yt][et + 1], this.U[yt][et] = Nt;
1543
+ }
1544
+ t[u - 2] = Lt, Z = Z + 1;
1545
+ break;
1546
+ case 4:
1547
+ if (this.s[k] <= 0 && (this.s[k] = this.s[k] < 0 ? -this.s[k] : 0, e))
1548
+ for (var ut = 0; ut <= q; ut++) this.V[ut][k] = -this.V[ut][k];
1549
+ for (; k < q && !(this.s[k] >= this.s[k + 1]); ) {
1550
+ var Rt = this.s[k];
1551
+ if (this.s[k] = this.s[k + 1], this.s[k + 1] = Rt, e && k < this.n - 1) for (var It = 0; It < this.n; It++)
1552
+ Rt = this.V[It][k + 1], this.V[It][k + 1] = this.V[It][k], this.V[It][k] = Rt;
1553
+ if (h && k < this.m - 1) for (var bt = 0; bt < this.m; bt++)
1554
+ Rt = this.U[bt][k + 1], this.U[bt][k + 1] = this.U[bt][k], this.U[bt][k] = Rt;
1555
+ k++;
1556
+ }
1557
+ Z = 0, u--;
1558
+ break;
1559
+ }
1560
+ }
1561
+ return {
1562
+ U: this.U,
1563
+ V: this.V,
1564
+ S: this.s
1565
+ };
1566
+ }, v.hypot = function(s, n) {
1567
+ var t = void 0;
1568
+ return Math.abs(s) > Math.abs(n) ? (t = n / s, t = Math.abs(s) * Math.sqrt(1 + t * t)) : n != 0 ? (t = s / n, t = Math.abs(n) * Math.sqrt(1 + t * t)) : t = 0, t;
1569
+ }, w.exports = v;
1570
+ }),
1571
+ (function(w, U, N) {
1572
+ "use strict";
1573
+ var v = /* @__PURE__ */ (function() {
1574
+ function n(t, a) {
1575
+ for (var h = 0; h < a.length; h++) {
1576
+ var e = a[h];
1577
+ e.enumerable = e.enumerable || !1, e.configurable = !0, "value" in e && (e.writable = !0), Object.defineProperty(t, e.key, e);
1578
+ }
1579
+ }
1580
+ return function(t, a, h) {
1581
+ return a && n(t.prototype, a), h && n(t, h), t;
1582
+ };
1583
+ })();
1584
+ function s(n, t) {
1585
+ if (!(n instanceof t)) throw new TypeError("Cannot call a class as a function");
1586
+ }
1587
+ w.exports = (function() {
1588
+ function n(t, a) {
1589
+ var h = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, d = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1590
+ s(this, n), this.sequence1 = t, this.sequence2 = a, this.match_score = h, this.mismatch_penalty = e, this.gap_penalty = d, this.iMax = t.length + 1, this.jMax = a.length + 1, this.grid = new Array(this.iMax);
1591
+ for (var r = 0; r < this.iMax; r++) {
1592
+ this.grid[r] = new Array(this.jMax);
1593
+ for (var i = 0; i < this.jMax; i++) this.grid[r][i] = 0;
1594
+ }
1595
+ this.tracebackGrid = new Array(this.iMax);
1596
+ for (var f = 0; f < this.iMax; f++) {
1597
+ this.tracebackGrid[f] = new Array(this.jMax);
1598
+ for (var l = 0; l < this.jMax; l++) this.tracebackGrid[f][l] = [
1599
+ null,
1600
+ null,
1601
+ null
1602
+ ];
1603
+ }
1604
+ this.alignments = [], this.score = -1, this.computeGrids();
1605
+ }
1606
+ return v(n, [
1607
+ {
1608
+ key: "getScore",
1609
+ value: function() {
1610
+ return this.score;
1611
+ }
1612
+ },
1613
+ {
1614
+ key: "getAlignments",
1615
+ value: function() {
1616
+ return this.alignments;
1617
+ }
1618
+ },
1619
+ {
1620
+ key: "computeGrids",
1621
+ value: function() {
1622
+ for (var a = 1; a < this.jMax; a++)
1623
+ this.grid[0][a] = this.grid[0][a - 1] + this.gap_penalty, this.tracebackGrid[0][a] = [
1624
+ !1,
1625
+ !1,
1626
+ !0
1627
+ ];
1628
+ for (var h = 1; h < this.iMax; h++)
1629
+ this.grid[h][0] = this.grid[h - 1][0] + this.gap_penalty, this.tracebackGrid[h][0] = [
1630
+ !1,
1631
+ !0,
1632
+ !1
1633
+ ];
1634
+ for (var e = 1; e < this.iMax; e++) for (var d = 1; d < this.jMax; d++) {
1635
+ var r = void 0;
1636
+ this.sequence1[e - 1] === this.sequence2[d - 1] ? r = this.grid[e - 1][d - 1] + this.match_score : r = this.grid[e - 1][d - 1] + this.mismatch_penalty;
1637
+ var i = this.grid[e - 1][d] + this.gap_penalty, f = this.grid[e][d - 1] + this.gap_penalty, l = [
1638
+ r,
1639
+ i,
1640
+ f
1641
+ ], p = this.arrayAllMaxIndexes(l);
1642
+ this.grid[e][d] = l[p[0]], this.tracebackGrid[e][d] = [
1643
+ p.includes(0),
1644
+ p.includes(1),
1645
+ p.includes(2)
1646
+ ];
1647
+ }
1648
+ this.score = this.grid[this.iMax - 1][this.jMax - 1];
1649
+ }
1650
+ },
1651
+ {
1652
+ key: "alignmentTraceback",
1653
+ value: function() {
1654
+ var a = [];
1655
+ for (a.push({
1656
+ pos: [this.sequence1.length, this.sequence2.length],
1657
+ seq1: "",
1658
+ seq2: ""
1659
+ }); a[0]; ) {
1660
+ var h = a[0], e = this.tracebackGrid[h.pos[0]][h.pos[1]];
1661
+ e[0] && a.push({
1662
+ pos: [h.pos[0] - 1, h.pos[1] - 1],
1663
+ seq1: this.sequence1[h.pos[0] - 1] + h.seq1,
1664
+ seq2: this.sequence2[h.pos[1] - 1] + h.seq2
1665
+ }), e[1] && a.push({
1666
+ pos: [h.pos[0] - 1, h.pos[1]],
1667
+ seq1: this.sequence1[h.pos[0] - 1] + h.seq1,
1668
+ seq2: "-" + h.seq2
1669
+ }), e[2] && a.push({
1670
+ pos: [h.pos[0], h.pos[1] - 1],
1671
+ seq1: "-" + h.seq1,
1672
+ seq2: this.sequence2[h.pos[1] - 1] + h.seq2
1673
+ }), h.pos[0] === 0 && h.pos[1] === 0 && this.alignments.push({
1674
+ sequence1: h.seq1,
1675
+ sequence2: h.seq2
1676
+ }), a.shift();
1677
+ }
1678
+ return this.alignments;
1679
+ }
1680
+ },
1681
+ {
1682
+ key: "getAllIndexes",
1683
+ value: function(a, h) {
1684
+ for (var e = [], d = -1; (d = a.indexOf(h, d + 1)) !== -1; ) e.push(d);
1685
+ return e;
1686
+ }
1687
+ },
1688
+ {
1689
+ key: "arrayAllMaxIndexes",
1690
+ value: function(a) {
1691
+ return this.getAllIndexes(a, Math.max.apply(null, a));
1692
+ }
1693
+ }
1694
+ ]), n;
1695
+ })();
1696
+ }),
1697
+ (function(w, U, N) {
1698
+ "use strict";
1699
+ var v = function() {
1700
+ };
1701
+ v.FDLayout = N(18), v.FDLayoutConstants = N(4), v.FDLayoutEdge = N(19), v.FDLayoutNode = N(20), v.DimensionD = N(21), v.HashMap = N(22), v.HashSet = N(23), v.IGeometry = N(8), v.IMath = N(9), v.Integer = N(10), v.Point = N(12), v.PointD = N(5), v.RandomSeed = N(16), v.RectangleD = N(13), v.Transform = N(17), v.UniqueIDGeneretor = N(14), v.Quicksort = N(25), v.LinkedList = N(11), v.LGraphObject = N(2), v.LGraph = N(6), v.LEdge = N(1), v.LGraphManager = N(7), v.LNode = N(3), v.Layout = N(15), v.LayoutConstants = N(0), v.NeedlemanWunsch = N(27), v.Matrix = N(24), v.SVD = N(26), w.exports = v;
1702
+ }),
1703
+ (function(w, U, N) {
1704
+ "use strict";
1705
+ function v() {
1706
+ this.listeners = [];
1707
+ }
1708
+ var s = v.prototype;
1709
+ s.addListener = function(n, t) {
1710
+ this.listeners.push({
1711
+ event: n,
1712
+ callback: t
1713
+ });
1714
+ }, s.removeListener = function(n, t) {
1715
+ for (var a = this.listeners.length; a >= 0; a--) {
1716
+ var h = this.listeners[a];
1717
+ h.event === n && h.callback === t && this.listeners.splice(a, 1);
1718
+ }
1719
+ }, s.emit = function(n, t) {
1720
+ for (var a = 0; a < this.listeners.length; a++) {
1721
+ var h = this.listeners[a];
1722
+ n === h.event && h.callback(t);
1723
+ }
1724
+ }, w.exports = v;
1725
+ })
1726
+ ]);
1727
+ });
1728
+ })), Ce = /* @__PURE__ */ de(((L, F) => {
1729
+ (function(U, N) {
1730
+ typeof L == "object" && typeof F == "object" ? F.exports = N(we()) : typeof define == "function" && define.amd ? define(["layout-base"], N) : typeof L == "object" ? L.coseBase = N(we()) : U.coseBase = N(U.layoutBase);
1731
+ })(L, function(w) {
1732
+ return (() => {
1733
+ "use strict";
1734
+ var U = {
1735
+ 45: ((s, n, t) => {
1736
+ var a = {};
1737
+ a.layoutBase = t(551), a.CoSEConstants = t(806), a.CoSEEdge = t(767), a.CoSEGraph = t(880), a.CoSEGraphManager = t(578), a.CoSELayout = t(765), a.CoSENode = t(991), a.ConstraintHandler = t(902), s.exports = a;
1738
+ }),
1739
+ 806: ((s, n, t) => {
1740
+ var a = t(551).FDLayoutConstants;
1741
+ function h() {
1742
+ }
1743
+ for (var e in a) h[e] = a[e];
1744
+ h.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, h.DEFAULT_RADIAL_SEPARATION = a.DEFAULT_EDGE_LENGTH, h.DEFAULT_COMPONENT_SEPERATION = 60, h.TILE = !0, h.TILING_PADDING_VERTICAL = 10, h.TILING_PADDING_HORIZONTAL = 10, h.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, h.ENFORCE_CONSTRAINTS = !0, h.APPLY_LAYOUT = !0, h.RELAX_MOVEMENT_ON_CONSTRAINTS = !0, h.TREE_REDUCTION_ON_INCREMENTAL = !0, h.PURE_INCREMENTAL = h.DEFAULT_INCREMENTAL, s.exports = h;
1745
+ }),
1746
+ 767: ((s, n, t) => {
1747
+ var a = t(551).FDLayoutEdge;
1748
+ function h(d, r, i) {
1749
+ a.call(this, d, r, i);
1750
+ }
1751
+ h.prototype = Object.create(a.prototype);
1752
+ for (var e in a) h[e] = a[e];
1753
+ s.exports = h;
1754
+ }),
1755
+ 880: ((s, n, t) => {
1756
+ var a = t(551).LGraph;
1757
+ function h(d, r, i) {
1758
+ a.call(this, d, r, i);
1759
+ }
1760
+ h.prototype = Object.create(a.prototype);
1761
+ for (var e in a) h[e] = a[e];
1762
+ s.exports = h;
1763
+ }),
1764
+ 578: ((s, n, t) => {
1765
+ var a = t(551).LGraphManager;
1766
+ function h(d) {
1767
+ a.call(this, d);
1768
+ }
1769
+ h.prototype = Object.create(a.prototype);
1770
+ for (var e in a) h[e] = a[e];
1771
+ s.exports = h;
1772
+ }),
1773
+ 765: ((s, n, t) => {
1774
+ var a = t(551).FDLayout, h = t(578), e = t(880), d = t(991), r = t(767), i = t(806), f = t(902), l = t(551).FDLayoutConstants, p = t(551).LayoutConstants, g = t(551).Point, c = t(551).PointD, T = t(551).DimensionD, A = t(551).Layout, I = t(551).Integer, S = t(551).IGeometry, Y = t(551).LGraph, V = t(551).Transform, z = t(551).LinkedList;
1775
+ function x() {
1776
+ a.call(this), this.toBeTiled = {}, this.constraints = {};
1777
+ }
1778
+ x.prototype = Object.create(a.prototype);
1779
+ for (var tt in a) x[tt] = a[tt];
1780
+ x.prototype.newGraphManager = function() {
1781
+ var o = new h(this);
1782
+ return this.graphManager = o, o;
1783
+ }, x.prototype.newGraph = function(o) {
1784
+ return new e(null, this.graphManager, o);
1785
+ }, x.prototype.newNode = function(o) {
1786
+ return new d(this.graphManager, o);
1787
+ }, x.prototype.newEdge = function(o) {
1788
+ return new r(null, null, o);
1789
+ }, x.prototype.initParameters = function() {
1790
+ a.prototype.initParameters.call(this, arguments), this.isSubLayout || (i.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = i.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = i.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);
1791
+ }, x.prototype.initSpringEmbedder = function() {
1792
+ a.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / l.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = 0.04, this.coolingAdjuster = 1;
1793
+ }, x.prototype.layout = function() {
1794
+ return p.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1795
+ }, x.prototype.classicLayout = function() {
1796
+ 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) {
1797
+ if (i.TREE_REDUCTION_ON_INCREMENTAL) {
1798
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1799
+ var m = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(C) {
1800
+ return m.has(C);
1801
+ });
1802
+ this.graphManager.setAllNodesToApplyGravitation(u);
1803
+ }
1804
+ } else {
1805
+ var o = this.getFlatForest();
1806
+ if (o.length > 0) this.positionNodesRadially(o);
1807
+ else {
1808
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1809
+ var m = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(E) {
1810
+ return m.has(E);
1811
+ });
1812
+ this.graphManager.setAllNodesToApplyGravitation(u), this.positionNodesRandomly();
1813
+ }
1814
+ }
1815
+ return Object.keys(this.constraints).length > 0 && (f.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), i.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
1816
+ }, x.prototype.tick = function() {
1817
+ if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1818
+ else return !0;
1819
+ if (this.totalIterations % l.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1820
+ if (this.isConverged()) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1821
+ else return !0;
1822
+ 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));
1823
+ }
1824
+ if (this.isTreeGrowing) {
1825
+ if (this.growTreeIterations % 10 == 0) if (this.prunedNodesAll.length > 0) {
1826
+ this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1827
+ var o = new Set(this.getAllNodes()), m = this.nodesWithGravity.filter(function(y) {
1828
+ return o.has(y);
1829
+ });
1830
+ this.graphManager.setAllNodesToApplyGravitation(m), this.graphManager.updateBounds(), this.updateGrid(), i.PURE_INCREMENTAL ? this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1831
+ } else
1832
+ this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1833
+ this.growTreeIterations++;
1834
+ }
1835
+ if (this.isGrowthFinished) {
1836
+ if (this.isConverged()) return !0;
1837
+ this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), i.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++;
1838
+ }
1839
+ var u = !this.isTreeGrowing && !this.isGrowthFinished, E = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1840
+ return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(u, E), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1841
+ }, x.prototype.getPositionsData = function() {
1842
+ for (var o = this.graphManager.getAllNodes(), m = {}, u = 0; u < o.length; u++) {
1843
+ var E = o[u].rect, y = o[u].id;
1844
+ m[y] = {
1845
+ id: y,
1846
+ x: E.getCenterX(),
1847
+ y: E.getCenterY(),
1848
+ w: E.width,
1849
+ h: E.height
1850
+ };
1851
+ }
1852
+ return m;
1853
+ }, x.prototype.runSpringEmbedder = function() {
1854
+ this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1855
+ var o = !1;
1856
+ if (l.ANIMATE === "during") this.emit("layoutstarted");
1857
+ else {
1858
+ for (; !o; ) o = this.tick();
1859
+ this.graphManager.updateBounds();
1860
+ }
1861
+ }, x.prototype.moveNodes = function() {
1862
+ for (var o = this.getAllNodes(), m, u = 0; u < o.length; u++)
1863
+ m = o[u], m.calculateDisplacement();
1864
+ Object.keys(this.constraints).length > 0 && this.updateDisplacements();
1865
+ for (var u = 0; u < o.length; u++)
1866
+ m = o[u], m.move();
1867
+ }, x.prototype.initConstraintVariables = function() {
1868
+ var o = this;
1869
+ this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
1870
+ for (var m = this.graphManager.getAllNodes(), u = 0; u < m.length; u++) {
1871
+ var E = m[u];
1872
+ this.idToNodeMap.set(E.id, E);
1873
+ }
1874
+ var y = function b(X) {
1875
+ for (var J = X.getChild().getNodes(), at, q = 0, Z = 0; Z < J.length; Z++)
1876
+ at = J[Z], at.getChild() == null ? o.fixedNodeSet.has(at.id) && (q += 100) : q += b(at);
1877
+ return q;
1878
+ };
1879
+ if (this.constraints.fixedNodeConstraint) {
1880
+ this.constraints.fixedNodeConstraint.forEach(function(J) {
1881
+ o.fixedNodeSet.add(J.nodeId);
1882
+ });
1883
+ for (var m = this.graphManager.getAllNodes(), E, u = 0; u < m.length; u++)
1884
+ if (E = m[u], E.getChild() != null) {
1885
+ var C = y(E);
1886
+ C > 0 && (E.fixedNodeWeight = C);
1887
+ }
1888
+ }
1889
+ if (this.constraints.relativePlacementConstraint) {
1890
+ var M = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map();
1891
+ 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(b) {
1892
+ o.fixedNodesOnHorizontal.add(b), o.fixedNodesOnVertical.add(b);
1893
+ }), this.constraints.alignmentConstraint) {
1894
+ if (this.constraints.alignmentConstraint.vertical)
1895
+ for (var O = this.constraints.alignmentConstraint.vertical, u = 0; u < O.length; u++)
1896
+ this.dummyToNodeForVerticalAlignment.set("dummy" + u, []), O[u].forEach(function(X) {
1897
+ M.set(X, "dummy" + u), o.dummyToNodeForVerticalAlignment.get("dummy" + u).push(X), o.fixedNodeSet.has(X) && o.fixedNodesOnHorizontal.add("dummy" + u);
1898
+ });
1899
+ if (this.constraints.alignmentConstraint.horizontal)
1900
+ for (var R = this.constraints.alignmentConstraint.horizontal, u = 0; u < R.length; u++)
1901
+ this.dummyToNodeForHorizontalAlignment.set("dummy" + u, []), R[u].forEach(function(X) {
1902
+ G.set(X, "dummy" + u), o.dummyToNodeForHorizontalAlignment.get("dummy" + u).push(X), o.fixedNodeSet.has(X) && o.fixedNodesOnVertical.add("dummy" + u);
1903
+ });
1904
+ }
1905
+ if (i.RELAX_MOVEMENT_ON_CONSTRAINTS)
1906
+ this.shuffle = function(b) {
1907
+ var X, J, at;
1908
+ for (at = b.length - 1; at >= 2 * b.length / 3; at--)
1909
+ X = Math.floor(Math.random() * (at + 1)), J = b[at], b[at] = b[X], b[X] = J;
1910
+ return b;
1911
+ }, 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(b) {
1912
+ if (b.left) {
1913
+ var X = M.has(b.left) ? M.get(b.left) : b.left, J = M.has(b.right) ? M.get(b.right) : b.right;
1914
+ o.nodesInRelativeHorizontal.includes(X) || (o.nodesInRelativeHorizontal.push(X), o.nodeToRelativeConstraintMapHorizontal.set(X, []), o.dummyToNodeForVerticalAlignment.has(X) ? o.nodeToTempPositionMapHorizontal.set(X, o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()) : o.nodeToTempPositionMapHorizontal.set(X, o.idToNodeMap.get(X).getCenterX())), o.nodesInRelativeHorizontal.includes(J) || (o.nodesInRelativeHorizontal.push(J), o.nodeToRelativeConstraintMapHorizontal.set(J, []), o.dummyToNodeForVerticalAlignment.has(J) ? o.nodeToTempPositionMapHorizontal.set(J, o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(J)[0]).getCenterX()) : o.nodeToTempPositionMapHorizontal.set(J, o.idToNodeMap.get(J).getCenterX())), o.nodeToRelativeConstraintMapHorizontal.get(X).push({
1915
+ right: J,
1916
+ gap: b.gap
1917
+ }), o.nodeToRelativeConstraintMapHorizontal.get(J).push({
1918
+ left: X,
1919
+ gap: b.gap
1920
+ });
1921
+ } else {
1922
+ var at = G.has(b.top) ? G.get(b.top) : b.top, q = G.has(b.bottom) ? G.get(b.bottom) : b.bottom;
1923
+ o.nodesInRelativeVertical.includes(at) || (o.nodesInRelativeVertical.push(at), o.nodeToRelativeConstraintMapVertical.set(at, []), o.dummyToNodeForHorizontalAlignment.has(at) ? o.nodeToTempPositionMapVertical.set(at, o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(at)[0]).getCenterY()) : o.nodeToTempPositionMapVertical.set(at, o.idToNodeMap.get(at).getCenterY())), o.nodesInRelativeVertical.includes(q) || (o.nodesInRelativeVertical.push(q), o.nodeToRelativeConstraintMapVertical.set(q, []), o.dummyToNodeForHorizontalAlignment.has(q) ? o.nodeToTempPositionMapVertical.set(q, o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(q)[0]).getCenterY()) : o.nodeToTempPositionMapVertical.set(q, o.idToNodeMap.get(q).getCenterY())), o.nodeToRelativeConstraintMapVertical.get(at).push({
1924
+ bottom: q,
1925
+ gap: b.gap
1926
+ }), o.nodeToRelativeConstraintMapVertical.get(q).push({
1927
+ top: at,
1928
+ gap: b.gap
1929
+ });
1930
+ }
1931
+ });
1932
+ else {
1933
+ var W = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
1934
+ this.constraints.relativePlacementConstraint.forEach(function(b) {
1935
+ if (b.left) {
1936
+ var X = M.has(b.left) ? M.get(b.left) : b.left, J = M.has(b.right) ? M.get(b.right) : b.right;
1937
+ W.has(X) ? W.get(X).push(J) : W.set(X, [J]), W.has(J) ? W.get(J).push(X) : W.set(J, [X]);
1938
+ } else {
1939
+ var at = G.has(b.top) ? G.get(b.top) : b.top, q = G.has(b.bottom) ? G.get(b.bottom) : b.bottom;
1940
+ B.has(at) ? B.get(at).push(q) : B.set(at, [q]), B.has(q) ? B.get(q).push(at) : B.set(q, [at]);
1941
+ }
1942
+ });
1943
+ var rt = function(X, J) {
1944
+ var at = [], q = [], Z = new z(), Et = /* @__PURE__ */ new Set(), ft = 0;
1945
+ return X.forEach(function(k, mt) {
1946
+ if (!Et.has(mt)) {
1947
+ at[ft] = [], q[ft] = !1;
1948
+ var ot = mt;
1949
+ for (Z.push(ot), Et.add(ot), at[ft].push(ot); Z.length != 0; )
1950
+ ot = Z.shift(), J.has(ot) && (q[ft] = !0), X.get(ot).forEach(function(wt) {
1951
+ Et.has(wt) || (Z.push(wt), Et.add(wt), at[ft].push(wt));
1952
+ });
1953
+ ft++;
1954
+ }
1955
+ }), {
1956
+ components: at,
1957
+ isFixed: q
1958
+ };
1959
+ }, K = rt(W, o.fixedNodesOnHorizontal);
1960
+ this.componentsOnHorizontal = K.components, this.fixedComponentsOnHorizontal = K.isFixed;
1961
+ var P = rt(B, o.fixedNodesOnVertical);
1962
+ this.componentsOnVertical = P.components, this.fixedComponentsOnVertical = P.isFixed;
1963
+ }
1964
+ }
1965
+ }, x.prototype.updateDisplacements = function() {
1966
+ var o = this;
1967
+ if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function(P) {
1968
+ var b = o.idToNodeMap.get(P.nodeId);
1969
+ b.displacementX = 0, b.displacementY = 0;
1970
+ }), this.constraints.alignmentConstraint) {
1971
+ if (this.constraints.alignmentConstraint.vertical)
1972
+ for (var m = this.constraints.alignmentConstraint.vertical, u = 0; u < m.length; u++) {
1973
+ for (var E = 0, y = 0; y < m[u].length; y++) {
1974
+ if (this.fixedNodeSet.has(m[u][y])) {
1975
+ E = 0;
1976
+ break;
1977
+ }
1978
+ E += this.idToNodeMap.get(m[u][y]).displacementX;
1979
+ }
1980
+ for (var C = E / m[u].length, y = 0; y < m[u].length; y++) this.idToNodeMap.get(m[u][y]).displacementX = C;
1981
+ }
1982
+ if (this.constraints.alignmentConstraint.horizontal)
1983
+ for (var M = this.constraints.alignmentConstraint.horizontal, u = 0; u < M.length; u++) {
1984
+ for (var G = 0, y = 0; y < M[u].length; y++) {
1985
+ if (this.fixedNodeSet.has(M[u][y])) {
1986
+ G = 0;
1987
+ break;
1988
+ }
1989
+ G += this.idToNodeMap.get(M[u][y]).displacementY;
1990
+ }
1991
+ for (var O = G / M[u].length, y = 0; y < M[u].length; y++) this.idToNodeMap.get(M[u][y]).displacementY = O;
1992
+ }
1993
+ }
1994
+ if (this.constraints.relativePlacementConstraint) if (i.RELAX_MOVEMENT_ON_CONSTRAINTS)
1995
+ this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function(P) {
1996
+ if (!o.fixedNodesOnHorizontal.has(P)) {
1997
+ var b = 0;
1998
+ o.dummyToNodeForVerticalAlignment.has(P) ? b = o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(P)[0]).displacementX : b = o.idToNodeMap.get(P).displacementX, o.nodeToRelativeConstraintMapHorizontal.get(P).forEach(function(X) {
1999
+ if (X.right) {
2000
+ var J = o.nodeToTempPositionMapHorizontal.get(X.right) - o.nodeToTempPositionMapHorizontal.get(P) - b;
2001
+ J < X.gap && (b -= X.gap - J);
2002
+ } else {
2003
+ var J = o.nodeToTempPositionMapHorizontal.get(P) - o.nodeToTempPositionMapHorizontal.get(X.left) + b;
2004
+ J < X.gap && (b += X.gap - J);
2005
+ }
2006
+ }), o.nodeToTempPositionMapHorizontal.set(P, o.nodeToTempPositionMapHorizontal.get(P) + b), o.dummyToNodeForVerticalAlignment.has(P) ? o.dummyToNodeForVerticalAlignment.get(P).forEach(function(X) {
2007
+ o.idToNodeMap.get(X).displacementX = b;
2008
+ }) : o.idToNodeMap.get(P).displacementX = b;
2009
+ }
2010
+ }), this.nodesInRelativeVertical.forEach(function(P) {
2011
+ if (!o.fixedNodesOnHorizontal.has(P)) {
2012
+ var b = 0;
2013
+ o.dummyToNodeForHorizontalAlignment.has(P) ? b = o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(P)[0]).displacementY : b = o.idToNodeMap.get(P).displacementY, o.nodeToRelativeConstraintMapVertical.get(P).forEach(function(X) {
2014
+ if (X.bottom) {
2015
+ var J = o.nodeToTempPositionMapVertical.get(X.bottom) - o.nodeToTempPositionMapVertical.get(P) - b;
2016
+ J < X.gap && (b -= X.gap - J);
2017
+ } else {
2018
+ var J = o.nodeToTempPositionMapVertical.get(P) - o.nodeToTempPositionMapVertical.get(X.top) + b;
2019
+ J < X.gap && (b += X.gap - J);
2020
+ }
2021
+ }), o.nodeToTempPositionMapVertical.set(P, o.nodeToTempPositionMapVertical.get(P) + b), o.dummyToNodeForHorizontalAlignment.has(P) ? o.dummyToNodeForHorizontalAlignment.get(P).forEach(function(X) {
2022
+ o.idToNodeMap.get(X).displacementY = b;
2023
+ }) : o.idToNodeMap.get(P).displacementY = b;
2024
+ }
2025
+ });
2026
+ else {
2027
+ for (var u = 0; u < this.componentsOnHorizontal.length; u++) {
2028
+ var R = this.componentsOnHorizontal[u];
2029
+ if (this.fixedComponentsOnHorizontal[u]) for (var y = 0; y < R.length; y++) this.dummyToNodeForVerticalAlignment.has(R[y]) ? this.dummyToNodeForVerticalAlignment.get(R[y]).forEach(function(X) {
2030
+ o.idToNodeMap.get(X).displacementX = 0;
2031
+ }) : this.idToNodeMap.get(R[y]).displacementX = 0;
2032
+ else {
2033
+ for (var W = 0, B = 0, y = 0; y < R.length; y++) if (this.dummyToNodeForVerticalAlignment.has(R[y])) {
2034
+ var rt = this.dummyToNodeForVerticalAlignment.get(R[y]);
2035
+ W += rt.length * this.idToNodeMap.get(rt[0]).displacementX, B += rt.length;
2036
+ } else
2037
+ W += this.idToNodeMap.get(R[y]).displacementX, B++;
2038
+ for (var K = W / B, y = 0; y < R.length; y++) this.dummyToNodeForVerticalAlignment.has(R[y]) ? this.dummyToNodeForVerticalAlignment.get(R[y]).forEach(function(X) {
2039
+ o.idToNodeMap.get(X).displacementX = K;
2040
+ }) : this.idToNodeMap.get(R[y]).displacementX = K;
2041
+ }
2042
+ }
2043
+ for (var u = 0; u < this.componentsOnVertical.length; u++) {
2044
+ var R = this.componentsOnVertical[u];
2045
+ if (this.fixedComponentsOnVertical[u]) for (var y = 0; y < R.length; y++) this.dummyToNodeForHorizontalAlignment.has(R[y]) ? this.dummyToNodeForHorizontalAlignment.get(R[y]).forEach(function(J) {
2046
+ o.idToNodeMap.get(J).displacementY = 0;
2047
+ }) : this.idToNodeMap.get(R[y]).displacementY = 0;
2048
+ else {
2049
+ for (var W = 0, B = 0, y = 0; y < R.length; y++) if (this.dummyToNodeForHorizontalAlignment.has(R[y])) {
2050
+ var rt = this.dummyToNodeForHorizontalAlignment.get(R[y]);
2051
+ W += rt.length * this.idToNodeMap.get(rt[0]).displacementY, B += rt.length;
2052
+ } else
2053
+ W += this.idToNodeMap.get(R[y]).displacementY, B++;
2054
+ for (var K = W / B, y = 0; y < R.length; y++) this.dummyToNodeForHorizontalAlignment.has(R[y]) ? this.dummyToNodeForHorizontalAlignment.get(R[y]).forEach(function(Z) {
2055
+ o.idToNodeMap.get(Z).displacementY = K;
2056
+ }) : this.idToNodeMap.get(R[y]).displacementY = K;
2057
+ }
2058
+ }
2059
+ }
2060
+ }, x.prototype.calculateNodesToApplyGravitationTo = function() {
2061
+ var o = [], m, u = this.graphManager.getGraphs(), E = u.length, y;
2062
+ for (y = 0; y < E; y++)
2063
+ m = u[y], m.updateConnected(), m.isConnected || (o = o.concat(m.getNodes()));
2064
+ return o;
2065
+ }, x.prototype.createBendpoints = function() {
2066
+ var o = [];
2067
+ o = o.concat(this.graphManager.getAllEdges());
2068
+ var m = /* @__PURE__ */ new Set(), u;
2069
+ for (u = 0; u < o.length; u++) {
2070
+ var E = o[u];
2071
+ if (!m.has(E)) {
2072
+ var y = E.getSource(), C = E.getTarget();
2073
+ if (y == C)
2074
+ E.getBendpoints().push(new c()), E.getBendpoints().push(new c()), this.createDummyNodesForBendpoints(E), m.add(E);
2075
+ else {
2076
+ var M = [];
2077
+ if (M = M.concat(y.getEdgeListToNode(C)), M = M.concat(C.getEdgeListToNode(y)), !m.has(M[0])) {
2078
+ if (M.length > 1) {
2079
+ var G;
2080
+ for (G = 0; G < M.length; G++) {
2081
+ var O = M[G];
2082
+ O.getBendpoints().push(new c()), this.createDummyNodesForBendpoints(O);
2083
+ }
2084
+ }
2085
+ M.forEach(function(R) {
2086
+ m.add(R);
2087
+ });
2088
+ }
2089
+ }
2090
+ }
2091
+ if (m.size == o.length) break;
2092
+ }
2093
+ }, x.prototype.positionNodesRadially = function(o) {
2094
+ for (var m = new g(0, 0), u = Math.ceil(Math.sqrt(o.length)), E = 0, y = 0, C = 0, M = new c(0, 0), G = 0; G < o.length; G++) {
2095
+ G % u == 0 && (C = 0, y = E, G != 0 && (y += i.DEFAULT_COMPONENT_SEPERATION), E = 0);
2096
+ var O = o[G], R = A.findCenterOfTree(O);
2097
+ m.x = C, m.y = y, M = x.radialLayout(O, R, m), M.y > E && (E = Math.floor(M.y)), C = Math.floor(M.x + i.DEFAULT_COMPONENT_SEPERATION);
2098
+ }
2099
+ this.transform(new c(p.WORLD_CENTER_X - M.x / 2, p.WORLD_CENTER_Y - M.y / 2));
2100
+ }, x.radialLayout = function(o, m, u) {
2101
+ var E = Math.max(this.maxDiagonalInTree(o), i.DEFAULT_RADIAL_SEPARATION);
2102
+ x.branchRadialLayout(m, null, 0, 359, 0, E);
2103
+ var y = Y.calculateBounds(o), C = new V();
2104
+ C.setDeviceOrgX(y.getMinX()), C.setDeviceOrgY(y.getMinY()), C.setWorldOrgX(u.x), C.setWorldOrgY(u.y);
2105
+ for (var M = 0; M < o.length; M++) o[M].transform(C);
2106
+ var G = new c(y.getMaxX(), y.getMaxY());
2107
+ return C.inverseTransformPoint(G);
2108
+ }, x.branchRadialLayout = function(o, m, u, E, y, C) {
2109
+ var M = (E - u + 1) / 2;
2110
+ M < 0 && (M += 180);
2111
+ var G = (M + u) % 360 * S.TWO_PI / 360, O = y * Math.cos(G), R = y * Math.sin(G);
2112
+ o.setCenter(O, R);
2113
+ var W = [];
2114
+ W = W.concat(o.getEdges());
2115
+ var B = W.length;
2116
+ m != null && B--;
2117
+ for (var rt = 0, K = W.length, P, b = o.getEdgesBetween(m); b.length > 1; ) {
2118
+ var X = b[0];
2119
+ b.splice(0, 1);
2120
+ var J = W.indexOf(X);
2121
+ J >= 0 && W.splice(J, 1), K--, B--;
2122
+ }
2123
+ m != null ? P = (W.indexOf(b[0]) + 1) % K : P = 0;
2124
+ for (var at = Math.abs(E - u) / B, q = P; rt != B; q = ++q % K) {
2125
+ var Z = W[q].getOtherEnd(o);
2126
+ if (Z != m) {
2127
+ var Et = (u + rt * at) % 360, ft = (Et + at) % 360;
2128
+ x.branchRadialLayout(Z, o, Et, ft, y + C, C), rt++;
2129
+ }
2130
+ }
2131
+ }, x.maxDiagonalInTree = function(o) {
2132
+ for (var m = I.MIN_VALUE, u = 0; u < o.length; u++) {
2133
+ var E = o[u].getDiagonal();
2134
+ E > m && (m = E);
2135
+ }
2136
+ return m;
2137
+ }, x.prototype.calcRepulsionRange = function() {
2138
+ return 2 * (this.level + 1) * this.idealEdgeLength;
2139
+ }, x.prototype.groupZeroDegreeMembers = function() {
2140
+ var o = this, m = {};
2141
+ this.memberGroups = {}, this.idToDummyNode = {};
2142
+ for (var u = [], E = this.graphManager.getAllNodes(), y = 0; y < E.length; y++) {
2143
+ var C = E[y], M = C.getParent();
2144
+ this.getNodeDegreeWithChildren(C) === 0 && (M.id == null || !this.getToBeTiled(M)) && u.push(C);
2145
+ }
2146
+ for (var y = 0; y < u.length; y++) {
2147
+ var C = u[y], G = C.getParent().id;
2148
+ typeof m[G] > "u" && (m[G] = []), m[G] = m[G].concat(C);
2149
+ }
2150
+ Object.keys(m).forEach(function(O) {
2151
+ if (m[O].length > 1) {
2152
+ var R = "DummyCompound_" + O;
2153
+ o.memberGroups[R] = m[O];
2154
+ var W = m[O][0].getParent(), B = new d(o.graphManager);
2155
+ B.id = R, B.paddingLeft = W.paddingLeft || 0, B.paddingRight = W.paddingRight || 0, B.paddingBottom = W.paddingBottom || 0, B.paddingTop = W.paddingTop || 0, o.idToDummyNode[R] = B;
2156
+ var rt = o.getGraphManager().add(o.newGraph(), B), K = W.getChild();
2157
+ K.add(B);
2158
+ for (var P = 0; P < m[O].length; P++) {
2159
+ var b = m[O][P];
2160
+ K.remove(b), rt.add(b);
2161
+ }
2162
+ }
2163
+ });
2164
+ }, x.prototype.clearCompounds = function() {
2165
+ var o = {}, m = {};
2166
+ this.performDFSOnCompounds();
2167
+ for (var u = 0; u < this.compoundOrder.length; u++)
2168
+ m[this.compoundOrder[u].id] = this.compoundOrder[u], o[this.compoundOrder[u].id] = [].concat(this.compoundOrder[u].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[u].getChild()), this.compoundOrder[u].child = null;
2169
+ this.graphManager.resetAllNodes(), this.tileCompoundMembers(o, m);
2170
+ }, x.prototype.clearZeroDegreeMembers = function() {
2171
+ var o = this, m = this.tiledZeroDegreePack = [];
2172
+ Object.keys(this.memberGroups).forEach(function(u) {
2173
+ var E = o.idToDummyNode[u];
2174
+ if (m[u] = o.tileNodes(o.memberGroups[u], E.paddingLeft + E.paddingRight), E.rect.width = m[u].width, E.rect.height = m[u].height, E.setCenter(m[u].centerX, m[u].centerY), E.labelMarginLeft = 0, E.labelMarginTop = 0, i.NODE_DIMENSIONS_INCLUDE_LABELS) {
2175
+ var y = E.rect.width, C = E.rect.height;
2176
+ 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(C + E.labelHeight), E.labelMarginTop = E.labelHeight) : E.labelPosVertical == "center" && E.labelHeight > C ? (E.rect.y -= (E.labelHeight - C) / 2, E.setHeight(E.labelHeight), E.labelMarginTop = (E.labelHeight - C) / 2) : E.labelPosVertical == "bottom" && E.setHeight(C + E.labelHeight));
2177
+ }
2178
+ });
2179
+ }, x.prototype.repopulateCompounds = function() {
2180
+ for (var o = this.compoundOrder.length - 1; o >= 0; o--) {
2181
+ var m = this.compoundOrder[o], u = m.id, E = m.paddingLeft, y = m.paddingTop, C = m.labelMarginLeft, M = m.labelMarginTop;
2182
+ this.adjustLocations(this.tiledMemberPack[u], m.rect.x, m.rect.y, E, y, C, M);
2183
+ }
2184
+ }, x.prototype.repopulateZeroDegreeMembers = function() {
2185
+ var o = this, m = this.tiledZeroDegreePack;
2186
+ Object.keys(m).forEach(function(u) {
2187
+ var E = o.idToDummyNode[u], y = E.paddingLeft, C = E.paddingTop, M = E.labelMarginLeft, G = E.labelMarginTop;
2188
+ o.adjustLocations(m[u], E.rect.x, E.rect.y, y, C, M, G);
2189
+ });
2190
+ }, x.prototype.getToBeTiled = function(o) {
2191
+ var m = o.id;
2192
+ if (this.toBeTiled[m] != null) return this.toBeTiled[m];
2193
+ var u = o.getChild();
2194
+ if (u == null)
2195
+ return this.toBeTiled[m] = !1, !1;
2196
+ for (var E = u.getNodes(), y = 0; y < E.length; y++) {
2197
+ var C = E[y];
2198
+ if (this.getNodeDegree(C) > 0)
2199
+ return this.toBeTiled[m] = !1, !1;
2200
+ if (C.getChild() == null) {
2201
+ this.toBeTiled[C.id] = !1;
2202
+ continue;
2203
+ }
2204
+ if (!this.getToBeTiled(C))
2205
+ return this.toBeTiled[m] = !1, !1;
2206
+ }
2207
+ return this.toBeTiled[m] = !0, !0;
2208
+ }, x.prototype.getNodeDegree = function(o) {
2209
+ o.id;
2210
+ for (var m = o.getEdges(), u = 0, E = 0; E < m.length; E++) {
2211
+ var y = m[E];
2212
+ y.getSource().id !== y.getTarget().id && (u = u + 1);
2213
+ }
2214
+ return u;
2215
+ }, x.prototype.getNodeDegreeWithChildren = function(o) {
2216
+ var m = this.getNodeDegree(o);
2217
+ if (o.getChild() == null) return m;
2218
+ for (var u = o.getChild().getNodes(), E = 0; E < u.length; E++) {
2219
+ var y = u[E];
2220
+ m += this.getNodeDegreeWithChildren(y);
2221
+ }
2222
+ return m;
2223
+ }, x.prototype.performDFSOnCompounds = function() {
2224
+ this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2225
+ }, x.prototype.fillCompexOrderByDFS = function(o) {
2226
+ for (var m = 0; m < o.length; m++) {
2227
+ var u = o[m];
2228
+ u.getChild() != null && this.fillCompexOrderByDFS(u.getChild().getNodes()), this.getToBeTiled(u) && this.compoundOrder.push(u);
2229
+ }
2230
+ }, x.prototype.adjustLocations = function(o, m, u, E, y, C, M) {
2231
+ m += E + C, u += y + M;
2232
+ for (var G = m, O = 0; O < o.rows.length; O++) {
2233
+ var R = o.rows[O];
2234
+ m = G;
2235
+ for (var W = 0, B = 0; B < R.length; B++) {
2236
+ var rt = R[B];
2237
+ rt.rect.x = m, rt.rect.y = u, m += rt.rect.width + o.horizontalPadding, rt.rect.height > W && (W = rt.rect.height);
2238
+ }
2239
+ u += W + o.verticalPadding;
2240
+ }
2241
+ }, x.prototype.tileCompoundMembers = function(o, m) {
2242
+ var u = this;
2243
+ this.tiledMemberPack = [], Object.keys(o).forEach(function(E) {
2244
+ var y = m[E];
2245
+ if (u.tiledMemberPack[E] = u.tileNodes(o[E], y.paddingLeft + y.paddingRight), y.rect.width = u.tiledMemberPack[E].width, y.rect.height = u.tiledMemberPack[E].height, y.setCenter(u.tiledMemberPack[E].centerX, u.tiledMemberPack[E].centerY), y.labelMarginLeft = 0, y.labelMarginTop = 0, i.NODE_DIMENSIONS_INCLUDE_LABELS) {
2246
+ var C = y.rect.width, M = y.rect.height;
2247
+ y.labelWidth && (y.labelPosHorizontal == "left" ? (y.rect.x -= y.labelWidth, y.setWidth(C + y.labelWidth), y.labelMarginLeft = y.labelWidth) : y.labelPosHorizontal == "center" && y.labelWidth > C ? (y.rect.x -= (y.labelWidth - C) / 2, y.setWidth(y.labelWidth), y.labelMarginLeft = (y.labelWidth - C) / 2) : y.labelPosHorizontal == "right" && y.setWidth(C + 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));
2248
+ }
2249
+ });
2250
+ }, x.prototype.tileNodes = function(o, m) {
2251
+ var u = this.tileNodesByFavoringDim(o, m, !0), E = this.tileNodesByFavoringDim(o, m, !1), y = this.getOrgRatio(u), C = this.getOrgRatio(E), M;
2252
+ return C < y ? M = E : M = u, M;
2253
+ }, x.prototype.getOrgRatio = function(o) {
2254
+ var m = o.width / o.height;
2255
+ return m < 1 && (m = 1 / m), m;
2256
+ }, x.prototype.calcIdealRowWidth = function(o, m) {
2257
+ var u = i.TILING_PADDING_VERTICAL, E = i.TILING_PADDING_HORIZONTAL, y = o.length, C = 0, M = 0, G = 0;
2258
+ o.forEach(function(P) {
2259
+ C += P.getWidth(), M += P.getHeight(), P.getWidth() > G && (G = P.getWidth());
2260
+ });
2261
+ var O = C / y, R = M / y, W = Math.pow(u - E, 2) + 4 * (O + E) * (R + u) * y, B = (E - u + Math.sqrt(W)) / (2 * (O + E)), rt;
2262
+ m ? (rt = Math.ceil(B), rt == B && rt++) : rt = Math.floor(B);
2263
+ var K = rt * (O + E) - E;
2264
+ return G > K && (K = G), K += E * 2, K;
2265
+ }, x.prototype.tileNodesByFavoringDim = function(o, m, u) {
2266
+ var E = i.TILING_PADDING_VERTICAL, y = i.TILING_PADDING_HORIZONTAL, C = i.TILING_COMPARE_BY, M = {
2267
+ rows: [],
2268
+ rowWidth: [],
2269
+ rowHeight: [],
2270
+ width: 0,
2271
+ height: m,
2272
+ verticalPadding: E,
2273
+ horizontalPadding: y,
2274
+ centerX: 0,
2275
+ centerY: 0
2276
+ };
2277
+ C && (M.idealRowWidth = this.calcIdealRowWidth(o, u));
2278
+ var G = function(b) {
2279
+ return b.rect.width * b.rect.height;
2280
+ }, O = function(b, X) {
2281
+ return G(X) - G(b);
2282
+ };
2283
+ o.sort(function(P, b) {
2284
+ var X = O;
2285
+ return M.idealRowWidth ? (X = C, X(P.id, b.id)) : X(P, b);
2286
+ });
2287
+ for (var R = 0, W = 0, B = 0; B < o.length; B++) {
2288
+ var rt = o[B];
2289
+ R += rt.getCenterX(), W += rt.getCenterY();
2290
+ }
2291
+ M.centerX = R / o.length, M.centerY = W / o.length;
2292
+ for (var B = 0; B < o.length; B++) {
2293
+ var rt = o[B];
2294
+ if (M.rows.length == 0) this.insertNodeToRow(M, rt, 0, m);
2295
+ else if (this.canAddHorizontal(M, rt.rect.width, rt.rect.height)) {
2296
+ var K = M.rows.length - 1;
2297
+ M.idealRowWidth || (K = this.getShortestRowIndex(M)), this.insertNodeToRow(M, rt, K, m);
2298
+ } else this.insertNodeToRow(M, rt, M.rows.length, m);
2299
+ this.shiftToLastRow(M);
2300
+ }
2301
+ return M;
2302
+ }, x.prototype.insertNodeToRow = function(o, m, u, E) {
2303
+ var y = E;
2304
+ u == o.rows.length && (o.rows.push([]), o.rowWidth.push(y), o.rowHeight.push(0));
2305
+ var C = o.rowWidth[u] + m.rect.width;
2306
+ o.rows[u].length > 0 && (C += o.horizontalPadding), o.rowWidth[u] = C, o.width < C && (o.width = C);
2307
+ var M = m.rect.height;
2308
+ u > 0 && (M += o.verticalPadding);
2309
+ var G = 0;
2310
+ M > o.rowHeight[u] && (G = o.rowHeight[u], o.rowHeight[u] = M, G = o.rowHeight[u] - G), o.height += G, o.rows[u].push(m);
2311
+ }, x.prototype.getShortestRowIndex = function(o) {
2312
+ for (var m = -1, u = Number.MAX_VALUE, E = 0; E < o.rows.length; E++) o.rowWidth[E] < u && (m = E, u = o.rowWidth[E]);
2313
+ return m;
2314
+ }, x.prototype.getLongestRowIndex = function(o) {
2315
+ for (var m = -1, u = Number.MIN_VALUE, E = 0; E < o.rows.length; E++) o.rowWidth[E] > u && (m = E, u = o.rowWidth[E]);
2316
+ return m;
2317
+ }, x.prototype.canAddHorizontal = function(o, m, u) {
2318
+ if (o.idealRowWidth) {
2319
+ var E = o.rows.length - 1;
2320
+ return o.rowWidth[E] + m + o.horizontalPadding <= o.idealRowWidth;
2321
+ }
2322
+ var y = this.getShortestRowIndex(o);
2323
+ if (y < 0) return !0;
2324
+ var C = o.rowWidth[y];
2325
+ if (C + o.horizontalPadding + m <= o.width) return !0;
2326
+ var M = 0;
2327
+ o.rowHeight[y] < u && y > 0 && (M = u + o.verticalPadding - o.rowHeight[y]);
2328
+ var G;
2329
+ o.width - C >= m + o.horizontalPadding ? G = (o.height + M) / (C + m + o.horizontalPadding) : G = (o.height + M) / o.width, M = u + o.verticalPadding;
2330
+ var O;
2331
+ return o.width < m ? O = (o.height + M) / m : O = (o.height + M) / o.width, O < 1 && (O = 1 / O), G < 1 && (G = 1 / G), G < O;
2332
+ }, x.prototype.shiftToLastRow = function(o) {
2333
+ var m = this.getLongestRowIndex(o), u = o.rowWidth.length - 1, E = o.rows[m], y = E[E.length - 1], C = y.width + o.horizontalPadding;
2334
+ if (o.width - o.rowWidth[u] > C && m != u) {
2335
+ E.splice(-1, 1), o.rows[u].push(y), o.rowWidth[m] = o.rowWidth[m] - C, o.rowWidth[u] = o.rowWidth[u] + C, o.width = o.rowWidth[instance.getLongestRowIndex(o)];
2336
+ for (var M = Number.MIN_VALUE, G = 0; G < E.length; G++) E[G].height > M && (M = E[G].height);
2337
+ m > 0 && (M += o.verticalPadding);
2338
+ var O = o.rowHeight[m] + o.rowHeight[u];
2339
+ o.rowHeight[m] = M, o.rowHeight[u] < y.height + o.verticalPadding && (o.rowHeight[u] = y.height + o.verticalPadding);
2340
+ var R = o.rowHeight[m] + o.rowHeight[u];
2341
+ o.height += R - O, this.shiftToLastRow(o);
2342
+ }
2343
+ }, x.prototype.tilingPreLayout = function() {
2344
+ i.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2345
+ }, x.prototype.tilingPostLayout = function() {
2346
+ i.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2347
+ }, x.prototype.reduceTrees = function() {
2348
+ for (var o = [], m = !0, u; m; ) {
2349
+ var E = this.graphManager.getAllNodes(), y = [];
2350
+ m = !1;
2351
+ for (var C = 0; C < E.length; C++)
2352
+ if (u = E[C], u.getEdges().length == 1 && !u.getEdges()[0].isInterGraph && u.getChild() == null) {
2353
+ if (i.PURE_INCREMENTAL) {
2354
+ var M = u.getEdges()[0].getOtherEnd(u), G = new T(u.getCenterX() - M.getCenterX(), u.getCenterY() - M.getCenterY());
2355
+ y.push([
2356
+ u,
2357
+ u.getEdges()[0],
2358
+ u.getOwner(),
2359
+ G
2360
+ ]);
2361
+ } else y.push([
2362
+ u,
2363
+ u.getEdges()[0],
2364
+ u.getOwner()
2365
+ ]);
2366
+ m = !0;
2367
+ }
2368
+ if (m == !0) {
2369
+ for (var O = [], R = 0; R < y.length; R++) y[R][0].getEdges().length == 1 && (O.push(y[R]), y[R][0].getOwner().remove(y[R][0]));
2370
+ o.push(O), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2371
+ }
2372
+ }
2373
+ this.prunedNodesAll = o;
2374
+ }, x.prototype.growTree = function(o) {
2375
+ for (var m = o[o.length - 1], u, E = 0; E < m.length; E++)
2376
+ u = m[E], this.findPlaceforPrunedNode(u), u[2].add(u[0]), u[2].add(u[1], u[1].source, u[1].target);
2377
+ o.splice(o.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2378
+ }, x.prototype.findPlaceforPrunedNode = function(o) {
2379
+ var m, u, E = o[0];
2380
+ if (E == o[1].source ? u = o[1].target : u = o[1].source, i.PURE_INCREMENTAL) E.setCenter(u.getCenterX() + o[3].getWidth(), u.getCenterY() + o[3].getHeight());
2381
+ else {
2382
+ var y = u.startX, C = u.finishX, M = u.startY, G = u.finishY, O = [
2383
+ 0,
2384
+ 0,
2385
+ 0,
2386
+ 0
2387
+ ];
2388
+ if (M > 0) for (var R = y; R <= C; R++) O[0] += this.grid[R][M - 1].length + this.grid[R][M].length - 1;
2389
+ if (C < this.grid.length - 1) for (var R = M; R <= G; R++) O[1] += this.grid[C + 1][R].length + this.grid[C][R].length - 1;
2390
+ if (G < this.grid[0].length - 1) for (var R = y; R <= C; R++) O[2] += this.grid[R][G + 1].length + this.grid[R][G].length - 1;
2391
+ if (y > 0) for (var R = M; R <= G; R++) O[3] += this.grid[y - 1][R].length + this.grid[y][R].length - 1;
2392
+ for (var W = I.MAX_VALUE, B, rt, K = 0; K < O.length; K++) O[K] < W ? (W = O[K], B = 1, rt = K) : O[K] == W && B++;
2393
+ if (B == 3 && W == 0)
2394
+ O[0] == 0 && O[1] == 0 && O[2] == 0 ? m = 1 : O[0] == 0 && O[1] == 0 && O[3] == 0 ? m = 0 : O[0] == 0 && O[2] == 0 && O[3] == 0 ? m = 3 : O[1] == 0 && O[2] == 0 && O[3] == 0 && (m = 2);
2395
+ else if (B == 2 && W == 0) {
2396
+ var P = Math.floor(Math.random() * 2);
2397
+ O[0] == 0 && O[1] == 0 ? P == 0 ? m = 0 : m = 1 : O[0] == 0 && O[2] == 0 ? P == 0 ? m = 0 : m = 2 : O[0] == 0 && O[3] == 0 ? P == 0 ? m = 0 : m = 3 : O[1] == 0 && O[2] == 0 ? P == 0 ? m = 1 : m = 2 : O[1] == 0 && O[3] == 0 ? P == 0 ? m = 1 : m = 3 : P == 0 ? m = 2 : m = 3;
2398
+ } else if (B == 4 && W == 0) {
2399
+ var P = Math.floor(Math.random() * 4);
2400
+ m = P;
2401
+ } else m = rt;
2402
+ m == 0 ? E.setCenter(u.getCenterX(), u.getCenterY() - u.getHeight() / 2 - l.DEFAULT_EDGE_LENGTH - E.getHeight() / 2) : m == 1 ? E.setCenter(u.getCenterX() + u.getWidth() / 2 + l.DEFAULT_EDGE_LENGTH + E.getWidth() / 2, u.getCenterY()) : m == 2 ? E.setCenter(u.getCenterX(), u.getCenterY() + u.getHeight() / 2 + l.DEFAULT_EDGE_LENGTH + E.getHeight() / 2) : E.setCenter(u.getCenterX() - u.getWidth() / 2 - l.DEFAULT_EDGE_LENGTH - E.getWidth() / 2, u.getCenterY());
2403
+ }
2404
+ }, s.exports = x;
2405
+ }),
2406
+ 991: ((s, n, t) => {
2407
+ var a = t(551).FDLayoutNode, h = t(551).IMath;
2408
+ function e(r, i, f, l) {
2409
+ a.call(this, r, i, f, l);
2410
+ }
2411
+ e.prototype = Object.create(a.prototype);
2412
+ for (var d in a) e[d] = a[d];
2413
+ e.prototype.calculateDisplacement = function() {
2414
+ var r = this.graphManager.getLayout();
2415
+ this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += r.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += r.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += r.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += r.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > r.coolingFactor * r.maxNodeDisplacement && (this.displacementX = r.coolingFactor * r.maxNodeDisplacement * h.sign(this.displacementX)), Math.abs(this.displacementY) > r.coolingFactor * r.maxNodeDisplacement && (this.displacementY = r.coolingFactor * r.maxNodeDisplacement * h.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
2416
+ }, e.prototype.propogateDisplacementToChildren = function(r, i) {
2417
+ for (var f = this.getChild().getNodes(), l, p = 0; p < f.length; p++)
2418
+ l = f[p], l.getChild() == null ? (l.displacementX += r, l.displacementY += i) : l.propogateDisplacementToChildren(r, i);
2419
+ }, e.prototype.move = function() {
2420
+ var r = this.graphManager.getLayout();
2421
+ (this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), r.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;
2422
+ }, e.prototype.setPred1 = function(r) {
2423
+ this.pred1 = r;
2424
+ }, e.prototype.getPred1 = function() {
2425
+ return pred1;
2426
+ }, e.prototype.getPred2 = function() {
2427
+ return pred2;
2428
+ }, e.prototype.setNext = function(r) {
2429
+ this.next = r;
2430
+ }, e.prototype.getNext = function() {
2431
+ return next;
2432
+ }, e.prototype.setProcessed = function(r) {
2433
+ this.processed = r;
2434
+ }, e.prototype.isProcessed = function() {
2435
+ return processed;
2436
+ }, s.exports = e;
2437
+ }),
2438
+ 902: ((s, n, t) => {
2439
+ function a(f) {
2440
+ if (Array.isArray(f)) {
2441
+ for (var l = 0, p = Array(f.length); l < f.length; l++) p[l] = f[l];
2442
+ return p;
2443
+ } else return Array.from(f);
2444
+ }
2445
+ var h = t(806), e = t(551).LinkedList, d = t(551).Matrix, r = t(551).SVD;
2446
+ function i() {
2447
+ }
2448
+ i.handleConstraints = function(f) {
2449
+ var l = {};
2450
+ l.fixedNodeConstraint = f.constraints.fixedNodeConstraint, l.alignmentConstraint = f.constraints.alignmentConstraint, l.relativePlacementConstraint = f.constraints.relativePlacementConstraint;
2451
+ for (var p = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), c = [], T = [], A = f.getAllNodes(), I = 0, S = 0; S < A.length; S++) {
2452
+ var Y = A[S];
2453
+ Y.getChild() == null && (g.set(Y.id, I++), c.push(Y.getCenterX()), T.push(Y.getCenterY()), p.set(Y.id, Y));
2454
+ }
2455
+ l.relativePlacementConstraint && l.relativePlacementConstraint.forEach(function(D) {
2456
+ !D.gap && D.gap != 0 && (D.left ? D.gap = h.DEFAULT_EDGE_LENGTH + p.get(D.left).getWidth() / 2 + p.get(D.right).getWidth() / 2 : D.gap = h.DEFAULT_EDGE_LENGTH + p.get(D.top).getHeight() / 2 + p.get(D.bottom).getHeight() / 2);
2457
+ });
2458
+ var V = function(H, $) {
2459
+ return {
2460
+ x: H.x - $.x,
2461
+ y: H.y - $.y
2462
+ };
2463
+ }, z = function(H) {
2464
+ var $ = 0, _ = 0;
2465
+ return H.forEach(function(Q) {
2466
+ $ += c[g.get(Q)], _ += T[g.get(Q)];
2467
+ }), {
2468
+ x: $ / H.size,
2469
+ y: _ / H.size
2470
+ };
2471
+ }, x = function(H, $, _, Q, j) {
2472
+ function pt(st, nt) {
2473
+ var ht = new Set(st), yt = !0, ut = !1, Rt = void 0;
2474
+ try {
2475
+ for (var It = nt[Symbol.iterator](), bt; !(yt = (bt = It.next()).done); yt = !0) {
2476
+ var Ot = bt.value;
2477
+ ht.add(Ot);
2478
+ }
2479
+ } catch (Tt) {
2480
+ ut = !0, Rt = Tt;
2481
+ } finally {
2482
+ try {
2483
+ !yt && It.return && It.return();
2484
+ } finally {
2485
+ if (ut) throw Rt;
2486
+ }
2487
+ }
2488
+ return ht;
2489
+ }
2490
+ var ct = /* @__PURE__ */ new Map();
2491
+ H.forEach(function(st, nt) {
2492
+ ct.set(nt, 0);
2493
+ }), H.forEach(function(st, nt) {
2494
+ st.forEach(function(ht) {
2495
+ ct.set(ht.id, ct.get(ht.id) + 1);
2496
+ });
2497
+ });
2498
+ var it = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Map(), Lt = new e();
2499
+ ct.forEach(function(st, nt) {
2500
+ st == 0 ? (Lt.push(nt), _ || ($ == "horizontal" ? it.set(nt, g.has(nt) ? c[g.get(nt)] : Q.get(nt)) : it.set(nt, g.has(nt) ? T[g.get(nt)] : Q.get(nt)))) : it.set(nt, Number.NEGATIVE_INFINITY), _ && dt.set(nt, /* @__PURE__ */ new Set([nt]));
2501
+ }), _ && j.forEach(function(st) {
2502
+ var nt = [];
2503
+ if (st.forEach(function(ut) {
2504
+ _.has(ut) && nt.push(ut);
2505
+ }), nt.length > 0) {
2506
+ var ht = 0;
2507
+ nt.forEach(function(ut) {
2508
+ $ == "horizontal" ? (it.set(ut, g.has(ut) ? c[g.get(ut)] : Q.get(ut)), ht += it.get(ut)) : (it.set(ut, g.has(ut) ? T[g.get(ut)] : Q.get(ut)), ht += it.get(ut));
2509
+ }), ht = ht / nt.length, st.forEach(function(ut) {
2510
+ _.has(ut) || it.set(ut, ht);
2511
+ });
2512
+ } else {
2513
+ var yt = 0;
2514
+ st.forEach(function(ut) {
2515
+ $ == "horizontal" ? yt += g.has(ut) ? c[g.get(ut)] : Q.get(ut) : yt += g.has(ut) ? T[g.get(ut)] : Q.get(ut);
2516
+ }), yt = yt / st.length, st.forEach(function(ut) {
2517
+ it.set(ut, yt);
2518
+ });
2519
+ }
2520
+ });
2521
+ for (var Mt = function() {
2522
+ var nt = Lt.shift();
2523
+ H.get(nt).forEach(function(ht) {
2524
+ if (it.get(ht.id) < it.get(nt) + ht.gap) if (_ && _.has(ht.id)) {
2525
+ var yt = void 0;
2526
+ if ($ == "horizontal" ? yt = g.has(ht.id) ? c[g.get(ht.id)] : Q.get(ht.id) : yt = g.has(ht.id) ? T[g.get(ht.id)] : Q.get(ht.id), it.set(ht.id, yt), yt < it.get(nt) + ht.gap) {
2527
+ var ut = it.get(nt) + ht.gap - yt;
2528
+ dt.get(nt).forEach(function(Rt) {
2529
+ it.set(Rt, it.get(Rt) - ut);
2530
+ });
2531
+ }
2532
+ } else it.set(ht.id, it.get(nt) + ht.gap);
2533
+ ct.set(ht.id, ct.get(ht.id) - 1), ct.get(ht.id) == 0 && Lt.push(ht.id), _ && dt.set(ht.id, pt(dt.get(nt), dt.get(ht.id)));
2534
+ });
2535
+ }; Lt.length != 0; ) Mt();
2536
+ if (_) {
2537
+ var et = /* @__PURE__ */ new Set();
2538
+ H.forEach(function(st, nt) {
2539
+ st.length == 0 && et.add(nt);
2540
+ });
2541
+ var Nt = [];
2542
+ dt.forEach(function(st, nt) {
2543
+ if (et.has(nt)) {
2544
+ var ht = !1, yt = !0, ut = !1, Rt = void 0;
2545
+ try {
2546
+ for (var It = st[Symbol.iterator](), bt; !(yt = (bt = It.next()).done); yt = !0) {
2547
+ var Ot = bt.value;
2548
+ _.has(Ot) && (ht = !0);
2549
+ }
2550
+ } catch (St) {
2551
+ ut = !0, Rt = St;
2552
+ } finally {
2553
+ try {
2554
+ !yt && It.return && It.return();
2555
+ } finally {
2556
+ if (ut) throw Rt;
2557
+ }
2558
+ }
2559
+ if (!ht) {
2560
+ var Tt = !1, Xt = void 0;
2561
+ Nt.forEach(function(St, Ut) {
2562
+ St.has([].concat(a(st))[0]) && (Tt = !0, Xt = Ut);
2563
+ }), Tt ? st.forEach(function(St) {
2564
+ Nt[Xt].add(St);
2565
+ }) : Nt.push(new Set(st));
2566
+ }
2567
+ }
2568
+ }), Nt.forEach(function(st, nt) {
2569
+ var ht = Number.POSITIVE_INFINITY, yt = Number.POSITIVE_INFINITY, ut = Number.NEGATIVE_INFINITY, Rt = Number.NEGATIVE_INFINITY, It = !0, bt = !1, Ot = void 0;
2570
+ try {
2571
+ for (var Tt = st[Symbol.iterator](), Xt; !(It = (Xt = Tt.next()).done); It = !0) {
2572
+ var St = Xt.value, Ut = void 0;
2573
+ $ == "horizontal" ? Ut = g.has(St) ? c[g.get(St)] : Q.get(St) : Ut = g.has(St) ? T[g.get(St)] : Q.get(St);
2574
+ var Jt = it.get(St);
2575
+ Ut < ht && (ht = Ut), Ut > ut && (ut = Ut), Jt < yt && (yt = Jt), Jt > Rt && (Rt = Jt);
2576
+ }
2577
+ } catch (te) {
2578
+ bt = !0, Ot = te;
2579
+ } finally {
2580
+ try {
2581
+ !It && Tt.return && Tt.return();
2582
+ } finally {
2583
+ if (bt) throw Ot;
2584
+ }
2585
+ }
2586
+ var oe = (ht + ut) / 2 - (yt + Rt) / 2, Qt = !0, Kt = !1, jt = void 0;
2587
+ try {
2588
+ for (var qt = st[Symbol.iterator](), ae; !(Qt = (ae = qt.next()).done); Qt = !0) {
2589
+ var _t = ae.value;
2590
+ it.set(_t, it.get(_t) + oe);
2591
+ }
2592
+ } catch (te) {
2593
+ Kt = !0, jt = te;
2594
+ } finally {
2595
+ try {
2596
+ !Qt && qt.return && qt.return();
2597
+ } finally {
2598
+ if (Kt) throw jt;
2599
+ }
2600
+ }
2601
+ });
2602
+ }
2603
+ return it;
2604
+ }, tt = function(H) {
2605
+ var $ = 0, _ = 0, Q = 0, j = 0;
2606
+ if (H.forEach(function(dt) {
2607
+ dt.left ? c[g.get(dt.left)] - c[g.get(dt.right)] >= 0 ? $++ : _++ : T[g.get(dt.top)] - T[g.get(dt.bottom)] >= 0 ? Q++ : j++;
2608
+ }), $ > _ && Q > j) for (var pt = 0; pt < g.size; pt++)
2609
+ c[pt] = -1 * c[pt], T[pt] = -1 * T[pt];
2610
+ else if ($ > _) for (var ct = 0; ct < g.size; ct++) c[ct] = -1 * c[ct];
2611
+ else if (Q > j) for (var it = 0; it < g.size; it++) T[it] = -1 * T[it];
2612
+ }, o = function(H) {
2613
+ var $ = [], _ = new e(), Q = /* @__PURE__ */ new Set(), j = 0;
2614
+ return H.forEach(function(pt, ct) {
2615
+ if (!Q.has(ct)) {
2616
+ $[j] = [];
2617
+ var it = ct;
2618
+ for (_.push(it), Q.add(it), $[j].push(it); _.length != 0; )
2619
+ it = _.shift(), H.get(it).forEach(function(dt) {
2620
+ Q.has(dt.id) || (_.push(dt.id), Q.add(dt.id), $[j].push(dt.id));
2621
+ });
2622
+ j++;
2623
+ }
2624
+ }), $;
2625
+ }, m = function(H) {
2626
+ var $ = /* @__PURE__ */ new Map();
2627
+ return H.forEach(function(_, Q) {
2628
+ $.set(Q, []);
2629
+ }), H.forEach(function(_, Q) {
2630
+ _.forEach(function(j) {
2631
+ $.get(Q).push(j), $.get(j.id).push({
2632
+ id: Q,
2633
+ gap: j.gap,
2634
+ direction: j.direction
2635
+ });
2636
+ });
2637
+ }), $;
2638
+ }, u = function(H) {
2639
+ var $ = /* @__PURE__ */ new Map();
2640
+ return H.forEach(function(_, Q) {
2641
+ $.set(Q, []);
2642
+ }), H.forEach(function(_, Q) {
2643
+ _.forEach(function(j) {
2644
+ $.get(j.id).push({
2645
+ id: Q,
2646
+ gap: j.gap,
2647
+ direction: j.direction
2648
+ });
2649
+ });
2650
+ }), $;
2651
+ }, E = [], y = [], C = !1, M = !1, G = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), W = [];
2652
+ if (l.fixedNodeConstraint && l.fixedNodeConstraint.forEach(function(D) {
2653
+ G.add(D.nodeId);
2654
+ }), l.relativePlacementConstraint && (l.relativePlacementConstraint.forEach(function(D) {
2655
+ D.left ? (O.has(D.left) ? O.get(D.left).push({
2656
+ id: D.right,
2657
+ gap: D.gap,
2658
+ direction: "horizontal"
2659
+ }) : O.set(D.left, [{
2660
+ id: D.right,
2661
+ gap: D.gap,
2662
+ direction: "horizontal"
2663
+ }]), O.has(D.right) || O.set(D.right, [])) : (O.has(D.top) ? O.get(D.top).push({
2664
+ id: D.bottom,
2665
+ gap: D.gap,
2666
+ direction: "vertical"
2667
+ }) : O.set(D.top, [{
2668
+ id: D.bottom,
2669
+ gap: D.gap,
2670
+ direction: "vertical"
2671
+ }]), O.has(D.bottom) || O.set(D.bottom, []));
2672
+ }), R = m(O), W = o(R)), h.TRANSFORM_ON_CONSTRAINT_HANDLING) {
2673
+ if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 1)
2674
+ l.fixedNodeConstraint.forEach(function(D, H) {
2675
+ E[H] = [D.position.x, D.position.y], y[H] = [c[g.get(D.nodeId)], T[g.get(D.nodeId)]];
2676
+ }), C = !0;
2677
+ else if (l.alignmentConstraint) (function() {
2678
+ var D = 0;
2679
+ if (l.alignmentConstraint.vertical) {
2680
+ for (var H = l.alignmentConstraint.vertical, $ = function(it) {
2681
+ var dt = /* @__PURE__ */ new Set();
2682
+ H[it].forEach(function(et) {
2683
+ dt.add(et);
2684
+ });
2685
+ var Lt = new Set([].concat(a(dt)).filter(function(et) {
2686
+ return G.has(et);
2687
+ })), Mt = void 0;
2688
+ Lt.size > 0 ? Mt = c[g.get(Lt.values().next().value)] : Mt = z(dt).x, H[it].forEach(function(et) {
2689
+ E[D] = [Mt, T[g.get(et)]], y[D] = [c[g.get(et)], T[g.get(et)]], D++;
2690
+ });
2691
+ }, _ = 0; _ < H.length; _++) $(_);
2692
+ C = !0;
2693
+ }
2694
+ if (l.alignmentConstraint.horizontal) {
2695
+ for (var Q = l.alignmentConstraint.horizontal, j = function(it) {
2696
+ var dt = /* @__PURE__ */ new Set();
2697
+ Q[it].forEach(function(et) {
2698
+ dt.add(et);
2699
+ });
2700
+ var Lt = new Set([].concat(a(dt)).filter(function(et) {
2701
+ return G.has(et);
2702
+ })), Mt = void 0;
2703
+ Lt.size > 0 ? Mt = c[g.get(Lt.values().next().value)] : Mt = z(dt).y, Q[it].forEach(function(et) {
2704
+ E[D] = [c[g.get(et)], Mt], y[D] = [c[g.get(et)], T[g.get(et)]], D++;
2705
+ });
2706
+ }, pt = 0; pt < Q.length; pt++) j(pt);
2707
+ C = !0;
2708
+ }
2709
+ l.relativePlacementConstraint && (M = !0);
2710
+ })();
2711
+ else if (l.relativePlacementConstraint) {
2712
+ for (var B = 0, rt = 0, K = 0; K < W.length; K++) W[K].length > B && (B = W[K].length, rt = K);
2713
+ if (B < R.size / 2)
2714
+ tt(l.relativePlacementConstraint), C = !1, M = !1;
2715
+ else {
2716
+ var P = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), X = [];
2717
+ W[rt].forEach(function(D) {
2718
+ O.get(D).forEach(function(H) {
2719
+ H.direction == "horizontal" ? (P.has(D) ? P.get(D).push(H) : P.set(D, [H]), P.has(H.id) || P.set(H.id, []), X.push({
2720
+ left: D,
2721
+ right: H.id
2722
+ })) : (b.has(D) ? b.get(D).push(H) : b.set(D, [H]), b.has(H.id) || b.set(H.id, []), X.push({
2723
+ top: D,
2724
+ bottom: H.id
2725
+ }));
2726
+ });
2727
+ }), tt(X), M = !1;
2728
+ var J = x(P, "horizontal"), at = x(b, "vertical");
2729
+ W[rt].forEach(function(D, H) {
2730
+ y[H] = [c[g.get(D)], T[g.get(D)]], E[H] = [], J.has(D) ? E[H][0] = J.get(D) : E[H][0] = c[g.get(D)], at.has(D) ? E[H][1] = at.get(D) : E[H][1] = T[g.get(D)];
2731
+ }), C = !0;
2732
+ }
2733
+ }
2734
+ if (C) {
2735
+ for (var q = void 0, Z = d.transpose(E), Et = d.transpose(y), ft = 0; ft < Z.length; ft++)
2736
+ Z[ft] = d.multGamma(Z[ft]), Et[ft] = d.multGamma(Et[ft]);
2737
+ var k = d.multMat(Z, d.transpose(Et)), mt = r.svd(k);
2738
+ q = d.multMat(mt.V, d.transpose(mt.U));
2739
+ for (var ot = 0; ot < g.size; ot++) {
2740
+ var wt = [c[ot], T[ot]], Wt = [q[0][0], q[1][0]], Dt = [q[0][1], q[1][1]];
2741
+ c[ot] = d.dotProduct(wt, Wt), T[ot] = d.dotProduct(wt, Dt);
2742
+ }
2743
+ M && tt(l.relativePlacementConstraint);
2744
+ }
2745
+ }
2746
+ if (h.ENFORCE_CONSTRAINTS) {
2747
+ if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 0) {
2748
+ var xt = {
2749
+ x: 0,
2750
+ y: 0
2751
+ };
2752
+ l.fixedNodeConstraint.forEach(function(D, H) {
2753
+ var $ = {
2754
+ x: c[g.get(D.nodeId)],
2755
+ y: T[g.get(D.nodeId)]
2756
+ }, _ = D.position, Q = V(_, $);
2757
+ xt.x += Q.x, xt.y += Q.y;
2758
+ }), xt.x /= l.fixedNodeConstraint.length, xt.y /= l.fixedNodeConstraint.length, c.forEach(function(D, H) {
2759
+ c[H] += xt.x;
2760
+ }), T.forEach(function(D, H) {
2761
+ T[H] += xt.y;
2762
+ }), l.fixedNodeConstraint.forEach(function(D) {
2763
+ c[g.get(D.nodeId)] = D.position.x, T[g.get(D.nodeId)] = D.position.y;
2764
+ });
2765
+ }
2766
+ if (l.alignmentConstraint) {
2767
+ if (l.alignmentConstraint.vertical)
2768
+ for (var Gt = l.alignmentConstraint.vertical, Vt = function(H) {
2769
+ var $ = /* @__PURE__ */ new Set();
2770
+ Gt[H].forEach(function(j) {
2771
+ $.add(j);
2772
+ });
2773
+ var _ = new Set([].concat(a($)).filter(function(j) {
2774
+ return G.has(j);
2775
+ })), Q = void 0;
2776
+ _.size > 0 ? Q = c[g.get(_.values().next().value)] : Q = z($).x, $.forEach(function(j) {
2777
+ G.has(j) || (c[g.get(j)] = Q);
2778
+ });
2779
+ }, Ft = 0; Ft < Gt.length; Ft++) Vt(Ft);
2780
+ if (l.alignmentConstraint.horizontal)
2781
+ for (var $t = l.alignmentConstraint.horizontal, Yt = function(H) {
2782
+ var $ = /* @__PURE__ */ new Set();
2783
+ $t[H].forEach(function(j) {
2784
+ $.add(j);
2785
+ });
2786
+ var _ = new Set([].concat(a($)).filter(function(j) {
2787
+ return G.has(j);
2788
+ })), Q = void 0;
2789
+ _.size > 0 ? Q = T[g.get(_.values().next().value)] : Q = z($).y, $.forEach(function(j) {
2790
+ G.has(j) || (T[g.get(j)] = Q);
2791
+ });
2792
+ }, Bt = 0; Bt < $t.length; Bt++) Yt(Bt);
2793
+ }
2794
+ l.relativePlacementConstraint && (function() {
2795
+ var D = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), pt = /* @__PURE__ */ new Set(), ct = /* @__PURE__ */ new Set();
2796
+ if (G.forEach(function(Pt) {
2797
+ pt.add(Pt), ct.add(Pt);
2798
+ }), l.alignmentConstraint) {
2799
+ if (l.alignmentConstraint.vertical)
2800
+ for (var it = l.alignmentConstraint.vertical, dt = function(vt) {
2801
+ $.set("dummy" + vt, []), it[vt].forEach(function(At) {
2802
+ D.set(At, "dummy" + vt), $.get("dummy" + vt).push(At), G.has(At) && pt.add("dummy" + vt);
2803
+ }), Q.set("dummy" + vt, c[g.get(it[vt][0])]);
2804
+ }, Lt = 0; Lt < it.length; Lt++) dt(Lt);
2805
+ if (l.alignmentConstraint.horizontal)
2806
+ for (var Mt = l.alignmentConstraint.horizontal, et = function(vt) {
2807
+ _.set("dummy" + vt, []), Mt[vt].forEach(function(At) {
2808
+ H.set(At, "dummy" + vt), _.get("dummy" + vt).push(At), G.has(At) && ct.add("dummy" + vt);
2809
+ }), j.set("dummy" + vt, T[g.get(Mt[vt][0])]);
2810
+ }, Nt = 0; Nt < Mt.length; Nt++) et(Nt);
2811
+ }
2812
+ var st = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Map(), ht = function(vt) {
2813
+ O.get(vt).forEach(function(At) {
2814
+ var Zt = void 0, zt = void 0;
2815
+ At.direction == "horizontal" ? (Zt = D.get(vt) ? D.get(vt) : vt, D.get(At.id) ? zt = {
2816
+ id: D.get(At.id),
2817
+ gap: At.gap,
2818
+ direction: At.direction
2819
+ } : zt = At, st.has(Zt) ? st.get(Zt).push(zt) : st.set(Zt, [zt]), st.has(zt.id) || st.set(zt.id, [])) : (Zt = H.get(vt) ? H.get(vt) : vt, H.get(At.id) ? zt = {
2820
+ id: H.get(At.id),
2821
+ gap: At.gap,
2822
+ direction: At.direction
2823
+ } : zt = At, nt.has(Zt) ? nt.get(Zt).push(zt) : nt.set(Zt, [zt]), nt.has(zt.id) || nt.set(zt.id, []));
2824
+ });
2825
+ }, yt = !0, ut = !1, Rt = void 0;
2826
+ try {
2827
+ for (var It = O.keys()[Symbol.iterator](), bt; !(yt = (bt = It.next()).done); yt = !0) {
2828
+ var Ot = bt.value;
2829
+ ht(Ot);
2830
+ }
2831
+ } catch (Pt) {
2832
+ ut = !0, Rt = Pt;
2833
+ } finally {
2834
+ try {
2835
+ !yt && It.return && It.return();
2836
+ } finally {
2837
+ if (ut) throw Rt;
2838
+ }
2839
+ }
2840
+ var Tt = m(st), Xt = m(nt), St = o(Tt), Ut = o(Xt), Jt = u(st), oe = u(nt), Qt = [], Kt = [];
2841
+ St.forEach(function(Pt, vt) {
2842
+ Qt[vt] = [], Pt.forEach(function(At) {
2843
+ Jt.get(At).length == 0 && Qt[vt].push(At);
2844
+ });
2845
+ }), Ut.forEach(function(Pt, vt) {
2846
+ Kt[vt] = [], Pt.forEach(function(At) {
2847
+ oe.get(At).length == 0 && Kt[vt].push(At);
2848
+ });
2849
+ });
2850
+ var jt = x(st, "horizontal", pt, Q, Qt), qt = x(nt, "vertical", ct, j, Kt), ae = function(vt) {
2851
+ $.get(vt) ? $.get(vt).forEach(function(At) {
2852
+ c[g.get(At)] = jt.get(vt);
2853
+ }) : c[g.get(vt)] = jt.get(vt);
2854
+ }, _t = !0, te = !1, me = void 0;
2855
+ try {
2856
+ for (var se = jt.keys()[Symbol.iterator](), Ee; !(_t = (Ee = se.next()).done); _t = !0) {
2857
+ var he = Ee.value;
2858
+ ae(he);
2859
+ }
2860
+ } catch (Pt) {
2861
+ te = !0, me = Pt;
2862
+ } finally {
2863
+ try {
2864
+ !_t && se.return && se.return();
2865
+ } finally {
2866
+ if (te) throw me;
2867
+ }
2868
+ }
2869
+ var We = function(vt) {
2870
+ _.get(vt) ? _.get(vt).forEach(function(At) {
2871
+ T[g.get(At)] = qt.get(vt);
2872
+ }) : T[g.get(vt)] = qt.get(vt);
2873
+ }, le = !0, Te = !1, Ne = void 0;
2874
+ try {
2875
+ for (var fe = qt.keys()[Symbol.iterator](), Le; !(le = (Le = fe.next()).done); le = !0) {
2876
+ var he = Le.value;
2877
+ We(he);
2878
+ }
2879
+ } catch (Pt) {
2880
+ Te = !0, Ne = Pt;
2881
+ } finally {
2882
+ try {
2883
+ !le && fe.return && fe.return();
2884
+ } finally {
2885
+ if (Te) throw Ne;
2886
+ }
2887
+ }
2888
+ })();
2889
+ }
2890
+ for (var Ct = 0; Ct < A.length; Ct++) {
2891
+ var gt = A[Ct];
2892
+ gt.getChild() == null && gt.setCenter(c[g.get(gt.id)], T[g.get(gt.id)]);
2893
+ }
2894
+ }, s.exports = i;
2895
+ }),
2896
+ 551: ((s) => {
2897
+ s.exports = w;
2898
+ })
2899
+ }, N = {};
2900
+ function v(s) {
2901
+ var n = N[s];
2902
+ if (n !== void 0) return n.exports;
2903
+ var t = N[s] = { exports: {} };
2904
+ return U[s](t, t.exports, v), t.exports;
2905
+ }
2906
+ return v(45);
2907
+ })();
2908
+ });
2909
+ })), hr = /* @__PURE__ */ de(((L, F) => {
2910
+ (function(U, N) {
2911
+ typeof L == "object" && typeof F == "object" ? F.exports = N(Ce()) : typeof define == "function" && define.amd ? define(["cose-base"], N) : typeof L == "object" ? L.cytoscapeFcose = N(Ce()) : U.cytoscapeFcose = N(U.coseBase);
2912
+ })(L, function(w) {
2913
+ return (() => {
2914
+ "use strict";
2915
+ var U = {
2916
+ 658: ((s) => {
2917
+ s.exports = Object.assign != null ? Object.assign.bind(Object) : function(n) {
2918
+ for (var t = arguments.length, a = Array(t > 1 ? t - 1 : 0), h = 1; h < t; h++) a[h - 1] = arguments[h];
2919
+ return a.forEach(function(e) {
2920
+ Object.keys(e).forEach(function(d) {
2921
+ return n[d] = e[d];
2922
+ });
2923
+ }), n;
2924
+ };
2925
+ }),
2926
+ 548: ((s, n, t) => {
2927
+ var a = /* @__PURE__ */ (function() {
2928
+ function d(r, i) {
2929
+ var f = [], l = !0, p = !1, g = void 0;
2930
+ try {
2931
+ for (var c = r[Symbol.iterator](), T; !(l = (T = c.next()).done) && (f.push(T.value), !(i && f.length === i)); l = !0)
2932
+ ;
2933
+ } catch (A) {
2934
+ p = !0, g = A;
2935
+ } finally {
2936
+ try {
2937
+ !l && c.return && c.return();
2938
+ } finally {
2939
+ if (p) throw g;
2940
+ }
2941
+ }
2942
+ return f;
2943
+ }
2944
+ return function(r, i) {
2945
+ if (Array.isArray(r)) return r;
2946
+ if (Symbol.iterator in Object(r)) return d(r, i);
2947
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
2948
+ };
2949
+ })(), h = t(140).layoutBase.LinkedList, e = {};
2950
+ e.getTopMostNodes = function(d) {
2951
+ for (var r = {}, i = 0; i < d.length; i++) r[d[i].id()] = !0;
2952
+ return d.filter(function(f, l) {
2953
+ typeof f == "number" && (f = l);
2954
+ for (var p = f.parent()[0]; p != null; ) {
2955
+ if (r[p.id()]) return !1;
2956
+ p = p.parent()[0];
2957
+ }
2958
+ return !0;
2959
+ });
2960
+ }, e.connectComponents = function(d, r, i, f) {
2961
+ var l = new h(), p = /* @__PURE__ */ new Set(), g = [], c = void 0, T = void 0, A = void 0, I = !1, S = 1, Y = [], V = [], z = function() {
2962
+ var tt = d.collection();
2963
+ V.push(tt);
2964
+ var o = i[0], m = d.collection();
2965
+ m.merge(o).merge(o.descendants().intersection(r)), g.push(o), m.forEach(function(y) {
2966
+ l.push(y), p.add(y), tt.merge(y);
2967
+ });
2968
+ for (var u = function() {
2969
+ o = l.shift();
2970
+ var C = d.collection();
2971
+ o.neighborhood().nodes().forEach(function(O) {
2972
+ r.intersection(o.edgesWith(O)).length > 0 && C.merge(O);
2973
+ });
2974
+ for (var M = 0; M < C.length; M++) {
2975
+ var G = C[M];
2976
+ c = i.intersection(G.union(G.ancestors())), c != null && !p.has(c[0]) && c.union(c.descendants()).forEach(function(O) {
2977
+ l.push(O), p.add(O), tt.merge(O), i.has(O) && g.push(O);
2978
+ });
2979
+ }
2980
+ }; l.length != 0; ) u();
2981
+ if (tt.forEach(function(y) {
2982
+ r.intersection(y.connectedEdges()).forEach(function(C) {
2983
+ tt.has(C.source()) && tt.has(C.target()) && tt.merge(C);
2984
+ });
2985
+ }), g.length == i.length && (I = !0), !I || I && S > 1) {
2986
+ T = g[0], A = T.connectedEdges().length, g.forEach(function(y) {
2987
+ y.connectedEdges().length < A && (A = y.connectedEdges().length, T = y);
2988
+ }), Y.push(T.id());
2989
+ var E = d.collection();
2990
+ E.merge(g[0]), g.forEach(function(y) {
2991
+ E.merge(y);
2992
+ }), g = [], i = i.difference(E), S++;
2993
+ }
2994
+ };
2995
+ do
2996
+ z();
2997
+ while (!I);
2998
+ return f && Y.length > 0 && f.set("dummy" + (f.size + 1), Y), V;
2999
+ }, e.relocateComponent = function(d, r, i) {
3000
+ if (!i.fixedNodeConstraint) {
3001
+ var f = Number.POSITIVE_INFINITY, l = Number.NEGATIVE_INFINITY, p = Number.POSITIVE_INFINITY, g = Number.NEGATIVE_INFINITY;
3002
+ if (i.quality == "draft") {
3003
+ var c = !0, T = !1, A = void 0;
3004
+ try {
3005
+ for (var I = r.nodeIndexes[Symbol.iterator](), S; !(c = (S = I.next()).done); c = !0) {
3006
+ var Y = S.value, V = a(Y, 2), z = V[0], x = V[1], tt = i.cy.getElementById(z);
3007
+ if (tt) {
3008
+ var o = tt.boundingBox(), m = r.xCoords[x] - o.w / 2, u = r.xCoords[x] + o.w / 2, E = r.yCoords[x] - o.h / 2, y = r.yCoords[x] + o.h / 2;
3009
+ m < f && (f = m), u > l && (l = u), E < p && (p = E), y > g && (g = y);
3010
+ }
3011
+ }
3012
+ } catch (R) {
3013
+ T = !0, A = R;
3014
+ } finally {
3015
+ try {
3016
+ !c && I.return && I.return();
3017
+ } finally {
3018
+ if (T) throw A;
3019
+ }
3020
+ }
3021
+ var C = d.x - (l + f) / 2, M = d.y - (g + p) / 2;
3022
+ r.xCoords = r.xCoords.map(function(R) {
3023
+ return R + C;
3024
+ }), r.yCoords = r.yCoords.map(function(R) {
3025
+ return R + M;
3026
+ });
3027
+ } else {
3028
+ Object.keys(r).forEach(function(R) {
3029
+ var W = r[R], B = W.getRect().x, rt = W.getRect().x + W.getRect().width, K = W.getRect().y, P = W.getRect().y + W.getRect().height;
3030
+ B < f && (f = B), rt > l && (l = rt), K < p && (p = K), P > g && (g = P);
3031
+ });
3032
+ var G = d.x - (l + f) / 2, O = d.y - (g + p) / 2;
3033
+ Object.keys(r).forEach(function(R) {
3034
+ var W = r[R];
3035
+ W.setCenter(W.getCenterX() + G, W.getCenterY() + O);
3036
+ });
3037
+ }
3038
+ }
3039
+ }, e.calcBoundingBox = function(d, r, i, f) {
3040
+ for (var l = Number.MAX_SAFE_INTEGER, p = Number.MIN_SAFE_INTEGER, g = Number.MAX_SAFE_INTEGER, c = Number.MIN_SAFE_INTEGER, T = void 0, A = void 0, I = void 0, S = void 0, Y = d.descendants().not(":parent"), V = Y.length, z = 0; z < V; z++) {
3041
+ var x = Y[z];
3042
+ T = r[f.get(x.id())] - x.width() / 2, A = r[f.get(x.id())] + x.width() / 2, I = i[f.get(x.id())] - x.height() / 2, S = i[f.get(x.id())] + x.height() / 2, l > T && (l = T), p < A && (p = A), g > I && (g = I), c < S && (c = S);
3043
+ }
3044
+ var tt = {};
3045
+ return tt.topLeftX = l, tt.topLeftY = g, tt.width = p - l, tt.height = c - g, tt;
3046
+ }, e.calcParentsWithoutChildren = function(d, r) {
3047
+ var i = d.collection();
3048
+ return r.nodes(":parent").forEach(function(f) {
3049
+ var l = !1;
3050
+ f.children().forEach(function(p) {
3051
+ p.css("display") != "none" && (l = !0);
3052
+ }), l || i.merge(f);
3053
+ }), i;
3054
+ }, s.exports = e;
3055
+ }),
3056
+ 816: ((s, n, t) => {
3057
+ var a = t(548), h = t(140).CoSELayout, e = t(140).CoSENode, d = t(140).layoutBase.PointD, r = t(140).layoutBase.DimensionD, i = t(140).layoutBase.LayoutConstants, f = t(140).layoutBase.FDLayoutConstants, l = t(140).CoSEConstants;
3058
+ s.exports = { coseLayout: function(g, c) {
3059
+ var T = g.cy, A = g.eles, I = A.nodes(), S = A.edges(), Y = void 0, V = void 0, z = void 0, x = {};
3060
+ g.randomize && (Y = c.nodeIndexes, V = c.xCoords, z = c.yCoords);
3061
+ var tt = function(O) {
3062
+ return typeof O == "function";
3063
+ }, o = function(O, R) {
3064
+ return tt(O) ? O(R) : O;
3065
+ }, m = a.calcParentsWithoutChildren(T, A), u = function G(O, R, W, B) {
3066
+ for (var rt = R.length, K = 0; K < rt; K++) {
3067
+ var P = R[K], b = null;
3068
+ P.intersection(m).length == 0 && (b = P.children());
3069
+ var X = void 0, J = P.layoutDimensions({ nodeDimensionsIncludeLabels: B.nodeDimensionsIncludeLabels });
3070
+ if (P.outerWidth() != null && P.outerHeight() != null) if (B.randomize) if (!P.isParent()) X = O.add(new e(W.graphManager, new d(V[Y.get(P.id())] - J.w / 2, z[Y.get(P.id())] - J.h / 2), new r(parseFloat(J.w), parseFloat(J.h))));
3071
+ else {
3072
+ var at = a.calcBoundingBox(P, V, z, Y);
3073
+ P.intersection(m).length == 0 ? X = O.add(new e(W.graphManager, new d(at.topLeftX, at.topLeftY), new r(at.width, at.height))) : X = O.add(new e(W.graphManager, new d(at.topLeftX, at.topLeftY), new r(parseFloat(J.w), parseFloat(J.h))));
3074
+ }
3075
+ else X = O.add(new e(W.graphManager, new d(P.position("x") - J.w / 2, P.position("y") - J.h / 2), new r(parseFloat(J.w), parseFloat(J.h))));
3076
+ else X = O.add(new e(this.graphManager));
3077
+ if (X.id = P.data("id"), X.nodeRepulsion = o(B.nodeRepulsion, P), X.paddingLeft = parseInt(P.css("padding")), X.paddingTop = parseInt(P.css("padding")), X.paddingRight = parseInt(P.css("padding")), X.paddingBottom = parseInt(P.css("padding")), B.nodeDimensionsIncludeLabels && (X.labelWidth = P.boundingBox({
3078
+ includeLabels: !0,
3079
+ includeNodes: !1,
3080
+ includeOverlays: !1
3081
+ }).w, X.labelHeight = P.boundingBox({
3082
+ includeLabels: !0,
3083
+ includeNodes: !1,
3084
+ includeOverlays: !1
3085
+ }).h, X.labelPosVertical = P.css("text-valign"), X.labelPosHorizontal = P.css("text-halign")), x[P.data("id")] = X, isNaN(X.rect.x) && (X.rect.x = 0), isNaN(X.rect.y) && (X.rect.y = 0), b != null && b.length > 0) {
3086
+ var q = void 0;
3087
+ q = W.getGraphManager().add(W.newGraph(), X), G(q, b, W, B);
3088
+ }
3089
+ }
3090
+ }, E = function(O, R, W) {
3091
+ for (var B = 0, rt = 0, K = 0; K < W.length; K++) {
3092
+ var P = W[K], b = x[P.data("source")], X = x[P.data("target")];
3093
+ if (b && X && b !== X && b.getEdgesBetween(X).length == 0) {
3094
+ var J = R.add(O.newEdge(), b, X);
3095
+ J.id = P.id(), J.idealLength = o(g.idealEdgeLength, P), J.edgeElasticity = o(g.edgeElasticity, P), B += J.idealLength, rt++;
3096
+ }
3097
+ }
3098
+ g.idealEdgeLength != null && (rt > 0 ? l.DEFAULT_EDGE_LENGTH = f.DEFAULT_EDGE_LENGTH = B / rt : tt(g.idealEdgeLength) ? l.DEFAULT_EDGE_LENGTH = f.DEFAULT_EDGE_LENGTH = 50 : l.DEFAULT_EDGE_LENGTH = f.DEFAULT_EDGE_LENGTH = g.idealEdgeLength, l.MIN_REPULSION_DIST = f.MIN_REPULSION_DIST = f.DEFAULT_EDGE_LENGTH / 10, l.DEFAULT_RADIAL_SEPARATION = f.DEFAULT_EDGE_LENGTH);
3099
+ }, y = function(O, R) {
3100
+ R.fixedNodeConstraint && (O.constraints.fixedNodeConstraint = R.fixedNodeConstraint), R.alignmentConstraint && (O.constraints.alignmentConstraint = R.alignmentConstraint), R.relativePlacementConstraint && (O.constraints.relativePlacementConstraint = R.relativePlacementConstraint);
3101
+ };
3102
+ g.nestingFactor != null && (l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = g.nestingFactor), g.gravity != null && (l.DEFAULT_GRAVITY_STRENGTH = f.DEFAULT_GRAVITY_STRENGTH = g.gravity), g.numIter != null && (l.MAX_ITERATIONS = f.MAX_ITERATIONS = g.numIter), g.gravityRange != null && (l.DEFAULT_GRAVITY_RANGE_FACTOR = f.DEFAULT_GRAVITY_RANGE_FACTOR = g.gravityRange), g.gravityCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_STRENGTH = f.DEFAULT_COMPOUND_GRAVITY_STRENGTH = g.gravityCompound), g.gravityRangeCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = g.gravityRangeCompound), g.initialEnergyOnIncremental != null && (l.DEFAULT_COOLING_FACTOR_INCREMENTAL = f.DEFAULT_COOLING_FACTOR_INCREMENTAL = g.initialEnergyOnIncremental), g.tilingCompareBy != null && (l.TILING_COMPARE_BY = g.tilingCompareBy), g.quality == "proof" ? i.QUALITY = 2 : i.QUALITY = 0, l.NODE_DIMENSIONS_INCLUDE_LABELS = f.NODE_DIMENSIONS_INCLUDE_LABELS = i.NODE_DIMENSIONS_INCLUDE_LABELS = g.nodeDimensionsIncludeLabels, l.DEFAULT_INCREMENTAL = f.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = !g.randomize, l.ANIMATE = f.ANIMATE = i.ANIMATE = g.animate, l.TILE = g.tile, l.TILING_PADDING_VERTICAL = typeof g.tilingPaddingVertical == "function" ? g.tilingPaddingVertical.call() : g.tilingPaddingVertical, l.TILING_PADDING_HORIZONTAL = typeof g.tilingPaddingHorizontal == "function" ? g.tilingPaddingHorizontal.call() : g.tilingPaddingHorizontal, l.DEFAULT_INCREMENTAL = f.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = !0, l.PURE_INCREMENTAL = !g.randomize, i.DEFAULT_UNIFORM_LEAF_NODE_SIZES = g.uniformNodeDimensions, g.step == "transformed" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !1), g.step == "enforced" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !1), g.step == "cose" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !0), g.step == "all" && (g.randomize ? l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0 : l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !0), g.fixedNodeConstraint || g.alignmentConstraint || g.relativePlacementConstraint ? l.TREE_REDUCTION_ON_INCREMENTAL = !1 : l.TREE_REDUCTION_ON_INCREMENTAL = !0;
3103
+ var C = new h(), M = C.newGraphManager();
3104
+ return u(M.addRoot(), a.getTopMostNodes(I), C, g), E(C, M, S), y(C, g), C.runLayout(), x;
3105
+ } };
3106
+ }),
3107
+ 212: ((s, n, t) => {
3108
+ var a = /* @__PURE__ */ (function() {
3109
+ function l(p, g) {
3110
+ for (var c = 0; c < g.length; c++) {
3111
+ var T = g[c];
3112
+ T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(p, T.key, T);
3113
+ }
3114
+ }
3115
+ return function(p, g, c) {
3116
+ return g && l(p.prototype, g), c && l(p, c), p;
3117
+ };
3118
+ })();
3119
+ function h(l, p) {
3120
+ if (!(l instanceof p)) throw new TypeError("Cannot call a class as a function");
3121
+ }
3122
+ var e = t(658), d = t(548), r = t(657).spectralLayout, i = t(816).coseLayout, f = Object.freeze({
3123
+ quality: "default",
3124
+ randomize: !0,
3125
+ animate: !0,
3126
+ animationDuration: 1e3,
3127
+ animationEasing: void 0,
3128
+ fit: !0,
3129
+ padding: 30,
3130
+ nodeDimensionsIncludeLabels: !1,
3131
+ uniformNodeDimensions: !1,
3132
+ packComponents: !0,
3133
+ step: "all",
3134
+ samplingType: !0,
3135
+ sampleSize: 25,
3136
+ nodeSeparation: 75,
3137
+ piTol: 1e-7,
3138
+ nodeRepulsion: function(p) {
3139
+ return 4500;
3140
+ },
3141
+ idealEdgeLength: function(p) {
3142
+ return 50;
3143
+ },
3144
+ edgeElasticity: function(p) {
3145
+ return 0.45;
3146
+ },
3147
+ nestingFactor: 0.1,
3148
+ gravity: 0.25,
3149
+ numIter: 2500,
3150
+ tile: !0,
3151
+ tilingCompareBy: void 0,
3152
+ tilingPaddingVertical: 10,
3153
+ tilingPaddingHorizontal: 10,
3154
+ gravityRangeCompound: 1.5,
3155
+ gravityCompound: 1,
3156
+ gravityRange: 3.8,
3157
+ initialEnergyOnIncremental: 0.3,
3158
+ fixedNodeConstraint: void 0,
3159
+ alignmentConstraint: void 0,
3160
+ relativePlacementConstraint: void 0,
3161
+ ready: function() {
3162
+ },
3163
+ stop: function() {
3164
+ }
3165
+ });
3166
+ s.exports = (function() {
3167
+ function l(p) {
3168
+ h(this, l), this.options = e({}, f, p);
3169
+ }
3170
+ return a(l, [{
3171
+ key: "run",
3172
+ value: function() {
3173
+ var g = this, c = this.options, T = c.cy, A = c.eles, I = [], S = [], Y = void 0, V = [];
3174
+ 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), (c.fixedNodeConstraint || c.alignmentConstraint || c.relativePlacementConstraint) && (c.tile = !1, c.packComponents = !1);
3175
+ var z = void 0, x = !1;
3176
+ if (T.layoutUtilities && c.packComponents && (z = T.layoutUtilities("get"), z || (z = T.layoutUtilities()), x = !0), A.nodes().length > 0) if (x) {
3177
+ var m = d.getTopMostNodes(c.eles.nodes());
3178
+ if (Y = d.connectComponents(T, c.eles, m), Y.forEach(function(q) {
3179
+ var Z = q.boundingBox();
3180
+ V.push({
3181
+ x: Z.x1 + Z.w / 2,
3182
+ y: Z.y1 + Z.h / 2
3183
+ });
3184
+ }), c.randomize && Y.forEach(function(q) {
3185
+ c.eles = q, I.push(r(c));
3186
+ }), c.quality == "default" || c.quality == "proof") {
3187
+ var u = T.collection();
3188
+ if (c.tile) {
3189
+ var E = /* @__PURE__ */ new Map(), y = [], C = [], M = 0, G = {
3190
+ nodeIndexes: E,
3191
+ xCoords: y,
3192
+ yCoords: C
3193
+ }, O = [];
3194
+ if (Y.forEach(function(q, Z) {
3195
+ q.edges().length == 0 && (q.nodes().forEach(function(Et, ft) {
3196
+ u.merge(q.nodes()[ft]), Et.isParent() || (G.nodeIndexes.set(q.nodes()[ft].id(), M++), G.xCoords.push(q.nodes()[0].position().x), G.yCoords.push(q.nodes()[0].position().y));
3197
+ }), O.push(Z));
3198
+ }), u.length > 1) {
3199
+ var R = u.boundingBox();
3200
+ V.push({
3201
+ x: R.x1 + R.w / 2,
3202
+ y: R.y1 + R.h / 2
3203
+ }), Y.push(u), I.push(G);
3204
+ for (var W = O.length - 1; W >= 0; W--)
3205
+ Y.splice(O[W], 1), I.splice(O[W], 1), V.splice(O[W], 1);
3206
+ }
3207
+ }
3208
+ Y.forEach(function(q, Z) {
3209
+ c.eles = q, S.push(i(c, I[Z])), d.relocateComponent(V[Z], S[Z], c);
3210
+ });
3211
+ } else Y.forEach(function(q, Z) {
3212
+ d.relocateComponent(V[Z], I[Z], c);
3213
+ });
3214
+ var B = /* @__PURE__ */ new Set();
3215
+ if (Y.length > 1) {
3216
+ var rt = [], K = A.filter(function(q) {
3217
+ return q.css("display") == "none";
3218
+ });
3219
+ Y.forEach(function(q, Z) {
3220
+ var Et = void 0;
3221
+ if (c.quality == "draft" && (Et = I[Z].nodeIndexes), q.nodes().not(K).length > 0) {
3222
+ var ft = {};
3223
+ ft.edges = [], ft.nodes = [];
3224
+ var k = void 0;
3225
+ q.nodes().not(K).forEach(function(mt) {
3226
+ if (c.quality == "draft") if (!mt.isParent())
3227
+ k = Et.get(mt.id()), ft.nodes.push({
3228
+ x: I[Z].xCoords[k] - mt.boundingbox().w / 2,
3229
+ y: I[Z].yCoords[k] - mt.boundingbox().h / 2,
3230
+ width: mt.boundingbox().w,
3231
+ height: mt.boundingbox().h
3232
+ });
3233
+ else {
3234
+ var ot = d.calcBoundingBox(mt, I[Z].xCoords, I[Z].yCoords, Et);
3235
+ ft.nodes.push({
3236
+ x: ot.topLeftX,
3237
+ y: ot.topLeftY,
3238
+ width: ot.width,
3239
+ height: ot.height
3240
+ });
3241
+ }
3242
+ else S[Z][mt.id()] && ft.nodes.push({
3243
+ x: S[Z][mt.id()].getLeft(),
3244
+ y: S[Z][mt.id()].getTop(),
3245
+ width: S[Z][mt.id()].getWidth(),
3246
+ height: S[Z][mt.id()].getHeight()
3247
+ });
3248
+ }), q.edges().forEach(function(mt) {
3249
+ var ot = mt.source(), wt = mt.target();
3250
+ if (ot.css("display") != "none" && wt.css("display") != "none")
3251
+ if (c.quality == "draft") {
3252
+ var Wt = Et.get(ot.id()), Dt = Et.get(wt.id()), xt = [], Gt = [];
3253
+ if (ot.isParent()) {
3254
+ var Vt = d.calcBoundingBox(ot, I[Z].xCoords, I[Z].yCoords, Et);
3255
+ xt.push(Vt.topLeftX + Vt.width / 2), xt.push(Vt.topLeftY + Vt.height / 2);
3256
+ } else
3257
+ xt.push(I[Z].xCoords[Wt]), xt.push(I[Z].yCoords[Wt]);
3258
+ if (wt.isParent()) {
3259
+ var Ft = d.calcBoundingBox(wt, I[Z].xCoords, I[Z].yCoords, Et);
3260
+ Gt.push(Ft.topLeftX + Ft.width / 2), Gt.push(Ft.topLeftY + Ft.height / 2);
3261
+ } else
3262
+ Gt.push(I[Z].xCoords[Dt]), Gt.push(I[Z].yCoords[Dt]);
3263
+ ft.edges.push({
3264
+ startX: xt[0],
3265
+ startY: xt[1],
3266
+ endX: Gt[0],
3267
+ endY: Gt[1]
3268
+ });
3269
+ } else S[Z][ot.id()] && S[Z][wt.id()] && ft.edges.push({
3270
+ startX: S[Z][ot.id()].getCenterX(),
3271
+ startY: S[Z][ot.id()].getCenterY(),
3272
+ endX: S[Z][wt.id()].getCenterX(),
3273
+ endY: S[Z][wt.id()].getCenterY()
3274
+ });
3275
+ }), ft.nodes.length > 0 && (rt.push(ft), B.add(Z));
3276
+ }
3277
+ });
3278
+ var P = z.packComponents(rt, c.randomize).shifts;
3279
+ if (c.quality == "draft") I.forEach(function(q, Z) {
3280
+ var Et = q.xCoords.map(function(k) {
3281
+ return k + P[Z].dx;
3282
+ }), ft = q.yCoords.map(function(k) {
3283
+ return k + P[Z].dy;
3284
+ });
3285
+ q.xCoords = Et, q.yCoords = ft;
3286
+ });
3287
+ else {
3288
+ var b = 0;
3289
+ B.forEach(function(q) {
3290
+ Object.keys(S[q]).forEach(function(Z) {
3291
+ var Et = S[q][Z];
3292
+ Et.setCenter(Et.getCenterX() + P[b].dx, Et.getCenterY() + P[b].dy);
3293
+ }), b++;
3294
+ });
3295
+ }
3296
+ }
3297
+ } else {
3298
+ var tt = c.eles.boundingBox();
3299
+ if (V.push({
3300
+ x: tt.x1 + tt.w / 2,
3301
+ y: tt.y1 + tt.h / 2
3302
+ }), c.randomize) {
3303
+ var o = r(c);
3304
+ I.push(o);
3305
+ }
3306
+ c.quality == "default" || c.quality == "proof" ? (S.push(i(c, I[0])), d.relocateComponent(V[0], S[0], c)) : d.relocateComponent(V[0], I[0], c);
3307
+ }
3308
+ var X = function(Z, Et) {
3309
+ if (c.quality == "default" || c.quality == "proof") {
3310
+ typeof Z == "number" && (Z = Et);
3311
+ var ft = void 0, k = void 0, mt = Z.data("id");
3312
+ return S.forEach(function(wt) {
3313
+ mt in wt && (ft = {
3314
+ x: wt[mt].getRect().getCenterX(),
3315
+ y: wt[mt].getRect().getCenterY()
3316
+ }, k = wt[mt]);
3317
+ }), c.nodeDimensionsIncludeLabels && (k.labelWidth && (k.labelPosHorizontal == "left" ? ft.x += k.labelWidth / 2 : k.labelPosHorizontal == "right" && (ft.x -= k.labelWidth / 2)), k.labelHeight && (k.labelPosVertical == "top" ? ft.y += k.labelHeight / 2 : k.labelPosVertical == "bottom" && (ft.y -= k.labelHeight / 2))), ft == null && (ft = {
3318
+ x: Z.position("x"),
3319
+ y: Z.position("y")
3320
+ }), {
3321
+ x: ft.x,
3322
+ y: ft.y
3323
+ };
3324
+ } else {
3325
+ var ot = void 0;
3326
+ return I.forEach(function(wt) {
3327
+ var Wt = wt.nodeIndexes.get(Z.id());
3328
+ Wt != null && (ot = {
3329
+ x: wt.xCoords[Wt],
3330
+ y: wt.yCoords[Wt]
3331
+ });
3332
+ }), ot == null && (ot = {
3333
+ x: Z.position("x"),
3334
+ y: Z.position("y")
3335
+ }), {
3336
+ x: ot.x,
3337
+ y: ot.y
3338
+ };
3339
+ }
3340
+ };
3341
+ if (c.quality == "default" || c.quality == "proof" || c.randomize) {
3342
+ var J = d.calcParentsWithoutChildren(T, A), at = A.filter(function(q) {
3343
+ return q.css("display") == "none";
3344
+ });
3345
+ c.eles = A.not(at), A.nodes().not(":parent").not(at).layoutPositions(g, c, X), J.length > 0 && J.forEach(function(q) {
3346
+ q.position(X(q));
3347
+ });
3348
+ }
3349
+ }
3350
+ }]), l;
3351
+ })();
3352
+ }),
3353
+ 657: ((s, n, t) => {
3354
+ var a = t(548), h = t(140).layoutBase.Matrix, e = t(140).layoutBase.SVD;
3355
+ s.exports = { spectralLayout: function(r) {
3356
+ var i = r.cy, f = r.eles, l = f.nodes(), p = f.nodes(":parent"), g = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), A = [], I = [], S = [], Y = [], V = [], z = [], x = [], tt = [], o = void 0, m = 1e8, u = 1e-9, E = r.piTol, y = r.samplingType, C = r.nodeSeparation, M = void 0, G = function() {
3357
+ for (var gt = 0, D = 0, H = !1; D < M; ) {
3358
+ gt = Math.floor(Math.random() * o), H = !1;
3359
+ for (var $ = 0; $ < D; $++) if (Y[$] == gt) {
3360
+ H = !0;
3361
+ break;
3362
+ }
3363
+ if (!H)
3364
+ Y[D] = gt, D++;
3365
+ else continue;
3366
+ }
3367
+ }, O = function(gt, D, H) {
3368
+ for (var $ = [], _ = 0, Q = 0, j = 0, pt = void 0, ct = [], it = 0, dt = 1, Lt = 0; Lt < o; Lt++) ct[Lt] = m;
3369
+ for ($[Q] = gt, ct[gt] = 0; Q >= _; ) {
3370
+ j = $[_++];
3371
+ for (var Mt = A[j], et = 0; et < Mt.length; et++)
3372
+ pt = c.get(Mt[et]), ct[pt] == m && (ct[pt] = ct[j] + 1, $[++Q] = pt);
3373
+ z[j][D] = ct[j] * C;
3374
+ }
3375
+ if (H) {
3376
+ for (var Nt = 0; Nt < o; Nt++) z[Nt][D] < V[Nt] && (V[Nt] = z[Nt][D]);
3377
+ for (var st = 0; st < o; st++) V[st] > it && (it = V[st], dt = st);
3378
+ }
3379
+ return dt;
3380
+ }, R = function(gt) {
3381
+ var D = void 0;
3382
+ if (gt) {
3383
+ D = Math.floor(Math.random() * o);
3384
+ for (var $ = 0; $ < o; $++) V[$] = m;
3385
+ for (var _ = 0; _ < M; _++)
3386
+ Y[_] = D, D = O(D, _, gt);
3387
+ } else {
3388
+ G();
3389
+ for (var H = 0; H < M; H++) O(Y[H], H, gt, !1);
3390
+ }
3391
+ for (var Q = 0; Q < o; Q++) for (var j = 0; j < M; j++) z[Q][j] *= z[Q][j];
3392
+ for (var pt = 0; pt < M; pt++) x[pt] = [];
3393
+ for (var ct = 0; ct < M; ct++) for (var it = 0; it < M; it++) x[ct][it] = z[Y[it]][ct];
3394
+ }, W = function() {
3395
+ for (var gt = e.svd(x), D = gt.S, H = gt.U, $ = gt.V, _ = D[0] * D[0] * D[0], Q = [], j = 0; j < M; j++) {
3396
+ Q[j] = [];
3397
+ for (var pt = 0; pt < M; pt++)
3398
+ Q[j][pt] = 0, j == pt && (Q[j][pt] = D[j] / (D[j] * D[j] + _ / (D[j] * D[j])));
3399
+ }
3400
+ tt = h.multMat(h.multMat($, Q), h.transpose(H));
3401
+ }, B = function() {
3402
+ for (var gt = void 0, D = void 0, H = [], $ = [], _ = [], Q = [], j = 0; j < o; j++)
3403
+ H[j] = Math.random(), $[j] = Math.random();
3404
+ H = h.normalize(H), $ = h.normalize($);
3405
+ for (var pt = 0, ct = u, it = u, dt = void 0; ; ) {
3406
+ pt++;
3407
+ for (var Lt = 0; Lt < o; Lt++) _[Lt] = H[Lt];
3408
+ if (H = h.multGamma(h.multL(h.multGamma(_), z, tt)), gt = h.dotProduct(_, H), H = h.normalize(H), ct = h.dotProduct(_, H), dt = Math.abs(ct / it), dt <= 1 + E && dt >= 1) break;
3409
+ it = ct;
3410
+ }
3411
+ for (var Mt = 0; Mt < o; Mt++) _[Mt] = H[Mt];
3412
+ for (pt = 0, it = u; ; ) {
3413
+ pt++;
3414
+ for (var et = 0; et < o; et++) Q[et] = $[et];
3415
+ if (Q = h.minusOp(Q, h.multCons(_, h.dotProduct(_, Q))), $ = h.multGamma(h.multL(h.multGamma(Q), z, tt)), D = h.dotProduct(Q, $), $ = h.normalize($), ct = h.dotProduct(Q, $), dt = Math.abs(ct / it), dt <= 1 + E && dt >= 1) break;
3416
+ it = ct;
3417
+ }
3418
+ for (var Nt = 0; Nt < o; Nt++) Q[Nt] = $[Nt];
3419
+ I = h.multCons(_, Math.sqrt(Math.abs(gt))), S = h.multCons(Q, Math.sqrt(Math.abs(D)));
3420
+ };
3421
+ a.connectComponents(i, f, a.getTopMostNodes(l), g), p.forEach(function(Ct) {
3422
+ a.connectComponents(i, f, a.getTopMostNodes(Ct.descendants().intersection(f)), g);
3423
+ });
3424
+ for (var rt = 0, K = 0; K < l.length; K++) l[K].isParent() || c.set(l[K].id(), rt++);
3425
+ var P = !0, b = !1, X = void 0;
3426
+ try {
3427
+ for (var J = g.keys()[Symbol.iterator](), at; !(P = (at = J.next()).done); P = !0) {
3428
+ var q = at.value;
3429
+ c.set(q, rt++);
3430
+ }
3431
+ } catch (Ct) {
3432
+ b = !0, X = Ct;
3433
+ } finally {
3434
+ try {
3435
+ !P && J.return && J.return();
3436
+ } finally {
3437
+ if (b) throw X;
3438
+ }
3439
+ }
3440
+ for (var Z = 0; Z < c.size; Z++) A[Z] = [];
3441
+ p.forEach(function(Ct) {
3442
+ for (var gt = Ct.children().intersection(f); gt.nodes(":childless").length == 0; ) gt = gt.nodes()[0].children().intersection(f);
3443
+ var D = 0, H = gt.nodes(":childless")[0].connectedEdges().length;
3444
+ gt.nodes(":childless").forEach(function($, _) {
3445
+ $.connectedEdges().length < H && (H = $.connectedEdges().length, D = _);
3446
+ }), T.set(Ct.id(), gt.nodes(":childless")[D].id());
3447
+ }), l.forEach(function(Ct) {
3448
+ var gt = void 0;
3449
+ Ct.isParent() ? gt = c.get(T.get(Ct.id())) : gt = c.get(Ct.id()), Ct.neighborhood().nodes().forEach(function(D) {
3450
+ f.intersection(Ct.edgesWith(D)).length > 0 && (D.isParent() ? A[gt].push(T.get(D.id())) : A[gt].push(D.id()));
3451
+ });
3452
+ });
3453
+ var Et = function(gt) {
3454
+ var D = c.get(gt), H = void 0;
3455
+ g.get(gt).forEach(function($) {
3456
+ i.getElementById($).isParent() ? H = T.get($) : H = $, A[D].push(H), A[c.get(H)].push(gt);
3457
+ });
3458
+ }, ft = !0, k = !1, mt = void 0;
3459
+ try {
3460
+ for (var ot = g.keys()[Symbol.iterator](), wt; !(ft = (wt = ot.next()).done); ft = !0) {
3461
+ var Wt = wt.value;
3462
+ Et(Wt);
3463
+ }
3464
+ } catch (Ct) {
3465
+ k = !0, mt = Ct;
3466
+ } finally {
3467
+ try {
3468
+ !ft && ot.return && ot.return();
3469
+ } finally {
3470
+ if (k) throw mt;
3471
+ }
3472
+ }
3473
+ o = c.size;
3474
+ var Dt = void 0;
3475
+ if (o > 2) {
3476
+ M = o < r.sampleSize ? o : r.sampleSize;
3477
+ for (var xt = 0; xt < o; xt++) z[xt] = [];
3478
+ for (var Gt = 0; Gt < M; Gt++) tt[Gt] = [];
3479
+ return r.quality == "draft" || r.step == "all" ? (R(y), W(), B(), Dt = {
3480
+ nodeIndexes: c,
3481
+ xCoords: I,
3482
+ yCoords: S
3483
+ }) : (c.forEach(function(Ct, gt) {
3484
+ I.push(i.getElementById(gt).position("x")), S.push(i.getElementById(gt).position("y"));
3485
+ }), Dt = {
3486
+ nodeIndexes: c,
3487
+ xCoords: I,
3488
+ yCoords: S
3489
+ }), Dt;
3490
+ } else {
3491
+ var Vt = c.keys(), Ft = i.getElementById(Vt.next().value), $t = Ft.position(), Yt = Ft.outerWidth();
3492
+ if (I.push($t.x), S.push($t.y), o == 2) {
3493
+ var Bt = i.getElementById(Vt.next().value).outerWidth();
3494
+ I.push($t.x + Yt / 2 + Bt / 2 + r.idealEdgeLength), S.push($t.y);
3495
+ }
3496
+ return Dt = {
3497
+ nodeIndexes: c,
3498
+ xCoords: I,
3499
+ yCoords: S
3500
+ }, Dt;
3501
+ }
3502
+ } };
3503
+ }),
3504
+ 579: ((s, n, t) => {
3505
+ var a = t(212), h = function(d) {
3506
+ d && d("layout", "fcose", a);
3507
+ };
3508
+ typeof cytoscape < "u" && h(cytoscape), s.exports = h;
3509
+ }),
3510
+ 140: ((s) => {
3511
+ s.exports = w;
3512
+ })
3513
+ }, N = {};
3514
+ function v(s) {
3515
+ var n = N[s];
3516
+ if (n !== void 0) return n.exports;
3517
+ var t = N[s] = { exports: {} };
3518
+ return U[s](t, t.exports, v), t.exports;
3519
+ }
3520
+ return v(579);
3521
+ })();
3522
+ });
3523
+ })), lr = /* @__PURE__ */ Ve(hr(), 1), Ae = {
3524
+ L: "left",
3525
+ R: "right",
3526
+ T: "top",
3527
+ B: "bottom"
3528
+ }, Me = {
3529
+ L: /* @__PURE__ */ lt((L) => `${L},${L / 2} 0,${L} 0,0`, "L"),
3530
+ R: /* @__PURE__ */ lt((L) => `0,${L / 2} ${L},0 ${L},${L}`, "R"),
3531
+ T: /* @__PURE__ */ lt((L) => `0,0 ${L},0 ${L / 2},${L}`, "T"),
3532
+ B: /* @__PURE__ */ lt((L) => `${L / 2},0 ${L},${L} 0,${L}`, "B")
3533
+ }, ne = {
3534
+ L: /* @__PURE__ */ lt((L, F) => L - F + 2, "L"),
3535
+ R: /* @__PURE__ */ lt((L, F) => L - 2, "R"),
3536
+ T: /* @__PURE__ */ lt((L, F) => L - F + 2, "T"),
3537
+ B: /* @__PURE__ */ lt((L, F) => L - 2, "B")
3538
+ }, fr = /* @__PURE__ */ lt(function(L) {
3539
+ return Ht(L) ? L === "L" ? "R" : "L" : L === "T" ? "B" : "T";
3540
+ }, "getOppositeArchitectureDirection"), Oe = /* @__PURE__ */ lt(function(L) {
3541
+ const F = L;
3542
+ return F === "L" || F === "R" || F === "T" || F === "B";
3543
+ }, "isArchitectureDirection"), Ht = /* @__PURE__ */ lt(function(L) {
3544
+ const F = L;
3545
+ return F === "L" || F === "R";
3546
+ }, "isArchitectureDirectionX"), kt = /* @__PURE__ */ lt(function(L) {
3547
+ const F = L;
3548
+ return F === "T" || F === "B";
3549
+ }, "isArchitectureDirectionY"), ye = /* @__PURE__ */ lt(function(L, F) {
3550
+ const w = Ht(L) && kt(F), U = kt(L) && Ht(F);
3551
+ return w || U;
3552
+ }, "isArchitectureDirectionXY"), cr = /* @__PURE__ */ lt(function(L) {
3553
+ const F = L[0], w = L[1], U = Ht(F) && kt(w), N = kt(F) && Ht(w);
3554
+ return U || N;
3555
+ }, "isArchitecturePairXY"), gr = /* @__PURE__ */ lt(function(L) {
3556
+ return L !== "LL" && L !== "RR" && L !== "TT" && L !== "BB";
3557
+ }, "isValidArchitectureDirectionPair"), ge = /* @__PURE__ */ lt(function(L, F) {
3558
+ const w = `${L}${F}`;
3559
+ return gr(w) ? w : void 0;
3560
+ }, "getArchitectureDirectionPair"), ur = /* @__PURE__ */ lt(function([L, F], w) {
3561
+ const U = w[0], N = w[1];
3562
+ return Ht(U) ? kt(N) ? [L + (U === "L" ? -1 : 1), F + (N === "T" ? 1 : -1)] : [L + (U === "L" ? -1 : 1), F] : Ht(N) ? [L + (N === "L" ? 1 : -1), F + (U === "T" ? 1 : -1)] : [L, F + (U === "T" ? 1 : -1)];
3563
+ }, "shiftPositionByArchitectureDirectionPair"), dr = /* @__PURE__ */ lt(function(L) {
3564
+ return L === "LT" || L === "TL" ? [1, 1] : L === "BL" || L === "LB" ? [1, -1] : L === "BR" || L === "RB" ? [-1, -1] : [-1, 1];
3565
+ }, "getArchitectureDirectionXYFactors"), vr = /* @__PURE__ */ lt(function(L, F) {
3566
+ return ye(L, F) ? "bend" : Ht(L) ? "horizontal" : "vertical";
3567
+ }, "getArchitectureDirectionAlignment"), pr = /* @__PURE__ */ lt(function(L) {
3568
+ return L.type === "service";
3569
+ }, "isArchitectureService"), yr = /* @__PURE__ */ lt(function(L) {
3570
+ return L.type === "junction";
3571
+ }, "isArchitectureJunction"), Ie = /* @__PURE__ */ lt((L) => L.data(), "edgeData"), re = /* @__PURE__ */ lt((L) => L.data(), "nodeData"), mr = Ke.architecture, Re = class {
3572
+ constructor() {
3573
+ this.nodes = {}, this.groups = {}, this.edges = [], this.layoutHints = [], this.registeredIds = {}, this.elements = {}, this.diagramId = "", this.setAccTitle = Qe, this.getAccTitle = tr, this.setDiagramTitle = ke, this.getDiagramTitle = _e, this.getAccDescription = je, this.setAccDescription = Be, this.clear();
3574
+ }
3575
+ static {
3576
+ lt(this, "ArchitectureDB");
3577
+ }
3578
+ setDiagramId(L) {
3579
+ this.diagramId = L;
3580
+ }
3581
+ getDiagramId() {
3582
+ return this.diagramId;
3583
+ }
3584
+ clear() {
3585
+ this.nodes = {}, this.groups = {}, this.edges = [], this.layoutHints = [], this.registeredIds = {}, this.dataStructures = void 0, this.elements = {}, this.diagramId = "", qe();
3586
+ }
3587
+ addService({ id: L, icon: F, in: w, title: U, iconText: N }) {
3588
+ if (this.registeredIds[L] !== void 0) throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);
3589
+ if (w !== void 0) {
3590
+ if (L === w) throw new Error(`The service [${L}] cannot be placed within itself`);
3591
+ if (this.registeredIds[w] === void 0) throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);
3592
+ if (this.registeredIds[w] === "node") throw new Error(`The service [${L}]'s parent is not a group`);
3593
+ }
3594
+ this.registeredIds[L] = "node", this.nodes[L] = {
3595
+ id: L,
3596
+ type: "service",
3597
+ icon: F,
3598
+ iconText: N,
3599
+ title: U,
3600
+ edges: [],
3601
+ in: w
3602
+ };
3603
+ }
3604
+ getServices() {
3605
+ return Object.values(this.nodes).filter(pr);
3606
+ }
3607
+ addJunction({ id: L, in: F }) {
3608
+ if (this.registeredIds[L] !== void 0) throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);
3609
+ if (F !== void 0) {
3610
+ if (L === F) throw new Error(`The junction [${L}] cannot be placed within itself`);
3611
+ if (this.registeredIds[F] === void 0) throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);
3612
+ if (this.registeredIds[F] === "node") throw new Error(`The junction [${L}]'s parent is not a group`);
3613
+ }
3614
+ this.registeredIds[L] = "node", this.nodes[L] = {
3615
+ id: L,
3616
+ type: "junction",
3617
+ edges: [],
3618
+ in: F
3619
+ };
3620
+ }
3621
+ getJunctions() {
3622
+ return Object.values(this.nodes).filter(yr);
3623
+ }
3624
+ getNodes() {
3625
+ return Object.values(this.nodes);
3626
+ }
3627
+ getNode(L) {
3628
+ return this.nodes[L] ?? null;
3629
+ }
3630
+ addGroup({ id: L, icon: F, in: w, title: U }) {
3631
+ if (this.registeredIds?.[L] !== void 0) throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);
3632
+ if (w !== void 0) {
3633
+ if (L === w) throw new Error(`The group [${L}] cannot be placed within itself`);
3634
+ if (this.registeredIds?.[w] === void 0) throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);
3635
+ if (this.registeredIds?.[w] === "node") throw new Error(`The group [${L}]'s parent is not a group`);
3636
+ }
3637
+ this.registeredIds[L] = "group", this.groups[L] = {
3638
+ id: L,
3639
+ icon: F,
3640
+ title: U,
3641
+ in: w
3642
+ };
3643
+ }
3644
+ getGroups() {
3645
+ return Object.values(this.groups);
3646
+ }
3647
+ addEdge({ lhsId: L, rhsId: F, lhsDir: w, rhsDir: U, lhsInto: N, rhsInto: v, lhsGroup: s, rhsGroup: n, title: t }) {
3648
+ if (!Oe(w)) throw new Error(`Invalid direction given for left hand side of edge ${L}--${F}. Expected (L,R,T,B) got ${String(w)}`);
3649
+ if (!Oe(U)) throw new Error(`Invalid direction given for right hand side of edge ${L}--${F}. Expected (L,R,T,B) got ${String(U)}`);
3650
+ if (this.nodes[L] === void 0 && this.groups[L] === void 0) throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);
3651
+ if (this.nodes[F] === void 0 && this.groups[F] === void 0) throw new Error(`The right-hand id [${F}] does not yet exist. Please create the service/group before declaring an edge to it.`);
3652
+ const a = this.nodes[L].in, h = this.nodes[F].in;
3653
+ if (s && a && h && a == h) throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);
3654
+ if (n && a && h && a == h) throw new Error(`The right-hand id [${F}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);
3655
+ const e = {
3656
+ lhsId: L,
3657
+ lhsDir: w,
3658
+ lhsInto: N,
3659
+ lhsGroup: s,
3660
+ rhsId: F,
3661
+ rhsDir: U,
3662
+ rhsInto: v,
3663
+ rhsGroup: n,
3664
+ title: t
3665
+ };
3666
+ this.edges.push(e), this.nodes[L] && this.nodes[F] && (this.nodes[L].edges.push(this.edges[this.edges.length - 1]), this.nodes[F].edges.push(this.edges[this.edges.length - 1]));
3667
+ }
3668
+ getEdges() {
3669
+ return this.edges;
3670
+ }
3671
+ addLayoutHint(L) {
3672
+ if (L.members.length < 2) throw new Error(`An align directive requires at least two members; got ${L.members.length}`);
3673
+ const F = /* @__PURE__ */ new Set();
3674
+ L.members.forEach((w) => {
3675
+ if (this.registeredIds[w] !== "node") throw new Error(`align ${L.direction} references [${w}], which is not a service or junction`);
3676
+ if (F.has(w)) throw new Error(`align ${L.direction} lists [${w}] more than once`);
3677
+ F.add(w);
3678
+ }), this.layoutHints.push(L);
3679
+ }
3680
+ getLayoutHints() {
3681
+ return this.layoutHints;
3682
+ }
3683
+ getDataStructures() {
3684
+ if (this.dataStructures === void 0) {
3685
+ const L = {}, F = Object.entries(this.nodes).reduce((n, [t, a]) => (n[t] = a.edges.reduce((h, e) => {
3686
+ const d = this.getNode(e.lhsId)?.in, r = this.getNode(e.rhsId)?.in;
3687
+ if (d && r && d !== r) {
3688
+ const i = vr(e.lhsDir, e.rhsDir);
3689
+ i !== "bend" && (L[d] ??= {}, L[d][r] = i, L[r] ??= {}, L[r][d] = i);
3690
+ }
3691
+ if (e.lhsId === t) {
3692
+ const i = ge(e.lhsDir, e.rhsDir);
3693
+ i && (h[i] = e.rhsId);
3694
+ } else {
3695
+ const i = ge(e.rhsDir, e.lhsDir);
3696
+ i && (h[i] = e.lhsId);
3697
+ }
3698
+ return h;
3699
+ }, {}), n), {}), w = Object.keys(F)[0], U = { [w]: 1 }, N = Object.keys(F).reduce((n, t) => t === w ? n : {
3700
+ ...n,
3701
+ [t]: 1
3702
+ }, {}), v = /* @__PURE__ */ lt((n) => {
3703
+ const t = { [n]: [0, 0] }, a = [n];
3704
+ for (; a.length > 0; ) {
3705
+ const h = a.shift();
3706
+ if (h) {
3707
+ U[h] = 1, delete N[h];
3708
+ const e = F[h], [d, r] = t[h];
3709
+ Object.entries(e).forEach(([i, f]) => {
3710
+ U[f] || (t[f] = ur([d, r], i), a.push(f));
3711
+ });
3712
+ }
3713
+ }
3714
+ return t;
3715
+ }, "BFS"), s = [v(w)];
3716
+ for (; Object.keys(N).length > 0; ) s.push(v(Object.keys(N)[0]));
3717
+ this.dataStructures = {
3718
+ adjList: F,
3719
+ spatialMaps: s,
3720
+ groupAlignments: L
3721
+ };
3722
+ }
3723
+ return this.dataStructures;
3724
+ }
3725
+ setElementForId(L, F) {
3726
+ this.elements[L] = F;
3727
+ }
3728
+ getElementById(L) {
3729
+ return this.elements[L];
3730
+ }
3731
+ getConfig() {
3732
+ return ir({
3733
+ ...mr,
3734
+ ...Je().architecture
3735
+ });
3736
+ }
3737
+ getConfigField(L) {
3738
+ return this.getConfig()[L];
3739
+ }
3740
+ }, Er = /* @__PURE__ */ lt((L, F) => {
3741
+ nr(L, F), L.groups.map((w) => F.addGroup(w)), L.services.map((w) => F.addService({
3742
+ ...w,
3743
+ type: "service"
3744
+ })), L.junctions.map((w) => F.addJunction({
3745
+ ...w,
3746
+ type: "junction"
3747
+ })), L.edges.map((w) => F.addEdge(w)), L.alignments?.map((w) => F.addLayoutHint({
3748
+ direction: w.direction,
3749
+ members: [...w.members]
3750
+ }));
3751
+ }, "populateDb"), Se = {
3752
+ parser: { yy: void 0 },
3753
+ parse: /* @__PURE__ */ lt(async (L) => {
3754
+ const F = await ze("architecture", L);
3755
+ De.debug(F);
3756
+ const w = Se.parser?.yy;
3757
+ if (!(w instanceof Re)) throw new Error("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.");
3758
+ Er(F, w);
3759
+ }, "parse")
3760
+ }, Tr = /* @__PURE__ */ lt((L) => `
3761
+ .edge {
3762
+ stroke-width: ${L.archEdgeWidth};
3763
+ stroke: ${L.archEdgeColor};
3764
+ fill: none;
3765
+ }
3766
+
3767
+ .arrow {
3768
+ fill: ${L.archEdgeArrowColor};
3769
+ }
3770
+
3771
+ .node-bkg {
3772
+ fill: none;
3773
+ stroke: ${L.archGroupBorderColor};
3774
+ stroke-width: ${L.archGroupBorderWidth};
3775
+ stroke-dasharray: 8;
3776
+ }
3777
+ .node-icon-text {
3778
+ display: flex;
3779
+ align-items: center;
3780
+ }
3781
+
3782
+ .node-icon-text > div {
3783
+ color: #fff;
3784
+ margin: 1px;
3785
+ height: fit-content;
3786
+ text-align: center;
3787
+ overflow: hidden;
3788
+ display: -webkit-box;
3789
+ -webkit-box-orient: vertical;
3790
+ }
3791
+ `, "getStyles");
3792
+ function ue(L, F) {
3793
+ if (L === 0) return F();
3794
+ const w = Math.random;
3795
+ let U = L >>> 0;
3796
+ Math.random = function() {
3797
+ U = U + 1831565813 >>> 0;
3798
+ let N = U;
3799
+ return N = Math.imul(N ^ N >>> 15, N | 1), N ^= N + Math.imul(N ^ N >>> 7, N | 61), ((N ^ N >>> 14) >>> 0) / 4294967296;
3800
+ };
3801
+ try {
3802
+ return F();
3803
+ } finally {
3804
+ Math.random = w;
3805
+ }
3806
+ }
3807
+ lt(ue, "withSeededRandom");
3808
+ var ee = /* @__PURE__ */ lt((L) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${L}</g>`, "wrapIcon"), ie = {
3809
+ prefix: "mermaid-architecture",
3810
+ height: 80,
3811
+ width: 80,
3812
+ icons: {
3813
+ database: { body: ee('<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;"/>') },
3814
+ server: { body: ee('<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>') },
3815
+ disk: { body: ee('<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;"/>') },
3816
+ internet: { body: ee('<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;"/>') },
3817
+ cloud: { body: ee('<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;"/>') },
3818
+ unknown: or,
3819
+ blank: { body: ee("") }
3820
+ }
3821
+ }, Nr = /* @__PURE__ */ lt(async function(L, F, w, U) {
3822
+ const N = w.getConfigField("padding"), v = w.getConfigField("iconSize"), s = v / 2, n = v / 6, t = n / 2;
3823
+ await Promise.all(F.edges().map(async (a) => {
3824
+ const { source: h, sourceDir: e, sourceArrow: d, sourceGroup: r, target: i, targetDir: f, targetArrow: l, targetGroup: p, label: g } = Ie(a);
3825
+ let { x: c, y: T } = a[0].sourceEndpoint();
3826
+ const { x: A, y: I } = a[0].midpoint();
3827
+ let { x: S, y: Y } = a[0].targetEndpoint();
3828
+ const V = N + 4;
3829
+ if (r && (Ht(e) ? c += e === "L" ? -V : V : T += e === "T" ? -V : V + 18), p && (Ht(f) ? S += f === "L" ? -V : V : Y += f === "T" ? -V : V + 18), !r && w.getNode(h)?.type === "junction" && (Ht(e) ? c += e === "L" ? s : -s : T += e === "T" ? s : -s), !p && w.getNode(i)?.type === "junction" && (Ht(f) ? S += f === "L" ? s : -s : Y += f === "T" ? s : -s), a[0]._private.rscratch) {
3830
+ const z = L.insert("g");
3831
+ if (z.insert("path").attr("d", `M ${c},${T} L ${A},${I} L${S},${Y} `).attr("class", "edge").attr("id", `${U}-${rr(h, i, { prefix: "L" })}`), d) {
3832
+ const x = Ht(e) ? ne[e](c, n) : c - t, tt = kt(e) ? ne[e](T, n) : T - t;
3833
+ z.insert("polygon").attr("points", Me[e](n)).attr("transform", `translate(${x},${tt})`).attr("class", "arrow");
3834
+ }
3835
+ if (l) {
3836
+ const x = Ht(f) ? ne[f](S, n) : S - t, tt = kt(f) ? ne[f](Y, n) : Y - t;
3837
+ z.insert("polygon").attr("points", Me[f](n)).attr("transform", `translate(${x},${tt})`).attr("class", "arrow");
3838
+ }
3839
+ if (g) {
3840
+ const x = ye(e, f) ? "XY" : Ht(e) ? "X" : "Y";
3841
+ let tt = 0;
3842
+ x === "X" ? tt = Math.abs(c - S) : x === "Y" ? tt = Math.abs(T - Y) / 1.5 : tt = Math.abs(c - S) / 2;
3843
+ const o = z.append("g");
3844
+ if (await pe(o, g, {
3845
+ useHtmlLabels: !1,
3846
+ width: tt,
3847
+ classes: "architecture-service-label"
3848
+ }, ve()), o.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), x === "X") o.attr("transform", "translate(" + A + ", " + I + ")");
3849
+ else if (x === "Y") o.attr("transform", "translate(" + A + ", " + I + ") rotate(-90)");
3850
+ else if (x === "XY") {
3851
+ const m = ge(e, f);
3852
+ if (m && cr(m)) {
3853
+ const u = o.node().getBoundingClientRect(), [E, y] = dr(m);
3854
+ o.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * E * y * 45})`);
3855
+ const C = o.node().getBoundingClientRect();
3856
+ o.attr("transform", `
3857
+ translate(${A}, ${I - u.height / 2})
3858
+ translate(${E * C.width / 2}, ${y * C.height / 2})
3859
+ rotate(${-1 * E * y * 45}, 0, ${u.height / 2})
3860
+ `);
3861
+ }
3862
+ }
3863
+ }
3864
+ }
3865
+ }));
3866
+ }, "drawEdges"), Lr = /* @__PURE__ */ lt(async function(L, F, w, U) {
3867
+ const N = w.getConfigField("padding") * 0.75, v = w.getConfigField("fontSize"), s = w.getConfigField("iconSize") / 2;
3868
+ await Promise.all(F.nodes().map(async (n) => {
3869
+ const t = re(n);
3870
+ if (t.type === "group") {
3871
+ const { h: a, w: h, x1: e, y1: d } = n.boundingBox(), r = L.append("rect");
3872
+ r.attr("id", `${U}-group-${t.id}`).attr("x", e + s).attr("y", d + s).attr("width", h).attr("height", a).attr("class", "node-bkg");
3873
+ const i = L.append("g");
3874
+ let f = e, l = d;
3875
+ if (t.icon) {
3876
+ const p = i.append("g");
3877
+ p.html(`<g>${await ce(t.icon, {
3878
+ height: N,
3879
+ width: N,
3880
+ fallbackPrefix: ie.prefix
3881
+ })}</g>`), p.attr("transform", "translate(" + (f + s + 1) + ", " + (l + s + 1) + ")"), f += N, l += v / 2 - 1 - 2;
3882
+ }
3883
+ if (t.label) {
3884
+ const p = i.append("g");
3885
+ await pe(p, t.label, {
3886
+ useHtmlLabels: !1,
3887
+ width: h,
3888
+ classes: "architecture-service-label"
3889
+ }, ve()), p.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), p.attr("transform", "translate(" + (f + s + 4) + ", " + (l + s + 2) + ")");
3890
+ }
3891
+ w.setElementForId(t.id, r);
3892
+ }
3893
+ }));
3894
+ }, "drawGroups"), wr = /* @__PURE__ */ lt(async function(L, F, w, U) {
3895
+ const N = ve();
3896
+ for (const v of w) {
3897
+ const s = F.append("g"), n = L.getConfigField("iconSize");
3898
+ if (v.title) {
3899
+ const e = s.append("g");
3900
+ await pe(e, v.title, {
3901
+ useHtmlLabels: !1,
3902
+ width: n * 1.5,
3903
+ classes: "architecture-service-label"
3904
+ }, N), e.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), e.attr("transform", "translate(" + n / 2 + ", " + n + ")");
3905
+ }
3906
+ const t = s.append("g");
3907
+ if (v.icon) t.html(`<g>${await ce(v.icon, {
3908
+ height: n,
3909
+ width: n,
3910
+ fallbackPrefix: ie.prefix
3911
+ })}</g>`);
3912
+ else if (v.iconText) {
3913
+ t.html(`<g>${await ce("blank", {
3914
+ height: n,
3915
+ width: n,
3916
+ fallbackPrefix: ie.prefix
3917
+ })}</g>`);
3918
+ const e = t.append("g").append("foreignObject").attr("width", n).attr("height", n).append("div").attr("class", "node-icon-text").attr("style", `height: ${n}px;`).append("div").html(er(v.iconText, N)), d = parseInt(window.getComputedStyle(e.node(), null).getPropertyValue("font-size").replace(/\D/g, "")) ?? 16;
3919
+ e.attr("style", `-webkit-line-clamp: ${Math.floor((n - 2) / d)};`);
3920
+ } else t.append("path").attr("class", "node-bkg").attr("id", `${U}-node-${v.id}`).attr("d", `M0,${n} V5 Q0,0 5,0 H${n - 5} Q${n},0 ${n},5 V${n} Z`);
3921
+ s.attr("id", `${U}-service-${v.id}`).attr("class", "architecture-service");
3922
+ const { width: a, height: h } = s.node().getBBox();
3923
+ v.width = a, v.height = h, L.setElementForId(v.id, s);
3924
+ }
3925
+ return 0;
3926
+ }, "drawServices"), Cr = /* @__PURE__ */ lt(function(L, F, w, U) {
3927
+ w.forEach((N) => {
3928
+ const v = F.append("g"), s = L.getConfigField("iconSize");
3929
+ v.append("g").append("rect").attr("id", `${U}-node-${N.id}`).attr("fill-opacity", "0").attr("width", s).attr("height", s), v.attr("class", "architecture-junction");
3930
+ const { width: n, height: t } = v._groups[0][0].getBBox();
3931
+ v.width = n, v.height = t, L.setElementForId(N.id, v);
3932
+ });
3933
+ }, "drawJunctions");
3934
+ sr([{
3935
+ name: ie.prefix,
3936
+ icons: ie
3937
+ }]);
3938
+ xe.use(lr.default);
3939
+ function Fe(L, F, w) {
3940
+ L.forEach((U) => {
3941
+ F.add({
3942
+ group: "nodes",
3943
+ data: {
3944
+ type: "service",
3945
+ id: U.id,
3946
+ icon: U.icon,
3947
+ label: U.title,
3948
+ parent: U.in,
3949
+ width: w.getConfigField("iconSize"),
3950
+ height: w.getConfigField("iconSize")
3951
+ },
3952
+ classes: "node-service"
3953
+ });
3954
+ });
3955
+ }
3956
+ lt(Fe, "addServices");
3957
+ function be(L, F, w) {
3958
+ L.forEach((U) => {
3959
+ F.add({
3960
+ group: "nodes",
3961
+ data: {
3962
+ type: "junction",
3963
+ id: U.id,
3964
+ parent: U.in,
3965
+ width: w.getConfigField("iconSize"),
3966
+ height: w.getConfigField("iconSize")
3967
+ },
3968
+ classes: "node-junction"
3969
+ });
3970
+ });
3971
+ }
3972
+ lt(be, "addJunctions");
3973
+ function Ge(L, F) {
3974
+ F.nodes().map((w) => {
3975
+ const U = re(w);
3976
+ U.type !== "group" && (U.x = w.position().x, U.y = w.position().y, L.getElementById(U.id).attr("transform", "translate(" + (U.x || 0) + "," + (U.y || 0) + ")"));
3977
+ });
3978
+ }
3979
+ lt(Ge, "positionNodes");
3980
+ function Pe(L, F) {
3981
+ L.forEach((w) => {
3982
+ F.add({
3983
+ group: "nodes",
3984
+ data: {
3985
+ type: "group",
3986
+ id: w.id,
3987
+ icon: w.icon,
3988
+ label: w.title,
3989
+ parent: w.in
3990
+ },
3991
+ classes: "node-group"
3992
+ });
3993
+ });
3994
+ }
3995
+ lt(Pe, "addGroups");
3996
+ function Ue(L, F) {
3997
+ L.forEach((w) => {
3998
+ const { lhsId: U, rhsId: N, lhsInto: v, lhsGroup: s, rhsInto: n, lhsDir: t, rhsDir: a, rhsGroup: h, title: e } = w, d = ye(w.lhsDir, w.rhsDir) ? "segments" : "straight", r = {
3999
+ id: `${U}-${N}`,
4000
+ label: e,
4001
+ source: U,
4002
+ sourceDir: t,
4003
+ sourceArrow: v,
4004
+ sourceGroup: s,
4005
+ sourceEndpoint: t === "L" ? "0 50%" : t === "R" ? "100% 50%" : t === "T" ? "50% 0" : "50% 100%",
4006
+ target: N,
4007
+ targetDir: a,
4008
+ targetArrow: n,
4009
+ targetGroup: h,
4010
+ targetEndpoint: a === "L" ? "0 50%" : a === "R" ? "100% 50%" : a === "T" ? "50% 0" : "50% 100%"
4011
+ };
4012
+ F.add({
4013
+ group: "edges",
4014
+ data: r,
4015
+ classes: d
4016
+ });
4017
+ });
4018
+ }
4019
+ lt(Ue, "addEdges");
4020
+ function Ye(L, F, w, U = []) {
4021
+ const N = /* @__PURE__ */ lt((e, d) => Object.entries(e).reduce((r, [i, f]) => {
4022
+ let l = 0;
4023
+ const p = Object.entries(f);
4024
+ if (p.length === 1)
4025
+ return r[i] = p[0][1], r;
4026
+ for (let g = 0; g < p.length - 1; g++) for (let c = g + 1; c < p.length; c++) {
4027
+ const [T, A] = p[g], [I, S] = p[c];
4028
+ if (w[T]?.[I] === d)
4029
+ r[i] ??= [], r[i] = [
4030
+ ...r[i],
4031
+ ...A,
4032
+ ...S
4033
+ ];
4034
+ else if (T === "default" || I === "default")
4035
+ r[i] ??= [], r[i] = [
4036
+ ...r[i],
4037
+ ...A,
4038
+ ...S
4039
+ ];
4040
+ else {
4041
+ const Y = `${i}-${l++}`;
4042
+ r[Y] = A;
4043
+ const V = `${i}-${l++}`;
4044
+ r[V] = S;
4045
+ }
4046
+ }
4047
+ return r;
4048
+ }, {}), "flattenAlignments"), [v, s] = F.map((e) => {
4049
+ const d = {}, r = {};
4050
+ return Object.entries(e).forEach(([i, [f, l]]) => {
4051
+ const p = L.getNode(i)?.in ?? "default";
4052
+ d[l] ??= {}, d[l][p] ??= [], d[l][p].push(i), r[f] ??= {}, r[f][p] ??= [], r[f][p].push(i);
4053
+ }), {
4054
+ horiz: Object.values(N(d, "horizontal")).filter((i) => i.length > 1),
4055
+ vert: Object.values(N(r, "vertical")).filter((i) => i.length > 1)
4056
+ };
4057
+ }).reduce(([e, d], { horiz: r, vert: i }) => [[...e, ...r], [...d, ...i]], [[], []]), n = /* @__PURE__ */ new Set();
4058
+ U.forEach((e) => e.members.forEach((d) => n.add(d)));
4059
+ const t = /* @__PURE__ */ lt((e) => e.filter((d) => !d.some((r) => n.has(r))), "dropOverlapping"), a = t(v), h = t(s);
4060
+ return U.forEach((e) => {
4061
+ e.members.length < 2 || (e.direction === "row" ? a.push([...e.members]) : h.push([...e.members]));
4062
+ }), {
4063
+ horizontal: a,
4064
+ vertical: h
4065
+ };
4066
+ }
4067
+ lt(Ye, "getAlignments");
4068
+ function Xe(L, F, w = []) {
4069
+ const U = [], N = F.getConfigField("iconSize"), v = F.getConfigField("idealEdgeLengthMultiplier"), s = v * N, n = /* @__PURE__ */ new Set();
4070
+ w.forEach((h) => {
4071
+ for (let e = 0; e < h.members.length - 1; e++) {
4072
+ const d = h.members[e], r = h.members[e + 1];
4073
+ n.add(`${d}|${r}`), n.add(`${r}|${d}`), h.direction === "row" ? U.push({
4074
+ left: d,
4075
+ right: r,
4076
+ gap: s
4077
+ }) : U.push({
4078
+ top: d,
4079
+ bottom: r,
4080
+ gap: s
4081
+ });
4082
+ }
4083
+ });
4084
+ const t = /* @__PURE__ */ lt((h) => `${h[0]},${h[1]}`, "posToStr"), a = /* @__PURE__ */ lt((h) => h.split(",").map((e) => parseInt(e)), "strToPos");
4085
+ return L.forEach((h) => {
4086
+ const e = Object.fromEntries(Object.entries(h).map(([f, l]) => [t(l), f])), d = [t([0, 0])], r = {}, i = {
4087
+ L: [-1, 0],
4088
+ R: [1, 0],
4089
+ T: [0, 1],
4090
+ B: [0, -1]
4091
+ };
4092
+ for (; d.length > 0; ) {
4093
+ const f = d.shift();
4094
+ if (f) {
4095
+ r[f] = 1;
4096
+ const l = e[f];
4097
+ if (l) {
4098
+ const p = a(f);
4099
+ Object.entries(i).forEach(([g, c]) => {
4100
+ const T = t([p[0] + c[0], p[1] + c[1]]), A = e[T];
4101
+ if (A && !r[T]) {
4102
+ if (d.push(T), n.has(`${l}|${A}`)) return;
4103
+ U.push({
4104
+ [Ae[g]]: A,
4105
+ [Ae[fr(g)]]: l,
4106
+ gap: v * N
4107
+ });
4108
+ }
4109
+ });
4110
+ }
4111
+ }
4112
+ }
4113
+ }), U;
4114
+ }
4115
+ lt(Xe, "getRelativeConstraints");
4116
+ function He(L, F, w, U, N, { spatialMaps: v, groupAlignments: s }) {
4117
+ return new Promise((n) => {
4118
+ const t = $e("body").append("div").attr("id", "cy").attr("style", "display:none"), a = xe({
4119
+ container: document.getElementById("cy"),
4120
+ style: [
4121
+ {
4122
+ selector: "edge",
4123
+ style: {
4124
+ "curve-style": "straight",
4125
+ "source-endpoint": "data(sourceEndpoint)",
4126
+ "target-endpoint": "data(targetEndpoint)"
4127
+ }
4128
+ },
4129
+ {
4130
+ selector: "edge[label]",
4131
+ style: { label: "data(label)" }
4132
+ },
4133
+ {
4134
+ selector: "edge.segments",
4135
+ style: {
4136
+ "curve-style": "segments",
4137
+ "segment-weights": "0",
4138
+ "segment-distances": [0.5],
4139
+ "edge-distances": "endpoints",
4140
+ "source-endpoint": "data(sourceEndpoint)",
4141
+ "target-endpoint": "data(targetEndpoint)"
4142
+ }
4143
+ },
4144
+ {
4145
+ selector: "node",
4146
+ style: { "compound-sizing-wrt-labels": "include" }
4147
+ },
4148
+ {
4149
+ selector: "node[label]",
4150
+ style: {
4151
+ "text-valign": "bottom",
4152
+ "text-halign": "center",
4153
+ "font-size": `${N.getConfigField("fontSize")}px`
4154
+ }
4155
+ },
4156
+ {
4157
+ selector: ".node-service",
4158
+ style: {
4159
+ label: "data(label)",
4160
+ width: "data(width)",
4161
+ height: "data(height)"
4162
+ }
4163
+ },
4164
+ {
4165
+ selector: ".node-junction",
4166
+ style: {
4167
+ width: "data(width)",
4168
+ height: "data(height)"
4169
+ }
4170
+ },
4171
+ {
4172
+ selector: ".node-group",
4173
+ style: { padding: `${N.getConfigField("padding")}px` }
4174
+ }
4175
+ ],
4176
+ layout: {
4177
+ name: "grid",
4178
+ boundingBox: {
4179
+ x1: 0,
4180
+ x2: 100,
4181
+ y1: 0,
4182
+ y2: 100
4183
+ }
4184
+ }
4185
+ });
4186
+ t.remove(), Pe(w, a), Fe(L, a, N), be(F, a, N), Ue(U, a);
4187
+ const h = N.getLayoutHints(), e = Ye(N, v, s, h), d = Xe(v, N, h), r = N.getConfigField("iconSize"), i = N.getConfigField("idealEdgeLengthMultiplier") * r, f = 0.5 * r, l = N.getConfigField("edgeElasticity"), p = N.getConfigField("seed"), g = a.layout({
4188
+ name: "fcose",
4189
+ quality: "proof",
4190
+ randomize: N.getConfigField("randomize"),
4191
+ nodeSeparation: N.getConfigField("nodeSeparation"),
4192
+ numIter: N.getConfigField("numIter"),
4193
+ styleEnabled: !1,
4194
+ animate: !1,
4195
+ nodeDimensionsIncludeLabels: !1,
4196
+ idealEdgeLength(c) {
4197
+ const [T, A] = c.connectedNodes(), { parent: I } = re(T), { parent: S } = re(A);
4198
+ return I === S ? i : f;
4199
+ },
4200
+ edgeElasticity(c) {
4201
+ const [T, A] = c.connectedNodes(), { parent: I } = re(T), { parent: S } = re(A);
4202
+ return I === S ? l : 1e-3;
4203
+ },
4204
+ alignmentConstraint: e,
4205
+ relativePlacementConstraint: d
4206
+ });
4207
+ g.one("layoutstop", () => {
4208
+ function c(T, A, I, S) {
4209
+ let Y, V;
4210
+ const { x: z, y: x } = T, { x: tt, y: o } = A;
4211
+ V = (S - x + (z - I) * (x - o) / (z - tt)) / Math.sqrt(1 + Math.pow((x - o) / (z - tt), 2)), Y = Math.sqrt(Math.pow(S - x, 2) + Math.pow(I - z, 2) - Math.pow(V, 2));
4212
+ const m = Math.sqrt(Math.pow(tt - z, 2) + Math.pow(o - x, 2));
4213
+ Y = Y / m;
4214
+ let u = (tt - z) * (S - x) - (o - x) * (I - z);
4215
+ switch (!0) {
4216
+ case u >= 0:
4217
+ u = 1;
4218
+ break;
4219
+ case u < 0:
4220
+ u = -1;
4221
+ break;
4222
+ }
4223
+ let E = (tt - z) * (I - z) + (o - x) * (S - x);
4224
+ switch (!0) {
4225
+ case E >= 0:
4226
+ E = 1;
4227
+ break;
4228
+ case E < 0:
4229
+ E = -1;
4230
+ break;
4231
+ }
4232
+ return V = Math.abs(V) * u, Y = Y * E, {
4233
+ distances: V,
4234
+ weights: Y
4235
+ };
4236
+ }
4237
+ lt(c, "getSegmentWeights"), a.startBatch();
4238
+ for (const T of Object.values(a.edges())) if (T.data?.()) {
4239
+ const { x: A, y: I } = T.source().position(), { x: S, y: Y } = T.target().position();
4240
+ if (A !== S && I !== Y) {
4241
+ const V = T.sourceEndpoint(), z = T.targetEndpoint(), { sourceDir: x } = Ie(T), [tt, o] = kt(x) ? [V.x, z.y] : [z.x, V.y], { weights: m, distances: u } = c(V, z, tt, o);
4242
+ T.style("segment-distances", u), T.style("segment-weights", m);
4243
+ }
4244
+ }
4245
+ a.endBatch(), ue(p, () => g.run());
4246
+ });
4247
+ try {
4248
+ ue(p, () => g.run());
4249
+ } catch (c) {
4250
+ throw c instanceof RangeError && c.message.includes("Invalid array length") ? new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.") : c;
4251
+ }
4252
+ a.ready((c) => {
4253
+ De.info("Ready", c), n(a);
4254
+ });
4255
+ });
4256
+ }
4257
+ lt(He, "layoutArchitecture");
4258
+ var Pr = {
4259
+ parser: Se,
4260
+ get db() {
4261
+ return new Re();
4262
+ },
4263
+ renderer: { draw: /* @__PURE__ */ lt(async (L, F, w, U) => {
4264
+ const N = U.db;
4265
+ N.setDiagramId(F);
4266
+ const v = N.getServices(), s = N.getJunctions(), n = N.getGroups(), t = N.getEdges(), a = N.getDataStructures(), h = ar(F), e = h.append("g");
4267
+ e.attr("class", "architecture-edges");
4268
+ const d = h.append("g");
4269
+ d.attr("class", "architecture-services");
4270
+ const r = h.append("g");
4271
+ r.attr("class", "architecture-groups"), await wr(N, d, v, F), Cr(N, d, s, F);
4272
+ const i = await He(v, s, n, t, N, a);
4273
+ await Nr(e, i, N, F), await Lr(r, i, N, F), Ge(N, i), Ze(void 0, h, N.getConfigField("padding"), N.getConfigField("useMaxWidth"));
4274
+ }, "draw") },
4275
+ styles: Tr
4276
+ };
4277
+ export {
4278
+ Pr as diagram
4279
+ };