@marimo-team/islands 0.12.1-dev7 → 0.12.1

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