@toimc/markdown 0.0.1 → 0.0.2

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 (237) hide show
  1. package/dist/{CodeBlock.vue.d.ts → components/CodeBlock.vue.d.ts} +10 -1
  2. package/dist/components/CodeBlock.vue.d.ts.map +1 -0
  3. package/dist/components/LatexBlock.vue.d.ts.map +1 -0
  4. package/dist/components/MarkdownRenderer.vue.d.ts.map +1 -0
  5. package/dist/components/MermaidBlock.vue.d.ts.map +1 -0
  6. package/dist/composables/useMarkdownIt.d.ts.map +1 -1
  7. package/dist/index.cjs +62 -59
  8. package/dist/index.d.ts +4 -4
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.mjs +4536 -4331
  11. package/dist/markdown.css +1 -1
  12. package/dist/utils/formula-guard.d.ts +13 -0
  13. package/dist/utils/formula-guard.d.ts.map +1 -0
  14. package/dist/utils/split-lines.d.ts +10 -0
  15. package/dist/utils/split-lines.d.ts.map +1 -0
  16. package/package.json +6 -3
  17. package/dist/CodeBlock.test.d.ts +0 -2
  18. package/dist/CodeBlock.test.d.ts.map +0 -1
  19. package/dist/CodeBlock.vue.d.ts.map +0 -1
  20. package/dist/LatexBlock.test.d.ts +0 -2
  21. package/dist/LatexBlock.test.d.ts.map +0 -1
  22. package/dist/LatexBlock.vue.d.ts.map +0 -1
  23. package/dist/MarkdownRenderer.test.d.ts +0 -2
  24. package/dist/MarkdownRenderer.test.d.ts.map +0 -1
  25. package/dist/MarkdownRenderer.vue.d.ts.map +0 -1
  26. package/dist/MermaidBlock.test.d.ts +0 -2
  27. package/dist/MermaidBlock.test.d.ts.map +0 -1
  28. package/dist/MermaidBlock.vue.d.ts.map +0 -1
  29. package/dist/abnfDiagram-N423BO3Z-CpvDGmAd.cjs +0 -1
  30. package/dist/abnfDiagram-N423BO3Z-DuAPsGBR.js +0 -89
  31. package/dist/arc-CFxpoaLu.js +0 -82
  32. package/dist/arc-Dh2Zrypi.cjs +0 -1
  33. package/dist/architecture-TIHT7OUA-CUym9zMN.cjs +0 -1
  34. package/dist/architecture-TIHT7OUA-DDwCCw0y.js +0 -3
  35. package/dist/architectureDiagram-T3A2C74G-CS6-PQjR.cjs +0 -36
  36. package/dist/architectureDiagram-T3A2C74G-d7xzbLJQ.js +0 -4155
  37. package/dist/array-CApNbSU9.js +0 -6
  38. package/dist/array-DZSRzHA_.cjs +0 -1
  39. package/dist/blockDiagram-VBNYF7ZC-CnvNE8Hq.js +0 -3157
  40. package/dist/blockDiagram-VBNYF7ZC-DVl7vKmv.cjs +0 -132
  41. package/dist/c4Diagram-5PPSVZJV-B1RTcquO.js +0 -2982
  42. package/dist/c4Diagram-5PPSVZJV-Djkk0hzr.cjs +0 -10
  43. package/dist/channel-CNZiSge7.cjs +0 -1
  44. package/dist/channel-CqlbSsMQ.js +0 -5
  45. package/dist/chunk-2GRJ4B5K-BgeLbn06.cjs +0 -1
  46. package/dist/chunk-2GRJ4B5K-C5VToU5T.js +0 -61
  47. package/dist/chunk-2Q5K7J3B-B8v9mTdK.cjs +0 -1
  48. package/dist/chunk-2Q5K7J3B-C3WfnuyI.js +0 -15
  49. package/dist/chunk-4I5QYGJK-Bs8S-Wfu.js +0 -275
  50. package/dist/chunk-4I5QYGJK-CBqJO_mi.cjs +0 -1
  51. package/dist/chunk-5RXB4S5H-BnJ1P9K2.js +0 -2042
  52. package/dist/chunk-5RXB4S5H-BtEDiC1U.cjs +0 -231
  53. package/dist/chunk-5VM5RSS4-BsUXY5k9.js +0 -5
  54. package/dist/chunk-5VM5RSS4-CwDmQ9T_.cjs +0 -15
  55. package/dist/chunk-6Q2QTUOP-C0P-wtth.js +0 -490
  56. package/dist/chunk-6Q2QTUOP-UC-G8b3B.cjs +0 -88
  57. package/dist/chunk-7BUUIJ7U-CZdUK2qY.js +0 -82
  58. package/dist/chunk-7BUUIJ7U-MzS1pW_S.cjs +0 -1
  59. package/dist/chunk-7Z6QIM7H-CJdupq9f.js +0 -593
  60. package/dist/chunk-7Z6QIM7H-CUGcycR0.cjs +0 -10
  61. package/dist/chunk-GF5L2VYU-CDGpCl8Z.js +0 -3357
  62. package/dist/chunk-GF5L2VYU-DWhSvqYP.cjs +0 -206
  63. package/dist/chunk-I66GZJ75-D8wVRUgw.cjs +0 -127
  64. package/dist/chunk-I66GZJ75-xmbkwRyp.js +0 -3754
  65. package/dist/chunk-JQJVKLGR-B-jNEb9r.js +0 -4135
  66. package/dist/chunk-JQJVKLGR-CbhQdRxu.cjs +0 -156
  67. package/dist/chunk-JWPE2WC7-B8JIODrM.js +0 -8
  68. package/dist/chunk-JWPE2WC7-Cs1kjq8S.cjs +0 -1
  69. package/dist/chunk-KBJHAD2P-BMuT9eJO.cjs +0 -1
  70. package/dist/chunk-KBJHAD2P-CCpB6hWQ.js +0 -26
  71. package/dist/chunk-KEIR6QF5-RwFi50en.js +0 -21456
  72. package/dist/chunk-KEIR6QF5-rUKzMPy0.cjs +0 -161
  73. package/dist/chunk-NSK5VX7P-BO1SrWAL.js +0 -1335
  74. package/dist/chunk-NSK5VX7P-BiC_63US.cjs +0 -2
  75. package/dist/chunk-QR6OTTB3-BSxbyKp_.cjs +0 -62
  76. package/dist/chunk-QR6OTTB3-CGxJcV-X.js +0 -3738
  77. package/dist/chunk-RYQCIY6F-Lf2oVMMh.cjs +0 -1
  78. package/dist/chunk-RYQCIY6F-UBebC0ib.js +0 -241
  79. package/dist/chunk-UBXNYLIW-BURVNZm2.cjs +0 -1
  80. package/dist/chunk-UBXNYLIW-fOGkdEwd.js +0 -32
  81. package/dist/chunk-W5SLKNZC-BLFqePZ1.cjs +0 -1
  82. package/dist/chunk-W5SLKNZC-C2SYjJjL.js +0 -67
  83. package/dist/chunk-WRU74C26-Cr4HTCc1.cjs +0 -70
  84. package/dist/chunk-WRU74C26-UGtU6H2a.js +0 -1636
  85. package/dist/chunk-XXDRQBXY-GENMsCHk.js +0 -9
  86. package/dist/chunk-XXDRQBXY-yMT3rT5Y.cjs +0 -1
  87. package/dist/chunk-Y2CYZVJY-CnmLqFtv.cjs +0 -1
  88. package/dist/chunk-Y2CYZVJY-DO9UHHon.js +0 -12
  89. package/dist/classDiagram-JCYQIIEL-DUjWUDYG.cjs +0 -1
  90. package/dist/classDiagram-JCYQIIEL-Dm9anlJw.js +0 -30
  91. package/dist/classDiagram-v2-OCEON4UE-Bl-vyFyz.js +0 -30
  92. package/dist/classDiagram-v2-OCEON4UE-DUjWUDYG.cjs +0 -1
  93. package/dist/composables/useHighlighter.test.d.ts +0 -2
  94. package/dist/composables/useHighlighter.test.d.ts.map +0 -1
  95. package/dist/composables/useMarkdownIt.test.d.ts +0 -2
  96. package/dist/composables/useMarkdownIt.test.d.ts.map +0 -1
  97. package/dist/composables/useShikiTokenizer.test.d.ts +0 -2
  98. package/dist/composables/useShikiTokenizer.test.d.ts.map +0 -1
  99. package/dist/composables/useStreamingMarkdown.test.d.ts +0 -2
  100. package/dist/composables/useStreamingMarkdown.test.d.ts.map +0 -1
  101. package/dist/cose-bilkent-JH36ORCC-C1RCVzVZ.cjs +0 -1
  102. package/dist/cose-bilkent-JH36ORCC-C5FbROLY.js +0 -2254
  103. package/dist/cynefin-VYW2F7L2-CMgnLl46.js +0 -3
  104. package/dist/cynefin-VYW2F7L2-DVi1CF5b.cjs +0 -1
  105. package/dist/cynefinDiagram-MW4NZA55-CkZY080C.cjs +0 -62
  106. package/dist/cynefinDiagram-MW4NZA55-DbAAx9CC.js +0 -355
  107. package/dist/cytoscape.esm-BKhIYxsH.cjs +0 -321
  108. package/dist/cytoscape.esm-DMXbtFI-.js +0 -18145
  109. package/dist/dagre-DarAkhy1.cjs +0 -1
  110. package/dist/dagre-VZM6K2ZE-CpL0s3GG.js +0 -328
  111. package/dist/dagre-VZM6K2ZE-D1_S1oSj.cjs +0 -4
  112. package/dist/dagre-x4cMb6gU.js +0 -1699
  113. package/dist/defaultLocale-ybN1Vtvg.cjs +0 -1
  114. package/dist/defaultLocale-yzzuPw6P.js +0 -198
  115. package/dist/diagram-7IWD3JNH-BXvOBw2z.js +0 -300
  116. package/dist/diagram-7IWD3JNH-W-Kjft6l.cjs +0 -30
  117. package/dist/diagram-B4RE2ZJO-C4lLgW4X.cjs +0 -3
  118. package/dist/diagram-B4RE2ZJO-DyAAD_bR.js +0 -432
  119. package/dist/diagram-LBJQPF4R-BTgCWP5o.cjs +0 -24
  120. package/dist/diagram-LBJQPF4R-BbMQOpt2.js +0 -134
  121. package/dist/diagram-Q27KOJAE-ink_R6qE.js +0 -527
  122. package/dist/diagram-Q27KOJAE-v-ZMzCxs.cjs +0 -24
  123. package/dist/diagram-UB23O5K3-BXTm2BG0.cjs +0 -41
  124. package/dist/diagram-UB23O5K3-C6rqCJBb.js +0 -214
  125. package/dist/dist-BP2me-br.js +0 -59
  126. package/dist/dist-Dwv2VYAL.cjs +0 -1
  127. package/dist/ebnfDiagram-BXEA7PRR-C80cjdjP.js +0 -100
  128. package/dist/ebnfDiagram-BXEA7PRR-lKO9XwUp.cjs +0 -1
  129. package/dist/erDiagram-JOGREHBK-Blwfr6w3.js +0 -1727
  130. package/dist/erDiagram-JOGREHBK-ChgcmULa.cjs +0 -85
  131. package/dist/eventmodeling-45OFAUF4-BDhzj03B.js +0 -3
  132. package/dist/eventmodeling-45OFAUF4-BtU19idK.cjs +0 -1
  133. package/dist/flowDiagram-UKHOOZJN-Co0JpKUU.js +0 -16
  134. package/dist/flowDiagram-UKHOOZJN-db1Ur2LI.cjs +0 -1
  135. package/dist/ganttDiagram-PKOTCBZU-Byi4E8Ye.js +0 -3073
  136. package/dist/ganttDiagram-PKOTCBZU-C_Vwv1o8.cjs +0 -292
  137. package/dist/gitGraph-TEB2WS4Q-CAeGPNFR.cjs +0 -1
  138. package/dist/gitGraph-TEB2WS4Q-DJA_hE4G.js +0 -3
  139. package/dist/gitGraphDiagram-DS77QQ5N-BG8AQVtP.js +0 -733
  140. package/dist/gitGraphDiagram-DS77QQ5N-DK9VJTjf.cjs +0 -106
  141. package/dist/graphlib-BaETKKSa.cjs +0 -1
  142. package/dist/graphlib-DoD0LnUK.js +0 -1267
  143. package/dist/info-DKCQHKI2-BD_vOCz6.js +0 -3
  144. package/dist/info-DKCQHKI2-p0Lazone.cjs +0 -1
  145. package/dist/infoDiagram-6WML65LV-B6PBOy7T.js +0 -20
  146. package/dist/infoDiagram-6WML65LV-nBSrP53Z.cjs +0 -2
  147. package/dist/init-BJdqMO10.cjs +0 -1
  148. package/dist/init-sjaVZO3f.js +0 -13
  149. package/dist/ishikawaDiagram-WSZJBQD7-BxEkaF2A.js +0 -719
  150. package/dist/ishikawaDiagram-WSZJBQD7-CjyKQ_N6.cjs +0 -70
  151. package/dist/journeyDiagram-NVQOT4AX-BPCuqjbW.js +0 -884
  152. package/dist/journeyDiagram-NVQOT4AX-DKgEeNcy.cjs +0 -139
  153. package/dist/kanban-definition-27J2QSJJ-BeKnR9zB.cjs +0 -89
  154. package/dist/kanban-definition-27J2QSJJ-D1pVuCv2.js +0 -974
  155. package/dist/katex-BfeHGk4M.js +0 -21977
  156. package/dist/katex-CEF6MvLx.cjs +0 -257
  157. package/dist/line-8EHPtDZA.cjs +0 -1
  158. package/dist/line-BifI9Y7j.js +0 -34
  159. package/dist/linear-Nt9BuHfn.cjs +0 -1
  160. package/dist/linear-l8AD1ib_.js +0 -288
  161. package/dist/map-CCpPjiU9.cjs +0 -1
  162. package/dist/map-DUk1uXZC.js +0 -241
  163. package/dist/mermaid-parser.core-BupC9XGF.js +0 -638
  164. package/dist/mermaid-parser.core-aXxW1VLR.cjs +0 -6
  165. package/dist/mermaid.core-C05C5gh_.cjs +0 -41
  166. package/dist/mermaid.core-CxM-VhZd.js +0 -2297
  167. package/dist/mindmap-definition-FAOFIHXS-B_k8KOvw.js +0 -1006
  168. package/dist/mindmap-definition-FAOFIHXS-CKPAiVKf.cjs +0 -96
  169. package/dist/ordinal-Bm_chml2.cjs +0 -1
  170. package/dist/ordinal-CNQzPcrr.js +0 -65
  171. package/dist/packet-7NZHBO7P-CVdRavgo.cjs +0 -1
  172. package/dist/packet-7NZHBO7P-CgBlALV1.js +0 -3
  173. package/dist/path-DIS6ck99.cjs +0 -1
  174. package/dist/path-DVvH25eQ.js +0 -84
  175. package/dist/pegDiagram-VL7TDLO6-B5Jhedbv.cjs +0 -1
  176. package/dist/pegDiagram-VL7TDLO6-PP-A-3Lv.js +0 -94
  177. package/dist/pie-RZYD4A2V-CryPC-P_.js +0 -3
  178. package/dist/pie-RZYD4A2V-CwDJ0bEW.cjs +0 -1
  179. package/dist/pieDiagram-7S7Q4E2Y-CgDU9E10.cjs +0 -39
  180. package/dist/pieDiagram-7S7Q4E2Y-CxNt1xaN.js +0 -203
  181. package/dist/quadrantDiagram-CIZ2JOQS-CMUanfcR.js +0 -2001
  182. package/dist/quadrantDiagram-CIZ2JOQS-vybEBK1o.cjs +0 -7
  183. package/dist/radar-I7S5WNFK-DaVgEjvC.cjs +0 -1
  184. package/dist/radar-I7S5WNFK-DgzJDRy3.js +0 -3
  185. package/dist/railroad-3IZDKUUU-BPsrMjqz.cjs +0 -1
  186. package/dist/railroad-3IZDKUUU-DFp3mbpB.js +0 -3
  187. package/dist/railroad-abnf-AHOZXSZD-BRjidKH0.js +0 -3
  188. package/dist/railroad-abnf-AHOZXSZD-ZpHq_KEy.cjs +0 -1
  189. package/dist/railroad-ebnf-EBAXGLYW-B45niwuq.cjs +0 -1
  190. package/dist/railroad-ebnf-EBAXGLYW-PgrDWact.js +0 -3
  191. package/dist/railroad-peg-LSFZ7HO6-CMKir81Y.js +0 -3
  192. package/dist/railroad-peg-LSFZ7HO6-DUsuEX2Z.cjs +0 -1
  193. package/dist/railroadDiagram-AXF67PYL-D7y_2yAa.cjs +0 -1
  194. package/dist/railroadDiagram-AXF67PYL-iLkvx2oU.js +0 -76
  195. package/dist/renderers/tokensToHtml.test.d.ts +0 -2
  196. package/dist/renderers/tokensToHtml.test.d.ts.map +0 -1
  197. package/dist/requirementDiagram-LRYGKXZP-Bs2mCDzB.js +0 -2223
  198. package/dist/requirementDiagram-LRYGKXZP-lA2nVr6h.cjs +0 -84
  199. package/dist/rolldown-runtime-B0aSnxlc.js +0 -20
  200. package/dist/rolldown-runtime-DF3sbh8G.cjs +0 -1
  201. package/dist/rough.esm-B2w_aYoc.js +0 -1361
  202. package/dist/rough.esm-ChRLLRha.cjs +0 -1
  203. package/dist/sankeyDiagram-W5VNT64P-BxYQllhE.js +0 -972
  204. package/dist/sankeyDiagram-W5VNT64P-vPci5pOT.cjs +0 -40
  205. package/dist/sequenceDiagram-SI44F4Z6-BNu1-3EN.cjs +0 -162
  206. package/dist/sequenceDiagram-SI44F4Z6-E6AoYU_R.js +0 -4156
  207. package/dist/sizeCapture-X5ZJPWSS-8gbZlYqg.js +0 -46
  208. package/dist/sizeCapture-X5ZJPWSS-bJ2ZX4Du.cjs +0 -1
  209. package/dist/src-C7bjHtAI.js +0 -2139
  210. package/dist/src-D9o9TOtH.cjs +0 -1
  211. package/dist/stateDiagram-OKZ733FA-B7ITlY91.cjs +0 -1
  212. package/dist/stateDiagram-OKZ733FA-BfcOAK65.js +0 -220
  213. package/dist/stateDiagram-v2-UEYNNEHI-BHO-uUPG.js +0 -30
  214. package/dist/stateDiagram-v2-UEYNNEHI-lgGjJyRM.cjs +0 -1
  215. package/dist/swimlanes-SLNWSIFB-BHIPInzG.js +0 -5069
  216. package/dist/swimlanes-SLNWSIFB-C-Z31wMl.cjs +0 -1
  217. package/dist/swimlanesDiagram-ULZ7WXOC-C8pvRoyc.cjs +0 -8
  218. package/dist/swimlanesDiagram-ULZ7WXOC-CK6AVyRM.js +0 -30
  219. package/dist/timeline-definition-Z64GVDOM-C31otJwb.cjs +0 -120
  220. package/dist/timeline-definition-Z64GVDOM-rUKJY7cp.js +0 -1069
  221. package/dist/treeView-QDETBFTQ-BkNUN560.cjs +0 -1
  222. package/dist/treeView-QDETBFTQ-DVp4aTZQ.js +0 -3
  223. package/dist/treemap-6X3UGDF4-BbBnHMHJ.js +0 -3
  224. package/dist/treemap-6X3UGDF4-BcO657a2.cjs +0 -1
  225. package/dist/utils/extractCompleteMarkdown.test.d.ts +0 -2
  226. package/dist/utils/extractCompleteMarkdown.test.d.ts.map +0 -1
  227. package/dist/vennDiagram-T6HMQDX7-DjlTuTEH.cjs +0 -34
  228. package/dist/vennDiagram-T6HMQDX7-vxMe-3nF.js +0 -1880
  229. package/dist/wardley-OPB4EBWU-B-RXhnoN.js +0 -3
  230. package/dist/wardley-OPB4EBWU-CiILNYeL.cjs +0 -1
  231. package/dist/wardleyDiagram-T6FBY63Y-BMQLZV1W.cjs +0 -78
  232. package/dist/wardleyDiagram-T6FBY63Y-C_Q2NmJu.js +0 -645
  233. package/dist/xychartDiagram-ELKLHX3M-Bsa_zeyd.cjs +0 -7
  234. package/dist/xychartDiagram-ELKLHX3M-OcVmrPL6.js +0 -2101
  235. /package/dist/{LatexBlock.vue.d.ts → components/LatexBlock.vue.d.ts} +0 -0
  236. /package/dist/{MarkdownRenderer.vue.d.ts → components/MarkdownRenderer.vue.d.ts} +0 -0
  237. /package/dist/{MermaidBlock.vue.d.ts → components/MermaidBlock.vue.d.ts} +0 -0
@@ -1,2254 +0,0 @@
1
- import { r as e, t } from "./rolldown-runtime-B0aSnxlc.js";
2
- import { n } from "./chunk-Y2CYZVJY-DO9UHHon.js";
3
- import { m as r, p as i } from "./src-C7bjHtAI.js";
4
- import { t as a } from "./cytoscape.esm-DMXbtFI-.js";
5
- //#region ../../node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js
6
- var o = /* @__PURE__ */ t(((e, t) => {
7
- (function(n, r) {
8
- 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();
9
- })(e, function() {
10
- return (function(e) {
11
- var t = {};
12
- function n(r) {
13
- if (t[r]) return t[r].exports;
14
- var i = t[r] = {
15
- i: r,
16
- l: !1,
17
- exports: {}
18
- };
19
- return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
20
- }
21
- return n.m = e, n.c = t, n.i = function(e) {
22
- return e;
23
- }, n.d = function(e, t, r) {
24
- n.o(e, t) || Object.defineProperty(e, t, {
25
- configurable: !1,
26
- enumerable: !0,
27
- get: r
28
- });
29
- }, n.n = function(e) {
30
- var t = e && e.__esModule ? function() {
31
- return e.default;
32
- } : function() {
33
- return e;
34
- };
35
- return n.d(t, "a", t), t;
36
- }, n.o = function(e, t) {
37
- return Object.prototype.hasOwnProperty.call(e, t);
38
- }, n.p = "", n(n.s = 26);
39
- })([
40
- (function(e, t, n) {
41
- function r() {}
42
- r.QUALITY = 1, r.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, r.DEFAULT_INCREMENTAL = !1, r.DEFAULT_ANIMATION_ON_LAYOUT = !0, r.DEFAULT_ANIMATION_DURING_LAYOUT = !1, r.DEFAULT_ANIMATION_PERIOD = 50, r.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, r.DEFAULT_GRAPH_MARGIN = 15, r.NODE_DIMENSIONS_INCLUDE_LABELS = !1, r.SIMPLE_NODE_SIZE = 40, r.SIMPLE_NODE_HALF_SIZE = r.SIMPLE_NODE_SIZE / 2, r.EMPTY_COMPOUND_NODE_SIZE = 40, r.MIN_EDGE_LENGTH = 1, r.WORLD_BOUNDARY = 1e6, r.INITIAL_WORLD_BOUNDARY = r.WORLD_BOUNDARY / 1e3, r.WORLD_CENTER_X = 1200, r.WORLD_CENTER_Y = 900, e.exports = r;
43
- }),
44
- (function(e, t, n) {
45
- var r = n(2), i = n(8), a = n(9);
46
- function o(e, t, n) {
47
- r.call(this, n), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = n, this.bendpoints = [], this.source = e, this.target = t;
48
- }
49
- for (var s in o.prototype = Object.create(r.prototype), r) o[s] = r[s];
50
- o.prototype.getSource = function() {
51
- return this.source;
52
- }, o.prototype.getTarget = function() {
53
- return this.target;
54
- }, o.prototype.isInterGraph = function() {
55
- return this.isInterGraph;
56
- }, o.prototype.getLength = function() {
57
- return this.length;
58
- }, o.prototype.isOverlapingSourceAndTarget = function() {
59
- return this.isOverlapingSourceAndTarget;
60
- }, o.prototype.getBendpoints = function() {
61
- return this.bendpoints;
62
- }, o.prototype.getLca = function() {
63
- return this.lca;
64
- }, o.prototype.getSourceInLca = function() {
65
- return this.sourceInLca;
66
- }, o.prototype.getTargetInLca = function() {
67
- return this.targetInLca;
68
- }, o.prototype.getOtherEnd = function(e) {
69
- if (this.source === e) return this.target;
70
- if (this.target === e) return this.source;
71
- throw "Node is not incident with this edge";
72
- }, o.prototype.getOtherEndInGraph = function(e, t) {
73
- for (var n = this.getOtherEnd(e), r = t.getGraphManager().getRoot();;) {
74
- if (n.getOwner() == t) return n;
75
- if (n.getOwner() == r) break;
76
- n = n.getOwner().getParent();
77
- }
78
- return null;
79
- }, o.prototype.updateLength = function() {
80
- var e = [
81
- ,
82
- ,
83
- ,
84
- ,
85
- ];
86
- this.isOverlapingSourceAndTarget = i.getIntersection(this.target.getRect(), this.source.getRect(), e), this.isOverlapingSourceAndTarget || (this.lengthX = e[0] - e[2], this.lengthY = e[1] - e[3], Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
87
- }, o.prototype.updateLengthSimple = function() {
88
- this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
89
- }, e.exports = o;
90
- }),
91
- (function(e, t, n) {
92
- function r(e) {
93
- this.vGraphObject = e;
94
- }
95
- e.exports = r;
96
- }),
97
- (function(e, t, n) {
98
- var r = n(2), i = n(10), a = n(13), o = n(0), s = n(16), c = n(4);
99
- function l(e, t, n, o) {
100
- n == null && o == null && (o = t), r.call(this, o), e.graphManager != null && (e = e.graphManager), this.estimatedSize = i.MIN_VALUE, this.inclusionTreeDepth = i.MAX_VALUE, this.vGraphObject = o, this.edges = [], this.graphManager = e, this.rect = n != null && t != null ? new a(t.x, t.y, n.width, n.height) : new a();
101
- }
102
- for (var u in l.prototype = Object.create(r.prototype), r) l[u] = r[u];
103
- l.prototype.getEdges = function() {
104
- return this.edges;
105
- }, l.prototype.getChild = function() {
106
- return this.child;
107
- }, l.prototype.getOwner = function() {
108
- return this.owner;
109
- }, l.prototype.getWidth = function() {
110
- return this.rect.width;
111
- }, l.prototype.setWidth = function(e) {
112
- this.rect.width = e;
113
- }, l.prototype.getHeight = function() {
114
- return this.rect.height;
115
- }, l.prototype.setHeight = function(e) {
116
- this.rect.height = e;
117
- }, l.prototype.getCenterX = function() {
118
- return this.rect.x + this.rect.width / 2;
119
- }, l.prototype.getCenterY = function() {
120
- return this.rect.y + this.rect.height / 2;
121
- }, l.prototype.getCenter = function() {
122
- return new c(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
123
- }, l.prototype.getLocation = function() {
124
- return new c(this.rect.x, this.rect.y);
125
- }, l.prototype.getRect = function() {
126
- return this.rect;
127
- }, l.prototype.getDiagonal = function() {
128
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
129
- }, l.prototype.getHalfTheDiagonal = function() {
130
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
131
- }, l.prototype.setRect = function(e, t) {
132
- this.rect.x = e.x, this.rect.y = e.y, this.rect.width = t.width, this.rect.height = t.height;
133
- }, l.prototype.setCenter = function(e, t) {
134
- this.rect.x = e - this.rect.width / 2, this.rect.y = t - this.rect.height / 2;
135
- }, l.prototype.setLocation = function(e, t) {
136
- this.rect.x = e, this.rect.y = t;
137
- }, l.prototype.moveBy = function(e, t) {
138
- this.rect.x += e, this.rect.y += t;
139
- }, l.prototype.getEdgeListToNode = function(e) {
140
- var t = [], n = this;
141
- return n.edges.forEach(function(r) {
142
- if (r.target == e) {
143
- if (r.source != n) throw "Incorrect edge source!";
144
- t.push(r);
145
- }
146
- }), t;
147
- }, l.prototype.getEdgesBetween = function(e) {
148
- var t = [], n = this;
149
- return n.edges.forEach(function(r) {
150
- if (r.source != n && r.target != n) throw "Incorrect edge source and/or target";
151
- (r.target == e || r.source == e) && t.push(r);
152
- }), t;
153
- }, l.prototype.getNeighborsList = function() {
154
- var e = /* @__PURE__ */ new Set(), t = this;
155
- return t.edges.forEach(function(n) {
156
- if (n.source == t) e.add(n.target);
157
- else {
158
- if (n.target != t) throw "Incorrect incidency!";
159
- e.add(n.source);
160
- }
161
- }), e;
162
- }, l.prototype.withChildren = function() {
163
- var e = /* @__PURE__ */ new Set(), t, n;
164
- 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) {
165
- e.add(t);
166
- });
167
- return e;
168
- }, l.prototype.getNoOfChildren = function() {
169
- var e = 0, t;
170
- if (this.child == null) e = 1;
171
- else for (var n = this.child.getNodes(), r = 0; r < n.length; r++) t = n[r], e += t.getNoOfChildren();
172
- return e == 0 && (e = 1), e;
173
- }, l.prototype.getEstimatedSize = function() {
174
- if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
175
- return this.estimatedSize;
176
- }, l.prototype.calcEstimatedSize = function() {
177
- 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);
178
- }, l.prototype.scatter = function() {
179
- var e, t, n = -o.INITIAL_WORLD_BOUNDARY, r = o.INITIAL_WORLD_BOUNDARY;
180
- e = o.WORLD_CENTER_X + s.nextDouble() * (r - n) + n;
181
- var i = -o.INITIAL_WORLD_BOUNDARY, a = o.INITIAL_WORLD_BOUNDARY;
182
- t = o.WORLD_CENTER_Y + s.nextDouble() * (a - i) + i, this.rect.x = e, this.rect.y = t;
183
- }, l.prototype.updateBounds = function() {
184
- if (this.getChild() == null) throw "assert failed";
185
- if (this.getChild().getNodes().length != 0) {
186
- var e = this.getChild();
187
- if (e.updateBounds(!0), this.rect.x = e.getLeft(), this.rect.y = e.getTop(), this.setWidth(e.getRight() - e.getLeft()), this.setHeight(e.getBottom() - e.getTop()), o.NODE_DIMENSIONS_INCLUDE_LABELS) {
188
- var t = e.getRight() - e.getLeft(), n = e.getBottom() - e.getTop();
189
- 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));
190
- }
191
- }
192
- }, l.prototype.getInclusionTreeDepth = function() {
193
- if (this.inclusionTreeDepth == i.MAX_VALUE) throw "assert failed";
194
- return this.inclusionTreeDepth;
195
- }, l.prototype.transform = function(e) {
196
- var t = this.rect.x;
197
- t > o.WORLD_BOUNDARY ? t = o.WORLD_BOUNDARY : t < -o.WORLD_BOUNDARY && (t = -o.WORLD_BOUNDARY);
198
- var n = this.rect.y;
199
- n > o.WORLD_BOUNDARY ? n = o.WORLD_BOUNDARY : n < -o.WORLD_BOUNDARY && (n = -o.WORLD_BOUNDARY);
200
- var r = new c(t, n), i = e.inverseTransformPoint(r);
201
- this.setLocation(i.x, i.y);
202
- }, l.prototype.getLeft = function() {
203
- return this.rect.x;
204
- }, l.prototype.getRight = function() {
205
- return this.rect.x + this.rect.width;
206
- }, l.prototype.getTop = function() {
207
- return this.rect.y;
208
- }, l.prototype.getBottom = function() {
209
- return this.rect.y + this.rect.height;
210
- }, l.prototype.getParent = function() {
211
- return this.owner == null ? null : this.owner.getParent();
212
- }, e.exports = l;
213
- }),
214
- (function(e, t, n) {
215
- function r(e, t) {
216
- e == null && t == null ? (this.x = 0, this.y = 0) : (this.x = e, this.y = t);
217
- }
218
- r.prototype.getX = function() {
219
- return this.x;
220
- }, r.prototype.getY = function() {
221
- return this.y;
222
- }, r.prototype.setX = function(e) {
223
- this.x = e;
224
- }, r.prototype.setY = function(e) {
225
- this.y = e;
226
- }, r.prototype.getDifference = function(e) {
227
- return new DimensionD(this.x - e.x, this.y - e.y);
228
- }, r.prototype.getCopy = function() {
229
- return new r(this.x, this.y);
230
- }, r.prototype.translate = function(e) {
231
- return this.x += e.width, this.y += e.height, this;
232
- }, e.exports = r;
233
- }),
234
- (function(e, t, n) {
235
- var r = n(2), i = n(10), a = n(0), o = n(6), s = n(3), c = n(1), l = n(13), u = n(12), d = n(11);
236
- function f(e, t, n) {
237
- r.call(this, n), this.estimatedSize = i.MIN_VALUE, this.margin = a.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = e, t != null && t instanceof o ? this.graphManager = t : t != null && t instanceof Layout && (this.graphManager = t.graphManager);
238
- }
239
- for (var p in f.prototype = Object.create(r.prototype), r) f[p] = r[p];
240
- f.prototype.getNodes = function() {
241
- return this.nodes;
242
- }, f.prototype.getEdges = function() {
243
- return this.edges;
244
- }, f.prototype.getGraphManager = function() {
245
- return this.graphManager;
246
- }, f.prototype.getParent = function() {
247
- return this.parent;
248
- }, f.prototype.getLeft = function() {
249
- return this.left;
250
- }, f.prototype.getRight = function() {
251
- return this.right;
252
- }, f.prototype.getTop = function() {
253
- return this.top;
254
- }, f.prototype.getBottom = function() {
255
- return this.bottom;
256
- }, f.prototype.isConnected = function() {
257
- return this.isConnected;
258
- }, f.prototype.add = function(e, t, n) {
259
- if (t == null && n == null) {
260
- var r = e;
261
- if (this.graphManager == null) throw "Graph has no graph mgr!";
262
- if (this.getNodes().indexOf(r) > -1) throw "Node already in graph!";
263
- return r.owner = this, this.getNodes().push(r), r;
264
- }
265
- var i = e;
266
- if (!(this.getNodes().indexOf(t) > -1 && this.getNodes().indexOf(n) > -1)) throw "Source or target not in graph!";
267
- if (t.owner != n.owner || t.owner != this) throw "Both owners must be this graph!";
268
- 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;
269
- }, f.prototype.remove = function(e) {
270
- var t = e;
271
- if (e instanceof s) {
272
- if (t == null) throw "Node is null!";
273
- if (t.owner == null || t.owner != this) throw "Owner graph is invalid!";
274
- if (this.graphManager == null) throw "Owner graph manager is invalid!";
275
- 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);
276
- var o = this.nodes.indexOf(t);
277
- if (o == -1) throw "Node not in owner node list!";
278
- this.nodes.splice(o, 1);
279
- } else if (e instanceof c) {
280
- var r = e;
281
- if (r == null) throw "Edge is null!";
282
- if (r.source == null || r.target == null) throw "Source and/or target is null!";
283
- 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!";
284
- var l = r.source.edges.indexOf(r), u = r.target.edges.indexOf(r);
285
- if (!(l > -1 && u > -1)) throw "Source and/or target doesn't know this edge!";
286
- r.source.edges.splice(l, 1), r.target != r.source && r.target.edges.splice(u, 1);
287
- var o = r.source.owner.getEdges().indexOf(r);
288
- if (o == -1) throw "Not in owner's edge list!";
289
- r.source.owner.getEdges().splice(o, 1);
290
- }
291
- }, f.prototype.updateLeftTop = function() {
292
- for (var e = i.MAX_VALUE, t = i.MAX_VALUE, n, r, a, o = this.getNodes(), s = o.length, c = 0; c < s; c++) {
293
- var l = o[c];
294
- n = l.getTop(), r = l.getLeft(), e > n && (e = n), t > r && (t = r);
295
- }
296
- return e == i.MAX_VALUE ? null : (a = o[0].getParent().paddingLeft == null ? this.margin : o[0].getParent().paddingLeft, this.left = t - a, this.top = e - a, new u(this.left, this.top));
297
- }, f.prototype.updateBounds = function(e) {
298
- for (var t = i.MAX_VALUE, n = -i.MAX_VALUE, r = i.MAX_VALUE, a = -i.MAX_VALUE, o, s, c, u, d, f = this.nodes, p = f.length, m = 0; m < p; m++) {
299
- var h = f[m];
300
- e && h.child != null && h.updateBounds(), o = h.getLeft(), s = h.getRight(), c = h.getTop(), u = h.getBottom(), t > o && (t = o), n < s && (n = s), r > c && (r = c), a < u && (a = u);
301
- }
302
- var g = new l(t, r, n - t, a - r);
303
- t == i.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), d = f[0].getParent().paddingLeft == null ? this.margin : f[0].getParent().paddingLeft, this.left = g.x - d, this.right = g.x + g.width + d, this.top = g.y - d, this.bottom = g.y + g.height + d;
304
- }, f.calculateBounds = function(e) {
305
- for (var t = i.MAX_VALUE, n = -i.MAX_VALUE, r = i.MAX_VALUE, a = -i.MAX_VALUE, o, s, c, u, d = e.length, f = 0; f < d; f++) {
306
- var p = e[f];
307
- o = p.getLeft(), s = p.getRight(), c = p.getTop(), u = p.getBottom(), t > o && (t = o), n < s && (n = s), r > c && (r = c), a < u && (a = u);
308
- }
309
- return new l(t, r, n - t, a - r);
310
- }, f.prototype.getInclusionTreeDepth = function() {
311
- return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
312
- }, f.prototype.getEstimatedSize = function() {
313
- if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
314
- return this.estimatedSize;
315
- }, f.prototype.calcEstimatedSize = function() {
316
- for (var e = 0, t = this.nodes, n = t.length, r = 0; r < n; r++) {
317
- var i = t[r];
318
- e += i.calcEstimatedSize();
319
- }
320
- return this.estimatedSize = e == 0 ? a.EMPTY_COMPOUND_NODE_SIZE : e / Math.sqrt(this.nodes.length), this.estimatedSize;
321
- }, f.prototype.updateConnected = function() {
322
- var e = this;
323
- if (this.nodes.length == 0) {
324
- this.isConnected = !0;
325
- return;
326
- }
327
- var t = new d(), n = /* @__PURE__ */ new Set(), r = this.nodes[0], i, a;
328
- for (r.withChildren().forEach(function(e) {
329
- t.push(e), n.add(e);
330
- }); t.length !== 0;) {
331
- r = t.shift(), i = r.getEdges();
332
- 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) {
333
- t.push(e), n.add(e);
334
- });
335
- }
336
- if (this.isConnected = !1, n.size >= this.nodes.length) {
337
- var c = 0;
338
- n.forEach(function(t) {
339
- t.owner == e && c++;
340
- }), c == this.nodes.length && (this.isConnected = !0);
341
- }
342
- }, e.exports = f;
343
- }),
344
- (function(e, t, n) {
345
- var r, i = n(1);
346
- function a(e) {
347
- r = n(5), this.layout = e, this.graphs = [], this.edges = [];
348
- }
349
- a.prototype.addRoot = function() {
350
- var e = this.layout.newGraph(), t = this.layout.newNode(null), n = this.add(e, t);
351
- return this.setRootGraph(n), this.rootGraph;
352
- }, a.prototype.add = function(e, t, n, r, i) {
353
- if (n == null && r == null && i == null) {
354
- if (e == null) throw "Graph is null!";
355
- if (t == null) throw "Parent node is null!";
356
- if (this.graphs.indexOf(e) > -1) throw "Graph already in this graph mgr!";
357
- if (this.graphs.push(e), e.parent != null) throw "Already has a parent!";
358
- if (t.child != null) throw "Already has a child!";
359
- return e.parent = t, t.child = e, e;
360
- }
361
- i = n, r = t, n = e;
362
- var a = r.getOwner(), o = i.getOwner();
363
- if (a == null || a.getGraphManager() != this) throw "Source not in this graph mgr!";
364
- if (o == null || o.getGraphManager() != this) throw "Target not in this graph mgr!";
365
- if (a == o) return n.isInterGraph = !1, a.add(n, r, i);
366
- if (n.isInterGraph = !0, n.source = r, n.target = i, this.edges.indexOf(n) > -1) throw "Edge already in inter-graph edge list!";
367
- if (this.edges.push(n), n.source == null || n.target == null) throw "Edge source and/or target is null!";
368
- if (n.source.edges.indexOf(n) != -1 || n.target.edges.indexOf(n) != -1) throw "Edge already in source and/or target incidency list!";
369
- return n.source.edges.push(n), n.target.edges.push(n), n;
370
- }, a.prototype.remove = function(e) {
371
- if (e instanceof r) {
372
- var t = e;
373
- if (t.getGraphManager() != this) throw "Graph not in this graph mgr";
374
- if (!(t == this.rootGraph || t.parent != null && t.parent.graphManager == this)) throw "Invalid parent node!";
375
- var n = [];
376
- n = n.concat(t.getEdges());
377
- for (var a, o = n.length, s = 0; s < o; s++) a = n[s], t.remove(a);
378
- var c = [];
379
- c = c.concat(t.getNodes());
380
- var l;
381
- o = c.length;
382
- for (var s = 0; s < o; s++) l = c[s], t.remove(l);
383
- t == this.rootGraph && this.setRootGraph(null);
384
- var u = this.graphs.indexOf(t);
385
- this.graphs.splice(u, 1), t.parent = null;
386
- } else if (e instanceof i) {
387
- if (a = e, a == null) throw "Edge is null!";
388
- if (!a.isInterGraph) throw "Not an inter-graph edge!";
389
- if (a.source == null || a.target == null) throw "Source and/or target is null!";
390
- if (a.source.edges.indexOf(a) == -1 || a.target.edges.indexOf(a) == -1) throw "Source and/or target doesn't know this edge!";
391
- var u = a.source.edges.indexOf(a);
392
- if (a.source.edges.splice(u, 1), u = a.target.edges.indexOf(a), a.target.edges.splice(u, 1), a.source.owner == null || a.source.owner.getGraphManager() == null) throw "Edge owner graph or owner graph manager is null!";
393
- if (a.source.owner.getGraphManager().edges.indexOf(a) == -1) throw "Not in owner graph manager's edge list!";
394
- var u = a.source.owner.getGraphManager().edges.indexOf(a);
395
- a.source.owner.getGraphManager().edges.splice(u, 1);
396
- }
397
- }, a.prototype.updateBounds = function() {
398
- this.rootGraph.updateBounds(!0);
399
- }, a.prototype.getGraphs = function() {
400
- return this.graphs;
401
- }, a.prototype.getAllNodes = function() {
402
- if (this.allNodes == null) {
403
- for (var e = [], t = this.getGraphs(), n = t.length, r = 0; r < n; r++) e = e.concat(t[r].getNodes());
404
- this.allNodes = e;
405
- }
406
- return this.allNodes;
407
- }, a.prototype.resetAllNodes = function() {
408
- this.allNodes = null;
409
- }, a.prototype.resetAllEdges = function() {
410
- this.allEdges = null;
411
- }, a.prototype.resetAllNodesToApplyGravitation = function() {
412
- this.allNodesToApplyGravitation = null;
413
- }, a.prototype.getAllEdges = function() {
414
- if (this.allEdges == null) {
415
- var e = [], t = this.getGraphs();
416
- t.length;
417
- for (var n = 0; n < t.length; n++) e = e.concat(t[n].getEdges());
418
- e = e.concat(this.edges), this.allEdges = e;
419
- }
420
- return this.allEdges;
421
- }, a.prototype.getAllNodesToApplyGravitation = function() {
422
- return this.allNodesToApplyGravitation;
423
- }, a.prototype.setAllNodesToApplyGravitation = function(e) {
424
- if (this.allNodesToApplyGravitation != null) throw "assert failed";
425
- this.allNodesToApplyGravitation = e;
426
- }, a.prototype.getRoot = function() {
427
- return this.rootGraph;
428
- }, a.prototype.setRootGraph = function(e) {
429
- if (e.getGraphManager() != this) throw "Root not in this graph mgr!";
430
- this.rootGraph = e, e.parent ??= this.layout.newNode("Root node");
431
- }, a.prototype.getLayout = function() {
432
- return this.layout;
433
- }, a.prototype.isOneAncestorOfOther = function(e, t) {
434
- if (e == null || t == null) throw "assert failed";
435
- if (e == t) return !0;
436
- var n = e.getOwner(), r;
437
- do {
438
- if (r = n.getParent(), r == null) break;
439
- if (r == t) return !0;
440
- if (n = r.getOwner(), n == null) break;
441
- } while (!0);
442
- n = t.getOwner();
443
- do {
444
- if (r = n.getParent(), r == null) break;
445
- if (r == e) return !0;
446
- if (n = r.getOwner(), n == null) break;
447
- } while (!0);
448
- return !1;
449
- }, a.prototype.calcLowestCommonAncestors = function() {
450
- for (var e, t, n, r, i, a = this.getAllEdges(), o = a.length, s = 0; s < o; s++) {
451
- if (e = a[s], t = e.source, n = e.target, e.lca = null, e.sourceInLca = t, e.targetInLca = n, t == n) {
452
- e.lca = t.getOwner();
453
- continue;
454
- }
455
- for (r = t.getOwner(); e.lca == null;) {
456
- for (e.targetInLca = n, i = n.getOwner(); e.lca == null;) {
457
- if (i == r) {
458
- e.lca = i;
459
- break;
460
- }
461
- if (i == this.rootGraph) break;
462
- if (e.lca != null) throw "assert failed";
463
- e.targetInLca = i.getParent(), i = e.targetInLca.getOwner();
464
- }
465
- if (r == this.rootGraph) break;
466
- e.lca ?? (e.sourceInLca = r.getParent(), r = e.sourceInLca.getOwner());
467
- }
468
- if (e.lca == null) throw "assert failed";
469
- }
470
- }, a.prototype.calcLowestCommonAncestor = function(e, t) {
471
- if (e == t) return e.getOwner();
472
- var n = e.getOwner();
473
- do {
474
- if (n == null) break;
475
- var r = t.getOwner();
476
- do {
477
- if (r == null) break;
478
- if (r == n) return r;
479
- r = r.getParent().getOwner();
480
- } while (!0);
481
- n = n.getParent().getOwner();
482
- } while (!0);
483
- return n;
484
- }, a.prototype.calcInclusionTreeDepths = function(e, t) {
485
- e == null && t == null && (e = this.rootGraph, t = 1);
486
- 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);
487
- }, a.prototype.includesInvalidEdge = function() {
488
- 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;
489
- return !1;
490
- }, e.exports = a;
491
- }),
492
- (function(e, t, n) {
493
- var r = n(0);
494
- function i() {}
495
- for (var a in r) i[a] = r[a];
496
- i.MAX_ITERATIONS = 2500, i.DEFAULT_EDGE_LENGTH = 50, i.DEFAULT_SPRING_STRENGTH = .45, i.DEFAULT_REPULSION_STRENGTH = 4500, i.DEFAULT_GRAVITY_STRENGTH = .4, i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, i.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, i.DEFAULT_COOLING_FACTOR_INCREMENTAL = .3, i.COOLING_ADAPTATION_FACTOR = .33, i.ADAPTATION_LOWER_NODE_LIMIT = 1e3, i.ADAPTATION_UPPER_NODE_LIMIT = 5e3, i.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, i.MAX_NODE_DISPLACEMENT = i.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, i.MIN_REPULSION_DIST = i.DEFAULT_EDGE_LENGTH / 10, i.CONVERGENCE_CHECK_PERIOD = 100, i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = .1, i.MIN_EDGE_LENGTH = 1, i.GRID_CALCULATION_CHECK_PERIOD = 10, e.exports = i;
497
- }),
498
- (function(e, t, n) {
499
- var r = n(12);
500
- function i() {}
501
- i.calcSeparationAmount = function(e, t, n, r) {
502
- if (!e.intersects(t)) throw "assert failed";
503
- var i = [, ,];
504
- 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()));
505
- var a = Math.abs((t.getCenterY() - e.getCenterY()) / (t.getCenterX() - e.getCenterX()));
506
- t.getCenterY() === e.getCenterY() && t.getCenterX() === e.getCenterX() && (a = 1);
507
- var o = a * n[0], s = n[1] / a;
508
- 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);
509
- }, i.decideDirectionsForOverlappingNodes = function(e, t, n) {
510
- n[0] = e.getCenterX() < t.getCenterX() ? -1 : 1, n[1] = e.getCenterY() < t.getCenterY() ? -1 : 1;
511
- }, i.getIntersection2 = function(e, t, n) {
512
- var r = e.getCenterX(), i = e.getCenterY(), a = t.getCenterX(), o = t.getCenterY();
513
- if (e.intersects(t)) return n[0] = r, n[1] = i, n[2] = a, n[3] = o, !0;
514
- 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;
515
- if (r === a) {
516
- if (i > o) return n[0] = r, n[1] = c, n[2] = a, n[3] = y, !1;
517
- if (i < o) return n[0] = r, n[1] = d, n[2] = a, n[3] = g, !1;
518
- } else if (i === o) {
519
- if (r > a) return n[0] = s, n[1] = i, n[2] = _, n[3] = o, !1;
520
- if (r < a) return n[0] = l, n[1] = i, n[2] = h, n[3] = o, !1;
521
- } else {
522
- 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;
523
- 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;
524
- 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) {
525
- case 1:
526
- j = c, A = r + -m / D, n[0] = A, n[1] = j;
527
- break;
528
- case 2:
529
- A = f, j = i + p * D, n[0] = A, n[1] = j;
530
- break;
531
- case 3:
532
- j = d, A = r + m / D, n[0] = A, n[1] = j;
533
- break;
534
- case 4: A = u, j = i + -p * D, n[0] = A, n[1] = j;
535
- }
536
- if (!w) switch (k) {
537
- case 1:
538
- N = g, M = a + -S / D, n[2] = M, n[3] = N;
539
- break;
540
- case 2:
541
- M = b, N = o + x * D, n[2] = M, n[3] = N;
542
- break;
543
- case 3:
544
- N = y, M = a + S / D, n[2] = M, n[3] = N;
545
- break;
546
- case 4: M = v, N = o + -x * D, n[2] = M, n[3] = N;
547
- }
548
- }
549
- return !1;
550
- }, i.getCardinalDirection = function(e, t, n) {
551
- return e > t ? n : 1 + n % 4;
552
- }, i.getIntersection = function(e, t, n, i) {
553
- if (i == null) return this.getIntersection2(e, t, n);
554
- var a = e.x, o = e.y, s = t.x, c = t.y, l = n.x, u = n.y, d = i.x, f = i.y, p = void 0, m = void 0, h = void 0, g = void 0, _ = void 0, v = void 0, y = void 0, b = void 0, x = void 0;
555
- return h = c - o, _ = a - s, y = s * o - a * c, g = f - u, v = l - d, b = d * u - l * f, x = h * v - g * _, x === 0 ? null : (p = (_ * b - v * y) / x, m = (g * y - h * b) / x, new r(p, m));
556
- }, i.angleOfVector = function(e, t, n, r) {
557
- var i = void 0;
558
- 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;
559
- }, i.doIntersect = function(e, t, n, r) {
560
- 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);
561
- if (f === 0) return !1;
562
- var p = ((d - l) * (u - i) + (c - u) * (d - a)) / f, m = ((a - s) * (u - i) + (o - i) * (d - a)) / f;
563
- return 0 < p && p < 1 && 0 < m && m < 1;
564
- }, i.HALF_PI = .5 * Math.PI, i.ONE_AND_HALF_PI = 1.5 * Math.PI, i.TWO_PI = 2 * Math.PI, i.THREE_PI = 3 * Math.PI, e.exports = i;
565
- }),
566
- (function(e, t, n) {
567
- function r() {}
568
- r.sign = function(e) {
569
- return e > 0 ? 1 : e < 0 ? -1 : 0;
570
- }, r.floor = function(e) {
571
- return e < 0 ? Math.ceil(e) : Math.floor(e);
572
- }, r.ceil = function(e) {
573
- return e < 0 ? Math.floor(e) : Math.ceil(e);
574
- }, e.exports = r;
575
- }),
576
- (function(e, t, n) {
577
- function r() {}
578
- r.MAX_VALUE = 2147483647, r.MIN_VALUE = -2147483648, e.exports = r;
579
- }),
580
- (function(e, t, n) {
581
- var r = function() {
582
- function e(e, t) {
583
- for (var n = 0; n < t.length; n++) {
584
- var r = t[n];
585
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
586
- }
587
- }
588
- return function(t, n, r) {
589
- return n && e(t.prototype, n), r && e(t, r), t;
590
- };
591
- }();
592
- function i(e, t) {
593
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
594
- }
595
- var a = function(e) {
596
- return {
597
- value: e,
598
- next: null,
599
- prev: null
600
- };
601
- }, o = function(e, t, n, r) {
602
- 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;
603
- }, s = function(e, t) {
604
- var n = e.prev, r = e.next;
605
- 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;
606
- };
607
- e.exports = function() {
608
- function e(t) {
609
- var n = this;
610
- i(this, e), this.length = 0, this.head = null, this.tail = null, t?.forEach(function(e) {
611
- return n.push(e);
612
- });
613
- }
614
- return r(e, [
615
- {
616
- key: "size",
617
- value: function() {
618
- return this.length;
619
- }
620
- },
621
- {
622
- key: "insertBefore",
623
- value: function(e, t) {
624
- return o(t.prev, a(e), t, this);
625
- }
626
- },
627
- {
628
- key: "insertAfter",
629
- value: function(e, t) {
630
- return o(t, a(e), t.next, this);
631
- }
632
- },
633
- {
634
- key: "insertNodeBefore",
635
- value: function(e, t) {
636
- return o(t.prev, e, t, this);
637
- }
638
- },
639
- {
640
- key: "insertNodeAfter",
641
- value: function(e, t) {
642
- return o(t, e, t.next, this);
643
- }
644
- },
645
- {
646
- key: "push",
647
- value: function(e) {
648
- return o(this.tail, a(e), null, this);
649
- }
650
- },
651
- {
652
- key: "unshift",
653
- value: function(e) {
654
- return o(null, a(e), this.head, this);
655
- }
656
- },
657
- {
658
- key: "remove",
659
- value: function(e) {
660
- return s(e, this);
661
- }
662
- },
663
- {
664
- key: "pop",
665
- value: function() {
666
- return s(this.tail, this).value;
667
- }
668
- },
669
- {
670
- key: "popNode",
671
- value: function() {
672
- return s(this.tail, this);
673
- }
674
- },
675
- {
676
- key: "shift",
677
- value: function() {
678
- return s(this.head, this).value;
679
- }
680
- },
681
- {
682
- key: "shiftNode",
683
- value: function() {
684
- return s(this.head, this);
685
- }
686
- },
687
- {
688
- key: "get_object_at",
689
- value: function(e) {
690
- if (e <= this.length()) {
691
- for (var t = 1, n = this.head; t < e;) n = n.next, t++;
692
- return n.value;
693
- }
694
- }
695
- },
696
- {
697
- key: "set_object_at",
698
- value: function(e, t) {
699
- if (e <= this.length()) {
700
- for (var n = 1, r = this.head; n < e;) r = r.next, n++;
701
- r.value = t;
702
- }
703
- }
704
- }
705
- ]), e;
706
- }();
707
- }),
708
- (function(e, t, n) {
709
- function r(e, t, n) {
710
- 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);
711
- }
712
- r.prototype.getX = function() {
713
- return this.x;
714
- }, r.prototype.getY = function() {
715
- return this.y;
716
- }, r.prototype.getLocation = function() {
717
- return new r(this.x, this.y);
718
- }, r.prototype.setLocation = function(e, t, n) {
719
- 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)));
720
- }, r.prototype.move = function(e, t) {
721
- this.x = e, this.y = t;
722
- }, r.prototype.translate = function(e, t) {
723
- this.x += e, this.y += t;
724
- }, r.prototype.equals = function(e) {
725
- if (e.constructor.name == "Point") {
726
- var t = e;
727
- return this.x == t.x && this.y == t.y;
728
- }
729
- return this == e;
730
- }, r.prototype.toString = function() {
731
- return new r().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
732
- }, e.exports = r;
733
- }),
734
- (function(e, t, n) {
735
- function r(e, t, n, r) {
736
- 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);
737
- }
738
- r.prototype.getX = function() {
739
- return this.x;
740
- }, r.prototype.setX = function(e) {
741
- this.x = e;
742
- }, r.prototype.getY = function() {
743
- return this.y;
744
- }, r.prototype.setY = function(e) {
745
- this.y = e;
746
- }, r.prototype.getWidth = function() {
747
- return this.width;
748
- }, r.prototype.setWidth = function(e) {
749
- this.width = e;
750
- }, r.prototype.getHeight = function() {
751
- return this.height;
752
- }, r.prototype.setHeight = function(e) {
753
- this.height = e;
754
- }, r.prototype.getRight = function() {
755
- return this.x + this.width;
756
- }, r.prototype.getBottom = function() {
757
- return this.y + this.height;
758
- }, r.prototype.intersects = function(e) {
759
- return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y);
760
- }, r.prototype.getCenterX = function() {
761
- return this.x + this.width / 2;
762
- }, r.prototype.getMinX = function() {
763
- return this.getX();
764
- }, r.prototype.getMaxX = function() {
765
- return this.getX() + this.width;
766
- }, r.prototype.getCenterY = function() {
767
- return this.y + this.height / 2;
768
- }, r.prototype.getMinY = function() {
769
- return this.getY();
770
- }, r.prototype.getMaxY = function() {
771
- return this.getY() + this.height;
772
- }, r.prototype.getWidthHalf = function() {
773
- return this.width / 2;
774
- }, r.prototype.getHeightHalf = function() {
775
- return this.height / 2;
776
- }, e.exports = r;
777
- }),
778
- (function(e, t, n) {
779
- var r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
780
- return typeof e;
781
- } : function(e) {
782
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
783
- };
784
- function i() {}
785
- i.lastID = 0, i.createID = function(e) {
786
- return i.isPrimitive(e) ? e : e.uniqueID == null ? (e.uniqueID = i.getString(), i.lastID++, e.uniqueID) : e.uniqueID;
787
- }, i.getString = function(e) {
788
- return e ??= i.lastID, "Object#" + e;
789
- }, i.isPrimitive = function(e) {
790
- var t = e === void 0 ? "undefined" : r(e);
791
- return e == null || t != "object" && t != "function";
792
- }, e.exports = i;
793
- }),
794
- (function(e, t, n) {
795
- function r(e) {
796
- if (Array.isArray(e)) {
797
- for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
798
- return n;
799
- }
800
- return Array.from(e);
801
- }
802
- var i = n(0), a = n(6), o = n(3), s = n(1), c = n(5), l = n(4), u = n(17), d = n(27);
803
- function f(e) {
804
- d.call(this), this.layoutQuality = i.QUALITY, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = i.DEFAULT_INCREMENTAL, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new a(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, e != null && (this.isRemoteUse = e);
805
- }
806
- f.RANDOM_SEED = 1, f.prototype = Object.create(d.prototype), f.prototype.getGraphManager = function() {
807
- return this.graphManager;
808
- }, f.prototype.getAllNodes = function() {
809
- return this.graphManager.getAllNodes();
810
- }, f.prototype.getAllEdges = function() {
811
- return this.graphManager.getAllEdges();
812
- }, f.prototype.getAllNodesToApplyGravitation = function() {
813
- return this.graphManager.getAllNodesToApplyGravitation();
814
- }, f.prototype.newGraphManager = function() {
815
- var e = new a(this);
816
- return this.graphManager = e, e;
817
- }, f.prototype.newGraph = function(e) {
818
- return new c(null, this.graphManager, e);
819
- }, f.prototype.newNode = function(e) {
820
- return new o(this.graphManager, e);
821
- }, f.prototype.newEdge = function(e) {
822
- return new s(null, null, e);
823
- }, f.prototype.checkLayoutSuccess = function() {
824
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
825
- }, f.prototype.runLayout = function() {
826
- this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
827
- var e = !this.checkLayoutSuccess() && this.layout();
828
- return i.ANIMATE !== "during" && (e && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, e);
829
- }, f.prototype.doPostLayout = function() {
830
- this.incremental || this.transform(), this.update();
831
- }, f.prototype.update2 = function() {
832
- if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
833
- for (var e = this.graphManager.getAllEdges(), t = 0; t < e.length; t++) e[t];
834
- for (var n = this.graphManager.getRoot().getNodes(), t = 0; t < n.length; t++) n[t];
835
- this.update(this.graphManager.getRoot());
836
- }
837
- }, f.prototype.update = function(e) {
838
- if (e == null) this.update2();
839
- else if (e instanceof o) {
840
- var t = e;
841
- if (t.getChild() != null) for (var n = t.getChild().getNodes(), r = 0; r < n.length; r++) update(n[r]);
842
- t.vGraphObject != null && t.vGraphObject.update(t);
843
- } else if (e instanceof s) {
844
- var i = e;
845
- i.vGraphObject != null && i.vGraphObject.update(i);
846
- } else if (e instanceof c) {
847
- var a = e;
848
- a.vGraphObject != null && a.vGraphObject.update(a);
849
- }
850
- }, f.prototype.initParameters = function() {
851
- this.isSubLayout || (this.layoutQuality = i.QUALITY, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = i.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
852
- }, f.prototype.transform = function(e) {
853
- if (e == null) this.transform(new l(0, 0));
854
- else {
855
- var t = new u(), n = this.graphManager.getRoot().updateLeftTop();
856
- if (n != null) {
857
- t.setWorldOrgX(e.x), t.setWorldOrgY(e.y), t.setDeviceOrgX(n.x), t.setDeviceOrgY(n.y);
858
- for (var r = this.getAllNodes(), i, a = 0; a < r.length; a++) i = r[a], i.transform(t);
859
- }
860
- }
861
- }, f.prototype.positionNodesRandomly = function(e) {
862
- if (e == null) this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
863
- 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());
864
- }, f.prototype.getFlatForest = function() {
865
- for (var e = [], t = !0, n = this.graphManager.getRoot().getNodes(), i = !0, a = 0; a < n.length; a++) n[a].getChild() != null && (i = !1);
866
- if (!i) return e;
867
- var o = /* @__PURE__ */ new Set(), s = [], c = /* @__PURE__ */ new Map(), l = [];
868
- for (l = l.concat(n); l.length > 0 && t;) {
869
- for (s.push(l[0]); s.length > 0 && t;) {
870
- var u = s[0];
871
- s.splice(0, 1), o.add(u);
872
- for (var d = u.getEdges(), a = 0; a < d.length; a++) {
873
- var f = d[a].getOtherEnd(u);
874
- if (c.get(u) != f) {
875
- if (!o.has(f)) s.push(f), c.set(f, u);
876
- else {
877
- t = !1;
878
- break;
879
- }
880
- }
881
- }
882
- }
883
- if (!t) e = [];
884
- else {
885
- var p = [].concat(r(o));
886
- e.push(p);
887
- for (var a = 0; a < p.length; a++) {
888
- var m = p[a], h = l.indexOf(m);
889
- h > -1 && l.splice(h, 1);
890
- }
891
- o = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
892
- }
893
- }
894
- return e;
895
- }, f.prototype.createDummyNodesForBendpoints = function(e) {
896
- for (var t = [], n = e.source, r = this.graphManager.calcLowestCommonAncestor(e.source, e.target), i = 0; i < e.bendpoints.length; i++) {
897
- var a = this.newNode(null);
898
- a.setRect(new Point(0, 0), new Dimension(1, 1)), r.add(a);
899
- var o = this.newEdge(null);
900
- this.graphManager.add(o, n, a), t.add(a), n = a;
901
- }
902
- var o = this.newEdge(null);
903
- return this.graphManager.add(o, n, e.target), this.edgeToDummyNodes.set(e, t), e.isInterGraph() ? this.graphManager.remove(e) : r.remove(e), t;
904
- }, f.prototype.createBendpointsFromDummyNodes = function() {
905
- var e = [];
906
- e = e.concat(this.graphManager.getAllEdges()), e = [].concat(r(this.edgeToDummyNodes.keys()), e);
907
- for (var t = 0; t < e.length; t++) {
908
- var n = e[t];
909
- if (n.bendpoints.length > 0) {
910
- for (var i = this.edgeToDummyNodes.get(n), a = 0; a < i.length; a++) {
911
- var o = i[a], s = new l(o.getCenterX(), o.getCenterY()), c = n.bendpoints.get(a);
912
- c.x = s.x, c.y = s.y, o.getOwner().remove(o);
913
- }
914
- this.graphManager.add(n, n.source, n.target);
915
- }
916
- }
917
- }, f.transform = function(e, t, n, r) {
918
- if (n != null && r != null) {
919
- var i = t;
920
- if (e <= 50) {
921
- var a = t / n;
922
- i -= (t - a) / 50 * (50 - e);
923
- } else {
924
- var o = t * r;
925
- i += (o - t) / 50 * (e - 50);
926
- }
927
- return i;
928
- }
929
- var s, c;
930
- return e <= 50 ? (s = 9 * t / 500, c = t / 10) : (s = 9 * t / 50, c = -8 * t), s * e + c;
931
- }, f.findCenterOfTree = function(e) {
932
- var t = [];
933
- t = t.concat(e);
934
- var n = [], r = /* @__PURE__ */ new Map(), i = !1, a = null;
935
- (t.length == 1 || t.length == 2) && (i = !0, a = t[0]);
936
- for (var o = 0; o < t.length; o++) {
937
- var s = t[o], c = s.getNeighborsList().size;
938
- r.set(s, s.getNeighborsList().size), c == 1 && n.push(s);
939
- }
940
- var l = [];
941
- for (l = l.concat(n); !i;) {
942
- var u = [];
943
- u = u.concat(l), l = [];
944
- for (var o = 0; o < t.length; o++) {
945
- var s = t[o], d = t.indexOf(s);
946
- d >= 0 && t.splice(d, 1), s.getNeighborsList().forEach(function(e) {
947
- if (n.indexOf(e) < 0) {
948
- var t = r.get(e) - 1;
949
- t == 1 && l.push(e), r.set(e, t);
950
- }
951
- });
952
- }
953
- n = n.concat(l), (t.length == 1 || t.length == 2) && (i = !0, a = t[0]);
954
- }
955
- return a;
956
- }, f.prototype.setGraphManager = function(e) {
957
- this.graphManager = e;
958
- }, e.exports = f;
959
- }),
960
- (function(e, t, n) {
961
- function r() {}
962
- r.seed = 1, r.x = 0, r.nextDouble = function() {
963
- return r.x = Math.sin(r.seed++) * 1e4, r.x - Math.floor(r.x);
964
- }, e.exports = r;
965
- }),
966
- (function(e, t, n) {
967
- var r = n(4);
968
- function i(e, t) {
969
- this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
970
- }
971
- i.prototype.getWorldOrgX = function() {
972
- return this.lworldOrgX;
973
- }, i.prototype.setWorldOrgX = function(e) {
974
- this.lworldOrgX = e;
975
- }, i.prototype.getWorldOrgY = function() {
976
- return this.lworldOrgY;
977
- }, i.prototype.setWorldOrgY = function(e) {
978
- this.lworldOrgY = e;
979
- }, i.prototype.getWorldExtX = function() {
980
- return this.lworldExtX;
981
- }, i.prototype.setWorldExtX = function(e) {
982
- this.lworldExtX = e;
983
- }, i.prototype.getWorldExtY = function() {
984
- return this.lworldExtY;
985
- }, i.prototype.setWorldExtY = function(e) {
986
- this.lworldExtY = e;
987
- }, i.prototype.getDeviceOrgX = function() {
988
- return this.ldeviceOrgX;
989
- }, i.prototype.setDeviceOrgX = function(e) {
990
- this.ldeviceOrgX = e;
991
- }, i.prototype.getDeviceOrgY = function() {
992
- return this.ldeviceOrgY;
993
- }, i.prototype.setDeviceOrgY = function(e) {
994
- this.ldeviceOrgY = e;
995
- }, i.prototype.getDeviceExtX = function() {
996
- return this.ldeviceExtX;
997
- }, i.prototype.setDeviceExtX = function(e) {
998
- this.ldeviceExtX = e;
999
- }, i.prototype.getDeviceExtY = function() {
1000
- return this.ldeviceExtY;
1001
- }, i.prototype.setDeviceExtY = function(e) {
1002
- this.ldeviceExtY = e;
1003
- }, i.prototype.transformX = function(e) {
1004
- var t = 0, n = this.lworldExtX;
1005
- return n != 0 && (t = this.ldeviceOrgX + (e - this.lworldOrgX) * this.ldeviceExtX / n), t;
1006
- }, i.prototype.transformY = function(e) {
1007
- var t = 0, n = this.lworldExtY;
1008
- return n != 0 && (t = this.ldeviceOrgY + (e - this.lworldOrgY) * this.ldeviceExtY / n), t;
1009
- }, i.prototype.inverseTransformX = function(e) {
1010
- var t = 0, n = this.ldeviceExtX;
1011
- return n != 0 && (t = this.lworldOrgX + (e - this.ldeviceOrgX) * this.lworldExtX / n), t;
1012
- }, i.prototype.inverseTransformY = function(e) {
1013
- var t = 0, n = this.ldeviceExtY;
1014
- return n != 0 && (t = this.lworldOrgY + (e - this.ldeviceOrgY) * this.lworldExtY / n), t;
1015
- }, i.prototype.inverseTransformPoint = function(e) {
1016
- return new r(this.inverseTransformX(e.x), this.inverseTransformY(e.y));
1017
- }, e.exports = i;
1018
- }),
1019
- (function(e, t, n) {
1020
- function r(e) {
1021
- if (Array.isArray(e)) {
1022
- for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
1023
- return n;
1024
- }
1025
- return Array.from(e);
1026
- }
1027
- var i = n(15), a = n(7), o = n(0), s = n(8), c = n(9);
1028
- function l() {
1029
- i.call(this), this.useSmartIdealEdgeLengthCalculation = a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = a.DEFAULT_EDGE_LENGTH, this.springConstant = a.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = a.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = a.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = a.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = a.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = a.MAX_ITERATIONS;
1030
- }
1031
- for (var u in l.prototype = Object.create(i.prototype), i) l[u] = i[u];
1032
- l.prototype.initParameters = function() {
1033
- i.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1034
- }, l.prototype.calcIdealEdgeLengths = function() {
1035
- for (var e, t, n, r, i, s, 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(), s = e.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (e.idealLength += i + s - 2 * o.SIMPLE_NODE_SIZE), t = e.getLca().getInclusionTreeDepth(), e.idealLength += a.DEFAULT_EDGE_LENGTH * a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (n.getInclusionTreeDepth() + r.getInclusionTreeDepth() - 2 * t));
1036
- }, l.prototype.initSpringEmbedder = function() {
1037
- var e = this.getAllNodes().length;
1038
- this.incremental ? (e > a.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * a.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (e - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - a.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (this.coolingFactor = e > a.ADAPTATION_LOWER_NODE_LIMIT ? Math.max(a.COOLING_ADAPTATION_FACTOR, 1 - (e - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * (1 - a.COOLING_ADAPTATION_FACTOR)) : 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1039
- }, l.prototype.calcSpringForces = function() {
1040
- for (var e = this.getAllEdges(), t, n = 0; n < e.length; n++) t = e[n], this.calcSpringForce(t, t.idealLength);
1041
- }, l.prototype.calcRepulsionForces = function() {
1042
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n, r, i, o, s = this.getAllNodes(), c;
1043
- if (this.useFRGridVariant) for (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && e && this.updateGrid(), c = /* @__PURE__ */ new Set(), n = 0; n < s.length; n++) i = s[n], this.calculateRepulsionForceOfANode(i, c, e, t), c.add(i);
1044
- else for (n = 0; n < s.length; n++) for (i = s[n], r = n + 1; r < s.length; r++) o = s[r], i.getOwner() == o.getOwner() && this.calcRepulsionForce(i, o);
1045
- }, l.prototype.calcGravitationalForces = function() {
1046
- for (var e, t = this.getAllNodesToApplyGravitation(), n = 0; n < t.length; n++) e = t[n], this.calcGravitationalForce(e);
1047
- }, l.prototype.moveNodes = function() {
1048
- for (var e = this.getAllNodes(), t, n = 0; n < e.length; n++) t = e[n], t.move();
1049
- }, l.prototype.calcSpringForce = function(e, t) {
1050
- var n = e.getSource(), r = e.getTarget(), i, a, o, s;
1051
- if (this.uniformLeafNodeSizes && n.getChild() == null && r.getChild() == null) e.updateLengthSimple();
1052
- else if (e.updateLength(), e.isOverlapingSourceAndTarget) return;
1053
- 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);
1054
- }, l.prototype.calcRepulsionForce = function(e, t) {
1055
- var n = e.getRect(), r = t.getRect(), i = [, ,], o = [
1056
- ,
1057
- ,
1058
- ,
1059
- ,
1060
- ], l, u, d, f, p, m, h;
1061
- if (n.intersects(r)) {
1062
- s.calcSeparationAmount(n, r, i, a.DEFAULT_EDGE_LENGTH / 2), m = 2 * i[0], h = 2 * i[1];
1063
- var g = e.noOfChildren * t.noOfChildren / (e.noOfChildren + t.noOfChildren);
1064
- e.repulsionForceX -= g * m, e.repulsionForceY -= g * h, t.repulsionForceX += g * m, t.repulsionForceY += g * h;
1065
- } else this.uniformLeafNodeSizes && e.getChild() == null && t.getChild() == null ? (l = r.getCenterX() - n.getCenterX(), u = r.getCenterY() - n.getCenterY()) : (s.getIntersection(n, r, o), l = o[2] - o[0], u = o[3] - o[1]), Math.abs(l) < a.MIN_REPULSION_DIST && (l = c.sign(l) * a.MIN_REPULSION_DIST), Math.abs(u) < a.MIN_REPULSION_DIST && (u = c.sign(u) * a.MIN_REPULSION_DIST), d = l * l + u * u, f = Math.sqrt(d), p = this.repulsionConstant * e.noOfChildren * t.noOfChildren / d, m = p * l / f, h = p * u / f, e.repulsionForceX -= m, e.repulsionForceY -= h, t.repulsionForceX += m, t.repulsionForceY += h;
1066
- }, l.prototype.calcGravitationalForce = function(e) {
1067
- 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;
1068
- 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));
1069
- }, l.prototype.isConverged = function() {
1070
- var e, t = !1;
1071
- 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;
1072
- }, l.prototype.animate = function() {
1073
- this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1074
- }, l.prototype.calcNoOfChildrenForAllNodes = function() {
1075
- for (var e, t = this.graphManager.getAllNodes(), n = 0; n < t.length; n++) e = t[n], e.noOfChildren = e.getNoOfChildren();
1076
- }, l.prototype.calcGrid = function(e) {
1077
- var t = 0, n = 0;
1078
- t = parseInt(Math.ceil((e.getRight() - e.getLeft()) / this.repulsionRange)), n = parseInt(Math.ceil((e.getBottom() - e.getTop()) / this.repulsionRange));
1079
- for (var r = Array(t), i = 0; i < t; i++) r[i] = Array(n);
1080
- for (var i = 0; i < t; i++) for (var a = 0; a < n; a++) r[i][a] = [];
1081
- return r;
1082
- }, l.prototype.addNodeToGrid = function(e, t, n) {
1083
- var r = 0, i = 0, a = 0, o = 0;
1084
- 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));
1085
- 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);
1086
- }, l.prototype.updateGrid = function() {
1087
- var e, t, n = this.getAllNodes();
1088
- 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());
1089
- }, l.prototype.calculateRepulsionForceOfANode = function(e, t, n, i) {
1090
- if (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && n || i) {
1091
- var o = /* @__PURE__ */ new Set();
1092
- e.surrounding = [];
1093
- 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)) {
1094
- for (var d = 0; d < c[l][u].length; d++) if (s = c[l][u][d], e.getOwner() == s.getOwner() && e != s && !t.has(s) && !o.has(s)) {
1095
- 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);
1096
- f <= this.repulsionRange && p <= this.repulsionRange && o.add(s);
1097
- }
1098
- }
1099
- e.surrounding = [].concat(r(o));
1100
- }
1101
- for (l = 0; l < e.surrounding.length; l++) this.calcRepulsionForce(e, e.surrounding[l]);
1102
- }, l.prototype.calcRepulsionRange = function() {
1103
- return 0;
1104
- }, e.exports = l;
1105
- }),
1106
- (function(e, t, n) {
1107
- var r = n(1), i = n(7);
1108
- function a(e, t, n) {
1109
- r.call(this, e, t, n), this.idealLength = i.DEFAULT_EDGE_LENGTH;
1110
- }
1111
- for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
1112
- e.exports = a;
1113
- }),
1114
- (function(e, t, n) {
1115
- var r = n(3);
1116
- function i(e, t, n, i) {
1117
- r.call(this, e, t, n, i), 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 = [];
1118
- }
1119
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1120
- i.prototype.setGridCoordinates = function(e, t, n, r) {
1121
- this.startX = e, this.finishX = t, this.startY = n, this.finishY = r;
1122
- }, e.exports = i;
1123
- }),
1124
- (function(e, t, n) {
1125
- function r(e, t) {
1126
- this.width = 0, this.height = 0, e !== null && t !== null && (this.height = t, this.width = e);
1127
- }
1128
- r.prototype.getWidth = function() {
1129
- return this.width;
1130
- }, r.prototype.setWidth = function(e) {
1131
- this.width = e;
1132
- }, r.prototype.getHeight = function() {
1133
- return this.height;
1134
- }, r.prototype.setHeight = function(e) {
1135
- this.height = e;
1136
- }, e.exports = r;
1137
- }),
1138
- (function(e, t, n) {
1139
- var r = n(14);
1140
- function i() {
1141
- this.map = {}, this.keys = [];
1142
- }
1143
- i.prototype.put = function(e, t) {
1144
- var n = r.createID(e);
1145
- this.contains(n) || (this.map[n] = t, this.keys.push(e));
1146
- }, i.prototype.contains = function(e) {
1147
- return r.createID(e), this.map[e] != null;
1148
- }, i.prototype.get = function(e) {
1149
- var t = r.createID(e);
1150
- return this.map[t];
1151
- }, i.prototype.keySet = function() {
1152
- return this.keys;
1153
- }, e.exports = i;
1154
- }),
1155
- (function(e, t, n) {
1156
- var r = n(14);
1157
- function i() {
1158
- this.set = {};
1159
- }
1160
- i.prototype.add = function(e) {
1161
- var t = r.createID(e);
1162
- this.contains(t) || (this.set[t] = e);
1163
- }, i.prototype.remove = function(e) {
1164
- delete this.set[r.createID(e)];
1165
- }, i.prototype.clear = function() {
1166
- this.set = {};
1167
- }, i.prototype.contains = function(e) {
1168
- return this.set[r.createID(e)] == e;
1169
- }, i.prototype.isEmpty = function() {
1170
- return this.size() === 0;
1171
- }, i.prototype.size = function() {
1172
- return Object.keys(this.set).length;
1173
- }, i.prototype.addAllTo = function(e) {
1174
- for (var t = Object.keys(this.set), n = t.length, r = 0; r < n; r++) e.push(this.set[t[r]]);
1175
- }, i.prototype.size = function() {
1176
- return Object.keys(this.set).length;
1177
- }, i.prototype.addAll = function(e) {
1178
- for (var t = e.length, n = 0; n < t; n++) {
1179
- var r = e[n];
1180
- this.add(r);
1181
- }
1182
- }, e.exports = i;
1183
- }),
1184
- (function(e, t, n) {
1185
- var r = function() {
1186
- function e(e, t) {
1187
- for (var n = 0; n < t.length; n++) {
1188
- var r = t[n];
1189
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
1190
- }
1191
- }
1192
- return function(t, n, r) {
1193
- return n && e(t.prototype, n), r && e(t, r), t;
1194
- };
1195
- }();
1196
- function i(e, t) {
1197
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1198
- }
1199
- var a = n(11);
1200
- e.exports = function() {
1201
- function e(t, n) {
1202
- i(this, e), (n !== null || n !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1203
- var r = void 0;
1204
- r = t instanceof a ? t.size() : t.length, this._quicksort(t, 0, r - 1);
1205
- }
1206
- return r(e, [
1207
- {
1208
- key: "_quicksort",
1209
- value: function(e, t, n) {
1210
- if (t < n) {
1211
- var r = this._partition(e, t, n);
1212
- this._quicksort(e, t, r), this._quicksort(e, r + 1, n);
1213
- }
1214
- }
1215
- },
1216
- {
1217
- key: "_partition",
1218
- value: function(e, t, n) {
1219
- for (var r = this._get(e, t), i = t, a = n;;) {
1220
- for (; this.compareFunction(r, this._get(e, a));) a--;
1221
- for (; this.compareFunction(this._get(e, i), r);) i++;
1222
- if (i < a) this._swap(e, i, a), i++, a--;
1223
- else return a;
1224
- }
1225
- }
1226
- },
1227
- {
1228
- key: "_get",
1229
- value: function(e, t) {
1230
- return e instanceof a ? e.get_object_at(t) : e[t];
1231
- }
1232
- },
1233
- {
1234
- key: "_set",
1235
- value: function(e, t, n) {
1236
- e instanceof a ? e.set_object_at(t, n) : e[t] = n;
1237
- }
1238
- },
1239
- {
1240
- key: "_swap",
1241
- value: function(e, t, n) {
1242
- var r = this._get(e, t);
1243
- this._set(e, t, this._get(e, n)), this._set(e, n, r);
1244
- }
1245
- },
1246
- {
1247
- key: "_defaultCompareFunction",
1248
- value: function(e, t) {
1249
- return t > e;
1250
- }
1251
- }
1252
- ]), e;
1253
- }();
1254
- }),
1255
- (function(e, t, n) {
1256
- var r = function() {
1257
- function e(e, t) {
1258
- for (var n = 0; n < t.length; n++) {
1259
- var r = t[n];
1260
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
1261
- }
1262
- }
1263
- return function(t, n, r) {
1264
- return n && e(t.prototype, n), r && e(t, r), t;
1265
- };
1266
- }();
1267
- function i(e, t) {
1268
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1269
- }
1270
- e.exports = function() {
1271
- function e(t, n) {
1272
- var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1273
- i(this, e), this.sequence1 = t, this.sequence2 = n, this.match_score = r, this.mismatch_penalty = a, this.gap_penalty = o, this.iMax = t.length + 1, this.jMax = n.length + 1, this.grid = Array(this.iMax);
1274
- for (var s = 0; s < this.iMax; s++) {
1275
- this.grid[s] = Array(this.jMax);
1276
- for (var c = 0; c < this.jMax; c++) this.grid[s][c] = 0;
1277
- }
1278
- this.tracebackGrid = Array(this.iMax);
1279
- for (var l = 0; l < this.iMax; l++) {
1280
- this.tracebackGrid[l] = Array(this.jMax);
1281
- for (var u = 0; u < this.jMax; u++) this.tracebackGrid[l][u] = [
1282
- null,
1283
- null,
1284
- null
1285
- ];
1286
- }
1287
- this.alignments = [], this.score = -1, this.computeGrids();
1288
- }
1289
- return r(e, [
1290
- {
1291
- key: "getScore",
1292
- value: function() {
1293
- return this.score;
1294
- }
1295
- },
1296
- {
1297
- key: "getAlignments",
1298
- value: function() {
1299
- return this.alignments;
1300
- }
1301
- },
1302
- {
1303
- key: "computeGrids",
1304
- value: function() {
1305
- for (var e = 1; e < this.jMax; e++) this.grid[0][e] = this.grid[0][e - 1] + this.gap_penalty, this.tracebackGrid[0][e] = [
1306
- !1,
1307
- !1,
1308
- !0
1309
- ];
1310
- for (var t = 1; t < this.iMax; t++) this.grid[t][0] = this.grid[t - 1][0] + this.gap_penalty, this.tracebackGrid[t][0] = [
1311
- !1,
1312
- !0,
1313
- !1
1314
- ];
1315
- for (var n = 1; n < this.iMax; n++) for (var r = 1; r < this.jMax; r++) {
1316
- var i = void 0;
1317
- 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;
1318
- var a = this.grid[n - 1][r] + this.gap_penalty, o = this.grid[n][r - 1] + this.gap_penalty, s = [
1319
- i,
1320
- a,
1321
- o
1322
- ], c = this.arrayAllMaxIndexes(s);
1323
- this.grid[n][r] = s[c[0]], this.tracebackGrid[n][r] = [
1324
- c.includes(0),
1325
- c.includes(1),
1326
- c.includes(2)
1327
- ];
1328
- }
1329
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
1330
- }
1331
- },
1332
- {
1333
- key: "alignmentTraceback",
1334
- value: function() {
1335
- var e = [];
1336
- for (e.push({
1337
- pos: [this.sequence1.length, this.sequence2.length],
1338
- seq1: "",
1339
- seq2: ""
1340
- }); e[0];) {
1341
- var t = e[0], n = this.tracebackGrid[t.pos[0]][t.pos[1]];
1342
- n[0] && e.push({
1343
- pos: [t.pos[0] - 1, t.pos[1] - 1],
1344
- seq1: this.sequence1[t.pos[0] - 1] + t.seq1,
1345
- seq2: this.sequence2[t.pos[1] - 1] + t.seq2
1346
- }), n[1] && e.push({
1347
- pos: [t.pos[0] - 1, t.pos[1]],
1348
- seq1: this.sequence1[t.pos[0] - 1] + t.seq1,
1349
- seq2: "-" + t.seq2
1350
- }), n[2] && e.push({
1351
- pos: [t.pos[0], t.pos[1] - 1],
1352
- seq1: "-" + t.seq1,
1353
- seq2: this.sequence2[t.pos[1] - 1] + t.seq2
1354
- }), t.pos[0] === 0 && t.pos[1] === 0 && this.alignments.push({
1355
- sequence1: t.seq1,
1356
- sequence2: t.seq2
1357
- }), e.shift();
1358
- }
1359
- return this.alignments;
1360
- }
1361
- },
1362
- {
1363
- key: "getAllIndexes",
1364
- value: function(e, t) {
1365
- for (var n = [], r = -1; (r = e.indexOf(t, r + 1)) !== -1;) n.push(r);
1366
- return n;
1367
- }
1368
- },
1369
- {
1370
- key: "arrayAllMaxIndexes",
1371
- value: function(e) {
1372
- return this.getAllIndexes(e, Math.max.apply(null, e));
1373
- }
1374
- }
1375
- ]), e;
1376
- }();
1377
- }),
1378
- (function(e, t, n) {
1379
- var r = function() {};
1380
- r.FDLayout = n(18), r.FDLayoutConstants = n(7), r.FDLayoutEdge = n(19), r.FDLayoutNode = n(20), r.DimensionD = n(21), r.HashMap = n(22), r.HashSet = n(23), r.IGeometry = n(8), r.IMath = n(9), r.Integer = n(10), r.Point = n(12), r.PointD = n(4), r.RandomSeed = n(16), r.RectangleD = n(13), r.Transform = n(17), r.UniqueIDGeneretor = n(14), r.Quicksort = n(24), r.LinkedList = n(11), r.LGraphObject = n(2), r.LGraph = n(5), r.LEdge = n(1), r.LGraphManager = n(6), r.LNode = n(3), r.Layout = n(15), r.LayoutConstants = n(0), r.NeedlemanWunsch = n(25), e.exports = r;
1381
- }),
1382
- (function(e, t, n) {
1383
- function r() {
1384
- this.listeners = [];
1385
- }
1386
- var i = r.prototype;
1387
- i.addListener = function(e, t) {
1388
- this.listeners.push({
1389
- event: e,
1390
- callback: t
1391
- });
1392
- }, i.removeListener = function(e, t) {
1393
- for (var n = this.listeners.length; n >= 0; n--) {
1394
- var r = this.listeners[n];
1395
- r.event === e && r.callback === t && this.listeners.splice(n, 1);
1396
- }
1397
- }, i.emit = function(e, t) {
1398
- for (var n = 0; n < this.listeners.length; n++) {
1399
- var r = this.listeners[n];
1400
- e === r.event && r.callback(t);
1401
- }
1402
- }, e.exports = r;
1403
- })
1404
- ]);
1405
- });
1406
- })), s = /* @__PURE__ */ t(((e, t) => {
1407
- (function(n, r) {
1408
- 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);
1409
- })(e, function(e) {
1410
- return (function(e) {
1411
- var t = {};
1412
- function n(r) {
1413
- if (t[r]) return t[r].exports;
1414
- var i = t[r] = {
1415
- i: r,
1416
- l: !1,
1417
- exports: {}
1418
- };
1419
- return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
1420
- }
1421
- return n.m = e, n.c = t, n.i = function(e) {
1422
- return e;
1423
- }, n.d = function(e, t, r) {
1424
- n.o(e, t) || Object.defineProperty(e, t, {
1425
- configurable: !1,
1426
- enumerable: !0,
1427
- get: r
1428
- });
1429
- }, n.n = function(e) {
1430
- var t = e && e.__esModule ? function() {
1431
- return e.default;
1432
- } : function() {
1433
- return e;
1434
- };
1435
- return n.d(t, "a", t), t;
1436
- }, n.o = function(e, t) {
1437
- return Object.prototype.hasOwnProperty.call(e, t);
1438
- }, n.p = "", n(n.s = 7);
1439
- })([
1440
- (function(t, n) {
1441
- t.exports = e;
1442
- }),
1443
- (function(e, t, n) {
1444
- var r = n(0).FDLayoutConstants;
1445
- function i() {}
1446
- for (var a in r) i[a] = r[a];
1447
- i.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, i.DEFAULT_RADIAL_SEPARATION = r.DEFAULT_EDGE_LENGTH, i.DEFAULT_COMPONENT_SEPERATION = 60, i.TILE = !0, i.TILING_PADDING_VERTICAL = 10, i.TILING_PADDING_HORIZONTAL = 10, i.TREE_REDUCTION_ON_INCREMENTAL = !1, e.exports = i;
1448
- }),
1449
- (function(e, t, n) {
1450
- var r = n(0).FDLayoutEdge;
1451
- function i(e, t, n) {
1452
- r.call(this, e, t, n);
1453
- }
1454
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1455
- e.exports = i;
1456
- }),
1457
- (function(e, t, n) {
1458
- var r = n(0).LGraph;
1459
- function i(e, t, n) {
1460
- r.call(this, e, t, n);
1461
- }
1462
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1463
- e.exports = i;
1464
- }),
1465
- (function(e, t, n) {
1466
- var r = n(0).LGraphManager;
1467
- function i(e) {
1468
- r.call(this, e);
1469
- }
1470
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1471
- e.exports = i;
1472
- }),
1473
- (function(e, t, n) {
1474
- var r = n(0).FDLayoutNode, i = n(0).IMath;
1475
- function a(e, t, n, i) {
1476
- r.call(this, e, t, n, i);
1477
- }
1478
- for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
1479
- a.prototype.move = function() {
1480
- var e = this.graphManager.getLayout();
1481
- this.displacementX = e.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = e.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementX = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementX)), Math.abs(this.displacementY) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementY = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementY)), this.child == 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;
1482
- }, a.prototype.propogateDisplacementToChildren = function(e, t) {
1483
- 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);
1484
- }, a.prototype.setPred1 = function(e) {
1485
- this.pred1 = e;
1486
- }, a.prototype.getPred1 = function() {
1487
- return pred1;
1488
- }, a.prototype.getPred2 = function() {
1489
- return pred2;
1490
- }, a.prototype.setNext = function(e) {
1491
- this.next = e;
1492
- }, a.prototype.getNext = function() {
1493
- return next;
1494
- }, a.prototype.setProcessed = function(e) {
1495
- this.processed = e;
1496
- }, a.prototype.isProcessed = function() {
1497
- return processed;
1498
- }, e.exports = a;
1499
- }),
1500
- (function(e, t, n) {
1501
- var r = n(0).FDLayout, i = n(4), a = n(3), o = n(5), s = n(2), c = n(1), l = n(0).FDLayoutConstants, u = n(0).LayoutConstants, d = n(0).Point, f = n(0).PointD, p = n(0).Layout, m = n(0).Integer, h = n(0).IGeometry, g = n(0).LGraph, _ = n(0).Transform;
1502
- function v() {
1503
- r.call(this), this.toBeTiled = {};
1504
- }
1505
- for (var y in v.prototype = Object.create(r.prototype), r) v[y] = r[y];
1506
- v.prototype.newGraphManager = function() {
1507
- var e = new i(this);
1508
- return this.graphManager = e, e;
1509
- }, v.prototype.newGraph = function(e) {
1510
- return new a(null, this.graphManager, e);
1511
- }, v.prototype.newNode = function(e) {
1512
- return new o(this.graphManager, e);
1513
- }, v.prototype.newEdge = function(e) {
1514
- return new s(null, null, e);
1515
- }, v.prototype.initParameters = function() {
1516
- r.prototype.initParameters.call(this, arguments), this.isSubLayout || (this.idealEdgeLength = c.DEFAULT_EDGE_LENGTH < 10 ? 10 : c.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = l.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = l.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = l.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = l.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = l.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / l.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = l.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
1517
- }, v.prototype.layout = function() {
1518
- return u.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1519
- }, v.prototype.classicLayout = function() {
1520
- 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) {
1521
- var e = this.getFlatForest();
1522
- if (e.length > 0) this.positionNodesRadially(e);
1523
- else {
1524
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1525
- var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
1526
- return t.has(e);
1527
- });
1528
- this.graphManager.setAllNodesToApplyGravitation(n), this.positionNodesRandomly();
1529
- }
1530
- } else if (c.TREE_REDUCTION_ON_INCREMENTAL) {
1531
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1532
- var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
1533
- return t.has(e);
1534
- });
1535
- this.graphManager.setAllNodesToApplyGravitation(n);
1536
- }
1537
- return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
1538
- }, v.prototype.tick = function() {
1539
- if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) {
1540
- if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1541
- else return !0;
1542
- }
1543
- if (this.totalIterations % l.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1544
- if (this.isConverged()) {
1545
- if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1546
- else return !0;
1547
- }
1548
- 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));
1549
- }
1550
- if (this.isTreeGrowing) {
1551
- if (this.growTreeIterations % 10 == 0) {
1552
- if (this.prunedNodesAll.length > 0) {
1553
- this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1554
- var e = new Set(this.getAllNodes()), t = this.nodesWithGravity.filter(function(t) {
1555
- return e.has(t);
1556
- });
1557
- this.graphManager.setAllNodesToApplyGravitation(t), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1558
- } else this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1559
- }
1560
- this.growTreeIterations++;
1561
- }
1562
- if (this.isGrowthFinished) {
1563
- if (this.isConverged()) return !0;
1564
- this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1565
- }
1566
- var n = !this.isTreeGrowing && !this.isGrowthFinished, r = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1567
- return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(n, r), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1568
- }, v.prototype.getPositionsData = function() {
1569
- for (var e = this.graphManager.getAllNodes(), t = {}, n = 0; n < e.length; n++) {
1570
- var r = e[n].rect, i = e[n].id;
1571
- t[i] = {
1572
- id: i,
1573
- x: r.getCenterX(),
1574
- y: r.getCenterY(),
1575
- w: r.width,
1576
- h: r.height
1577
- };
1578
- }
1579
- return t;
1580
- }, v.prototype.runSpringEmbedder = function() {
1581
- this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1582
- var e = !1;
1583
- if (l.ANIMATE === "during") this.emit("layoutstarted");
1584
- else {
1585
- for (; !e;) e = this.tick();
1586
- this.graphManager.updateBounds();
1587
- }
1588
- }, v.prototype.calculateNodesToApplyGravitationTo = function() {
1589
- var e = [], t, n = this.graphManager.getGraphs(), r = n.length, i;
1590
- for (i = 0; i < r; i++) t = n[i], t.updateConnected(), t.isConnected || (e = e.concat(t.getNodes()));
1591
- return e;
1592
- }, v.prototype.createBendpoints = function() {
1593
- var e = [];
1594
- e = e.concat(this.graphManager.getAllEdges());
1595
- var t = /* @__PURE__ */ new Set(), n;
1596
- for (n = 0; n < e.length; n++) {
1597
- var r = e[n];
1598
- if (!t.has(r)) {
1599
- var i = r.getSource(), a = r.getTarget();
1600
- if (i == a) r.getBendpoints().push(new f()), r.getBendpoints().push(new f()), this.createDummyNodesForBendpoints(r), t.add(r);
1601
- else {
1602
- var o = [];
1603
- if (o = o.concat(i.getEdgeListToNode(a)), o = o.concat(a.getEdgeListToNode(i)), !t.has(o[0])) {
1604
- if (o.length > 1) {
1605
- var s;
1606
- for (s = 0; s < o.length; s++) {
1607
- var c = o[s];
1608
- c.getBendpoints().push(new f()), this.createDummyNodesForBendpoints(c);
1609
- }
1610
- }
1611
- o.forEach(function(e) {
1612
- t.add(e);
1613
- });
1614
- }
1615
- }
1616
- }
1617
- if (t.size == e.length) break;
1618
- }
1619
- }, v.prototype.positionNodesRadially = function(e) {
1620
- for (var t = new d(0, 0), n = Math.ceil(Math.sqrt(e.length)), r = 0, i = 0, a = 0, o = new f(0, 0), s = 0; s < e.length; s++) {
1621
- s % n == 0 && (a = 0, i = r, s != 0 && (i += c.DEFAULT_COMPONENT_SEPERATION), r = 0);
1622
- var l = e[s], m = p.findCenterOfTree(l);
1623
- t.x = a, t.y = i, o = v.radialLayout(l, m, t), o.y > r && (r = Math.floor(o.y)), a = Math.floor(o.x + c.DEFAULT_COMPONENT_SEPERATION);
1624
- }
1625
- this.transform(new f(u.WORLD_CENTER_X - o.x / 2, u.WORLD_CENTER_Y - o.y / 2));
1626
- }, v.radialLayout = function(e, t, n) {
1627
- var r = Math.max(this.maxDiagonalInTree(e), c.DEFAULT_RADIAL_SEPARATION);
1628
- v.branchRadialLayout(t, null, 0, 359, 0, r);
1629
- var i = g.calculateBounds(e), a = new _();
1630
- a.setDeviceOrgX(i.getMinX()), a.setDeviceOrgY(i.getMinY()), a.setWorldOrgX(n.x), a.setWorldOrgY(n.y);
1631
- for (var o = 0; o < e.length; o++) e[o].transform(a);
1632
- var s = new f(i.getMaxX(), i.getMaxY());
1633
- return a.inverseTransformPoint(s);
1634
- }, v.branchRadialLayout = function(e, t, n, r, i, a) {
1635
- var o = (r - n + 1) / 2;
1636
- o < 0 && (o += 180);
1637
- var s = (o + n) % 360 * h.TWO_PI / 360, c = i * Math.cos(s), l = i * Math.sin(s);
1638
- e.setCenter(c, l);
1639
- var u = [];
1640
- u = u.concat(e.getEdges());
1641
- var d = u.length;
1642
- t != null && d--;
1643
- for (var f = 0, p = u.length, m, g = e.getEdgesBetween(t); g.length > 1;) {
1644
- var _ = g[0];
1645
- g.splice(0, 1);
1646
- var y = u.indexOf(_);
1647
- y >= 0 && u.splice(y, 1), p--, d--;
1648
- }
1649
- m = t == null ? 0 : (u.indexOf(g[0]) + 1) % p;
1650
- for (var b = Math.abs(r - n) / d, x = m; f != d; x = ++x % p) {
1651
- var S = u[x].getOtherEnd(e);
1652
- if (S != t) {
1653
- var C = (n + f * b) % 360, w = (C + b) % 360;
1654
- v.branchRadialLayout(S, e, C, w, i + a, a), f++;
1655
- }
1656
- }
1657
- }, v.maxDiagonalInTree = function(e) {
1658
- for (var t = m.MIN_VALUE, n = 0; n < e.length; n++) {
1659
- var r = e[n].getDiagonal();
1660
- r > t && (t = r);
1661
- }
1662
- return t;
1663
- }, v.prototype.calcRepulsionRange = function() {
1664
- return 2 * (this.level + 1) * this.idealEdgeLength;
1665
- }, v.prototype.groupZeroDegreeMembers = function() {
1666
- var e = this, t = {};
1667
- this.memberGroups = {}, this.idToDummyNode = {};
1668
- for (var n = [], r = this.graphManager.getAllNodes(), i = 0; i < r.length; i++) {
1669
- var a = r[i], s = a.getParent();
1670
- this.getNodeDegreeWithChildren(a) === 0 && (s.id == null || !this.getToBeTiled(s)) && n.push(a);
1671
- }
1672
- for (var i = 0; i < n.length; i++) {
1673
- var a = n[i], c = a.getParent().id;
1674
- t[c] === void 0 && (t[c] = []), t[c] = t[c].concat(a);
1675
- }
1676
- Object.keys(t).forEach(function(n) {
1677
- if (t[n].length > 1) {
1678
- var r = "DummyCompound_" + n;
1679
- e.memberGroups[r] = t[n];
1680
- var i = t[n][0].getParent(), a = new o(e.graphManager);
1681
- 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;
1682
- var s = e.getGraphManager().add(e.newGraph(), a), c = i.getChild();
1683
- c.add(a);
1684
- for (var l = 0; l < t[n].length; l++) {
1685
- var u = t[n][l];
1686
- c.remove(u), s.add(u);
1687
- }
1688
- }
1689
- });
1690
- }, v.prototype.clearCompounds = function() {
1691
- var e = {}, t = {};
1692
- this.performDFSOnCompounds();
1693
- 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;
1694
- this.graphManager.resetAllNodes(), this.tileCompoundMembers(e, t);
1695
- }, v.prototype.clearZeroDegreeMembers = function() {
1696
- var e = this, t = this.tiledZeroDegreePack = [];
1697
- Object.keys(this.memberGroups).forEach(function(n) {
1698
- var r = e.idToDummyNode[n];
1699
- t[n] = e.tileNodes(e.memberGroups[n], r.paddingLeft + r.paddingRight), r.rect.width = t[n].width, r.rect.height = t[n].height;
1700
- });
1701
- }, v.prototype.repopulateCompounds = function() {
1702
- for (var e = this.compoundOrder.length - 1; e >= 0; e--) {
1703
- var t = this.compoundOrder[e], n = t.id, r = t.paddingLeft, i = t.paddingTop;
1704
- this.adjustLocations(this.tiledMemberPack[n], t.rect.x, t.rect.y, r, i);
1705
- }
1706
- }, v.prototype.repopulateZeroDegreeMembers = function() {
1707
- var e = this, t = this.tiledZeroDegreePack;
1708
- Object.keys(t).forEach(function(n) {
1709
- var r = e.idToDummyNode[n], i = r.paddingLeft, a = r.paddingTop;
1710
- e.adjustLocations(t[n], r.rect.x, r.rect.y, i, a);
1711
- });
1712
- }, v.prototype.getToBeTiled = function(e) {
1713
- var t = e.id;
1714
- if (this.toBeTiled[t] != null) return this.toBeTiled[t];
1715
- var n = e.getChild();
1716
- if (n == null) return this.toBeTiled[t] = !1, !1;
1717
- for (var r = n.getNodes(), i = 0; i < r.length; i++) {
1718
- var a = r[i];
1719
- if (this.getNodeDegree(a) > 0) return this.toBeTiled[t] = !1, !1;
1720
- if (a.getChild() == null) {
1721
- this.toBeTiled[a.id] = !1;
1722
- continue;
1723
- }
1724
- if (!this.getToBeTiled(a)) return this.toBeTiled[t] = !1, !1;
1725
- }
1726
- return this.toBeTiled[t] = !0, !0;
1727
- }, v.prototype.getNodeDegree = function(e) {
1728
- e.id;
1729
- for (var t = e.getEdges(), n = 0, r = 0; r < t.length; r++) {
1730
- var i = t[r];
1731
- i.getSource().id !== i.getTarget().id && (n += 1);
1732
- }
1733
- return n;
1734
- }, v.prototype.getNodeDegreeWithChildren = function(e) {
1735
- var t = this.getNodeDegree(e);
1736
- if (e.getChild() == null) return t;
1737
- for (var n = e.getChild().getNodes(), r = 0; r < n.length; r++) {
1738
- var i = n[r];
1739
- t += this.getNodeDegreeWithChildren(i);
1740
- }
1741
- return t;
1742
- }, v.prototype.performDFSOnCompounds = function() {
1743
- this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
1744
- }, v.prototype.fillCompexOrderByDFS = function(e) {
1745
- for (var t = 0; t < e.length; t++) {
1746
- var n = e[t];
1747
- n.getChild() != null && this.fillCompexOrderByDFS(n.getChild().getNodes()), this.getToBeTiled(n) && this.compoundOrder.push(n);
1748
- }
1749
- }, v.prototype.adjustLocations = function(e, t, n, r, i) {
1750
- t += r, n += i;
1751
- for (var a = t, o = 0; o < e.rows.length; o++) {
1752
- var s = e.rows[o];
1753
- t = a;
1754
- for (var c = 0, l = 0; l < s.length; l++) {
1755
- var u = s[l];
1756
- u.rect.x = t, u.rect.y = n, t += u.rect.width + e.horizontalPadding, u.rect.height > c && (c = u.rect.height);
1757
- }
1758
- n += c + e.verticalPadding;
1759
- }
1760
- }, v.prototype.tileCompoundMembers = function(e, t) {
1761
- var n = this;
1762
- this.tiledMemberPack = [], Object.keys(e).forEach(function(r) {
1763
- var i = t[r];
1764
- 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;
1765
- });
1766
- }, v.prototype.tileNodes = function(e, t) {
1767
- var n = {
1768
- rows: [],
1769
- rowWidth: [],
1770
- rowHeight: [],
1771
- width: 0,
1772
- height: t,
1773
- verticalPadding: c.TILING_PADDING_VERTICAL,
1774
- horizontalPadding: c.TILING_PADDING_HORIZONTAL
1775
- };
1776
- e.sort(function(e, t) {
1777
- 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);
1778
- });
1779
- for (var r = 0; r < e.length; r++) {
1780
- var i = e[r];
1781
- 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);
1782
- }
1783
- return n;
1784
- }, v.prototype.insertNodeToRow = function(e, t, n, r) {
1785
- var i = r;
1786
- n == e.rows.length && (e.rows.push([]), e.rowWidth.push(i), e.rowHeight.push(0));
1787
- var a = e.rowWidth[n] + t.rect.width;
1788
- e.rows[n].length > 0 && (a += e.horizontalPadding), e.rowWidth[n] = a, e.width < a && (e.width = a);
1789
- var o = t.rect.height;
1790
- n > 0 && (o += e.verticalPadding);
1791
- var s = 0;
1792
- 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);
1793
- }, v.prototype.getShortestRowIndex = function(e) {
1794
- 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]);
1795
- return t;
1796
- }, v.prototype.getLongestRowIndex = function(e) {
1797
- 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]);
1798
- return t;
1799
- }, v.prototype.canAddHorizontal = function(e, t, n) {
1800
- var r = this.getShortestRowIndex(e);
1801
- if (r < 0) return !0;
1802
- var i = e.rowWidth[r];
1803
- if (i + e.horizontalPadding + t <= e.width) return !0;
1804
- var a = 0;
1805
- e.rowHeight[r] < n && r > 0 && (a = n + e.verticalPadding - e.rowHeight[r]);
1806
- var o = e.width - i >= t + e.horizontalPadding ? (e.height + a) / (i + t + e.horizontalPadding) : (e.height + a) / e.width;
1807
- a = n + e.verticalPadding;
1808
- var s = e.width < t ? (e.height + a) / t : (e.height + a) / e.width;
1809
- return s < 1 && (s = 1 / s), o < 1 && (o = 1 / o), o < s;
1810
- }, v.prototype.shiftToLastRow = function(e) {
1811
- var t = this.getLongestRowIndex(e), n = e.rowWidth.length - 1, r = e.rows[t], i = r[r.length - 1], a = i.width + e.horizontalPadding;
1812
- if (e.width - e.rowWidth[n] > a && t != n) {
1813
- 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)];
1814
- for (var o = Number.MIN_VALUE, s = 0; s < r.length; s++) r[s].height > o && (o = r[s].height);
1815
- t > 0 && (o += e.verticalPadding);
1816
- var c = e.rowHeight[t] + e.rowHeight[n];
1817
- e.rowHeight[t] = o, e.rowHeight[n] < i.height + e.verticalPadding && (e.rowHeight[n] = i.height + e.verticalPadding);
1818
- var l = e.rowHeight[t] + e.rowHeight[n];
1819
- e.height += l - c, this.shiftToLastRow(e);
1820
- }
1821
- }, v.prototype.tilingPreLayout = function() {
1822
- c.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
1823
- }, v.prototype.tilingPostLayout = function() {
1824
- c.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
1825
- }, v.prototype.reduceTrees = function() {
1826
- for (var e = [], t = !0, n; t;) {
1827
- var r = this.graphManager.getAllNodes(), i = [];
1828
- t = !1;
1829
- for (var a = 0; a < r.length; a++) n = r[a], n.getEdges().length == 1 && !n.getEdges()[0].isInterGraph && n.getChild() == null && (i.push([
1830
- n,
1831
- n.getEdges()[0],
1832
- n.getOwner()
1833
- ]), t = !0);
1834
- if (t == 1) {
1835
- 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]));
1836
- e.push(o), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
1837
- }
1838
- }
1839
- this.prunedNodesAll = e;
1840
- }, v.prototype.growTree = function(e) {
1841
- 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);
1842
- e.splice(e.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
1843
- }, v.prototype.findPlaceforPrunedNode = function(e) {
1844
- var t, n, r = e[0];
1845
- n = r == e[1].source ? e[1].target : e[1].source;
1846
- var i = n.startX, a = n.finishX, o = n.startY, s = n.finishY, c = [
1847
- 0,
1848
- 0,
1849
- 0,
1850
- 0
1851
- ];
1852
- if (o > 0) for (var u = i; u <= a; u++) c[0] += this.grid[u][o - 1].length + this.grid[u][o].length - 1;
1853
- if (a < this.grid.length - 1) for (var u = o; u <= s; u++) c[1] += this.grid[a + 1][u].length + this.grid[a][u].length - 1;
1854
- if (s < this.grid[0].length - 1) for (var u = i; u <= a; u++) c[2] += this.grid[u][s + 1].length + this.grid[u][s].length - 1;
1855
- if (i > 0) for (var u = o; u <= s; u++) c[3] += this.grid[i - 1][u].length + this.grid[i][u].length - 1;
1856
- for (var d = m.MAX_VALUE, f, p, h = 0; h < c.length; h++) c[h] < d ? (d = c[h], f = 1, p = h) : c[h] == d && f++;
1857
- 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);
1858
- else if (f == 2 && d == 0) {
1859
- var g = Math.floor(Math.random() * 2);
1860
- 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;
1861
- } else if (f == 4 && d == 0) {
1862
- var g = Math.floor(Math.random() * 4);
1863
- t = g;
1864
- } else t = p;
1865
- t == 0 ? r.setCenter(n.getCenterX(), n.getCenterY() - n.getHeight() / 2 - l.DEFAULT_EDGE_LENGTH - r.getHeight() / 2) : t == 1 ? r.setCenter(n.getCenterX() + n.getWidth() / 2 + l.DEFAULT_EDGE_LENGTH + r.getWidth() / 2, n.getCenterY()) : t == 2 ? r.setCenter(n.getCenterX(), n.getCenterY() + n.getHeight() / 2 + l.DEFAULT_EDGE_LENGTH + r.getHeight() / 2) : r.setCenter(n.getCenterX() - n.getWidth() / 2 - l.DEFAULT_EDGE_LENGTH - r.getWidth() / 2, n.getCenterY());
1866
- }, e.exports = v;
1867
- }),
1868
- (function(e, t, n) {
1869
- var r = {};
1870
- 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;
1871
- })
1872
- ]);
1873
- });
1874
- })), c = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1875
- (function(n, r) {
1876
- 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);
1877
- })(e, function(e) {
1878
- return (function(e) {
1879
- var t = {};
1880
- function n(r) {
1881
- if (t[r]) return t[r].exports;
1882
- var i = t[r] = {
1883
- i: r,
1884
- l: !1,
1885
- exports: {}
1886
- };
1887
- return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
1888
- }
1889
- return n.m = e, n.c = t, n.i = function(e) {
1890
- return e;
1891
- }, n.d = function(e, t, r) {
1892
- n.o(e, t) || Object.defineProperty(e, t, {
1893
- configurable: !1,
1894
- enumerable: !0,
1895
- get: r
1896
- });
1897
- }, n.n = function(e) {
1898
- var t = e && e.__esModule ? function() {
1899
- return e.default;
1900
- } : function() {
1901
- return e;
1902
- };
1903
- return n.d(t, "a", t), t;
1904
- }, n.o = function(e, t) {
1905
- return Object.prototype.hasOwnProperty.call(e, t);
1906
- }, n.p = "", n(n.s = 1);
1907
- })([(function(t, n) {
1908
- t.exports = e;
1909
- }), (function(e, t, n) {
1910
- var r = n(0).layoutBase.LayoutConstants, i = n(0).layoutBase.FDLayoutConstants, a = n(0).CoSEConstants, o = n(0).CoSELayout, s = n(0).CoSENode, c = n(0).layoutBase.PointD, l = n(0).layoutBase.DimensionD, u = {
1911
- ready: function() {},
1912
- stop: function() {},
1913
- quality: "default",
1914
- nodeDimensionsIncludeLabels: !1,
1915
- refresh: 30,
1916
- fit: !0,
1917
- padding: 10,
1918
- randomize: !0,
1919
- nodeRepulsion: 4500,
1920
- idealEdgeLength: 50,
1921
- edgeElasticity: .45,
1922
- nestingFactor: .1,
1923
- gravity: .25,
1924
- numIter: 2500,
1925
- tile: !0,
1926
- animate: "end",
1927
- animationDuration: 500,
1928
- tilingPaddingVertical: 10,
1929
- tilingPaddingHorizontal: 10,
1930
- gravityRangeCompound: 1.5,
1931
- gravityCompound: 1,
1932
- gravityRange: 3.8,
1933
- initialEnergyOnIncremental: .5
1934
- };
1935
- function d(e, t) {
1936
- var n = {};
1937
- for (var r in e) n[r] = e[r];
1938
- for (var r in t) n[r] = t[r];
1939
- return n;
1940
- }
1941
- function f(e) {
1942
- this.options = d(u, e), p(this.options);
1943
- }
1944
- var p = function(e) {
1945
- e.nodeRepulsion != null && (a.DEFAULT_REPULSION_STRENGTH = i.DEFAULT_REPULSION_STRENGTH = e.nodeRepulsion), e.idealEdgeLength != null && (a.DEFAULT_EDGE_LENGTH = i.DEFAULT_EDGE_LENGTH = e.idealEdgeLength), e.edgeElasticity != null && (a.DEFAULT_SPRING_STRENGTH = i.DEFAULT_SPRING_STRENGTH = e.edgeElasticity), e.nestingFactor != null && (a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = e.nestingFactor), e.gravity != null && (a.DEFAULT_GRAVITY_STRENGTH = i.DEFAULT_GRAVITY_STRENGTH = e.gravity), e.numIter != null && (a.MAX_ITERATIONS = i.MAX_ITERATIONS = e.numIter), e.gravityRange != null && (a.DEFAULT_GRAVITY_RANGE_FACTOR = i.DEFAULT_GRAVITY_RANGE_FACTOR = e.gravityRange), e.gravityCompound != null && (a.DEFAULT_COMPOUND_GRAVITY_STRENGTH = i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = e.gravityCompound), e.gravityRangeCompound != null && (a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = e.gravityRangeCompound), e.initialEnergyOnIncremental != null && (a.DEFAULT_COOLING_FACTOR_INCREMENTAL = i.DEFAULT_COOLING_FACTOR_INCREMENTAL = e.initialEnergyOnIncremental), r.QUALITY = e.quality == "draft" ? 0 : e.quality == "proof" ? 2 : 1, a.NODE_DIMENSIONS_INCLUDE_LABELS = i.NODE_DIMENSIONS_INCLUDE_LABELS = r.NODE_DIMENSIONS_INCLUDE_LABELS = e.nodeDimensionsIncludeLabels, a.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = r.DEFAULT_INCREMENTAL = !e.randomize, a.ANIMATE = i.ANIMATE = r.ANIMATE = e.animate, a.TILE = e.tile, a.TILING_PADDING_VERTICAL = typeof e.tilingPaddingVertical == "function" ? e.tilingPaddingVertical.call() : e.tilingPaddingVertical, a.TILING_PADDING_HORIZONTAL = typeof e.tilingPaddingHorizontal == "function" ? e.tilingPaddingHorizontal.call() : e.tilingPaddingHorizontal;
1946
- };
1947
- f.prototype.run = function() {
1948
- var e, t, n = this.options;
1949
- this.idToLNode = {};
1950
- var r = this.layout = new o(), i = this;
1951
- i.stopped = !1, this.cy = this.options.cy, this.cy.trigger({
1952
- type: "layoutstart",
1953
- layout: this
1954
- });
1955
- var a = r.newGraphManager();
1956
- this.gm = a;
1957
- var s = this.options.eles.nodes(), c = this.options.eles.edges();
1958
- this.root = a.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(s), r);
1959
- for (var l = 0; l < c.length; l++) {
1960
- var u = c[l], d = this.idToLNode[u.data("source")], f = this.idToLNode[u.data("target")];
1961
- if (d !== f && d.getEdgesBetween(f).length == 0) {
1962
- var p = a.add(r.newEdge(), d, f);
1963
- p.id = u.id();
1964
- }
1965
- }
1966
- var m = function(e, t) {
1967
- typeof e == "number" && (e = t);
1968
- var n = e.data("id"), r = i.idToLNode[n];
1969
- return {
1970
- x: r.getRect().getCenterX(),
1971
- y: r.getRect().getCenterY()
1972
- };
1973
- }, h = function a() {
1974
- for (var o = function() {
1975
- n.fit && n.cy.fit(n.eles, n.padding), e || (e = !0, i.cy.one("layoutready", n.ready), i.cy.trigger({
1976
- type: "layoutready",
1977
- layout: i
1978
- }));
1979
- }, s = i.options.refresh, c, l = 0; l < s && !c; l++) c = i.stopped || i.layout.tick();
1980
- if (c) {
1981
- r.checkLayoutSuccess() && !r.isSubLayout && r.doPostLayout(), r.tilingPostLayout && r.tilingPostLayout(), r.isLayoutFinished = !0, i.options.eles.nodes().positions(m), o(), i.cy.one("layoutstop", i.options.stop), i.cy.trigger({
1982
- type: "layoutstop",
1983
- layout: i
1984
- }), t && cancelAnimationFrame(t), e = !1;
1985
- return;
1986
- }
1987
- var u = i.layout.getPositionsData();
1988
- n.eles.nodes().positions(function(e, t) {
1989
- if (typeof e == "number" && (e = t), !e.isParent()) {
1990
- for (var n = e.id(), r = u[n], i = e; r == null && (r = u[i.data("parent")] || u["DummyCompound_" + i.data("parent")], u[n] = r, i = i.parent()[0], i != null););
1991
- return r == null ? {
1992
- x: e.position("x"),
1993
- y: e.position("y")
1994
- } : {
1995
- x: r.x,
1996
- y: r.y
1997
- };
1998
- }
1999
- }), o(), t = requestAnimationFrame(a);
2000
- };
2001
- return r.addListener("layoutstarted", function() {
2002
- i.options.animate === "during" && (t = requestAnimationFrame(h));
2003
- }), r.runLayout(), this.options.animate !== "during" && (i.options.eles.nodes().not(":parent").layoutPositions(i, i.options, m), e = !1), this;
2004
- }, f.prototype.getTopMostNodes = function(e) {
2005
- for (var t = {}, n = 0; n < e.length; n++) t[e[n].id()] = !0;
2006
- return e.filter(function(e, n) {
2007
- typeof e == "number" && (e = n);
2008
- for (var r = e.parent()[0]; r != null;) {
2009
- if (t[r.id()]) return !1;
2010
- r = r.parent()[0];
2011
- }
2012
- return !0;
2013
- });
2014
- }, f.prototype.processChildrenList = function(e, t, n) {
2015
- for (var r = t.length, i = 0; i < r; i++) {
2016
- var a = t[i], o = a.children(), u, d = a.layoutDimensions({ nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels });
2017
- if (u = a.outerWidth() != null && a.outerHeight() != null ? e.add(new s(n.graphManager, new c(a.position("x") - d.w / 2, a.position("y") - d.h / 2), new l(parseFloat(d.w), parseFloat(d.h)))) : e.add(new s(this.graphManager)), u.id = a.data("id"), u.paddingLeft = parseInt(a.css("padding")), u.paddingTop = parseInt(a.css("padding")), u.paddingRight = parseInt(a.css("padding")), u.paddingBottom = parseInt(a.css("padding")), this.options.nodeDimensionsIncludeLabels && a.isParent()) {
2018
- var f = a.boundingBox({
2019
- includeLabels: !0,
2020
- includeNodes: !1
2021
- }).w, p = a.boundingBox({
2022
- includeLabels: !0,
2023
- includeNodes: !1
2024
- }).h, m = a.css("text-halign");
2025
- u.labelWidth = f, u.labelHeight = p, u.labelPos = m;
2026
- }
2027
- if (this.idToLNode[a.data("id")] = u, isNaN(u.rect.x) && (u.rect.x = 0), isNaN(u.rect.y) && (u.rect.y = 0), o != null && o.length > 0) {
2028
- var h = n.getGraphManager().add(n.newGraph(), u);
2029
- this.processChildrenList(h, o, n);
2030
- }
2031
- }
2032
- }, f.prototype.stop = function() {
2033
- return this.stopped = !0, this;
2034
- };
2035
- var m = function(e) {
2036
- e("layout", "cose-bilkent", f);
2037
- };
2038
- typeof cytoscape < "u" && m(cytoscape), e.exports = m;
2039
- })]);
2040
- });
2041
- })))(), 1);
2042
- a.use(c.default);
2043
- function l(e, t) {
2044
- e.forEach((e) => {
2045
- let n = {
2046
- id: e.id,
2047
- labelText: e.label,
2048
- height: e.height,
2049
- width: e.width,
2050
- padding: e.padding ?? 0
2051
- };
2052
- Object.keys(e).forEach((t) => {
2053
- [
2054
- "id",
2055
- "label",
2056
- "height",
2057
- "width",
2058
- "padding",
2059
- "x",
2060
- "y"
2061
- ].includes(t) || (n[t] = e[t]);
2062
- }), t.add({
2063
- group: "nodes",
2064
- data: n,
2065
- position: {
2066
- x: e.x ?? 0,
2067
- y: e.y ?? 0
2068
- }
2069
- });
2070
- });
2071
- }
2072
- n(l, "addNodes");
2073
- function u(e, t) {
2074
- e.forEach((e) => {
2075
- let n = {
2076
- id: e.id,
2077
- source: e.start,
2078
- target: e.end
2079
- };
2080
- Object.keys(e).forEach((t) => {
2081
- [
2082
- "id",
2083
- "start",
2084
- "end"
2085
- ].includes(t) || (n[t] = e[t]);
2086
- }), t.add({
2087
- group: "edges",
2088
- data: n
2089
- });
2090
- });
2091
- }
2092
- n(u, "addEdges");
2093
- function d(e) {
2094
- return new Promise((t) => {
2095
- let n = i("body").append("div").attr("id", "cy").attr("style", "display:none"), o = a({
2096
- container: document.getElementById("cy"),
2097
- style: [{
2098
- selector: "edge",
2099
- style: { "curve-style": "bezier" }
2100
- }]
2101
- });
2102
- n.remove(), l(e.nodes, o), u(e.edges, o), o.nodes().forEach(function(e) {
2103
- e.layoutDimensions = () => {
2104
- let t = e.data();
2105
- return {
2106
- w: t.width,
2107
- h: t.height
2108
- };
2109
- };
2110
- }), o.layout({
2111
- name: "cose-bilkent",
2112
- quality: "proof",
2113
- styleEnabled: !1,
2114
- animate: !1
2115
- }).run(), o.ready((e) => {
2116
- r.info("Cytoscape ready", e), t(o);
2117
- });
2118
- });
2119
- }
2120
- n(d, "createCytoscapeInstance");
2121
- function f(e) {
2122
- return e.nodes().map((e) => {
2123
- let t = e.data(), n = e.position(), r = {
2124
- id: t.id,
2125
- x: n.x,
2126
- y: n.y
2127
- };
2128
- return Object.keys(t).forEach((e) => {
2129
- e !== "id" && (r[e] = t[e]);
2130
- }), r;
2131
- });
2132
- }
2133
- n(f, "extractPositionedNodes");
2134
- function p(e) {
2135
- return e.edges().map((e) => {
2136
- let t = e.data(), n = e._private.rscratch, r = {
2137
- id: t.id,
2138
- source: t.source,
2139
- target: t.target,
2140
- startX: n.startX,
2141
- startY: n.startY,
2142
- midX: n.midX,
2143
- midY: n.midY,
2144
- endX: n.endX,
2145
- endY: n.endY
2146
- };
2147
- return Object.keys(t).forEach((e) => {
2148
- [
2149
- "id",
2150
- "source",
2151
- "target"
2152
- ].includes(e) || (r[e] = t[e]);
2153
- }), r;
2154
- });
2155
- }
2156
- n(p, "extractPositionedEdges");
2157
- async function m(e, t) {
2158
- r.debug("Starting cose-bilkent layout algorithm");
2159
- try {
2160
- h(e);
2161
- let t = await d(e), n = f(t), i = p(t);
2162
- return r.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`), {
2163
- nodes: n,
2164
- edges: i
2165
- };
2166
- } catch (e) {
2167
- throw r.error("Error in cose-bilkent layout algorithm:", e), e;
2168
- }
2169
- }
2170
- n(m, "executeCoseBilkentLayout");
2171
- function h(e) {
2172
- if (!e) throw Error("Layout data is required");
2173
- if (!e.config) throw Error("Configuration is required in layout data");
2174
- if (!e.rootNode) throw Error("Root node is required");
2175
- if (!e.nodes || !Array.isArray(e.nodes)) throw Error("No nodes found in layout data");
2176
- if (!Array.isArray(e.edges)) throw Error("Edges array is required in layout data");
2177
- return !0;
2178
- }
2179
- n(h, "validateLayoutData");
2180
- var g = /* @__PURE__ */ n(async (e, t, { insertCluster: n, insertEdge: r, insertEdgeLabel: i, insertMarkers: a, insertNode: o, log: s, positionEdgeLabel: c }, { algorithm: l }) => {
2181
- let u = {}, d = {}, f = t.select("g");
2182
- a(f, e.markers, e.type, e.diagramId);
2183
- 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");
2184
- s.debug("Inserting nodes into DOM for dimension calculation"), await Promise.all(e.nodes.map(async (t) => {
2185
- if (t.isGroup) {
2186
- let e = { ...t };
2187
- d[t.id] = e, u[t.id] = e, await n(p, t);
2188
- } else {
2189
- let n = { ...t };
2190
- u[t.id] = n;
2191
- let r = await o(_, t, {
2192
- config: e.config,
2193
- dir: e.direction || "TB"
2194
- }), i = r.node().getBBox();
2195
- n.width = i.width, n.height = i.height, n.domId = r, s.debug(`Node ${t.id} dimensions: ${i.width}x${i.height}`);
2196
- }
2197
- })), s.debug("Running cose-bilkent layout algorithm");
2198
- let v = await m({
2199
- ...e,
2200
- nodes: e.nodes.map((e) => {
2201
- let t = u[e.id];
2202
- return {
2203
- ...e,
2204
- width: t.width,
2205
- height: t.height
2206
- };
2207
- })
2208
- }, e.config);
2209
- s.debug("Positioning nodes based on layout results"), v.nodes.forEach((e) => {
2210
- let t = u[e.id];
2211
- 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})`));
2212
- }), v.edges.forEach((t) => {
2213
- let n = e.edges.find((e) => e.id === t.id);
2214
- n && (n.points = [
2215
- {
2216
- x: t.startX,
2217
- y: t.startY
2218
- },
2219
- {
2220
- x: t.midX,
2221
- y: t.midY
2222
- },
2223
- {
2224
- x: t.endX,
2225
- y: t.endY
2226
- }
2227
- ]);
2228
- }), s.debug("Inserting and positioning edges"), await Promise.all(e.edges.map(async (t) => {
2229
- await i(g, t);
2230
- let n = u[t.start ?? ""], a = u[t.end ?? ""];
2231
- if (n && a) {
2232
- let i = v.edges.find((e) => e.id === t.id);
2233
- if (i) {
2234
- s.debug("APA01 positionedEdge", i);
2235
- let o = { ...t };
2236
- c(o, r(h, o, d, e.type, n, a, e.diagramId));
2237
- } else {
2238
- let i = {
2239
- ...t,
2240
- points: [{
2241
- x: n.x || 0,
2242
- y: n.y || 0
2243
- }, {
2244
- x: a.x || 0,
2245
- y: a.y || 0
2246
- }]
2247
- };
2248
- c(i, r(h, i, d, e.type, n, a, e.diagramId));
2249
- }
2250
- }
2251
- })), s.debug("Cose-bilkent rendering completed");
2252
- }, "render");
2253
- //#endregion
2254
- export { g as render };