gitnexus 1.6.5-rc.2 → 1.6.5-rc.21

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 (288) hide show
  1. package/README.md +1 -1
  2. package/dist/_shared/scope-resolution/method-dispatch-index.d.ts +26 -0
  3. package/dist/_shared/scope-resolution/method-dispatch-index.d.ts.map +1 -1
  4. package/dist/_shared/scope-resolution/method-dispatch-index.js +22 -3
  5. package/dist/_shared/scope-resolution/method-dispatch-index.js.map +1 -1
  6. package/dist/_shared/scope-resolution/registries/lookup-core.js +18 -1
  7. package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -1
  8. package/dist/cli/ai-context.d.ts +1 -0
  9. package/dist/cli/ai-context.js +30 -12
  10. package/dist/cli/analyze.d.ts +18 -0
  11. package/dist/cli/analyze.js +33 -4
  12. package/dist/cli/augment.d.ts +1 -1
  13. package/dist/cli/augment.js +1 -1
  14. package/dist/cli/index.js +6 -1
  15. package/dist/cli/setup.js +6 -0
  16. package/dist/core/augmentation/engine.d.ts +2 -2
  17. package/dist/core/augmentation/engine.js +26 -6
  18. package/dist/core/embeddings/ast-utils.js +2 -1
  19. package/dist/core/embeddings/http-client.js +22 -6
  20. package/dist/core/group/extractors/grpc-extractor.js +2 -1
  21. package/dist/core/group/extractors/http-patterns/python.js +175 -0
  22. package/dist/core/group/extractors/http-route-extractor.js +2 -1
  23. package/dist/core/group/extractors/include-extractor.js +2 -1
  24. package/dist/core/group/extractors/thrift-extractor.js +2 -1
  25. package/dist/core/group/extractors/tree-sitter-scanner.js +2 -1
  26. package/dist/core/incremental/shadow-candidates.d.ts +44 -0
  27. package/dist/core/incremental/shadow-candidates.js +74 -0
  28. package/dist/core/incremental/subgraph-extract.d.ts +64 -0
  29. package/dist/core/incremental/subgraph-extract.js +111 -0
  30. package/dist/core/ingestion/call-processor.js +166 -47
  31. package/dist/core/ingestion/community-processor.js +18 -0
  32. package/dist/core/ingestion/heritage-processor.js +3 -2
  33. package/dist/core/ingestion/import-processor.js +2 -1
  34. package/dist/core/ingestion/import-resolvers/standard.d.ts +5 -0
  35. package/dist/core/ingestion/import-resolvers/standard.js +27 -1
  36. package/dist/core/ingestion/import-resolvers/utils.js +4 -0
  37. package/dist/core/ingestion/languages/c/arity-metadata.d.ts +14 -0
  38. package/dist/core/ingestion/languages/c/arity-metadata.js +94 -0
  39. package/dist/core/ingestion/languages/c/arity.d.ts +6 -0
  40. package/dist/core/ingestion/languages/c/arity.js +18 -0
  41. package/dist/core/ingestion/languages/c/captures.d.ts +2 -0
  42. package/dist/core/ingestion/languages/c/captures.js +105 -0
  43. package/dist/core/ingestion/languages/c/header-scan.d.ts +7 -0
  44. package/dist/core/ingestion/languages/c/header-scan.js +55 -0
  45. package/dist/core/ingestion/languages/c/import-decomposer.d.ts +8 -0
  46. package/dist/core/ingestion/languages/c/import-decomposer.js +50 -0
  47. package/dist/core/ingestion/languages/c/import-target.d.ts +14 -0
  48. package/dist/core/ingestion/languages/c/import-target.js +57 -0
  49. package/dist/core/ingestion/languages/c/index.d.ts +11 -0
  50. package/dist/core/ingestion/languages/c/index.js +11 -0
  51. package/dist/core/ingestion/languages/c/interpret.d.ts +14 -0
  52. package/dist/core/ingestion/languages/c/interpret.js +48 -0
  53. package/dist/core/ingestion/languages/c/merge-bindings.d.ts +7 -0
  54. package/dist/core/ingestion/languages/c/merge-bindings.js +23 -0
  55. package/dist/core/ingestion/languages/c/query.d.ts +3 -0
  56. package/dist/core/ingestion/languages/c/query.js +161 -0
  57. package/dist/core/ingestion/languages/c/scope-resolver.d.ts +13 -0
  58. package/dist/core/ingestion/languages/c/scope-resolver.js +60 -0
  59. package/dist/core/ingestion/languages/c/simple-hooks.d.ts +14 -0
  60. package/dist/core/ingestion/languages/c/simple-hooks.js +19 -0
  61. package/dist/core/ingestion/languages/c/static-linkage.d.ts +13 -0
  62. package/dist/core/ingestion/languages/c/static-linkage.js +57 -0
  63. package/dist/core/ingestion/languages/c-cpp.js +10 -0
  64. package/dist/core/ingestion/languages/csharp/captures.js +2 -1
  65. package/dist/core/ingestion/languages/csharp/namespace-siblings.js +3 -2
  66. package/dist/core/ingestion/languages/go/captures.js +2 -1
  67. package/dist/core/ingestion/languages/go/range-binding.js +2 -1
  68. package/dist/core/ingestion/languages/java/arity-metadata.d.ts +18 -0
  69. package/dist/core/ingestion/languages/java/arity-metadata.js +40 -0
  70. package/dist/core/ingestion/languages/java/arity.d.ts +10 -0
  71. package/dist/core/ingestion/languages/java/arity.js +24 -0
  72. package/dist/core/ingestion/languages/java/cache-stats.d.ts +15 -0
  73. package/dist/core/ingestion/languages/java/cache-stats.js +26 -0
  74. package/dist/core/ingestion/languages/java/captures.d.ts +17 -0
  75. package/dist/core/ingestion/languages/java/captures.js +187 -0
  76. package/dist/core/ingestion/languages/java/import-decomposer.d.ts +18 -0
  77. package/dist/core/ingestion/languages/java/import-decomposer.js +85 -0
  78. package/dist/core/ingestion/languages/java/import-target.d.ts +17 -0
  79. package/dist/core/ingestion/languages/java/import-target.js +100 -0
  80. package/dist/core/ingestion/languages/java/index.d.ts +29 -0
  81. package/dist/core/ingestion/languages/java/index.js +29 -0
  82. package/dist/core/ingestion/languages/java/interpret.d.ts +13 -0
  83. package/dist/core/ingestion/languages/java/interpret.js +131 -0
  84. package/dist/core/ingestion/languages/java/merge-bindings.d.ts +12 -0
  85. package/dist/core/ingestion/languages/java/merge-bindings.js +40 -0
  86. package/dist/core/ingestion/languages/java/query.d.ts +30 -0
  87. package/dist/core/ingestion/languages/java/query.js +192 -0
  88. package/dist/core/ingestion/languages/java/receiver-binding.d.ts +11 -0
  89. package/dist/core/ingestion/languages/java/receiver-binding.js +95 -0
  90. package/dist/core/ingestion/languages/java/scope-resolver.d.ts +50 -0
  91. package/dist/core/ingestion/languages/java/scope-resolver.js +74 -0
  92. package/dist/core/ingestion/languages/java/simple-hooks.d.ts +13 -0
  93. package/dist/core/ingestion/languages/java/simple-hooks.js +34 -0
  94. package/dist/core/ingestion/languages/java.js +11 -0
  95. package/dist/core/ingestion/languages/php/arity-metadata.d.ts +28 -0
  96. package/dist/core/ingestion/languages/php/arity-metadata.js +63 -0
  97. package/dist/core/ingestion/languages/php/arity.d.ts +25 -0
  98. package/dist/core/ingestion/languages/php/arity.js +40 -0
  99. package/dist/core/ingestion/languages/php/cache-stats.d.ts +15 -0
  100. package/dist/core/ingestion/languages/php/cache-stats.js +26 -0
  101. package/dist/core/ingestion/languages/php/captures.d.ts +34 -0
  102. package/dist/core/ingestion/languages/php/captures.js +739 -0
  103. package/dist/core/ingestion/languages/php/import-decomposer.d.ts +28 -0
  104. package/dist/core/ingestion/languages/php/import-decomposer.js +265 -0
  105. package/dist/core/ingestion/languages/php/import-target.d.ts +47 -0
  106. package/dist/core/ingestion/languages/php/import-target.js +100 -0
  107. package/dist/core/ingestion/languages/php/index.d.ts +68 -0
  108. package/dist/core/ingestion/languages/php/index.js +72 -0
  109. package/dist/core/ingestion/languages/php/interpret.d.ts +36 -0
  110. package/dist/core/ingestion/languages/php/interpret.js +241 -0
  111. package/dist/core/ingestion/languages/php/merge-bindings.d.ts +19 -0
  112. package/dist/core/ingestion/languages/php/merge-bindings.js +47 -0
  113. package/dist/core/ingestion/languages/php/namespace-siblings.d.ts +51 -0
  114. package/dist/core/ingestion/languages/php/namespace-siblings.js +288 -0
  115. package/dist/core/ingestion/languages/php/query.d.ts +32 -0
  116. package/dist/core/ingestion/languages/php/query.js +326 -0
  117. package/dist/core/ingestion/languages/php/receiver-binding.d.ts +36 -0
  118. package/dist/core/ingestion/languages/php/receiver-binding.js +128 -0
  119. package/dist/core/ingestion/languages/php/scope-resolver.d.ts +23 -0
  120. package/dist/core/ingestion/languages/php/scope-resolver.js +358 -0
  121. package/dist/core/ingestion/languages/php/simple-hooks.d.ts +42 -0
  122. package/dist/core/ingestion/languages/php/simple-hooks.js +111 -0
  123. package/dist/core/ingestion/languages/php.d.ts +0 -7
  124. package/dist/core/ingestion/languages/php.js +15 -0
  125. package/dist/core/ingestion/languages/python/captures.js +2 -1
  126. package/dist/core/ingestion/languages/typescript/captures.js +2 -1
  127. package/dist/core/ingestion/parsing-processor.d.ts +22 -2
  128. package/dist/core/ingestion/parsing-processor.js +85 -50
  129. package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +5 -0
  130. package/dist/core/ingestion/pipeline-phases/parse-impl.js +119 -11
  131. package/dist/core/ingestion/pipeline-phases/parse.d.ts +14 -0
  132. package/dist/core/ingestion/pipeline.d.ts +13 -0
  133. package/dist/core/ingestion/registry-primary-flag.js +2 -0
  134. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +65 -0
  135. package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.d.ts +1 -1
  136. package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +12 -2
  137. package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +5 -0
  138. package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +25 -1
  139. package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +79 -7
  140. package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +7 -3
  141. package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +24 -4
  142. package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +21 -2
  143. package/dist/core/ingestion/scope-resolution/pipeline/phase.js +13 -1
  144. package/dist/core/ingestion/scope-resolution/pipeline/registry.js +6 -0
  145. package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +17 -0
  146. package/dist/core/ingestion/scope-resolution/pipeline/run.js +31 -7
  147. package/dist/core/ingestion/tree-sitter-queries.d.ts +1 -1
  148. package/dist/core/ingestion/tree-sitter-queries.js +10 -0
  149. package/dist/core/ingestion/workers/parse-worker.js +2 -1
  150. package/dist/core/lbug/lbug-adapter.d.ts +26 -0
  151. package/dist/core/lbug/lbug-adapter.js +174 -40
  152. package/dist/core/lbug/pool-adapter.js +19 -2
  153. package/dist/core/run-analyze.d.ts +2 -0
  154. package/dist/core/run-analyze.js +323 -29
  155. package/dist/core/tree-sitter/safe-parse.d.ts +6 -0
  156. package/dist/core/tree-sitter/safe-parse.js +32 -0
  157. package/dist/server/git-clone.js +10 -13
  158. package/dist/storage/file-hash.d.ts +47 -0
  159. package/dist/storage/file-hash.js +86 -0
  160. package/dist/storage/git.d.ts +17 -6
  161. package/dist/storage/git.js +46 -12
  162. package/dist/storage/parse-cache.d.ts +67 -0
  163. package/dist/storage/parse-cache.js +182 -0
  164. package/dist/storage/repo-manager.d.ts +41 -1
  165. package/dist/storage/repo-manager.js +17 -2
  166. package/hooks/claude/gitnexus-hook.cjs +8 -1
  167. package/hooks/claude/hook-lock.cjs +119 -0
  168. package/package.json +1 -1
  169. package/web/assets/{agent-BpHQleHE.js → agent-BG6RCOzz.js} +1 -1
  170. package/web/assets/architecture-7EHR7CIX-6QZW5X65-F-tujre-.js +1 -0
  171. package/web/assets/architectureDiagram-UL44E2DR-2GL7nOvO.js +36 -0
  172. package/web/assets/blockDiagram-7IZFK4PR-5AjX0pPU.js +132 -0
  173. package/web/assets/{c4Diagram-DFAF54RM-DeJV1rCn.js → c4Diagram-Y2BXMSZH-hLOeq7xC.js} +2 -2
  174. package/web/assets/chunk-2T2R6R2M-B_pq_2nf.js +4 -0
  175. package/web/assets/chunk-2UTLFMKG-CpoohCFN.js +1 -0
  176. package/web/assets/{chunk-7RZVMHOQ-BdIU-RGO.js → chunk-3SSMPTDK-CfqpR3Nr.js} +1 -1
  177. package/web/assets/chunk-4R4BOZG6-D3gm7tYj.js +159 -0
  178. package/web/assets/chunk-6764PJDD-WcI965eO.js +1 -0
  179. package/web/assets/chunk-AQ6EADP3-BpMj3rQl.js +1 -0
  180. package/web/assets/{chunk-KSICW3F5-C2tZmXwv.js → chunk-AZZRMDJM-DSoCJlUA.js} +1 -1
  181. package/web/assets/chunk-C62D2QBJ-CvFF2PnB.js +1 -0
  182. package/web/assets/chunk-CEXFNPSA-DdNtJtrF.js +1 -0
  183. package/web/assets/chunk-J5EP6P6S-DtcVaAJI.js +1 -0
  184. package/web/assets/{chunk-AEOMTBSW-D7qjBMHW.js → chunk-JQRUD6KW-DElaNjc0.js} +1 -1
  185. package/web/assets/chunk-KGYTTC2M-D0K5or7e.js +1 -0
  186. package/web/assets/chunk-KRXBNO2N-DpR8iDt8.js +1 -0
  187. package/web/assets/chunk-LCXTWHL2-DdMObOEk.js +231 -0
  188. package/web/assets/chunk-LII3EMHJ-I78zXtzi.js +1 -0
  189. package/web/assets/chunk-RERM46MO-Betu1cSy.js +1 -0
  190. package/web/assets/chunk-RG4AUYOV-BUCJ2JP5.js +206 -0
  191. package/web/assets/chunk-RKZBBQEN-Cutpza0t.js +1 -0
  192. package/web/assets/chunk-RLI5ZMPA-BFUxCvX2.js +1 -0
  193. package/web/assets/chunk-T5OCTHI4-DKwlkuvB.js +1 -0
  194. package/web/assets/chunk-UP6H54XL-0YWa0NDg.js +1 -0
  195. package/web/assets/chunk-UXSXWOXI-CSz0OXpz.js +1 -0
  196. package/web/assets/chunk-W44A43WB-AOmgoT-X.js +1 -0
  197. package/web/assets/{chunk-RWUO3TPN-DTWzAhQ1.js → chunk-ZXARS5L4-DIzgxjMw.js} +1 -1
  198. package/web/assets/classDiagram-KGZ6W3CR-BT-rn7LF.js +1 -0
  199. package/web/assets/classDiagram-v2-72OJOZXJ-uR3nDadY.js +1 -0
  200. package/web/assets/{cose-bilkent-PNC4W37J-DdZq7Qz_.js → cose-bilkent-UX7MHV2Q-DCSCD1TK.js} +1 -1
  201. package/web/assets/dagre-ND4H6XIP-CsciHSij.js +4 -0
  202. package/web/assets/diagram-3NCE3AQN-BKUT5Rpc.js +43 -0
  203. package/web/assets/diagram-GF46GFSD-Dxb4hZSo.js +24 -0
  204. package/web/assets/diagram-HNR7UZ2L-D3qus9Cn.js +3 -0
  205. package/web/assets/diagram-QXG6HAR7-r9BMLGGP.js +24 -0
  206. package/web/assets/diagram-WEQXMOUZ-BGXqs7-m.js +10 -0
  207. package/web/assets/{erDiagram-GCSMX5X6-DfdN6iqF.js → erDiagram-L5TCEMPS-LgSWVrkZ.js} +2 -2
  208. package/web/assets/eventmodeling-FCH6USID-MREXMVOE-By7r3bla.js +1 -0
  209. package/web/assets/flowDiagram-H6V6AXG4-Bj_vV5ky.js +162 -0
  210. package/web/assets/ganttDiagram-JCBTUEKG-B1eVITSh.js +292 -0
  211. package/web/assets/gitGraph-WXDBUCRP-R675I2BI-ClEP6RdE.js +1 -0
  212. package/web/assets/gitGraphDiagram-S2ZK5IYY-BP0R-_FD.js +106 -0
  213. package/web/assets/{index-3NUCUW2s.js → index-oL-ZNYwb.js} +80 -81
  214. package/web/assets/info-J43DQDTF-KCYPFFUO-bBJRjmP5.js +1 -0
  215. package/web/assets/infoDiagram-3YFTVSEB-Dmj4OEO3.js +2 -0
  216. package/web/assets/{ishikawaDiagram-YMYX4NHK-BF8AtDaj.js → ishikawaDiagram-BNXS4ZKH-B3NgQ4lJ.js} +2 -2
  217. package/web/assets/{journeyDiagram-SO5T7YLQ-BW8oKa3N.js → journeyDiagram-M6C3CM3L-DALmL4_N.js} +3 -3
  218. package/web/assets/{kanban-definition-LJHFXRCJ-DzbOsR-2.js → kanban-definition-75IXJCU3-AvVbHpnN.js} +4 -4
  219. package/web/assets/{katex-GD7MH7QM-CJiOjBBJ.js → katex-K3KEBU37-CqF6_ZN-.js} +1 -1
  220. package/web/assets/{mindmap-definition-2EUWGEK5-BIXGQALq.js → mindmap-definition-2TDM6QVE-B5c9VOzs.js} +28 -28
  221. package/web/assets/packet-YPE3B663-LP52Z2RK-1ZCldnu3.js +1 -0
  222. package/web/assets/pie-LRSECV5Y-TCRJHUBD-EhjHC5EE.js +1 -0
  223. package/web/assets/pieDiagram-CU6KROY3-Po2HSSR4.js +30 -0
  224. package/web/assets/quadrantDiagram-VICAPDV7-C47UxSZD.js +7 -0
  225. package/web/assets/radar-GUYGQ44K-RDLRG3WG-CvXjgxlW.js +1 -0
  226. package/web/assets/{requirementDiagram-M5DCFWZL-CzUUrhQD.js → requirementDiagram-JXO7QTGE-CpECN_Hq.js} +6 -6
  227. package/web/assets/sankeyDiagram-URQDO5SZ-B3b7cLrS.js +40 -0
  228. package/web/assets/sequenceDiagram-VS2MUI6T-CRJ95oVP.js +162 -0
  229. package/web/assets/stateDiagram-7D4R322I-C7U9b3ks.js +1 -0
  230. package/web/assets/stateDiagram-v2-36443NZ5-BQajbtov.js +1 -0
  231. package/web/assets/{timeline-definition-5SPVSISX-DkMiGj4Z.js → timeline-definition-O6YCAMPW-rtbk6BBo.js} +4 -4
  232. package/web/assets/treeView-BLDUP644-QA4HXRO3-R2o5gwfP.js +1 -0
  233. package/web/assets/treemap-LRROVOQU-LLAWBHMP-Cesmac_u.js +1 -0
  234. package/web/assets/{vennDiagram-IE5QUKF5-BCxMmf9q.js → vennDiagram-MWXL3ELB-W8Yoaayh.js} +3 -3
  235. package/web/assets/wardley-L42UT6IY-5TKZOOLJ-B9HYoRgA.js +1 -0
  236. package/web/assets/wardleyDiagram-CUQ6CDDI-DIZw5Abj.js +78 -0
  237. package/web/assets/{xychartDiagram-ZHJ5623Y-DZ7fP1_3.js → xychartDiagram-N2JHSOCM-DGRtrj4P.js} +3 -3
  238. package/web/index.html +2 -2
  239. package/web/assets/architecture-YZFGNWBL-S5CXDPWN-BUzkWgDl.js +0 -1
  240. package/web/assets/architectureDiagram-EMZXCZ2Q-CXbzok1G.js +0 -36
  241. package/web/assets/blockDiagram-IGV67L2C-DA1QJ4ZB.js +0 -132
  242. package/web/assets/chunk-3GS5O3IE-B8hpnia8.js +0 -231
  243. package/web/assets/chunk-3YCYZ6SJ-B-BVu21C.js +0 -1
  244. package/web/assets/chunk-6NTNNK5N-DW-jYSDr.js +0 -1
  245. package/web/assets/chunk-A34GCYZU-BbZl-IKy.js +0 -1
  246. package/web/assets/chunk-DJ7UZH7F-B5tMfF87.js +0 -1
  247. package/web/assets/chunk-DKKBVRCY-Djm-6K_e.js +0 -4
  248. package/web/assets/chunk-DU5LTGQ6-QPoynYcp.js +0 -1
  249. package/web/assets/chunk-FXACKDTF-jieSmbe2.js +0 -159
  250. package/web/assets/chunk-H3VCZNTA-8EMHZ3SV.js +0 -1
  251. package/web/assets/chunk-HN6EAY2L-CgE_agsD.js +0 -1
  252. package/web/assets/chunk-O5ABG6QK-DEZV1O19.js +0 -1
  253. package/web/assets/chunk-PK6DOVAG-BXv0JnsJ.js +0 -206
  254. package/web/assets/chunk-RNJOYNJ4-BiBkF9dN.js +0 -1
  255. package/web/assets/chunk-TBF5ZNIQ-BSl6s9lT.js +0 -1
  256. package/web/assets/chunk-TU3PZOEN-DE5Qhc0N.js +0 -1
  257. package/web/assets/chunk-TYMNRAUI-D1NDLIMG.js +0 -1
  258. package/web/assets/chunk-VELTKBKT-C9dVN39o.js +0 -1
  259. package/web/assets/chunk-W7ZLLLMY-Bu-cdLzs.js +0 -1
  260. package/web/assets/chunk-WSB5WSVC-Dor71SOz.js +0 -1
  261. package/web/assets/chunk-XGPFEOL4-CUonLRle.js +0 -1
  262. package/web/assets/classDiagram-PPOCWD7C-Cdd6UdVv.js +0 -1
  263. package/web/assets/classDiagram-v2-23LJLIIU-DNhxY2Ib.js +0 -1
  264. package/web/assets/dagre-E77IOHMT-Cfj_6e17.js +0 -4
  265. package/web/assets/diagram-H7BISOXX-BNvpsrBv.js +0 -43
  266. package/web/assets/diagram-JC5VWROH-Cn0rtDbJ.js +0 -24
  267. package/web/assets/diagram-LXUTUG65-CHfoVKNm.js +0 -10
  268. package/web/assets/diagram-WEHSV5V5-BLxHksnu.js +0 -24
  269. package/web/assets/flowDiagram-OTCZ4VVT-aAZw4c_M.js +0 -162
  270. package/web/assets/ganttDiagram-MUNLMDZQ-BEfC_7Or.js +0 -292
  271. package/web/assets/gitGraph-7Q5UKJZL-54BCDZD5-B6ZeRLP0.js +0 -1
  272. package/web/assets/gitGraphDiagram-3HKGZ4G3-CG0kC8Q5.js +0 -106
  273. package/web/assets/info-OMHHGYJF-BF2H5H6G-BIOsZy0W.js +0 -1
  274. package/web/assets/infoDiagram-MN7RKWGX-DUoMH-pq.js +0 -2
  275. package/web/assets/packet-4T2RLAQJ-EV4IVRXR-Bs7ysNMU.js +0 -1
  276. package/web/assets/pie-ZZUOXDRM-N23DN5KN-Csi8nnbH.js +0 -1
  277. package/web/assets/pieDiagram-3IATQBI2-QY-u7P6a.js +0 -30
  278. package/web/assets/quadrantDiagram-E256RVCF-Di4aNiU8.js +0 -7
  279. package/web/assets/radar-PYXPWWZC-P6TP7ZYP-DJlyXh2-.js +0 -1
  280. package/web/assets/sankeyDiagram-L3NBLAOT-D2fbMiIU.js +0 -10
  281. package/web/assets/sequenceDiagram-ZOUHS735-BNdkqguh.js +0 -157
  282. package/web/assets/stateDiagram-MLPALWAM-51_Q2w2L.js +0 -1
  283. package/web/assets/stateDiagram-v2-B5LQ5ZB2-8nHs2aNE.js +0 -1
  284. package/web/assets/treeView-SZITEDCU-5DXDK3XO-Cy6P0_CZ.js +0 -1
  285. package/web/assets/treemap-W4RFUUIX-WYLRDWKO-C_pp1R7A.js +0 -1
  286. package/web/assets/wardley-RL74JXVD-BCRCBASE-CMStJhpn.js +0 -1
  287. package/web/assets/wardleyDiagram-XU3VSMPF-ijlLF77s.js +0 -20
  288. /package/web/assets/{context-builder-CqQNhRj1.js → context-builder-CG-ydtp4.js} +0 -0
@@ -1 +1 @@
1
- import{o as e,r as t,t as n}from"./chunk-VELTKBKT-C9dVN39o.js";import{Gn as r,zn as i}from"./index-3NUCUW2s.js";import{t as a}from"./chunk-7RZVMHOQ-BdIU-RGO.js";var o=t((e,t)=>{n((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()}),`webpackUniversalModuleDefinition`)(e,function(){return(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return n(r,`__webpack_require__`),r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?n(function(){return e.default},`getDefault`):n(function(){return e},`getModuleExports`);return r.d(t,`a`,t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=``,r(r.s=26)})([(function(e,t,r){function i(){}n(i,`LayoutConstants`),i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,e.exports=i}),(function(e,t,r){var i=r(2),a=r(8),o=r(9);function s(e,t,n){i.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var c in n(s,`LEdge`),s.prototype=Object.create(i.prototype),i)s[c]=i[c];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.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`},s.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},s.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=a.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=s}),(function(e,t,r){function i(e){this.vGraphObject=e}n(i,`LGraphObject`),e.exports=i}),(function(e,t,r){var i=r(2),a=r(10),o=r(13),s=r(0),c=r(16),l=r(4);function u(e,t,n,r){n==null&&r==null&&(r=t),i.call(this,r),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=a.MIN_VALUE,this.inclusionTreeDepth=a.MAX_VALUE,this.vGraphObject=r,this.edges=[],this.graphManager=e,n!=null&&t!=null?this.rect=new o(t.x,t.y,n.width,n.height):this.rect=new o}for(var d in n(u,`LNode`),u.prototype=Object.create(i.prototype),i)u[d]=i[d];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.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},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.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},u.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},u.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},u.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},u.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},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==a.MIN_VALUE)throw`assert failed`;return this.estimatedSize},u.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)},u.prototype.scatter=function(){var e,t,n=-s.INITIAL_WORLD_BOUNDARY,r=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_X+c.nextDouble()*(r-n)+n;var i=-s.INITIAL_WORLD_BOUNDARY,a=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_Y+c.nextDouble()*(a-i)+i,this.rect.x=e,this.rect.y=t},u.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()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var t=e.getRight()-e.getLeft(),n=e.getBottom()-e.getTop();this.labelWidth>t&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&(this.labelPos==`center`?this.rect.y-=(this.labelHeight-n)/2:this.labelPos==`top`&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==a.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>s.WORLD_BOUNDARY?t=s.WORLD_BOUNDARY:t<-s.WORLD_BOUNDARY&&(t=-s.WORLD_BOUNDARY);var n=this.rect.y;n>s.WORLD_BOUNDARY?n=s.WORLD_BOUNDARY:n<-s.WORLD_BOUNDARY&&(n=-s.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=u}),(function(e,t,r){function i(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}n(i,`PointD`),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(e){this.x=e},i.prototype.setY=function(e){this.y=e},i.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=i}),(function(e,t,r){var i=r(2),a=r(10),o=r(0),s=r(6),c=r(3),l=r(1),u=r(13),d=r(12),f=r(11);function p(e,t,n){i.call(this,n),this.estimatedSize=a.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof s?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var m in n(p,`LGraph`),p.prototype=Object.create(i.prototype),i)p[m]=i[m];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.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}},p.prototype.remove=function(e){var t=e;if(e instanceof c){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 l){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 s=r.source.edges.indexOf(r),u=r.target.edges.indexOf(r);if(!(s>-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(s,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)}},p.prototype.updateLeftTop=function(){for(var e=a.MAX_VALUE,t=a.MAX_VALUE,n,r,i,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==a.MAX_VALUE?null:(i=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-i,this.top=e-i,new d(this.left,this.top))},p.prototype.updateBounds=function(e){for(var t=a.MAX_VALUE,n=-a.MAX_VALUE,r=a.MAX_VALUE,i=-a.MAX_VALUE,o,s,c,l,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(),l=h.getBottom(),t>o&&(t=o),n<s&&(n=s),r>c&&(r=c),i<l&&(i=l)}var g=new u(t,r,n-t,i-r);t==a.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},p.calculateBounds=function(e){for(var t=a.MAX_VALUE,n=-a.MAX_VALUE,r=a.MAX_VALUE,i=-a.MAX_VALUE,o,s,c,l,d=e.length,f=0;f<d;f++){var p=e[f];o=p.getLeft(),s=p.getRight(),c=p.getTop(),l=p.getBottom(),t>o&&(t=o),n<s&&(n=s),r>c&&(r=c),i<l&&(i=l)}return new u(t,r,n-t,i-r)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==a.MIN_VALUE)throw`assert failed`;return this.estimatedSize},p.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=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=e/Math.sqrt(this.nodes.length),this.estimatedSize},p.prototype.updateConnected=function(){var e=this;if(this.nodes.length==0){this.isConnected=!0;return}var t=new f,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=p}),(function(e,t,r){var i,a=r(1);function o(e){i=r(5),this.layout=e,this.graphs=[],this.edges=[]}n(o,`LGraphManager`),o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.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}},o.prototype.remove=function(e){if(e instanceof i){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 r,o=n.length,s=0;s<o;s++)r=n[s],t.remove(r);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 a){if(r=e,r==null)throw`Edge is null!`;if(!r.isInterGraph)throw`Not an inter-graph edge!`;if(!(r.source!=null&&r.target!=null))throw`Source and/or target is null!`;if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw`Source and/or target doesn't know this edge!`;var u=r.source.edges.indexOf(r);if(r.source.edges.splice(u,1),u=r.target.edges.indexOf(r),r.target.edges.splice(u,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw`Edge owner graph or owner graph manager is null!`;if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw`Not in owner graph manager's edge list!`;var u=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(u,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.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},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){for(var e=[],t=this.getGraphs(),n=t.length,r=0;r<t.length;r++)e=e.concat(t[r].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw`assert failed`;this.allNodesToApplyGravitation=e},o.prototype.getRoot=function(){return this.rootGraph},o.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`)},o.prototype.getLayout=function(){return this.layout},o.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},o.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`}},o.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},o.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)},o.prototype.includesInvalidEdge=function(){for(var e,t=this.edges.length,n=0;n<t;n++)if(e=this.edges[n],this.isOneAncestorOfOther(e.source,e.target))return!0;return!1},e.exports=o}),(function(e,t,r){var i=r(0);function a(){}for(var o in n(a,`FDLayoutConstants`),i)a[o]=i[o];a.MAX_ITERATIONS=2500,a.DEFAULT_EDGE_LENGTH=50,a.DEFAULT_SPRING_STRENGTH=.45,a.DEFAULT_REPULSION_STRENGTH=4500,a.DEFAULT_GRAVITY_STRENGTH=.4,a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,a.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,a.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,a.COOLING_ADAPTATION_FACTOR=.33,a.ADAPTATION_LOWER_NODE_LIMIT=1e3,a.ADAPTATION_UPPER_NODE_LIMIT=5e3,a.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,a.MAX_NODE_DISPLACEMENT=a.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,a.MIN_REPULSION_DIST=a.DEFAULT_EDGE_LENGTH/10,a.CONVERGENCE_CHECK_PERIOD=100,a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,a.MIN_EDGE_LENGTH=1,a.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=a}),(function(e,t,r){var i=r(12);function a(){}n(a,`IGeometry`),a.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)},a.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},a.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},a.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},a.getIntersection=function(e,t,n,r){if(r==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=r.x,f=r.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 i(p,m))},a.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},a.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},a.HALF_PI=.5*Math.PI,a.ONE_AND_HALF_PI=1.5*Math.PI,a.TWO_PI=2*Math.PI,a.THREE_PI=3*Math.PI,e.exports=a}),(function(e,t,r){function i(){}n(i,`IMath`),i.sign=function(e){return e>0?1:e<0?-1:0},i.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},i.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=i}),(function(e,t,r){function i(){}n(i,`Integer`),i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,e.exports=i}),(function(e,t,r){var i=(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 n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`);var o=n(function(e){return{value:e,next:null,prev:null}},`nodeFrom`),s=n(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},`add`),c=n(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},`_remove`);e.exports=(function(){function e(t){var n=this;a(this,e),this.length=0,this.head=null,this.tail=null,t?.forEach(function(e){return n.push(e)})}return n(e,`LinkedList`),i(e,[{key:`size`,value:n(function(){return this.length},`size`)},{key:`insertBefore`,value:n(function(e,t){return s(t.prev,o(e),t,this)},`insertBefore`)},{key:`insertAfter`,value:n(function(e,t){return s(t,o(e),t.next,this)},`insertAfter`)},{key:`insertNodeBefore`,value:n(function(e,t){return s(t.prev,e,t,this)},`insertNodeBefore`)},{key:`insertNodeAfter`,value:n(function(e,t){return s(t,e,t.next,this)},`insertNodeAfter`)},{key:`push`,value:n(function(e){return s(this.tail,o(e),null,this)},`push`)},{key:`unshift`,value:n(function(e){return s(null,o(e),this.head,this)},`unshift`)},{key:`remove`,value:n(function(e){return c(e,this)},`remove`)},{key:`pop`,value:n(function(){return c(this.tail,this).value},`pop`)},{key:`popNode`,value:n(function(){return c(this.tail,this)},`popNode`)},{key:`shift`,value:n(function(){return c(this.head,this).value},`shift`)},{key:`shiftNode`,value:n(function(){return c(this.head,this)},`shiftNode`)},{key:`get_object_at`,value:n(function(e){if(e<=this.length()){for(var t=1,n=this.head;t<e;)n=n.next,t++;return n.value}},`get_object_at`)},{key:`set_object_at`,value:n(function(e,t){if(e<=this.length()){for(var n=1,r=this.head;n<e;)r=r.next,n++;r.value=t}},`set_object_at`)}]),e})()}),(function(e,t,r){function i(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)}n(i,`Point`),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.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)))},i.prototype.move=function(e,t){this.x=e,this.y=t},i.prototype.translate=function(e,t){this.x+=e,this.y+=t},i.prototype.equals=function(e){if(e.constructor.name==`Point`){var t=e;return this.x==t.x&&this.y==t.y}return this==e},i.prototype.toString=function(){return new i().constructor.name+`[x=`+this.x+`,y=`+this.y+`]`},e.exports=i}),(function(e,t,r){function i(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)}n(i,`RectangleD`),i.prototype.getX=function(){return this.x},i.prototype.setX=function(e){this.x=e},i.prototype.getY=function(){return this.y},i.prototype.setY=function(e){this.y=e},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},e.exports=i}),(function(e,t,r){var i=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 a(){}n(a,`UniqueIDGeneretor`),a.lastID=0,a.createID=function(e){return a.isPrimitive(e)?e:(e.uniqueID??(e.uniqueID=a.getString(),a.lastID++),e.uniqueID)},a.getString=function(e){return e??=a.lastID,`Object#`+e},a.isPrimitive=function(e){var t=typeof e>`u`?`undefined`:i(e);return e==null||t!=`object`&&t!=`function`},e.exports=a}),(function(e,t,r){function i(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)}n(i,`_toConsumableArray`);var a=r(0),o=r(6),s=r(3),c=r(1),l=r(5),u=r(4),d=r(17),f=r(27);function p(e){f.call(this),this.layoutQuality=a.QUALITY,this.createBendsAsNeeded=a.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=a.DEFAULT_INCREMENTAL,this.animationOnLayout=a.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=a.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=a.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=a.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,e!=null&&(this.isRemoteUse=e)}n(p,`Layout`),p.RANDOM_SEED=1,p.prototype=Object.create(f.prototype),p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},p.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},p.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},p.prototype.newGraphManager=function(){var e=new o(this);return this.graphManager=e,e},p.prototype.newGraph=function(e){return new l(null,this.graphManager,e)},p.prototype.newNode=function(e){return new s(this.graphManager,e)},p.prototype.newEdge=function(e){return new c(null,null,e)},p.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},p.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var e;return e=this.checkLayoutSuccess()?!1:this.layout(),a.ANIMATE===`during`?!1:(e&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,e)},p.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},p.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())}},p.prototype.update=function(e){if(e==null)this.update2();else if(e instanceof s){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 c){var i=e;i.vGraphObject!=null&&i.vGraphObject.update(i)}else if(e instanceof l){var a=e;a.vGraphObject!=null&&a.vGraphObject.update(a)}},p.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=a.QUALITY,this.animationDuringLayout=a.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=a.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=a.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=a.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=a.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=a.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},p.prototype.transform=function(e){if(e==null)this.transform(new u(0,0));else{var t=new d,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)}}},p.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())},p.prototype.getFlatForest=function(){for(var e=[],t=!0,n=this.graphManager.getRoot().getNodes(),r=!0,a=0;a<n.length;a++)n[a].getChild()!=null&&(r=!1);if(!r)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(i(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},p.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},p.prototype.createBendpointsFromDummyNodes=function(){var e=[];e=e.concat(this.graphManager.getAllEdges()),e=[].concat(i(this.edgeToDummyNodes.keys()),e);for(var t=0;t<e.length;t++){var n=e[t];if(n.bendpoints.length>0){for(var r=this.edgeToDummyNodes.get(n),a=0;a<r.length;a++){var o=r[a],s=new u(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)}}},p.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}},p.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},p.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=p}),(function(e,t,r){function i(){}n(i,`RandomSeed`),i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},e.exports=i}),(function(e,t,r){var i=r(4);function a(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}n(a,`Transform`),a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(e){this.lworldExtX=e},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(e){this.lworldExtY=e},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},a.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},a.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},a.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},a.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},a.prototype.inverseTransformPoint=function(e){return new i(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=a}),(function(e,t,r){function i(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)}n(i,`_toConsumableArray`);var a=r(15),o=r(7),s=r(0),c=r(8),l=r(9);function u(){a.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.springConstant=o.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=o.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}for(var d in n(u,`FDLayout`),u.prototype=Object.create(a.prototype),a)u[d]=a[d];u.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,i,a,c=this.getGraphManager().getAllEdges(),l=0;l<c.length;l++)e=c[l],e.idealLength=this.idealEdgeLength,e.isInterGraph&&(n=e.getSource(),r=e.getTarget(),i=e.getSourceInLca().getEstimatedSize(),a=e.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(e.idealLength+=i+a-2*s.SIMPLE_NODE_SIZE),t=e.getLca().getInclusionTreeDepth(),e.idealLength+=o.DEFAULT_EDGE_LENGTH*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(n.getInclusionTreeDepth()+r.getInclusionTreeDepth()-2*t))},u.prototype.initSpringEmbedder=function(){var e=this.getAllNodes().length;this.incremental?(e>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(e-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n<e.length;n++)t=e[n],this.calcSpringForce(t,t.idealLength)},u.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]:!1,n,r,i,a,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%o.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++)a=s[r],i.getOwner()==a.getOwner()&&this.calcRepulsionForce(i,a)},u.prototype.calcGravitationalForces=function(){for(var e,t=this.getAllNodesToApplyGravitation(),n=0;n<t.length;n++)e=t[n],this.calcGravitationalForce(e)},u.prototype.moveNodes=function(){for(var e=this.getAllNodes(),t,n=0;n<e.length;n++)t=e[n],t.move()},u.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=this.springConstant*(i-t),o=a*(e.lengthX/i),s=a*(e.lengthY/i),n.springForceX+=o,n.springForceY+=s,r.springForceX-=o,r.springForceY-=s)},u.prototype.calcRepulsionForce=function(e,t){var n=e.getRect(),r=t.getRect(),i=[,,],a=[,,,,],s,u,d,f,p,m,h;if(n.intersects(r)){c.calcSeparationAmount(n,r,i,o.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?(s=r.getCenterX()-n.getCenterX(),u=r.getCenterY()-n.getCenterY()):(c.getIntersection(n,r,a),s=a[2]-a[0],u=a[3]-a[1]),Math.abs(s)<o.MIN_REPULSION_DIST&&(s=l.sign(s)*o.MIN_REPULSION_DIST),Math.abs(u)<o.MIN_REPULSION_DIST&&(u=l.sign(u)*o.MIN_REPULSION_DIST),d=s*s+u*u,f=Math.sqrt(d),p=this.repulsionConstant*e.noOfChildren*t.noOfChildren/d,m=p*s/f,h=p*u/f,e.repulsionForceX-=m,e.repulsionForceY-=h,t.repulsionForceX+=m,t.repulsionForceY+=h},u.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))},u.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},u.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},u.prototype.calcNoOfChildrenForAllNodes=function(){for(var e,t=this.graphManager.getAllNodes(),n=0;n<t.length;n++)e=t[n],e.noOfChildren=e.getNoOfChildren()},u.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},u.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)},u.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())},u.prototype.calculateRepulsionForceOfANode=function(e,t,n,r){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&n||r){var a=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)&&!a.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&&a.add(s)}}e.surrounding=[].concat(i(a))}for(l=0;l<e.surrounding.length;l++)this.calcRepulsionForce(e,e.surrounding[l])},u.prototype.calcRepulsionRange=function(){return 0},e.exports=u}),(function(e,t,r){var i=r(1),a=r(7);function o(e,t,n){i.call(this,e,t,n),this.idealLength=a.DEFAULT_EDGE_LENGTH}for(var s in n(o,`FDLayoutEdge`),o.prototype=Object.create(i.prototype),i)o[s]=i[s];e.exports=o}),(function(e,t,r){var i=r(3);function a(e,t,n,r){i.call(this,e,t,n,r),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 n(a,`FDLayoutNode`),a.prototype=Object.create(i.prototype),i)a[o]=i[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,r){function i(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}n(i,`DimensionD`),i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},e.exports=i}),(function(e,t,r){var i=r(14);function a(){this.map={},this.keys=[]}n(a,`HashMap`),a.prototype.put=function(e,t){var n=i.createID(e);this.contains(n)||(this.map[n]=t,this.keys.push(e))},a.prototype.contains=function(e){return i.createID(e),this.map[e]!=null},a.prototype.get=function(e){var t=i.createID(e);return this.map[t]},a.prototype.keySet=function(){return this.keys},e.exports=a}),(function(e,t,r){var i=r(14);function a(){this.set={}}n(a,`HashSet`),a.prototype.add=function(e){var t=i.createID(e);this.contains(t)||(this.set[t]=e)},a.prototype.remove=function(e){delete this.set[i.createID(e)]},a.prototype.clear=function(){this.set={}},a.prototype.contains=function(e){return this.set[i.createID(e)]==e},a.prototype.isEmpty=function(){return this.size()===0},a.prototype.size=function(){return Object.keys(this.set).length},a.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]])},a.prototype.size=function(){return Object.keys(this.set).length},a.prototype.addAll=function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];this.add(r)}},e.exports=a}),(function(e,t,r){var i=(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 n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`);var o=r(11);e.exports=(function(){function e(t,n){a(this,e),(n!==null||n!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=t instanceof o?t.size():t.length,this._quicksort(t,0,r-1)}return n(e,`Quicksort`),i(e,[{key:`_quicksort`,value:n(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)}},`_quicksort`)},{key:`_partition`,value:n(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}},`_partition`)},{key:`_get`,value:n(function(e,t){return e instanceof o?e.get_object_at(t):e[t]},`_get`)},{key:`_set`,value:n(function(e,t,n){e instanceof o?e.set_object_at(t,n):e[t]=n},`_set`)},{key:`_swap`,value:n(function(e,t,n){var r=this._get(e,t);this._set(e,t,this._get(e,n)),this._set(e,n,r)},`_swap`)},{key:`_defaultCompareFunction`,value:n(function(e,t){return t>e},`_defaultCompareFunction`)}]),e})()}),(function(e,t,r){var i=(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 n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`),e.exports=(function(){function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;a(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,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 n(e,`NeedlemanWunsch`),i(e,[{key:`getScore`,value:n(function(){return this.score},`getScore`)},{key:`getAlignments`,value:n(function(){return this.alignments},`getAlignments`)},{key:`computeGrids`,value:n(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]},`computeGrids`)},{key:`alignmentTraceback`,value:n(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},`alignmentTraceback`)},{key:`getAllIndexes`,value:n(function(e,t){for(var n=[],r=-1;(r=e.indexOf(t,r+1))!==-1;)n.push(r);return n},`getAllIndexes`)},{key:`arrayAllMaxIndexes`,value:n(function(e){return this.getAllIndexes(e,Math.max.apply(null,e))},`arrayAllMaxIndexes`)}]),e})()}),(function(e,t,r){var i=n(function(){},`layoutBase`);i.FDLayout=r(18),i.FDLayoutConstants=r(7),i.FDLayoutEdge=r(19),i.FDLayoutNode=r(20),i.DimensionD=r(21),i.HashMap=r(22),i.HashSet=r(23),i.IGeometry=r(8),i.IMath=r(9),i.Integer=r(10),i.Point=r(12),i.PointD=r(4),i.RandomSeed=r(16),i.RectangleD=r(13),i.Transform=r(17),i.UniqueIDGeneretor=r(14),i.Quicksort=r(24),i.LinkedList=r(11),i.LGraphObject=r(2),i.LGraph=r(5),i.LEdge=r(1),i.LGraphManager=r(6),i.LNode=r(3),i.Layout=r(15),i.LayoutConstants=r(0),i.NeedlemanWunsch=r(25),e.exports=i}),(function(e,t,r){function i(){this.listeners=[]}n(i,`Emitter`);var a=i.prototype;a.addListener=function(e,t){this.listeners.push({event:e,callback:t})},a.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)}},a.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=i})])})}),s=t((e,t)=>{n((function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(o()):typeof define==`function`&&define.amd?define([`layout-base`],r):typeof e==`object`?e.coseBase=r(o()):n.coseBase=r(n.layoutBase)}),`webpackUniversalModuleDefinition`)(e,function(e){return(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return n(r,`__webpack_require__`),r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?n(function(){return e.default},`getDefault`):n(function(){return e},`getModuleExports`);return r.d(t,`a`,t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=``,r(r.s=7)})([(function(t,n){t.exports=e}),(function(e,t,r){var i=r(0).FDLayoutConstants;function a(){}for(var o in n(a,`CoSEConstants`),i)a[o]=i[o];a.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,a.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,a.DEFAULT_COMPONENT_SEPERATION=60,a.TILE=!0,a.TILING_PADDING_VERTICAL=10,a.TILING_PADDING_HORIZONTAL=10,a.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=a}),(function(e,t,r){var i=r(0).FDLayoutEdge;function a(e,t,n){i.call(this,e,t,n)}for(var o in n(a,`CoSEEdge`),a.prototype=Object.create(i.prototype),i)a[o]=i[o];e.exports=a}),(function(e,t,r){var i=r(0).LGraph;function a(e,t,n){i.call(this,e,t,n)}for(var o in n(a,`CoSEGraph`),a.prototype=Object.create(i.prototype),i)a[o]=i[o];e.exports=a}),(function(e,t,r){var i=r(0).LGraphManager;function a(e){i.call(this,e)}for(var o in n(a,`CoSEGraphManager`),a.prototype=Object.create(i.prototype),i)a[o]=i[o];e.exports=a}),(function(e,t,r){var i=r(0).FDLayoutNode,a=r(0).IMath;function o(e,t,n,r){i.call(this,e,t,n,r)}for(var s in n(o,`CoSENode`),o.prototype=Object.create(i.prototype),i)o[s]=i[s];o.prototype.move=function(){var e=this.graphManager.getLayout();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*a.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*a.sign(this.displacementY)),this.child==null||this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(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},o.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.moveBy(e,t),r.displacementX+=e,r.displacementY+=t):r.propogateDisplacementToChildren(e,t)},o.prototype.setPred1=function(e){this.pred1=e},o.prototype.getPred1=function(){return pred1},o.prototype.getPred2=function(){return pred2},o.prototype.setNext=function(e){this.next=e},o.prototype.getNext=function(){return next},o.prototype.setProcessed=function(e){this.processed=e},o.prototype.isProcessed=function(){return processed},e.exports=o}),(function(e,t,r){var i=r(0).FDLayout,a=r(4),o=r(3),s=r(5),c=r(2),l=r(1),u=r(0).FDLayoutConstants,d=r(0).LayoutConstants,f=r(0).Point,p=r(0).PointD,m=r(0).Layout,h=r(0).Integer,g=r(0).IGeometry,_=r(0).LGraph,v=r(0).Transform;function y(){i.call(this),this.toBeTiled={}}for(var b in n(y,`CoSELayout`),y.prototype=Object.create(i.prototype),i)y[b]=i[b];y.prototype.newGraphManager=function(){var e=new a(this);return this.graphManager=e,e},y.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},y.prototype.newNode=function(e){return new s(this.graphManager,e)},y.prototype.newEdge=function(e){return new c(null,null,e)},y.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=u.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=u.DEFAULT_REPULSION_STRENGTH,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,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=u.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},y.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},y.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){if(l.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.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(),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()),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},y.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},y.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()}},y.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},y.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}},y.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+=l.DEFAULT_COMPONENT_SEPERATION),r=0);var c=e[s],u=m.findCenterOfTree(c);t.x=a,t.y=i,o=y.radialLayout(c,u,t),o.y>r&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-o.x/2,d.WORLD_CENTER_Y-o.y/2))},y.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(t,null,0,359,0,r);var i=_.calculateBounds(e),a=new v;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)},y.branchRadialLayout=function(e,t,n,r,i,a){var o=(r-n+1)/2;o<0&&(o+=180);var s=(o+n)%360*g.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 _=h[0];h.splice(0,1);var v=u.indexOf(_);v>=0&&u.splice(v,1),p--,d--}m=t==null?0:(u.indexOf(h[0])+1)%p;for(var b=Math.abs(r-n)/d,x=m;f!=d;x=++x%p){var S=u[x].getOtherEnd(e);if(S!=t){var C=(n+f*b)%360,w=(C+b)%360;y.branchRadialLayout(S,e,C,w,i+a,a),f++}}},y.maxDiagonalInTree=function(e){for(var t=h.MIN_VALUE,n=0;n<e.length;n++){var r=e[n].getDiagonal();r>t&&(t=r)}return t},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.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],o=a.getParent();this.getNodeDegreeWithChildren(a)===0&&(o.id==null||!this.getToBeTiled(o))&&n.push(a)}for(var i=0;i<n.length;i++){var a=n[i],c=a.getParent().id;typeof t[c]>`u`&&(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 s(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 o=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),o.add(u)}}})},y.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)},y.prototype.clearZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=e.idToDummyNode[n];t[n]=e.tileNodes(e.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=t[n].width,r.rect.height=t[n].height})},y.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;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},y.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;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)})},y.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},y.prototype.getNodeDegree=function(e){for(var t=e.id,n=e.getEdges(),r=0,i=0;i<n.length;i++){var a=n[i];a.getSource().id!==a.getTarget().id&&(r+=1)}return r},y.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},y.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},y.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)}},y.prototype.adjustLocations=function(e,t,n,r,i){t+=r,n+=i;for(var a=t,o=0;o<e.rows.length;o++){var s=e.rows[o];t=a;for(var c=0,l=0;l<s.length;l++){var u=s[l];u.rect.x=t,u.rect.y=n,t+=u.rect.width+e.horizontalPadding,u.rect.height>c&&(c=u.rect.height)}n+=c+e.verticalPadding}},y.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];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})},y.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:l.TILING_PADDING_VERTICAL,horizontalPadding:l.TILING_PADDING_HORIZONTAL};e.sort(function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:+(e.rect.width*e.rect.height<t.rect.width*t.rect.height)});for(var r=0;r<e.length;r++){var i=e[r];n.rows.length==0?this.insertNodeToRow(n,i,0,t):this.canAddHorizontal(n,i.rect.width,i.rect.height)?this.insertNodeToRow(n,i,this.getShortestRowIndex(n),t):this.insertNodeToRow(n,i,n.rows.length,t),this.shiftToLastRow(n)}return n},y.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)},y.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},y.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},y.prototype.canAddHorizontal=function(e,t,n){var r=this.getShortestRowIndex(e);if(r<0)return!0;var i=e.rowWidth[r];if(i+e.horizontalPadding+t<=e.width)return!0;var a=0;e.rowHeight[r]<n&&r>0&&(a=n+e.verticalPadding-e.rowHeight[r]);var o=e.width-i>=t+e.horizontalPadding?(e.height+a)/(i+t+e.horizontalPadding):(e.height+a)/e.width;a=n+e.verticalPadding;var s;return s=e.width<t?(e.height+a)/t:(e.height+a)/e.width,s<1&&(s=1/s),o<1&&(o=1/o),o<s},y.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)}},y.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},y.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},y.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++)n=r[a],n.getEdges().length==1&&!n.getEdges()[0].isInterGraph&&n.getChild()==null&&(i.push([n,n.getEdges()[0],n.getOwner()]),t=!0);if(t==1){for(var o=[],s=0;s<i.length;s++)i[s][0].getEdges().length==1&&(o.push(i[s]),i[s][0].getOwner().remove(i[s][0]));e.push(o),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},y.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()},y.prototype.findPlaceforPrunedNode=function(e){var t,n,r=e[0];n=r==e[1].source?e[1].target:e[1].source;var i=n.startX,a=n.finishX,o=n.startY,s=n.finishY,c=[0,0,0,0];if(o>0)for(var l=i;l<=a;l++)c[0]+=this.grid[l][o-1].length+this.grid[l][o].length-1;if(a<this.grid.length-1)for(var l=o;l<=s;l++)c[1]+=this.grid[a+1][l].length+this.grid[a][l].length-1;if(s<this.grid[0].length-1)for(var l=i;l<=a;l++)c[2]+=this.grid[l][s+1].length+this.grid[l][s].length-1;if(i>0)for(var l=o;l<=s;l++)c[3]+=this.grid[i-1][l].length+this.grid[i][l].length-1;for(var d=h.MAX_VALUE,f,p,m=0;m<c.length;m++)c[m]<d?(d=c[m],f=1,p=m):c[m]==d&&f++;if(f==3&&d==0)c[0]==0&&c[1]==0&&c[2]==0?t=1:c[0]==0&&c[1]==0&&c[3]==0?t=0:c[0]==0&&c[2]==0&&c[3]==0?t=3:c[1]==0&&c[2]==0&&c[3]==0&&(t=2);else if(f==2&&d==0){var g=Math.floor(Math.random()*2);t=c[0]==0&&c[1]==0?g==0?0:1:c[0]==0&&c[2]==0?g==0?0:2:c[0]==0&&c[3]==0?g==0?0:3:c[1]==0&&c[2]==0?g==0?1:2:c[1]==0&&c[3]==0?g==0?1:3:g==0?2:3}else if(f==4&&d==0){var g=Math.floor(Math.random()*4);t=g}else t=p;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=y}),(function(e,t,n){var r={};r.layoutBase=n(0),r.CoSEConstants=n(1),r.CoSEEdge=n(2),r.CoSEGraph=n(3),r.CoSEGraphManager=n(4),r.CoSELayout=n(6),r.CoSENode=n(5),e.exports=r})])})}),c=e(t((e,t)=>{n((function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(s()):typeof define==`function`&&define.amd?define([`cose-base`],r):typeof e==`object`?e.cytoscapeCoseBilkent=r(s()):n.cytoscapeCoseBilkent=r(n.coseBase)}),`webpackUniversalModuleDefinition`)(e,function(e){return(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return n(r,`__webpack_require__`),r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?n(function(){return e.default},`getDefault`):n(function(){return e},`getModuleExports`);return r.d(t,`a`,t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=``,r(r.s=1)})([(function(t,n){t.exports=e}),(function(e,t,r){var i=r(0).layoutBase.LayoutConstants,a=r(0).layoutBase.FDLayoutConstants,o=r(0).CoSEConstants,s=r(0).CoSELayout,c=r(0).CoSENode,l=r(0).layoutBase.PointD,u=r(0).layoutBase.DimensionD,d={ready:n(function(){},`ready`),stop:n(function(){},`stop`),quality:`default`,nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:`end`,animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function f(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}n(f,`extend`);function p(e){this.options=f(d,e),m(this.options)}n(p,`_CoSELayout`);var m=n(function(e){e.nodeRepulsion!=null&&(o.DEFAULT_REPULSION_STRENGTH=a.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion),e.idealEdgeLength!=null&&(o.DEFAULT_EDGE_LENGTH=a.DEFAULT_EDGE_LENGTH=e.idealEdgeLength),e.edgeElasticity!=null&&(o.DEFAULT_SPRING_STRENGTH=a.DEFAULT_SPRING_STRENGTH=e.edgeElasticity),e.nestingFactor!=null&&(o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(o.DEFAULT_GRAVITY_STRENGTH=a.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(o.MAX_ITERATIONS=a.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(o.DEFAULT_GRAVITY_RANGE_FACTOR=a.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(o.DEFAULT_COOLING_FACTOR_INCREMENTAL=a.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.quality==`draft`?i.QUALITY=0:e.quality==`proof`?i.QUALITY=2:i.QUALITY=1,o.NODE_DIMENSIONS_INCLUDE_LABELS=a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,o.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!e.randomize,o.ANIMATE=a.ANIMATE=i.ANIMATE=e.animate,o.TILE=e.tile,o.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,o.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal},`getUserOptions`);p.prototype.run=function(){var e,t,r=this.options;this.idToLNode={};var i=this.layout=new s,a=this;a.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:`layoutstart`,layout:this});var o=i.newGraphManager();this.gm=o;var c=this.options.eles.nodes(),l=this.options.eles.edges();this.root=o.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(c),i);for(var u=0;u<l.length;u++){var d=l[u],f=this.idToLNode[d.data(`source`)],p=this.idToLNode[d.data(`target`)];if(f!==p&&f.getEdgesBetween(p).length==0){var m=o.add(i.newEdge(),f,p);m.id=d.id()}}var h=n(function(e,t){typeof e==`number`&&(e=t);var n=e.data(`id`),r=a.idToLNode[n];return{x:r.getRect().getCenterX(),y:r.getRect().getCenterY()}},`getPositions`),g=n(function o(){for(var s=n(function(){r.fit&&r.cy.fit(r.eles,r.padding),e||(e=!0,a.cy.one(`layoutready`,r.ready),a.cy.trigger({type:`layoutready`,layout:a}))},`afterReposition`),c=a.options.refresh,l,u=0;u<c&&!l;u++)l=a.stopped||a.layout.tick();if(l){i.checkLayoutSuccess()&&!i.isSubLayout&&i.doPostLayout(),i.tilingPostLayout&&i.tilingPostLayout(),i.isLayoutFinished=!0,a.options.eles.nodes().positions(h),s(),a.cy.one(`layoutstop`,a.options.stop),a.cy.trigger({type:`layoutstop`,layout:a}),t&&cancelAnimationFrame(t),e=!1;return}var d=a.layout.getPositionsData();r.eles.nodes().positions(function(e,t){if(typeof e==`number`&&(e=t),!e.isParent()){for(var n=e.id(),r=d[n],i=e;r==null&&(r=d[i.data(`parent`)]||d[`DummyCompound_`+i.data(`parent`)],d[n]=r,i=i.parent()[0],i!=null););return r==null?{x:e.position(`x`),y:e.position(`y`)}:{x:r.x,y:r.y}}}),s(),t=requestAnimationFrame(o)},`iterateAnimated`);return i.addListener(`layoutstarted`,function(){a.options.animate===`during`&&(t=requestAnimationFrame(g))}),i.runLayout(),this.options.animate!==`during`&&(a.options.eles.nodes().not(`:parent`).layoutPositions(a,a.options,h),e=!1),this},p.prototype.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})},p.prototype.processChildrenList=function(e,t,n){for(var r=t.length,i=0;i<r;i++){var a=t[i],o=a.children(),s,d=a.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s=a.outerWidth()!=null&&a.outerHeight()!=null?e.add(new c(n.graphManager,new l(a.position(`x`)-d.w/2,a.position(`y`)-d.h/2),new u(parseFloat(d.w),parseFloat(d.h)))):e.add(new c(this.graphManager)),s.id=a.data(`id`),s.paddingLeft=parseInt(a.css(`padding`)),s.paddingTop=parseInt(a.css(`padding`)),s.paddingRight=parseInt(a.css(`padding`)),s.paddingBottom=parseInt(a.css(`padding`)),this.options.nodeDimensionsIncludeLabels&&a.isParent()){var f=a.boundingBox({includeLabels:!0,includeNodes:!1}).w,p=a.boundingBox({includeLabels:!0,includeNodes:!1}).h,m=a.css(`text-halign`);s.labelWidth=f,s.labelHeight=p,s.labelPos=m}if(this.idToLNode[a.data(`id`)]=s,isNaN(s.rect.x)&&(s.rect.x=0),isNaN(s.rect.y)&&(s.rect.y=0),o!=null&&o.length>0){var h=n.getGraphManager().add(n.newGraph(),s);this.processChildrenList(h,o,n)}}},p.prototype.stop=function(){return this.stopped=!0,this};var h=n(function(e){e(`layout`,`cose-bilkent`,p)},`register`);typeof cytoscape<`u`&&h(cytoscape),e.exports=h})])})})(),1);a.use(c.default);function l(e,t){e.forEach(e=>{let n={id:e.id,labelText:e.label,height:e.height,width:e.width,padding:e.padding??0};Object.keys(e).forEach(t=>{[`id`,`label`,`height`,`width`,`padding`,`x`,`y`].includes(t)||(n[t]=e[t])}),t.add({group:`nodes`,data:n,position:{x:e.x??0,y:e.y??0}})})}n(l,`addNodes`);function u(e,t){e.forEach(e=>{let n={id:e.id,source:e.start,target:e.end};Object.keys(e).forEach(t=>{[`id`,`start`,`end`].includes(t)||(n[t]=e[t])}),t.add({group:`edges`,data:n})})}n(u,`addEdges`);function d(e){return new Promise(t=>{let n=i(`body`).append(`div`).attr(`id`,`cy`).attr(`style`,`display:none`),o=a({container:document.getElementById(`cy`),style:[{selector:`edge`,style:{"curve-style":`bezier`}}]});n.remove(),l(e.nodes,o),u(e.edges,o),o.nodes().forEach(function(e){e.layoutDimensions=()=>{let t=e.data();return{w:t.width,h:t.height}}}),o.layout({name:`cose-bilkent`,quality:`proof`,styleEnabled:!1,animate:!1}).run(),o.ready(e=>{r.info(`Cytoscape ready`,e),t(o)})})}n(d,`createCytoscapeInstance`);function f(e){return e.nodes().map(e=>{let t=e.data(),n=e.position(),r={id:t.id,x:n.x,y:n.y};return Object.keys(t).forEach(e=>{e!==`id`&&(r[e]=t[e])}),r})}n(f,`extractPositionedNodes`);function p(e){return e.edges().map(e=>{let t=e.data(),n=e._private.rscratch,r={id:t.id,source:t.source,target:t.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(t).forEach(e=>{[`id`,`source`,`target`].includes(e)||(r[e]=t[e])}),r})}n(p,`extractPositionedEdges`);async function m(e,t){r.debug(`Starting cose-bilkent layout algorithm`);try{h(e);let t=await d(e),n=f(t),i=p(t);return r.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(e){throw r.error(`Error in cose-bilkent layout algorithm:`,e),e}}n(m,`executeCoseBilkentLayout`);function h(e){if(!e)throw Error(`Layout data is required`);if(!e.config)throw Error(`Configuration is required in layout data`);if(!e.rootNode)throw Error(`Root node is required`);if(!e.nodes||!Array.isArray(e.nodes))throw Error(`No nodes found in layout data`);if(!Array.isArray(e.edges))throw Error(`Edges array is required in layout data`);return!0}n(h,`validateLayoutData`);var g=n(async(e,t,{insertCluster:n,insertEdge:r,insertEdgeLabel:i,insertMarkers:a,insertNode:o,log:s,positionEdgeLabel:c},{algorithm:l})=>{let u={},d={},f=t.select(`g`);a(f,e.markers,e.type,e.diagramId);let p=f.insert(`g`).attr(`class`,`subgraphs`),h=f.insert(`g`).attr(`class`,`edgePaths`),g=f.insert(`g`).attr(`class`,`edgeLabels`),_=f.insert(`g`).attr(`class`,`nodes`);s.debug(`Inserting nodes into DOM for dimension calculation`),await Promise.all(e.nodes.map(async t=>{if(t.isGroup){let e={...t};d[t.id]=e,u[t.id]=e,await n(p,t)}else{let n={...t};u[t.id]=n;let r=await o(_,t,{config:e.config,dir:e.direction||`TB`}),i=r.node().getBBox();n.width=i.width,n.height=i.height,n.domId=r,s.debug(`Node ${t.id} dimensions: ${i.width}x${i.height}`)}})),s.debug(`Running cose-bilkent layout algorithm`);let v=await m({...e,nodes:e.nodes.map(e=>{let t=u[e.id];return{...e,width:t.width,height:t.height}})},e.config);s.debug(`Positioning nodes based on layout results`),v.nodes.forEach(e=>{let t=u[e.id];t?.domId&&(t.domId.attr(`transform`,`translate(${e.x}, ${e.y})`),t.x=e.x,t.y=e.y,s.debug(`Positioned node ${t.id} at center (${e.x}, ${e.y})`))}),v.edges.forEach(t=>{let n=e.edges.find(e=>e.id===t.id);n&&(n.points=[{x:t.startX,y:t.startY},{x:t.midX,y:t.midY},{x:t.endX,y:t.endY}])}),s.debug(`Inserting and positioning edges`),await Promise.all(e.edges.map(async t=>{await i(g,t);let n=u[t.start??``],a=u[t.end??``];if(n&&a){let i=v.edges.find(e=>e.id===t.id);if(i){s.debug(`APA01 positionedEdge`,i);let o={...t};c(o,r(h,o,d,e.type,n,a,e.diagramId))}else{let i={...t,points:[{x:n.x||0,y:n.y||0},{x:a.x||0,y:a.y||0}]};c(i,r(h,i,d,e.type,n,a,e.diagramId))}}})),s.debug(`Cose-bilkent rendering completed`)},`render`);export{g as render};
1
+ import{i as e,n as t,t as n}from"./chunk-AQ6EADP3-BpMj3rQl.js";import{Yt as r,tn as i}from"./index-oL-ZNYwb.js";import{t as a}from"./chunk-3SSMPTDK-CfqpR3Nr.js";var o=t((e,t)=>{n((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()}),`webpackUniversalModuleDefinition`)(e,function(){return(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return n(r,`__webpack_require__`),r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?n(function(){return e.default},`getDefault`):n(function(){return e},`getModuleExports`);return r.d(t,`a`,t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=``,r(r.s=26)})([(function(e,t,r){function i(){}n(i,`LayoutConstants`),i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,e.exports=i}),(function(e,t,r){var i=r(2),a=r(8),o=r(9);function s(e,t,n){i.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var c in n(s,`LEdge`),s.prototype=Object.create(i.prototype),i)s[c]=i[c];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.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`},s.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},s.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=a.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=s}),(function(e,t,r){function i(e){this.vGraphObject=e}n(i,`LGraphObject`),e.exports=i}),(function(e,t,r){var i=r(2),a=r(10),o=r(13),s=r(0),c=r(16),l=r(4);function u(e,t,n,r){n==null&&r==null&&(r=t),i.call(this,r),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=a.MIN_VALUE,this.inclusionTreeDepth=a.MAX_VALUE,this.vGraphObject=r,this.edges=[],this.graphManager=e,n!=null&&t!=null?this.rect=new o(t.x,t.y,n.width,n.height):this.rect=new o}for(var d in n(u,`LNode`),u.prototype=Object.create(i.prototype),i)u[d]=i[d];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.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},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.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},u.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},u.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},u.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},u.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},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==a.MIN_VALUE)throw`assert failed`;return this.estimatedSize},u.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)},u.prototype.scatter=function(){var e,t,n=-s.INITIAL_WORLD_BOUNDARY,r=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_X+c.nextDouble()*(r-n)+n;var i=-s.INITIAL_WORLD_BOUNDARY,a=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_Y+c.nextDouble()*(a-i)+i,this.rect.x=e,this.rect.y=t},u.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()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var t=e.getRight()-e.getLeft(),n=e.getBottom()-e.getTop();this.labelWidth>t&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&(this.labelPos==`center`?this.rect.y-=(this.labelHeight-n)/2:this.labelPos==`top`&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==a.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>s.WORLD_BOUNDARY?t=s.WORLD_BOUNDARY:t<-s.WORLD_BOUNDARY&&(t=-s.WORLD_BOUNDARY);var n=this.rect.y;n>s.WORLD_BOUNDARY?n=s.WORLD_BOUNDARY:n<-s.WORLD_BOUNDARY&&(n=-s.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=u}),(function(e,t,r){function i(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}n(i,`PointD`),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(e){this.x=e},i.prototype.setY=function(e){this.y=e},i.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=i}),(function(e,t,r){var i=r(2),a=r(10),o=r(0),s=r(6),c=r(3),l=r(1),u=r(13),d=r(12),f=r(11);function p(e,t,n){i.call(this,n),this.estimatedSize=a.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof s?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var m in n(p,`LGraph`),p.prototype=Object.create(i.prototype),i)p[m]=i[m];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.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}},p.prototype.remove=function(e){var t=e;if(e instanceof c){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 l){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 s=r.source.edges.indexOf(r),u=r.target.edges.indexOf(r);if(!(s>-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(s,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)}},p.prototype.updateLeftTop=function(){for(var e=a.MAX_VALUE,t=a.MAX_VALUE,n,r,i,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==a.MAX_VALUE?null:(i=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-i,this.top=e-i,new d(this.left,this.top))},p.prototype.updateBounds=function(e){for(var t=a.MAX_VALUE,n=-a.MAX_VALUE,r=a.MAX_VALUE,i=-a.MAX_VALUE,o,s,c,l,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(),l=h.getBottom(),t>o&&(t=o),n<s&&(n=s),r>c&&(r=c),i<l&&(i=l)}var g=new u(t,r,n-t,i-r);t==a.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},p.calculateBounds=function(e){for(var t=a.MAX_VALUE,n=-a.MAX_VALUE,r=a.MAX_VALUE,i=-a.MAX_VALUE,o,s,c,l,d=e.length,f=0;f<d;f++){var p=e[f];o=p.getLeft(),s=p.getRight(),c=p.getTop(),l=p.getBottom(),t>o&&(t=o),n<s&&(n=s),r>c&&(r=c),i<l&&(i=l)}return new u(t,r,n-t,i-r)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==a.MIN_VALUE)throw`assert failed`;return this.estimatedSize},p.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=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=e/Math.sqrt(this.nodes.length),this.estimatedSize},p.prototype.updateConnected=function(){var e=this;if(this.nodes.length==0){this.isConnected=!0;return}var t=new f,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=p}),(function(e,t,r){var i,a=r(1);function o(e){i=r(5),this.layout=e,this.graphs=[],this.edges=[]}n(o,`LGraphManager`),o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.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}},o.prototype.remove=function(e){if(e instanceof i){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 r,o=n.length,s=0;s<o;s++)r=n[s],t.remove(r);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 a){if(r=e,r==null)throw`Edge is null!`;if(!r.isInterGraph)throw`Not an inter-graph edge!`;if(!(r.source!=null&&r.target!=null))throw`Source and/or target is null!`;if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw`Source and/or target doesn't know this edge!`;var u=r.source.edges.indexOf(r);if(r.source.edges.splice(u,1),u=r.target.edges.indexOf(r),r.target.edges.splice(u,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw`Edge owner graph or owner graph manager is null!`;if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw`Not in owner graph manager's edge list!`;var u=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(u,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.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},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){for(var e=[],t=this.getGraphs(),n=t.length,r=0;r<t.length;r++)e=e.concat(t[r].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw`assert failed`;this.allNodesToApplyGravitation=e},o.prototype.getRoot=function(){return this.rootGraph},o.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`)},o.prototype.getLayout=function(){return this.layout},o.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},o.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`}},o.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},o.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)},o.prototype.includesInvalidEdge=function(){for(var e,t=this.edges.length,n=0;n<t;n++)if(e=this.edges[n],this.isOneAncestorOfOther(e.source,e.target))return!0;return!1},e.exports=o}),(function(e,t,r){var i=r(0);function a(){}for(var o in n(a,`FDLayoutConstants`),i)a[o]=i[o];a.MAX_ITERATIONS=2500,a.DEFAULT_EDGE_LENGTH=50,a.DEFAULT_SPRING_STRENGTH=.45,a.DEFAULT_REPULSION_STRENGTH=4500,a.DEFAULT_GRAVITY_STRENGTH=.4,a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,a.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,a.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,a.COOLING_ADAPTATION_FACTOR=.33,a.ADAPTATION_LOWER_NODE_LIMIT=1e3,a.ADAPTATION_UPPER_NODE_LIMIT=5e3,a.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,a.MAX_NODE_DISPLACEMENT=a.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,a.MIN_REPULSION_DIST=a.DEFAULT_EDGE_LENGTH/10,a.CONVERGENCE_CHECK_PERIOD=100,a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,a.MIN_EDGE_LENGTH=1,a.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=a}),(function(e,t,r){var i=r(12);function a(){}n(a,`IGeometry`),a.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)},a.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},a.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},a.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},a.getIntersection=function(e,t,n,r){if(r==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=r.x,f=r.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 i(p,m))},a.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},a.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},a.HALF_PI=.5*Math.PI,a.ONE_AND_HALF_PI=1.5*Math.PI,a.TWO_PI=2*Math.PI,a.THREE_PI=3*Math.PI,e.exports=a}),(function(e,t,r){function i(){}n(i,`IMath`),i.sign=function(e){return e>0?1:e<0?-1:0},i.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},i.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=i}),(function(e,t,r){function i(){}n(i,`Integer`),i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,e.exports=i}),(function(e,t,r){var i=(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 n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`);var o=n(function(e){return{value:e,next:null,prev:null}},`nodeFrom`),s=n(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},`add`),c=n(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},`_remove`);e.exports=(function(){function e(t){var n=this;a(this,e),this.length=0,this.head=null,this.tail=null,t?.forEach(function(e){return n.push(e)})}return n(e,`LinkedList`),i(e,[{key:`size`,value:n(function(){return this.length},`size`)},{key:`insertBefore`,value:n(function(e,t){return s(t.prev,o(e),t,this)},`insertBefore`)},{key:`insertAfter`,value:n(function(e,t){return s(t,o(e),t.next,this)},`insertAfter`)},{key:`insertNodeBefore`,value:n(function(e,t){return s(t.prev,e,t,this)},`insertNodeBefore`)},{key:`insertNodeAfter`,value:n(function(e,t){return s(t,e,t.next,this)},`insertNodeAfter`)},{key:`push`,value:n(function(e){return s(this.tail,o(e),null,this)},`push`)},{key:`unshift`,value:n(function(e){return s(null,o(e),this.head,this)},`unshift`)},{key:`remove`,value:n(function(e){return c(e,this)},`remove`)},{key:`pop`,value:n(function(){return c(this.tail,this).value},`pop`)},{key:`popNode`,value:n(function(){return c(this.tail,this)},`popNode`)},{key:`shift`,value:n(function(){return c(this.head,this).value},`shift`)},{key:`shiftNode`,value:n(function(){return c(this.head,this)},`shiftNode`)},{key:`get_object_at`,value:n(function(e){if(e<=this.length()){for(var t=1,n=this.head;t<e;)n=n.next,t++;return n.value}},`get_object_at`)},{key:`set_object_at`,value:n(function(e,t){if(e<=this.length()){for(var n=1,r=this.head;n<e;)r=r.next,n++;r.value=t}},`set_object_at`)}]),e})()}),(function(e,t,r){function i(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)}n(i,`Point`),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.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)))},i.prototype.move=function(e,t){this.x=e,this.y=t},i.prototype.translate=function(e,t){this.x+=e,this.y+=t},i.prototype.equals=function(e){if(e.constructor.name==`Point`){var t=e;return this.x==t.x&&this.y==t.y}return this==e},i.prototype.toString=function(){return new i().constructor.name+`[x=`+this.x+`,y=`+this.y+`]`},e.exports=i}),(function(e,t,r){function i(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)}n(i,`RectangleD`),i.prototype.getX=function(){return this.x},i.prototype.setX=function(e){this.x=e},i.prototype.getY=function(){return this.y},i.prototype.setY=function(e){this.y=e},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},e.exports=i}),(function(e,t,r){var i=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 a(){}n(a,`UniqueIDGeneretor`),a.lastID=0,a.createID=function(e){return a.isPrimitive(e)?e:(e.uniqueID??(e.uniqueID=a.getString(),a.lastID++),e.uniqueID)},a.getString=function(e){return e??=a.lastID,`Object#`+e},a.isPrimitive=function(e){var t=typeof e>`u`?`undefined`:i(e);return e==null||t!=`object`&&t!=`function`},e.exports=a}),(function(e,t,r){function i(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)}n(i,`_toConsumableArray`);var a=r(0),o=r(6),s=r(3),c=r(1),l=r(5),u=r(4),d=r(17),f=r(27);function p(e){f.call(this),this.layoutQuality=a.QUALITY,this.createBendsAsNeeded=a.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=a.DEFAULT_INCREMENTAL,this.animationOnLayout=a.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=a.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=a.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=a.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,e!=null&&(this.isRemoteUse=e)}n(p,`Layout`),p.RANDOM_SEED=1,p.prototype=Object.create(f.prototype),p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},p.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},p.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},p.prototype.newGraphManager=function(){var e=new o(this);return this.graphManager=e,e},p.prototype.newGraph=function(e){return new l(null,this.graphManager,e)},p.prototype.newNode=function(e){return new s(this.graphManager,e)},p.prototype.newEdge=function(e){return new c(null,null,e)},p.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},p.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var e;return e=this.checkLayoutSuccess()?!1:this.layout(),a.ANIMATE===`during`?!1:(e&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,e)},p.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},p.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())}},p.prototype.update=function(e){if(e==null)this.update2();else if(e instanceof s){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 c){var i=e;i.vGraphObject!=null&&i.vGraphObject.update(i)}else if(e instanceof l){var a=e;a.vGraphObject!=null&&a.vGraphObject.update(a)}},p.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=a.QUALITY,this.animationDuringLayout=a.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=a.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=a.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=a.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=a.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=a.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},p.prototype.transform=function(e){if(e==null)this.transform(new u(0,0));else{var t=new d,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)}}},p.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())},p.prototype.getFlatForest=function(){for(var e=[],t=!0,n=this.graphManager.getRoot().getNodes(),r=!0,a=0;a<n.length;a++)n[a].getChild()!=null&&(r=!1);if(!r)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(i(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},p.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},p.prototype.createBendpointsFromDummyNodes=function(){var e=[];e=e.concat(this.graphManager.getAllEdges()),e=[].concat(i(this.edgeToDummyNodes.keys()),e);for(var t=0;t<e.length;t++){var n=e[t];if(n.bendpoints.length>0){for(var r=this.edgeToDummyNodes.get(n),a=0;a<r.length;a++){var o=r[a],s=new u(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)}}},p.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}},p.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},p.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=p}),(function(e,t,r){function i(){}n(i,`RandomSeed`),i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},e.exports=i}),(function(e,t,r){var i=r(4);function a(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}n(a,`Transform`),a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(e){this.lworldExtX=e},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(e){this.lworldExtY=e},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},a.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},a.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},a.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},a.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},a.prototype.inverseTransformPoint=function(e){return new i(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=a}),(function(e,t,r){function i(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)}n(i,`_toConsumableArray`);var a=r(15),o=r(7),s=r(0),c=r(8),l=r(9);function u(){a.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.springConstant=o.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=o.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}for(var d in n(u,`FDLayout`),u.prototype=Object.create(a.prototype),a)u[d]=a[d];u.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,i,a,c=this.getGraphManager().getAllEdges(),l=0;l<c.length;l++)e=c[l],e.idealLength=this.idealEdgeLength,e.isInterGraph&&(n=e.getSource(),r=e.getTarget(),i=e.getSourceInLca().getEstimatedSize(),a=e.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(e.idealLength+=i+a-2*s.SIMPLE_NODE_SIZE),t=e.getLca().getInclusionTreeDepth(),e.idealLength+=o.DEFAULT_EDGE_LENGTH*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(n.getInclusionTreeDepth()+r.getInclusionTreeDepth()-2*t))},u.prototype.initSpringEmbedder=function(){var e=this.getAllNodes().length;this.incremental?(e>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(e-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n<e.length;n++)t=e[n],this.calcSpringForce(t,t.idealLength)},u.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]:!1,n,r,i,a,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%o.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++)a=s[r],i.getOwner()==a.getOwner()&&this.calcRepulsionForce(i,a)},u.prototype.calcGravitationalForces=function(){for(var e,t=this.getAllNodesToApplyGravitation(),n=0;n<t.length;n++)e=t[n],this.calcGravitationalForce(e)},u.prototype.moveNodes=function(){for(var e=this.getAllNodes(),t,n=0;n<e.length;n++)t=e[n],t.move()},u.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=this.springConstant*(i-t),o=a*(e.lengthX/i),s=a*(e.lengthY/i),n.springForceX+=o,n.springForceY+=s,r.springForceX-=o,r.springForceY-=s)},u.prototype.calcRepulsionForce=function(e,t){var n=e.getRect(),r=t.getRect(),i=[,,],a=[,,,,],s,u,d,f,p,m,h;if(n.intersects(r)){c.calcSeparationAmount(n,r,i,o.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?(s=r.getCenterX()-n.getCenterX(),u=r.getCenterY()-n.getCenterY()):(c.getIntersection(n,r,a),s=a[2]-a[0],u=a[3]-a[1]),Math.abs(s)<o.MIN_REPULSION_DIST&&(s=l.sign(s)*o.MIN_REPULSION_DIST),Math.abs(u)<o.MIN_REPULSION_DIST&&(u=l.sign(u)*o.MIN_REPULSION_DIST),d=s*s+u*u,f=Math.sqrt(d),p=this.repulsionConstant*e.noOfChildren*t.noOfChildren/d,m=p*s/f,h=p*u/f,e.repulsionForceX-=m,e.repulsionForceY-=h,t.repulsionForceX+=m,t.repulsionForceY+=h},u.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))},u.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},u.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},u.prototype.calcNoOfChildrenForAllNodes=function(){for(var e,t=this.graphManager.getAllNodes(),n=0;n<t.length;n++)e=t[n],e.noOfChildren=e.getNoOfChildren()},u.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},u.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)},u.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())},u.prototype.calculateRepulsionForceOfANode=function(e,t,n,r){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&n||r){var a=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)&&!a.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&&a.add(s)}}e.surrounding=[].concat(i(a))}for(l=0;l<e.surrounding.length;l++)this.calcRepulsionForce(e,e.surrounding[l])},u.prototype.calcRepulsionRange=function(){return 0},e.exports=u}),(function(e,t,r){var i=r(1),a=r(7);function o(e,t,n){i.call(this,e,t,n),this.idealLength=a.DEFAULT_EDGE_LENGTH}for(var s in n(o,`FDLayoutEdge`),o.prototype=Object.create(i.prototype),i)o[s]=i[s];e.exports=o}),(function(e,t,r){var i=r(3);function a(e,t,n,r){i.call(this,e,t,n,r),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 n(a,`FDLayoutNode`),a.prototype=Object.create(i.prototype),i)a[o]=i[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,r){function i(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}n(i,`DimensionD`),i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},e.exports=i}),(function(e,t,r){var i=r(14);function a(){this.map={},this.keys=[]}n(a,`HashMap`),a.prototype.put=function(e,t){var n=i.createID(e);this.contains(n)||(this.map[n]=t,this.keys.push(e))},a.prototype.contains=function(e){return i.createID(e),this.map[e]!=null},a.prototype.get=function(e){var t=i.createID(e);return this.map[t]},a.prototype.keySet=function(){return this.keys},e.exports=a}),(function(e,t,r){var i=r(14);function a(){this.set={}}n(a,`HashSet`),a.prototype.add=function(e){var t=i.createID(e);this.contains(t)||(this.set[t]=e)},a.prototype.remove=function(e){delete this.set[i.createID(e)]},a.prototype.clear=function(){this.set={}},a.prototype.contains=function(e){return this.set[i.createID(e)]==e},a.prototype.isEmpty=function(){return this.size()===0},a.prototype.size=function(){return Object.keys(this.set).length},a.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]])},a.prototype.size=function(){return Object.keys(this.set).length},a.prototype.addAll=function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];this.add(r)}},e.exports=a}),(function(e,t,r){var i=(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 n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`);var o=r(11);e.exports=(function(){function e(t,n){a(this,e),(n!==null||n!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=t instanceof o?t.size():t.length,this._quicksort(t,0,r-1)}return n(e,`Quicksort`),i(e,[{key:`_quicksort`,value:n(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)}},`_quicksort`)},{key:`_partition`,value:n(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}},`_partition`)},{key:`_get`,value:n(function(e,t){return e instanceof o?e.get_object_at(t):e[t]},`_get`)},{key:`_set`,value:n(function(e,t,n){e instanceof o?e.set_object_at(t,n):e[t]=n},`_set`)},{key:`_swap`,value:n(function(e,t,n){var r=this._get(e,t);this._set(e,t,this._get(e,n)),this._set(e,n,r)},`_swap`)},{key:`_defaultCompareFunction`,value:n(function(e,t){return t>e},`_defaultCompareFunction`)}]),e})()}),(function(e,t,r){var i=(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 n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`),e.exports=(function(){function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;a(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,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 n(e,`NeedlemanWunsch`),i(e,[{key:`getScore`,value:n(function(){return this.score},`getScore`)},{key:`getAlignments`,value:n(function(){return this.alignments},`getAlignments`)},{key:`computeGrids`,value:n(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]},`computeGrids`)},{key:`alignmentTraceback`,value:n(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},`alignmentTraceback`)},{key:`getAllIndexes`,value:n(function(e,t){for(var n=[],r=-1;(r=e.indexOf(t,r+1))!==-1;)n.push(r);return n},`getAllIndexes`)},{key:`arrayAllMaxIndexes`,value:n(function(e){return this.getAllIndexes(e,Math.max.apply(null,e))},`arrayAllMaxIndexes`)}]),e})()}),(function(e,t,r){var i=n(function(){},`layoutBase`);i.FDLayout=r(18),i.FDLayoutConstants=r(7),i.FDLayoutEdge=r(19),i.FDLayoutNode=r(20),i.DimensionD=r(21),i.HashMap=r(22),i.HashSet=r(23),i.IGeometry=r(8),i.IMath=r(9),i.Integer=r(10),i.Point=r(12),i.PointD=r(4),i.RandomSeed=r(16),i.RectangleD=r(13),i.Transform=r(17),i.UniqueIDGeneretor=r(14),i.Quicksort=r(24),i.LinkedList=r(11),i.LGraphObject=r(2),i.LGraph=r(5),i.LEdge=r(1),i.LGraphManager=r(6),i.LNode=r(3),i.Layout=r(15),i.LayoutConstants=r(0),i.NeedlemanWunsch=r(25),e.exports=i}),(function(e,t,r){function i(){this.listeners=[]}n(i,`Emitter`);var a=i.prototype;a.addListener=function(e,t){this.listeners.push({event:e,callback:t})},a.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)}},a.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=i})])})}),s=t((e,t)=>{n((function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(o()):typeof define==`function`&&define.amd?define([`layout-base`],r):typeof e==`object`?e.coseBase=r(o()):n.coseBase=r(n.layoutBase)}),`webpackUniversalModuleDefinition`)(e,function(e){return(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return n(r,`__webpack_require__`),r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?n(function(){return e.default},`getDefault`):n(function(){return e},`getModuleExports`);return r.d(t,`a`,t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=``,r(r.s=7)})([(function(t,n){t.exports=e}),(function(e,t,r){var i=r(0).FDLayoutConstants;function a(){}for(var o in n(a,`CoSEConstants`),i)a[o]=i[o];a.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,a.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,a.DEFAULT_COMPONENT_SEPERATION=60,a.TILE=!0,a.TILING_PADDING_VERTICAL=10,a.TILING_PADDING_HORIZONTAL=10,a.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=a}),(function(e,t,r){var i=r(0).FDLayoutEdge;function a(e,t,n){i.call(this,e,t,n)}for(var o in n(a,`CoSEEdge`),a.prototype=Object.create(i.prototype),i)a[o]=i[o];e.exports=a}),(function(e,t,r){var i=r(0).LGraph;function a(e,t,n){i.call(this,e,t,n)}for(var o in n(a,`CoSEGraph`),a.prototype=Object.create(i.prototype),i)a[o]=i[o];e.exports=a}),(function(e,t,r){var i=r(0).LGraphManager;function a(e){i.call(this,e)}for(var o in n(a,`CoSEGraphManager`),a.prototype=Object.create(i.prototype),i)a[o]=i[o];e.exports=a}),(function(e,t,r){var i=r(0).FDLayoutNode,a=r(0).IMath;function o(e,t,n,r){i.call(this,e,t,n,r)}for(var s in n(o,`CoSENode`),o.prototype=Object.create(i.prototype),i)o[s]=i[s];o.prototype.move=function(){var e=this.graphManager.getLayout();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*a.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*a.sign(this.displacementY)),this.child==null||this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(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},o.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.moveBy(e,t),r.displacementX+=e,r.displacementY+=t):r.propogateDisplacementToChildren(e,t)},o.prototype.setPred1=function(e){this.pred1=e},o.prototype.getPred1=function(){return pred1},o.prototype.getPred2=function(){return pred2},o.prototype.setNext=function(e){this.next=e},o.prototype.getNext=function(){return next},o.prototype.setProcessed=function(e){this.processed=e},o.prototype.isProcessed=function(){return processed},e.exports=o}),(function(e,t,r){var i=r(0).FDLayout,a=r(4),o=r(3),s=r(5),c=r(2),l=r(1),u=r(0).FDLayoutConstants,d=r(0).LayoutConstants,f=r(0).Point,p=r(0).PointD,m=r(0).Layout,h=r(0).Integer,g=r(0).IGeometry,_=r(0).LGraph,v=r(0).Transform;function y(){i.call(this),this.toBeTiled={}}for(var b in n(y,`CoSELayout`),y.prototype=Object.create(i.prototype),i)y[b]=i[b];y.prototype.newGraphManager=function(){var e=new a(this);return this.graphManager=e,e},y.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},y.prototype.newNode=function(e){return new s(this.graphManager,e)},y.prototype.newEdge=function(e){return new c(null,null,e)},y.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=u.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=u.DEFAULT_REPULSION_STRENGTH,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,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=u.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},y.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},y.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){if(l.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.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(),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()),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},y.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},y.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()}},y.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},y.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}},y.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+=l.DEFAULT_COMPONENT_SEPERATION),r=0);var c=e[s],u=m.findCenterOfTree(c);t.x=a,t.y=i,o=y.radialLayout(c,u,t),o.y>r&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-o.x/2,d.WORLD_CENTER_Y-o.y/2))},y.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(t,null,0,359,0,r);var i=_.calculateBounds(e),a=new v;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)},y.branchRadialLayout=function(e,t,n,r,i,a){var o=(r-n+1)/2;o<0&&(o+=180);var s=(o+n)%360*g.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 _=h[0];h.splice(0,1);var v=u.indexOf(_);v>=0&&u.splice(v,1),p--,d--}m=t==null?0:(u.indexOf(h[0])+1)%p;for(var b=Math.abs(r-n)/d,x=m;f!=d;x=++x%p){var S=u[x].getOtherEnd(e);if(S!=t){var C=(n+f*b)%360,w=(C+b)%360;y.branchRadialLayout(S,e,C,w,i+a,a),f++}}},y.maxDiagonalInTree=function(e){for(var t=h.MIN_VALUE,n=0;n<e.length;n++){var r=e[n].getDiagonal();r>t&&(t=r)}return t},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.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],o=a.getParent();this.getNodeDegreeWithChildren(a)===0&&(o.id==null||!this.getToBeTiled(o))&&n.push(a)}for(var i=0;i<n.length;i++){var a=n[i],c=a.getParent().id;typeof t[c]>`u`&&(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 s(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 o=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),o.add(u)}}})},y.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)},y.prototype.clearZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=e.idToDummyNode[n];t[n]=e.tileNodes(e.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=t[n].width,r.rect.height=t[n].height})},y.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;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},y.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;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)})},y.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},y.prototype.getNodeDegree=function(e){for(var t=e.id,n=e.getEdges(),r=0,i=0;i<n.length;i++){var a=n[i];a.getSource().id!==a.getTarget().id&&(r+=1)}return r},y.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},y.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},y.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)}},y.prototype.adjustLocations=function(e,t,n,r,i){t+=r,n+=i;for(var a=t,o=0;o<e.rows.length;o++){var s=e.rows[o];t=a;for(var c=0,l=0;l<s.length;l++){var u=s[l];u.rect.x=t,u.rect.y=n,t+=u.rect.width+e.horizontalPadding,u.rect.height>c&&(c=u.rect.height)}n+=c+e.verticalPadding}},y.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];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})},y.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:l.TILING_PADDING_VERTICAL,horizontalPadding:l.TILING_PADDING_HORIZONTAL};e.sort(function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:+(e.rect.width*e.rect.height<t.rect.width*t.rect.height)});for(var r=0;r<e.length;r++){var i=e[r];n.rows.length==0?this.insertNodeToRow(n,i,0,t):this.canAddHorizontal(n,i.rect.width,i.rect.height)?this.insertNodeToRow(n,i,this.getShortestRowIndex(n),t):this.insertNodeToRow(n,i,n.rows.length,t),this.shiftToLastRow(n)}return n},y.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)},y.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},y.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},y.prototype.canAddHorizontal=function(e,t,n){var r=this.getShortestRowIndex(e);if(r<0)return!0;var i=e.rowWidth[r];if(i+e.horizontalPadding+t<=e.width)return!0;var a=0;e.rowHeight[r]<n&&r>0&&(a=n+e.verticalPadding-e.rowHeight[r]);var o=e.width-i>=t+e.horizontalPadding?(e.height+a)/(i+t+e.horizontalPadding):(e.height+a)/e.width;a=n+e.verticalPadding;var s;return s=e.width<t?(e.height+a)/t:(e.height+a)/e.width,s<1&&(s=1/s),o<1&&(o=1/o),o<s},y.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)}},y.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},y.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},y.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++)n=r[a],n.getEdges().length==1&&!n.getEdges()[0].isInterGraph&&n.getChild()==null&&(i.push([n,n.getEdges()[0],n.getOwner()]),t=!0);if(t==1){for(var o=[],s=0;s<i.length;s++)i[s][0].getEdges().length==1&&(o.push(i[s]),i[s][0].getOwner().remove(i[s][0]));e.push(o),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},y.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()},y.prototype.findPlaceforPrunedNode=function(e){var t,n,r=e[0];n=r==e[1].source?e[1].target:e[1].source;var i=n.startX,a=n.finishX,o=n.startY,s=n.finishY,c=[0,0,0,0];if(o>0)for(var l=i;l<=a;l++)c[0]+=this.grid[l][o-1].length+this.grid[l][o].length-1;if(a<this.grid.length-1)for(var l=o;l<=s;l++)c[1]+=this.grid[a+1][l].length+this.grid[a][l].length-1;if(s<this.grid[0].length-1)for(var l=i;l<=a;l++)c[2]+=this.grid[l][s+1].length+this.grid[l][s].length-1;if(i>0)for(var l=o;l<=s;l++)c[3]+=this.grid[i-1][l].length+this.grid[i][l].length-1;for(var d=h.MAX_VALUE,f,p,m=0;m<c.length;m++)c[m]<d?(d=c[m],f=1,p=m):c[m]==d&&f++;if(f==3&&d==0)c[0]==0&&c[1]==0&&c[2]==0?t=1:c[0]==0&&c[1]==0&&c[3]==0?t=0:c[0]==0&&c[2]==0&&c[3]==0?t=3:c[1]==0&&c[2]==0&&c[3]==0&&(t=2);else if(f==2&&d==0){var g=Math.floor(Math.random()*2);t=c[0]==0&&c[1]==0?g==0?0:1:c[0]==0&&c[2]==0?g==0?0:2:c[0]==0&&c[3]==0?g==0?0:3:c[1]==0&&c[2]==0?g==0?1:2:c[1]==0&&c[3]==0?g==0?1:3:g==0?2:3}else if(f==4&&d==0){var g=Math.floor(Math.random()*4);t=g}else t=p;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=y}),(function(e,t,n){var r={};r.layoutBase=n(0),r.CoSEConstants=n(1),r.CoSEEdge=n(2),r.CoSEGraph=n(3),r.CoSEGraphManager=n(4),r.CoSELayout=n(6),r.CoSENode=n(5),e.exports=r})])})}),c=e(t((e,t)=>{n((function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(s()):typeof define==`function`&&define.amd?define([`cose-base`],r):typeof e==`object`?e.cytoscapeCoseBilkent=r(s()):n.cytoscapeCoseBilkent=r(n.coseBase)}),`webpackUniversalModuleDefinition`)(e,function(e){return(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return n(r,`__webpack_require__`),r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?n(function(){return e.default},`getDefault`):n(function(){return e},`getModuleExports`);return r.d(t,`a`,t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=``,r(r.s=1)})([(function(t,n){t.exports=e}),(function(e,t,r){var i=r(0).layoutBase.LayoutConstants,a=r(0).layoutBase.FDLayoutConstants,o=r(0).CoSEConstants,s=r(0).CoSELayout,c=r(0).CoSENode,l=r(0).layoutBase.PointD,u=r(0).layoutBase.DimensionD,d={ready:n(function(){},`ready`),stop:n(function(){},`stop`),quality:`default`,nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:`end`,animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function f(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}n(f,`extend`);function p(e){this.options=f(d,e),m(this.options)}n(p,`_CoSELayout`);var m=n(function(e){e.nodeRepulsion!=null&&(o.DEFAULT_REPULSION_STRENGTH=a.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion),e.idealEdgeLength!=null&&(o.DEFAULT_EDGE_LENGTH=a.DEFAULT_EDGE_LENGTH=e.idealEdgeLength),e.edgeElasticity!=null&&(o.DEFAULT_SPRING_STRENGTH=a.DEFAULT_SPRING_STRENGTH=e.edgeElasticity),e.nestingFactor!=null&&(o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(o.DEFAULT_GRAVITY_STRENGTH=a.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(o.MAX_ITERATIONS=a.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(o.DEFAULT_GRAVITY_RANGE_FACTOR=a.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(o.DEFAULT_COOLING_FACTOR_INCREMENTAL=a.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.quality==`draft`?i.QUALITY=0:e.quality==`proof`?i.QUALITY=2:i.QUALITY=1,o.NODE_DIMENSIONS_INCLUDE_LABELS=a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,o.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!e.randomize,o.ANIMATE=a.ANIMATE=i.ANIMATE=e.animate,o.TILE=e.tile,o.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,o.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal},`getUserOptions`);p.prototype.run=function(){var e,t,r=this.options;this.idToLNode={};var i=this.layout=new s,a=this;a.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:`layoutstart`,layout:this});var o=i.newGraphManager();this.gm=o;var c=this.options.eles.nodes(),l=this.options.eles.edges();this.root=o.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(c),i);for(var u=0;u<l.length;u++){var d=l[u],f=this.idToLNode[d.data(`source`)],p=this.idToLNode[d.data(`target`)];if(f!==p&&f.getEdgesBetween(p).length==0){var m=o.add(i.newEdge(),f,p);m.id=d.id()}}var h=n(function(e,t){typeof e==`number`&&(e=t);var n=e.data(`id`),r=a.idToLNode[n];return{x:r.getRect().getCenterX(),y:r.getRect().getCenterY()}},`getPositions`),g=n(function o(){for(var s=n(function(){r.fit&&r.cy.fit(r.eles,r.padding),e||(e=!0,a.cy.one(`layoutready`,r.ready),a.cy.trigger({type:`layoutready`,layout:a}))},`afterReposition`),c=a.options.refresh,l,u=0;u<c&&!l;u++)l=a.stopped||a.layout.tick();if(l){i.checkLayoutSuccess()&&!i.isSubLayout&&i.doPostLayout(),i.tilingPostLayout&&i.tilingPostLayout(),i.isLayoutFinished=!0,a.options.eles.nodes().positions(h),s(),a.cy.one(`layoutstop`,a.options.stop),a.cy.trigger({type:`layoutstop`,layout:a}),t&&cancelAnimationFrame(t),e=!1;return}var d=a.layout.getPositionsData();r.eles.nodes().positions(function(e,t){if(typeof e==`number`&&(e=t),!e.isParent()){for(var n=e.id(),r=d[n],i=e;r==null&&(r=d[i.data(`parent`)]||d[`DummyCompound_`+i.data(`parent`)],d[n]=r,i=i.parent()[0],i!=null););return r==null?{x:e.position(`x`),y:e.position(`y`)}:{x:r.x,y:r.y}}}),s(),t=requestAnimationFrame(o)},`iterateAnimated`);return i.addListener(`layoutstarted`,function(){a.options.animate===`during`&&(t=requestAnimationFrame(g))}),i.runLayout(),this.options.animate!==`during`&&(a.options.eles.nodes().not(`:parent`).layoutPositions(a,a.options,h),e=!1),this},p.prototype.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})},p.prototype.processChildrenList=function(e,t,n){for(var r=t.length,i=0;i<r;i++){var a=t[i],o=a.children(),s,d=a.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s=a.outerWidth()!=null&&a.outerHeight()!=null?e.add(new c(n.graphManager,new l(a.position(`x`)-d.w/2,a.position(`y`)-d.h/2),new u(parseFloat(d.w),parseFloat(d.h)))):e.add(new c(this.graphManager)),s.id=a.data(`id`),s.paddingLeft=parseInt(a.css(`padding`)),s.paddingTop=parseInt(a.css(`padding`)),s.paddingRight=parseInt(a.css(`padding`)),s.paddingBottom=parseInt(a.css(`padding`)),this.options.nodeDimensionsIncludeLabels&&a.isParent()){var f=a.boundingBox({includeLabels:!0,includeNodes:!1}).w,p=a.boundingBox({includeLabels:!0,includeNodes:!1}).h,m=a.css(`text-halign`);s.labelWidth=f,s.labelHeight=p,s.labelPos=m}if(this.idToLNode[a.data(`id`)]=s,isNaN(s.rect.x)&&(s.rect.x=0),isNaN(s.rect.y)&&(s.rect.y=0),o!=null&&o.length>0){var h=n.getGraphManager().add(n.newGraph(),s);this.processChildrenList(h,o,n)}}},p.prototype.stop=function(){return this.stopped=!0,this};var h=n(function(e){e(`layout`,`cose-bilkent`,p)},`register`);typeof cytoscape<`u`&&h(cytoscape),e.exports=h})])})})(),1);a.use(c.default);function l(e,t){e.forEach(e=>{let n={id:e.id,labelText:e.label,height:e.height,width:e.width,padding:e.padding??0};Object.keys(e).forEach(t=>{[`id`,`label`,`height`,`width`,`padding`,`x`,`y`].includes(t)||(n[t]=e[t])}),t.add({group:`nodes`,data:n,position:{x:e.x??0,y:e.y??0}})})}n(l,`addNodes`);function u(e,t){e.forEach(e=>{let n={id:e.id,source:e.start,target:e.end};Object.keys(e).forEach(t=>{[`id`,`start`,`end`].includes(t)||(n[t]=e[t])}),t.add({group:`edges`,data:n})})}n(u,`addEdges`);function d(e){return new Promise(t=>{let n=r(`body`).append(`div`).attr(`id`,`cy`).attr(`style`,`display:none`),o=a({container:document.getElementById(`cy`),style:[{selector:`edge`,style:{"curve-style":`bezier`}}]});n.remove(),l(e.nodes,o),u(e.edges,o),o.nodes().forEach(function(e){e.layoutDimensions=()=>{let t=e.data();return{w:t.width,h:t.height}}}),o.layout({name:`cose-bilkent`,quality:`proof`,styleEnabled:!1,animate:!1}).run(),o.ready(e=>{i.info(`Cytoscape ready`,e),t(o)})})}n(d,`createCytoscapeInstance`);function f(e){return e.nodes().map(e=>{let t=e.data(),n=e.position(),r={id:t.id,x:n.x,y:n.y};return Object.keys(t).forEach(e=>{e!==`id`&&(r[e]=t[e])}),r})}n(f,`extractPositionedNodes`);function p(e){return e.edges().map(e=>{let t=e.data(),n=e._private.rscratch,r={id:t.id,source:t.source,target:t.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(t).forEach(e=>{[`id`,`source`,`target`].includes(e)||(r[e]=t[e])}),r})}n(p,`extractPositionedEdges`);async function m(e,t){i.debug(`Starting cose-bilkent layout algorithm`);try{h(e);let t=await d(e),n=f(t),r=p(t);return i.debug(`Layout completed: ${n.length} nodes, ${r.length} edges`),{nodes:n,edges:r}}catch(e){throw i.error(`Error in cose-bilkent layout algorithm:`,e),e}}n(m,`executeCoseBilkentLayout`);function h(e){if(!e)throw Error(`Layout data is required`);if(!e.config)throw Error(`Configuration is required in layout data`);if(!e.rootNode)throw Error(`Root node is required`);if(!e.nodes||!Array.isArray(e.nodes))throw Error(`No nodes found in layout data`);if(!Array.isArray(e.edges))throw Error(`Edges array is required in layout data`);return!0}n(h,`validateLayoutData`);var g=n(async(e,t,{insertCluster:n,insertEdge:r,insertEdgeLabel:i,insertMarkers:a,insertNode:o,log:s,positionEdgeLabel:c},{algorithm:l})=>{let u={},d={},f=t.select(`g`);a(f,e.markers,e.type,e.diagramId);let p=f.insert(`g`).attr(`class`,`subgraphs`),h=f.insert(`g`).attr(`class`,`edgePaths`),g=f.insert(`g`).attr(`class`,`edgeLabels`),_=f.insert(`g`).attr(`class`,`nodes`);s.debug(`Inserting nodes into DOM for dimension calculation`),await Promise.all(e.nodes.map(async t=>{if(t.isGroup){let e={...t};d[t.id]=e,u[t.id]=e,await n(p,t)}else{let n={...t};u[t.id]=n;let r=await o(_,t,{config:e.config,dir:e.direction||`TB`}),i=r.node().getBBox();n.width=i.width,n.height=i.height,n.domId=r,s.debug(`Node ${t.id} dimensions: ${i.width}x${i.height}`)}})),s.debug(`Running cose-bilkent layout algorithm`);let v=await m({...e,nodes:e.nodes.map(e=>{let t=u[e.id];return{...e,width:t.width,height:t.height}})},e.config);s.debug(`Positioning nodes based on layout results`),v.nodes.forEach(e=>{let t=u[e.id];t?.domId&&(t.domId.attr(`transform`,`translate(${e.x}, ${e.y})`),t.x=e.x,t.y=e.y,s.debug(`Positioned node ${t.id} at center (${e.x}, ${e.y})`))}),v.edges.forEach(t=>{let n=e.edges.find(e=>e.id===t.id);n&&(n.points=[{x:t.startX,y:t.startY},{x:t.midX,y:t.midY},{x:t.endX,y:t.endY}])}),s.debug(`Inserting and positioning edges`),await Promise.all(e.edges.map(async t=>{await i(g,t);let n=u[t.start??``],a=u[t.end??``];if(n&&a){let i=v.edges.find(e=>e.id===t.id);if(i){s.debug(`APA01 positionedEdge`,i);let o={...t};c(o,r(h,o,d,e.type,n,a,e.diagramId))}else{let i={...t,points:[{x:n.x||0,y:n.y||0},{x:a.x||0,y:a.y||0}]};c(i,r(h,i,d,e.type,n,a,e.diagramId))}}})),s.debug(`Cose-bilkent rendering completed`)},`render`);export{g as render};
@@ -0,0 +1,4 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-BpMj3rQl.js";import{Ct as t,_ as n,a as r,d as i,f as a,g as o,i as s,m as c,o as l,p as u,r as d,s as f,tn as p,u as m,w as h}from"./index-oL-ZNYwb.js";import{A as g,a as _,k as v,p as y}from"./chunk-W44A43WB-AOmgoT-X.js";import{t as b}from"./chunk-KRXBNO2N-DpR8iDt8.js";function x(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:S(e),edges:C(e)};return g(e.graph())||(t.value=y(e.graph())),t}e(x,`write`);function S(e){return v(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return g(n)||(i.value=n),g(r)||(i.parent=r),i})}e(S,`writeNodes`);function C(e){return v(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return g(t.name)||(r.name=t.name),g(n)||(r.value=n),r})}e(C,`writeEdges`);var w=new Map,T=new Map,E=new Map,D=e(()=>{T.clear(),E.clear(),w.clear()},`clear`),O=e((e,t)=>{let n=T.get(t)||[];return p.trace(`In isDescendant`,t,` `,e,` = `,n.includes(e)),n.includes(e)},`isDescendant`),k=e((e,t)=>{let n=T.get(t)||[];return p.info(`Descendants of `,t,` is `,n),p.info(`Edge is `,e),e.v===t||e.w===t?!1:n?n.includes(e.v)||O(e.v,t)||O(e.w,t)||n.includes(e.w):(p.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),A=e((e,t,n,r)=>{p.warn(`Copying children of `,e,`root`,r,`data`,t.node(e),r);let i=t.children(e)||[];e!==r&&i.push(e),p.warn(`Copying (nodes) clusterId`,e,`nodes`,i),i.forEach(i=>{if(t.children(i).length>0)A(i,t,n,r);else{let a=t.node(i);p.info(`cp `,i,` to `,r,` with parent `,e),n.setNode(i,a),r!==t.parent(i)&&(p.warn(`Setting parent`,i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(p.debug(`Setting parent`,i,e),n.setParent(i,e)):(p.info(`In copy `,e,`root`,r,`data`,t.node(e),r),p.debug(`Not Setting parent for node=`,i,`cluster!==rootId`,e!==r,`node!==clusterId`,i!==e));let o=t.edges(i);p.debug(`Copying Edges`,o),o.forEach(i=>{p.info(`Edge`,i);let a=t.edge(i.v,i.w,i.name);p.info(`Edge data`,a,r);try{k(i,r)?(p.info(`Copying as `,i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),p.info(`newGraph edges `,n.edges(),n.edge(n.edges()[0]))):p.info(`Skipping copy of edge `,i.v,`-->`,i.w,` rootId: `,r,` clusterId:`,e)}catch(e){p.error(e)}})}p.debug(`Removing node`,i),t.removeNode(i)})},`copy`),j=e((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)E.set(i,e),r=[...r,...j(i,t)];return r},`extractDescendants`),M=e((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),N=e((e,t,n)=>{let r=t.children(e);if(p.trace(`Searching children of id `,e,r),r.length<1)return e;let i;for(let e of r){let r=N(e,t,n),a=M(t,n,r);if(r)if(a.length>0)i=r;else return r}return i},`findNonClusterChild`),P=e(e=>!w.has(e)||!w.get(e).externalConnections?e:w.has(e)?w.get(e).id:e,`getAnchorId`),F=e((e,t)=>{if(!e||t>10){p.debug(`Opting out, no graph `);return}else p.debug(`Opting in, graph `);e.nodes().forEach(function(t){e.children(t).length>0&&(p.warn(`Cluster identified`,t,` Replacement id in edges: `,N(t,e,t)),T.set(t,j(t,e)),w.set(t,{id:N(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let n=e.children(t),r=e.edges();n.length>0?(p.debug(`Cluster identified`,t,T),r.forEach(e=>{O(e.v,t)^O(e.w,t)&&(p.warn(`Edge: `,e,` leaves cluster `,t),p.warn(`Descendants of XXX `,t,`: `,T.get(t)),w.get(t).externalConnections=!0)})):p.debug(`Not a cluster `,t,T)});for(let t of w.keys()){let n=w.get(t).id,r=e.parent(n);r!==t&&w.has(r)&&!w.get(r).externalConnections&&(w.get(t).id=r)}e.edges().forEach(function(t){let n=e.edge(t);p.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),p.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(p.warn(`Fix XXX`,w,`ids:`,t.v,t.w,`Translating: `,w.get(t.v),` --- `,w.get(t.w)),w.get(t.v)||w.get(t.w)){if(p.warn(`Fixing and trying - removing XXX`,t.v,t.w,t.name),r=P(t.v),i=P(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let i=e.parent(r);w.get(i).externalConnections=!0,n.fromCluster=t.v}if(i!==t.w){let r=e.parent(i);w.get(r).externalConnections=!0,n.toCluster=t.w}p.warn(`Fix Replacing with XXX`,r,i,t.name),e.setEdge(r,i,n,t.name)}}),p.warn(`Adjusted Graph`,x(e)),I(e,0),p.trace(w)},`adjustClustersAndEdges`),I=e((e,t)=>{if(p.warn(`extractor - `,t,x(e),e.children(`D`)),t>10){p.error(`Bailing out`);return}let n=e.nodes(),r=!1;for(let t of n){let n=e.children(t);r||=n.length>0}if(!r){p.debug(`Done, no node has children`,e.nodes());return}p.debug(`Nodes = `,n,t);for(let r of n)if(p.debug(`Extracting node`,r,w,w.has(r)&&!w.get(r).externalConnections,!e.parent(r),e.node(r),e.children(`D`),` Depth `,t),!w.has(r))p.debug(`Not a cluster`,r,t);else if(!w.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){p.warn(`Cluster without external connections, without a parent and with children`,r,t);let n=e.graph().rankdir===`TB`?`LR`:`TB`;w.get(r)?.clusterData?.dir&&(n=w.get(r).clusterData.dir,p.warn(`Fixing dir`,w.get(r).clusterData.dir,n));let i=new _({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});p.warn(`Old graph before copy`,x(e)),A(r,e,i,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:w.get(r).clusterData,label:w.get(r).label,graph:i}),p.warn(`New graph after copy node: (`,r,`)`,x(i)),p.debug(`Old graph after copy`,x(e))}else p.warn(`Cluster ** `,r,` **not meeting the criteria !externalConnections:`,!w.get(r).externalConnections,` no parent: `,!e.parent(r),` children `,e.children(r)&&e.children(r).length>0,e.children(`D`),t),p.debug(w);n=e.nodes(),p.warn(`New list of nodes`,n);for(let r of n){let n=e.node(r);p.warn(` Now next level`,r,n),n?.clusterNode&&I(n.graph,t+1)}},`extractor`),L=e((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=L(e,e.children(t));n=[...n,...r]}),n},`sorter`),R=e(e=>L(e,e.children()),`sortNodesByHierarchy`),z=e(async(t,i,l,f,m,g)=>{p.warn(`Graph in recursive render:XAX`,x(i),m);let _=i.graph().rankdir;p.trace(`Dir in recursive render - dir:`,_);let v=t.insert(`g`).attr(`class`,`root`);i.nodes()?p.info(`Recursive render XXX`,i.nodes()):p.info(`No nodes found for`,i),i.edges().length>0&&p.info(`Recursive edges`,i.edge(i.edges()[0]));let y=v.insert(`g`).attr(`class`,`clusters`),S=v.insert(`g`).attr(`class`,`edgePaths`),C=v.insert(`g`).attr(`class`,`edgeLabels`),T=v.insert(`g`).attr(`class`,`nodes`);await Promise.all(i.nodes().map(async function(e){let t=i.node(e);if(m!==void 0){let t=JSON.parse(JSON.stringify(m.clusterData));p.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,e,`
3
+ data=`,t.height,`
4
+ Parent cluster`,m.height),i.setNode(m.id,t),i.parent(e)||(p.trace(`Setting parent`,e,m.id),i.setParent(e,m.id,t))}if(p.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(i.node(e))),t?.clusterNode){p.info(`Cluster identified XBX`,e,t.width,i.node(e));let{ranksep:r,nodesep:a}=i.graph();t.graph.setGraph({...t.graph.graph(),ranksep:r+25,nodesep:a});let s=await z(T,t.graph,l,f,i.node(e),g),c=s.elem;n(t,c),t.diff=s.diff||0,p.info(`New compound node after recursive render XAX`,e,`width`,t.width,`height`,t.height),o(c,t)}else i.children(e).length>0?(p.trace(`Cluster - the non recursive path XBX`,e,t.id,t,t.width,`Graph:`,i),p.trace(N(t.id,i)),w.set(t.id,{id:N(t.id,i),node:t})):(p.trace(`Node - the non recursive path XAX`,e,T,i.node(e),_),await c(T,i.node(e),{config:g,dir:_}))})),await e(async()=>{let e=i.edges().map(async function(e){let t=i.edge(e.v,e.w,e.name);p.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),p.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(i.edge(e))),p.info(`Fix`,w,`ids:`,e.v,e.w,`Translating: `,w.get(e.v),w.get(e.w)),await r(C,t)});await Promise.all(e)},`processEdges`)(),p.info(`Graph before layout:`,JSON.stringify(x(i))),p.info(`############################################# XXX`),p.info(`### Layout ### XXX`),p.info(`############################################# XXX`),b(i),p.info(`Graph after layout:`,JSON.stringify(x(i)));let E=0,{subGraphTitleTotalMargin:D}=h(g);return await Promise.all(R(i).map(async function(e){let t=i.node(e);if(p.info(`Position XBX => `+e+`: (`+t.x,`,`+t.y,`) width: `,t.width,` height: `,t.height),t?.clusterNode)t.y+=D,p.info(`A tainted cluster node XBX1`,e,t.id,t.width,t.height,t.x,t.y,i.parent(e)),w.get(t.id).node=t,a(t);else if(i.children(e).length>0){p.info(`A pure cluster node XBX1`,e,t.id,t.x,t.y,t.width,t.height,i.parent(e)),t.height+=D,i.node(t.parentId);let n=t?.padding/2||0,r=t?.labelBBox?.height||0,a=r-n||0;p.debug(`OffsetY`,a,`labelHeight`,r,`halfPadding`,n),await u(y,t),w.get(t.id).node=t}else{let e=i.node(t.parentId);t.y+=D/2,p.info(`A regular node XBX1 - using the padding`,t.id,`parent`,t.parentId,t.width,t.height,t.x,t.y,`offsetY`,t.offsetY,`parent`,e,e?.offsetY,t),a(t)}})),i.edges().forEach(function(e){let t=i.edge(e);p.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(t),t),t.points.forEach(e=>e.y+=D/2),s(t,d(S,t,w,l,i.node(e.v),i.node(e.w),f))}),i.nodes().forEach(function(e){let t=i.node(e);p.info(e,t.type,t.diff),t.isGroup&&(E=t.diff)}),p.warn(`Returning from recursive render XAX`,v,E),{elem:v,diff:E}},`recursiveRender`),B=e(async(e,n)=>{let r=new _({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=n.select(`g`);l(a,e.markers,e.type,e.diagramId),i(),f(),m(),D(),e.nodes.forEach(e=>{r.setNode(e.id,{...e}),e.parentId&&r.setParent(e.id,e.parentId)}),p.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,n=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=r.node(t);r.setNode(n,{domId:n,id:n,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),r.setParent(n,a.parentId),r.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),r.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e);o.label=``,o.arrowTypeEnd=`none`,o.endLabelLeft=``,o.endLabelRight=``,o.startLabelLeft=``,o.id=t+`-cyclic-special-1`,s.startLabelRight=``,s.startLabelLeft=``,s.endLabelLeft=``,s.endLabelRight=``,s.arrowTypeStart=`none`,s.arrowTypeEnd=`none`,s.id=t+`-cyclic-special-mid`,c.label=``,c.startLabelRight=``,c.startLabelLeft=``,c.arrowTypeStart=`none`,a.isGroup&&(o.fromCluster=t,c.toCluster=t),c.id=t+`-cyclic-special-2`,c.arrowTypeStart=`none`,r.setEdge(t,n,o,t+`-cyclic-special-0`),r.setEdge(n,i,s,t+`-cyclic-special-1`),r.setEdge(i,t,c,t+`-cyc<lic-special-2`)}else r.setEdge(e.start,e.end,{...e},e.id)}),p.warn(`Graph at first:`,JSON.stringify(x(r))),F(r),p.warn(`Graph after XAX:`,JSON.stringify(x(r)));let o=t();await z(a,r,e.type,e.diagramId,void 0,o)},`render`);export{B as render};
@@ -0,0 +1,43 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-BpMj3rQl.js";import{D as t,W as n,Z as r,dt as i,ft as a,gt as o,ht as s,lt as c,nt as l,pt as u,tn as d,vt as f,wt as p,xt as m}from"./index-oL-ZNYwb.js";import"./chunk-4R4BOZG6-D3gm7tYj.js";import"./chunk-RERM46MO-Betu1cSy.js";import{t as h}from"./chunk-JQRUD6KW-DElaNjc0.js";import{t as g}from"./chunk-2T2R6R2M-B_pq_2nf.js";import"./chunk-UP6H54XL-0YWa0NDg.js";import"./chunk-UXSXWOXI-CSz0OXpz.js";import"./chunk-C62D2QBJ-CvFF2PnB.js";import"./chunk-CEXFNPSA-DdNtJtrF.js";import"./chunk-J5EP6P6S-DtcVaAJI.js";import"./chunk-RLI5ZMPA-BFUxCvX2.js";import"./chunk-2UTLFMKG-CpoohCFN.js";import"./chunk-RKZBBQEN-Cutpza0t.js";import"./chunk-KGYTTC2M-D0K5or7e.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v={axes:[],curves:[],options:_},y=structuredClone(v),b=c.radar,x=e(()=>t({...b,...r().radar}),`getConfig`),S=e(()=>y.axes,`getAxes`),C=e(()=>y.curves,`getCurves`),w=e(()=>y.options,`getOptions`),T=e(e=>{y.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),E=e(e=>{y.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:D(e.entries)}))},`setCurves`),D=e(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=S();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),O={getAxes:S,getCurves:C,getOptions:w,setAxes:T,setCurves:E,setOptions:e(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});y.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule}},`setOptions`),getConfig:x,clear:e(()=>{m(),y=structuredClone(v)},`clear`),setAccTitle:i,getAccTitle:p,setDiagramTitle:a,getDiagramTitle:f,getAccDescription:l,setAccDescription:o},k=e(e=>{h(e,O);let{axes:t,curves:n,options:r}=e;O.setAxes(t),O.setCurves(n),O.setOptions(r)},`populate`),A={parse:e(async e=>{let t=await g(`radar`,e);d.debug(t),k(t)},`parse`)},j=e((e,t,r,i)=>{let a=i.db,o=a.getAxes(),s=a.getCurves(),c=a.getOptions(),l=a.getConfig(),u=a.getDiagramTitle(),d=M(n(t),l),f=c.max??Math.max(...s.map(e=>Math.max(...e.entries))),p=c.min,m=Math.min(l.width,l.height)/2;N(d,o,m,c.ticks,c.graticule),P(d,o,m,l),F(d,o,s,p,f,c.graticule,l),R(d,s,c.showLegend,l),d.append(`text`).attr(`class`,`radarTitle`).text(u).attr(`x`,0).attr(`y`,-l.height/2-l.marginTop)},`draw`),M=e((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return u(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),N=e((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),P=e((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2;e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*Math.cos(s)).attr(`y2`,n*r.axisScaleFactor*Math.sin(s)).attr(`class`,`radarAxisLine`),e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*Math.cos(s)).attr(`y`,n*r.axisLabelFactor*Math.sin(s)).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function F(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=I(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,L(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}e(F,`drawCurves`);function I(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}e(I,`relativeRadius`);function L(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}e(L,`closedRoundCurve`);function R(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}e(R,`drawLegend`);var z={draw:j},B=e((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
2
+ .radarCurve-${r} {
3
+ color: ${i};
4
+ fill: ${i};
5
+ fill-opacity: ${t.curveOpacity};
6
+ stroke: ${i};
7
+ stroke-width: ${t.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${i};
11
+ fill-opacity: ${t.curveOpacity};
12
+ stroke: ${i};
13
+ }
14
+ `}return n},`genIndexStyles`),V=e(e=>{let n=t(s(),r().themeVariables);return{themeVariables:n,radarOptions:t(n.radar,e)}},`buildRadarStyleOptions`),H={parser:A,db:O,renderer:z,styles:e(({radar:e}={})=>{let{themeVariables:t,radarOptions:n}=V(e);return`
15
+ .radarTitle {
16
+ font-size: ${t.fontSize};
17
+ color: ${t.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${n.axisColor};
23
+ stroke-width: ${n.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ dominant-baseline: middle;
27
+ text-anchor: middle;
28
+ font-size: ${n.axisLabelFontSize}px;
29
+ color: ${n.axisColor};
30
+ }
31
+ .radarGraticule {
32
+ fill: ${n.graticuleColor};
33
+ fill-opacity: ${n.graticuleOpacity};
34
+ stroke: ${n.graticuleColor};
35
+ stroke-width: ${n.graticuleStrokeWidth};
36
+ }
37
+ .radarLegendText {
38
+ text-anchor: start;
39
+ font-size: ${n.legendFontSize}px;
40
+ dominant-baseline: hanging;
41
+ }
42
+ ${B(t,n)}
43
+ `},`styles`)};export{H as diagram};
@@ -0,0 +1,24 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-BpMj3rQl.js";import{B as t,Bt as n,D as r,Dt as i,Lt as a,Pt as o,W as s,Yt as c,Z as l,dt as u,ft as d,gt as f,ht as p,lt as m,nt as h,pt as g,tn as _,vt as v,wt as y,xt as b,z as x}from"./index-oL-ZNYwb.js";import"./chunk-4R4BOZG6-D3gm7tYj.js";import"./chunk-RERM46MO-Betu1cSy.js";import{t as S}from"./chunk-JQRUD6KW-DElaNjc0.js";import{t as C}from"./chunk-2T2R6R2M-B_pq_2nf.js";import"./chunk-UP6H54XL-0YWa0NDg.js";import"./chunk-UXSXWOXI-CSz0OXpz.js";import"./chunk-C62D2QBJ-CvFF2PnB.js";import"./chunk-CEXFNPSA-DdNtJtrF.js";import"./chunk-J5EP6P6S-DtcVaAJI.js";import"./chunk-RLI5ZMPA-BFUxCvX2.js";import"./chunk-2UTLFMKG-CpoohCFN.js";import"./chunk-RKZBBQEN-Cutpza0t.js";import"./chunk-KGYTTC2M-D0K5or7e.js";import{t as w}from"./chunk-ZXARS5L4-DIzgxjMw.js";var T=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=u,this.getAccTitle=y,this.setDiagramTitle=d,this.getDiagramTitle=v,this.getAccDescription=h,this.setAccDescription=f}static{e(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=m,t=l();return r({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{x(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){b(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function E(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(E,`buildHierarchy`);var D=e((t,n)=>{S(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=O(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=E(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),O=e(e=>e.name?String(e.name):``,`getItemName`),k={parser:{yy:void 0},parse:e(async e=>{try{let t=await C(`treemap`,e);_.debug(`Treemap AST:`,t);let n=k.parser?.yy;if(!(n instanceof T))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);D(t,n)}catch(e){throw _.error(`Error parsing treemap:`,e),e}},`parse`)},A=10,j=10,M=25,N={draw:e((r,u,d,f)=>{let p=f.db,m=p.getConfig(),h=m.padding??A,v=p.getDiagramTitle(),y=p.getRoot(),{themeVariables:b}=l();if(!y)return;let x=v?30:0,S=s(u),C=m.nodeWidth?m.nodeWidth*j:960,T=m.nodeHeight?m.nodeHeight*j:500,E=C,D=T+x;S.attr(`viewBox`,`0 0 ${E} ${D}`),g(S,D,E,m.useMaxWidth);let O;try{let t=m.valueFormat||`,`;if(t===`$0,0`)O=e(e=>`$`+i(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;O=e(e=>`$`+i(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);O=e(e=>`$`+i(n||``)(e),`valueFormat`)}else O=i(t)}catch(e){_.error(`Error creating format function:`,e),O=i(`,`)}let k=o().range([`transparent`,b.cScale0,b.cScale1,b.cScale2,b.cScale3,b.cScale4,b.cScale5,b.cScale6,b.cScale7,b.cScale8,b.cScale9,b.cScale10,b.cScale11]),N=o().range([`transparent`,b.cScalePeer0,b.cScalePeer1,b.cScalePeer2,b.cScalePeer3,b.cScalePeer4,b.cScalePeer5,b.cScalePeer6,b.cScalePeer7,b.cScalePeer8,b.cScalePeer9,b.cScalePeer10,b.cScalePeer11]),P=o().range([b.cScaleLabel0,b.cScaleLabel1,b.cScaleLabel2,b.cScaleLabel3,b.cScaleLabel4,b.cScaleLabel5,b.cScaleLabel6,b.cScaleLabel7,b.cScaleLabel8,b.cScaleLabel9,b.cScaleLabel10,b.cScaleLabel11]);v&&S.append(`text`).attr(`x`,E/2).attr(`y`,x/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(v);let F=S.append(`g`).attr(`transform`,`translate(0, ${x})`).attr(`class`,`treemapContainer`),I=a(y).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),L=n().size([C,T]).paddingTop(e=>e.children&&e.children.length>0?M+j:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?j:0).paddingRight(e=>e.children&&e.children.length>0?j:0).paddingBottom(e=>e.children&&e.children.length>0?j:0).round(!0)(I),R=L.descendants().filter(e=>e.children&&e.children.length>0),z=F.selectAll(`.treemapSection`).data(R).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);z.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,M).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),z.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${u}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,M),z.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>k(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>N(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let n=t({cssCompiledStyles:e.data.cssCompiledStyles});return n.nodeStyles+`;`+n.borderStyles.join(`;`)}),z.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,M/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+P(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+t({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=c(this),n=e.data.name;t.text(n);let r=e.x1-e.x0,i;i=m.showValues!==!1&&e.value?r-10-30-10-6:r-6-6;let a=Math.max(15,i),o=t.node();if(o.getComputedTextLength()>a){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),o.getComputedTextLength()>a&&t.text(``);break}if(t.text(e+`...`),o.getComputedTextLength()<=a)break}}}),m.showValues!==!1&&z.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,M/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?O(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+P(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+t({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let B=L.leaves(),V=F.selectAll(`.treemapLeafGroup`).data(B).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);V.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?k(e.parent.data.name):k(e.data.name)).attr(`style`,e=>t({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?k(e.parent.data.name):k(e.data.name)).attr(`stroke-width`,3),V.append(`clipPath`).attr(`id`,(e,t)=>`clip-${u}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),V.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:`+P(e.data.name)+`;`+t({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${u}-${t})`).text(e=>e.data.name).each(function(e){let t=c(this),n=e.x1-e.x0,r=e.y1-e.y0,i=t.node(),a=n-8,o=r-8;if(a<10||o<10){t.style(`display`,`none`);return}let s=parseInt(t.style(`font-size`),10),l=.6;for(;i.getComputedTextLength()>a&&s>8;)s--,t.style(`font-size`,`${s}px`);let u=Math.max(6,Math.min(28,Math.round(s*l))),d=s+2+u;for(;d>o&&s>8&&(s--,u=Math.max(6,Math.min(28,Math.round(s*l))),!(u<6&&s===8));)t.style(`font-size`,`${s}px`),d=s+2+u;t.style(`font-size`,`${s}px`),(i.getComputedTextLength()>a||s<8||o<s)&&t.style(`display`,`none`)}),m.showValues!==!1&&V.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:`+P(e.data.name)+`;`+t({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${u}-${t})`).text(e=>e.value?O(e.value):``).each(function(e){let t=c(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let r=c(n).select(`.treemapLabel`);if(r.empty()||r.style(`display`)===`none`){t.style(`display`,`none`);return}let i=parseFloat(r.style(`font-size`)),a=Math.max(6,Math.min(28,Math.round(i*.6)));t.style(`font-size`,`${a}px`);let o=(e.y1-e.y0)/2+i/2+2;t.attr(`y`,o);let s=e.x1-e.x0,l=e.y1-e.y0-4,u=s-8;t.node().getComputedTextLength()>u||o+a>l||a<6?t.style(`display`,`none`):t.style(`display`,null)}),w(S,m.diagramPadding??8,`flowchart`,m?.useMaxWidth||!1)},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},P={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},F={parser:k,get db(){return new T},renderer:N,styles:e(({treemap:e}={})=>{let t=r(p(),l().themeVariables),n=r(P,e),i=n.titleColor??t.titleColor,a=n.labelColor??t.textColor,o=n.valueColor??t.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${n.sectionStrokeColor};
4
+ stroke-width: ${n.sectionStrokeWidth};
5
+ fill: ${n.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${n.leafStrokeColor};
9
+ stroke-width: ${n.leafStrokeWidth};
10
+ fill: ${n.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${a};
14
+ font-size: ${n.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${o};
18
+ font-size: ${n.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${i};
22
+ font-size: ${n.titleFontSize};
23
+ }
24
+ `},`getStyles`)};export{F as diagram};
@@ -0,0 +1,3 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-BpMj3rQl.js";import{A as t,Ct as n,D as r,F as i,J as a,Yt as o,Z as s,dt as c,ft as l,gt as u,lt as d,nt as f,rt as p,tn as m,vt as h,wt as g,xt as _}from"./index-oL-ZNYwb.js";import{b as ee}from"./chunk-4R4BOZG6-D3gm7tYj.js";import"./chunk-RERM46MO-Betu1cSy.js";import{t as te}from"./chunk-JQRUD6KW-DElaNjc0.js";import{t as ne}from"./chunk-2T2R6R2M-B_pq_2nf.js";import"./chunk-UP6H54XL-0YWa0NDg.js";import"./chunk-UXSXWOXI-CSz0OXpz.js";import"./chunk-C62D2QBJ-CvFF2PnB.js";import"./chunk-CEXFNPSA-DdNtJtrF.js";import"./chunk-J5EP6P6S-DtcVaAJI.js";import"./chunk-RLI5ZMPA-BFUxCvX2.js";import"./chunk-2UTLFMKG-CpoohCFN.js";import"./chunk-RKZBBQEN-Cutpza0t.js";import"./chunk-KGYTTC2M-D0K5or7e.js";var v=`position frame`,y=`frame positioned`,b=`position relation`,x=`relation positioned`,re=e(function(e){m.debug(`options str`,e)},`setOptions`),ie=e(function(){return{}},`getOptions`),ae=e(function(){S(),_()},`clear`);function S(){C={}}e(S,`reset`);var oe=d.eventmodeling,se=e(()=>r({...oe,...s().eventmodeling}),`getConfig`),C={};function w(){let e=ce,{ast:t}=C,n=D();if(!t)throw Error(`No data for EventModel`);return t.frames.forEach((r,i)=>{let a=P(r,t.dataEntities,n);e=J(e,{$kind:v,index:i,frame:r,textProps:a});let o;V(r)?(m.debug(`source frame`,r.sourceFrames),o=t.frames.filter(e=>r.sourceFrames.some(t=>t.$refText===e.name)),o.forEach(t=>{e=J(e,{$kind:b,index:i,frame:r,sourceFrame:t})})):e=J(e,{$kind:b,index:i,frame:r})}),e={...e,sortedSwimlanesArray:R(e.swimlanes)},e}e(w,`getState`);function T(e){C.ast=e}e(T,`setAst`);var E={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function D(){return E}e(D,`getDiagramProps`);var ce={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function O(e){let t=e.split(`.`);if(t.length===2)return t[0]}e(O,`extractNamespace`);function k(e){let t=e.split(`.`);return t.length===2?t[1]:e}e(k,`extractName`);function A(e,t){if(!(!t||t.length===0))return Object.values(e).find(e=>e.namespace===t)}e(A,`findSwimlaneByNamespace`);function j(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&r<n}).map(e=>Number.parseInt(e)))+1}e(j,`findNextAvailableIndex`);function M(e,t){let n=O(e.entityIdentifier),r=A(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||E.labelUiAutomation}:n?{index:j(t,0,100),label:E.labelUiAutomationPrefix+n}:{index:0,label:E.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||E.labelCommandReadModel}:n?{index:j(t,100,200),label:E.labelCommandReadModelPrefix+n}:{index:100,label:E.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||E.labelEvents}:n?{index:j(t,200,300),label:E.labelEventsPrefix+n}:{index:200,label:E.labelEvents}}}e(M,`calculateSwimlaneProps`);function N(e){let{themeVariables:t}=s();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}e(N,`calculateEntityVisualProps`);function P(e,n,r){let a=s(),o=p(k(e.entityIdentifier)??``,a),c,l={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`<br/>`},u=`<b>${t(o,r.textMaxWidth,l)}</b>`;if(e.dataInlineValue&&(c=e.dataInlineValue,c=c.substring(c.indexOf(`{`)+1),c=c.substring(0,c.lastIndexOf(`}`)-1),c=p(c,a),c=t(c,r.textMaxWidth,l),c=c.replaceAll(` `,`&nbsp;`)),e.dataReference){let i=n.find(t=>t.name===e.dataReference?.$refText);i&&(c=i.dataBlockValue,c=c.substring(c.indexOf(`{
2
+ `)+2),c=c.substring(0,c.lastIndexOf(`}`)-1),c=p(c,a),c=t(c,r.textMaxWidth,l),c=c.replaceAll(` `,`&nbsp;`),c+=`<br/>`)}let d=c!==void 0;d&&(u+=`<br/><br/><code style="text-align: left; display: block;max-width:${r.textMaxWidth}px">${c}</code>`);let f={fontSize:l.fontSize,fontWeight:l.fontWeight,fontFamily:l.fontFamily},h=i(u,f),g=d?h.width/3:h.width,_={content:u,width:g,height:h.height};return m.debug(`[${e.name}] ${e.entityIdentifier} text`,_),_}e(P,`calculateTextProps`);function F(e,t){let n=t,r=N(n.frame),i={width:n.textProps.width+2*E.boxTextPadding,height:n.textProps.height+2*E.boxTextPadding};return[{$kind:y,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}e(F,`decidePositionFrame`);function I(e,t,n){return t===void 0?E.contentStartX:t.index===e.index&&e.r?e.r+E.boxPadding:n===void 0?E.contentStartX:n.r-E.boxOverlap+E.boxPadding}e(I,`calculateX`);function L(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}e(L,`calculateMaxRight`);function R(e){return Object.values(e).sort((e,t)=>e.index-t.index)}e(R,`sortedSwimlanesArray`);function z(e,t){let n=t,r=M(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*E.swimlaneMinHeight+E.swimlaneGap,height:E.swimlaneMinHeight,maxHeight:E.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(E.boxMinWidth,Math.min(E.boxMaxWidth,n.dimension.width))+2*E.boxPadding,height:Math.max(E.boxMinHeight,Math.min(E.boxMaxHeight,n.dimension.height))+2*E.boxPadding},c=I(i,o,a),l=c+s.width+E.boxPadding,u=L(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(E.swimlaneMinHeight,i.maxHeight)+2*E.swimlanePadding;let d={x:c,y:E.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=R(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e<p.length;e++){let t=p[e],n=p[e-1];t.y=n.y+n.height+E.swimlaneGap}return f}e(z,`evolveFramePositioned`);function B(e,t){return e===0&&t.sourceFrames.length===0}e(B,`isFirstFrame`);function V(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}e(V,`hasSourceFrame`);function H(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}e(H,`findBoxByFrame`);function U(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}e(U,`findBoxByLineIndex`);function W(e,t){let n=t;if(ee(n.frame)||B(n.index,n.frame))return[];let r=H(e.boxes,n.frame);if(r===void 0)throw Error(`Target box not found for frame ${n.frame.name}`);let i;return i=n.sourceFrame?H(e.boxes,n.sourceFrame):U(e.boxes,r.swimlane.index,n.index-1),i===void 0?[]:[{$kind:x,frame:n.frame,index:n.index,sourceBox:i,targetBox:r}]}e(W,`decidePositionRelation`);function G(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}e(G,`evolveRelationPositioned`);var le={[v]:F,[b]:W},ue={[y]:z,[x]:G};function K(e,t){let n=le[t.$kind];if(n==null)return[];let r=n(e,t);return m.debug(`decided events`,r),r}e(K,`decide`);function q(e,t){let n=t.reduce((e,t)=>{let n=ue[t.$kind];return n==null?e:n(e,t)},e);return m.debug(`evolve events`,{state:e,newState:n,events:t}),n}e(q,`evolve`);function J(e,t){return q(e,K(e,t))}e(J,`dispatch`);var Y={getConfig:se,setOptions:re,getOptions:ie,clear:ae,setAccTitle:c,getAccTitle:g,getAccDescription:f,setAccDescription:u,setDiagramTitle:l,getDiagramTitle:h,setAst:T,getDiagramProps:D,getState:w},de={parse:e(async e=>{let t=await ne(`eventmodeling`,e);m.debug(t),Y.setAst(t),te(t,Y)},`parse`)},fe=n()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}e(X,`renderD3Box`);function Z(e,t){return e>t}e(Z,`dirUpwards`);function Q(e,t,n,r){return i=>{let a=i.sourceBox.swimlane.y+t.swimlanePadding,o=i.targetBox.swimlane.y+t.swimlanePadding,s=Z(a,o),c=i.sourceBox.x+i.sourceBox.dimension.width*2/3,l=i.targetBox.x+i.targetBox.dimension.width/3,u,d;m.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(u=a,d=o+i.targetBox.dimension.height):(u=a+i.sourceBox.dimension.height,d=o);let f=r.emRelationStroke??i.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,i.visual.fill).attr(`stroke`,f).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${n})`).attr(`d`,`M${c} ${u} L${l} ${d}`)}}e(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}e($,`renderD3Swimlane`);var pe={parser:de,db:Y,renderer:{draw:e(function(e,t,r,i){if(m.debug(`in eventmodeling renderer`,e+`
3
+ `,`id:`,t,r),!fe)throw Error(`EventModeling config not found`);let s=i.db,{themeVariables:c,eventmodeling:l}=n(),u=o(`[id="${t}"]`),d=s.getDiagramProps(),f=s.getState(),p=`em-arrowhead-${t}`,h=c.emArrowhead??`#000000`;f.sortedSwimlanesArray.forEach($(u,f.maxR,d,c)),f.boxes.forEach(X(u,d)),f.relations.forEach(Q(u,d,p,c)),u.append(`defs`).append(`marker`).attr(`id`,p).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,h),a(void 0,u,l?.padding??30,l?.useMaxWidth)},`draw`)},styles:e(e=>``,`getStyles`)};export{pe as diagram};
@@ -0,0 +1,24 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-BpMj3rQl.js";import{D as t,W as n,Z as r,dt as i,ft as a,gt as o,lt as s,nt as c,pt as l,tn as u,vt as d,wt as f,xt as p}from"./index-oL-ZNYwb.js";import"./chunk-4R4BOZG6-D3gm7tYj.js";import"./chunk-RERM46MO-Betu1cSy.js";import{t as m}from"./chunk-JQRUD6KW-DElaNjc0.js";import{t as h}from"./chunk-2T2R6R2M-B_pq_2nf.js";import"./chunk-UP6H54XL-0YWa0NDg.js";import"./chunk-UXSXWOXI-CSz0OXpz.js";import"./chunk-C62D2QBJ-CvFF2PnB.js";import"./chunk-CEXFNPSA-DdNtJtrF.js";import"./chunk-J5EP6P6S-DtcVaAJI.js";import"./chunk-RLI5ZMPA-BFUxCvX2.js";import"./chunk-2UTLFMKG-CpoohCFN.js";import"./chunk-RKZBBQEN-Cutpza0t.js";import"./chunk-KGYTTC2M-D0K5or7e.js";var g=s.packet,_=class{constructor(){this.packet=[],this.setAccTitle=i,this.getAccTitle=f,this.setDiagramTitle=a,this.getDiagramTitle=d,this.getAccDescription=c,this.setAccDescription=o}static{e(this,`PacketDB`)}getConfig(){let e=t({...g,...r().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){p(),this.packet=[]}},v=1e4,y=e((e,t)=>{m(e,t);let n=-1,r=[],i=1,{bitsPerRow:a}=t.getConfig();for(let{start:o,end:s,bits:c,label:l}of e.blocks){if(o!==void 0&&s!==void 0&&s<o)throw Error(`Packet block ${o} - ${s} is invalid. End must be greater than start.`);if(o??=n+1,o!==n+1)throw Error(`Packet block ${o} - ${s??o} is not contiguous. It should start from ${n+1}.`);if(c===0)throw Error(`Packet block ${o} is invalid. Cannot have a zero bit field.`);for(s??=o+(c??1)-1,c??=s-o+1,n=s,u.debug(`Packet block ${o} - ${n} with label ${l}`);r.length<=a+1&&t.getPacket().length<v;){let[e,n]=b({start:o,end:s,bits:c,label:l},i,a);if(r.push(e),e.end+1===i*a&&(t.pushWord(r),r=[],i++),!n)break;({start:o,end:s,bits:c,label:l}=n)}}t.pushWord(r)},`populate`),b=e((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:e(async e=>{let t=await h(`packet`,e),n=x.parser?.yy;if(!(n instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);u.debug(t),y(t,n)},`parse`)},S=e((e,t,r,i)=>{let a=i.db,o=a.getConfig(),{rowHeight:s,paddingY:c,bitWidth:u,bitsPerRow:d}=o,f=a.getPacket(),p=a.getDiagramTitle(),m=s+c,h=m*(f.length+1)-(p?0:s),g=u*d+2,_=n(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),l(_,h,g,o.useMaxWidth);for(let[e,t]of f.entries())C(_,t,e,o);_.append(`text`).text(p).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=e((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:e(({packet:e}={})=>{let n=t(T,e);return`
2
+ .packetByte {
3
+ font-size: ${n.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${n.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${n.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${n.labelColor};
13
+ font-size: ${n.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${n.titleColor};
17
+ font-size: ${n.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${n.blockStrokeColor};
21
+ stroke-width: ${n.blockStrokeWidth};
22
+ fill: ${n.blockFillColor};
23
+ }
24
+ `},`styles`)};export{E as diagram};