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