mulmoclaude 0.9.4 → 0.9.6

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 (377) hide show
  1. package/client/assets/JsonEditor-CuOiOZGn.js +10 -0
  2. package/client/assets/PluginScopedRoot-BBS0j7lL.js +1 -0
  3. package/client/assets/abnfDiagram-VRR7QNED-BanoRrli.js +1 -0
  4. package/client/assets/{abnfDiagram-VRR7QNED-6nNByj6v-By7GJ3xW.js → abnfDiagram-VRR7QNED-RjiYivmv-B3_D0KAN.js} +1 -1
  5. package/client/assets/{arc-BXutyUAX.js → arc-C6pGbJrV.js} +1 -1
  6. package/client/assets/architecture-TIHT7OUA-0NsD2xW1-BqJkogwD.js +1 -0
  7. package/client/assets/architecture-TIHT7OUA-BWqzHezU.js +1 -0
  8. package/client/assets/architectureDiagram-ZJ3FMSHR-3nWA91tG-tqXnplPu.js +36 -0
  9. package/client/assets/architectureDiagram-ZJ3FMSHR-BEgLzbC0.js +36 -0
  10. package/client/assets/{blockDiagram-677ZJIJ3-DQ35o5E4-BXS11D3J.js → blockDiagram-677ZJIJ3-BPuAJQRW-CxKiN_v_.js} +10 -10
  11. package/client/assets/{blockDiagram-677ZJIJ3-aYvCODxv.js → blockDiagram-677ZJIJ3-D6-nAhT2.js} +3 -3
  12. package/client/assets/{c4Diagram-LMCZKHZV-Bau6RMBb.js → c4Diagram-LMCZKHZV-BHlfURC3.js} +2 -2
  13. package/client/assets/{c4Diagram-LMCZKHZV-ClWZeiWo-DXGnOOUf.js → c4Diagram-LMCZKHZV-C0LAqQso-DKJYOYhq.js} +3 -3
  14. package/client/assets/channel-7wUqSdoX-C_V89OUp.js +1 -0
  15. package/client/assets/channel-CkfP_QOM.js +1 -0
  16. package/client/assets/{chunk-32BRIVSS-CCt9wtYd-Cwa_IP35.js → chunk-32BRIVSS-BRrYpgtb-D66HGyim.js} +1 -1
  17. package/client/assets/{chunk-32BRIVSS-CxzHeys5.js → chunk-32BRIVSS-D9wEVNTU.js} +1 -1
  18. package/client/assets/{chunk-52WLFC77-FbBbR4uI-wsNC5d-f.js → chunk-52WLFC77-BJ-ss3Xr-yli54ol3.js} +2 -2
  19. package/client/assets/{chunk-52WLFC77-BtNjbTdw.js → chunk-52WLFC77-DWo67RXY.js} +1 -1
  20. package/client/assets/chunk-5FCAYU7R-DNtJmW0j.js +1 -0
  21. package/client/assets/chunk-5HE753X5-o8-OCfIL.js +1 -0
  22. package/client/assets/chunk-5JV3BV7I-DKfYBAeY.js +1 -0
  23. package/client/assets/chunk-5TONJI2A-DOX2waSJ.js +2 -0
  24. package/client/assets/chunk-BIQX33UG-CuPbkyWp.js +1 -0
  25. package/client/assets/{chunk-C7G6YPKG-C87hlS9c-BitbJpTa.js → chunk-C7G6YPKG-BZEucKEL-Bi7TfXWe.js} +1 -1
  26. package/client/assets/{chunk-C7G6YPKG-BE8ehsnc.js → chunk-C7G6YPKG-DZx-IR8j.js} +1 -1
  27. package/client/assets/chunk-CQNSW5MT-BbEh_krl.js +1 -0
  28. package/client/assets/chunk-CYSBUYHQ-CbOq7Rc1.js +1 -0
  29. package/client/assets/chunk-D8eiyYIV-D55tgtzm.js +1 -0
  30. package/client/assets/chunk-EMLP6XTP-BoneA0Uo.js +1 -0
  31. package/client/assets/{chunk-EX3LRPZG-BqGqMXLN-Cl2Eo1_u.js → chunk-EX3LRPZG-DLS6FBN1-BAJyr-Ct.js} +3 -3
  32. package/client/assets/{chunk-EX3LRPZG-Bhgskzyy.js → chunk-EX3LRPZG-w7OrMXYQ.js} +2 -2
  33. package/client/assets/{chunk-FWX5IMBZ-D9sskZb_.js → chunk-FWX5IMBZ-BVoKdd_g.js} +2 -2
  34. package/client/assets/{chunk-FWX5IMBZ-BkbSAAuW-C2r4AuAO.js → chunk-FWX5IMBZ-DHLSFw1H-uyc7D4vO.js} +2 -2
  35. package/client/assets/{chunk-HOUHSVGY-Cxu0eDlh-owg_DcY0.js → chunk-HOUHSVGY-Bhlt8hXJ-C_6N7WlG.js} +1 -1
  36. package/client/assets/{chunk-HOUHSVGY-CBCXk7rb.js → chunk-HOUHSVGY-CsniSN-m.js} +1 -1
  37. package/client/assets/chunk-ICXQ74PX-DwgHBX_g-BYMy_Tms.js +2 -0
  38. package/client/assets/{chunk-ICXQ74PX-DTqPpDQ9.js → chunk-ICXQ74PX-r48BQ3SP.js} +2 -2
  39. package/client/assets/chunk-JG7HCLWE-Dk4_aECj.js +2 -0
  40. package/client/assets/{chunk-KEIR6QF5-DNzq6p3w.js → chunk-KEIR6QF5-Dj-OpFgW.js} +5 -5
  41. package/client/assets/{chunk-MOJQB5TN-CqxshQHA-Cn_EpDyZ.js → chunk-MOJQB5TN-CMZRaeqt-pjKXfT4z.js} +3 -3
  42. package/client/assets/{chunk-MOJQB5TN-D1s_zUGz.js → chunk-MOJQB5TN-Zy5vyRW1.js} +1 -1
  43. package/client/assets/chunk-MOZMSUNE-BgA8jCvb.js +1 -0
  44. package/client/assets/{chunk-OGEWGWER-CjCr7ceX-Dfk5-70y.js → chunk-OGEWGWER-8Qy4a8b5-V5o-c2Sj.js} +1 -1
  45. package/client/assets/{chunk-OGEWGWER-DzfhxoQd.js → chunk-OGEWGWER-CoEgBgV4.js} +1 -1
  46. package/client/assets/chunk-OSBZ3O6U-CX9EQ5t2.js +1 -0
  47. package/client/assets/{chunk-PUDLZKDR-BZlebNhn.js → chunk-PUDLZKDR-B8qq3OpO.js} +3 -3
  48. package/client/assets/chunk-PUDLZKDR-DcrWQRYh-BRsBI7nq.js +156 -0
  49. package/client/assets/{chunk-Q4XR5HBZ-BcJb7mwA.js → chunk-Q4XR5HBZ-DGJYU9p1.js} +1 -1
  50. package/client/assets/{chunk-Q4XR5HBZ-CZd-9lTB-qPEYoRNc.js → chunk-Q4XR5HBZ-ZXVGkG8Z-DddfuS9d.js} +1 -1
  51. package/client/assets/chunk-QBLGF6JB-C9zGMqvP.js +1 -0
  52. package/client/assets/chunk-R7FJI6CG-BpBhcF6R.js +1 -0
  53. package/client/assets/{chunk-RYQCIY6F-B_IgMG7T.js → chunk-RYQCIY6F-AHipPOEA.js} +1 -1
  54. package/client/assets/{chunk-RYQCIY6F-YkbemkCt-CX4fncTQ.js → chunk-RYQCIY6F-CmHwCv5h-BPthLvkX.js} +1 -1
  55. package/client/assets/chunk-U6XO7XAA-CR0BSRFR.js +2 -0
  56. package/client/assets/{chunk-V7JOEXUC-Buce04o6.js → chunk-V7JOEXUC-D754YzMj.js} +2 -2
  57. package/client/assets/{chunk-V7JOEXUC-rI0xlC_O-C607vJXy.js → chunk-V7JOEXUC-DmGdheTX-DdeSpI9P.js} +4 -4
  58. package/client/assets/{chunk-VAUOI2AC-CxhkzXN0.js → chunk-VAUOI2AC-BAbw2DCD.js} +1 -1
  59. package/client/assets/{chunk-VAUOI2AC-DrcykVNK-CSROJWdE.js → chunk-VAUOI2AC-CS9QJ4yz-DzK4GLu7.js} +1 -1
  60. package/client/assets/{chunk-VR4S4FIN-O6iF8Yvf-CLIwrgqU.js → chunk-VR4S4FIN-C6a91eNY-QKZ1ki6J.js} +1 -1
  61. package/client/assets/{chunk-VR4S4FIN-D5afNrsS.js → chunk-VR4S4FIN-zILtmnP-.js} +1 -1
  62. package/client/assets/chunk-WYO6CB5R-BlzOfotS-CNW2AfuP.js +127 -0
  63. package/client/assets/{chunk-WYO6CB5R-BXTIdTMw.js → chunk-WYO6CB5R-DOOEMpuR.js} +2 -2
  64. package/client/assets/{chunk-XXDRQBXY-DXMD6ofA.js → chunk-XXDRQBXY-DlK_iNGL.js} +1 -1
  65. package/client/assets/chunk-YOTPTUD7-CjHV8V6f.js +1 -0
  66. package/client/assets/{chunk-ZGVPDNZ5-CYusI0J_.js → chunk-ZGVPDNZ5-BSTv4rHJ.js} +1 -1
  67. package/client/assets/{chunk-ZGVPDNZ5-BpFv9JSP-CHYySMjV.js → chunk-ZGVPDNZ5-BYwxNFTK-COXeJVkk.js} +9 -9
  68. package/client/assets/classDiagram-OUVF2IWQ-BYlRi6YQ-BnAFLhmC.js +1 -0
  69. package/client/assets/classDiagram-OUVF2IWQ-CsuRjVbb.js +1 -0
  70. package/client/assets/classDiagram-v2-EOCWNBFH-BCHaYHxj-BnAFLhmC.js +1 -0
  71. package/client/assets/classDiagram-v2-EOCWNBFH-CsuRjVbb.js +1 -0
  72. package/client/assets/cose-bilkent-JH36ORCC-ClnkE1nH.js +1 -0
  73. package/client/assets/cose-bilkent-JH36ORCC-DDu6UbVg-6Z5sGh3p.js +1 -0
  74. package/client/assets/cynefin-VYW2F7L2-4m18BxUG.js +1 -0
  75. package/client/assets/cynefin-VYW2F7L2-CGYr2F6h-D8q8f9Cp.js +1 -0
  76. package/client/assets/cynefinDiagram-TSTJHNR4-Bi8nukib.js +62 -0
  77. package/client/assets/{cynefinDiagram-TSTJHNR4-x0-0sQ15-Cq1gFcFu.js → cynefinDiagram-TSTJHNR4-DHA9iPo--DtKHpboy.js} +1 -1
  78. package/client/assets/cytoscape.esm-CQFVGiJu.js +321 -0
  79. package/client/assets/cytoscape.esm-CncKIM2s-CQFVGiJu.js +321 -0
  80. package/client/assets/{dagre-wczQIDso-CfevN9RO.js → dagre-CF0ZwvCl-CSPF5CVP.js} +1 -1
  81. package/client/assets/{dagre-VKFMJZFB-CQdfl-bx-CzZZuace.js → dagre-VKFMJZFB--oJKqXBZ-DiYgmsaL.js} +2 -2
  82. package/client/assets/{dagre-VKFMJZFB-C_9IS7mB.js → dagre-VKFMJZFB-C1ITHaIN.js} +2 -2
  83. package/client/assets/{dagre-CXRCoUWR.js → dagre-dpRSp0QF.js} +1 -1
  84. package/client/assets/diagram-FQU43EPY-BaTTRfyt.js +3 -0
  85. package/client/assets/{diagram-FQU43EPY-BOSB6VUb-isPdQ8WX.js → diagram-FQU43EPY-CcJCB9bG-DWDgTP-w.js} +3 -3
  86. package/client/assets/diagram-G47NLZAW-C_o-WGG1-B2r14NtH.js +24 -0
  87. package/client/assets/{diagram-G47NLZAW-ulE1JlWG.js → diagram-G47NLZAW-CacIL-Pg.js} +2 -2
  88. package/client/assets/{diagram-NH7WQ7WH-D_IXrL3i.js → diagram-NH7WQ7WH-C2XIWiyF.js} +1 -1
  89. package/client/assets/{diagram-NH7WQ7WH-BMQp1rkF-D6-fOq_v.js → diagram-NH7WQ7WH-CXJCYvY--nFMoNwQC.js} +1 -1
  90. package/client/assets/{diagram-OA4YK3LP-D1wQ0vUj-BNi6QLCK.js → diagram-OA4YK3LP-BMzeJ87A-CM-WEA1W.js} +2 -2
  91. package/client/assets/{diagram-OA4YK3LP-C-pC6Eyu.js → diagram-OA4YK3LP-Don4E7eX.js} +3 -3
  92. package/client/assets/diagram-WEI45ONY-CyySk9Cj.js +41 -0
  93. package/client/assets/{diagram-WEI45ONY-RR0DpF8R-BS3nrb3w.js → diagram-WEI45ONY-D_93NKqo-VEDONN1d.js} +2 -2
  94. package/client/assets/dist-BH9bKIvu.js +1 -0
  95. package/client/assets/ebnfDiagram-CCIWWBDH-BTAOE5UD.js +1 -0
  96. package/client/assets/{ebnfDiagram-CCIWWBDH-M123uVJ8-9-dq55nQ.js → ebnfDiagram-CCIWWBDH-CVai1Ii9-JuINr049.js} +1 -1
  97. package/client/assets/{erDiagram-Q63AITRT-CMbtO3Sm.js → erDiagram-Q63AITRT-BmuYd4oT.js} +2 -2
  98. package/client/assets/{erDiagram-Q63AITRT-BWx_-PXG-CWGfG4z5.js → erDiagram-Q63AITRT-CiABnA0s-BTp1ksjd.js} +3 -3
  99. package/client/assets/eventmodeling-45OFAUF4-CWmqhm3a-DaMXgsq1.js +1 -0
  100. package/client/assets/eventmodeling-45OFAUF4-Dp0gpjhg.js +1 -0
  101. package/client/assets/flowDiagram-23GEKE2U-Cg2bsWXx.js +1 -0
  102. package/client/assets/flowDiagram-23GEKE2U-DKSB5AiY-L0uHDxpA.js +1 -0
  103. package/client/assets/ganttDiagram-NO4QXBWP-CsSkApOb.js +292 -0
  104. package/client/assets/ganttDiagram-NO4QXBWP-DQZvdFo1-Cgb7YCUp.js +292 -0
  105. package/client/assets/gitGraph-TEB2WS4Q-BR9qPwdN-BJo8GRlR.js +1 -0
  106. package/client/assets/gitGraph-TEB2WS4Q-Do0SQOtM.js +1 -0
  107. package/client/assets/{gitGraphDiagram-IHSO6WYX-B2CJhk_G-ClOKkjxw.js → gitGraphDiagram-IHSO6WYX-C2ovBouh-BeuFn51y.js} +5 -5
  108. package/client/assets/gitGraphDiagram-IHSO6WYX-CtPRy8Z7.js +106 -0
  109. package/client/assets/{graphlib-B8gBHxth.js → graphlib-DS17s2tU.js} +1 -1
  110. package/client/assets/{graphlib-hY-1btwe-DQjxxcnr.js → graphlib-I2XjzNHe-RhW8UfaN.js} +1 -1
  111. package/client/assets/heic2any-EZu0dVlS.js +66 -0
  112. package/client/assets/html2canvas-CDGcmOD3-ukyIyzI-.js +5 -0
  113. package/client/assets/index-BLM4Fy-7.js +5072 -0
  114. package/client/assets/{index-BXb--as6.css → index-fGG7U2mb.css} +1 -1
  115. package/client/assets/index.es-DqtpmBm8-BjIwhbGt.js +5 -0
  116. package/client/assets/info-DKCQHKI2-DIc7uC4I.js +1 -0
  117. package/client/assets/info-DKCQHKI2-Dplx5kMp-PEA0dB7D.js +1 -0
  118. package/client/assets/{infoDiagram-FWYZ7A6U-Mp1X3pBP-ATJv87Ur.js → infoDiagram-FWYZ7A6U-7UnoB5AP-BmcCrm-Q.js} +1 -1
  119. package/client/assets/infoDiagram-FWYZ7A6U-DkCDDBsK.js +2 -0
  120. package/client/assets/{ishikawaDiagram-FXEZZL3T-BNG7tkJu-CGCeOIlJ.js → ishikawaDiagram-FXEZZL3T-ByUDM_N2-Df6QkX36.js} +3 -3
  121. package/client/assets/{ishikawaDiagram-FXEZZL3T-CVDUj46f.js → ishikawaDiagram-FXEZZL3T-DhxgPq51.js} +2 -2
  122. package/client/assets/{journeyDiagram-5HDEW3XC-BA-ESGLP.js → journeyDiagram-5HDEW3XC-CuLTUpBK.js} +3 -3
  123. package/client/assets/{journeyDiagram-5HDEW3XC-Dbp_hY9X-Bx-IoCe9.js → journeyDiagram-5HDEW3XC-c5xIah9o-iIHb-wNM.js} +4 -4
  124. package/client/assets/{kanban-definition-HUTT4EX6-DSTc5u3q-C0JGckt1.js → kanban-definition-HUTT4EX6-Cnt6loYD-CMqIbYg3.js} +7 -7
  125. package/client/assets/{kanban-definition-HUTT4EX6-Bqaet01L.js → kanban-definition-HUTT4EX6-N2X0Puic.js} +2 -2
  126. package/client/assets/{katex-CddkPoXu.js → katex-B7rAX3Vi.js} +1 -1
  127. package/client/assets/{katex-M0IxphGf-CddkPoXu.js → katex-C_9rYNVQ-B7rAX3Vi.js} +1 -1
  128. package/client/assets/lib-y9UXKPRL.js +114 -0
  129. package/client/assets/{line-CkyHfW7d.js → line-BXNA28H5.js} +1 -1
  130. package/client/assets/{line-B1wBwzrY-f5wxpqoF.js → line-D7ziSjKi-B1_q9owb.js} +1 -1
  131. package/client/assets/{linear-B9fuEF4c.js → linear-BiXMiKrI.js} +1 -1
  132. package/client/assets/{map-DsCK-0Cs.js → map-BaFkSB1l.js} +1 -1
  133. package/client/assets/{map-CgrwEyH7-DWQFomlZ.js → map-apqDkUhJ-f2EW8y9V.js} +1 -1
  134. package/client/assets/{marked.esm-CIU5FDdN.js → marked.esm-D_BrEnGi.js} +16 -16
  135. package/client/assets/{marp-C9QDHFAJ.js → marp-DsqHCCYu.js} +234 -228
  136. package/client/assets/mermaid-parser.core-CMbO70Iy.js +4 -0
  137. package/client/assets/{mermaid-parser.core-DC7NPJ_M-Ca6XzwfM.js → mermaid-parser.core-DxEa8E3F-CmItqkOe.js} +7 -7
  138. package/client/assets/{mermaid.core-BBEQfkdJ.js → mermaid.core-S-qn8Fjh.js} +4 -4
  139. package/client/assets/mermaid.core-V0OYwIz3-Bm77sBEQ.js +11 -0
  140. package/client/assets/{mindmap-definition-LN4V7U3C-DYtgcMsY-DynyLTNv.js → mindmap-definition-LN4V7U3C-CexN3O6L-C0dmjX3H.js} +6 -6
  141. package/client/assets/{mindmap-definition-LN4V7U3C-B4BN0efL.js → mindmap-definition-LN4V7U3C-CqqDm5WC.js} +2 -2
  142. package/client/assets/packet-7NZHBO7P-CQI3flND-Db3MFqeC.js +1 -0
  143. package/client/assets/packet-7NZHBO7P-D2duWGIK.js +1 -0
  144. package/client/assets/{pegDiagram-2B236MQR-C43eIpKM-Bi_5Sxjt.js → pegDiagram-2B236MQR-BiM4G0cW-Wcq-mV7k.js} +1 -1
  145. package/client/assets/pegDiagram-2B236MQR-DrzJ7Jz4.js +1 -0
  146. package/client/assets/pie-RZYD4A2V-CnmKE2Wa-sztOF14f.js +1 -0
  147. package/client/assets/pie-RZYD4A2V-CynqTUkZ.js +1 -0
  148. package/client/assets/{pieDiagram-ENE6RG2P-BkTqgJyR-Bcdm19kR.js → pieDiagram-ENE6RG2P-B_fBBS-2-ChMXDmtl.js} +2 -2
  149. package/client/assets/pieDiagram-ENE6RG2P-Ou2SXK-A.js +39 -0
  150. package/client/assets/preload-helper-Czpn1I53.js +1 -0
  151. package/client/assets/purify.es-sLXpNpJ5.js +3 -0
  152. package/client/assets/{quadrantDiagram-ABIIQ3AL-BQmAJL2v.js → quadrantDiagram-ABIIQ3AL-B-MGAr4e.js} +2 -2
  153. package/client/assets/{quadrantDiagram-ABIIQ3AL-Bm1Zjm45-B3orqx_f.js → quadrantDiagram-ABIIQ3AL-BigGVxCR-BVI0wVmI.js} +4 -4
  154. package/client/assets/radar-I7S5WNFK-fIKE12aT.js +1 -0
  155. package/client/assets/radar-I7S5WNFK-us6x-Z9R-CkRPW8bD.js +1 -0
  156. package/client/assets/railroad-3IZDKUUU-BKdz6pdN-ChHwSTJk.js +1 -0
  157. package/client/assets/railroad-3IZDKUUU-Bgx8HJTj.js +1 -0
  158. package/client/assets/railroad-abnf-AHOZXSZD-Nh6k60mH.js +1 -0
  159. package/client/assets/railroad-abnf-AHOZXSZD-m_CSSIfd-BCBaHqla.js +1 -0
  160. package/client/assets/railroad-ebnf-EBAXGLYW-C74h3s_I.js +1 -0
  161. package/client/assets/railroad-ebnf-EBAXGLYW-Nu3nAG7C-DgAH0mvh.js +1 -0
  162. package/client/assets/railroad-peg-LSFZ7HO6--Y3mD4R_-BnWBkaNu.js +1 -0
  163. package/client/assets/railroad-peg-LSFZ7HO6-0hT-lN-u.js +1 -0
  164. package/client/assets/{railroadDiagram-RFXS5EU6-BkfbdeAs-Di6jH5I6.js → railroadDiagram-RFXS5EU6--lNIlG64-DJVkqaQv.js} +1 -1
  165. package/client/assets/railroadDiagram-RFXS5EU6-CaJYqOUh.js +1 -0
  166. package/client/assets/{requirementDiagram-TGXJPOKE-Dlqoe9TY.js → requirementDiagram-TGXJPOKE-06klrOCU.js} +2 -2
  167. package/client/assets/{requirementDiagram-TGXJPOKE-CrGTTjYg-DmIC7Shp.js → requirementDiagram-TGXJPOKE-D-B0Y5Wu-BYmwOTar.js} +5 -5
  168. package/client/assets/rolldown-runtime-CNC7AqOf.js +1 -0
  169. package/client/assets/runtime-protocol-vue-D-K9PWNl.js +1 -0
  170. package/client/assets/{runtime-vue-lHsY5zMj.js → runtime-vue-Vp1a1gFB.js} +1 -1
  171. package/client/assets/{sankeyDiagram-HTMAVEWB-BkTKgu8Q.js → sankeyDiagram-HTMAVEWB-CP5k4rjG.js} +2 -2
  172. package/client/assets/{sankeyDiagram-HTMAVEWB-rWXPf03Z-CjV9pCSJ.js → sankeyDiagram-HTMAVEWB-DlutaXDv-BoNwZavt.js} +5 -5
  173. package/client/assets/{sequenceDiagram-DBY2YBRQ-nkJYWO2m-BqS_sTCH.js → sequenceDiagram-DBY2YBRQ-BOLgtggH-Dg69N5_X.js} +6 -6
  174. package/client/assets/{sequenceDiagram-DBY2YBRQ-BpuXUcFy.js → sequenceDiagram-DBY2YBRQ-DVjGagTt.js} +3 -3
  175. package/client/assets/src-Cz8bXOH0.js +1 -0
  176. package/client/assets/{stateDiagram-2N3HPSRC-CdlGXuo7.js → stateDiagram-2N3HPSRC-CmEfTWWD.js} +1 -1
  177. package/client/assets/{stateDiagram-2N3HPSRC-T4-clK8b-DQRiB4va.js → stateDiagram-2N3HPSRC-jf_dXUEU-BXKAtbPN.js} +1 -1
  178. package/client/assets/stateDiagram-v2-6OUMAXLB-CuzgCL2v-DZ80ys2S.js +1 -0
  179. package/client/assets/stateDiagram-v2-6OUMAXLB-v-85z0s6.js +1 -0
  180. package/client/assets/swimlanes-5IMT3BWC-B-BFEZsj.js +2 -0
  181. package/client/assets/swimlanes-5IMT3BWC-CYjtALQH-rMx_ZnBc.js +2 -0
  182. package/client/assets/swimlanesDiagram-G3AALYLV-3bmSBtKs-DIYUYkIw.js +8 -0
  183. package/client/assets/swimlanesDiagram-G3AALYLV-BWm8rLnX.js +8 -0
  184. package/client/assets/{timeline-definition-FHXFAJF6-Bjh-7QmL.js → timeline-definition-FHXFAJF6-CH_JlXvj.js} +2 -2
  185. package/client/assets/{timeline-definition-FHXFAJF6-CNc9jSTP-BKNSymgY.js → timeline-definition-FHXFAJF6-DYJ4oUm8-MUfHnY-o.js} +5 -5
  186. package/client/assets/treeView-QDETBFTQ-CygwzEgj.js +1 -0
  187. package/client/assets/treeView-QDETBFTQ-D27HWG6Q-D6ZRNMo0.js +1 -0
  188. package/client/assets/treemap-6X3UGDF4-BbCXbaXr.js +1 -0
  189. package/client/assets/treemap-6X3UGDF4-CmGIU3H5-Da0cvAt3.js +1 -0
  190. package/client/assets/v4-DDdyfk2q.js +1 -0
  191. package/client/assets/{vennDiagram-L72KCM5P-Dr3pTJ_0-C38xwcVo.js → vennDiagram-L72KCM5P-CdKAHoek-BzVSnb3s.js} +4 -4
  192. package/client/assets/{vennDiagram-L72KCM5P-Cz3dbe7b.js → vennDiagram-L72KCM5P-DlnvP9fL.js} +2 -2
  193. package/client/assets/vue-CU5-3-x4.js +1 -0
  194. package/client/assets/vue-i18n-DMHgtTtA.js +3 -0
  195. package/client/assets/vue.runtime.esm-bundler-D9nG8JAr.js +4 -0
  196. package/client/assets/wardley-OPB4EBWU-BjXxCRf_.js +1 -0
  197. package/client/assets/wardley-OPB4EBWU-CbHWsb2k-Cke9AF-r.js +1 -0
  198. package/client/assets/{wardleyDiagram-EHGQE667-DSFc7ZZa-mlWXRiWx.js → wardleyDiagram-EHGQE667-BF6c4_CW-ClVAk-t3.js} +3 -3
  199. package/client/assets/{wardleyDiagram-EHGQE667-DiyoyO_X.js → wardleyDiagram-EHGQE667-CPX0a8kl.js} +3 -3
  200. package/client/assets/{xychartDiagram-FW5EYKEG-BP0Nn4Pp-DRRiStGZ.js → xychartDiagram-FW5EYKEG-CGiKngj7-CGJx8rEM.js} +4 -4
  201. package/client/assets/{xychartDiagram-FW5EYKEG-DhY1_UGM.js → xychartDiagram-FW5EYKEG-D_XBrDMx.js} +2 -2
  202. package/client/index.html +15 -13
  203. package/package.json +10 -9
  204. package/server/agent/backend/claude-code.ts +22 -5
  205. package/server/agent/backgroundSessions.ts +6 -0
  206. package/server/agent/config.ts +196 -51
  207. package/server/agent/index.ts +156 -101
  208. package/server/agent/mcp-esm-bootstrap.mjs +16 -0
  209. package/server/agent/mcp-esm-loader.d.mts +28 -0
  210. package/server/agent/mcp-esm-loader.mjs +106 -0
  211. package/server/agent/mcp-tools/manageCollection.ts +38 -30
  212. package/server/agent/mcp-tools/spawnBackgroundChat.ts +40 -37
  213. package/server/agent/mcpBrokerFailover.ts +32 -0
  214. package/server/api/routes/agent.ts +220 -67
  215. package/server/api/routes/attachment.ts +105 -48
  216. package/server/api/routes/config.ts +7 -0
  217. package/server/api/routes/files.ts +255 -107
  218. package/server/api/routes/mulmo-script.ts +111 -94
  219. package/server/api/routes/scheduler.ts +84 -72
  220. package/server/api/routes/schedulerTasks.ts +45 -48
  221. package/server/api/routes/wiki/history.ts +51 -45
  222. package/server/api/routes/wiki.ts +24 -14
  223. package/server/events/relay-client-helpers.ts +67 -0
  224. package/server/events/relay-client.ts +240 -202
  225. package/server/events/scheduler-adapter.ts +11 -1
  226. package/server/index.ts +145 -117
  227. package/server/plugins/dev-watcher.ts +70 -42
  228. package/server/plugins/preset-loader.ts +9 -32
  229. package/server/plugins/resolvePresetRoot.ts +53 -0
  230. package/server/prompts/system/system.md +1 -1
  231. package/server/remoteHost/auth.ts +8 -25
  232. package/server/remoteHost/commandChannel.ts +7 -52
  233. package/server/remoteHost/firebase.ts +8 -18
  234. package/server/remoteHost/index.ts +26 -100
  235. package/server/remoteHost/onExpire.ts +50 -0
  236. package/server/system/credentials.ts +31 -23
  237. package/server/utils/files/attachment-store.ts +8 -0
  238. package/server/utils/files/csp-io.ts +45 -0
  239. package/server/utils/files/image-jpeg-convert.ts +89 -0
  240. package/server/workspace/chat-index/index.ts +33 -26
  241. package/server/workspace/chat-index/summarizer.ts +22 -16
  242. package/server/workspace/collections/remoteView.ts +47 -18
  243. package/server/workspace/journal/archivist-cli.ts +49 -30
  244. package/server/workspace/journal/index.ts +58 -41
  245. package/server/workspace/memory/topic-migrate.ts +36 -25
  246. package/server/workspace/memory/topic-run.ts +40 -35
  247. package/server/workspace/memory/topic-swap.ts +62 -49
  248. package/server/workspace/paths.ts +14 -6
  249. package/server/workspace/skills/external/install.ts +18 -9
  250. package/server/workspace/skills/scheduled-run.ts +97 -0
  251. package/server/workspace/skills/scheduler.ts +62 -40
  252. package/server/workspace/skills/user-tasks.ts +36 -20
  253. package/server/workspace/skills/writer.ts +7 -2
  254. package/src/App.vue +15 -0
  255. package/src/components/ChatAttachmentPreview.vue +23 -2
  256. package/src/components/ChatInput.vue +15 -2
  257. package/src/components/FileContentHeader.vue +33 -3
  258. package/src/components/FileContentRenderer.vue +23 -4
  259. package/src/components/RemoteHostControl.vue +12 -5
  260. package/src/composables/collections/uiHost.ts +13 -1
  261. package/src/composables/useContentDisplay.ts +18 -3
  262. package/src/composables/useCspExtra.ts +28 -0
  263. package/src/composables/useCspViolations.ts +115 -0
  264. package/src/composables/useDirChildrenCache.ts +85 -0
  265. package/src/composables/useFileContentLoader.ts +67 -0
  266. package/src/composables/useFileSelection.ts +7 -60
  267. package/src/composables/useFileTree.helpers.ts +31 -0
  268. package/src/composables/useFileTree.ts +15 -98
  269. package/src/composables/useOpenInOs.ts +68 -0
  270. package/src/composables/useRefRoots.ts +24 -0
  271. package/src/composables/useSessionHistory.helpers.ts +8 -0
  272. package/src/composables/useSessionHistory.ts +55 -46
  273. package/src/composables/useVoiceInput.helpers.ts +12 -0
  274. package/src/composables/useVoiceInput.ts +2 -5
  275. package/src/config/apiRoutes.ts +13 -0
  276. package/src/config/roles.ts +1 -0
  277. package/src/config/workspacePaths.ts +6 -0
  278. package/src/lang/de.ts +11 -0
  279. package/src/lang/en.ts +11 -0
  280. package/src/lang/es.ts +11 -0
  281. package/src/lang/fr.ts +11 -0
  282. package/src/lang/ja.ts +11 -0
  283. package/src/lang/ko.ts +10 -0
  284. package/src/lang/pt-BR.ts +11 -0
  285. package/src/lang/zh.ts +10 -0
  286. package/src/plugins/scheduler/TasksTab.vue +1 -1
  287. package/src/types/pastedFile.ts +10 -0
  288. package/src/utils/agent/eventDispatch.ts +18 -17
  289. package/src/utils/attachment/heicPreview.ts +65 -0
  290. package/src/utils/html/customViewSrcdoc.ts +10 -4
  291. package/src/utils/html/previewCsp.ts +76 -24
  292. package/client/assets/JsonEditor-CoWGJG3Y.js +0 -10
  293. package/client/assets/abnfDiagram-VRR7QNED-BrQlVixL.js +0 -1
  294. package/client/assets/architecture-TIHT7OUA-CYMWc3UT-C7HoFzWN.js +0 -1
  295. package/client/assets/architecture-TIHT7OUA-aml8u-G9.js +0 -1
  296. package/client/assets/architectureDiagram-ZJ3FMSHR-Bgnyaj_i-CCpEsCHN.js +0 -36
  297. package/client/assets/architectureDiagram-ZJ3FMSHR-DJTFpPjB.js +0 -36
  298. package/client/assets/channel-D9VSi_QV.js +0 -1
  299. package/client/assets/channel-Di5rtkx0-C3gZcytF.js +0 -1
  300. package/client/assets/chunk-D8eiyYIV-BeeEsA1B.js +0 -1
  301. package/client/assets/chunk-ICXQ74PX-hiraF_Xj-CdaEwVin.js +0 -2
  302. package/client/assets/chunk-PUDLZKDR-Dx6M-vz1-CLyVurOz.js +0 -156
  303. package/client/assets/chunk-WYO6CB5R-B83L_z6I-Cs8mg9If.js +0 -127
  304. package/client/assets/classDiagram-OUVF2IWQ-BgAZMSbT-BgxEE1D3.js +0 -1
  305. package/client/assets/classDiagram-OUVF2IWQ-CBD3Eidl.js +0 -1
  306. package/client/assets/classDiagram-v2-EOCWNBFH-CBD3Eidl.js +0 -1
  307. package/client/assets/classDiagram-v2-EOCWNBFH-DxHTyui1-BgxEE1D3.js +0 -1
  308. package/client/assets/cose-bilkent-JH36ORCC-CuSL2tA8-aMIqISfj.js +0 -1
  309. package/client/assets/cose-bilkent-JH36ORCC-WAJDBXv1.js +0 -1
  310. package/client/assets/cynefin-VYW2F7L2-DH2qkJKw.js +0 -1
  311. package/client/assets/cynefin-VYW2F7L2-DqA3n9nY-BNWhIK_n.js +0 -1
  312. package/client/assets/cynefinDiagram-TSTJHNR4-CUvPV9MV.js +0 -62
  313. package/client/assets/cytoscape.esm-CzdwbRaj-Djp6vQyU.js +0 -321
  314. package/client/assets/cytoscape.esm-Djp6vQyU.js +0 -321
  315. package/client/assets/diagram-FQU43EPY-BP8N00-b.js +0 -3
  316. package/client/assets/diagram-G47NLZAW-DLXrcXsN-BIqj7RKy.js +0 -24
  317. package/client/assets/diagram-WEI45ONY-Di9m35i-.js +0 -41
  318. package/client/assets/dist-CQ3HaWOk.js +0 -1
  319. package/client/assets/ebnfDiagram-CCIWWBDH-Cbwnim2x.js +0 -1
  320. package/client/assets/eventmodeling-45OFAUF4--32SIpkL.js +0 -1
  321. package/client/assets/eventmodeling-45OFAUF4-_BVSjAXf-DQdL0Icr.js +0 -1
  322. package/client/assets/flowDiagram-23GEKE2U-BeOc_anm-CuVzKmmU.js +0 -1
  323. package/client/assets/flowDiagram-23GEKE2U-Dofa_qxG.js +0 -1
  324. package/client/assets/ganttDiagram-NO4QXBWP-BOoJ1eTw-TWoNmSvq.js +0 -292
  325. package/client/assets/ganttDiagram-NO4QXBWP-BgoAVKuc.js +0 -292
  326. package/client/assets/gitGraph-TEB2WS4Q-CH12KLTN-Bz4frAhV.js +0 -1
  327. package/client/assets/gitGraph-TEB2WS4Q-DIMvNvqt.js +0 -1
  328. package/client/assets/gitGraphDiagram-IHSO6WYX-Dmb6KnPz.js +0 -106
  329. package/client/assets/html2canvas-CDGcmOD3-DRL9pFVl.js +0 -5
  330. package/client/assets/index-B3NxFcEH.js +0 -5072
  331. package/client/assets/index.es-DqtpmBm8-EQk3NgR8.js +0 -5
  332. package/client/assets/info-DKCQHKI2-Cbw3mbiK-GsDZz9IO.js +0 -1
  333. package/client/assets/info-DKCQHKI2-ViCqobGo.js +0 -1
  334. package/client/assets/infoDiagram-FWYZ7A6U-HKV7LIG-.js +0 -2
  335. package/client/assets/lib-4Tgx7rAy.js +0 -114
  336. package/client/assets/mermaid-parser.core-SAwSf4_o.js +0 -7
  337. package/client/assets/mermaid.core-DZM3Ha-E-BxOo-RYG.js +0 -11
  338. package/client/assets/packet-7NZHBO7P-CY4XRk9N.js +0 -1
  339. package/client/assets/packet-7NZHBO7P-lwb58iYx--vqSg65J.js +0 -1
  340. package/client/assets/pegDiagram-2B236MQR-BOKErjUu.js +0 -1
  341. package/client/assets/pie-RZYD4A2V-6BHB7bAx.js +0 -1
  342. package/client/assets/pie-RZYD4A2V-B1UWb4Gu-Dmn2hLWH.js +0 -1
  343. package/client/assets/pieDiagram-ENE6RG2P-DtNjvz-U.js +0 -39
  344. package/client/assets/preload-helper-CZgWQFsJ.js +0 -1
  345. package/client/assets/purify.es-DY32g7DN.js +0 -3
  346. package/client/assets/radar-I7S5WNFK-7CKcb_l--CqKdnR0v.js +0 -1
  347. package/client/assets/radar-I7S5WNFK-R7Jhjfdt.js +0 -1
  348. package/client/assets/railroad-3IZDKUUU-BepSPyHI.js +0 -1
  349. package/client/assets/railroad-3IZDKUUU-gCySKdnW-CKU26HTP.js +0 -1
  350. package/client/assets/railroad-abnf-AHOZXSZD-BlsHsp3c.js +0 -1
  351. package/client/assets/railroad-abnf-AHOZXSZD-BophH4r--CGkGHq54.js +0 -1
  352. package/client/assets/railroad-ebnf-EBAXGLYW-AZNjl_Zu-B7bn_PF3.js +0 -1
  353. package/client/assets/railroad-ebnf-EBAXGLYW-B4fMcGEH.js +0 -1
  354. package/client/assets/railroad-peg-LSFZ7HO6-B1ZrjJIu.js +0 -1
  355. package/client/assets/railroad-peg-LSFZ7HO6-BSiEEyeb-CP_B-N5g.js +0 -1
  356. package/client/assets/railroadDiagram-RFXS5EU6-8cz0Iby3.js +0 -1
  357. package/client/assets/runtime-protocol-vue-WG3JLsjz.js +0 -1
  358. package/client/assets/src-Cqa3Jy1j.js +0 -1
  359. package/client/assets/stateDiagram-v2-6OUMAXLB-BN8Jr3ZM.js +0 -1
  360. package/client/assets/stateDiagram-v2-6OUMAXLB-DIp7nhRd-DbrOhUn_.js +0 -1
  361. package/client/assets/swimlanes-5IMT3BWC-HmQNEntu-CNBgZdur.js +0 -2
  362. package/client/assets/swimlanes-5IMT3BWC-iEJg5gki.js +0 -2
  363. package/client/assets/swimlanesDiagram-G3AALYLV-BeoZhwg7-DpqgeNRA.js +0 -8
  364. package/client/assets/swimlanesDiagram-G3AALYLV-o-sS6aEP.js +0 -8
  365. package/client/assets/treeView-QDETBFTQ-D3cqRl6k.js +0 -1
  366. package/client/assets/treeView-QDETBFTQ-nIQcG1h9-O_ri9HxD.js +0 -1
  367. package/client/assets/treemap-6X3UGDF4-BnsvC8yL-Cfsty1e3.js +0 -1
  368. package/client/assets/treemap-6X3UGDF4-DGkZcvDG.js +0 -1
  369. package/client/assets/v4-B29ayslu.js +0 -1
  370. package/client/assets/vue-C6d2VveO.js +0 -1
  371. package/client/assets/vue-i18n-CL-ejuNu.js +0 -3
  372. package/client/assets/vue.runtime.esm-bundler-BeoTfMNc.js +0 -4
  373. package/client/assets/wardley-OPB4EBWU-8Odxkx6V-CCDIVuBs.js +0 -1
  374. package/client/assets/wardley-OPB4EBWU-CZsCDvKk.js +0 -1
  375. package/server/remoteHost/hostRunner.ts +0 -122
  376. package/server/system/logs/aaa +0 -737
  377. package/server/system/logs/bb +0 -446
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-CNC7AqOf.js";import{Gt as t,K as n,Nr as r,Qt as i,Rt as a,X as o,Y as s,Zn as c,at as l,hr as u,q as d,qt as ee,sr as f,wt as p,zn as m}from"./vue.runtime.esm-bundler-D9nG8JAr.js";import{n as te}from"./vue-i18n-DMHgtTtA.js";import{t as ne}from"./vue-CU5-3-x4.js";function h(e,t){if(e instanceof Error)return e.message;if(typeof e==`object`&&e){let t=e;if(typeof t.details==`string`&&t.details)return t.details;if(typeof t.message==`string`&&t.message)return t.message}return t===void 0?String(e):t}function g(e,t){return e instanceof Error?e:Error(t??h(e))}function re(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ie(e){return typeof e==`object`&&!!e}function ae(e){return typeof e==`string`&&e.trim().length>0}function oe(e,t){return re(e)&&typeof e[t]==`string`}m();var _=c(!0),se=c(null);function ce(e){return typeof DOMException<`u`&&e instanceof DOMException&&e.name===`AbortError`||typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`}var v=null;function le(e){v=e}function ue(e){if(!e)return``;let t=[];for(let[n,r]of Object.entries(e))r!==void 0&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`);return t.length===0?``:`?${t.join(`&`)}`}function de(e,t){let n={...e.headers??{}};return t&&n[`Content-Type`]===void 0&&(n[`Content-Type`]=`application/json`),v&&n.Authorization===void 0&&(n.Authorization=`Bearer ${v}`),n}async function fe(e){let{status:t}=e;try{let n=await e.clone().json();if(oe(n,`error`))return{error:n.error,status:t}}catch{}return{error:e.statusText||`Request failed (${t})`,status:t}}async function y(e,t={}){let n=t.method??`GET`,r=t.body!==void 0,i=`${e}${ue(t.query)}`,a={method:n,headers:de(t,r),signal:t.signal};r&&(a.body=JSON.stringify(t.body));let o;try{o=await fetch(i,a)}catch(e){let t=h(e);return ce(e)||(_.value=!1,se.value=t),{ok:!1,error:t,status:0}}if(_.value||(_.value=!0,se.value=null),!o.ok){let{error:e,status:t}=await fe(o);return{ok:!1,error:e,status:t}}try{return{ok:!0,data:await o.json()}}catch(e){return{ok:!1,error:`Invalid JSON response: ${h(e)}`,status:o.status}}}function pe(e,t,n={}){return y(e,{...n,method:`GET`,query:t})}function me(e,t,n={}){return y(e,{...n,method:`POST`,body:t})}function he(e,t,n={}){return y(e,{...n,method:`PUT`,body:t})}function ge(e,t,n={}){return y(e,{...n,method:`DELETE`,body:t})}async function _e(e,t={}){let n=`${e}${ue(t.query)}`,r={method:t.method??`GET`,headers:de(t,!1),body:t.body,signal:t.signal};return fetch(n,r)}var b=Object.create(null);b.open=`0`,b.close=`1`,b.ping=`2`,b.pong=`3`,b.message=`4`,b.upgrade=`5`,b.noop=`6`;var x=Object.create(null);Object.keys(b).forEach(e=>{x[b[e]]=e});var S={type:`error`,data:`parser error`},ve=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,ye=typeof ArrayBuffer==`function`,be=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,xe=({type:e,data:t},n,r)=>ve&&t instanceof Blob?n?r(t):Se(t,r):ye&&(t instanceof ArrayBuffer||be(t))?n?r(t):Se(new Blob([t]),r):r(b[e]+(t||``)),Se=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function Ce(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var we;function Te(e,t){if(ve&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ce).then(t);if(ye&&(e.data instanceof ArrayBuffer||be(e.data)))return t(Ce(e.data));xe(e,!1,e=>{we||=new TextEncoder,t(we.encode(e))})}var Ee=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,C=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;e++)C[Ee.charCodeAt(e)]=e;var De=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=C[e.charCodeAt(r)],o=C[e.charCodeAt(r+1)],s=C[e.charCodeAt(r+2)],c=C[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},Oe=typeof ArrayBuffer==`function`,w=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:Ae(e,t)};let n=e.charAt(0);return n===`b`?{type:`message`,data:ke(e.substring(1),t)}:x[n]?e.length>1?{type:x[n],data:e.substring(1)}:{type:x[n]}:S},ke=(e,t)=>Oe?Ae(De(e),t):{base64:!0,data:e},Ae=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},je=``,Me=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{xe(e,!1,e=>{r[a]=e,++i===n&&t(r.join(je))})})},Ne=(e,t)=>{let n=e.split(je),r=[];for(let e=0;e<n.length;e++){let i=w(n[e],t);if(r.push(i),i.type===`error`)break}return r};function Pe(){return new TransformStream({transform(e,t){Te(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var Fe;function T(e){return e.reduce((e,t)=>e+t.length,0)}function E(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Ie(e,t){Fe||=new TextDecoder;let n=[],r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(T(n)<1)break;let e=E(n,1);a=(e[0]&128)==128,i=e[0]&127,r=i<126?3:i===126?1:2}else if(r===1){if(T(n)<2)break;let e=E(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(r===2){if(T(n)<8)break;let e=E(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>2**21-1){s.enqueue(S);break}i=a*2**32+t.getUint32(4),r=3}else{if(T(n)<i)break;let e=E(n,i);s.enqueue(w(a?e:Fe.decode(e),t)),r=0}if(i===0||i>e){s.enqueue(S);break}}}})}function D(e){if(e)return Le(e)}function Le(e){for(var t in D.prototype)e[t]=D.prototype[t];return e}D.prototype.on=D.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},D.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},D.prototype.off=D.prototype.removeListener=D.prototype.removeAllListeners=D.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},D.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},D.prototype.emitReserved=D.prototype.emit,D.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},D.prototype.hasListeners=function(e){return!!this.listeners(e).length};var O=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),k=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),Re=`arraybuffer`;function ze(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var Be=k.setTimeout,Ve=k.clearTimeout;function A(e,t){t.useNativeTimers?(e.setTimeoutFn=Be.bind(k),e.clearTimeoutFn=Ve.bind(k)):(e.setTimeoutFn=k.setTimeout.bind(k),e.clearTimeoutFn=k.clearTimeout.bind(k))}var He=1.33;function Ue(e){return typeof e==`string`?We(e):Math.ceil((e.byteLength||e.size)*He)}function We(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Ge(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ke(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function qe(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var Je=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},j=class extends D{constructor(e){super(),this.writable=!1,A(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new Je(e,t,n)),this}open(){return this.readyState=`opening`,this.doOpen(),this}close(){return(this.readyState===`opening`||this.readyState===`open`)&&(this.doClose(),this.onClose()),this}send(e){this.readyState===`open`&&this.write(e)}onOpen(){this.readyState=`open`,this.writable=!0,super.emitReserved(`open`)}onData(e){let t=w(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(`packet`,e)}onClose(e){this.readyState=`closed`,super.emitReserved(`close`,e)}pause(e){}createUri(e,t={}){return e+`://`+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?`:`+this.opts.port:``}_query(e){let t=Ke(e);return t.length?`?`+t:``}},Ye=class extends j{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}onData(e){Ne(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,Me(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ge()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},Xe=!1;try{Xe=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var Ze=Xe;function Qe(){}var $e=class extends Ye{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},M=class e extends D{constructor(e,t,n){super(),this.createRequest=e,A(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=ze(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(this._xhr===void 0||this._xhr===null)){if(this._xhr.onreadystatechange=Qe,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(M.requestsCount=0,M.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,et);else if(typeof addEventListener==`function`){let e=`onpagehide`in k?`pagehide`:`unload`;addEventListener(e,et,!1)}}function et(){for(let e in M.requests)M.requests.hasOwnProperty(e)&&M.requests[e].abort()}var tt=(function(){let e=rt({xdomain:!1});return e&&e.responseType!==null})(),nt=class extends $e{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=tt&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new M(rt,this.uri(),e)}};function rt(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||Ze))return new XMLHttpRequest}catch{}if(!t)try{return new k[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var it=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,at=class extends j{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=it?{}:ze(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved(`error`,e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:`websocket connection closed`,context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError(`websocket error`,e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;xe(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&O(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ge()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},ot=k.WebSocket||k.MozWebSocket,st={websocket:class extends at{createSocket(e,t,n){return it?new ot(e,t,n):t?new ot(e,t):new ot(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends j{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved(`error`,e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError(`webtransport error`,e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Ie(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=Pe();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&O(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:nt},ct=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lt=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function N(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=ct.exec(e||``),a={},o=14;for(;o--;)a[lt[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,`:`),a.authority=a.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`),a.ipv6uri=!0),a.pathNames=ut(a,a.path),a.queryKey=dt(a,a.query),a}function ut(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function dt(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var P=typeof addEventListener==`function`&&typeof removeEventListener==`function`,F=[];P&&addEventListener(`offline`,()=>{F.forEach(e=>e())},!1);var I=class e extends D{constructor(e,t){if(super(),this.binaryType=Re,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e==`object`&&(t=e,e=null),e){let n=N(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=N(t.host).host);A(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,t.hostname&&!t.port&&(t.port=this.secure?`443`:`80`),this.hostname=t.hostname||(typeof location<`u`?location.hostname:`localhost`),this.port=t.port||(typeof location<`u`&&location.port?location.port:this.secure?`443`:`80`),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:`/engine.io`,agent:!1,withCredentials:!1,upgrade:!0,timestampParam:`t`,rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``),typeof this.opts.query==`string`&&(this.opts.query=qe(this.opts.query)),P&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener(`beforeunload`,this._beforeunloadEventListener,!1)),this.hostname!==`localhost`&&(this._offlineEventListener=()=>{this._onClose(`transport close`,{description:`network connection lost`})},F.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.priorWebsocketSuccess=this.transport.name===`websocket`,this.emitReserved(`open`),this.flush()}_onPacket(e){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`)switch(this.emitReserved(`packet`,e),this.emitReserved(`heartbeat`),e.type){case`open`:this.onHandshake(JSON.parse(e.data));break;case`ping`:this._sendPacket(`pong`),this.emitReserved(`ping`),this.emitReserved(`pong`),this._resetPingTimeout();break;case`error`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data);break}}onHandshake(e){this.emitReserved(`handshake`,e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!==`closed`&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved(`drain`):this.flush()}flush(){if(this.readyState!==`closed`&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=Ue(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,O(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={},n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{this.once(`upgrade`,t),this.once(`upgradeError`,t)};return(this.readyState===`opening`||this.readyState===`open`)&&(this.readyState=`closing`,this.writeBuffer.length?this.once(`drain`,()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`)return this.transports.shift(),this._open();this.emitReserved(`error`,t),this._onClose(`transport error`,t)}_onClose(e,t){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners(`close`),this.transport.close(),this.transport.removeAllListeners(),P&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=F.indexOf(this._offlineEventListener);e!==-1&&F.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};I.protocol=4;var ft=class extends I{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState===`open`&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;I.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n)if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;I.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},pt=class extends ft{constructor(e,t={}){let n=typeof e==`object`,r=n?{...e}:{...t};(!r.transports||r.transports&&typeof r.transports[0]==`string`)&&(r.transports=(r.transports||[`polling`,`websocket`,`webtransport`]).map(e=>st[e]).filter(e=>!!e)),super(n?r:e,r)}};pt.protocol;function mt(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=N(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var ht=typeof ArrayBuffer==`function`,gt=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,_t=Object.prototype.toString,vt=typeof Blob==`function`||typeof Blob<`u`&&_t.call(Blob)===`[object BlobConstructor]`,yt=typeof File==`function`||typeof File<`u`&&_t.call(File)===`[object FileConstructor]`;function L(e){return ht&&(e instanceof ArrayBuffer||gt(e))||vt&&e instanceof Blob||yt&&e instanceof File}function R(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(R(e[t]))return!0;return!1}if(L(e))return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return R(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&R(e[t]))return!0;return!1}function bt(e){let t=[],n=e.data,r=e;return r.data=z(n,t),r.attachments=t.length,{packet:r,buffers:t}}function z(e,t){if(!e)return e;if(L(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=z(e[r],t);return n}else if(typeof e==`object`&&!(e instanceof Date)){let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=z(e[r],t));return n}return e}function xt(e,t){return e.data=St(e.data,t),delete e.attachments,e}function St(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num==`number`&&e.num>=0&&e.num<t.length)return t[e.num];throw Error(`illegal attachments`)}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=St(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=St(e[n],t));return e}var Ct=e({Decoder:()=>Et,Encoder:()=>Tt,PacketType:()=>B,isPacketValid:()=>Mt,protocol:()=>5}),wt=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],B;(function(e){e[e.CONNECT=0]=`CONNECT`,e[e.DISCONNECT=1]=`DISCONNECT`,e[e.EVENT=2]=`EVENT`,e[e.ACK=3]=`ACK`,e[e.CONNECT_ERROR=4]=`CONNECT_ERROR`,e[e.BINARY_EVENT=5]=`BINARY_EVENT`,e[e.BINARY_ACK=6]=`BINARY_ACK`})(B||={});var Tt=class{constructor(e){this.replacer=e}encode(e){return(e.type===B.EVENT||e.type===B.ACK)&&R(e)?this.encodeAsBinary({type:e.type===B.EVENT?B.BINARY_EVENT:B.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===B.BINARY_EVENT||e.type===B.BINARY_ACK)&&(t+=e.attachments+`-`),e.nsp&&e.nsp!==`/`&&(t+=e.nsp+`,`),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=bt(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Et=class e extends D{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===B.BINARY_EVENT;n||t.type===B.BINARY_ACK?(t.type=n?B.EVENT:B.ACK,this.reconstructor=new Dt(t),t.attachments===0&&super.emitReserved(`decoded`,t)):super.emitReserved(`decoded`,t)}else if(L(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`);else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(B[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===B.BINARY_EVENT||r.type===B.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!kt(a)||a<0)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&!(t.charAt(n)===`,`||n===t.length););r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case B.CONNECT:return V(t);case B.DISCONNECT:return t===void 0;case B.CONNECT_ERROR:return typeof t==`string`||V(t);case B.EVENT:case B.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&wt.indexOf(t[0])===-1);case B.ACK:case B.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},Dt=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=xt(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function Ot(e){return typeof e==`string`}var kt=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function At(e){return e===void 0||kt(e)}function V(e){return Object.prototype.toString.call(e)===`[object Object]`}function jt(e,t){switch(e){case B.CONNECT:return t===void 0||V(t);case B.DISCONNECT:return t===void 0;case B.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&wt.indexOf(t[0])===-1);case B.ACK:return Array.isArray(t);case B.CONNECT_ERROR:return typeof t==`string`||V(t);default:return!1}}function Mt(e){return Ot(e.nsp)&&At(e.id)&&jt(e.type,e.data)}function H(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var Nt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Pt=class extends D{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[H(e,`open`,this.onopen.bind(this)),H(e,`packet`,this.onpacket.bind(this)),H(e,`error`,this.onerror.bind(this)),H(e,`close`,this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState===`open`&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift(`message`),this.emit.apply(this,e),this}emit(e,...t){if(Nt.hasOwnProperty(e))throw Error(`"`+e.toString()+`" is a reserved event name`);if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let n={type:B.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth==`function`?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:B.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved(`connect_error`,e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved(`disconnect`,e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case B.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,Error(`It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)`));break;case B.EVENT:case B.BINARY_EVENT:this.onevent(e);break;case B.ACK:case B.BINARY_ACK:this.onack(e);break;case B.DISCONNECT:this.ondisconnect();break;case B.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]==`string`&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:B.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];typeof t==`function`&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose(`io server disconnect`)}destroy(){this.subs&&=(this.subs.forEach(e=>e()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:B.DISCONNECT}),this.destroy(),this.connected&&this.onclose(`io client disconnect`),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function U(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}U.prototype.duration=function(){var e=this.ms*this.factor**+this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},U.prototype.reset=function(){this.attempts=0},U.prototype.setMin=function(e){this.ms=e},U.prototype.setMax=function(e){this.max=e},U.prototype.setJitter=function(e){this.jitter=e};var W=class extends D{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,A(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor??.5),this.backoff=new U({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||Ct;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)==null||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf(`open`))return this;this.engine=new pt(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=H(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=H(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push(H(e,`ping`,this.onping.bind(this)),H(e,`data`,this.ondata.bind(this)),H(e,`error`,this.onerror.bind(this)),H(e,`close`,this.onclose.bind(this)),H(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){O(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Pt(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose(`forced close`)}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)==null||n.close(),this.backoff.reset(),this._readyState=`closed`,this.emitReserved(`close`,e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},G={};function K(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=mt(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=G[i]&&a in G[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new W(r,t):(G[i]||(G[i]=new W(r,t)),c=G[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(K,{Manager:W,Socket:Pt,io:K,connect:K});var q=null,J=new Map,Y=new Set,X=!1;function Ft(e){for(let t of J.keys())e.emit(`subscribe`,t)}function It(){for(let e of Y)try{e()}catch(e){console.error(`[usePubSub] reconnect handler threw:`,e)}}function Lt(){if(q)return q;let e=K({path:`/ws/pubsub`,transports:[`websocket`]});return e.on(`connect`,()=>{Ft(e),X?It():X=!0}),e.on(`data`,e=>{let t=J.get(e.channel);if(t)for(let n of t)n(e.data)}),q=e,e}function Rt(){J.size>0||q&&(q.disconnect(),q=null,X=!1)}function zt(){function e(e,t){let n=J.get(e);n||(n=new Set,J.set(e,n)),n.add(t);let r=Lt();return r.connected&&r.emit(`subscribe`,e),()=>{let n=J.get(e);n&&(n.delete(t),n.size===0&&(J.delete(e),q?.connected&&q.emit(`unsubscribe`,e)),Rt())}}function t(e){return Y.add(e),()=>{Y.delete(e)}}return{subscribe:e,onReconnect:t}}function Z(e){return e}function Bt(e,t){if(!t)return e.url;let{url:n}=e;for(let[e,r]of Object.entries(t)){let t=`:${e}`;n.includes(t)&&(n=n.split(t).join(encodeURIComponent(String(r))))}return n}var Vt={openBook:`openBook`,getBooks:`getBooks`,createBook:`createBook`,updateBook:`updateBook`,deleteBook:`deleteBook`,getAccounts:`getAccounts`,upsertAccount:`upsertAccount`,addEntries:`addEntries`,voidEntry:`voidEntry`,getJournalEntries:`getJournalEntries`,getOpeningBalances:`getOpeningBalances`,setOpeningBalances:`setOpeningBalances`,getReport:`getReport`,getTimeSeries:`getTimeSeries`,rebuildSnapshots:`rebuildSnapshots`},Ht={dispatch:{path:`/api/accounting`,method:`POST`}};function Ut(e){return`accounting:${e}`}var Wt=`accounting:books`;function Gt(e,t){if(e instanceof Error)return e.message;if(typeof e==`object`&&e){let t=e;if(typeof t.details==`string`&&t.details)return t.details;if(typeof t.message==`string`&&t.message)return t.message}return t===void 0?String(e):t}var Kt={accounting:`data/accounting`,accountingBooks:`data/accounting/books`},qt=[1,2,3,4,5,6,7,8,9,10,11,12],Jt={Q1:3,Q2:6,Q3:9,Q4:12};function Yt(e){return typeof e==`number`&&Number.isInteger(e)&&e>=1&&e<=12}function Xt(e){return Yt(e)?e:typeof e==`string`&&Object.hasOwn(Jt,e)?Jt[e]:12}function Zt(e){return Xt(e)}function Qt(e,t){let n=new Date(Date.UTC(2001,e,0));try{return new Intl.DateTimeFormat(t,{month:`long`,day:`numeric`,timeZone:`UTC`}).format(n)}catch{return String(e)}}function $t(e){return String(e).padStart(2,`0`)}function en(e,t){return new Date(e,t+1,0).getDate()}function tn(e,t,n){return`${e}-${$t(t)}-${$t(n)}`}function nn(e,t){let n=Zt(e),r=(t.getMonth()+1-n-1+12)%12;return Math.floor(r/3)}function rn(e,t,n){let r=Zt(e),i=t.getMonth()+1,a=t.getFullYear(),o=r%12+1,s=i>=o?a:a-1,c=o+n*3;return{year:s+Math.floor((c-1)/12),month:(c-1)%12+1}}function Q(e,t,n){let r=rn(e,t,n),i=r.month-1+2,a=r.year+Math.floor(i/12),o=i%12+1,s=en(a,o-1);return{from:tn(r.year,r.month,1),to:tn(a,o,s)}}function an(e,t=new Date){return Q(e,t,nn(e,t))}function on(e,t=new Date){let n=nn(e,t);return n>0?Q(e,t,n-1):Q(e,new Date(t.getFullYear(),t.getMonth()-3,1),3)}function sn(e,t=new Date){let n=Q(e,t,0),r=Q(e,t,3);return{from:n.from,to:r.to}}function cn(e,t=new Date){return sn(e,new Date(t.getFullYear()-1,t.getMonth(),t.getDate()))}var ln=`US.JP.GB.CA.AU.NZ.DE.FR.IT.ES.NL.BE.AT.IE.PT.FI.SE.DK.PL.CH.NO.CN.KR.TW.HK.SG.IN.BR.MX`.split(`.`);function un(e,t){try{return new Intl.DisplayNames([t],{type:`region`}).of(e)??e}catch{return e}}function dn(e){return typeof e==`string`&&ln.includes(e)}var fn={warnMissingTaxRegistrationId:new Set([`JP`,`GB`,`DE`,`FR`,`IT`,`ES`,`NL`,`BE`,`AT`,`IE`,`PT`,`FI`,`SE`,`DK`,`PL`,`IN`,`AU`,`NZ`,`CA`])};function pn(e,t){return t?fn[e].has(t):!1}var mn=[`USD`,`EUR`,`JPY`,`GBP`,`CNY`,`KRW`,`TWD`,`HKD`,`SGD`,`AUD`,`CAD`,`CHF`,`INR`,`BRL`,`MXN`],hn=2;function gn(e,t){try{return new Intl.DisplayNames([t],{type:`currency`}).of(e)??e}catch{return e}}function _n(e){try{return new Intl.NumberFormat(`en`,{style:`currency`,currency:e}).resolvedOptions().maximumFractionDigits??hn}catch{return hn}}function vn(e){let t=_n(e);return t===0?`1`:(1/10**t).toFixed(t)}function yn(e,t,n){try{return new Intl.NumberFormat(n,{style:`currency`,currency:t}).format(e)}catch{return e.toFixed(_n(t))}}function bn(e,t=2,n){return e.toLocaleString(n,{minimumFractionDigits:t,maximumFractionDigits:t})}function $(e){return String(e).padStart(2,`0`)}function xn(e=new Date){return`${e.getFullYear()}-${$(e.getMonth()+1)}-${$(e.getDate())}`}function Sn(e=new Date){return`${e.getFullYear()}-${$(e.getMonth()+1)}`}function Cn(e=new Date){let t=new Date(e.getFullYear(),e.getMonth()-1,1);return`${t.getFullYear()}-${$(t.getMonth()+1)}`}function wn(e=new Date){let t=Math.floor(e.getMonth()/3)*3,n=new Date(e.getFullYear(),t-1,1);return`${n.getFullYear()}-${$(n.getMonth()+1)}`}function Tn(e=new Date){return`${e.getFullYear()-1}-12`}var En=[`revenue`,`expense`,`netIncome`,`accountBalance`],Dn=[`month`,`quarter`,`year`],On=Z({toolName:`manageAccounting`,apiNamespace:`accounting`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`,workspaceDirs:{accounting:Kt.accounting,accountingBooks:Kt.accountingBooks},staticChannels:{accountingBooks:`accounting:books`}}),kn=Z({toolName:`openCanvas`,apiNamespace:`canvas`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),An=Z({toolName:`presentChart`,apiNamespace:`chart`,apiRoutes:{create:{method:`POST`,path:``}},mcpDispatch:`create`}),jn=Z({toolName:`editImages`}),Mn=Z({toolName:`generateImage`}),Nn=Z({toolName:`manageSkills`,apiNamespace:`skills`,apiRoutes:{list:{method:`GET`,path:``},detail:{method:`GET`,path:`/:name`},create:{method:`POST`,path:``},update:{method:`PUT`,path:`/:name`},remove:{method:`DELETE`,path:`/:name`},catalogList:{method:`GET`,path:`/catalog`},catalogStar:{method:`POST`,path:`/catalog/star`},catalogPreview:{method:`GET`,path:`/catalog/preview`},externalSuggestions:{method:`GET`,path:`/external/suggestions`},externalReposList:{method:`GET`,path:`/external/repos`},externalReposInstall:{method:`POST`,path:`/external/repos`},externalReposRemove:{method:`DELETE`,path:`/external/repos/:repoId`}},mcpDispatch:`create`}),Pn=Z({toolName:`presentDocument`,apiNamespace:`markdown`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),Fn=Z({toolName:`managePhotoLocations`,apiNamespace:`photoLocations`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`,staticChannels:{locationsChanged:`photoLocations:locations-changed`}}),In=Z({toolName:`presentCollection`,apiNamespace:`presentCollection`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),Ln=Z({toolName:`presentForm`,apiNamespace:`form`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),Rn=Z({toolName:`presentHtml`,apiNamespace:`html`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),zn=Z({toolName:`presentMulmoScript`,apiNamespace:`mulmoScript`,apiRoutes:{save:{method:`POST`,path:`/save`},updateBeat:{method:`POST`,path:`/update-beat`},updateScript:{method:`POST`,path:`/update-script`},beatImage:{method:`GET`,path:`/beat-image`},beatAudio:{method:`GET`,path:`/beat-audio`},generateBeatAudio:{method:`POST`,path:`/generate-beat-audio`},renderBeat:{method:`POST`,path:`/render-beat`},uploadBeatImage:{method:`POST`,path:`/upload-beat-image`},characterImage:{method:`GET`,path:`/character-image`},renderCharacter:{method:`POST`,path:`/render-character`},uploadCharacterImage:{method:`POST`,path:`/upload-character-image`},movieStatus:{method:`GET`,path:`/movie-status`},generateMovie:{method:`POST`,path:`/generate-movie`},downloadMovie:{method:`GET`,path:`/download-movie`},pdfStatus:{method:`GET`,path:`/pdf-status`},generatePdf:{method:`POST`,path:`/generate-pdf`},downloadPdf:{method:`GET`,path:`/download-pdf`}},mcpDispatch:`save`,requires:[`ffmpeg`]}),Bn=Z({toolName:`presentSVG`,apiNamespace:`svg`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),Vn=Z({toolName:`manageAutomations`,apiNamespace:`scheduler`,apiRoutes:{list:{method:`GET`,path:``},dispatch:{method:`POST`,path:``},tasksList:{method:`GET`,path:`/tasks`},tasksCreate:{method:`POST`,path:`/tasks`},taskUpdate:{method:`PUT`,path:`/tasks/:id`},taskDelete:{method:`DELETE`,path:`/tasks/:id`},taskRun:{method:`POST`,path:`/tasks/:id/run`},logs:{method:`GET`,path:`/logs`}},mcpDispatch:`dispatch`}),Hn=Z({toolName:`presentSpreadsheet`,apiNamespace:`spreadsheet`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),Un=[On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Z({toolName:`manageWiki`})];function Wn(e,t,n){let r={},i={},a=[];for(let o of e){let e=t(o);if(e)for(let[t,s]of Object.entries(e)){let e=i[t];if(e!==void 0){a.push({dimension:n,key:t,plugins:[e,o.toolName]});continue}r[t]=s,i[t]=o.toolName}}return{aggregate:r,owner:i,collisions:a}}function Gn(e,t,n,r){let i={},a=[];for(let[o,s]of Object.entries(n)){if(t.has(o)){a.push({label:e,key:o,plugin:r[o]??``});continue}i[o]=s}return{cleaned:i,dropped:a}}function Kn(e,t){let{aggregate:n,owner:r,collisions:i}=Wn(e,t.extract,t.dimension),a=new Set(Object.keys(t.hostRecord));if(t.additionalReservedKeys)for(let e of t.additionalReservedKeys)a.add(e);let{cleaned:o,dropped:s}=Gn(t.label,a,n,r);return{merged:{...t.hostRecord,...o},hostCollisions:s,intraCollisions:i}}var qn={message:`/api/transports/:transportId/chats/:externalChatId`,connect:`/api/transports/:transportId/chats/:externalChatId/connect`};function Jn(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]={method:i.method,url:`/api/${e}${i.path}`};return n}var Yn=Kn(Un,{label:`API_ROUTES`,hostRecord:{health:`/api/health`,sandbox:`/api/sandbox`,shortcuts:`/api/shortcuts`,dashboard:`/api/dashboard`,agent:{run:`/api/agent`,cancel:`/api/agent/cancel`,internal:{toolResult:`/api/internal/tool-result`}},chatIndex:{rebuild:`/api/chat-index/rebuild`},chatService:qn,config:{base:`/api/config`,settings:`/api/config/settings`,mcp:`/api/config/mcp`,workspaceDirs:`/api/config/workspace-dirs`,referenceDirs:`/api/config/reference-dirs`,schedulerOverrides:`/api/config/scheduler-overrides`,refresh:`/api/config/refresh`,connectors:`/api/config/connectors`},files:{tree:`/api/files/tree`,dir:`/api/files/dir`,content:`/api/files/content`,create:`/api/files/create`,raw:`/api/files/raw`,refRoots:`/api/files/ref-roots`,open:`/api/files/open`,reveal:`/api/files/reveal`},image:{generate:`/api/generate-image`,edit:`/api/edit-image`,upload:`/api/images`,update:`/api/images/update`},attachments:{upload:`/api/attachments`},share:{pack:`/api/share/pack`,packMarkdown:`/api/share/pack-markdown`},remoteHost:{connect:`/api/remote-host/connect`,disconnect:`/api/remote-host/disconnect`,status:`/api/remote-host/status`},mcpTools:{list:`/api/mcp-tools`,invoke:`/api/mcp-tools/:tool`},notifier:{dispatch:`/api/notifier`},journal:{latestDaily:`/api/journal/latest-daily`},pdf:{markdown:`/api/pdf/markdown`},translation:{translate:`/api/translation`},transcribe:{run:`/api/transcribe`,model:`/api/transcribe/model`,modelDownload:`/api/transcribe/model/download`},plugins:{mindmap:`/api/mindmap`,quiz:`/api/quiz`,present3d:`/api/present3d`,googleMap:`/api/google-map`,runtimeList:`/api/plugins/runtime/list`,runtimeDispatch:`/api/plugins/runtime/:pkg/dispatch`,runtimeOauthCallback:`/api/plugins/runtime/oauth-callback/:alias`,diagnostics:`/api/plugins/diagnostics`,runtimeAsset:`/api/plugins/runtime/:pkg/:version/{*splat}`},roles:{list:`/api/roles`,manage:`/api/roles/manage`},marpThemes:{list:`/api/marp-themes`},collections:{list:`/api/collections`,detail:`/api/collections/:slug`,items:`/api/collections/:slug/items`,item:`/api/collections/:slug/items/:itemId`,itemAction:`/api/collections/:slug/items/:itemId/actions/:actionId`,collectionAction:`/api/collections/:slug/actions/:actionId`,refresh:`/api/collections/:slug/refresh`,viewFile:`/api/collections/:slug/view-file`,remoteView:`/api/collections/:slug/remote-view`,remoteViewMutate:`/api/collections/:slug/remote-view/:viewId/mutate`,remoteViewItems:`/api/collections/:slug/remote-view/:viewId/items`,viewI18n:`/api/collections/:slug/view-i18n`,viewToken:`/api/collections/:slug/view-token`,viewData:`/api/collections/:slug/view-data`,viewDelete:`/api/collections/:slug/views/:viewId`},collectionsRegistry:{list:`/api/collections-registry`,preview:`/api/collections-registry/preview`,import:`/api/collections-registry/import`,export:`/api/collections-registry/export`},sessions:{list:`/api/sessions`,detail:`/api/sessions/:id`,markRead:`/api/sessions/:id/mark-read`,bookmark:`/api/sessions/:id/bookmark`},feeds:{list:`/api/feeds`,detail:`/api/feeds/:slug`},hooks:{log:`/api/hooks/log`},wiki:{base:`/api/wiki`,pageHistory:`/api/wiki/pages/:slug/history`,pageHistorySnapshot:`/api/wiki/pages/:slug/history/:stamp`,pageHistoryRestore:`/api/wiki/pages/:slug/history/:stamp/restore`,internalSnapshot:`/api/wiki/internal/snapshot`}},extract:e=>{if(e.apiRoutes===void 0)return;let t=e.apiNamespace??e.toolName;return{[t]:Jn(t,e.apiRoutes)}},dimension:`apiNamespace`});Yn.hostCollisions,Yn.intraCollisions;var Xn=Yn.merged;p();function Zn(e,t){return`plugin:${e}:${t}`}function Qn(e){let{subscribe:t}=zt();return{subscribe(n,r){return t(Zn(e,n),r)}}}function $n(e){let t=`[plugin/${e}]`;return{debug:(e,n)=>console.debug(t,e,n),info:(e,n)=>console.info(t,e,n),warn:(e,n)=>console.warn(t,e,n),error:(e,n)=>console.error(t,e,n)}}var er=new Set([`http:`,`https:`]);function tr(e){return t=>{let n;try{n=new URL(t)}catch{console.warn(`[plugin/${e}] openUrl rejected unparseable URL`,{url:t});return}if(!er.has(n.protocol)){console.warn(`[plugin/${e}] openUrl rejected non-http(s) scheme`,{scheme:n.protocol});return}window.open(t,`_blank`,`noopener,noreferrer`)||console.warn(`[plugin/${e}] window.open returned null`,{url:t})}}function nr(e){let t=Xn.plugins.runtimeDispatch.replace(`:pkg`,encodeURIComponent(e));return async n=>{let r=await me(t,n);if(!r.ok)throw Error(`plugin/${e} dispatch failed (${r.status}): ${r.error}`);return r.data}}function rr(e){let{pkgName:t,endpoints:r}=e,{locale:i}=te(),a=n(()=>String(i.value));return{pubsub:Qn(t),locale:a,log:$n(t),openUrl:tr(t),dispatch:nr(t),endpoints:r}}p(),m();function ir(e){let t=c(null),r=c(!1),i=c(0),a=n(()=>{if(!t.value)return``;let e=t.value.message||String(t.value),n=t.value.stack??``;return n?`${e}\n\n${n}`:e});function o(n){let r=g(n);console.error(`[plugin/${e}] uncaught error`,r),t.value=r}function s(){t.value=null,r.value=!1,i.value+=1}return{error:t,showDetails:r,mountKey:i,errorDetails:a,captureError:o,retry:s}}p(),m(),u();var ar={key:0,class:`rounded border border-red-200 bg-red-50 p-3 text-sm`,"data-testid":`plugin-error-boundary`,role:`alert`},or={class:`flex items-center gap-2 mb-1`},sr={class:`font-medium text-red-800`},cr={class:`text-red-700 mb-2`},lr={class:`flex items-center gap-3`},ur={key:0,class:`mt-2 text-xs text-red-900 bg-red-100 p-2 rounded overflow-auto max-h-40 whitespace-pre-wrap break-words`},dr=l({__name:`PluginScopedRoot`,props:{pkgName:{},endpoints:{}},setup(e){let n=e,{t:c}=te();ee(ne,rr({pkgName:n.pkgName,endpoints:n.endpoints}));let{error:l,showDetails:u,mountKey:p,errorDetails:m,captureError:h,retry:g}=ir(n.pkgName);return a(e=>(h(e),!1)),(n,a)=>f(l)?(t(),o(`div`,ar,[d(`div`,or,[a[2]||=d(`span`,{class:`material-icons text-red-500`,"aria-hidden":`true`},`error_outline`,-1),d(`span`,sr,r(f(c)(`pluginErrorBoundary.title`,{pkg:e.pkgName})),1)]),d(`p`,cr,r(f(c)(`pluginErrorBoundary.subtitle`)),1),d(`div`,lr,[d(`button`,{type:`button`,class:`text-xs text-red-600 hover:underline`,"data-testid":`plugin-error-toggle-details`,onClick:a[0]||=e=>u.value=!f(u)},r(f(u)?f(c)(`pluginErrorBoundary.hideDetails`):f(c)(`pluginErrorBoundary.showDetails`)),1),d(`button`,{type:`button`,class:`text-xs text-red-600 hover:underline`,"data-testid":`plugin-error-retry`,onClick:a[1]||=(...e)=>f(g)&&f(g)(...e)},r(f(c)(`pluginErrorBoundary.retry`)),1)]),f(u)?(t(),o(`pre`,ur,r(f(m)),1)):s(``,!0)])):i(n.$slots,`default`,{key:f(p)})}}),fr=e({default:()=>pr}),pr=dr;export{_ as $,Gt as A,gn as B,Dn as C,sn as D,pn as E,dn as F,Bt as G,Cn as H,wn as I,ge as J,zt as K,xn as L,yn as M,bn as N,an as O,vn as P,he as Q,Sn as R,mn as S,Ut as T,on as U,cn as V,Xt as W,pe as X,_e as Y,me as Z,Vt as _,Kn as a,h as at,qt as b,zn as c,In as d,se as et,Fn as f,On as g,kn as h,Un as i,re as it,Qt as j,Tn as k,Rn as l,An as m,fr as n,ae as nt,Hn as o,g as ot,Nn as p,y as q,Xn as r,ie as rt,Bn as s,pr as t,le as tt,Ln as u,Ht as v,En as w,ln as x,Wt as y,un as z};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-5HE753X5-o8-OCfIL.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-Cz8bXOH0.js";import"./chunk-WYO6CB5R-DOOEMpuR.js";import"./chunk-VAUOI2AC-BAbw2DCD.js";import{n as r,r as i,t as a}from"./chunk-MOJQB5TN-Zy5vyRW1.js";import{t as o}from"./chunk-JWPE2WC7-DVXcaiue.js";import{t as s}from"./mermaid-parser.core-CMbO70Iy.js";var c=e().RailroadAbnf.parser.LangiumParser,l=t(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=t(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=t(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=t(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=t(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:t(e=>{a.clear(),n.debug(`[ABNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[ABNF Parser] Parsed rules:`,r.rules.length),h(r),n.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-Bdt8pFDJ-DsF7k-Jl.js";import{f as t}from"./src-Brzfja-q-DNc4Or4z.js";import{_ as n,g as r}from"./mermaid-parser.core-DC7NPJ_M-Ca6XzwfM.js";import"./chunk-WYO6CB5R-B83L_z6I-Cs8mg9If.js";import"./chunk-VAUOI2AC-DrcykVNK-CSROJWdE.js";import{n as i,r as a,t as o}from"./chunk-MOJQB5TN-CqxshQHA-Cn_EpDyZ.js";import{t as s}from"./chunk-JWPE2WC7-BQ3zXr2k-DSd3Ct95.js";var c=r().RailroadAbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=e(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=e(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=e(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=e(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{s(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{a.clear(),t.debug(`[ABNF Parser] Starting Langium parse`);let r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new n(r);let i=r.value;t.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),t.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:o,styles:i};export{g as diagram};
1
+ import{n as e}from"./chunk-Y2CYZVJY-Bdt8pFDJ-DsF7k-Jl.js";import{f as t}from"./src-Brzfja-q-DNc4Or4z.js";import{_ as n,g as r}from"./mermaid-parser.core-DxEa8E3F-CmItqkOe.js";import"./chunk-WYO6CB5R-BlzOfotS-CNW2AfuP.js";import"./chunk-VAUOI2AC-CS9QJ4yz-DzK4GLu7.js";import{n as i,r as a,t as o}from"./chunk-MOJQB5TN-CMZRaeqt-pjKXfT4z.js";import{t as s}from"./chunk-JWPE2WC7-BQ3zXr2k-DSd3Ct95.js";var c=r().RailroadAbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=e(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=e(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=e(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=e(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{s(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{a.clear(),t.debug(`[ABNF Parser] Starting Langium parse`);let r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new n(r);let i=r.value;t.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),t.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:o,styles:i};export{g as diagram};
@@ -1 +1 @@
1
- import{n as e,t}from"./path-BWPyau1x.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-CQ3HaWOk.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
1
+ import{n as e,t}from"./path-BWPyau1x.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-BH9bKIvu.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
@@ -0,0 +1 @@
1
+ import{f as e}from"./mermaid-parser.core-DxEa8E3F-CmItqkOe.js";export{e as createArchitectureServices};
@@ -0,0 +1 @@
1
+ import"./chunk-KEIR6QF5-Dj-OpFgW.js";import{n as e}from"./chunk-MOZMSUNE-BgA8jCvb.js";export{e as createArchitectureServices};
@@ -0,0 +1,36 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-Bdt8pFDJ-DsF7k-Jl.js";import{a as t,f as n,m as r,u as i}from"./src-Brzfja-q-DNc4Or4z.js";import{c as a}from"./mermaid-parser.core-DxEa8E3F-CmItqkOe.js";import{A as o,B as s,O as c,T as l,U as u,_ as d,d as f,g as p,n as m,o as h,t as g,tt as _}from"./chunk-WYO6CB5R-BlzOfotS-CNW2AfuP.js";import{t as v}from"./chunk-VAUOI2AC-CS9QJ4yz-DzK4GLu7.js";import{t as y}from"./chunk-JWPE2WC7-BQ3zXr2k-DSd3Ct95.js";import{D as b,u as x}from"./chunk-ICXQ74PX-DwgHBX_g-BYMy_Tms.js";import{i as S,r as C,t as w}from"./chunk-HOUHSVGY-Bhlt8hXJ-C_6N7WlG.js";import{t as T}from"./chunk-Q4XR5HBZ-ZXVGkG8Z-DddfuS9d.js";import{t as E}from"./cytoscape.esm-CncKIM2s-CQFVGiJu.js";var D=r(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.layoutBase=r():n.layoutBase=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=28)})([(function(e,t,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r}),(function(e,t,n){var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw`Node is not incident with this edge`},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o}),(function(e,t,n){function r(e){this.vGraphObject=e}e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),c=n(5);function l(e,t,n,o){n==null&&o==null&&(o=t),r.call(this,o),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,n!=null&&t!=null?this.rect=new a(t.x,t.y,n.width,n.height):this.rect=new a}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(e){this.rect.width=e},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(e){this.rect.height=e},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},l.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},l.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},l.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},l.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw`Incorrect edge source!`;t.push(r)}}),t},l.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(!(r.source==n||r.target==n))throw`Incorrect edge source and/or target`;(r.target==e||r.source==e)&&t.push(r)}),t},l.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw`Incorrect incidency!`;e.add(n.source)}}),e},l.prototype.withChildren=function(){var e=new Set,t,n;if(e.add(this),this.child!=null)for(var r=this.child.getNodes(),i=0;i<r.length;i++)t=r[i],n=t.withChildren(),n.forEach(function(t){e.add(t)});return e},l.prototype.getNoOfChildren=function(){var e=0,t;if(this.child==null)e=1;else for(var n=this.child.getNodes(),r=0;r<n.length;r++)t=n[r],e+=t.getNoOfChildren();return e==0&&(e=1),e},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw`assert failed`;return this.estimatedSize},l.prototype.calcEstimatedSize=function(){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)},l.prototype.scatter=function(){var e,t,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;e=o.WORLD_CENTER_X+s.nextDouble()*(r-n)+n;var i=-o.INITIAL_WORLD_BOUNDARY,a=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_Y+s.nextDouble()*(a-i)+i,this.rect.x=e,this.rect.y=t},l.prototype.updateBounds=function(){if(this.getChild()==null)throw`assert failed`;if(this.getChild().getNodes().length!=0){var e=this.getChild();if(e.updateBounds(!0),this.rect.x=e.getLeft(),this.rect.y=e.getTop(),this.setWidth(e.getRight()-e.getLeft()),this.setHeight(e.getBottom()-e.getTop()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var t=e.getRight()-e.getLeft(),n=e.getBottom()-e.getTop();this.labelWidth&&(this.labelPosHorizontal==`left`?(this.rect.x-=this.labelWidth,this.setWidth(t+this.labelWidth)):this.labelPosHorizontal==`center`&&this.labelWidth>t?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal==`right`&&this.setWidth(t+this.labelWidth)),this.labelHeight&&(this.labelPosVertical==`top`?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):this.labelPosVertical==`center`&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):this.labelPosVertical==`bottom`&&this.setHeight(n+this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},l.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=l}),(function(e,t,n){var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i}),(function(e,t,n){function r(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(7),s=n(3),c=n(1),l=n(13),u=n(12),d=n(11);function f(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof o?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in f.prototype=Object.create(r.prototype),r)f[p]=r[p];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(e,t,n){if(t==null&&n==null){var r=e;if(this.graphManager==null)throw`Graph has no graph mgr!`;if(this.getNodes().indexOf(r)>-1)throw`Node already in graph!`;return r.owner=this,this.getNodes().push(r),r}else{var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw`Source or target not in graph!`;if(!(t.owner==n.owner&&t.owner==this))throw`Both owners must be this graph!`;return t.owner==n.owner?(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i):null}},f.prototype.remove=function(e){var t=e;if(e instanceof s){if(t==null)throw`Node is null!`;if(!(t.owner!=null&&t.owner==this))throw`Owner graph is invalid!`;if(this.graphManager==null)throw`Owner graph manager is invalid!`;for(var n=t.edges.slice(),r,i=n.length,a=0;a<i;a++)r=n[a],r.isInterGraph?this.graphManager.remove(r):r.source.owner.remove(r);var o=this.nodes.indexOf(t);if(o==-1)throw`Node not in owner node list!`;this.nodes.splice(o,1)}else if(e instanceof c){var r=e;if(r==null)throw`Edge is null!`;if(!(r.source!=null&&r.target!=null))throw`Source and/or target is null!`;if(!(r.source.owner!=null&&r.target.owner!=null&&r.source.owner==this&&r.target.owner==this))throw`Source and/or target owner is invalid!`;var l=r.source.edges.indexOf(r),u=r.target.edges.indexOf(r);if(!(l>-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(l,1),r.target!=r.source&&r.target.edges.splice(u,1);var o=r.source.owner.getEdges().indexOf(r);if(o==-1)throw`Not in owner's edge list!`;r.source.owner.getEdges().splice(o,1)}},f.prototype.updateLeftTop=function(){for(var e=i.MAX_VALUE,t=i.MAX_VALUE,n,r,a,o=this.getNodes(),s=o.length,c=0;c<s;c++){var l=o[c];n=l.getTop(),r=l.getLeft(),e>n&&(e=n),t>r&&(t=r)}return e==i.MAX_VALUE?null:(a=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-a,this.top=e-a,new u(this.left,this.top))},f.prototype.updateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,c,u,d,f=this.nodes,p=f.length,m=0;m<p;m++){var h=f[m];e&&h.child!=null&&h.updateBounds(),o=h.getLeft(),s=h.getRight(),c=h.getTop(),u=h.getBottom(),t>o&&(t=o),n<s&&(n=s),r>c&&(r=c),a<u&&(a=u)}var g=new l(t,r,n-t,a-r);t==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),d=f[0].getParent().paddingLeft==null?this.margin:f[0].getParent().paddingLeft,this.left=g.x-d,this.right=g.x+g.width+d,this.top=g.y-d,this.bottom=g.y+g.height+d},f.calculateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,c,u,d=e.length,f=0;f<d;f++){var p=e[f];o=p.getLeft(),s=p.getRight(),c=p.getTop(),u=p.getBottom(),t>o&&(t=o),n<s&&(n=s),r>c&&(r=c),a<u&&(a=u)}return new l(t,r,n-t,a-r)},f.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},f.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw`assert failed`;return this.estimatedSize},f.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r<n;r++){var i=t[r];e+=i.calcEstimatedSize()}return e==0?this.estimatedSize=a.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=e/Math.sqrt(this.nodes.length),this.estimatedSize},f.prototype.updateConnected=function(){var e=this;if(this.nodes.length==0){this.isConnected=!0;return}var t=new d,n=new Set,r=this.nodes[0],i,a;for(r.withChildren().forEach(function(e){t.push(e),n.add(e)});t.length!==0;){r=t.shift(),i=r.getEdges();for(var o=i.length,s=0;s<o;s++)a=i[s].getOtherEndInGraph(r,this),a!=null&&!n.has(a)&&a.withChildren().forEach(function(e){t.push(e),n.add(e)})}if(this.isConnected=!1,n.size>=this.nodes.length){var c=0;n.forEach(function(t){t.owner==e&&c++}),c==this.nodes.length&&(this.isConnected=!0)}},e.exports=f}),(function(e,t,n){var r,i=n(1);function a(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(n==null&&r==null&&i==null){if(e==null)throw`Graph is null!`;if(t==null)throw`Parent node is null!`;if(this.graphs.indexOf(e)>-1)throw`Graph already in this graph mgr!`;if(this.graphs.push(e),e.parent!=null)throw`Already has a parent!`;if(t.child!=null)throw`Already has a child!`;return e.parent=t,t.child=e,e}else{i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(!(a!=null&&a.getGraphManager()==this))throw`Source not in this graph mgr!`;if(!(o!=null&&o.getGraphManager()==this))throw`Target not in this graph mgr!`;if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw`Edge already in inter-graph edge list!`;if(this.edges.push(n),!(n.source!=null&&n.target!=null))throw`Edge source and/or target is null!`;if(!(n.source.edges.indexOf(n)==-1&&n.target.edges.indexOf(n)==-1))throw`Edge already in source and/or target incidency list!`;return n.source.edges.push(n),n.target.edges.push(n),n}},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw`Graph not in this graph mgr`;if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw`Invalid parent node!`;var n=[];n=n.concat(t.getEdges());for(var a,o=n.length,s=0;s<o;s++)a=n[s],t.remove(a);var c=[];c=c.concat(t.getNodes());var l;o=c.length;for(var s=0;s<o;s++)l=c[s],t.remove(l);t==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(t);this.graphs.splice(u,1),t.parent=null}else if(e instanceof i){if(a=e,a==null)throw`Edge is null!`;if(!a.isInterGraph)throw`Not an inter-graph edge!`;if(!(a.source!=null&&a.target!=null))throw`Source and/or target is null!`;if(!(a.source.edges.indexOf(a)!=-1&&a.target.edges.indexOf(a)!=-1))throw`Source and/or target doesn't know this edge!`;var u=a.source.edges.indexOf(a);if(a.source.edges.splice(u,1),u=a.target.edges.indexOf(a),a.target.edges.splice(u,1),!(a.source.owner!=null&&a.source.owner.getGraphManager()!=null))throw`Edge owner graph or owner graph manager is null!`;if(a.source.owner.getGraphManager().edges.indexOf(a)==-1)throw`Not in owner graph manager's edge list!`;var u=a.source.owner.getGraphManager().edges.indexOf(a);a.source.owner.getGraphManager().edges.splice(u,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(this.allNodes==null){for(var e=[],t=this.getGraphs(),n=t.length,r=0;r<n;r++)e=e.concat(t[r].getNodes());this.allNodes=e}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(this.allEdges==null){var e=[],t=this.getGraphs();t.length;for(var n=0;n<t.length;n++)e=e.concat(t[n].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw`assert failed`;this.allNodesToApplyGravitation=e},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw`Root not in this graph mgr!`;this.rootGraph=e,e.parent??=this.layout.newNode(`Root node`)},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(e,t){if(!(e!=null&&t!=null))throw`assert failed`;if(e==t)return!0;var n=e.getOwner(),r;do{if(r=n.getParent(),r==null)break;if(r==t)return!0;if(n=r.getOwner(),n==null)break}while(!0);n=t.getOwner();do{if(r=n.getParent(),r==null)break;if(r==e)return!0;if(n=r.getOwner(),n==null)break}while(!0);return!1},a.prototype.calcLowestCommonAncestors=function(){for(var e,t,n,r,i,a=this.getAllEdges(),o=a.length,s=0;s<o;s++){if(e=a[s],t=e.source,n=e.target,e.lca=null,e.sourceInLca=t,e.targetInLca=n,t==n){e.lca=t.getOwner();continue}for(r=t.getOwner();e.lca==null;){for(e.targetInLca=n,i=n.getOwner();e.lca==null;){if(i==r){e.lca=i;break}if(i==this.rootGraph)break;if(e.lca!=null)throw`assert failed`;e.targetInLca=i.getParent(),i=e.targetInLca.getOwner()}if(r==this.rootGraph)break;e.lca??(e.sourceInLca=r.getParent(),r=e.sourceInLca.getOwner())}if(e.lca==null)throw`assert failed`}},a.prototype.calcLowestCommonAncestor=function(e,t){if(e==t)return e.getOwner();var n=e.getOwner();do{if(n==null)break;var r=t.getOwner();do{if(r==null)break;if(r==n)return r;r=r.getParent().getOwner()}while(!0);n=n.getParent().getOwner()}while(!0);return n},a.prototype.calcInclusionTreeDepths=function(e,t){e==null&&t==null&&(e=this.rootGraph,t=1);for(var n,r=e.getNodes(),i=r.length,a=0;a<i;a++)n=r[a],n.inclusionTreeDepth=t,n.child!=null&&this.calcInclusionTreeDepths(n.child,t+1)},a.prototype.includesInvalidEdge=function(){for(var e,t=[],n=this.edges.length,r=0;r<n;r++)e=this.edges[r],this.isOneAncestorOfOther(e.source,e.target)&&t.push(e);for(var r=0;r<t.length;r++)this.remove(t[r]);return!1},e.exports=a}),(function(e,t,n){var r=n(12);function i(){}i.calcSeparationAmount=function(e,t,n,r){if(!e.intersects(t))throw`assert failed`;var i=[,,];this.decideDirectionsForOverlappingNodes(e,t,i),n[0]=Math.min(e.getRight(),t.getRight())-Math.max(e.x,t.x),n[1]=Math.min(e.getBottom(),t.getBottom())-Math.max(e.y,t.y),e.getX()<=t.getX()&&e.getRight()>=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]<s?s=n[0]:o=n[1],n[0]=-1*i[0]*(s/2+r),n[1]=-1*i[1]*(o/2+r)},i.decideDirectionsForOverlappingNodes=function(e,t,n){e.getCenterX()<t.getCenterX()?n[0]=-1:n[0]=1,e.getCenterY()<t.getCenterY()?n[1]=-1:n[1]=1},i.getIntersection2=function(e,t,n){var r=e.getCenterX(),i=e.getCenterY(),a=t.getCenterX(),o=t.getCenterY();if(e.intersects(t))return n[0]=r,n[1]=i,n[2]=a,n[3]=o,!0;var s=e.getX(),c=e.getY(),l=e.getRight(),u=e.getX(),d=e.getBottom(),f=e.getRight(),p=e.getWidthHalf(),m=e.getHeightHalf(),h=t.getX(),g=t.getY(),_=t.getRight(),v=t.getX(),y=t.getBottom(),b=t.getRight(),x=t.getWidthHalf(),S=t.getHeightHalf(),C=!1,w=!1;if(r===a){if(i>o)return n[0]=r,n[1]=c,n[2]=a,n[3]=y,!1;if(i<o)return n[0]=r,n[1]=d,n[2]=a,n[3]=g,!1}else if(i===o){if(r>a)return n[0]=s,n[1]=i,n[2]=_,n[3]=o,!1;if(r<a)return n[0]=l,n[1]=i,n[2]=h,n[3]=o,!1}else{var T=e.height/e.width,E=t.height/t.width,D=(o-i)/(a-r),O=void 0,k=void 0,A=void 0,j=void 0,M=void 0,N=void 0;if(-T===D?r>a?(n[0]=u,n[1]=d,C=!0):(n[0]=l,n[1]=c,C=!0):T===D&&(r>a?(n[0]=s,n[1]=c,C=!0):(n[0]=f,n[1]=d,C=!0)),-E===D?a>r?(n[2]=v,n[3]=y,w=!0):(n[2]=_,n[3]=g,w=!0):E===D&&(a>r?(n[2]=h,n[3]=g,w=!0):(n[2]=b,n[3]=y,w=!0)),C&&w)return!1;if(r>a?i>o?(O=this.getCardinalDirection(T,D,4),k=this.getCardinalDirection(E,D,2)):(O=this.getCardinalDirection(-T,D,3),k=this.getCardinalDirection(-E,D,1)):i>o?(O=this.getCardinalDirection(-T,D,1),k=this.getCardinalDirection(-E,D,3)):(O=this.getCardinalDirection(T,D,2),k=this.getCardinalDirection(E,D,4)),!C)switch(O){case 1:j=c,A=r+-m/D,n[0]=A,n[1]=j;break;case 2:A=f,j=i+p*D,n[0]=A,n[1]=j;break;case 3:j=d,A=r+m/D,n[0]=A,n[1]=j;break;case 4:A=u,j=i+-p*D,n[0]=A,n[1]=j;break}if(!w)switch(k){case 1:N=g,M=a+-S/D,n[2]=M,n[3]=N;break;case 2:M=b,N=o+x*D,n[2]=M,n[3]=N;break;case 3:N=y,M=a+S/D,n[2]=M,n[3]=N;break;case 4:M=v,N=o+-x*D,n[2]=M,n[3]=N;break}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(i==null)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,c=t.y,l=n.x,u=n.y,d=i.x,f=i.y,p=void 0,m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0;return h=c-o,_=a-s,y=s*o-a*c,g=f-u,v=l-d,b=d*u-l*f,x=h*v-g*_,x===0?null:(p=(_*b-v*y)/x,m=(g*y-h*b)/x,new r(p,m))},i.angleOfVector=function(e,t,n,r){var i=void 0;return e===n?i=r<t?this.ONE_AND_HALF_PI:this.HALF_PI:(i=Math.atan((r-t)/(n-e)),n<e?i+=Math.PI:r<t&&(i+=this.TWO_PI)),i},i.doIntersect=function(e,t,n,r){var i=e.x,a=e.y,o=t.x,s=t.y,c=n.x,l=n.y,u=r.x,d=r.y,f=(o-i)*(d-l)-(u-c)*(s-a);if(f===0)return!1;var p=((d-l)*(u-i)+(c-u)*(d-a))/f,m=((a-s)*(u-i)+(o-i)*(d-a))/f;return 0<p&&p<1&&0<m&&m<1},i.findCircleLineIntersections=function(e,t,n,r,i,a,o){var s=(n-e)*(n-e)+(r-t)*(r-t),c=2*((e-i)*(n-e)+(t-a)*(r-t)),l=(e-i)*(e-i)+(t-a)*(t-a)-o*o;if(c*c-4*s*l>=0){var u=(-c+Math.sqrt(c*c-4*s*l))/(2*s),d=(-c-Math.sqrt(c*c-4*s*l))/(2*s);return u>=0&&u<=1?[u]:d>=0&&d<=1?[d]:null}else return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i}),(function(e,t,n){function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r}),(function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=function(e){return{value:e,next:null,prev:null}},o=function(e,t,n,r){return e===null?r.head=t:e.next=t,n===null?r.tail=t:n.prev=t,t.prev=e,t.next=n,r.length++,t},s=function(e,t){var n=e.prev,r=e.next;return n===null?t.head=r:n.next=r,r===null?t.tail=n:r.prev=n,e.prev=e.next=null,t.length--,e};e.exports=function(){function e(t){var n=this;i(this,e),this.length=0,this.head=null,this.tail=null,t?.forEach(function(e){return n.push(e)})}return r(e,[{key:`size`,value:function(){return this.length}},{key:`insertBefore`,value:function(e,t){return o(t.prev,a(e),t,this)}},{key:`insertAfter`,value:function(e,t){return o(t,a(e),t.next,this)}},{key:`insertNodeBefore`,value:function(e,t){return o(t.prev,e,t,this)}},{key:`insertNodeAfter`,value:function(e,t){return o(t,e,t.next,this)}},{key:`push`,value:function(e){return o(this.tail,a(e),null,this)}},{key:`unshift`,value:function(e){return o(null,a(e),this.head,this)}},{key:`remove`,value:function(e){return s(e,this)}},{key:`pop`,value:function(){return s(this.tail,this).value}},{key:`popNode`,value:function(){return s(this.tail,this)}},{key:`shift`,value:function(){return s(this.head,this).value}},{key:`shiftNode`,value:function(){return s(this.head,this)}},{key:`get_object_at`,value:function(e){if(e<=this.length()){for(var t=1,n=this.head;t<e;)n=n.next,t++;return n.value}}},{key:`set_object_at`,value:function(e,t){if(e<=this.length()){for(var n=1,r=this.head;n<e;)r=r.next,n++;r.value=t}}}]),e}()}),(function(e,t,n){function r(e,t,n){this.x=null,this.y=null,e==null&&t==null&&n==null?(this.x=0,this.y=0):typeof e==`number`&&typeof t==`number`&&n==null?(this.x=e,this.y=t):e.constructor.name==`Point`&&t==null&&n==null&&(n=e,this.x=n.x,this.y=n.y)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(e,t,n){e.constructor.name==`Point`&&t==null&&n==null?(n=e,this.setLocation(n.x,n.y)):typeof e==`number`&&typeof t==`number`&&n==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},r.prototype.move=function(e,t){this.x=e,this.y=t},r.prototype.translate=function(e,t){this.x+=e,this.y+=t},r.prototype.equals=function(e){if(e.constructor.name==`Point`){var t=e;return this.x==t.x&&this.y==t.y}return this==e},r.prototype.toString=function(){return new r().constructor.name+`[x=`+this.x+`,y=`+this.y+`]`},e.exports=r}),(function(e,t,n){function r(e,t,n,r){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&n!=null&&r!=null&&(this.x=e,this.y=t,this.width=n,this.height=r)}r.prototype.getX=function(){return this.x},r.prototype.setX=function(e){this.x=e},r.prototype.getY=function(){return this.y},r.prototype.setY=function(e){this.y=e},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(e){this.width=e},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(e){this.height=e},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},e.exports=r}),(function(e,t,n){var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function i(){}i.lastID=0,i.createID=function(e){return i.isPrimitive(e)?e:e.uniqueID==null?(e.uniqueID=i.getString(),i.lastID++,e.uniqueID):e.uniqueID},i.getString=function(e){return e??=i.lastID,`Object#`+e},i.isPrimitive=function(e){var t=e===void 0?`undefined`:r(e);return e==null||t!=`object`&&t!=`function`},e.exports=i}),(function(e,t,n){function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}var i=n(0),a=n(7),o=n(3),s=n(1),c=n(6),l=n(5),u=n(17),d=n(29);function f(e){d.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,e!=null&&(this.isRemoteUse=e)}f.RANDOM_SEED=1,f.prototype=Object.create(d.prototype),f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},f.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},f.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},f.prototype.newGraphManager=function(){var e=new a(this);return this.graphManager=e,e},f.prototype.newGraph=function(e){return new c(null,this.graphManager,e)},f.prototype.newNode=function(e){return new o(this.graphManager,e)},f.prototype.newEdge=function(e){return new s(null,null,e)},f.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},f.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var e=!this.checkLayoutSuccess()&&this.layout();return i.ANIMATE===`during`?!1:(e&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,e)},f.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},f.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var e=this.graphManager.getAllEdges(),t=0;t<e.length;t++)e[t];for(var n=this.graphManager.getRoot().getNodes(),t=0;t<n.length;t++)n[t];this.update(this.graphManager.getRoot())}},f.prototype.update=function(e){if(e==null)this.update2();else if(e instanceof o){var t=e;if(t.getChild()!=null)for(var n=t.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);t.vGraphObject!=null&&t.vGraphObject.update(t)}else if(e instanceof s){var i=e;i.vGraphObject!=null&&i.vGraphObject.update(i)}else if(e instanceof c){var a=e;a.vGraphObject!=null&&a.vGraphObject.update(a)}},f.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},f.prototype.transform=function(e){if(e==null)this.transform(new l(0,0));else{var t=new u,n=this.graphManager.getRoot().updateLeftTop();if(n!=null){t.setWorldOrgX(e.x),t.setWorldOrgY(e.y),t.setDeviceOrgX(n.x),t.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),i,a=0;a<r.length;a++)i=r[a],i.transform(t)}}},f.prototype.positionNodesRandomly=function(e){if(e==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var t,n,r=e.getNodes(),i=0;i<r.length;i++)t=r[i],n=t.getChild(),n==null||n.getNodes().length==0?t.scatter():(this.positionNodesRandomly(n),t.updateBounds())},f.prototype.getFlatForest=function(){for(var e=[],t=!0,n=this.graphManager.getRoot().getNodes(),i=!0,a=0;a<n.length;a++)n[a].getChild()!=null&&(i=!1);if(!i)return e;var o=new Set,s=[],c=new Map,l=[];for(l=l.concat(n);l.length>0&&t;){for(s.push(l[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);for(var d=u.getEdges(),a=0;a<d.length;a++){var f=d[a].getOtherEnd(u);if(c.get(u)!=f)if(!o.has(f))s.push(f),c.set(f,u);else{t=!1;break}}}if(!t)e=[];else{var p=[].concat(r(o));e.push(p);for(var a=0;a<p.length;a++){var m=p[a],h=l.indexOf(m);h>-1&&l.splice(h,1)}o=new Set,c=new Map}}return e},f.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i<e.bendpoints.length;i++){var a=this.newNode(null);a.setRect(new Point(0,0),new Dimension(1,1)),r.add(a);var o=this.newEdge(null);this.graphManager.add(o,n,a),t.add(a),n=a}var o=this.newEdge(null);return this.graphManager.add(o,n,e.target),this.edgeToDummyNodes.set(e,t),e.isInterGraph()?this.graphManager.remove(e):r.remove(e),t},f.prototype.createBendpointsFromDummyNodes=function(){var e=[];e=e.concat(this.graphManager.getAllEdges()),e=[].concat(r(this.edgeToDummyNodes.keys()),e);for(var t=0;t<e.length;t++){var n=e[t];if(n.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(n),a=0;a<i.length;a++){var o=i[a],s=new l(o.getCenterX(),o.getCenterY()),c=n.bendpoints.get(a);c.x=s.x,c.y=s.y,o.getOwner().remove(o)}this.graphManager.add(n,n.source,n.target)}}},f.transform=function(e,t,n,r){if(n!=null&&r!=null){var i=t;if(e<=50){var a=t/n;i-=(t-a)/50*(50-e)}else{var o=t*r;i+=(o-t)/50*(e-50)}return i}else{var s,c;return e<=50?(s=9*t/500,c=t/10):(s=9*t/50,c=-8*t),s*e+c}},f.findCenterOfTree=function(e){var t=[];t=t.concat(e);var n=[],r=new Map,i=!1,a=null;(t.length==1||t.length==2)&&(i=!0,a=t[0]);for(var o=0;o<t.length;o++){var s=t[o],c=s.getNeighborsList().size;r.set(s,s.getNeighborsList().size),c==1&&n.push(s)}var l=[];for(l=l.concat(n);!i;){var u=[];u=u.concat(l),l=[];for(var o=0;o<t.length;o++){var s=t[o],d=t.indexOf(s);d>=0&&t.splice(d,1),s.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;t==1&&l.push(e),r.set(e,t)}})}n=n.concat(l),(t.length==1||t.length==2)&&(i=!0,a=t[0])}return a},f.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=f}),(function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},e.exports=r}),(function(e,t,n){var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i}),(function(e,t,n){function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}var i=n(15),a=n(4),o=n(0),s=n(8),c=n(9);function l(){i.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}for(var u in l.prototype=Object.create(i.prototype),i)l[u]=i[u];l.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,i,s,c,l=this.getGraphManager().getAllEdges(),u=0;u<l.length;u++)e=l[u],t=e.idealLength,e.isInterGraph&&(r=e.getSource(),i=e.getTarget(),s=e.getSourceInLca().getEstimatedSize(),c=e.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(e.idealLength+=s+c-2*o.SIMPLE_NODE_SIZE),n=e.getLca().getInclusionTreeDepth(),e.idealLength+=t*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+i.getInclusionTreeDepth()-2*n))},l.prototype.initSpringEmbedder=function(){var e=this.getAllNodes().length;this.incremental?(e>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n<e.length;n++)t=e[n],this.calcSpringForce(t,t.idealLength)},l.prototype.calcRepulsionForces=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n,r,i,o,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),c=new Set,n=0;n<s.length;n++)i=s[n],this.calculateRepulsionForceOfANode(i,c,e,t),c.add(i);else for(n=0;n<s.length;n++)for(i=s[n],r=n+1;r<s.length;r++)o=s[r],i.getOwner()==o.getOwner()&&this.calcRepulsionForce(i,o)},l.prototype.calcGravitationalForces=function(){for(var e,t=this.getAllNodesToApplyGravitation(),n=0;n<t.length;n++)e=t[n],this.calcGravitationalForce(e)},l.prototype.moveNodes=function(){for(var e=this.getAllNodes(),t,n=0;n<e.length;n++)t=e[n],t.move()},l.prototype.calcSpringForce=function(e,t){var n=e.getSource(),r=e.getTarget(),i,a,o,s;if(this.uniformLeafNodeSizes&&n.getChild()==null&&r.getChild()==null)e.updateLengthSimple();else if(e.updateLength(),e.isOverlapingSourceAndTarget)return;i=e.getLength(),i!=0&&(a=e.edgeElasticity*(i-t),o=a*(e.lengthX/i),s=a*(e.lengthY/i),n.springForceX+=o,n.springForceY+=s,r.springForceX-=o,r.springForceY-=s)},l.prototype.calcRepulsionForce=function(e,t){var n=e.getRect(),r=t.getRect(),i=[,,],o=[,,,,],l,u,d,f,p,m,h;if(n.intersects(r)){s.calcSeparationAmount(n,r,i,a.DEFAULT_EDGE_LENGTH/2),m=2*i[0],h=2*i[1];var g=e.noOfChildren*t.noOfChildren/(e.noOfChildren+t.noOfChildren);e.repulsionForceX-=g*m,e.repulsionForceY-=g*h,t.repulsionForceX+=g*m,t.repulsionForceY+=g*h}else this.uniformLeafNodeSizes&&e.getChild()==null&&t.getChild()==null?(l=r.getCenterX()-n.getCenterX(),u=r.getCenterY()-n.getCenterY()):(s.getIntersection(n,r,o),l=o[2]-o[0],u=o[3]-o[1]),Math.abs(l)<a.MIN_REPULSION_DIST&&(l=c.sign(l)*a.MIN_REPULSION_DIST),Math.abs(u)<a.MIN_REPULSION_DIST&&(u=c.sign(u)*a.MIN_REPULSION_DIST),d=l*l+u*u,f=Math.sqrt(d),p=(e.nodeRepulsion/2+t.nodeRepulsion/2)*e.noOfChildren*t.noOfChildren/d,m=p*l/f,h=p*u/f,e.repulsionForceX-=m,e.repulsionForceY-=h,t.repulsionForceX+=m,t.repulsionForceY+=h},l.prototype.calcGravitationalForce=function(e){var t=e.getOwner(),n=(t.getRight()+t.getLeft())/2,r=(t.getTop()+t.getBottom())/2,i=e.getCenterX()-n,a=e.getCenterY()-r,o=Math.abs(i)+e.getWidth()/2,s=Math.abs(a)+e.getHeight()/2,c;e.getOwner()==this.graphManager.getRoot()?(c=t.getEstimatedSize()*this.gravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a)):(c=t.getEstimatedSize()*this.compoundGravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant))},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,e||t},l.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},l.prototype.calcNoOfChildrenForAllNodes=function(){for(var e,t=this.graphManager.getAllNodes(),n=0;n<t.length;n++)e=t[n],e.noOfChildren=e.getNoOfChildren()},l.prototype.calcGrid=function(e){var t=0,n=0;t=parseInt(Math.ceil((e.getRight()-e.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((e.getBottom()-e.getTop())/this.repulsionRange));for(var r=Array(t),i=0;i<t;i++)r[i]=Array(n);for(var i=0;i<t;i++)for(var a=0;a<n;a++)r[i][a]=[];return r},l.prototype.addNodeToGrid=function(e,t,n){var r=0,i=0,a=0,o=0;r=parseInt(Math.floor((e.getRect().x-t)/this.repulsionRange)),i=parseInt(Math.floor((e.getRect().width+e.getRect().x-t)/this.repulsionRange)),a=parseInt(Math.floor((e.getRect().y-n)/this.repulsionRange)),o=parseInt(Math.floor((e.getRect().height+e.getRect().y-n)/this.repulsionRange));for(var s=r;s<=i;s++)for(var c=a;c<=o;c++)this.grid[s][c].push(e),e.setGridCoordinates(r,i,a,o)},l.prototype.updateGrid=function(){var e,t,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),e=0;e<n.length;e++)t=n[e],this.addNodeToGrid(t,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},l.prototype.calculateRepulsionForceOfANode=function(e,t,n,i){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&n||i){var o=new Set;e.surrounding=[];for(var s,c=this.grid,l=e.startX-1;l<e.finishX+2;l++)for(var u=e.startY-1;u<e.finishY+2;u++)if(!(l<0||u<0||l>=c.length||u>=c[0].length)){for(var d=0;d<c[l][u].length;d++)if(s=c[l][u][d],!(e.getOwner()!=s.getOwner()||e==s)&&!t.has(s)&&!o.has(s)){var f=Math.abs(e.getCenterX()-s.getCenterX())-(e.getWidth()/2+s.getWidth()/2),p=Math.abs(e.getCenterY()-s.getCenterY())-(e.getHeight()/2+s.getHeight()/2);f<=this.repulsionRange&&p<=this.repulsionRange&&o.add(s)}}e.surrounding=[].concat(r(o))}for(l=0;l<e.surrounding.length;l++)this.calcRepulsionForce(e,e.surrounding[l])},l.prototype.calcRepulsionRange=function(){return 0},e.exports=l}),(function(e,t,n){var r=n(1),i=n(4);function a(e,t,n){r.call(this,e,t,n),this.idealLength=i.DEFAULT_EDGE_LENGTH,this.edgeElasticity=i.DEFAULT_SPRING_STRENGTH}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];e.exports=a}),(function(e,t,n){var r=n(3),i=n(4);function a(e,t,n,a){r.call(this,e,t,n,a),this.nodeRepulsion=i.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=[]}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.setGridCoordinates=function(e,t,n,r){this.startX=e,this.finishX=t,this.startY=n,this.finishY=r},e.exports=a}),(function(e,t,n){function r(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(e){this.width=e},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(e){this.height=e},e.exports=r}),(function(e,t,n){var r=n(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(e,t){var n=r.createID(e);this.contains(n)||(this.map[n]=t,this.keys.push(e))},i.prototype.contains=function(e){return r.createID(e),this.map[e]!=null},i.prototype.get=function(e){var t=r.createID(e);return this.map[t]},i.prototype.keySet=function(){return this.keys},e.exports=i}),(function(e,t,n){var r=n(14);function i(){this.set={}}i.prototype.add=function(e){var t=r.createID(e);this.contains(t)||(this.set[t]=e)},i.prototype.remove=function(e){delete this.set[r.createID(e)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(e){return this.set[r.createID(e)]==e},i.prototype.isEmpty=function(){return this.size()===0},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(e){for(var t=Object.keys(this.set),n=t.length,r=0;r<n;r++)e.push(this.set[t[r]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];this.add(r)}},e.exports=i}),(function(e,t,n){function r(){}r.multMat=function(e,t){for(var n=[],r=0;r<e.length;r++){n[r]=[];for(var i=0;i<t[0].length;i++){n[r][i]=0;for(var a=0;a<e[0].length;a++)n[r][i]+=e[r][a]*t[a][i]}}return n},r.transpose=function(e){for(var t=[],n=0;n<e[0].length;n++){t[n]=[];for(var r=0;r<e.length;r++)t[n][r]=e[r][n]}return t},r.multCons=function(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=e[r]*t;return n},r.minusOp=function(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=e[r]-t[r];return n},r.dotProduct=function(e,t){for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n},r.mag=function(e){return Math.sqrt(this.dotProduct(e,e))},r.normalize=function(e){for(var t=[],n=this.mag(e),r=0;r<e.length;r++)t[r]=e[r]/n;return t},r.multGamma=function(e){for(var t=[],n=0,r=0;r<e.length;r++)n+=e[r];n*=-1/e.length;for(var i=0;i<e.length;i++)t[i]=n+e[i];return t},r.multL=function(e,t,n){for(var r=[],i=[],a=[],o=0;o<t[0].length;o++){for(var s=0,c=0;c<t.length;c++)s+=-.5*t[c][o]*e[c];i[o]=s}for(var l=0;l<n.length;l++){for(var u=0,d=0;d<n.length;d++)u+=n[l][d]*i[d];a[l]=u}for(var f=0;f<t.length;f++){for(var p=0,m=0;m<t[0].length;m++)p+=t[f][m]*a[m];r[f]=p}return r},e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=n(11);e.exports=function(){function e(t,n){i(this,e),(n!==null||n!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=t instanceof a?t.size():t.length,this._quicksort(t,0,r-1)}return r(e,[{key:`_quicksort`,value:function(e,t,n){if(t<n){var r=this._partition(e,t,n);this._quicksort(e,t,r),this._quicksort(e,r+1,n)}}},{key:`_partition`,value:function(e,t,n){for(var r=this._get(e,t),i=t,a=n;;){for(;this.compareFunction(r,this._get(e,a));)a--;for(;this.compareFunction(this._get(e,i),r);)i++;if(i<a)this._swap(e,i,a),i++,a--;else return a}}},{key:`_get`,value:function(e,t){return e instanceof a?e.get_object_at(t):e[t]}},{key:`_set`,value:function(e,t,n){e instanceof a?e.set_object_at(t,n):e[t]=n}},{key:`_swap`,value:function(e,t,n){var r=this._get(e,t);this._set(e,t,this._get(e,n)),this._set(e,n,r)}},{key:`_defaultCompareFunction`,value:function(e,t){return t>e}}]),e}()}),(function(e,t,n){function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-->0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function(e){return function e(t){if(t.length==0)return 0;for(var n=[],r=0;r<t[0];r++)n.push(e(t.slice(1)));return n}(e)}([this.m,t]),this.V=function(e){return function e(t){if(t.length==0)return 0;for(var n=[],r=0;r<t[0];r++)n.push(e(t.slice(1)));return n}(e)}([this.n,this.n]);for(var n=function(e){for(var t=[];e-->0;)t.push(0);return t}(this.n),i=function(e){for(var t=[];e-->0;)t.push(0);return t}(this.m),a=!0,o=!0,s=Math.min(this.m-1,this.n),c=Math.max(0,Math.min(this.n-2,this.m)),l=0;l<Math.max(s,c);l++){if(l<s){this.s[l]=0;for(var u=l;u<this.m;u++)this.s[l]=r.hypot(this.s[l],e[u][l]);if(this.s[l]!==0){e[l][l]<0&&(this.s[l]=-this.s[l]);for(var d=l;d<this.m;d++)e[d][l]/=this.s[l];e[l][l]+=1}this.s[l]=-this.s[l]}for(var f=l+1;f<this.n;f++){if(function(e,t){return e&&t}(l<s,this.s[l]!==0)){for(var p=0,m=l;m<this.m;m++)p+=e[m][l]*e[m][f];p=-p/e[l][l];for(var h=l;h<this.m;h++)e[h][f]+=p*e[h][l]}n[f]=e[l][f]}if(function(e,t){return e&&t}(a,l<s))for(var g=l;g<this.m;g++)this.U[g][l]=e[g][l];if(l<c){n[l]=0;for(var _=l+1;_<this.n;_++)n[l]=r.hypot(n[l],n[_]);if(n[l]!==0){n[l+1]<0&&(n[l]=-n[l]);for(var v=l+1;v<this.n;v++)n[v]/=n[l];n[l+1]+=1}if(n[l]=-n[l],function(e,t){return e&&t}(l+1<this.m,n[l]!==0)){for(var y=l+1;y<this.m;y++)i[y]=0;for(var b=l+1;b<this.n;b++)for(var x=l+1;x<this.m;x++)i[x]+=n[b]*e[x][b];for(var S=l+1;S<this.n;S++)for(var C=-n[S]/n[l+1],w=l+1;w<this.m;w++)e[w][S]+=C*i[w]}if(o)for(var T=l+1;T<this.n;T++)this.V[T][l]=n[T]}}var E=Math.min(this.n,this.m+1);if(s<this.n&&(this.s[s]=e[s][s]),this.m<E&&(this.s[E-1]=0),c+1<E&&(n[c]=e[c][E-1]),n[E-1]=0,a){for(var D=s;D<t;D++){for(var O=0;O<this.m;O++)this.U[O][D]=0;this.U[D][D]=1}for(var k=s-1;k>=0;k--)if(this.s[k]!==0){for(var A=k+1;A<t;A++){for(var j=0,M=k;M<this.m;M++)j+=this.U[M][k]*this.U[M][A];j=-j/this.U[k][k];for(var N=k;N<this.m;N++)this.U[N][A]+=j*this.U[N][k]}for(var P=k;P<this.m;P++)this.U[P][k]=-this.U[P][k];this.U[k][k]=1+this.U[k][k];for(var F=0;F<k-1;F++)this.U[F][k]=0}else{for(var I=0;I<this.m;I++)this.U[I][k]=0;this.U[k][k]=1}}if(o)for(var L=this.n-1;L>=0;L--){if(function(e,t){return e&&t}(L<c,n[L]!==0))for(var R=L+1;R<t;R++){for(var z=0,B=L+1;B<this.n;B++)z+=this.V[B][L]*this.V[B][R];z=-z/this.V[L+1][L];for(var V=L+1;V<this.n;V++)this.V[V][R]+=z*this.V[V][L]}for(var ee=0;ee<this.n;ee++)this.V[ee][L]=0;this.V[L][L]=1}for(var te=E-1,H=0,ne=2**-52,re=2**-966;E>0;){var U=void 0,W=void 0;for(U=E-2;U>=-1&&U!==-1;U--)if(Math.abs(n[U])<=re+ne*(Math.abs(this.s[U])+Math.abs(this.s[U+1]))){n[U]=0;break}if(U===E-2)W=4;else{var G=void 0;for(G=E-1;G>=U&&G!==U;G--){var ie=(G===E?0:Math.abs(n[G]))+(G===U+1?0:Math.abs(n[G-1]));if(Math.abs(this.s[G])<=re+ne*ie){this.s[G]=0;break}}G===U?W=3:G===E-1?W=1:(W=2,U=G)}switch(U++,W){case 1:var K=n[E-2];n[E-2]=0;for(var q=E-2;q>=U;q--){var J=r.hypot(this.s[q],K),Y=this.s[q]/J,X=K/J;if(this.s[q]=J,q!==U&&(K=-X*n[q-1],n[q-1]=Y*n[q-1]),o)for(var Z=0;Z<this.n;Z++)J=Y*this.V[Z][q]+X*this.V[Z][E-1],this.V[Z][E-1]=-X*this.V[Z][q]+Y*this.V[Z][E-1],this.V[Z][q]=J}break;case 2:var ae=n[U-1];n[U-1]=0;for(var Q=U;Q<E;Q++){var oe=r.hypot(this.s[Q],ae),se=this.s[Q]/oe,ce=ae/oe;if(this.s[Q]=oe,ae=-ce*n[Q],n[Q]=se*n[Q],a)for(var le=0;le<this.m;le++)oe=se*this.U[le][Q]+ce*this.U[le][U-1],this.U[le][U-1]=-ce*this.U[le][Q]+se*this.U[le][U-1],this.U[le][Q]=oe}break;case 3:var ue=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[E-1]),Math.abs(this.s[E-2])),Math.abs(n[E-2])),Math.abs(this.s[U])),Math.abs(n[U])),de=this.s[E-1]/ue,fe=this.s[E-2]/ue,pe=n[E-2]/ue,me=this.s[U]/ue,he=n[U]/ue,ge=((fe+de)*(fe-de)+pe*pe)/2,_e=de*pe*(de*pe),ve=0;(function(e,t){return e||t})(ge!==0,_e!==0)&&(ve=Math.sqrt(ge*ge+_e),ge<0&&(ve=-ve),ve=_e/(ge+ve));for(var ye=(me+de)*(me-de)+ve,be=me*he,$=U;$<E-1;$++){var xe=r.hypot(ye,be),Se=ye/xe,Ce=be/xe;if($!==U&&(n[$-1]=xe),ye=Se*this.s[$]+Ce*n[$],n[$]=Se*n[$]-Ce*this.s[$],be=Ce*this.s[$+1],this.s[$+1]=Se*this.s[$+1],o)for(var we=0;we<this.n;we++)xe=Se*this.V[we][$]+Ce*this.V[we][$+1],this.V[we][$+1]=-Ce*this.V[we][$]+Se*this.V[we][$+1],this.V[we][$]=xe;if(xe=r.hypot(ye,be),Se=ye/xe,Ce=be/xe,this.s[$]=xe,ye=Se*n[$]+Ce*this.s[$+1],this.s[$+1]=-Ce*n[$]+Se*this.s[$+1],be=Ce*n[$+1],n[$+1]=Se*n[$+1],a&&$<this.m-1)for(var Te=0;Te<this.m;Te++)xe=Se*this.U[Te][$]+Ce*this.U[Te][$+1],this.U[Te][$+1]=-Ce*this.U[Te][$]+Se*this.U[Te][$+1],this.U[Te][$]=xe}n[E-2]=ye,H+=1;break;case 4:if(this.s[U]<=0&&(this.s[U]=this.s[U]<0?-this.s[U]:0,o))for(var Ee=0;Ee<=te;Ee++)this.V[Ee][U]=-this.V[Ee][U];for(;U<te&&!(this.s[U]>=this.s[U+1]);){var De=this.s[U];if(this.s[U]=this.s[U+1],this.s[U+1]=De,o&&U<this.n-1)for(var Oe=0;Oe<this.n;Oe++)De=this.V[Oe][U+1],this.V[Oe][U+1]=this.V[Oe][U],this.V[Oe][U]=De;if(a&&U<this.m-1)for(var ke=0;ke<this.m;ke++)De=this.U[ke][U+1],this.U[ke][U+1]=this.U[ke][U],this.U[ke][U]=De;U++}H=0,E--;break}}return{U:this.U,V:this.V,S:this.s}},r.hypot=function(e,t){var n=void 0;return Math.abs(e)>Math.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):t==0?n=0:(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)),n},e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}e.exports=function(){function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[s][c]=0}this.tracebackGrid=Array(this.iMax);for(var l=0;l<this.iMax;l++){this.tracebackGrid[l]=Array(this.jMax);for(var u=0;u<this.jMax;u++)this.tracebackGrid[l][u]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(e,[{key:`getScore`,value:function(){return this.score}},{key:`getAlignments`,value:function(){return this.alignments}},{key:`computeGrids`,value:function(){for(var e=1;e<this.jMax;e++)this.grid[0][e]=this.grid[0][e-1]+this.gap_penalty,this.tracebackGrid[0][e]=[!1,!1,!0];for(var t=1;t<this.iMax;t++)this.grid[t][0]=this.grid[t-1][0]+this.gap_penalty,this.tracebackGrid[t][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var i=void 0;i=this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty;var a=this.grid[n-1][r]+this.gap_penalty,o=this.grid[n][r-1]+this.gap_penalty,s=[i,a,o],c=this.arrayAllMaxIndexes(s);this.grid[n][r]=s[c[0]],this.tracebackGrid[n][r]=[c.includes(0),c.includes(1),c.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:`alignmentTraceback`,value:function(){var e=[];for(e.push({pos:[this.sequence1.length,this.sequence2.length],seq1:``,seq2:``});e[0];){var t=e[0],n=this.tracebackGrid[t.pos[0]][t.pos[1]];n[0]&&e.push({pos:[t.pos[0]-1,t.pos[1]-1],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),n[1]&&e.push({pos:[t.pos[0]-1,t.pos[1]],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:`-`+t.seq2}),n[2]&&e.push({pos:[t.pos[0],t.pos[1]-1],seq1:`-`+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),t.pos[0]===0&&t.pos[1]===0&&this.alignments.push({sequence1:t.seq1,sequence2:t.seq2}),e.shift()}return this.alignments}},{key:`getAllIndexes`,value:function(e,t){for(var n=[],r=-1;(r=e.indexOf(t,r+1))!==-1;)n.push(r);return n}},{key:`arrayAllMaxIndexes`,value:function(e){return this.getAllIndexes(e,Math.max.apply(null,e))}}]),e}()}),(function(e,t,n){var r=function(){};r.FDLayout=n(18),r.FDLayoutConstants=n(4),r.FDLayoutEdge=n(19),r.FDLayoutNode=n(20),r.DimensionD=n(21),r.HashMap=n(22),r.HashSet=n(23),r.IGeometry=n(8),r.IMath=n(9),r.Integer=n(10),r.Point=n(12),r.PointD=n(5),r.RandomSeed=n(16),r.RectangleD=n(13),r.Transform=n(17),r.UniqueIDGeneretor=n(14),r.Quicksort=n(25),r.LinkedList=n(11),r.LGraphObject=n(2),r.LGraph=n(6),r.LEdge=n(1),r.LGraphManager=n(7),r.LNode=n(3),r.Layout=n(15),r.LayoutConstants=n(0),r.NeedlemanWunsch=n(27),r.Matrix=n(24),r.SVD=n(26),e.exports=r}),(function(e,t,n){function r(){this.listeners=[]}var i=r.prototype;i.addListener=function(e,t){this.listeners.push({event:e,callback:t})},i.removeListener=function(e,t){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];e===r.event&&r.callback(t)}},e.exports=r})])})})),O=r(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(D()):typeof define==`function`&&define.amd?define([`layout-base`],r):typeof e==`object`?e.coseBase=r(D()):n.coseBase=r(n.layoutBase)})(e,function(e){return(()=>{var t={45:((e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r}),806:((e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i}),767:((e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),880:((e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),578:((e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),765:((e,t,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),s=n(767),c=n(806),l=n(902),u=n(551).FDLayoutConstants,d=n(551).LayoutConstants,f=n(551).Point,p=n(551).PointD,m=n(551).DimensionD,h=n(551).Layout,g=n(551).Integer,_=n(551).IGeometry,v=n(551).LGraph,y=n(551).Transform,b=n(551).LinkedList;function x(){r.call(this),this.toBeTiled={},this.constraints={}}for(var S in x.prototype=Object.create(r.prototype),r)x[S]=r[S];x.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},x.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},x.prototype.newNode=function(e){return new o(this.graphManager,e)},x.prototype.newEdge=function(e){return new s(null,null,e)},x.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(c.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.prototype.classicLayout=function(){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){var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n)}return Object.keys(this.constraints).length>0&&(l.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-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))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),c.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n<e.length;n++){var r=e[n].rect,i=e[n].id;t[i]={id:i,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return t},x.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if(u.ANIMATE===`during`)this.emit(`layoutstarted`);else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},x.prototype.moveNodes=function(){for(var e=this.getAllNodes(),t,n=0;n<e.length;n++)t=e[n],t.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var n=0;n<e.length;n++)t=e[n],t.move()},x.prototype.initConstraintVariables=function(){var e=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var t=this.graphManager.getAllNodes(),n=0;n<t.length;n++){var r=t[n];this.idToNodeMap.set(r.id,r)}var i=function t(n){for(var r=n.getChild().getNodes(),i,a=0,o=0;o<r.length;o++)i=r[o],i.getChild()==null?e.fixedNodeSet.has(i.id)&&(a+=100):a+=t(i);return a};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(t){e.fixedNodeSet.add(t.nodeId)});for(var t=this.graphManager.getAllNodes(),r,n=0;n<t.length;n++)if(r=t[n],r.getChild()!=null){var a=i(r);a>0&&(r.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var o=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var l=this.constraints.alignmentConstraint.vertical,n=0;n<l.length;n++)this.dummyToNodeForVerticalAlignment.set(`dummy`+n,[]),l[n].forEach(function(t){o.set(t,`dummy`+n),e.dummyToNodeForVerticalAlignment.get(`dummy`+n).push(t),e.fixedNodeSet.has(t)&&e.fixedNodesOnHorizontal.add(`dummy`+n)});if(this.constraints.alignmentConstraint.horizontal)for(var u=this.constraints.alignmentConstraint.horizontal,n=0;n<u.length;n++)this.dummyToNodeForHorizontalAlignment.set(`dummy`+n,[]),u[n].forEach(function(t){s.set(t,`dummy`+n),e.dummyToNodeForHorizontalAlignment.get(`dummy`+n).push(t),e.fixedNodeSet.has(t)&&e.fixedNodesOnVertical.add(`dummy`+n)})}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(e){var t,n,r;for(r=e.length-1;r>=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var n=o.has(t.left)?o.get(t.left):t.left,r=o.has(t.right)?o.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,a=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}});else{var d=new Map,f=new Map;this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var t=o.has(e.left)?o.get(e.left):e.left,n=o.has(e.right)?o.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;f.has(r)?f.get(r).push(i):f.set(r,[i]),f.has(i)?f.get(i).push(r):f.set(i,[r])}});var p=function(e,t){var n=[],r=[],i=new b,a=new Set,o=0;return e.forEach(function(s,c){if(!a.has(c)){n[o]=[],r[o]=!1;var l=c;for(i.push(l),a.add(l),n[o].push(l);i.length!=0;)l=i.shift(),t.has(l)&&(r[o]=!0),e.get(l).forEach(function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))});o++}}),{components:n,isFixed:r}},m=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=m.components,this.fixedComponentsOnHorizontal=m.isFixed;var h=p(f,e.fixedNodesOnVertical);this.componentsOnVertical=h.components,this.fixedComponentsOnVertical=h.isFixed}}},x.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n<t.length;n++){for(var r=0,i=0;i<t[n].length;i++){if(this.fixedNodeSet.has(t[n][i])){r=0;break}r+=this.idToNodeMap.get(t[n][i]).displacementX}for(var a=r/t[n].length,i=0;i<t[n].length;i++)this.idToNodeMap.get(t[n][i]).displacementX=a}if(this.constraints.alignmentConstraint.horizontal)for(var o=this.constraints.alignmentConstraint.horizontal,n=0;n<o.length;n++){for(var s=0,i=0;i<o[n].length;i++){if(this.fixedNodeSet.has(o[n][i])){s=0;break}s+=this.idToNodeMap.get(o[n][i]).displacementY}for(var l=s/o[n].length,i=0;i<o[n].length;i++)this.idToNodeMap.get(o[n][i]).displacementY=l}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(t){if(!e.fixedNodesOnHorizontal.has(t)){var n=0;n=e.dummyToNodeForVerticalAlignment.has(t)?e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(t)[0]).displacementX:e.idToNodeMap.get(t).displacementX,e.nodeToRelativeConstraintMapHorizontal.get(t).forEach(function(r){if(r.right){var i=e.nodeToTempPositionMapHorizontal.get(r.right)-e.nodeToTempPositionMapHorizontal.get(t)-n;i<r.gap&&(n-=r.gap-i)}else{var i=e.nodeToTempPositionMapHorizontal.get(t)-e.nodeToTempPositionMapHorizontal.get(r.left)+n;i<r.gap&&(n+=r.gap-i)}}),e.nodeToTempPositionMapHorizontal.set(t,e.nodeToTempPositionMapHorizontal.get(t)+n),e.dummyToNodeForVerticalAlignment.has(t)?e.dummyToNodeForVerticalAlignment.get(t).forEach(function(t){e.idToNodeMap.get(t).displacementX=n}):e.idToNodeMap.get(t).displacementX=n}}),this.nodesInRelativeVertical.forEach(function(t){if(!e.fixedNodesOnHorizontal.has(t)){var n=0;n=e.dummyToNodeForHorizontalAlignment.has(t)?e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(t)[0]).displacementY:e.idToNodeMap.get(t).displacementY,e.nodeToRelativeConstraintMapVertical.get(t).forEach(function(r){if(r.bottom){var i=e.nodeToTempPositionMapVertical.get(r.bottom)-e.nodeToTempPositionMapVertical.get(t)-n;i<r.gap&&(n-=r.gap-i)}else{var i=e.nodeToTempPositionMapVertical.get(t)-e.nodeToTempPositionMapVertical.get(r.top)+n;i<r.gap&&(n+=r.gap-i)}}),e.nodeToTempPositionMapVertical.set(t,e.nodeToTempPositionMapVertical.get(t)+n),e.dummyToNodeForHorizontalAlignment.has(t)?e.dummyToNodeForHorizontalAlignment.get(t).forEach(function(t){e.idToNodeMap.get(t).displacementY=n}):e.idToNodeMap.get(t).displacementY=n}});else{for(var n=0;n<this.componentsOnHorizontal.length;n++){var u=this.componentsOnHorizontal[n];if(this.fixedComponentsOnHorizontal[n])for(var i=0;i<u.length;i++)this.dummyToNodeForVerticalAlignment.has(u[i])?this.dummyToNodeForVerticalAlignment.get(u[i]).forEach(function(t){e.idToNodeMap.get(t).displacementX=0}):this.idToNodeMap.get(u[i]).displacementX=0;else{for(var d=0,f=0,i=0;i<u.length;i++)if(this.dummyToNodeForVerticalAlignment.has(u[i])){var p=this.dummyToNodeForVerticalAlignment.get(u[i]);d+=p.length*this.idToNodeMap.get(p[0]).displacementX,f+=p.length}else d+=this.idToNodeMap.get(u[i]).displacementX,f++;for(var m=d/f,i=0;i<u.length;i++)this.dummyToNodeForVerticalAlignment.has(u[i])?this.dummyToNodeForVerticalAlignment.get(u[i]).forEach(function(t){e.idToNodeMap.get(t).displacementX=m}):this.idToNodeMap.get(u[i]).displacementX=m}}for(var n=0;n<this.componentsOnVertical.length;n++){var u=this.componentsOnVertical[n];if(this.fixedComponentsOnVertical[n])for(var i=0;i<u.length;i++)this.dummyToNodeForHorizontalAlignment.has(u[i])?this.dummyToNodeForHorizontalAlignment.get(u[i]).forEach(function(t){e.idToNodeMap.get(t).displacementY=0}):this.idToNodeMap.get(u[i]).displacementY=0;else{for(var d=0,f=0,i=0;i<u.length;i++)if(this.dummyToNodeForHorizontalAlignment.has(u[i])){var p=this.dummyToNodeForHorizontalAlignment.get(u[i]);d+=p.length*this.idToNodeMap.get(p[0]).displacementY,f+=p.length}else d+=this.idToNodeMap.get(u[i]).displacementY,f++;for(var m=d/f,i=0;i<u.length;i++)this.dummyToNodeForHorizontalAlignment.has(u[i])?this.dummyToNodeForHorizontalAlignment.get(u[i]).forEach(function(t){e.idToNodeMap.get(t).displacementY=m}):this.idToNodeMap.get(u[i]).displacementY=m}}}},x.prototype.calculateNodesToApplyGravitationTo=function(){var e=[],t,n=this.graphManager.getGraphs(),r=n.length,i;for(i=0;i<r;i++)t=n[i],t.updateConnected(),t.isConnected||(e=e.concat(t.getNodes()));return e},x.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var t=new Set,n;for(n=0;n<e.length;n++){var r=e[n];if(!t.has(r)){var i=r.getSource(),a=r.getTarget();if(i==a)r.getBendpoints().push(new p),r.getBendpoints().push(new p),this.createDummyNodesForBendpoints(r),t.add(r);else{var o=[];if(o=o.concat(i.getEdgeListToNode(a)),o=o.concat(a.getEdgeListToNode(i)),!t.has(o[0])){if(o.length>1){var s;for(s=0;s<o.length;s++){var c=o[s];c.getBendpoints().push(new p),this.createDummyNodesForBendpoints(c)}}o.forEach(function(e){t.add(e)})}}}if(t.size==e.length)break}},x.prototype.positionNodesRadially=function(e){for(var t=new f(0,0),n=Math.ceil(Math.sqrt(e.length)),r=0,i=0,a=0,o=new p(0,0),s=0;s<e.length;s++){s%n==0&&(a=0,i=r,s!=0&&(i+=c.DEFAULT_COMPONENT_SEPERATION),r=0);var l=e[s],u=h.findCenterOfTree(l);t.x=a,t.y=i,o=x.radialLayout(l,u,t),o.y>r&&(r=Math.floor(o.y)),a=Math.floor(o.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-o.x/2,d.WORLD_CENTER_Y-o.y/2))},x.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),c.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(t,null,0,359,0,r);var i=v.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o<e.length;o++)e[o].transform(a);var s=new p(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(s)},x.branchRadialLayout=function(e,t,n,r,i,a){var o=(r-n+1)/2;o<0&&(o+=180);var s=(o+n)%360*_.TWO_PI/360,c=i*Math.cos(s),l=i*Math.sin(s);e.setCenter(c,l);var u=[];u=u.concat(e.getEdges());var d=u.length;t!=null&&d--;for(var f=0,p=u.length,m,h=e.getEdgesBetween(t);h.length>1;){var g=h[0];h.splice(0,1);var v=u.indexOf(g);v>=0&&u.splice(v,1),p--,d--}m=t==null?0:(u.indexOf(h[0])+1)%p;for(var y=Math.abs(r-n)/d,b=m;f!=d;b=++b%p){var S=u[b].getOtherEnd(e);if(S!=t){var C=(n+f*y)%360,w=(C+y)%360;x.branchRadialLayout(S,e,C,w,i+a,a),f++}}},x.maxDiagonalInTree=function(e){for(var t=g.MIN_VALUE,n=0;n<e.length;n++){var r=e[n].getDiagonal();r>t&&(t=r)}return t},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i<r.length;i++){var a=r[i],s=a.getParent();this.getNodeDegreeWithChildren(a)===0&&(s.id==null||!this.getToBeTiled(s))&&n.push(a)}for(var i=0;i<n.length;i++){var a=n[i],c=a.getParent().id;t[c]===void 0&&(t[c]=[]),t[c]=t[c].concat(a)}Object.keys(t).forEach(function(n){if(t[n].length>1){var r=`DummyCompound_`+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),c=i.getChild();c.add(a);for(var l=0;l<t[n].length;l++){var u=t[n][l];c.remove(u),s.add(u)}}})},x.prototype.clearCompounds=function(){var e={},t={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)t[this.compoundOrder[n].id]=this.compoundOrder[n],e[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,t)},x.prototype.clearZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=e.idToDummyNode[n];if(t[n]=e.tileNodes(e.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=t[n].width,r.rect.height=t[n].height,r.setCenter(t[n].centerX,t[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var i=r.rect.width,a=r.rect.height;r.labelWidth&&(r.labelPosHorizontal==`left`?(r.rect.x-=r.labelWidth,r.setWidth(i+r.labelWidth),r.labelMarginLeft=r.labelWidth):r.labelPosHorizontal==`center`&&r.labelWidth>i?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):r.labelPosHorizontal==`right`&&r.setWidth(i+r.labelWidth)),r.labelHeight&&(r.labelPosVertical==`top`?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical==`center`&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):r.labelPosVertical==`bottom`&&r.setHeight(a+r.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},x.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)})},x.prototype.getToBeTiled=function(e){var t=e.id;if(this.toBeTiled[t]!=null)return this.toBeTiled[t];var n=e.getChild();if(n==null)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i<r.length;i++){var a=r[i];if(this.getNodeDegree(a)>0)return this.toBeTiled[t]=!1,!1;if(a.getChild()==null){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},x.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;r<t.length;r++){var i=t[r];i.getSource().id!==i.getTarget().id&&(n+=1)}return n},x.prototype.getNodeDegreeWithChildren=function(e){var t=this.getNodeDegree(e);if(e.getChild()==null)return t;for(var n=e.getChild().getNodes(),r=0;r<n.length;r++){var i=n[r];t+=this.getNodeDegreeWithChildren(i)}return t},x.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},x.prototype.fillCompexOrderByDFS=function(e){for(var t=0;t<e.length;t++){var n=e[t];n.getChild()!=null&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},x.prototype.adjustLocations=function(e,t,n,r,i,a,o){t+=r+a,n+=i+o;for(var s=t,c=0;c<e.rows.length;c++){var l=e.rows[c];t=s;for(var u=0,d=0;d<l.length;d++){var f=l[d];f.rect.x=t,f.rect.y=n,t+=f.rect.width+e.horizontalPadding,f.rect.height>u&&(u=f.rect.height)}n+=u+e.verticalPadding}},x.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&(i.labelPosHorizontal==`left`?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal==`center`&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):i.labelPosHorizontal==`right`&&i.setWidth(a+i.labelWidth)),i.labelHeight&&(i.labelPosVertical==`top`?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical==`center`&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):i.labelPosVertical==`bottom`&&i.setHeight(o+i.labelHeight))}})},x.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)<i?r:n},x.prototype.getOrgRatio=function(e){var t=e.width/e.height;return t<1&&(t=1/t),t},x.prototype.calcIdealRowWidth=function(e,t){var n=c.TILING_PADDING_VERTICAL,r=c.TILING_PADDING_HORIZONTAL,i=e.length,a=0,o=0,s=0;e.forEach(function(e){a+=e.getWidth(),o+=e.getHeight(),e.getWidth()>s&&(s=e.getWidth())});var l=a/i,u=o/i,d=(n-r)**2+4*(l+r)*(u+n)*i,f=(r-n+Math.sqrt(d))/(2*(l+r)),p;t?(p=Math.ceil(f),p==f&&p++):p=Math.floor(f);var m=p*(l+r)-r;return s>m&&(m=s),m+=r*2,m},x.prototype.tileNodesByFavoringDim=function(e,t,n){var r=c.TILING_PADDING_VERTICAL,i=c.TILING_PADDING_HORIZONTAL,a=c.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},l=function(e,t){return s(t)-s(e)};e.sort(function(e,t){var n=l;return o.idealRowWidth?(n=a,n(e.id,t.id)):n(e,t)});for(var u=0,d=0,f=0;f<e.length;f++){var p=e[f];u+=p.getCenterX(),d+=p.getCenterY()}o.centerX=u/e.length,o.centerY=d/e.length;for(var f=0;f<e.length;f++){var p=e[f];if(o.rows.length==0)this.insertNodeToRow(o,p,0,t);else if(this.canAddHorizontal(o,p.rect.width,p.rect.height)){var m=o.rows.length-1;o.idealRowWidth||(m=this.getShortestRowIndex(o)),this.insertNodeToRow(o,p,m,t)}else this.insertNodeToRow(o,p,o.rows.length,t);this.shiftToLastRow(o)}return o},x.prototype.insertNodeToRow=function(e,t,n,r){var i=r;n==e.rows.length&&(e.rows.push([]),e.rowWidth.push(i),e.rowHeight.push(0));var a=e.rowWidth[n]+t.rect.width;e.rows[n].length>0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width<a&&(e.width=a);var o=t.rect.height;n>0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},x.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]<n&&(t=r,n=e.rowWidth[r]);return t},x.prototype.getLongestRowIndex=function(e){for(var t=-1,n=Number.MIN_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]>n&&(t=r,n=e.rowWidth[r]);return t},x.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var a=e.rowWidth[i];if(a+e.horizontalPadding+t<=e.width)return!0;var o=0;e.rowHeight[i]<n&&i>0&&(o=n+e.verticalPadding-e.rowHeight[i]);var s=e.width-a>=t+e.horizontalPadding?(e.height+o)/(a+t+e.horizontalPadding):(e.height+o)/e.width;o=n+e.verticalPadding;var c=e.width<t?(e.height+o)/t:(e.height+o)/e.width;return c<1&&(c=1/c),s<1&&(s=1/s),s<c},x.prototype.shiftToLastRow=function(e){var t=this.getLongestRowIndex(e),n=e.rowWidth.length-1,r=e.rows[t],i=r[r.length-1],a=i.width+e.horizontalPadding;if(e.width-e.rowWidth[n]>a&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;s<r.length;s++)r[s].height>o&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var c=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]<i.height+e.verticalPadding&&(e.rowHeight[n]=i.height+e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.height+=l-c,this.shiftToLastRow(e)}},x.prototype.tilingPreLayout=function(){c.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},x.prototype.tilingPostLayout=function(){c.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},x.prototype.reduceTrees=function(){for(var e=[],t=!0,n;t;){var r=this.graphManager.getAllNodes(),i=[];t=!1;for(var a=0;a<r.length;a++)if(n=r[a],n.getEdges().length==1&&!n.getEdges()[0].isInterGraph&&n.getChild()==null){if(c.PURE_INCREMENTAL){var o=n.getEdges()[0].getOtherEnd(n),s=new m(n.getCenterX()-o.getCenterX(),n.getCenterY()-o.getCenterY());i.push([n,n.getEdges()[0],n.getOwner(),s])}else i.push([n,n.getEdges()[0],n.getOwner()]);t=!0}if(t==1){for(var l=[],u=0;u<i.length;u++)i[u][0].getEdges().length==1&&(l.push(i[u]),i[u][0].getOwner().remove(i[u][0]));e.push(l),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},x.prototype.growTree=function(e){for(var t=e[e.length-1],n,r=0;r<t.length;r++)n=t[r],this.findPlaceforPrunedNode(n),n[2].add(n[0]),n[2].add(n[1],n[1].source,n[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},x.prototype.findPlaceforPrunedNode=function(e){var t,n,r=e[0];if(n=r==e[1].source?e[1].target:e[1].source,c.PURE_INCREMENTAL)r.setCenter(n.getCenterX()+e[3].getWidth(),n.getCenterY()+e[3].getHeight());else{var i=n.startX,a=n.finishX,o=n.startY,s=n.finishY,l=[0,0,0,0];if(o>0)for(var d=i;d<=a;d++)l[0]+=this.grid[d][o-1].length+this.grid[d][o].length-1;if(a<this.grid.length-1)for(var d=o;d<=s;d++)l[1]+=this.grid[a+1][d].length+this.grid[a][d].length-1;if(s<this.grid[0].length-1)for(var d=i;d<=a;d++)l[2]+=this.grid[d][s+1].length+this.grid[d][s].length-1;if(i>0)for(var d=o;d<=s;d++)l[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var f=g.MAX_VALUE,p,m,h=0;h<l.length;h++)l[h]<f?(f=l[h],p=1,m=h):l[h]==f&&p++;if(p==3&&f==0)l[0]==0&&l[1]==0&&l[2]==0?t=1:l[0]==0&&l[1]==0&&l[3]==0?t=0:l[0]==0&&l[2]==0&&l[3]==0?t=3:l[1]==0&&l[2]==0&&l[3]==0&&(t=2);else if(p==2&&f==0){var _=Math.floor(Math.random()*2);t=l[0]==0&&l[1]==0?_==0?0:1:l[0]==0&&l[2]==0?_==0?0:2:l[0]==0&&l[3]==0?_==0?0:3:l[1]==0&&l[2]==0?_==0?1:2:l[1]==0&&l[3]==0?_==0?1:3:_==0?2:3}else if(p==4&&f==0){var _=Math.floor(Math.random()*4);t=_}else t=m;t==0?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-u.DEFAULT_EDGE_LENGTH-r.getHeight()/2):t==1?r.setCenter(n.getCenterX()+n.getWidth()/2+u.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):t==2?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+u.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-u.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())}},e.exports=x}),991:((e,t,n)=>{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n=this.getChild().getNodes(),r,i=0;i<n.length;i++)r=n[i],r.getChild()==null?(r.displacementX+=e,r.displacementY+=t):r.propogateDisplacementToChildren(e,t)},a.prototype.move=function(){var e=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),e.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},a.prototype.setPred1=function(e){this.pred1=e},a.prototype.getPred1=function(){return pred1},a.prototype.getPred2=function(){return pred2},a.prototype.setNext=function(e){this.next=e},a.prototype.getNext=function(){return next},a.prototype.setProcessed=function(e){this.processed=e},a.prototype.isProcessed=function(){return processed},e.exports=a}),902:((e,t,n)=>{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}var i=n(806),a=n(551).LinkedList,o=n(551).Matrix,s=n(551).SVD;function c(){}c.handleConstraints=function(e){var t={};t.fixedNodeConstraint=e.constraints.fixedNodeConstraint,t.alignmentConstraint=e.constraints.alignmentConstraint,t.relativePlacementConstraint=e.constraints.relativePlacementConstraint;for(var n=new Map,c=new Map,l=[],u=[],d=e.getAllNodes(),f=0,p=0;p<d.length;p++){var m=d[p];m.getChild()??(c.set(m.id,f++),l.push(m.getCenterX()),u.push(m.getCenterY()),n.set(m.id,m))}t.relativePlacementConstraint&&t.relativePlacementConstraint.forEach(function(e){!e.gap&&e.gap!=0&&(e.left?e.gap=i.DEFAULT_EDGE_LENGTH+n.get(e.left).getWidth()/2+n.get(e.right).getWidth()/2:e.gap=i.DEFAULT_EDGE_LENGTH+n.get(e.top).getHeight()/2+n.get(e.bottom).getHeight()/2)});var h=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},g=function(e){var t=0,n=0;return e.forEach(function(e){t+=l[c.get(e)],n+=u[c.get(e)]}),{x:t/e.size,y:n/e.size}},_=function(e,t,n,i,o){function s(e,t){var n=new Set(e),r=!0,i=!1,a=void 0;try{for(var o=t[Symbol.iterator](),s;!(r=(s=o.next()).done);r=!0){var c=s.value;n.add(c)}}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}var d=new Map;e.forEach(function(e,t){d.set(t,0)}),e.forEach(function(e,t){e.forEach(function(e){d.set(e.id,d.get(e.id)+1)})});var f=new Map,p=new Map,m=new a;d.forEach(function(e,r){e==0?(m.push(r),n||(t==`horizontal`?f.set(r,c.has(r)?l[c.get(r)]:i.get(r)):f.set(r,c.has(r)?u[c.get(r)]:i.get(r)))):f.set(r,-1/0),n&&p.set(r,new Set([r]))}),n&&o.forEach(function(e){var r=[];if(e.forEach(function(e){n.has(e)&&r.push(e)}),r.length>0){var a=0;r.forEach(function(e){t==`horizontal`?(f.set(e,c.has(e)?l[c.get(e)]:i.get(e)),a+=f.get(e)):(f.set(e,c.has(e)?u[c.get(e)]:i.get(e)),a+=f.get(e))}),a/=r.length,e.forEach(function(e){n.has(e)||f.set(e,a)})}else{var o=0;e.forEach(function(e){t==`horizontal`?o+=c.has(e)?l[c.get(e)]:i.get(e):o+=c.has(e)?u[c.get(e)]:i.get(e)}),o/=e.length,e.forEach(function(e){f.set(e,o)})}});for(var h=function(){var r=m.shift();e.get(r).forEach(function(e){if(f.get(e.id)<f.get(r)+e.gap)if(n&&n.has(e.id)){var a=void 0;if(a=t==`horizontal`?c.has(e.id)?l[c.get(e.id)]:i.get(e.id):c.has(e.id)?u[c.get(e.id)]:i.get(e.id),f.set(e.id,a),a<f.get(r)+e.gap){var o=f.get(r)+e.gap-a;p.get(r).forEach(function(e){f.set(e,f.get(e)-o)})}}else f.set(e.id,f.get(r)+e.gap);d.set(e.id,d.get(e.id)-1),d.get(e.id)==0&&m.push(e.id),n&&p.set(e.id,s(p.get(r),p.get(e.id)))})};m.length!=0;)h();if(n){var g=new Set;e.forEach(function(e,t){e.length==0&&g.add(t)});var _=[];p.forEach(function(e,t){if(g.has(t)){var i=!1,a=!0,o=!1,s=void 0;try{for(var c=e[Symbol.iterator](),l;!(a=(l=c.next()).done);a=!0){var u=l.value;n.has(u)&&(i=!0)}}catch(e){o=!0,s=e}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}if(!i){var d=!1,f=void 0;_.forEach(function(t,n){t.has([].concat(r(e))[0])&&(d=!0,f=n)}),d?e.forEach(function(e){_[f].add(e)}):_.push(new Set(e))}}}),_.forEach(function(e,n){var r=1/0,a=1/0,o=-1/0,s=-1/0,d=!0,p=!1,m=void 0;try{for(var h=e[Symbol.iterator](),g;!(d=(g=h.next()).done);d=!0){var _=g.value,v=void 0;v=t==`horizontal`?c.has(_)?l[c.get(_)]:i.get(_):c.has(_)?u[c.get(_)]:i.get(_);var y=f.get(_);v<r&&(r=v),v>o&&(o=v),y<a&&(a=y),y>s&&(s=y)}}catch(e){p=!0,m=e}finally{try{!d&&h.return&&h.return()}finally{if(p)throw m}}var b=(r+o)/2-(a+s)/2,x=!0,S=!1,C=void 0;try{for(var w=e[Symbol.iterator](),T;!(x=(T=w.next()).done);x=!0){var E=T.value;f.set(E,f.get(E)+b)}}catch(e){S=!0,C=e}finally{try{!x&&w.return&&w.return()}finally{if(S)throw C}}})}return f},v=function(e){var t=0,n=0,r=0,i=0;if(e.forEach(function(e){e.left?l[c.get(e.left)]-l[c.get(e.right)]>=0?t++:n++:u[c.get(e.top)]-u[c.get(e.bottom)]>=0?r++:i++}),t>n&&r>i)for(var a=0;a<c.size;a++)l[a]=-1*l[a],u[a]=-1*u[a];else if(t>n)for(var o=0;o<c.size;o++)l[o]=-1*l[o];else if(r>i)for(var s=0;s<c.size;s++)u[s]=-1*u[s]},y=function(e){var t=[],n=new a,r=new Set,i=0;return e.forEach(function(a,o){if(!r.has(o)){t[i]=[];var s=o;for(n.push(s),r.add(s),t[i].push(s);n.length!=0;)s=n.shift(),e.get(s).forEach(function(e){r.has(e.id)||(n.push(e.id),r.add(e.id),t[i].push(e.id))});i++}}),t},b=function(e){var t=new Map;return e.forEach(function(e,n){t.set(n,[])}),e.forEach(function(e,n){e.forEach(function(e){t.get(n).push(e),t.get(e.id).push({id:n,gap:e.gap,direction:e.direction})})}),t},x=function(e){var t=new Map;return e.forEach(function(e,n){t.set(n,[])}),e.forEach(function(e,n){e.forEach(function(e){t.get(e.id).push({id:n,gap:e.gap,direction:e.direction})})}),t},S=[],C=[],w=!1,T=!1,E=new Set,D=new Map,O=new Map,k=[];if(t.fixedNodeConstraint&&t.fixedNodeConstraint.forEach(function(e){E.add(e.nodeId)}),t.relativePlacementConstraint&&(t.relativePlacementConstraint.forEach(function(e){e.left?(D.has(e.left)?D.get(e.left).push({id:e.right,gap:e.gap,direction:`horizontal`}):D.set(e.left,[{id:e.right,gap:e.gap,direction:`horizontal`}]),D.has(e.right)||D.set(e.right,[])):(D.has(e.top)?D.get(e.top).push({id:e.bottom,gap:e.gap,direction:`vertical`}):D.set(e.top,[{id:e.bottom,gap:e.gap,direction:`vertical`}]),D.has(e.bottom)||D.set(e.bottom,[]))}),O=b(D),k=y(O)),i.TRANSFORM_ON_CONSTRAINT_HANDLING){if(t.fixedNodeConstraint&&t.fixedNodeConstraint.length>1)t.fixedNodeConstraint.forEach(function(e,t){S[t]=[e.position.x,e.position.y],C[t]=[l[c.get(e.nodeId)],u[c.get(e.nodeId)]]}),w=!0;else if(t.alignmentConstraint)(function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach(function(e){i.add(e)});var a=new Set([].concat(r(i)).filter(function(e){return E.has(e)})),o=void 0;o=a.size>0?l[c.get(a.values().next().value)]:g(i).x,n[t].forEach(function(t){S[e]=[o,u[c.get(t)]],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},a=0;a<n.length;a++)i(a);w=!0}if(t.alignmentConstraint.horizontal){for(var o=t.alignmentConstraint.horizontal,s=function(t){var n=new Set;o[t].forEach(function(e){n.add(e)});var i=new Set([].concat(r(n)).filter(function(e){return E.has(e)})),a=void 0;a=i.size>0?l[c.get(i.values().next().value)]:g(n).y,o[t].forEach(function(t){S[e]=[l[c.get(t)],a],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},d=0;d<o.length;d++)s(d);w=!0}t.relativePlacementConstraint&&(T=!0)})();else if(t.relativePlacementConstraint){for(var A=0,j=0,M=0;M<k.length;M++)k[M].length>A&&(A=k[M].length,j=M);if(A<O.size/2)v(t.relativePlacementConstraint),w=!1,T=!1;else{var N=new Map,P=new Map,F=[];k[j].forEach(function(e){D.get(e).forEach(function(t){t.direction==`horizontal`?(N.has(e)?N.get(e).push(t):N.set(e,[t]),N.has(t.id)||N.set(t.id,[]),F.push({left:e,right:t.id})):(P.has(e)?P.get(e).push(t):P.set(e,[t]),P.has(t.id)||P.set(t.id,[]),F.push({top:e,bottom:t.id}))})}),v(F),T=!1;var I=_(N,`horizontal`),L=_(P,`vertical`);k[j].forEach(function(e,t){C[t]=[l[c.get(e)],u[c.get(e)]],S[t]=[],I.has(e)?S[t][0]=I.get(e):S[t][0]=l[c.get(e)],L.has(e)?S[t][1]=L.get(e):S[t][1]=u[c.get(e)]}),w=!0}}if(w){for(var R=void 0,z=o.transpose(S),B=o.transpose(C),V=0;V<z.length;V++)z[V]=o.multGamma(z[V]),B[V]=o.multGamma(B[V]);var ee=o.multMat(z,o.transpose(B)),te=s.svd(ee);R=o.multMat(te.V,o.transpose(te.U));for(var H=0;H<c.size;H++){var ne=[l[H],u[H]],re=[R[0][0],R[1][0]],U=[R[0][1],R[1][1]];l[H]=o.dotProduct(ne,re),u[H]=o.dotProduct(ne,U)}T&&v(t.relativePlacementConstraint)}}if(i.ENFORCE_CONSTRAINTS){if(t.fixedNodeConstraint&&t.fixedNodeConstraint.length>0){var W={x:0,y:0};t.fixedNodeConstraint.forEach(function(e,t){var n={x:l[c.get(e.nodeId)],y:u[c.get(e.nodeId)]},r=e.position,i=h(r,n);W.x+=i.x,W.y+=i.y}),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,l.forEach(function(e,t){l[t]+=W.x}),u.forEach(function(e,t){u[t]+=W.y}),t.fixedNodeConstraint.forEach(function(e){l[c.get(e.nodeId)]=e.position.x,u[c.get(e.nodeId)]=e.position.y})}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var G=t.alignmentConstraint.vertical,ie=function(e){var t=new Set;G[e].forEach(function(e){t.add(e)});var n=new Set([].concat(r(t)).filter(function(e){return E.has(e)})),i=void 0;i=n.size>0?l[c.get(n.values().next().value)]:g(t).x,t.forEach(function(e){E.has(e)||(l[c.get(e)]=i)})},K=0;K<G.length;K++)ie(K);if(t.alignmentConstraint.horizontal)for(var q=t.alignmentConstraint.horizontal,J=function(e){var t=new Set;q[e].forEach(function(e){t.add(e)});var n=new Set([].concat(r(t)).filter(function(e){return E.has(e)})),i=void 0;i=n.size>0?u[c.get(n.values().next().value)]:g(t).y,t.forEach(function(e){E.has(e)||(u[c.get(e)]=i)})},Y=0;Y<q.length;Y++)J(Y)}t.relativePlacementConstraint&&(function(){var e=new Map,n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=new Set,d=new Set;if(E.forEach(function(e){s.add(e),d.add(e)}),t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var f=t.alignmentConstraint.vertical,p=function(t){r.set(`dummy`+t,[]),f[t].forEach(function(n){e.set(n,`dummy`+t),r.get(`dummy`+t).push(n),E.has(n)&&s.add(`dummy`+t)}),a.set(`dummy`+t,l[c.get(f[t][0])])},m=0;m<f.length;m++)p(m);if(t.alignmentConstraint.horizontal)for(var h=t.alignmentConstraint.horizontal,g=function(e){i.set(`dummy`+e,[]),h[e].forEach(function(t){n.set(t,`dummy`+e),i.get(`dummy`+e).push(t),E.has(t)&&d.add(`dummy`+e)}),o.set(`dummy`+e,u[c.get(h[e][0])])},v=0;v<h.length;v++)g(v)}var S=new Map,C=new Map,w=function(t){D.get(t).forEach(function(r){var i=void 0,a=void 0;r.direction==`horizontal`?(i=e.get(t)?e.get(t):t,a=e.get(r.id)?{id:e.get(r.id),gap:r.gap,direction:r.direction}:r,S.has(i)?S.get(i).push(a):S.set(i,[a]),S.has(a.id)||S.set(a.id,[])):(i=n.get(t)?n.get(t):t,a=n.get(r.id)?{id:n.get(r.id),gap:r.gap,direction:r.direction}:r,C.has(i)?C.get(i).push(a):C.set(i,[a]),C.has(a.id)||C.set(a.id,[]))})},T=!0,O=!1,k=void 0;try{for(var A=D.keys()[Symbol.iterator](),j;!(T=(j=A.next()).done);T=!0){var M=j.value;w(M)}}catch(e){O=!0,k=e}finally{try{!T&&A.return&&A.return()}finally{if(O)throw k}}var N=b(S),P=b(C),F=y(N),I=y(P),L=x(S),R=x(C),z=[],B=[];F.forEach(function(e,t){z[t]=[],e.forEach(function(e){L.get(e).length==0&&z[t].push(e)})}),I.forEach(function(e,t){B[t]=[],e.forEach(function(e){R.get(e).length==0&&B[t].push(e)})});var V=_(S,`horizontal`,s,a,z),ee=_(C,`vertical`,d,o,B),te=function(e){r.get(e)?r.get(e).forEach(function(t){l[c.get(t)]=V.get(e)}):l[c.get(e)]=V.get(e)},H=!0,ne=!1,re=void 0;try{for(var U=V.keys()[Symbol.iterator](),W;!(H=(W=U.next()).done);H=!0){var G=W.value;te(G)}}catch(e){ne=!0,re=e}finally{try{!H&&U.return&&U.return()}finally{if(ne)throw re}}var ie=function(e){i.get(e)?i.get(e).forEach(function(t){u[c.get(t)]=ee.get(e)}):u[c.get(e)]=ee.get(e)},K=!0,q=!1,J=void 0;try{for(var Y=ee.keys()[Symbol.iterator](),X;!(K=(X=Y.next()).done);K=!0){var G=X.value;ie(G)}}catch(e){q=!0,J=e}finally{try{!K&&Y.return&&Y.return()}finally{if(q)throw J}}})()}for(var X=0;X<d.length;X++){var Z=d[X];Z.getChild()??Z.setCenter(l[c.get(Z.id)],u[c.get(Z.id)])}},e.exports=c}),551:(t=>{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(45)})()})})),k=i(r(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(O()):typeof define==`function`&&define.amd?define([`cose-base`],r):typeof e==`object`?e.cytoscapeFcose=r(O()):n.cytoscapeFcose=r(n.coseBase)})(e,function(e){return(()=>{var t={658:(e=>{e.exports=Object.assign==null?function(e){return[...arguments].slice(1).forEach(function(t){Object.keys(t).forEach(function(n){return e[n]=t[n]})}),e}:Object.assign.bind(Object)}),548:((e,t,n)=>{var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=n(140).layoutBase.LinkedList,a={};a.getTopMostNodes=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].id()]=!0;return e.filter(function(e,n){typeof e==`number`&&(e=n);for(var r=e.parent()[0];r!=null;){if(t[r.id()])return!1;r=r.parent()[0]}return!0})},a.connectComponents=function(e,t,n,r){var a=new i,o=new Set,s=[],c=void 0,l=void 0,u=void 0,d=!1,f=1,p=[],m=[],h=function(){var r=e.collection();m.push(r);var i=n[0],h=e.collection();h.merge(i).merge(i.descendants().intersection(t)),s.push(i),h.forEach(function(e){a.push(e),o.add(e),r.merge(e)});for(var g=function(){i=a.shift();var l=e.collection();i.neighborhood().nodes().forEach(function(e){t.intersection(i.edgesWith(e)).length>0&&l.merge(e)});for(var u=0;u<l.length;u++){var d=l[u];c=n.intersection(d.union(d.ancestors())),c!=null&&!o.has(c[0])&&c.union(c.descendants()).forEach(function(e){a.push(e),o.add(e),r.merge(e),n.has(e)&&s.push(e)})}};a.length!=0;)g();if(r.forEach(function(e){t.intersection(e.connectedEdges()).forEach(function(e){r.has(e.source())&&r.has(e.target())&&r.merge(e)})}),s.length==n.length&&(d=!0),!d||d&&f>1){l=s[0],u=l.connectedEdges().length,s.forEach(function(e){e.connectedEdges().length<u&&(u=e.connectedEdges().length,l=e)}),p.push(l.id());var _=e.collection();_.merge(s[0]),s.forEach(function(e){_.merge(e)}),s=[],n=n.difference(_),f++}};do h();while(!d);return r&&p.length>0&&r.set(`dummy`+(r.size+1),p),m},a.relocateComponent=function(e,t,n){if(!n.fixedNodeConstraint){var i=1/0,a=-1/0,o=1/0,s=-1/0;if(n.quality==`draft`){var c=!0,l=!1,u=void 0;try{for(var d=t.nodeIndexes[Symbol.iterator](),f;!(c=(f=d.next()).done);c=!0){var p=f.value,m=r(p,2),h=m[0],g=m[1],_=n.cy.getElementById(h);if(_){var v=_.boundingBox(),y=t.xCoords[g]-v.w/2,b=t.xCoords[g]+v.w/2,x=t.yCoords[g]-v.h/2,S=t.yCoords[g]+v.h/2;y<i&&(i=y),b>a&&(a=b),x<o&&(o=x),S>s&&(s=S)}}}catch(e){l=!0,u=e}finally{try{!c&&d.return&&d.return()}finally{if(l)throw u}}var C=e.x-(a+i)/2,w=e.y-(s+o)/2;t.xCoords=t.xCoords.map(function(e){return e+C}),t.yCoords=t.yCoords.map(function(e){return e+w})}else{Object.keys(t).forEach(function(e){var n=t[e],r=n.getRect().x,c=n.getRect().x+n.getRect().width,l=n.getRect().y,u=n.getRect().y+n.getRect().height;r<i&&(i=r),c>a&&(a=c),l<o&&(o=l),u>s&&(s=u)});var T=e.x-(a+i)/2,E=e.y-(s+o)/2;Object.keys(t).forEach(function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+E)})}}},a.calcBoundingBox=function(e,t,n,r){for(var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1),c=void 0,l=void 0,u=void 0,d=void 0,f=e.descendants().not(`:parent`),p=f.length,m=0;m<p;m++){var h=f[m];c=t[r.get(h.id())]-h.width()/2,l=t[r.get(h.id())]+h.width()/2,u=n[r.get(h.id())]-h.height()/2,d=n[r.get(h.id())]+h.height()/2,i>c&&(i=c),a<l&&(a=l),o>u&&(o=u),s<d&&(s=d)}var g={};return g.topLeftX=i,g.topLeftY=o,g.width=a-i,g.height=s-o,g},a.calcParentsWithoutChildren=function(e,t){var n=e.collection();return t.nodes(`:parent`).forEach(function(e){var t=!1;e.children().forEach(function(e){e.css(`display`)!=`none`&&(t=!0)}),t||n.merge(e)}),n},e.exports=a}),816:((e,t,n)=>{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,c=n(140).layoutBase.LayoutConstants,l=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,f=d.nodes(),p=d.edges(),m=void 0,h=void 0,g=void 0,_={};e.randomize&&(m=t.nodeIndexes,h=t.xCoords,g=t.yCoords);var v=function(e){return typeof e==`function`},y=function(e,t){return v(e)?e(t):e},b=r.calcParentsWithoutChildren(n,d),x=function e(t,n,i,c){for(var l=n.length,u=0;u<l;u++){var d=n[u],f=null;d.intersection(b).length==0&&(f=d.children());var p=void 0,v=d.layoutDimensions({nodeDimensionsIncludeLabels:c.nodeDimensionsIncludeLabels});if(d.outerWidth()!=null&&d.outerHeight()!=null)if(c.randomize)if(!d.isParent())p=t.add(new a(i.graphManager,new o(h[m.get(d.id())]-v.w/2,g[m.get(d.id())]-v.h/2),new s(parseFloat(v.w),parseFloat(v.h))));else{var x=r.calcBoundingBox(d,h,g,m);p=d.intersection(b).length==0?t.add(new a(i.graphManager,new o(x.topLeftX,x.topLeftY),new s(x.width,x.height))):t.add(new a(i.graphManager,new o(x.topLeftX,x.topLeftY),new s(parseFloat(v.w),parseFloat(v.h))))}else p=t.add(new a(i.graphManager,new o(d.position(`x`)-v.w/2,d.position(`y`)-v.h/2),new s(parseFloat(v.w),parseFloat(v.h))));else p=t.add(new a(this.graphManager));if(p.id=d.data(`id`),p.nodeRepulsion=y(c.nodeRepulsion,d),p.paddingLeft=parseInt(d.css(`padding`)),p.paddingTop=parseInt(d.css(`padding`)),p.paddingRight=parseInt(d.css(`padding`)),p.paddingBottom=parseInt(d.css(`padding`)),c.nodeDimensionsIncludeLabels&&(p.labelWidth=d.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,p.labelHeight=d.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,p.labelPosVertical=d.css(`text-valign`),p.labelPosHorizontal=d.css(`text-halign`)),_[d.data(`id`)]=p,isNaN(p.rect.x)&&(p.rect.x=0),isNaN(p.rect.y)&&(p.rect.y=0),f!=null&&f.length>0){var S=void 0;S=i.getGraphManager().add(i.newGraph(),p),e(S,f,i,c)}}},S=function(t,n,r){for(var i=0,a=0,o=0;o<r.length;o++){var s=r[o],c=_[s.data(`source`)],d=_[s.data(`target`)];if(c&&d&&c!==d&&c.getEdgesBetween(d).length==0){var f=n.add(t.newEdge(),c,d);f.id=s.id(),f.idealLength=y(e.idealEdgeLength,s),f.edgeElasticity=y(e.edgeElasticity,s),i+=f.idealLength,a++}}e.idealEdgeLength!=null&&(a>0?u.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=i/a:v(e.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,u.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH)},C=function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)};e.nestingFactor!=null&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(u.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(u.MAX_ITERATIONS=l.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.tilingCompareBy!=null&&(u.TILING_COMPARE_BY=e.tilingCompareBy),e.quality==`proof`?c.QUALITY=2:c.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!e.randomize,u.ANIMATE=l.ANIMATE=c.ANIMATE=e.animate,u.TILE=e.tile,u.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!e.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,e.step==`transformed`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),e.step==`enforced`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),e.step==`cose`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),e.step==`all`&&(e.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,T=w.newGraphManager();return x(T.addRoot(),r.getTopMostNodes(f),w,e),S(w,T,p),C(w,e),w.runLayout(),_}}}),212:((e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=n(658),o=n(548),s=n(657).spectralLayout,c=n(816).coseLayout,l=Object.freeze({quality:`default`,randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:`all`,samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(e){return 4500},idealEdgeLength:function(e){return 50},edgeElasticity:function(e){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}});e.exports=function(){function e(t){i(this,e),this.options=a({},l,t)}return r(e,[{key:`run`,value:function(){var e=this,t=this.options,n=t.cy,r=t.eles,i=[],a=[],l=void 0,u=[];t.fixedNodeConstraint&&(!Array.isArray(t.fixedNodeConstraint)||t.fixedNodeConstraint.length==0)&&(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(t.alignmentConstraint.vertical&&(!Array.isArray(t.alignmentConstraint.vertical)||t.alignmentConstraint.vertical.length==0)&&(t.alignmentConstraint.vertical=void 0),t.alignmentConstraint.horizontal&&(!Array.isArray(t.alignmentConstraint.horizontal)||t.alignmentConstraint.horizontal.length==0)&&(t.alignmentConstraint.horizontal=void 0)),t.relativePlacementConstraint&&(!Array.isArray(t.relativePlacementConstraint)||t.relativePlacementConstraint.length==0)&&(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var d=void 0,f=!1;if(n.layoutUtilities&&t.packComponents&&(d=n.layoutUtilities(`get`),d||=n.layoutUtilities(),f=!0),r.nodes().length>0)if(f){var p=o.getTopMostNodes(t.eles.nodes());if(l=o.connectComponents(n,t.eles,p),l.forEach(function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})}),t.randomize&&l.forEach(function(e){t.eles=e,i.push(s(t))}),t.quality=="default"||t.quality==`proof`){var m=n.collection();if(t.tile){var h=new Map,g=[],_=[],v=0,y={nodeIndexes:h,xCoords:g,yCoords:_},b=[];if(l.forEach(function(e,t){e.edges().length==0&&(e.nodes().forEach(function(t,n){m.merge(e.nodes()[n]),t.isParent()||(y.nodeIndexes.set(e.nodes()[n].id(),v++),y.xCoords.push(e.nodes()[0].position().x),y.yCoords.push(e.nodes()[0].position().y))}),b.push(t))}),m.length>1){var x=m.boundingBox();u.push({x:x.x1+x.w/2,y:x.y1+x.h/2}),l.push(m),i.push(y);for(var S=b.length-1;S>=0;S--)l.splice(b[S],1),i.splice(b[S],1),u.splice(b[S],1)}}l.forEach(function(e,n){t.eles=e,a.push(c(t,i[n])),o.relocateComponent(u[n],a[n],t)})}else l.forEach(function(e,n){o.relocateComponent(u[n],i[n],t)});var C=new Set;if(l.length>1){var w=[],T=r.filter(function(e){return e.css(`display`)==`none`});l.forEach(function(e,n){var r=void 0;if(t.quality==`draft`&&(r=i[n].nodeIndexes),e.nodes().not(T).length>0){var s={};s.edges=[],s.nodes=[];var c=void 0;e.nodes().not(T).forEach(function(e){if(t.quality==`draft`)if(!e.isParent())c=r.get(e.id()),s.nodes.push({x:i[n].xCoords[c]-e.boundingbox().w/2,y:i[n].yCoords[c]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else{var l=o.calcBoundingBox(e,i[n].xCoords,i[n].yCoords,r);s.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})}else a[n][e.id()]&&s.nodes.push({x:a[n][e.id()].getLeft(),y:a[n][e.id()].getTop(),width:a[n][e.id()].getWidth(),height:a[n][e.id()].getHeight()})}),e.edges().forEach(function(e){var c=e.source(),l=e.target();if(c.css(`display`)!=`none`&&l.css(`display`)!=`none`)if(t.quality==`draft`){var u=r.get(c.id()),d=r.get(l.id()),f=[],p=[];if(c.isParent()){var m=o.calcBoundingBox(c,i[n].xCoords,i[n].yCoords,r);f.push(m.topLeftX+m.width/2),f.push(m.topLeftY+m.height/2)}else f.push(i[n].xCoords[u]),f.push(i[n].yCoords[u]);if(l.isParent()){var h=o.calcBoundingBox(l,i[n].xCoords,i[n].yCoords,r);p.push(h.topLeftX+h.width/2),p.push(h.topLeftY+h.height/2)}else p.push(i[n].xCoords[d]),p.push(i[n].yCoords[d]);s.edges.push({startX:f[0],startY:f[1],endX:p[0],endY:p[1]})}else a[n][c.id()]&&a[n][l.id()]&&s.edges.push({startX:a[n][c.id()].getCenterX(),startY:a[n][c.id()].getCenterY(),endX:a[n][l.id()].getCenterX(),endY:a[n][l.id()].getCenterY()})}),s.nodes.length>0&&(w.push(s),C.add(n))}});var E=d.packComponents(w,t.randomize).shifts;if(t.quality==`draft`)i.forEach(function(e,t){var n=e.xCoords.map(function(e){return e+E[t].dx}),r=e.yCoords.map(function(e){return e+E[t].dy});e.xCoords=n,e.yCoords=r});else{var D=0;C.forEach(function(e){Object.keys(a[e]).forEach(function(t){var n=a[e][t];n.setCenter(n.getCenterX()+E[D].dx,n.getCenterY()+E[D].dy)}),D++})}}}else{var O=t.eles.boundingBox();if(u.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),t.randomize){var k=s(t);i.push(k)}t.quality=="default"||t.quality==`proof`?(a.push(c(t,i[0])),o.relocateComponent(u[0],a[0],t)):o.relocateComponent(u[0],i[0],t)}var A=function(e,n){if(t.quality=="default"||t.quality==`proof`){typeof e==`number`&&(e=n);var r=void 0,o=void 0,s=e.data(`id`);return a.forEach(function(e){s in e&&(r={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},o=e[s])}),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&(o.labelPosHorizontal==`left`?r.x+=o.labelWidth/2:o.labelPosHorizontal==`right`&&(r.x-=o.labelWidth/2)),o.labelHeight&&(o.labelPosVertical==`top`?r.y+=o.labelHeight/2:o.labelPosVertical==`bottom`&&(r.y-=o.labelHeight/2))),r??={x:e.position(`x`),y:e.position(`y`)},{x:r.x,y:r.y}}else{var c=void 0;return i.forEach(function(t){var n=t.nodeIndexes.get(e.id());n!=null&&(c={x:t.xCoords[n],y:t.yCoords[n]})}),c??={x:e.position(`x`),y:e.position(`y`)},{x:c.x,y:c.y}}};if(t.quality=="default"||t.quality==`proof`||t.randomize){var j=o.calcParentsWithoutChildren(n,r),M=r.filter(function(e){return e.css(`display`)==`none`});t.eles=r.not(M),r.nodes().not(`:parent`).not(M).layoutPositions(e,t,A),j.length>0&&j.forEach(function(e){e.position(A(e))})}else console.log(`If randomize option is set to false, then quality option must be 'default' or 'proof'.`)}}]),e}()}),657:((e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,o=n.nodes(),s=n.nodes(`:parent`),c=new Map,l=new Map,u=new Map,d=[],f=[],p=[],m=[],h=[],g=[],_=[],v=[],y=void 0,b=1e8,x=1e-9,S=e.piTol,C=e.samplingType,w=e.nodeSeparation,T=void 0,E=function(){for(var e=0,t=0,n=!1;t<T;){e=Math.floor(Math.random()*y),n=!1;for(var r=0;r<t;r++)if(m[r]==e){n=!0;break}if(!n)m[t]=e,t++;else continue}},D=function(e,t,n){for(var r=[],i=0,a=0,o=0,s=void 0,c=[],u=0,f=1,p=0;p<y;p++)c[p]=b;for(r[a]=e,c[e]=0;a>=i;){o=r[i++];for(var m=d[o],_=0;_<m.length;_++)s=l.get(m[_]),c[s]==b&&(c[s]=c[o]+1,r[++a]=s);g[o][t]=c[o]*w}if(n){for(var v=0;v<y;v++)g[v][t]<h[v]&&(h[v]=g[v][t]);for(var x=0;x<y;x++)h[x]>u&&(u=h[x],f=x)}return f},O=function(e){var t=void 0;if(e){t=Math.floor(Math.random()*y);for(var n=0;n<y;n++)h[n]=b;for(var r=0;r<T;r++)m[r]=t,t=D(t,r,e)}else{E();for(var i=0;i<T;i++)D(m[i],i,e,!1)}for(var a=0;a<y;a++)for(var o=0;o<T;o++)g[a][o]*=g[a][o];for(var s=0;s<T;s++)_[s]=[];for(var c=0;c<T;c++)for(var l=0;l<T;l++)_[c][l]=g[m[l]][c]},k=function(){for(var e=a.svd(_),t=e.S,n=e.U,r=e.V,o=t[0]*t[0]*t[0],s=[],c=0;c<T;c++){s[c]=[];for(var l=0;l<T;l++)s[c][l]=0,c==l&&(s[c][l]=t[c]/(t[c]*t[c]+o/(t[c]*t[c])))}v=i.multMat(i.multMat(r,s),i.transpose(n))},A=function(){for(var e=void 0,t=void 0,n=[],r=[],a=[],o=[],s=0;s<y;s++)n[s]=Math.random(),r[s]=Math.random();n=i.normalize(n),r=i.normalize(r);for(var c=0,l=x,u=x,d=void 0;;){c++;for(var m=0;m<y;m++)a[m]=n[m];if(n=i.multGamma(i.multL(i.multGamma(a),g,v)),e=i.dotProduct(a,n),n=i.normalize(n),l=i.dotProduct(a,n),d=Math.abs(l/u),d<=1+S&&d>=1)break;u=l}for(var h=0;h<y;h++)a[h]=n[h];for(c=0,u=x;;){c++;for(var _=0;_<y;_++)o[_]=r[_];if(o=i.minusOp(o,i.multCons(a,i.dotProduct(a,o))),r=i.multGamma(i.multL(i.multGamma(o),g,v)),t=i.dotProduct(o,r),r=i.normalize(r),l=i.dotProduct(o,r),d=Math.abs(l/u),d<=1+S&&d>=1)break;u=l}for(var b=0;b<y;b++)o[b]=r[b];f=i.multCons(a,Math.sqrt(Math.abs(e))),p=i.multCons(o,Math.sqrt(Math.abs(t)))};r.connectComponents(t,n,r.getTopMostNodes(o),c),s.forEach(function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),c)});for(var j=0,M=0;M<o.length;M++)o[M].isParent()||l.set(o[M].id(),j++);var N=!0,P=!1,F=void 0;try{for(var I=c.keys()[Symbol.iterator](),L;!(N=(L=I.next()).done);N=!0){var R=L.value;l.set(R,j++)}}catch(e){P=!0,F=e}finally{try{!N&&I.return&&I.return()}finally{if(P)throw F}}for(var z=0;z<l.size;z++)d[z]=[];s.forEach(function(e){for(var t=e.children().intersection(n);t.nodes(`:childless`).length==0;)t=t.nodes()[0].children().intersection(n);var r=0,i=t.nodes(`:childless`)[0].connectedEdges().length;t.nodes(`:childless`).forEach(function(e,t){e.connectedEdges().length<i&&(i=e.connectedEdges().length,r=t)}),u.set(e.id(),t.nodes(`:childless`)[r].id())}),o.forEach(function(e){var t=void 0;t=e.isParent()?l.get(u.get(e.id())):l.get(e.id()),e.neighborhood().nodes().forEach(function(r){n.intersection(e.edgesWith(r)).length>0&&(r.isParent()?d[t].push(u.get(r.id())):d[t].push(r.id()))})});var B=function(e){var n=l.get(e),r=void 0;c.get(e).forEach(function(i){r=t.getElementById(i).isParent()?u.get(i):i,d[n].push(r),d[l.get(r)].push(e)})},V=!0,ee=!1,te=void 0;try{for(var H=c.keys()[Symbol.iterator](),ne;!(V=(ne=H.next()).done);V=!0){var re=ne.value;B(re)}}catch(e){ee=!0,te=e}finally{try{!V&&H.return&&H.return()}finally{if(ee)throw te}}y=l.size;var U=void 0;if(y>2){T=y<e.sampleSize?y:e.sampleSize;for(var W=0;W<y;W++)g[W]=[];for(var G=0;G<T;G++)v[G]=[];return e.quality==`draft`||e.step==`all`?(O(C),k(),A(),U={nodeIndexes:l,xCoords:f,yCoords:p}):(l.forEach(function(e,n){f.push(t.getElementById(n).position(`x`)),p.push(t.getElementById(n).position(`y`))}),U={nodeIndexes:l,xCoords:f,yCoords:p}),U}else{var ie=l.keys(),K=t.getElementById(ie.next().value),q=K.position(),J=K.outerWidth();if(f.push(q.x),p.push(q.y),y==2){var Y=t.getElementById(ie.next().value).outerWidth();f.push(q.x+J/2+Y/2+e.idealEdgeLength),p.push(q.y)}return U={nodeIndexes:l,xCoords:f,yCoords:p},U}}}}),579:((e,t,n)=>{var r=n(212),i=function(e){e&&e(`layout`,`fcose`,r)};typeof cytoscape<`u`&&i(cytoscape),e.exports=i}),140:(t=>{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(579)})()})}))(),1),A={L:`left`,R:`right`,T:`top`,B:`bottom`},j={L:e(e=>`${e},${e/2} 0,${e} 0,0`,`L`),R:e(e=>`0,${e/2} ${e},0 ${e},${e}`,`R`),T:e(e=>`0,0 ${e},0 ${e/2},${e}`,`T`),B:e(e=>`${e/2},0 ${e},${e} 0,${e}`,`B`)},M={L:e((e,t)=>e-t+2,`L`),R:e((e,t)=>e-2,`R`),T:e((e,t)=>e-t+2,`T`),B:e((e,t)=>e-2,`B`)},N=e(function(e){return F(e)?e===`L`?`R`:`L`:e===`T`?`B`:`T`},`getOppositeArchitectureDirection`),P=e(function(e){let t=e;return t===`L`||t===`R`||t===`T`||t===`B`},`isArchitectureDirection`),F=e(function(e){let t=e;return t===`L`||t===`R`},`isArchitectureDirectionX`),I=e(function(e){let t=e;return t===`T`||t===`B`},`isArchitectureDirectionY`),L=e(function(e,t){let n=F(e)&&I(t),r=I(e)&&F(t);return n||r},`isArchitectureDirectionXY`),R=e(function(e){let t=e[0],n=e[1],r=F(t)&&I(n),i=I(t)&&F(n);return r||i},`isArchitecturePairXY`),z=e(function(e){return e!==`LL`&&e!==`RR`&&e!==`TT`&&e!==`BB`},`isValidArchitectureDirectionPair`),B=e(function(e,t){let n=`${e}${t}`;return z(n)?n:void 0},`getArchitectureDirectionPair`),V=e(function([e,t],n){let r=n[0],i=n[1];return F(r)?I(i)?[e+(r===`L`?-1:1),t+(i===`T`?1:-1)]:[e+(r===`L`?-1:1),t]:F(i)?[e+(i===`L`?1:-1),t+(r===`T`?1:-1)]:[e,t+(r===`T`?1:-1)]},`shiftPositionByArchitectureDirectionPair`),ee=e(function(e){return e===`LT`||e===`TL`?[1,1]:e===`BL`||e===`LB`?[1,-1]:e===`BR`||e===`RB`?[-1,-1]:[-1,1]},`getArchitectureDirectionXYFactors`),te=e(function(e,t){return L(e,t)?`bend`:F(e)?`horizontal`:`vertical`},`getArchitectureDirectionAlignment`),H=e(function(e){return e.type===`service`},`isArchitectureService`),ne=e(function(e){return e.type===`junction`},`isArchitectureJunction`),re=e(e=>e.data(),`edgeData`),U=e(e=>e.data(),`nodeData`),W=h.architecture,G=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId=``,this.setAccTitle=l,this.getAccTitle=o,this.setDiagramTitle=s,this.getDiagramTitle=_,this.getAccDescription=m,this.setAccDescription=p,this.clear()}static{e(this,`ArchitectureDB`)}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId=``,c()}addService({id:e,icon:t,in:n,title:r,iconText:i}){if(this.registeredIds[e]!==void 0)throw Error(`The service id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw Error(`The service [${e}] cannot be placed within itself`);if(this.registeredIds[n]===void 0)throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[n]===`node`)throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds[e]=`node`,this.nodes[e]={id:e,type:`service`,icon:t,iconText:i,title:r,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(H)}addJunction({id:e,in:t}){if(this.registeredIds[e]!==void 0)throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds[e]}`);if(t!==void 0){if(e===t)throw Error(`The junction [${e}] cannot be placed within itself`);if(this.registeredIds[t]===void 0)throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[t]===`node`)throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds[e]=`node`,this.nodes[e]={id:e,type:`junction`,edges:[],in:t}}getJunctions(){return Object.values(this.nodes).filter(ne)}getNodes(){return Object.values(this.nodes)}getNode(e){return this.nodes[e]??null}addGroup({id:e,icon:t,in:n,title:r}){if(this.registeredIds?.[e]!==void 0)throw Error(`The group id [${e}] is already in use by another ${this.registeredIds[e]}`);if(n!==void 0){if(e===n)throw Error(`The group [${e}] cannot be placed within itself`);if(this.registeredIds?.[n]===void 0)throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[n]===`node`)throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds[e]=`group`,this.groups[e]={id:e,icon:t,title:r,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:c}){if(!P(n))throw Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(n)}`);if(!P(r))throw Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(r)}`);if(this.nodes[e]===void 0&&this.groups[e]===void 0)throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[t]===void 0&&this.groups[t]===void 0)throw Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);let l=this.nodes[e].in,u=this.nodes[t].in;if(o&&l&&u&&l==u)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(s&&l&&u&&l==u)throw Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:c};this.edges.push(d),this.nodes[e]&&this.nodes[t]&&(this.nodes[e].edges.push(this.edges[this.edges.length-1]),this.nodes[t].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let t=new Set;e.members.forEach(n=>{if(this.registeredIds[n]!==`node`)throw Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(t.has(n))throw Error(`align ${e.direction} lists [${n}] more than once`);t.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let t={},n=Object.entries(this.nodes).reduce((e,[n,r])=>(e[n]=r.edges.reduce((e,r)=>{let i=this.getNode(r.lhsId)?.in,a=this.getNode(r.rhsId)?.in;if(i&&a&&i!==a){let e=te(r.lhsDir,r.rhsDir);e!==`bend`&&(t[i]??={},t[i][a]=e,t[a]??={},t[a][i]=e)}if(r.lhsId===n){let t=B(r.lhsDir,r.rhsDir);t&&(e[t]=r.rhsId)}else{let t=B(r.rhsDir,r.lhsDir);t&&(e[t]=r.lhsId)}return e},{}),e),{}),r=Object.keys(n)[0],i={[r]:1},a=Object.keys(n).reduce((e,t)=>t===r?e:{...e,[t]:1},{}),o=e(e=>{let t={[e]:[0,0]},r=[e];for(;r.length>0;){let e=r.shift();if(e){i[e]=1,delete a[e];let o=n[e],[s,c]=t[e];Object.entries(o).forEach(([e,n])=>{i[n]||(t[n]=V([s,c],e),r.push(n))})}}return t},`BFS`),s=[o(r)];for(;Object.keys(a).length>0;)s.push(o(Object.keys(a)[0]));this.dataStructures={adjList:n,spatialMaps:s,groupAlignments:t}}return this.dataStructures}setElementForId(e,t){this.elements[e]=t}getElementById(e){return this.elements[e]}getConfig(){return b({...W,...f().architecture})}getConfigField(e){return this.getConfig()[e]}},ie=e((e,t)=>{y(e,t),e.groups.map(e=>t.addGroup(e)),e.services.map(e=>t.addService({...e,type:`service`})),e.junctions.map(e=>t.addJunction({...e,type:`junction`})),e.edges.map(e=>t.addEdge(e)),e.alignments?.map(e=>t.addLayoutHint({direction:e.direction,members:[...e.members]}))},`populateDb`),K={parser:{yy:void 0},parse:e(async e=>{let t=await a(`architecture`,e);n.debug(t);let r=K.parser?.yy;if(!(r instanceof G))throw 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.`);ie(t,r)},`parse`)},q=e(e=>`
2
+ .edge {
3
+ stroke-width: ${e.archEdgeWidth};
4
+ stroke: ${e.archEdgeColor};
5
+ fill: none;
6
+ }
7
+
8
+ .arrow {
9
+ fill: ${e.archEdgeArrowColor};
10
+ }
11
+
12
+ .node-bkg {
13
+ fill: none;
14
+ stroke: ${e.archGroupBorderColor};
15
+ stroke-width: ${e.archGroupBorderWidth};
16
+ stroke-dasharray: 8;
17
+ }
18
+ .node-icon-text {
19
+ display: flex;
20
+ align-items: center;
21
+ }
22
+
23
+ .node-icon-text > div {
24
+ color: #fff;
25
+ margin: 1px;
26
+ height: fit-content;
27
+ text-align: center;
28
+ overflow: hidden;
29
+ display: -webkit-box;
30
+ -webkit-box-orient: vertical;
31
+ }
32
+ `,`getStyles`);function J(e,t){if(e===0)return t();let n=Math.random,r=e>>>0;Math.random=function(){r=r+1831565813>>>0;let e=r;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296};try{return t()}finally{Math.random=n}}e(J,`withSeededRandom`);var Y=e(e=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${e}</g>`,`wrapIcon`),X={prefix:`mermaid-architecture`,height:80,width:80,icons:{database:{body:Y(`<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;"/>`)},server:{body:Y(`<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>`)},disk:{body:Y(`<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;"/>`)},internet:{body:Y(`<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;"/>`)},cloud:{body:Y(`<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;"/>`)},unknown:w,blank:{body:Y(``)}}},Z=e(async function(e,t,n,r){let i=n.getConfigField(`padding`),a=n.getConfigField(`iconSize`),o=a/2,s=a/6,c=s/2;await Promise.all(t.edges().map(async t=>{let{source:a,sourceDir:l,sourceArrow:d,sourceGroup:f,target:p,targetDir:m,targetArrow:h,targetGroup:g,label:_}=re(t),{x:v,y}=t[0].sourceEndpoint(),{x:b,y:S}=t[0].midpoint(),{x:C,y:w}=t[0].targetEndpoint(),E=i+4;if(f&&(F(l)?v+=l===`L`?-E:E:y+=l===`T`?-E:E+18),g&&(F(m)?C+=m===`L`?-E:E:w+=m===`T`?-E:E+18),!f&&n.getNode(a)?.type===`junction`&&(F(l)?v+=l===`L`?o:-o:y+=l===`T`?o:-o),!g&&n.getNode(p)?.type===`junction`&&(F(m)?C+=m===`L`?o:-o:w+=m===`T`?o:-o),t[0]._private.rscratch){let t=e.insert(`g`);if(t.insert(`path`).attr(`d`,`M ${v},${y} L ${b},${S} L${C},${w} `).attr(`class`,`edge`).attr(`id`,`${r}-${x(a,p,{prefix:`L`})}`),d){let e=F(l)?M[l](v,s):v-c,n=I(l)?M[l](y,s):y-c;t.insert(`polygon`).attr(`points`,j[l](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(h){let e=F(m)?M[m](C,s):C-c,n=I(m)?M[m](w,s):w-c;t.insert(`polygon`).attr(`points`,j[m](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(_){let e=L(l,m)?`XY`:F(l)?`X`:`Y`,n=0;n=e===`X`?Math.abs(v-C):e===`Y`?Math.abs(y-w)/1.5:Math.abs(v-C)/2;let r=t.append(`g`);if(await T(r,_,{useHtmlLabels:!1,width:n,classes:`architecture-service-label`},u()),r.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e===`X`)r.attr(`transform`,`translate(`+b+`, `+S+`)`);else if(e===`Y`)r.attr(`transform`,`translate(`+b+`, `+S+`) rotate(-90)`);else if(e===`XY`){let e=B(l,m);if(e&&R(e)){let t=r.node().getBoundingClientRect(),[n,i]=ee(e);r.attr(`dominant-baseline`,`auto`).attr(`transform`,`rotate(${-1*n*i*45})`);let a=r.node().getBoundingClientRect();r.attr(`transform`,`
33
+ translate(${b}, ${S-t.height/2})
34
+ translate(${n*a.width/2}, ${i*a.height/2})
35
+ rotate(${-1*n*i*45}, 0, ${t.height/2})
36
+ `)}}}}}))},`drawEdges`),ae=e(async function(e,t,n,r){let i=n.getConfigField(`padding`)*.75,a=n.getConfigField(`fontSize`),o=n.getConfigField(`iconSize`)/2;await Promise.all(t.nodes().map(async t=>{let s=U(t);if(s.type===`group`){let{h:c,w:l,x1:d,y1:f}=t.boundingBox(),p=e.append(`rect`);p.attr(`id`,`${r}-group-${s.id}`).attr(`x`,d+o).attr(`y`,f+o).attr(`width`,l).attr(`height`,c).attr(`class`,`node-bkg`);let m=e.append(`g`),h=d,g=f;if(s.icon){let e=m.append(`g`);e.html(`<g>${await C(s.icon,{height:i,width:i,fallbackPrefix:X.prefix})}</g>`),e.attr(`transform`,`translate(`+(h+o+1)+`, `+(g+o+1)+`)`),h+=i,g+=a/2-1-2}if(s.label){let e=m.append(`g`);await T(e,s.label,{useHtmlLabels:!1,width:l,classes:`architecture-service-label`},u()),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`start`).attr(`text-anchor`,`start`),e.attr(`transform`,`translate(`+(h+o+4)+`, `+(g+o+2)+`)`)}n.setElementForId(s.id,p)}}))},`drawGroups`),Q=e(async function(e,t,n,r){let i=u();for(let a of n){let n=t.append(`g`),o=e.getConfigField(`iconSize`);if(a.title){let e=n.append(`g`);await T(e,a.title,{useHtmlLabels:!1,width:o*1.5,classes:`architecture-service-label`},i),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e.attr(`transform`,`translate(`+o/2+`, `+o+`)`)}let s=n.append(`g`);if(a.icon)s.html(`<g>${await C(a.icon,{height:o,width:o,fallbackPrefix:X.prefix})}</g>`);else if(a.iconText){s.html(`<g>${await C(`blank`,{height:o,width:o,fallbackPrefix:X.prefix})}</g>`);let e=s.append(`g`).append(`foreignObject`).attr(`width`,o).attr(`height`,o).append(`div`).attr(`class`,`node-icon-text`).attr(`style`,`height: ${o}px;`).append(`div`).html(g(a.iconText,i)),t=parseInt(window.getComputedStyle(e.node(),null).getPropertyValue(`font-size`).replace(/\D/g,``))??16;e.attr(`style`,`-webkit-line-clamp: ${Math.floor((o-2)/t)};`)}else s.append(`path`).attr(`class`,`node-bkg`).attr(`id`,`${r}-node-${a.id}`).attr(`d`,`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);n.attr(`id`,`${r}-service-${a.id}`).attr(`class`,`architecture-service`);let{width:c,height:l}=n.node().getBBox();a.width=c,a.height=l,e.setElementForId(a.id,n)}return 0},`drawServices`),oe=e(function(e,t,n,r){n.forEach(n=>{let i=t.append(`g`),a=e.getConfigField(`iconSize`);i.append(`g`).append(`rect`).attr(`id`,`${r}-node-${n.id}`).attr(`fill-opacity`,`0`).attr(`width`,a).attr(`height`,a),i.attr(`class`,`architecture-junction`);let{width:o,height:s}=i._groups[0][0].getBBox();i.width=o,i.height=s,e.setElementForId(n.id,i)})},`drawJunctions`);S([{name:X.prefix,icons:X}]),E.use(k.default);function se(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`service`,id:e.id,icon:e.icon,label:e.title,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-service`})})}e(se,`addServices`);function ce(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`junction`,id:e.id,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-junction`})})}e(ce,`addJunctions`);function le(e,t){t.nodes().map(t=>{let n=U(t);n.type!==`group`&&(n.x=t.position().x,n.y=t.position().y,e.getElementById(n.id).attr(`transform`,`translate(`+(n.x||0)+`,`+(n.y||0)+`)`))})}e(le,`positionNodes`);function ue(e,t){e.forEach(e=>{t.add({group:`nodes`,data:{type:`group`,id:e.id,icon:e.icon,label:e.title,parent:e.in},classes:`node-group`})})}e(ue,`addGroups`);function de(e,t){e.forEach(e=>{let{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:o,lhsDir:s,rhsDir:c,rhsGroup:l,title:u}=e,d=L(e.lhsDir,e.rhsDir)?`segments`:`straight`,f={id:`${n}-${r}`,label:u,source:n,sourceDir:s,sourceArrow:i,sourceGroup:a,sourceEndpoint:s===`L`?`0 50%`:s===`R`?`100% 50%`:s===`T`?`50% 0`:`50% 100%`,target:r,targetDir:c,targetArrow:o,targetGroup:l,targetEndpoint:c===`L`?`0 50%`:c===`R`?`100% 50%`:c===`T`?`50% 0`:`50% 100%`};t.add({group:`edges`,data:f,classes:d})})}e(de,`addEdges`);function fe(t,n,r,i=[]){let a=e((e,t)=>Object.entries(e).reduce((e,[n,i])=>{let a=0,o=Object.entries(i);if(o.length===1)return e[n]=o[0][1],e;for(let i=0;i<o.length-1;i++)for(let s=i+1;s<o.length;s++){let[c,l]=o[i],[u,d]=o[s];if(r[c]?.[u]===t)e[n]??=[],e[n]=[...e[n],...l,...d];else if(c==="default"||u==="default")e[n]??=[],e[n]=[...e[n],...l,...d];else{let t=`${n}-${a++}`;e[t]=l;let r=`${n}-${a++}`;e[r]=d}}return e},{}),`flattenAlignments`),[o,s]=n.map(e=>{let n={},r={};return Object.entries(e).forEach(([e,[i,a]])=>{let o=t.getNode(e)?.in??`default`;n[a]??={},n[a][o]??=[],n[a][o].push(e),r[i]??={},r[i][o]??=[],r[i][o].push(e)}),{horiz:Object.values(a(n,`horizontal`)).filter(e=>e.length>1),vert:Object.values(a(r,`vertical`)).filter(e=>e.length>1)}}).reduce(([e,t],{horiz:n,vert:r})=>[[...e,...n],[...t,...r]],[[],[]]),c=new Set;i.forEach(e=>e.members.forEach(e=>c.add(e)));let l=e(e=>e.filter(e=>!e.some(e=>c.has(e))),`dropOverlapping`),u=l(o),d=l(s);return i.forEach(e=>{e.members.length<2||(e.direction===`row`?u.push([...e.members]):d.push([...e.members]))}),{horizontal:u,vertical:d}}e(fe,`getAlignments`);function pe(t,n,r=[]){let i=[],a=n.getConfigField(`iconSize`),o=n.getConfigField(`idealEdgeLengthMultiplier`),s=o*a,c=new Set;r.forEach(e=>{for(let t=0;t<e.members.length-1;t++){let n=e.members[t],r=e.members[t+1];c.add(`${n}|${r}`),c.add(`${r}|${n}`),e.direction===`row`?i.push({left:n,right:r,gap:s}):i.push({top:n,bottom:r,gap:s})}});let l=e(e=>`${e[0]},${e[1]}`,`posToStr`),u=e(e=>e.split(`,`).map(e=>parseInt(e)),`strToPos`);return t.forEach(e=>{let t=Object.fromEntries(Object.entries(e).map(([e,t])=>[l(t),e])),n=[l([0,0])],r={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){let e=n.shift();if(e){r[e]=1;let d=t[e];if(d){let f=u(e);Object.entries(s).forEach(([e,s])=>{let u=l([f[0]+s[0],f[1]+s[1]]),p=t[u];if(p&&!r[u]){if(n.push(u),c.has(`${d}|${p}`))return;i.push({[A[e]]:p,[A[N(e)]]:d,gap:o*a})}})}}}}),i}e(pe,`getRelativeConstraints`);function me(r,i,a,o,s,{spatialMaps:c,groupAlignments:l}){return new Promise(u=>{let d=t(`body`).append(`div`).attr(`id`,`cy`).attr(`style`,`display:none`),f=E({container:document.getElementById(`cy`),style:[{selector:`edge`,style:{"curve-style":`straight`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`edge[label]`,style:{label:`data(label)`}},{selector:`edge.segments`,style:{"curve-style":`segments`,"segment-weights":`0`,"segment-distances":[.5],"edge-distances":`endpoints`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`node`,style:{"compound-sizing-wrt-labels":`include`}},{selector:`node[label]`,style:{"text-valign":`bottom`,"text-halign":`center`,"font-size":`${s.getConfigField(`fontSize`)}px`}},{selector:`.node-service`,style:{label:`data(label)`,width:`data(width)`,height:`data(height)`}},{selector:`.node-junction`,style:{width:`data(width)`,height:`data(height)`}},{selector:`.node-group`,style:{padding:`${s.getConfigField(`padding`)}px`}}],layout:{name:`grid`,boundingBox:{x1:0,x2:100,y1:0,y2:100}}});d.remove(),ue(a,f),se(r,f,s),ce(i,f,s),de(o,f);let p=s.getLayoutHints(),m=fe(s,c,l,p),h=pe(c,s,p),g=s.getConfigField(`iconSize`),_=s.getConfigField(`idealEdgeLengthMultiplier`)*g,v=.5*g,y=s.getConfigField(`edgeElasticity`),b=s.getConfigField(`seed`),x=f.layout({name:`fcose`,quality:`proof`,randomize:s.getConfigField(`randomize`),nodeSeparation:s.getConfigField(`nodeSeparation`),numIter:s.getConfigField(`numIter`),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(e){let[t,n]=e.connectedNodes(),{parent:r}=U(t),{parent:i}=U(n);return r===i?_:v},edgeElasticity(e){let[t,n]=e.connectedNodes(),{parent:r}=U(t),{parent:i}=U(n);return r===i?y:.001},alignmentConstraint:m,relativePlacementConstraint:h});x.one(`layoutstop`,()=>{function t(e,t,n,r){let i,a,{x:o,y:s}=e,{x:c,y:l}=t;a=(r-s+(o-n)*(s-l)/(o-c))/Math.sqrt(1+((s-l)/(o-c))**2),i=Math.sqrt((r-s)**2+(n-o)**2-a**2);let u=Math.sqrt((c-o)**2+(l-s)**2);i/=u;let d=(c-o)*(r-s)-(l-s)*(n-o);switch(!0){case d>=0:d=1;break;case d<0:d=-1;break}let f=(c-o)*(n-o)+(l-s)*(r-s);switch(!0){case f>=0:f=1;break;case f<0:f=-1;break}return a=Math.abs(a)*d,i*=f,{distances:a,weights:i}}e(t,`getSegmentWeights`),f.startBatch();for(let e of Object.values(f.edges()))if(e.data?.()){let{x:n,y:r}=e.source().position(),{x:i,y:a}=e.target().position();if(n!==i&&r!==a){let n=e.sourceEndpoint(),r=e.targetEndpoint(),{sourceDir:i}=re(e),[a,o]=I(i)?[n.x,r.y]:[r.x,n.y],{weights:s,distances:c}=t(n,r,a,o);e.style(`segment-distances`,c),e.style(`segment-weights`,s)}}f.endBatch(),J(b,()=>x.run())});try{J(b,()=>x.run())}catch(e){throw e instanceof RangeError&&e.message.includes(`Invalid array length`)?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."):e}f.ready(e=>{n.info(`Ready`,e),u(f)})})}e(me,`layoutArchitecture`);var he={parser:K,get db(){return new G},renderer:{draw:e(async(e,t,n,r)=>{let i=r.db;i.setDiagramId(t);let a=i.getServices(),o=i.getJunctions(),s=i.getGroups(),c=i.getEdges(),l=i.getDataStructures(),u=v(t),f=u.append(`g`);f.attr(`class`,`architecture-edges`);let p=u.append(`g`);p.attr(`class`,`architecture-services`);let m=u.append(`g`);m.attr(`class`,`architecture-groups`),await Q(i,p,a,t),oe(i,p,o,t);let h=await me(a,o,s,c,i,l);await Z(f,h,i,t),await ae(m,h,i,t),le(i,h),d(void 0,u,i.getConfigField(`padding`),i.getConfigField(`useMaxWidth`))},`draw`)},styles:q};export{he as diagram};