@blueking/ai-blueking 2.0.0-dev.1 → 2.0.0-dev.3

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