@schmitech/chatbot-widget 0.5.3 → 0.6.0

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 (64) hide show
  1. package/dist/_basePickBy-C3-QE0dl-5eQ6L29l.js +152 -0
  2. package/dist/_baseUniq-CstiM9Lp-AFR_Ns0a.js +615 -0
  3. package/dist/arc-W3NKKXLI-DHbDwLx0.js +84 -0
  4. package/dist/architecture-U656AL7Q-fn9wJZsH-BLoGjtkP.js +6 -0
  5. package/dist/architectureDiagram-VXUJARFQ-zzJsgPC6-C4OfUE0m.js +4667 -0
  6. package/dist/blockDiagram-VD42YOAC-D-In4h7h-BYXdRmeG.js +2266 -0
  7. package/dist/c4Diagram-YG6GDRKO-DBs8r9gh-BdLuHgPT.js +1582 -0
  8. package/dist/channel-RBWQyMSg-Cx0HUumY.js +6 -0
  9. package/dist/chatbot-widget.bundle.js +4473 -1556
  10. package/dist/chatbot-widget.css +1 -1
  11. package/dist/chatbot-widget.es.js +12 -63659
  12. package/dist/chatbot-widget.umd.js +4472 -1555
  13. package/dist/chunk-4BX2VUAB-BqD7w0AR-CbA2613c.js +10 -0
  14. package/dist/chunk-55IACEB6-D8pvDVEJ-DrL4SJSR.js +9 -0
  15. package/dist/chunk-B4BG7PRW-Dwma1pSy-BWjG5dc6.js +1375 -0
  16. package/dist/chunk-DI55MBZ5-BY2XXvZz-DbAvz3Pq.js +1383 -0
  17. package/dist/chunk-FMBD7UC4-BeiLbQ8U-BNaZTCv4.js +20 -0
  18. package/dist/chunk-QN33PNHL-BkO3hOeq-DkU1EzGA.js +21 -0
  19. package/dist/chunk-QZHKN3VN-Cwlo2qTG-DMmeZmp5.js +16 -0
  20. package/dist/chunk-TZMSLE5B-BnXK-OiF-RfzVsOBe.js +65 -0
  21. package/dist/classDiagram-2ON5EDUG-Crd6O69V-kCZrFOLN.js +17 -0
  22. package/dist/classDiagram-v2-WZHVMYZB-Crd6O69V-kCZrFOLN.js +17 -0
  23. package/dist/clone-CfLgyC8S-DsDOh4B4.js +9 -0
  24. package/dist/config/index.d.ts +4 -2
  25. package/dist/cose-bilkent-S5V4N54A-DKeVcPDK-de_7nZTY.js +2609 -0
  26. package/dist/cytoscape.esm-CjI2IsL8-Be2K4mI6.js +18723 -0
  27. package/dist/dagre-6UL2VRFP-BPf604Df-BhZs6zCq.js +448 -0
  28. package/dist/diagram-PSM6KHXK-DeLcpEV3-qb4rujeN.js +532 -0
  29. package/dist/diagram-QEK2KX5R-C_5RR1NJ-C5kZWmRl.js +222 -0
  30. package/dist/diagram-S2PKOQOG-DVx43aon-4nlw6iDz.js +144 -0
  31. package/dist/erDiagram-Q2GNP2WA-DgUeO5_h-DHc9Yphl.js +841 -0
  32. package/dist/flowDiagram-NV44I4VS-C5HQUzU9-DHjbmAtJ.js +1628 -0
  33. package/dist/ganttDiagram-JELNMOA3-DgSZ1ixF-C3hJs_k9.js +1936 -0
  34. package/dist/gitGraph-F6HP7TQM-UL7-Bx1s-Cog5rj3j.js +6 -0
  35. package/dist/gitGraphDiagram-NY62KEGX-DY5loT9K-CEcKQNrM.js +713 -0
  36. package/dist/graph-BfwqPHx6-DErF9dBN.js +248 -0
  37. package/dist/index-B5s_uaP2.js +124168 -0
  38. package/dist/index-BAOVR-xx-thst7Pu6.js +13251 -0
  39. package/dist/info-NVLQJR56-BsqQ0RXQ-BcYgZCCY.js +6 -0
  40. package/dist/infoDiagram-WHAUD3N6-DIqQ6vCk-BuiAAMSH.js +25 -0
  41. package/dist/journeyDiagram-XKPGCS4Q-DXjg3S3r-Byi_TGXs.js +835 -0
  42. package/dist/kanban-definition-3W4ZIXB7-Uxt7Am6n-jy96nA-g.js +721 -0
  43. package/dist/layout-CSfkE668-BjigbqJL.js +1333 -0
  44. package/dist/mermaid-parser.core-LjuO4CL3-BLqmPe8-.js +12891 -0
  45. package/dist/mindmap-definition-VGOIOE7T-DXwVuAPE-SK4e1Sse.js +787 -0
  46. package/dist/packet-BFZMPI3H-DJWkrKrV-BamBev9S.js +6 -0
  47. package/dist/pie-7BOR55EZ-DC8hTFwn-D1bcIQbR.js +6 -0
  48. package/dist/pieDiagram-ADFJNKIX-Cj0EHHtj-Dbr09c-S.js +161 -0
  49. package/dist/quadrantDiagram-AYHSOK5B-CnLDz007-Ci0DQl2T.js +1024 -0
  50. package/dist/radar-NHE76QYJ-Bijk-Fk9-9nAmDCMr.js +6 -0
  51. package/dist/requirementDiagram-UZGBJVZJ-rDaI-8Be-CSEc4S33.js +851 -0
  52. package/dist/sankeyDiagram-TZEHDZUN-A0YO8ixs-Zj8Z0j0n.js +810 -0
  53. package/dist/sequenceDiagram-WL72ISMW-BFF7TtP7-Dcofckjv.js +2519 -0
  54. package/dist/shared/styles.d.ts +1 -1
  55. package/dist/stateDiagram-FKZM4ZOC-ofFsB7HJ-BJBX12rE.js +264 -0
  56. package/dist/stateDiagram-v2-4FDKWEC3-CEZFbksU-BywmU88h.js +17 -0
  57. package/dist/timeline-definition-IT6M3QCI-5W361ZNm-MP_ufVe7.js +800 -0
  58. package/dist/treemap-KMMF4GRG-pGRoYcSn-BeZ7sXgP.js +6 -0
  59. package/dist/ui/Message.d.ts +1 -5
  60. package/dist/ui/MessagesList.d.ts +1 -5
  61. package/dist/utils/contentFiltering.d.ts +12 -0
  62. package/dist/xychartDiagram-PRI3JC2R-CSr0GxaP-DBgCtplP.js +1297 -0
  63. package/package.json +3 -3
  64. package/dist/ui/TypingEffect.d.ts +0 -18
@@ -0,0 +1,2609 @@
1
+ import { x as W, a as j, f as lt, D as gt } from "./index-B5s_uaP2.js";
2
+ import { e as tt } from "./cytoscape.esm-CjI2IsL8-Be2K4mI6.js";
3
+ typeof window < "u" && (window.global = window);
4
+ var V = { exports: {} }, z = { exports: {} }, q = { exports: {} }, ut = q.exports, $;
5
+ function ct() {
6
+ return $ || ($ = 1, function(x, X) {
7
+ (function(m, I) {
8
+ x.exports = I();
9
+ })(ut, function() {
10
+ return (
11
+ /******/
12
+ function(m) {
13
+ var I = {};
14
+ function T(n) {
15
+ if (I[n])
16
+ return I[n].exports;
17
+ var e = I[n] = {
18
+ /******/
19
+ i: n,
20
+ /******/
21
+ l: !1,
22
+ /******/
23
+ exports: {}
24
+ /******/
25
+ };
26
+ return m[n].call(e.exports, e, e.exports, T), e.l = !0, e.exports;
27
+ }
28
+ return T.m = m, T.c = I, T.i = function(n) {
29
+ return n;
30
+ }, T.d = function(n, e, t) {
31
+ T.o(n, e) || Object.defineProperty(n, e, {
32
+ /******/
33
+ configurable: !1,
34
+ /******/
35
+ enumerable: !0,
36
+ /******/
37
+ get: t
38
+ /******/
39
+ });
40
+ }, T.n = function(n) {
41
+ var e = n && n.__esModule ? (
42
+ /******/
43
+ function() {
44
+ return n.default;
45
+ }
46
+ ) : (
47
+ /******/
48
+ function() {
49
+ return n;
50
+ }
51
+ );
52
+ return T.d(e, "a", e), e;
53
+ }, T.o = function(n, e) {
54
+ return Object.prototype.hasOwnProperty.call(n, e);
55
+ }, T.p = "", T(T.s = 26);
56
+ }([
57
+ /* 0 */
58
+ /***/
59
+ function(m, I, T) {
60
+ function n() {
61
+ }
62
+ n.QUALITY = 1, n.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, n.DEFAULT_INCREMENTAL = !1, n.DEFAULT_ANIMATION_ON_LAYOUT = !0, n.DEFAULT_ANIMATION_DURING_LAYOUT = !1, n.DEFAULT_ANIMATION_PERIOD = 50, n.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, n.DEFAULT_GRAPH_MARGIN = 15, n.NODE_DIMENSIONS_INCLUDE_LABELS = !1, n.SIMPLE_NODE_SIZE = 40, n.SIMPLE_NODE_HALF_SIZE = n.SIMPLE_NODE_SIZE / 2, n.EMPTY_COMPOUND_NODE_SIZE = 40, n.MIN_EDGE_LENGTH = 1, n.WORLD_BOUNDARY = 1e6, n.INITIAL_WORLD_BOUNDARY = n.WORLD_BOUNDARY / 1e3, n.WORLD_CENTER_X = 1200, n.WORLD_CENTER_Y = 900, m.exports = n;
63
+ },
64
+ /* 1 */
65
+ /***/
66
+ function(m, I, T) {
67
+ var n = T(2), e = T(8), t = T(9);
68
+ function r(a, o, p) {
69
+ n.call(this, p), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = p, this.bendpoints = [], this.source = a, this.target = o;
70
+ }
71
+ r.prototype = Object.create(n.prototype);
72
+ for (var h in n)
73
+ r[h] = n[h];
74
+ r.prototype.getSource = function() {
75
+ return this.source;
76
+ }, r.prototype.getTarget = function() {
77
+ return this.target;
78
+ }, r.prototype.isInterGraph = function() {
79
+ return this.isInterGraph;
80
+ }, r.prototype.getLength = function() {
81
+ return this.length;
82
+ }, r.prototype.isOverlapingSourceAndTarget = function() {
83
+ return this.isOverlapingSourceAndTarget;
84
+ }, r.prototype.getBendpoints = function() {
85
+ return this.bendpoints;
86
+ }, r.prototype.getLca = function() {
87
+ return this.lca;
88
+ }, r.prototype.getSourceInLca = function() {
89
+ return this.sourceInLca;
90
+ }, r.prototype.getTargetInLca = function() {
91
+ return this.targetInLca;
92
+ }, r.prototype.getOtherEnd = function(a) {
93
+ if (this.source === a)
94
+ return this.target;
95
+ if (this.target === a)
96
+ return this.source;
97
+ throw "Node is not incident with this edge";
98
+ }, r.prototype.getOtherEndInGraph = function(a, o) {
99
+ for (var p = this.getOtherEnd(a), i = o.getGraphManager().getRoot(); ; ) {
100
+ if (p.getOwner() == o)
101
+ return p;
102
+ if (p.getOwner() == i)
103
+ break;
104
+ p = p.getOwner().getParent();
105
+ }
106
+ return null;
107
+ }, r.prototype.updateLength = function() {
108
+ var a = new Array(4);
109
+ this.isOverlapingSourceAndTarget = e.getIntersection(this.target.getRect(), this.source.getRect(), a), this.isOverlapingSourceAndTarget || (this.lengthX = a[0] - a[2], this.lengthY = a[1] - a[3], Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
110
+ }, r.prototype.updateLengthSimple = function() {
111
+ this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
112
+ }, m.exports = r;
113
+ },
114
+ /* 2 */
115
+ /***/
116
+ function(m, I, T) {
117
+ function n(e) {
118
+ this.vGraphObject = e;
119
+ }
120
+ m.exports = n;
121
+ },
122
+ /* 3 */
123
+ /***/
124
+ function(m, I, T) {
125
+ var n = T(2), e = T(10), t = T(13), r = T(0), h = T(16), a = T(4);
126
+ function o(i, g, l, f) {
127
+ l == null && f == null && (f = g), n.call(this, f), i.graphManager != null && (i = i.graphManager), this.estimatedSize = e.MIN_VALUE, this.inclusionTreeDepth = e.MAX_VALUE, this.vGraphObject = f, this.edges = [], this.graphManager = i, l != null && g != null ? this.rect = new t(g.x, g.y, l.width, l.height) : this.rect = new t();
128
+ }
129
+ o.prototype = Object.create(n.prototype);
130
+ for (var p in n)
131
+ o[p] = n[p];
132
+ o.prototype.getEdges = function() {
133
+ return this.edges;
134
+ }, o.prototype.getChild = function() {
135
+ return this.child;
136
+ }, o.prototype.getOwner = function() {
137
+ return this.owner;
138
+ }, o.prototype.getWidth = function() {
139
+ return this.rect.width;
140
+ }, o.prototype.setWidth = function(i) {
141
+ this.rect.width = i;
142
+ }, o.prototype.getHeight = function() {
143
+ return this.rect.height;
144
+ }, o.prototype.setHeight = function(i) {
145
+ this.rect.height = i;
146
+ }, o.prototype.getCenterX = function() {
147
+ return this.rect.x + this.rect.width / 2;
148
+ }, o.prototype.getCenterY = function() {
149
+ return this.rect.y + this.rect.height / 2;
150
+ }, o.prototype.getCenter = function() {
151
+ return new a(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
152
+ }, o.prototype.getLocation = function() {
153
+ return new a(this.rect.x, this.rect.y);
154
+ }, o.prototype.getRect = function() {
155
+ return this.rect;
156
+ }, o.prototype.getDiagonal = function() {
157
+ return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
158
+ }, o.prototype.getHalfTheDiagonal = function() {
159
+ return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
160
+ }, o.prototype.setRect = function(i, g) {
161
+ this.rect.x = i.x, this.rect.y = i.y, this.rect.width = g.width, this.rect.height = g.height;
162
+ }, o.prototype.setCenter = function(i, g) {
163
+ this.rect.x = i - this.rect.width / 2, this.rect.y = g - this.rect.height / 2;
164
+ }, o.prototype.setLocation = function(i, g) {
165
+ this.rect.x = i, this.rect.y = g;
166
+ }, o.prototype.moveBy = function(i, g) {
167
+ this.rect.x += i, this.rect.y += g;
168
+ }, o.prototype.getEdgeListToNode = function(i) {
169
+ var g = [], l = this;
170
+ return l.edges.forEach(function(f) {
171
+ if (f.target == i) {
172
+ if (f.source != l) throw "Incorrect edge source!";
173
+ g.push(f);
174
+ }
175
+ }), g;
176
+ }, o.prototype.getEdgesBetween = function(i) {
177
+ var g = [], l = this;
178
+ return l.edges.forEach(function(f) {
179
+ if (!(f.source == l || f.target == l)) throw "Incorrect edge source and/or target";
180
+ (f.target == i || f.source == i) && g.push(f);
181
+ }), g;
182
+ }, o.prototype.getNeighborsList = function() {
183
+ var i = /* @__PURE__ */ new Set(), g = this;
184
+ return g.edges.forEach(function(l) {
185
+ if (l.source == g)
186
+ i.add(l.target);
187
+ else {
188
+ if (l.target != g)
189
+ throw "Incorrect incidency!";
190
+ i.add(l.source);
191
+ }
192
+ }), i;
193
+ }, o.prototype.withChildren = function() {
194
+ var i = /* @__PURE__ */ new Set(), g, l;
195
+ if (i.add(this), this.child != null)
196
+ for (var f = this.child.getNodes(), E = 0; E < f.length; E++)
197
+ g = f[E], l = g.withChildren(), l.forEach(function(y) {
198
+ i.add(y);
199
+ });
200
+ return i;
201
+ }, o.prototype.getNoOfChildren = function() {
202
+ var i = 0, g;
203
+ if (this.child == null)
204
+ i = 1;
205
+ else
206
+ for (var l = this.child.getNodes(), f = 0; f < l.length; f++)
207
+ g = l[f], i += g.getNoOfChildren();
208
+ return i == 0 && (i = 1), i;
209
+ }, o.prototype.getEstimatedSize = function() {
210
+ if (this.estimatedSize == e.MIN_VALUE)
211
+ throw "assert failed";
212
+ return this.estimatedSize;
213
+ }, o.prototype.calcEstimatedSize = function() {
214
+ 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);
215
+ }, o.prototype.scatter = function() {
216
+ var i, g, l = -r.INITIAL_WORLD_BOUNDARY, f = r.INITIAL_WORLD_BOUNDARY;
217
+ i = r.WORLD_CENTER_X + h.nextDouble() * (f - l) + l;
218
+ var E = -r.INITIAL_WORLD_BOUNDARY, y = r.INITIAL_WORLD_BOUNDARY;
219
+ g = r.WORLD_CENTER_Y + h.nextDouble() * (y - E) + E, this.rect.x = i, this.rect.y = g;
220
+ }, o.prototype.updateBounds = function() {
221
+ if (this.getChild() == null)
222
+ throw "assert failed";
223
+ if (this.getChild().getNodes().length != 0) {
224
+ var i = this.getChild();
225
+ if (i.updateBounds(!0), this.rect.x = i.getLeft(), this.rect.y = i.getTop(), this.setWidth(i.getRight() - i.getLeft()), this.setHeight(i.getBottom() - i.getTop()), r.NODE_DIMENSIONS_INCLUDE_LABELS) {
226
+ var g = i.getRight() - i.getLeft(), l = i.getBottom() - i.getTop();
227
+ this.labelWidth > g && (this.rect.x -= (this.labelWidth - g) / 2, this.setWidth(this.labelWidth)), this.labelHeight > l && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - l) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - l), this.setHeight(this.labelHeight));
228
+ }
229
+ }
230
+ }, o.prototype.getInclusionTreeDepth = function() {
231
+ if (this.inclusionTreeDepth == e.MAX_VALUE)
232
+ throw "assert failed";
233
+ return this.inclusionTreeDepth;
234
+ }, o.prototype.transform = function(i) {
235
+ var g = this.rect.x;
236
+ g > r.WORLD_BOUNDARY ? g = r.WORLD_BOUNDARY : g < -r.WORLD_BOUNDARY && (g = -r.WORLD_BOUNDARY);
237
+ var l = this.rect.y;
238
+ l > r.WORLD_BOUNDARY ? l = r.WORLD_BOUNDARY : l < -r.WORLD_BOUNDARY && (l = -r.WORLD_BOUNDARY);
239
+ var f = new a(g, l), E = i.inverseTransformPoint(f);
240
+ this.setLocation(E.x, E.y);
241
+ }, o.prototype.getLeft = function() {
242
+ return this.rect.x;
243
+ }, o.prototype.getRight = function() {
244
+ return this.rect.x + this.rect.width;
245
+ }, o.prototype.getTop = function() {
246
+ return this.rect.y;
247
+ }, o.prototype.getBottom = function() {
248
+ return this.rect.y + this.rect.height;
249
+ }, o.prototype.getParent = function() {
250
+ return this.owner == null ? null : this.owner.getParent();
251
+ }, m.exports = o;
252
+ },
253
+ /* 4 */
254
+ /***/
255
+ function(m, I, T) {
256
+ function n(e, t) {
257
+ e == null && t == null ? (this.x = 0, this.y = 0) : (this.x = e, this.y = t);
258
+ }
259
+ n.prototype.getX = function() {
260
+ return this.x;
261
+ }, n.prototype.getY = function() {
262
+ return this.y;
263
+ }, n.prototype.setX = function(e) {
264
+ this.x = e;
265
+ }, n.prototype.setY = function(e) {
266
+ this.y = e;
267
+ }, n.prototype.getDifference = function(e) {
268
+ return new DimensionD(this.x - e.x, this.y - e.y);
269
+ }, n.prototype.getCopy = function() {
270
+ return new n(this.x, this.y);
271
+ }, n.prototype.translate = function(e) {
272
+ return this.x += e.width, this.y += e.height, this;
273
+ }, m.exports = n;
274
+ },
275
+ /* 5 */
276
+ /***/
277
+ function(m, I, T) {
278
+ var n = T(2), e = T(10), t = T(0), r = T(6), h = T(3), a = T(1), o = T(13), p = T(12), i = T(11);
279
+ function g(f, E, y) {
280
+ n.call(this, y), this.estimatedSize = e.MIN_VALUE, this.margin = t.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = f, E != null && E instanceof r ? this.graphManager = E : E != null && E instanceof Layout && (this.graphManager = E.graphManager);
281
+ }
282
+ g.prototype = Object.create(n.prototype);
283
+ for (var l in n)
284
+ g[l] = n[l];
285
+ g.prototype.getNodes = function() {
286
+ return this.nodes;
287
+ }, g.prototype.getEdges = function() {
288
+ return this.edges;
289
+ }, g.prototype.getGraphManager = function() {
290
+ return this.graphManager;
291
+ }, g.prototype.getParent = function() {
292
+ return this.parent;
293
+ }, g.prototype.getLeft = function() {
294
+ return this.left;
295
+ }, g.prototype.getRight = function() {
296
+ return this.right;
297
+ }, g.prototype.getTop = function() {
298
+ return this.top;
299
+ }, g.prototype.getBottom = function() {
300
+ return this.bottom;
301
+ }, g.prototype.isConnected = function() {
302
+ return this.isConnected;
303
+ }, g.prototype.add = function(f, E, y) {
304
+ if (E == null && y == null) {
305
+ var d = f;
306
+ if (this.graphManager == null)
307
+ throw "Graph has no graph mgr!";
308
+ if (this.getNodes().indexOf(d) > -1)
309
+ throw "Node already in graph!";
310
+ return d.owner = this, this.getNodes().push(d), d;
311
+ } else {
312
+ var N = f;
313
+ if (!(this.getNodes().indexOf(E) > -1 && this.getNodes().indexOf(y) > -1))
314
+ throw "Source or target not in graph!";
315
+ if (!(E.owner == y.owner && E.owner == this))
316
+ throw "Both owners must be this graph!";
317
+ return E.owner != y.owner ? null : (N.source = E, N.target = y, N.isInterGraph = !1, this.getEdges().push(N), E.edges.push(N), y != E && y.edges.push(N), N);
318
+ }
319
+ }, g.prototype.remove = function(f) {
320
+ var E = f;
321
+ if (f instanceof h) {
322
+ if (E == null)
323
+ throw "Node is null!";
324
+ if (!(E.owner != null && E.owner == this))
325
+ throw "Owner graph is invalid!";
326
+ if (this.graphManager == null)
327
+ throw "Owner graph manager is invalid!";
328
+ for (var y = E.edges.slice(), d, N = y.length, v = 0; v < N; v++)
329
+ d = y[v], d.isInterGraph ? this.graphManager.remove(d) : d.source.owner.remove(d);
330
+ var L = this.nodes.indexOf(E);
331
+ if (L == -1)
332
+ throw "Node not in owner node list!";
333
+ this.nodes.splice(L, 1);
334
+ } else if (f instanceof a) {
335
+ var d = f;
336
+ if (d == null)
337
+ throw "Edge is null!";
338
+ if (!(d.source != null && d.target != null))
339
+ throw "Source and/or target is null!";
340
+ if (!(d.source.owner != null && d.target.owner != null && d.source.owner == this && d.target.owner == this))
341
+ throw "Source and/or target owner is invalid!";
342
+ var s = d.source.edges.indexOf(d), u = d.target.edges.indexOf(d);
343
+ if (!(s > -1 && u > -1))
344
+ throw "Source and/or target doesn't know this edge!";
345
+ d.source.edges.splice(s, 1), d.target != d.source && d.target.edges.splice(u, 1);
346
+ var L = d.source.owner.getEdges().indexOf(d);
347
+ if (L == -1)
348
+ throw "Not in owner's edge list!";
349
+ d.source.owner.getEdges().splice(L, 1);
350
+ }
351
+ }, g.prototype.updateLeftTop = function() {
352
+ for (var f = e.MAX_VALUE, E = e.MAX_VALUE, y, d, N, v = this.getNodes(), L = v.length, s = 0; s < L; s++) {
353
+ var u = v[s];
354
+ y = u.getTop(), d = u.getLeft(), f > y && (f = y), E > d && (E = d);
355
+ }
356
+ return f == e.MAX_VALUE ? null : (v[0].getParent().paddingLeft != null ? N = v[0].getParent().paddingLeft : N = this.margin, this.left = E - N, this.top = f - N, new p(this.left, this.top));
357
+ }, g.prototype.updateBounds = function(f) {
358
+ for (var E = e.MAX_VALUE, y = -e.MAX_VALUE, d = e.MAX_VALUE, N = -e.MAX_VALUE, v, L, s, u, c, A = this.nodes, _ = A.length, O = 0; O < _; O++) {
359
+ var D = A[O];
360
+ f && D.child != null && D.updateBounds(), v = D.getLeft(), L = D.getRight(), s = D.getTop(), u = D.getBottom(), E > v && (E = v), y < L && (y = L), d > s && (d = s), N < u && (N = u);
361
+ }
362
+ var w = new o(E, d, y - E, N - d);
363
+ E == e.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), A[0].getParent().paddingLeft != null ? c = A[0].getParent().paddingLeft : c = this.margin, this.left = w.x - c, this.right = w.x + w.width + c, this.top = w.y - c, this.bottom = w.y + w.height + c;
364
+ }, g.calculateBounds = function(f) {
365
+ for (var E = e.MAX_VALUE, y = -e.MAX_VALUE, d = e.MAX_VALUE, N = -e.MAX_VALUE, v, L, s, u, c = f.length, A = 0; A < c; A++) {
366
+ var _ = f[A];
367
+ v = _.getLeft(), L = _.getRight(), s = _.getTop(), u = _.getBottom(), E > v && (E = v), y < L && (y = L), d > s && (d = s), N < u && (N = u);
368
+ }
369
+ var O = new o(E, d, y - E, N - d);
370
+ return O;
371
+ }, g.prototype.getInclusionTreeDepth = function() {
372
+ return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
373
+ }, g.prototype.getEstimatedSize = function() {
374
+ if (this.estimatedSize == e.MIN_VALUE)
375
+ throw "assert failed";
376
+ return this.estimatedSize;
377
+ }, g.prototype.calcEstimatedSize = function() {
378
+ for (var f = 0, E = this.nodes, y = E.length, d = 0; d < y; d++) {
379
+ var N = E[d];
380
+ f += N.calcEstimatedSize();
381
+ }
382
+ return f == 0 ? this.estimatedSize = t.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = f / Math.sqrt(this.nodes.length), this.estimatedSize;
383
+ }, g.prototype.updateConnected = function() {
384
+ var f = this;
385
+ if (this.nodes.length == 0) {
386
+ this.isConnected = !0;
387
+ return;
388
+ }
389
+ var E = new i(), y = /* @__PURE__ */ new Set(), d = this.nodes[0], N, v, L = d.withChildren();
390
+ for (L.forEach(function(O) {
391
+ E.push(O), y.add(O);
392
+ }); E.length !== 0; ) {
393
+ d = E.shift(), N = d.getEdges();
394
+ for (var s = N.length, u = 0; u < s; u++) {
395
+ var c = N[u];
396
+ if (v = c.getOtherEndInGraph(d, this), v != null && !y.has(v)) {
397
+ var A = v.withChildren();
398
+ A.forEach(function(O) {
399
+ E.push(O), y.add(O);
400
+ });
401
+ }
402
+ }
403
+ }
404
+ if (this.isConnected = !1, y.size >= this.nodes.length) {
405
+ var _ = 0;
406
+ y.forEach(function(O) {
407
+ O.owner == f && _++;
408
+ }), _ == this.nodes.length && (this.isConnected = !0);
409
+ }
410
+ }, m.exports = g;
411
+ },
412
+ /* 6 */
413
+ /***/
414
+ function(m, I, T) {
415
+ var n, e = T(1);
416
+ function t(r) {
417
+ n = T(5), this.layout = r, this.graphs = [], this.edges = [];
418
+ }
419
+ t.prototype.addRoot = function() {
420
+ var r = this.layout.newGraph(), h = this.layout.newNode(null), a = this.add(r, h);
421
+ return this.setRootGraph(a), this.rootGraph;
422
+ }, t.prototype.add = function(r, h, a, o, p) {
423
+ if (a == null && o == null && p == null) {
424
+ if (r == null)
425
+ throw "Graph is null!";
426
+ if (h == null)
427
+ throw "Parent node is null!";
428
+ if (this.graphs.indexOf(r) > -1)
429
+ throw "Graph already in this graph mgr!";
430
+ if (this.graphs.push(r), r.parent != null)
431
+ throw "Already has a parent!";
432
+ if (h.child != null)
433
+ throw "Already has a child!";
434
+ return r.parent = h, h.child = r, r;
435
+ } else {
436
+ p = a, o = h, a = r;
437
+ var i = o.getOwner(), g = p.getOwner();
438
+ if (!(i != null && i.getGraphManager() == this))
439
+ throw "Source not in this graph mgr!";
440
+ if (!(g != null && g.getGraphManager() == this))
441
+ throw "Target not in this graph mgr!";
442
+ if (i == g)
443
+ return a.isInterGraph = !1, i.add(a, o, p);
444
+ if (a.isInterGraph = !0, a.source = o, a.target = p, this.edges.indexOf(a) > -1)
445
+ throw "Edge already in inter-graph edge list!";
446
+ if (this.edges.push(a), !(a.source != null && a.target != null))
447
+ throw "Edge source and/or target is null!";
448
+ if (!(a.source.edges.indexOf(a) == -1 && a.target.edges.indexOf(a) == -1))
449
+ throw "Edge already in source and/or target incidency list!";
450
+ return a.source.edges.push(a), a.target.edges.push(a), a;
451
+ }
452
+ }, t.prototype.remove = function(r) {
453
+ if (r instanceof n) {
454
+ var h = r;
455
+ if (h.getGraphManager() != this)
456
+ throw "Graph not in this graph mgr";
457
+ if (!(h == this.rootGraph || h.parent != null && h.parent.graphManager == this))
458
+ throw "Invalid parent node!";
459
+ var a = [];
460
+ a = a.concat(h.getEdges());
461
+ for (var o, p = a.length, i = 0; i < p; i++)
462
+ o = a[i], h.remove(o);
463
+ var g = [];
464
+ g = g.concat(h.getNodes());
465
+ var l;
466
+ p = g.length;
467
+ for (var i = 0; i < p; i++)
468
+ l = g[i], h.remove(l);
469
+ h == this.rootGraph && this.setRootGraph(null);
470
+ var f = this.graphs.indexOf(h);
471
+ this.graphs.splice(f, 1), h.parent = null;
472
+ } else if (r instanceof e) {
473
+ if (o = r, o == null)
474
+ throw "Edge is null!";
475
+ if (!o.isInterGraph)
476
+ throw "Not an inter-graph edge!";
477
+ if (!(o.source != null && o.target != null))
478
+ throw "Source and/or target is null!";
479
+ if (!(o.source.edges.indexOf(o) != -1 && o.target.edges.indexOf(o) != -1))
480
+ throw "Source and/or target doesn't know this edge!";
481
+ var f = o.source.edges.indexOf(o);
482
+ if (o.source.edges.splice(f, 1), f = o.target.edges.indexOf(o), o.target.edges.splice(f, 1), !(o.source.owner != null && o.source.owner.getGraphManager() != null))
483
+ throw "Edge owner graph or owner graph manager is null!";
484
+ if (o.source.owner.getGraphManager().edges.indexOf(o) == -1)
485
+ throw "Not in owner graph manager's edge list!";
486
+ var f = o.source.owner.getGraphManager().edges.indexOf(o);
487
+ o.source.owner.getGraphManager().edges.splice(f, 1);
488
+ }
489
+ }, t.prototype.updateBounds = function() {
490
+ this.rootGraph.updateBounds(!0);
491
+ }, t.prototype.getGraphs = function() {
492
+ return this.graphs;
493
+ }, t.prototype.getAllNodes = function() {
494
+ if (this.allNodes == null) {
495
+ for (var r = [], h = this.getGraphs(), a = h.length, o = 0; o < a; o++)
496
+ r = r.concat(h[o].getNodes());
497
+ this.allNodes = r;
498
+ }
499
+ return this.allNodes;
500
+ }, t.prototype.resetAllNodes = function() {
501
+ this.allNodes = null;
502
+ }, t.prototype.resetAllEdges = function() {
503
+ this.allEdges = null;
504
+ }, t.prototype.resetAllNodesToApplyGravitation = function() {
505
+ this.allNodesToApplyGravitation = null;
506
+ }, t.prototype.getAllEdges = function() {
507
+ if (this.allEdges == null) {
508
+ var r = [], h = this.getGraphs();
509
+ h.length;
510
+ for (var a = 0; a < h.length; a++)
511
+ r = r.concat(h[a].getEdges());
512
+ r = r.concat(this.edges), this.allEdges = r;
513
+ }
514
+ return this.allEdges;
515
+ }, t.prototype.getAllNodesToApplyGravitation = function() {
516
+ return this.allNodesToApplyGravitation;
517
+ }, t.prototype.setAllNodesToApplyGravitation = function(r) {
518
+ if (this.allNodesToApplyGravitation != null)
519
+ throw "assert failed";
520
+ this.allNodesToApplyGravitation = r;
521
+ }, t.prototype.getRoot = function() {
522
+ return this.rootGraph;
523
+ }, t.prototype.setRootGraph = function(r) {
524
+ if (r.getGraphManager() != this)
525
+ throw "Root not in this graph mgr!";
526
+ this.rootGraph = r, r.parent == null && (r.parent = this.layout.newNode("Root node"));
527
+ }, t.prototype.getLayout = function() {
528
+ return this.layout;
529
+ }, t.prototype.isOneAncestorOfOther = function(r, h) {
530
+ if (!(r != null && h != null))
531
+ throw "assert failed";
532
+ if (r == h)
533
+ return !0;
534
+ var a = r.getOwner(), o;
535
+ do {
536
+ if (o = a.getParent(), o == null)
537
+ break;
538
+ if (o == h)
539
+ return !0;
540
+ if (a = o.getOwner(), a == null)
541
+ break;
542
+ } while (!0);
543
+ a = h.getOwner();
544
+ do {
545
+ if (o = a.getParent(), o == null)
546
+ break;
547
+ if (o == r)
548
+ return !0;
549
+ if (a = o.getOwner(), a == null)
550
+ break;
551
+ } while (!0);
552
+ return !1;
553
+ }, t.prototype.calcLowestCommonAncestors = function() {
554
+ for (var r, h, a, o, p, i = this.getAllEdges(), g = i.length, l = 0; l < g; l++) {
555
+ if (r = i[l], h = r.source, a = r.target, r.lca = null, r.sourceInLca = h, r.targetInLca = a, h == a) {
556
+ r.lca = h.getOwner();
557
+ continue;
558
+ }
559
+ for (o = h.getOwner(); r.lca == null; ) {
560
+ for (r.targetInLca = a, p = a.getOwner(); r.lca == null; ) {
561
+ if (p == o) {
562
+ r.lca = p;
563
+ break;
564
+ }
565
+ if (p == this.rootGraph)
566
+ break;
567
+ if (r.lca != null)
568
+ throw "assert failed";
569
+ r.targetInLca = p.getParent(), p = r.targetInLca.getOwner();
570
+ }
571
+ if (o == this.rootGraph)
572
+ break;
573
+ r.lca == null && (r.sourceInLca = o.getParent(), o = r.sourceInLca.getOwner());
574
+ }
575
+ if (r.lca == null)
576
+ throw "assert failed";
577
+ }
578
+ }, t.prototype.calcLowestCommonAncestor = function(r, h) {
579
+ if (r == h)
580
+ return r.getOwner();
581
+ var a = r.getOwner();
582
+ do {
583
+ if (a == null)
584
+ break;
585
+ var o = h.getOwner();
586
+ do {
587
+ if (o == null)
588
+ break;
589
+ if (o == a)
590
+ return o;
591
+ o = o.getParent().getOwner();
592
+ } while (!0);
593
+ a = a.getParent().getOwner();
594
+ } while (!0);
595
+ return a;
596
+ }, t.prototype.calcInclusionTreeDepths = function(r, h) {
597
+ r == null && h == null && (r = this.rootGraph, h = 1);
598
+ for (var a, o = r.getNodes(), p = o.length, i = 0; i < p; i++)
599
+ a = o[i], a.inclusionTreeDepth = h, a.child != null && this.calcInclusionTreeDepths(a.child, h + 1);
600
+ }, t.prototype.includesInvalidEdge = function() {
601
+ for (var r, h = this.edges.length, a = 0; a < h; a++)
602
+ if (r = this.edges[a], this.isOneAncestorOfOther(r.source, r.target))
603
+ return !0;
604
+ return !1;
605
+ }, m.exports = t;
606
+ },
607
+ /* 7 */
608
+ /***/
609
+ function(m, I, T) {
610
+ var n = T(0);
611
+ function e() {
612
+ }
613
+ for (var t in n)
614
+ e[t] = n[t];
615
+ e.MAX_ITERATIONS = 2500, e.DEFAULT_EDGE_LENGTH = 50, e.DEFAULT_SPRING_STRENGTH = 0.45, e.DEFAULT_REPULSION_STRENGTH = 4500, e.DEFAULT_GRAVITY_STRENGTH = 0.4, e.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, e.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, e.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, e.COOLING_ADAPTATION_FACTOR = 0.33, e.ADAPTATION_LOWER_NODE_LIMIT = 1e3, e.ADAPTATION_UPPER_NODE_LIMIT = 5e3, e.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, e.MAX_NODE_DISPLACEMENT = e.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, e.MIN_REPULSION_DIST = e.DEFAULT_EDGE_LENGTH / 10, e.CONVERGENCE_CHECK_PERIOD = 100, e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, e.MIN_EDGE_LENGTH = 1, e.GRID_CALCULATION_CHECK_PERIOD = 10, m.exports = e;
616
+ },
617
+ /* 8 */
618
+ /***/
619
+ function(m, I, T) {
620
+ var n = T(12);
621
+ function e() {
622
+ }
623
+ e.calcSeparationAmount = function(t, r, h, a) {
624
+ if (!t.intersects(r))
625
+ throw "assert failed";
626
+ var o = new Array(2);
627
+ this.decideDirectionsForOverlappingNodes(t, r, o), h[0] = Math.min(t.getRight(), r.getRight()) - Math.max(t.x, r.x), h[1] = Math.min(t.getBottom(), r.getBottom()) - Math.max(t.y, r.y), t.getX() <= r.getX() && t.getRight() >= r.getRight() ? h[0] += Math.min(r.getX() - t.getX(), t.getRight() - r.getRight()) : r.getX() <= t.getX() && r.getRight() >= t.getRight() && (h[0] += Math.min(t.getX() - r.getX(), r.getRight() - t.getRight())), t.getY() <= r.getY() && t.getBottom() >= r.getBottom() ? h[1] += Math.min(r.getY() - t.getY(), t.getBottom() - r.getBottom()) : r.getY() <= t.getY() && r.getBottom() >= t.getBottom() && (h[1] += Math.min(t.getY() - r.getY(), r.getBottom() - t.getBottom()));
628
+ var p = Math.abs((r.getCenterY() - t.getCenterY()) / (r.getCenterX() - t.getCenterX()));
629
+ r.getCenterY() === t.getCenterY() && r.getCenterX() === t.getCenterX() && (p = 1);
630
+ var i = p * h[0], g = h[1] / p;
631
+ h[0] < g ? g = h[0] : i = h[1], h[0] = -1 * o[0] * (g / 2 + a), h[1] = -1 * o[1] * (i / 2 + a);
632
+ }, e.decideDirectionsForOverlappingNodes = function(t, r, h) {
633
+ t.getCenterX() < r.getCenterX() ? h[0] = -1 : h[0] = 1, t.getCenterY() < r.getCenterY() ? h[1] = -1 : h[1] = 1;
634
+ }, e.getIntersection2 = function(t, r, h) {
635
+ var a = t.getCenterX(), o = t.getCenterY(), p = r.getCenterX(), i = r.getCenterY();
636
+ if (t.intersects(r))
637
+ return h[0] = a, h[1] = o, h[2] = p, h[3] = i, !0;
638
+ var g = t.getX(), l = t.getY(), f = t.getRight(), E = t.getX(), y = t.getBottom(), d = t.getRight(), N = t.getWidthHalf(), v = t.getHeightHalf(), L = r.getX(), s = r.getY(), u = r.getRight(), c = r.getX(), A = r.getBottom(), _ = r.getRight(), O = r.getWidthHalf(), D = r.getHeightHalf(), w = !1, R = !1;
639
+ if (a === p) {
640
+ if (o > i)
641
+ return h[0] = a, h[1] = l, h[2] = p, h[3] = A, !1;
642
+ if (o < i)
643
+ return h[0] = a, h[1] = y, h[2] = p, h[3] = s, !1;
644
+ } else if (o === i) {
645
+ if (a > p)
646
+ return h[0] = g, h[1] = o, h[2] = u, h[3] = i, !1;
647
+ if (a < p)
648
+ return h[0] = f, h[1] = o, h[2] = L, h[3] = i, !1;
649
+ } else {
650
+ var F = t.height / t.width, b = r.height / r.width, C = (i - o) / (p - a), M = void 0, G = void 0, P = void 0, S = void 0, U = void 0, Y = void 0;
651
+ if (-F === C ? a > p ? (h[0] = E, h[1] = y, w = !0) : (h[0] = f, h[1] = l, w = !0) : F === C && (a > p ? (h[0] = g, h[1] = l, w = !0) : (h[0] = d, h[1] = y, w = !0)), -b === C ? p > a ? (h[2] = c, h[3] = A, R = !0) : (h[2] = u, h[3] = s, R = !0) : b === C && (p > a ? (h[2] = L, h[3] = s, R = !0) : (h[2] = _, h[3] = A, R = !0)), w && R)
652
+ return !1;
653
+ if (a > p ? o > i ? (M = this.getCardinalDirection(F, C, 4), G = this.getCardinalDirection(b, C, 2)) : (M = this.getCardinalDirection(-F, C, 3), G = this.getCardinalDirection(-b, C, 1)) : o > i ? (M = this.getCardinalDirection(-F, C, 1), G = this.getCardinalDirection(-b, C, 3)) : (M = this.getCardinalDirection(F, C, 2), G = this.getCardinalDirection(b, C, 4)), !w)
654
+ switch (M) {
655
+ case 1:
656
+ S = l, P = a + -v / C, h[0] = P, h[1] = S;
657
+ break;
658
+ case 2:
659
+ P = d, S = o + N * C, h[0] = P, h[1] = S;
660
+ break;
661
+ case 3:
662
+ S = y, P = a + v / C, h[0] = P, h[1] = S;
663
+ break;
664
+ case 4:
665
+ P = E, S = o + -N * C, h[0] = P, h[1] = S;
666
+ break;
667
+ }
668
+ if (!R)
669
+ switch (G) {
670
+ case 1:
671
+ Y = s, U = p + -D / C, h[2] = U, h[3] = Y;
672
+ break;
673
+ case 2:
674
+ U = _, Y = i + O * C, h[2] = U, h[3] = Y;
675
+ break;
676
+ case 3:
677
+ Y = A, U = p + D / C, h[2] = U, h[3] = Y;
678
+ break;
679
+ case 4:
680
+ U = c, Y = i + -O * C, h[2] = U, h[3] = Y;
681
+ break;
682
+ }
683
+ }
684
+ return !1;
685
+ }, e.getCardinalDirection = function(t, r, h) {
686
+ return t > r ? h : 1 + h % 4;
687
+ }, e.getIntersection = function(t, r, h, a) {
688
+ if (a == null)
689
+ return this.getIntersection2(t, r, h);
690
+ var o = t.x, p = t.y, i = r.x, g = r.y, l = h.x, f = h.y, E = a.x, y = a.y, d = void 0, N = void 0, v = void 0, L = void 0, s = void 0, u = void 0, c = void 0, A = void 0, _ = void 0;
691
+ return v = g - p, s = o - i, c = i * p - o * g, L = y - f, u = l - E, A = E * f - l * y, _ = v * u - L * s, _ === 0 ? null : (d = (s * A - u * c) / _, N = (L * c - v * A) / _, new n(d, N));
692
+ }, e.angleOfVector = function(t, r, h, a) {
693
+ var o = void 0;
694
+ return t !== h ? (o = Math.atan((a - r) / (h - t)), h < t ? o += Math.PI : a < r && (o += this.TWO_PI)) : a < r ? o = this.ONE_AND_HALF_PI : o = this.HALF_PI, o;
695
+ }, e.doIntersect = function(t, r, h, a) {
696
+ var o = t.x, p = t.y, i = r.x, g = r.y, l = h.x, f = h.y, E = a.x, y = a.y, d = (i - o) * (y - f) - (E - l) * (g - p);
697
+ if (d === 0)
698
+ return !1;
699
+ var N = ((y - f) * (E - o) + (l - E) * (y - p)) / d, v = ((p - g) * (E - o) + (i - o) * (y - p)) / d;
700
+ return 0 < N && N < 1 && 0 < v && v < 1;
701
+ }, e.HALF_PI = 0.5 * Math.PI, e.ONE_AND_HALF_PI = 1.5 * Math.PI, e.TWO_PI = 2 * Math.PI, e.THREE_PI = 3 * Math.PI, m.exports = e;
702
+ },
703
+ /* 9 */
704
+ /***/
705
+ function(m, I, T) {
706
+ function n() {
707
+ }
708
+ n.sign = function(e) {
709
+ return e > 0 ? 1 : e < 0 ? -1 : 0;
710
+ }, n.floor = function(e) {
711
+ return e < 0 ? Math.ceil(e) : Math.floor(e);
712
+ }, n.ceil = function(e) {
713
+ return e < 0 ? Math.floor(e) : Math.ceil(e);
714
+ }, m.exports = n;
715
+ },
716
+ /* 10 */
717
+ /***/
718
+ function(m, I, T) {
719
+ function n() {
720
+ }
721
+ n.MAX_VALUE = 2147483647, n.MIN_VALUE = -2147483648, m.exports = n;
722
+ },
723
+ /* 11 */
724
+ /***/
725
+ function(m, I, T) {
726
+ var n = /* @__PURE__ */ function() {
727
+ function o(p, i) {
728
+ for (var g = 0; g < i.length; g++) {
729
+ var l = i[g];
730
+ l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(p, l.key, l);
731
+ }
732
+ }
733
+ return function(p, i, g) {
734
+ return i && o(p.prototype, i), g && o(p, g), p;
735
+ };
736
+ }();
737
+ function e(o, p) {
738
+ if (!(o instanceof p))
739
+ throw new TypeError("Cannot call a class as a function");
740
+ }
741
+ var t = function(o) {
742
+ return { value: o, next: null, prev: null };
743
+ }, r = function(o, p, i, g) {
744
+ return o !== null ? o.next = p : g.head = p, i !== null ? i.prev = p : g.tail = p, p.prev = o, p.next = i, g.length++, p;
745
+ }, h = function(o, p) {
746
+ var i = o.prev, g = o.next;
747
+ return i !== null ? i.next = g : p.head = g, g !== null ? g.prev = i : p.tail = i, o.prev = o.next = null, p.length--, o;
748
+ }, a = function() {
749
+ function o(p) {
750
+ var i = this;
751
+ e(this, o), this.length = 0, this.head = null, this.tail = null, p != null && p.forEach(function(g) {
752
+ return i.push(g);
753
+ });
754
+ }
755
+ return n(o, [{
756
+ key: "size",
757
+ value: function() {
758
+ return this.length;
759
+ }
760
+ }, {
761
+ key: "insertBefore",
762
+ value: function(p, i) {
763
+ return r(i.prev, t(p), i, this);
764
+ }
765
+ }, {
766
+ key: "insertAfter",
767
+ value: function(p, i) {
768
+ return r(i, t(p), i.next, this);
769
+ }
770
+ }, {
771
+ key: "insertNodeBefore",
772
+ value: function(p, i) {
773
+ return r(i.prev, p, i, this);
774
+ }
775
+ }, {
776
+ key: "insertNodeAfter",
777
+ value: function(p, i) {
778
+ return r(i, p, i.next, this);
779
+ }
780
+ }, {
781
+ key: "push",
782
+ value: function(p) {
783
+ return r(this.tail, t(p), null, this);
784
+ }
785
+ }, {
786
+ key: "unshift",
787
+ value: function(p) {
788
+ return r(null, t(p), this.head, this);
789
+ }
790
+ }, {
791
+ key: "remove",
792
+ value: function(p) {
793
+ return h(p, this);
794
+ }
795
+ }, {
796
+ key: "pop",
797
+ value: function() {
798
+ return h(this.tail, this).value;
799
+ }
800
+ }, {
801
+ key: "popNode",
802
+ value: function() {
803
+ return h(this.tail, this);
804
+ }
805
+ }, {
806
+ key: "shift",
807
+ value: function() {
808
+ return h(this.head, this).value;
809
+ }
810
+ }, {
811
+ key: "shiftNode",
812
+ value: function() {
813
+ return h(this.head, this);
814
+ }
815
+ }, {
816
+ key: "get_object_at",
817
+ value: function(p) {
818
+ if (p <= this.length()) {
819
+ for (var i = 1, g = this.head; i < p; )
820
+ g = g.next, i++;
821
+ return g.value;
822
+ }
823
+ }
824
+ }, {
825
+ key: "set_object_at",
826
+ value: function(p, i) {
827
+ if (p <= this.length()) {
828
+ for (var g = 1, l = this.head; g < p; )
829
+ l = l.next, g++;
830
+ l.value = i;
831
+ }
832
+ }
833
+ }]), o;
834
+ }();
835
+ m.exports = a;
836
+ },
837
+ /* 12 */
838
+ /***/
839
+ function(m, I, T) {
840
+ function n(e, t, r) {
841
+ this.x = null, this.y = null, e == null && t == null && r == null ? (this.x = 0, this.y = 0) : typeof e == "number" && typeof t == "number" && r == null ? (this.x = e, this.y = t) : e.constructor.name == "Point" && t == null && r == null && (r = e, this.x = r.x, this.y = r.y);
842
+ }
843
+ n.prototype.getX = function() {
844
+ return this.x;
845
+ }, n.prototype.getY = function() {
846
+ return this.y;
847
+ }, n.prototype.getLocation = function() {
848
+ return new n(this.x, this.y);
849
+ }, n.prototype.setLocation = function(e, t, r) {
850
+ e.constructor.name == "Point" && t == null && r == null ? (r = e, this.setLocation(r.x, r.y)) : typeof e == "number" && typeof t == "number" && r == null && (parseInt(e) == e && parseInt(t) == t ? this.move(e, t) : (this.x = Math.floor(e + 0.5), this.y = Math.floor(t + 0.5)));
851
+ }, n.prototype.move = function(e, t) {
852
+ this.x = e, this.y = t;
853
+ }, n.prototype.translate = function(e, t) {
854
+ this.x += e, this.y += t;
855
+ }, n.prototype.equals = function(e) {
856
+ if (e.constructor.name == "Point") {
857
+ var t = e;
858
+ return this.x == t.x && this.y == t.y;
859
+ }
860
+ return this == e;
861
+ }, n.prototype.toString = function() {
862
+ return new n().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
863
+ }, m.exports = n;
864
+ },
865
+ /* 13 */
866
+ /***/
867
+ function(m, I, T) {
868
+ function n(e, t, r, h) {
869
+ this.x = 0, this.y = 0, this.width = 0, this.height = 0, e != null && t != null && r != null && h != null && (this.x = e, this.y = t, this.width = r, this.height = h);
870
+ }
871
+ n.prototype.getX = function() {
872
+ return this.x;
873
+ }, n.prototype.setX = function(e) {
874
+ this.x = e;
875
+ }, n.prototype.getY = function() {
876
+ return this.y;
877
+ }, n.prototype.setY = function(e) {
878
+ this.y = e;
879
+ }, n.prototype.getWidth = function() {
880
+ return this.width;
881
+ }, n.prototype.setWidth = function(e) {
882
+ this.width = e;
883
+ }, n.prototype.getHeight = function() {
884
+ return this.height;
885
+ }, n.prototype.setHeight = function(e) {
886
+ this.height = e;
887
+ }, n.prototype.getRight = function() {
888
+ return this.x + this.width;
889
+ }, n.prototype.getBottom = function() {
890
+ return this.y + this.height;
891
+ }, n.prototype.intersects = function(e) {
892
+ return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y);
893
+ }, n.prototype.getCenterX = function() {
894
+ return this.x + this.width / 2;
895
+ }, n.prototype.getMinX = function() {
896
+ return this.getX();
897
+ }, n.prototype.getMaxX = function() {
898
+ return this.getX() + this.width;
899
+ }, n.prototype.getCenterY = function() {
900
+ return this.y + this.height / 2;
901
+ }, n.prototype.getMinY = function() {
902
+ return this.getY();
903
+ }, n.prototype.getMaxY = function() {
904
+ return this.getY() + this.height;
905
+ }, n.prototype.getWidthHalf = function() {
906
+ return this.width / 2;
907
+ }, n.prototype.getHeightHalf = function() {
908
+ return this.height / 2;
909
+ }, m.exports = n;
910
+ },
911
+ /* 14 */
912
+ /***/
913
+ function(m, I, T) {
914
+ var n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
915
+ return typeof t;
916
+ } : function(t) {
917
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
918
+ };
919
+ function e() {
920
+ }
921
+ e.lastID = 0, e.createID = function(t) {
922
+ return e.isPrimitive(t) ? t : (t.uniqueID != null || (t.uniqueID = e.getString(), e.lastID++), t.uniqueID);
923
+ }, e.getString = function(t) {
924
+ return t == null && (t = e.lastID), "Object#" + t;
925
+ }, e.isPrimitive = function(t) {
926
+ var r = typeof t > "u" ? "undefined" : n(t);
927
+ return t == null || r != "object" && r != "function";
928
+ }, m.exports = e;
929
+ },
930
+ /* 15 */
931
+ /***/
932
+ function(m, I, T) {
933
+ function n(l) {
934
+ if (Array.isArray(l)) {
935
+ for (var f = 0, E = Array(l.length); f < l.length; f++)
936
+ E[f] = l[f];
937
+ return E;
938
+ } else
939
+ return Array.from(l);
940
+ }
941
+ var e = T(0), t = T(6), r = T(3), h = T(1), a = T(5), o = T(4), p = T(17), i = T(27);
942
+ function g(l) {
943
+ i.call(this), this.layoutQuality = e.QUALITY, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = e.DEFAULT_INCREMENTAL, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new t(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, l != null && (this.isRemoteUse = l);
944
+ }
945
+ g.RANDOM_SEED = 1, g.prototype = Object.create(i.prototype), g.prototype.getGraphManager = function() {
946
+ return this.graphManager;
947
+ }, g.prototype.getAllNodes = function() {
948
+ return this.graphManager.getAllNodes();
949
+ }, g.prototype.getAllEdges = function() {
950
+ return this.graphManager.getAllEdges();
951
+ }, g.prototype.getAllNodesToApplyGravitation = function() {
952
+ return this.graphManager.getAllNodesToApplyGravitation();
953
+ }, g.prototype.newGraphManager = function() {
954
+ var l = new t(this);
955
+ return this.graphManager = l, l;
956
+ }, g.prototype.newGraph = function(l) {
957
+ return new a(null, this.graphManager, l);
958
+ }, g.prototype.newNode = function(l) {
959
+ return new r(this.graphManager, l);
960
+ }, g.prototype.newEdge = function(l) {
961
+ return new h(null, null, l);
962
+ }, g.prototype.checkLayoutSuccess = function() {
963
+ return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
964
+ }, g.prototype.runLayout = function() {
965
+ this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
966
+ var l;
967
+ return this.checkLayoutSuccess() ? l = !1 : l = this.layout(), e.ANIMATE === "during" ? !1 : (l && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, l);
968
+ }, g.prototype.doPostLayout = function() {
969
+ this.incremental || this.transform(), this.update();
970
+ }, g.prototype.update2 = function() {
971
+ if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
972
+ for (var l = this.graphManager.getAllEdges(), f = 0; f < l.length; f++)
973
+ l[f];
974
+ for (var E = this.graphManager.getRoot().getNodes(), f = 0; f < E.length; f++)
975
+ E[f];
976
+ this.update(this.graphManager.getRoot());
977
+ }
978
+ }, g.prototype.update = function(l) {
979
+ if (l == null)
980
+ this.update2();
981
+ else if (l instanceof r) {
982
+ var f = l;
983
+ if (f.getChild() != null)
984
+ for (var E = f.getChild().getNodes(), y = 0; y < E.length; y++)
985
+ update(E[y]);
986
+ if (f.vGraphObject != null) {
987
+ var d = f.vGraphObject;
988
+ d.update(f);
989
+ }
990
+ } else if (l instanceof h) {
991
+ var N = l;
992
+ if (N.vGraphObject != null) {
993
+ var v = N.vGraphObject;
994
+ v.update(N);
995
+ }
996
+ } else if (l instanceof a) {
997
+ var L = l;
998
+ if (L.vGraphObject != null) {
999
+ var s = L.vGraphObject;
1000
+ s.update(L);
1001
+ }
1002
+ }
1003
+ }, g.prototype.initParameters = function() {
1004
+ this.isSubLayout || (this.layoutQuality = e.QUALITY, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = e.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
1005
+ }, g.prototype.transform = function(l) {
1006
+ if (l == null)
1007
+ this.transform(new o(0, 0));
1008
+ else {
1009
+ var f = new p(), E = this.graphManager.getRoot().updateLeftTop();
1010
+ if (E != null) {
1011
+ f.setWorldOrgX(l.x), f.setWorldOrgY(l.y), f.setDeviceOrgX(E.x), f.setDeviceOrgY(E.y);
1012
+ for (var y = this.getAllNodes(), d, N = 0; N < y.length; N++)
1013
+ d = y[N], d.transform(f);
1014
+ }
1015
+ }
1016
+ }, g.prototype.positionNodesRandomly = function(l) {
1017
+ if (l == null)
1018
+ this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
1019
+ else
1020
+ for (var f, E, y = l.getNodes(), d = 0; d < y.length; d++)
1021
+ f = y[d], E = f.getChild(), E == null || E.getNodes().length == 0 ? f.scatter() : (this.positionNodesRandomly(E), f.updateBounds());
1022
+ }, g.prototype.getFlatForest = function() {
1023
+ for (var l = [], f = !0, E = this.graphManager.getRoot().getNodes(), y = !0, d = 0; d < E.length; d++)
1024
+ E[d].getChild() != null && (y = !1);
1025
+ if (!y)
1026
+ return l;
1027
+ var N = /* @__PURE__ */ new Set(), v = [], L = /* @__PURE__ */ new Map(), s = [];
1028
+ for (s = s.concat(E); s.length > 0 && f; ) {
1029
+ for (v.push(s[0]); v.length > 0 && f; ) {
1030
+ var u = v[0];
1031
+ v.splice(0, 1), N.add(u);
1032
+ for (var c = u.getEdges(), d = 0; d < c.length; d++) {
1033
+ var A = c[d].getOtherEnd(u);
1034
+ if (L.get(u) != A)
1035
+ if (!N.has(A))
1036
+ v.push(A), L.set(A, u);
1037
+ else {
1038
+ f = !1;
1039
+ break;
1040
+ }
1041
+ }
1042
+ }
1043
+ if (!f)
1044
+ l = [];
1045
+ else {
1046
+ var _ = [].concat(n(N));
1047
+ l.push(_);
1048
+ for (var d = 0; d < _.length; d++) {
1049
+ var O = _[d], D = s.indexOf(O);
1050
+ D > -1 && s.splice(D, 1);
1051
+ }
1052
+ N = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Map();
1053
+ }
1054
+ }
1055
+ return l;
1056
+ }, g.prototype.createDummyNodesForBendpoints = function(l) {
1057
+ for (var f = [], E = l.source, y = this.graphManager.calcLowestCommonAncestor(l.source, l.target), d = 0; d < l.bendpoints.length; d++) {
1058
+ var N = this.newNode(null);
1059
+ N.setRect(new Point(0, 0), new Dimension(1, 1)), y.add(N);
1060
+ var v = this.newEdge(null);
1061
+ this.graphManager.add(v, E, N), f.add(N), E = N;
1062
+ }
1063
+ var v = this.newEdge(null);
1064
+ return this.graphManager.add(v, E, l.target), this.edgeToDummyNodes.set(l, f), l.isInterGraph() ? this.graphManager.remove(l) : y.remove(l), f;
1065
+ }, g.prototype.createBendpointsFromDummyNodes = function() {
1066
+ var l = [];
1067
+ l = l.concat(this.graphManager.getAllEdges()), l = [].concat(n(this.edgeToDummyNodes.keys())).concat(l);
1068
+ for (var f = 0; f < l.length; f++) {
1069
+ var E = l[f];
1070
+ if (E.bendpoints.length > 0) {
1071
+ for (var y = this.edgeToDummyNodes.get(E), d = 0; d < y.length; d++) {
1072
+ var N = y[d], v = new o(N.getCenterX(), N.getCenterY()), L = E.bendpoints.get(d);
1073
+ L.x = v.x, L.y = v.y, N.getOwner().remove(N);
1074
+ }
1075
+ this.graphManager.add(E, E.source, E.target);
1076
+ }
1077
+ }
1078
+ }, g.transform = function(l, f, E, y) {
1079
+ if (E != null && y != null) {
1080
+ var d = f;
1081
+ if (l <= 50) {
1082
+ var N = f / E;
1083
+ d -= (f - N) / 50 * (50 - l);
1084
+ } else {
1085
+ var v = f * y;
1086
+ d += (v - f) / 50 * (l - 50);
1087
+ }
1088
+ return d;
1089
+ } else {
1090
+ var L, s;
1091
+ return l <= 50 ? (L = 9 * f / 500, s = f / 10) : (L = 9 * f / 50, s = -8 * f), L * l + s;
1092
+ }
1093
+ }, g.findCenterOfTree = function(l) {
1094
+ var f = [];
1095
+ f = f.concat(l);
1096
+ var E = [], y = /* @__PURE__ */ new Map(), d = !1, N = null;
1097
+ (f.length == 1 || f.length == 2) && (d = !0, N = f[0]);
1098
+ for (var v = 0; v < f.length; v++) {
1099
+ var L = f[v], s = L.getNeighborsList().size;
1100
+ y.set(L, L.getNeighborsList().size), s == 1 && E.push(L);
1101
+ }
1102
+ var u = [];
1103
+ for (u = u.concat(E); !d; ) {
1104
+ var c = [];
1105
+ c = c.concat(u), u = [];
1106
+ for (var v = 0; v < f.length; v++) {
1107
+ var L = f[v], A = f.indexOf(L);
1108
+ A >= 0 && f.splice(A, 1);
1109
+ var _ = L.getNeighborsList();
1110
+ _.forEach(function(w) {
1111
+ if (E.indexOf(w) < 0) {
1112
+ var R = y.get(w), F = R - 1;
1113
+ F == 1 && u.push(w), y.set(w, F);
1114
+ }
1115
+ });
1116
+ }
1117
+ E = E.concat(u), (f.length == 1 || f.length == 2) && (d = !0, N = f[0]);
1118
+ }
1119
+ return N;
1120
+ }, g.prototype.setGraphManager = function(l) {
1121
+ this.graphManager = l;
1122
+ }, m.exports = g;
1123
+ },
1124
+ /* 16 */
1125
+ /***/
1126
+ function(m, I, T) {
1127
+ function n() {
1128
+ }
1129
+ n.seed = 1, n.x = 0, n.nextDouble = function() {
1130
+ return n.x = Math.sin(n.seed++) * 1e4, n.x - Math.floor(n.x);
1131
+ }, m.exports = n;
1132
+ },
1133
+ /* 17 */
1134
+ /***/
1135
+ function(m, I, T) {
1136
+ var n = T(4);
1137
+ function e(t, r) {
1138
+ this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1139
+ }
1140
+ e.prototype.getWorldOrgX = function() {
1141
+ return this.lworldOrgX;
1142
+ }, e.prototype.setWorldOrgX = function(t) {
1143
+ this.lworldOrgX = t;
1144
+ }, e.prototype.getWorldOrgY = function() {
1145
+ return this.lworldOrgY;
1146
+ }, e.prototype.setWorldOrgY = function(t) {
1147
+ this.lworldOrgY = t;
1148
+ }, e.prototype.getWorldExtX = function() {
1149
+ return this.lworldExtX;
1150
+ }, e.prototype.setWorldExtX = function(t) {
1151
+ this.lworldExtX = t;
1152
+ }, e.prototype.getWorldExtY = function() {
1153
+ return this.lworldExtY;
1154
+ }, e.prototype.setWorldExtY = function(t) {
1155
+ this.lworldExtY = t;
1156
+ }, e.prototype.getDeviceOrgX = function() {
1157
+ return this.ldeviceOrgX;
1158
+ }, e.prototype.setDeviceOrgX = function(t) {
1159
+ this.ldeviceOrgX = t;
1160
+ }, e.prototype.getDeviceOrgY = function() {
1161
+ return this.ldeviceOrgY;
1162
+ }, e.prototype.setDeviceOrgY = function(t) {
1163
+ this.ldeviceOrgY = t;
1164
+ }, e.prototype.getDeviceExtX = function() {
1165
+ return this.ldeviceExtX;
1166
+ }, e.prototype.setDeviceExtX = function(t) {
1167
+ this.ldeviceExtX = t;
1168
+ }, e.prototype.getDeviceExtY = function() {
1169
+ return this.ldeviceExtY;
1170
+ }, e.prototype.setDeviceExtY = function(t) {
1171
+ this.ldeviceExtY = t;
1172
+ }, e.prototype.transformX = function(t) {
1173
+ var r = 0, h = this.lworldExtX;
1174
+ return h != 0 && (r = this.ldeviceOrgX + (t - this.lworldOrgX) * this.ldeviceExtX / h), r;
1175
+ }, e.prototype.transformY = function(t) {
1176
+ var r = 0, h = this.lworldExtY;
1177
+ return h != 0 && (r = this.ldeviceOrgY + (t - this.lworldOrgY) * this.ldeviceExtY / h), r;
1178
+ }, e.prototype.inverseTransformX = function(t) {
1179
+ var r = 0, h = this.ldeviceExtX;
1180
+ return h != 0 && (r = this.lworldOrgX + (t - this.ldeviceOrgX) * this.lworldExtX / h), r;
1181
+ }, e.prototype.inverseTransformY = function(t) {
1182
+ var r = 0, h = this.ldeviceExtY;
1183
+ return h != 0 && (r = this.lworldOrgY + (t - this.ldeviceOrgY) * this.lworldExtY / h), r;
1184
+ }, e.prototype.inverseTransformPoint = function(t) {
1185
+ var r = new n(this.inverseTransformX(t.x), this.inverseTransformY(t.y));
1186
+ return r;
1187
+ }, m.exports = e;
1188
+ },
1189
+ /* 18 */
1190
+ /***/
1191
+ function(m, I, T) {
1192
+ function n(i) {
1193
+ if (Array.isArray(i)) {
1194
+ for (var g = 0, l = Array(i.length); g < i.length; g++)
1195
+ l[g] = i[g];
1196
+ return l;
1197
+ } else
1198
+ return Array.from(i);
1199
+ }
1200
+ var e = T(15), t = T(7), r = T(0), h = T(8), a = T(9);
1201
+ function o() {
1202
+ e.call(this), this.useSmartIdealEdgeLengthCalculation = t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = t.DEFAULT_EDGE_LENGTH, this.springConstant = t.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = t.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = t.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = t.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * t.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = t.MAX_ITERATIONS;
1203
+ }
1204
+ o.prototype = Object.create(e.prototype);
1205
+ for (var p in e)
1206
+ o[p] = e[p];
1207
+ o.prototype.initParameters = function() {
1208
+ e.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1209
+ }, o.prototype.calcIdealEdgeLengths = function() {
1210
+ for (var i, g, l, f, E, y, d = this.getGraphManager().getAllEdges(), N = 0; N < d.length; N++)
1211
+ i = d[N], i.idealLength = this.idealEdgeLength, i.isInterGraph && (l = i.getSource(), f = i.getTarget(), E = i.getSourceInLca().getEstimatedSize(), y = i.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (i.idealLength += E + y - 2 * r.SIMPLE_NODE_SIZE), g = i.getLca().getInclusionTreeDepth(), i.idealLength += t.DEFAULT_EDGE_LENGTH * t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (l.getInclusionTreeDepth() + f.getInclusionTreeDepth() - 2 * g));
1212
+ }, o.prototype.initSpringEmbedder = function() {
1213
+ var i = this.getAllNodes().length;
1214
+ this.incremental ? (i > t.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * t.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (i - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - t.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (i > t.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(t.COOLING_ADAPTATION_FACTOR, 1 - (i - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * (1 - t.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1215
+ }, o.prototype.calcSpringForces = function() {
1216
+ for (var i = this.getAllEdges(), g, l = 0; l < i.length; l++)
1217
+ g = i[l], this.calcSpringForce(g, g.idealLength);
1218
+ }, o.prototype.calcRepulsionForces = function() {
1219
+ var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, l, f, E, y, d = this.getAllNodes(), N;
1220
+ if (this.useFRGridVariant)
1221
+ for (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && i && this.updateGrid(), N = /* @__PURE__ */ new Set(), l = 0; l < d.length; l++)
1222
+ E = d[l], this.calculateRepulsionForceOfANode(E, N, i, g), N.add(E);
1223
+ else
1224
+ for (l = 0; l < d.length; l++)
1225
+ for (E = d[l], f = l + 1; f < d.length; f++)
1226
+ y = d[f], E.getOwner() == y.getOwner() && this.calcRepulsionForce(E, y);
1227
+ }, o.prototype.calcGravitationalForces = function() {
1228
+ for (var i, g = this.getAllNodesToApplyGravitation(), l = 0; l < g.length; l++)
1229
+ i = g[l], this.calcGravitationalForce(i);
1230
+ }, o.prototype.moveNodes = function() {
1231
+ for (var i = this.getAllNodes(), g, l = 0; l < i.length; l++)
1232
+ g = i[l], g.move();
1233
+ }, o.prototype.calcSpringForce = function(i, g) {
1234
+ var l = i.getSource(), f = i.getTarget(), E, y, d, N;
1235
+ if (this.uniformLeafNodeSizes && l.getChild() == null && f.getChild() == null)
1236
+ i.updateLengthSimple();
1237
+ else if (i.updateLength(), i.isOverlapingSourceAndTarget)
1238
+ return;
1239
+ E = i.getLength(), E != 0 && (y = this.springConstant * (E - g), d = y * (i.lengthX / E), N = y * (i.lengthY / E), l.springForceX += d, l.springForceY += N, f.springForceX -= d, f.springForceY -= N);
1240
+ }, o.prototype.calcRepulsionForce = function(i, g) {
1241
+ var l = i.getRect(), f = g.getRect(), E = new Array(2), y = new Array(4), d, N, v, L, s, u, c;
1242
+ if (l.intersects(f)) {
1243
+ h.calcSeparationAmount(l, f, E, t.DEFAULT_EDGE_LENGTH / 2), u = 2 * E[0], c = 2 * E[1];
1244
+ var A = i.noOfChildren * g.noOfChildren / (i.noOfChildren + g.noOfChildren);
1245
+ i.repulsionForceX -= A * u, i.repulsionForceY -= A * c, g.repulsionForceX += A * u, g.repulsionForceY += A * c;
1246
+ } else
1247
+ this.uniformLeafNodeSizes && i.getChild() == null && g.getChild() == null ? (d = f.getCenterX() - l.getCenterX(), N = f.getCenterY() - l.getCenterY()) : (h.getIntersection(l, f, y), d = y[2] - y[0], N = y[3] - y[1]), Math.abs(d) < t.MIN_REPULSION_DIST && (d = a.sign(d) * t.MIN_REPULSION_DIST), Math.abs(N) < t.MIN_REPULSION_DIST && (N = a.sign(N) * t.MIN_REPULSION_DIST), v = d * d + N * N, L = Math.sqrt(v), s = this.repulsionConstant * i.noOfChildren * g.noOfChildren / v, u = s * d / L, c = s * N / L, i.repulsionForceX -= u, i.repulsionForceY -= c, g.repulsionForceX += u, g.repulsionForceY += c;
1248
+ }, o.prototype.calcGravitationalForce = function(i) {
1249
+ var g, l, f, E, y, d, N, v;
1250
+ g = i.getOwner(), l = (g.getRight() + g.getLeft()) / 2, f = (g.getTop() + g.getBottom()) / 2, E = i.getCenterX() - l, y = i.getCenterY() - f, d = Math.abs(E) + i.getWidth() / 2, N = Math.abs(y) + i.getHeight() / 2, i.getOwner() == this.graphManager.getRoot() ? (v = g.getEstimatedSize() * this.gravityRangeFactor, (d > v || N > v) && (i.gravitationForceX = -this.gravityConstant * E, i.gravitationForceY = -this.gravityConstant * y)) : (v = g.getEstimatedSize() * this.compoundGravityRangeFactor, (d > v || N > v) && (i.gravitationForceX = -this.gravityConstant * E * this.compoundGravityConstant, i.gravitationForceY = -this.gravityConstant * y * this.compoundGravityConstant));
1251
+ }, o.prototype.isConverged = function() {
1252
+ var i, g = !1;
1253
+ return this.totalIterations > this.maxIterations / 3 && (g = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), i = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, i || g;
1254
+ }, o.prototype.animate = function() {
1255
+ this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1256
+ }, o.prototype.calcNoOfChildrenForAllNodes = function() {
1257
+ for (var i, g = this.graphManager.getAllNodes(), l = 0; l < g.length; l++)
1258
+ i = g[l], i.noOfChildren = i.getNoOfChildren();
1259
+ }, o.prototype.calcGrid = function(i) {
1260
+ var g = 0, l = 0;
1261
+ g = parseInt(Math.ceil((i.getRight() - i.getLeft()) / this.repulsionRange)), l = parseInt(Math.ceil((i.getBottom() - i.getTop()) / this.repulsionRange));
1262
+ for (var f = new Array(g), E = 0; E < g; E++)
1263
+ f[E] = new Array(l);
1264
+ for (var E = 0; E < g; E++)
1265
+ for (var y = 0; y < l; y++)
1266
+ f[E][y] = new Array();
1267
+ return f;
1268
+ }, o.prototype.addNodeToGrid = function(i, g, l) {
1269
+ var f = 0, E = 0, y = 0, d = 0;
1270
+ f = parseInt(Math.floor((i.getRect().x - g) / this.repulsionRange)), E = parseInt(Math.floor((i.getRect().width + i.getRect().x - g) / this.repulsionRange)), y = parseInt(Math.floor((i.getRect().y - l) / this.repulsionRange)), d = parseInt(Math.floor((i.getRect().height + i.getRect().y - l) / this.repulsionRange));
1271
+ for (var N = f; N <= E; N++)
1272
+ for (var v = y; v <= d; v++)
1273
+ this.grid[N][v].push(i), i.setGridCoordinates(f, E, y, d);
1274
+ }, o.prototype.updateGrid = function() {
1275
+ var i, g, l = this.getAllNodes();
1276
+ for (this.grid = this.calcGrid(this.graphManager.getRoot()), i = 0; i < l.length; i++)
1277
+ g = l[i], this.addNodeToGrid(g, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1278
+ }, o.prototype.calculateRepulsionForceOfANode = function(i, g, l, f) {
1279
+ if (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && l || f) {
1280
+ var E = /* @__PURE__ */ new Set();
1281
+ i.surrounding = new Array();
1282
+ for (var y, d = this.grid, N = i.startX - 1; N < i.finishX + 2; N++)
1283
+ for (var v = i.startY - 1; v < i.finishY + 2; v++)
1284
+ if (!(N < 0 || v < 0 || N >= d.length || v >= d[0].length)) {
1285
+ for (var L = 0; L < d[N][v].length; L++)
1286
+ if (y = d[N][v][L], !(i.getOwner() != y.getOwner() || i == y) && !g.has(y) && !E.has(y)) {
1287
+ var s = Math.abs(i.getCenterX() - y.getCenterX()) - (i.getWidth() / 2 + y.getWidth() / 2), u = Math.abs(i.getCenterY() - y.getCenterY()) - (i.getHeight() / 2 + y.getHeight() / 2);
1288
+ s <= this.repulsionRange && u <= this.repulsionRange && E.add(y);
1289
+ }
1290
+ }
1291
+ i.surrounding = [].concat(n(E));
1292
+ }
1293
+ for (N = 0; N < i.surrounding.length; N++)
1294
+ this.calcRepulsionForce(i, i.surrounding[N]);
1295
+ }, o.prototype.calcRepulsionRange = function() {
1296
+ return 0;
1297
+ }, m.exports = o;
1298
+ },
1299
+ /* 19 */
1300
+ /***/
1301
+ function(m, I, T) {
1302
+ var n = T(1), e = T(7);
1303
+ function t(h, a, o) {
1304
+ n.call(this, h, a, o), this.idealLength = e.DEFAULT_EDGE_LENGTH;
1305
+ }
1306
+ t.prototype = Object.create(n.prototype);
1307
+ for (var r in n)
1308
+ t[r] = n[r];
1309
+ m.exports = t;
1310
+ },
1311
+ /* 20 */
1312
+ /***/
1313
+ function(m, I, T) {
1314
+ var n = T(3);
1315
+ function e(r, h, a, o) {
1316
+ n.call(this, r, h, a, o), 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 = [];
1317
+ }
1318
+ e.prototype = Object.create(n.prototype);
1319
+ for (var t in n)
1320
+ e[t] = n[t];
1321
+ e.prototype.setGridCoordinates = function(r, h, a, o) {
1322
+ this.startX = r, this.finishX = h, this.startY = a, this.finishY = o;
1323
+ }, m.exports = e;
1324
+ },
1325
+ /* 21 */
1326
+ /***/
1327
+ function(m, I, T) {
1328
+ function n(e, t) {
1329
+ this.width = 0, this.height = 0, e !== null && t !== null && (this.height = t, this.width = e);
1330
+ }
1331
+ n.prototype.getWidth = function() {
1332
+ return this.width;
1333
+ }, n.prototype.setWidth = function(e) {
1334
+ this.width = e;
1335
+ }, n.prototype.getHeight = function() {
1336
+ return this.height;
1337
+ }, n.prototype.setHeight = function(e) {
1338
+ this.height = e;
1339
+ }, m.exports = n;
1340
+ },
1341
+ /* 22 */
1342
+ /***/
1343
+ function(m, I, T) {
1344
+ var n = T(14);
1345
+ function e() {
1346
+ this.map = {}, this.keys = [];
1347
+ }
1348
+ e.prototype.put = function(t, r) {
1349
+ var h = n.createID(t);
1350
+ this.contains(h) || (this.map[h] = r, this.keys.push(t));
1351
+ }, e.prototype.contains = function(t) {
1352
+ return n.createID(t), this.map[t] != null;
1353
+ }, e.prototype.get = function(t) {
1354
+ var r = n.createID(t);
1355
+ return this.map[r];
1356
+ }, e.prototype.keySet = function() {
1357
+ return this.keys;
1358
+ }, m.exports = e;
1359
+ },
1360
+ /* 23 */
1361
+ /***/
1362
+ function(m, I, T) {
1363
+ var n = T(14);
1364
+ function e() {
1365
+ this.set = {};
1366
+ }
1367
+ e.prototype.add = function(t) {
1368
+ var r = n.createID(t);
1369
+ this.contains(r) || (this.set[r] = t);
1370
+ }, e.prototype.remove = function(t) {
1371
+ delete this.set[n.createID(t)];
1372
+ }, e.prototype.clear = function() {
1373
+ this.set = {};
1374
+ }, e.prototype.contains = function(t) {
1375
+ return this.set[n.createID(t)] == t;
1376
+ }, e.prototype.isEmpty = function() {
1377
+ return this.size() === 0;
1378
+ }, e.prototype.size = function() {
1379
+ return Object.keys(this.set).length;
1380
+ }, e.prototype.addAllTo = function(t) {
1381
+ for (var r = Object.keys(this.set), h = r.length, a = 0; a < h; a++)
1382
+ t.push(this.set[r[a]]);
1383
+ }, e.prototype.size = function() {
1384
+ return Object.keys(this.set).length;
1385
+ }, e.prototype.addAll = function(t) {
1386
+ for (var r = t.length, h = 0; h < r; h++) {
1387
+ var a = t[h];
1388
+ this.add(a);
1389
+ }
1390
+ }, m.exports = e;
1391
+ },
1392
+ /* 24 */
1393
+ /***/
1394
+ function(m, I, T) {
1395
+ var n = /* @__PURE__ */ function() {
1396
+ function h(a, o) {
1397
+ for (var p = 0; p < o.length; p++) {
1398
+ var i = o[p];
1399
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(a, i.key, i);
1400
+ }
1401
+ }
1402
+ return function(a, o, p) {
1403
+ return o && h(a.prototype, o), p && h(a, p), a;
1404
+ };
1405
+ }();
1406
+ function e(h, a) {
1407
+ if (!(h instanceof a))
1408
+ throw new TypeError("Cannot call a class as a function");
1409
+ }
1410
+ var t = T(11), r = function() {
1411
+ function h(a, o) {
1412
+ e(this, h), (o !== null || o !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1413
+ var p = void 0;
1414
+ a instanceof t ? p = a.size() : p = a.length, this._quicksort(a, 0, p - 1);
1415
+ }
1416
+ return n(h, [{
1417
+ key: "_quicksort",
1418
+ value: function(a, o, p) {
1419
+ if (o < p) {
1420
+ var i = this._partition(a, o, p);
1421
+ this._quicksort(a, o, i), this._quicksort(a, i + 1, p);
1422
+ }
1423
+ }
1424
+ }, {
1425
+ key: "_partition",
1426
+ value: function(a, o, p) {
1427
+ for (var i = this._get(a, o), g = o, l = p; ; ) {
1428
+ for (; this.compareFunction(i, this._get(a, l)); )
1429
+ l--;
1430
+ for (; this.compareFunction(this._get(a, g), i); )
1431
+ g++;
1432
+ if (g < l)
1433
+ this._swap(a, g, l), g++, l--;
1434
+ else return l;
1435
+ }
1436
+ }
1437
+ }, {
1438
+ key: "_get",
1439
+ value: function(a, o) {
1440
+ return a instanceof t ? a.get_object_at(o) : a[o];
1441
+ }
1442
+ }, {
1443
+ key: "_set",
1444
+ value: function(a, o, p) {
1445
+ a instanceof t ? a.set_object_at(o, p) : a[o] = p;
1446
+ }
1447
+ }, {
1448
+ key: "_swap",
1449
+ value: function(a, o, p) {
1450
+ var i = this._get(a, o);
1451
+ this._set(a, o, this._get(a, p)), this._set(a, p, i);
1452
+ }
1453
+ }, {
1454
+ key: "_defaultCompareFunction",
1455
+ value: function(a, o) {
1456
+ return o > a;
1457
+ }
1458
+ }]), h;
1459
+ }();
1460
+ m.exports = r;
1461
+ },
1462
+ /* 25 */
1463
+ /***/
1464
+ function(m, I, T) {
1465
+ var n = /* @__PURE__ */ function() {
1466
+ function r(h, a) {
1467
+ for (var o = 0; o < a.length; o++) {
1468
+ var p = a[o];
1469
+ p.enumerable = p.enumerable || !1, p.configurable = !0, "value" in p && (p.writable = !0), Object.defineProperty(h, p.key, p);
1470
+ }
1471
+ }
1472
+ return function(h, a, o) {
1473
+ return a && r(h.prototype, a), o && r(h, o), h;
1474
+ };
1475
+ }();
1476
+ function e(r, h) {
1477
+ if (!(r instanceof h))
1478
+ throw new TypeError("Cannot call a class as a function");
1479
+ }
1480
+ var t = function() {
1481
+ function r(h, a) {
1482
+ var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, p = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1483
+ e(this, r), this.sequence1 = h, this.sequence2 = a, this.match_score = o, this.mismatch_penalty = p, this.gap_penalty = i, this.iMax = h.length + 1, this.jMax = a.length + 1, this.grid = new Array(this.iMax);
1484
+ for (var g = 0; g < this.iMax; g++) {
1485
+ this.grid[g] = new Array(this.jMax);
1486
+ for (var l = 0; l < this.jMax; l++)
1487
+ this.grid[g][l] = 0;
1488
+ }
1489
+ this.tracebackGrid = new Array(this.iMax);
1490
+ for (var f = 0; f < this.iMax; f++) {
1491
+ this.tracebackGrid[f] = new Array(this.jMax);
1492
+ for (var E = 0; E < this.jMax; E++)
1493
+ this.tracebackGrid[f][E] = [null, null, null];
1494
+ }
1495
+ this.alignments = [], this.score = -1, this.computeGrids();
1496
+ }
1497
+ return n(r, [{
1498
+ key: "getScore",
1499
+ value: function() {
1500
+ return this.score;
1501
+ }
1502
+ }, {
1503
+ key: "getAlignments",
1504
+ value: function() {
1505
+ return this.alignments;
1506
+ }
1507
+ // Main dynamic programming procedure
1508
+ }, {
1509
+ key: "computeGrids",
1510
+ value: function() {
1511
+ for (var h = 1; h < this.jMax; h++)
1512
+ this.grid[0][h] = this.grid[0][h - 1] + this.gap_penalty, this.tracebackGrid[0][h] = [!1, !1, !0];
1513
+ for (var a = 1; a < this.iMax; a++)
1514
+ this.grid[a][0] = this.grid[a - 1][0] + this.gap_penalty, this.tracebackGrid[a][0] = [!1, !0, !1];
1515
+ for (var o = 1; o < this.iMax; o++)
1516
+ for (var p = 1; p < this.jMax; p++) {
1517
+ var i = void 0;
1518
+ this.sequence1[o - 1] === this.sequence2[p - 1] ? i = this.grid[o - 1][p - 1] + this.match_score : i = this.grid[o - 1][p - 1] + this.mismatch_penalty;
1519
+ var g = this.grid[o - 1][p] + this.gap_penalty, l = this.grid[o][p - 1] + this.gap_penalty, f = [i, g, l], E = this.arrayAllMaxIndexes(f);
1520
+ this.grid[o][p] = f[E[0]], this.tracebackGrid[o][p] = [E.includes(0), E.includes(1), E.includes(2)];
1521
+ }
1522
+ this.score = this.grid[this.iMax - 1][this.jMax - 1];
1523
+ }
1524
+ // Gets all possible valid sequence combinations
1525
+ }, {
1526
+ key: "alignmentTraceback",
1527
+ value: function() {
1528
+ var h = [];
1529
+ for (h.push({
1530
+ pos: [this.sequence1.length, this.sequence2.length],
1531
+ seq1: "",
1532
+ seq2: ""
1533
+ }); h[0]; ) {
1534
+ var a = h[0], o = this.tracebackGrid[a.pos[0]][a.pos[1]];
1535
+ o[0] && h.push({
1536
+ pos: [a.pos[0] - 1, a.pos[1] - 1],
1537
+ seq1: this.sequence1[a.pos[0] - 1] + a.seq1,
1538
+ seq2: this.sequence2[a.pos[1] - 1] + a.seq2
1539
+ }), o[1] && h.push({
1540
+ pos: [a.pos[0] - 1, a.pos[1]],
1541
+ seq1: this.sequence1[a.pos[0] - 1] + a.seq1,
1542
+ seq2: "-" + a.seq2
1543
+ }), o[2] && h.push({
1544
+ pos: [a.pos[0], a.pos[1] - 1],
1545
+ seq1: "-" + a.seq1,
1546
+ seq2: this.sequence2[a.pos[1] - 1] + a.seq2
1547
+ }), a.pos[0] === 0 && a.pos[1] === 0 && this.alignments.push({
1548
+ sequence1: a.seq1,
1549
+ sequence2: a.seq2
1550
+ }), h.shift();
1551
+ }
1552
+ return this.alignments;
1553
+ }
1554
+ // Helper Functions
1555
+ }, {
1556
+ key: "getAllIndexes",
1557
+ value: function(h, a) {
1558
+ for (var o = [], p = -1; (p = h.indexOf(a, p + 1)) !== -1; )
1559
+ o.push(p);
1560
+ return o;
1561
+ }
1562
+ }, {
1563
+ key: "arrayAllMaxIndexes",
1564
+ value: function(h) {
1565
+ return this.getAllIndexes(h, Math.max.apply(null, h));
1566
+ }
1567
+ }]), r;
1568
+ }();
1569
+ m.exports = t;
1570
+ },
1571
+ /* 26 */
1572
+ /***/
1573
+ function(m, I, T) {
1574
+ var n = function() {
1575
+ };
1576
+ n.FDLayout = T(18), n.FDLayoutConstants = T(7), n.FDLayoutEdge = T(19), n.FDLayoutNode = T(20), n.DimensionD = T(21), n.HashMap = T(22), n.HashSet = T(23), n.IGeometry = T(8), n.IMath = T(9), n.Integer = T(10), n.Point = T(12), n.PointD = T(4), n.RandomSeed = T(16), n.RectangleD = T(13), n.Transform = T(17), n.UniqueIDGeneretor = T(14), n.Quicksort = T(24), n.LinkedList = T(11), n.LGraphObject = T(2), n.LGraph = T(5), n.LEdge = T(1), n.LGraphManager = T(6), n.LNode = T(3), n.Layout = T(15), n.LayoutConstants = T(0), n.NeedlemanWunsch = T(25), m.exports = n;
1577
+ },
1578
+ /* 27 */
1579
+ /***/
1580
+ function(m, I, T) {
1581
+ function n() {
1582
+ this.listeners = [];
1583
+ }
1584
+ var e = n.prototype;
1585
+ e.addListener = function(t, r) {
1586
+ this.listeners.push({
1587
+ event: t,
1588
+ callback: r
1589
+ });
1590
+ }, e.removeListener = function(t, r) {
1591
+ for (var h = this.listeners.length; h >= 0; h--) {
1592
+ var a = this.listeners[h];
1593
+ a.event === t && a.callback === r && this.listeners.splice(h, 1);
1594
+ }
1595
+ }, e.emit = function(t, r) {
1596
+ for (var h = 0; h < this.listeners.length; h++) {
1597
+ var a = this.listeners[h];
1598
+ t === a.event && a.callback(r);
1599
+ }
1600
+ }, m.exports = n;
1601
+ }
1602
+ /******/
1603
+ ])
1604
+ );
1605
+ });
1606
+ }(q)), q.exports;
1607
+ }
1608
+ var dt = z.exports, K;
1609
+ function pt() {
1610
+ return K || (K = 1, function(x, X) {
1611
+ (function(m, I) {
1612
+ x.exports = I(ct());
1613
+ })(dt, function(m) {
1614
+ return (
1615
+ /******/
1616
+ function(I) {
1617
+ var T = {};
1618
+ function n(e) {
1619
+ if (T[e])
1620
+ return T[e].exports;
1621
+ var t = T[e] = {
1622
+ /******/
1623
+ i: e,
1624
+ /******/
1625
+ l: !1,
1626
+ /******/
1627
+ exports: {}
1628
+ /******/
1629
+ };
1630
+ return I[e].call(t.exports, t, t.exports, n), t.l = !0, t.exports;
1631
+ }
1632
+ return n.m = I, n.c = T, n.i = function(e) {
1633
+ return e;
1634
+ }, n.d = function(e, t, r) {
1635
+ n.o(e, t) || Object.defineProperty(e, t, {
1636
+ /******/
1637
+ configurable: !1,
1638
+ /******/
1639
+ enumerable: !0,
1640
+ /******/
1641
+ get: r
1642
+ /******/
1643
+ });
1644
+ }, n.n = function(e) {
1645
+ var t = e && e.__esModule ? (
1646
+ /******/
1647
+ function() {
1648
+ return e.default;
1649
+ }
1650
+ ) : (
1651
+ /******/
1652
+ function() {
1653
+ return e;
1654
+ }
1655
+ );
1656
+ return n.d(t, "a", t), t;
1657
+ }, n.o = function(e, t) {
1658
+ return Object.prototype.hasOwnProperty.call(e, t);
1659
+ }, n.p = "", n(n.s = 7);
1660
+ }([
1661
+ /* 0 */
1662
+ /***/
1663
+ function(I, T) {
1664
+ I.exports = m;
1665
+ },
1666
+ /* 1 */
1667
+ /***/
1668
+ function(I, T, n) {
1669
+ var e = n(0).FDLayoutConstants;
1670
+ function t() {
1671
+ }
1672
+ for (var r in e)
1673
+ t[r] = e[r];
1674
+ t.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, t.DEFAULT_RADIAL_SEPARATION = e.DEFAULT_EDGE_LENGTH, t.DEFAULT_COMPONENT_SEPERATION = 60, t.TILE = !0, t.TILING_PADDING_VERTICAL = 10, t.TILING_PADDING_HORIZONTAL = 10, t.TREE_REDUCTION_ON_INCREMENTAL = !1, I.exports = t;
1675
+ },
1676
+ /* 2 */
1677
+ /***/
1678
+ function(I, T, n) {
1679
+ var e = n(0).FDLayoutEdge;
1680
+ function t(h, a, o) {
1681
+ e.call(this, h, a, o);
1682
+ }
1683
+ t.prototype = Object.create(e.prototype);
1684
+ for (var r in e)
1685
+ t[r] = e[r];
1686
+ I.exports = t;
1687
+ },
1688
+ /* 3 */
1689
+ /***/
1690
+ function(I, T, n) {
1691
+ var e = n(0).LGraph;
1692
+ function t(h, a, o) {
1693
+ e.call(this, h, a, o);
1694
+ }
1695
+ t.prototype = Object.create(e.prototype);
1696
+ for (var r in e)
1697
+ t[r] = e[r];
1698
+ I.exports = t;
1699
+ },
1700
+ /* 4 */
1701
+ /***/
1702
+ function(I, T, n) {
1703
+ var e = n(0).LGraphManager;
1704
+ function t(h) {
1705
+ e.call(this, h);
1706
+ }
1707
+ t.prototype = Object.create(e.prototype);
1708
+ for (var r in e)
1709
+ t[r] = e[r];
1710
+ I.exports = t;
1711
+ },
1712
+ /* 5 */
1713
+ /***/
1714
+ function(I, T, n) {
1715
+ var e = n(0).FDLayoutNode, t = n(0).IMath;
1716
+ function r(a, o, p, i) {
1717
+ e.call(this, a, o, p, i);
1718
+ }
1719
+ r.prototype = Object.create(e.prototype);
1720
+ for (var h in e)
1721
+ r[h] = e[h];
1722
+ r.prototype.move = function() {
1723
+ var a = this.graphManager.getLayout();
1724
+ this.displacementX = a.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = a.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > a.coolingFactor * a.maxNodeDisplacement && (this.displacementX = a.coolingFactor * a.maxNodeDisplacement * t.sign(this.displacementX)), Math.abs(this.displacementY) > a.coolingFactor * a.maxNodeDisplacement && (this.displacementY = a.coolingFactor * a.maxNodeDisplacement * t.sign(this.displacementY)), this.child == null ? this.moveBy(this.displacementX, this.displacementY) : this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), a.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;
1725
+ }, r.prototype.propogateDisplacementToChildren = function(a, o) {
1726
+ for (var p = this.getChild().getNodes(), i, g = 0; g < p.length; g++)
1727
+ i = p[g], i.getChild() == null ? (i.moveBy(a, o), i.displacementX += a, i.displacementY += o) : i.propogateDisplacementToChildren(a, o);
1728
+ }, r.prototype.setPred1 = function(a) {
1729
+ this.pred1 = a;
1730
+ }, r.prototype.getPred1 = function() {
1731
+ return pred1;
1732
+ }, r.prototype.getPred2 = function() {
1733
+ return pred2;
1734
+ }, r.prototype.setNext = function(a) {
1735
+ this.next = a;
1736
+ }, r.prototype.getNext = function() {
1737
+ return next;
1738
+ }, r.prototype.setProcessed = function(a) {
1739
+ this.processed = a;
1740
+ }, r.prototype.isProcessed = function() {
1741
+ return processed;
1742
+ }, I.exports = r;
1743
+ },
1744
+ /* 6 */
1745
+ /***/
1746
+ function(I, T, n) {
1747
+ var e = n(0).FDLayout, t = n(4), r = n(3), h = n(5), a = n(2), o = n(1), p = n(0).FDLayoutConstants, i = n(0).LayoutConstants, g = n(0).Point, l = n(0).PointD, f = n(0).Layout, E = n(0).Integer, y = n(0).IGeometry, d = n(0).LGraph, N = n(0).Transform;
1748
+ function v() {
1749
+ e.call(this), this.toBeTiled = {};
1750
+ }
1751
+ v.prototype = Object.create(e.prototype);
1752
+ for (var L in e)
1753
+ v[L] = e[L];
1754
+ v.prototype.newGraphManager = function() {
1755
+ var s = new t(this);
1756
+ return this.graphManager = s, s;
1757
+ }, v.prototype.newGraph = function(s) {
1758
+ return new r(null, this.graphManager, s);
1759
+ }, v.prototype.newNode = function(s) {
1760
+ return new h(this.graphManager, s);
1761
+ }, v.prototype.newEdge = function(s) {
1762
+ return new a(null, null, s);
1763
+ }, v.prototype.initParameters = function() {
1764
+ e.prototype.initParameters.call(this, arguments), this.isSubLayout || (o.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = o.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = p.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = p.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = p.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = p.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = p.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / p.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = p.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
1765
+ }, v.prototype.layout = function() {
1766
+ var s = i.DEFAULT_CREATE_BENDS_AS_NEEDED;
1767
+ return s && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1768
+ }, v.prototype.classicLayout = function() {
1769
+ 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) {
1770
+ if (o.TREE_REDUCTION_ON_INCREMENTAL) {
1771
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1772
+ var s = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(A) {
1773
+ return s.has(A);
1774
+ });
1775
+ this.graphManager.setAllNodesToApplyGravitation(u);
1776
+ }
1777
+ } else {
1778
+ var c = this.getFlatForest();
1779
+ if (c.length > 0)
1780
+ this.positionNodesRadially(c);
1781
+ else {
1782
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1783
+ var s = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(O) {
1784
+ return s.has(O);
1785
+ });
1786
+ this.graphManager.setAllNodesToApplyGravitation(u), this.positionNodesRandomly();
1787
+ }
1788
+ }
1789
+ return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
1790
+ }, v.prototype.tick = function() {
1791
+ if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
1792
+ if (this.prunedNodesAll.length > 0)
1793
+ this.isTreeGrowing = !0;
1794
+ else
1795
+ return !0;
1796
+ if (this.totalIterations % p.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1797
+ if (this.isConverged())
1798
+ if (this.prunedNodesAll.length > 0)
1799
+ this.isTreeGrowing = !0;
1800
+ else
1801
+ return !0;
1802
+ 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));
1803
+ }
1804
+ if (this.isTreeGrowing) {
1805
+ if (this.growTreeIterations % 10 == 0)
1806
+ if (this.prunedNodesAll.length > 0) {
1807
+ this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1808
+ var s = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(_) {
1809
+ return s.has(_);
1810
+ });
1811
+ this.graphManager.setAllNodesToApplyGravitation(u), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = p.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1812
+ } else
1813
+ this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1814
+ this.growTreeIterations++;
1815
+ }
1816
+ if (this.isGrowthFinished) {
1817
+ if (this.isConverged())
1818
+ return !0;
1819
+ this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = p.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1820
+ }
1821
+ var c = !this.isTreeGrowing && !this.isGrowthFinished, A = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1822
+ return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(c, A), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1823
+ }, v.prototype.getPositionsData = function() {
1824
+ for (var s = this.graphManager.getAllNodes(), u = {}, c = 0; c < s.length; c++) {
1825
+ var A = s[c].rect, _ = s[c].id;
1826
+ u[_] = {
1827
+ id: _,
1828
+ x: A.getCenterX(),
1829
+ y: A.getCenterY(),
1830
+ w: A.width,
1831
+ h: A.height
1832
+ };
1833
+ }
1834
+ return u;
1835
+ }, v.prototype.runSpringEmbedder = function() {
1836
+ this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1837
+ var s = !1;
1838
+ if (p.ANIMATE === "during")
1839
+ this.emit("layoutstarted");
1840
+ else {
1841
+ for (; !s; )
1842
+ s = this.tick();
1843
+ this.graphManager.updateBounds();
1844
+ }
1845
+ }, v.prototype.calculateNodesToApplyGravitationTo = function() {
1846
+ var s = [], u, c = this.graphManager.getGraphs(), A = c.length, _;
1847
+ for (_ = 0; _ < A; _++)
1848
+ u = c[_], u.updateConnected(), u.isConnected || (s = s.concat(u.getNodes()));
1849
+ return s;
1850
+ }, v.prototype.createBendpoints = function() {
1851
+ var s = [];
1852
+ s = s.concat(this.graphManager.getAllEdges());
1853
+ var u = /* @__PURE__ */ new Set(), c;
1854
+ for (c = 0; c < s.length; c++) {
1855
+ var A = s[c];
1856
+ if (!u.has(A)) {
1857
+ var _ = A.getSource(), O = A.getTarget();
1858
+ if (_ == O)
1859
+ A.getBendpoints().push(new l()), A.getBendpoints().push(new l()), this.createDummyNodesForBendpoints(A), u.add(A);
1860
+ else {
1861
+ var D = [];
1862
+ if (D = D.concat(_.getEdgeListToNode(O)), D = D.concat(O.getEdgeListToNode(_)), !u.has(D[0])) {
1863
+ if (D.length > 1) {
1864
+ var w;
1865
+ for (w = 0; w < D.length; w++) {
1866
+ var R = D[w];
1867
+ R.getBendpoints().push(new l()), this.createDummyNodesForBendpoints(R);
1868
+ }
1869
+ }
1870
+ D.forEach(function(F) {
1871
+ u.add(F);
1872
+ });
1873
+ }
1874
+ }
1875
+ }
1876
+ if (u.size == s.length)
1877
+ break;
1878
+ }
1879
+ }, v.prototype.positionNodesRadially = function(s) {
1880
+ for (var u = new g(0, 0), c = Math.ceil(Math.sqrt(s.length)), A = 0, _ = 0, O = 0, D = new l(0, 0), w = 0; w < s.length; w++) {
1881
+ w % c == 0 && (O = 0, _ = A, w != 0 && (_ += o.DEFAULT_COMPONENT_SEPERATION), A = 0);
1882
+ var R = s[w], F = f.findCenterOfTree(R);
1883
+ u.x = O, u.y = _, D = v.radialLayout(R, F, u), D.y > A && (A = Math.floor(D.y)), O = Math.floor(D.x + o.DEFAULT_COMPONENT_SEPERATION);
1884
+ }
1885
+ this.transform(new l(i.WORLD_CENTER_X - D.x / 2, i.WORLD_CENTER_Y - D.y / 2));
1886
+ }, v.radialLayout = function(s, u, c) {
1887
+ var A = Math.max(this.maxDiagonalInTree(s), o.DEFAULT_RADIAL_SEPARATION);
1888
+ v.branchRadialLayout(u, null, 0, 359, 0, A);
1889
+ var _ = d.calculateBounds(s), O = new N();
1890
+ O.setDeviceOrgX(_.getMinX()), O.setDeviceOrgY(_.getMinY()), O.setWorldOrgX(c.x), O.setWorldOrgY(c.y);
1891
+ for (var D = 0; D < s.length; D++) {
1892
+ var w = s[D];
1893
+ w.transform(O);
1894
+ }
1895
+ var R = new l(_.getMaxX(), _.getMaxY());
1896
+ return O.inverseTransformPoint(R);
1897
+ }, v.branchRadialLayout = function(s, u, c, A, _, O) {
1898
+ var D = (A - c + 1) / 2;
1899
+ D < 0 && (D += 180);
1900
+ var w = (D + c) % 360, R = w * y.TWO_PI / 360, F = _ * Math.cos(R), b = _ * Math.sin(R);
1901
+ s.setCenter(F, b);
1902
+ var C = [];
1903
+ C = C.concat(s.getEdges());
1904
+ var M = C.length;
1905
+ u != null && M--;
1906
+ for (var G = 0, P = C.length, S, U = s.getEdgesBetween(u); U.length > 1; ) {
1907
+ var Y = U[0];
1908
+ U.splice(0, 1);
1909
+ var B = C.indexOf(Y);
1910
+ B >= 0 && C.splice(B, 1), P--, M--;
1911
+ }
1912
+ u != null ? S = (C.indexOf(U[0]) + 1) % P : S = 0;
1913
+ for (var H = Math.abs(A - c) / M, k = S; G != M; k = ++k % P) {
1914
+ var Z = C[k].getOtherEnd(s);
1915
+ if (Z != u) {
1916
+ var Q = (c + G * H) % 360, ht = (Q + H) % 360;
1917
+ v.branchRadialLayout(Z, s, Q, ht, _ + O, O), G++;
1918
+ }
1919
+ }
1920
+ }, v.maxDiagonalInTree = function(s) {
1921
+ for (var u = E.MIN_VALUE, c = 0; c < s.length; c++) {
1922
+ var A = s[c], _ = A.getDiagonal();
1923
+ _ > u && (u = _);
1924
+ }
1925
+ return u;
1926
+ }, v.prototype.calcRepulsionRange = function() {
1927
+ return 2 * (this.level + 1) * this.idealEdgeLength;
1928
+ }, v.prototype.groupZeroDegreeMembers = function() {
1929
+ var s = this, u = {};
1930
+ this.memberGroups = {}, this.idToDummyNode = {};
1931
+ for (var c = [], A = this.graphManager.getAllNodes(), _ = 0; _ < A.length; _++) {
1932
+ var O = A[_], D = O.getParent();
1933
+ this.getNodeDegreeWithChildren(O) === 0 && (D.id == null || !this.getToBeTiled(D)) && c.push(O);
1934
+ }
1935
+ for (var _ = 0; _ < c.length; _++) {
1936
+ var O = c[_], w = O.getParent().id;
1937
+ typeof u[w] > "u" && (u[w] = []), u[w] = u[w].concat(O);
1938
+ }
1939
+ Object.keys(u).forEach(function(R) {
1940
+ if (u[R].length > 1) {
1941
+ var F = "DummyCompound_" + R;
1942
+ s.memberGroups[F] = u[R];
1943
+ var b = u[R][0].getParent(), C = new h(s.graphManager);
1944
+ C.id = F, C.paddingLeft = b.paddingLeft || 0, C.paddingRight = b.paddingRight || 0, C.paddingBottom = b.paddingBottom || 0, C.paddingTop = b.paddingTop || 0, s.idToDummyNode[F] = C;
1945
+ var M = s.getGraphManager().add(s.newGraph(), C), G = b.getChild();
1946
+ G.add(C);
1947
+ for (var P = 0; P < u[R].length; P++) {
1948
+ var S = u[R][P];
1949
+ G.remove(S), M.add(S);
1950
+ }
1951
+ }
1952
+ });
1953
+ }, v.prototype.clearCompounds = function() {
1954
+ var s = {}, u = {};
1955
+ this.performDFSOnCompounds();
1956
+ for (var c = 0; c < this.compoundOrder.length; c++)
1957
+ u[this.compoundOrder[c].id] = this.compoundOrder[c], s[this.compoundOrder[c].id] = [].concat(this.compoundOrder[c].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[c].getChild()), this.compoundOrder[c].child = null;
1958
+ this.graphManager.resetAllNodes(), this.tileCompoundMembers(s, u);
1959
+ }, v.prototype.clearZeroDegreeMembers = function() {
1960
+ var s = this, u = this.tiledZeroDegreePack = [];
1961
+ Object.keys(this.memberGroups).forEach(function(c) {
1962
+ var A = s.idToDummyNode[c];
1963
+ u[c] = s.tileNodes(s.memberGroups[c], A.paddingLeft + A.paddingRight), A.rect.width = u[c].width, A.rect.height = u[c].height;
1964
+ });
1965
+ }, v.prototype.repopulateCompounds = function() {
1966
+ for (var s = this.compoundOrder.length - 1; s >= 0; s--) {
1967
+ var u = this.compoundOrder[s], c = u.id, A = u.paddingLeft, _ = u.paddingTop;
1968
+ this.adjustLocations(this.tiledMemberPack[c], u.rect.x, u.rect.y, A, _);
1969
+ }
1970
+ }, v.prototype.repopulateZeroDegreeMembers = function() {
1971
+ var s = this, u = this.tiledZeroDegreePack;
1972
+ Object.keys(u).forEach(function(c) {
1973
+ var A = s.idToDummyNode[c], _ = A.paddingLeft, O = A.paddingTop;
1974
+ s.adjustLocations(u[c], A.rect.x, A.rect.y, _, O);
1975
+ });
1976
+ }, v.prototype.getToBeTiled = function(s) {
1977
+ var u = s.id;
1978
+ if (this.toBeTiled[u] != null)
1979
+ return this.toBeTiled[u];
1980
+ var c = s.getChild();
1981
+ if (c == null)
1982
+ return this.toBeTiled[u] = !1, !1;
1983
+ for (var A = c.getNodes(), _ = 0; _ < A.length; _++) {
1984
+ var O = A[_];
1985
+ if (this.getNodeDegree(O) > 0)
1986
+ return this.toBeTiled[u] = !1, !1;
1987
+ if (O.getChild() == null) {
1988
+ this.toBeTiled[O.id] = !1;
1989
+ continue;
1990
+ }
1991
+ if (!this.getToBeTiled(O))
1992
+ return this.toBeTiled[u] = !1, !1;
1993
+ }
1994
+ return this.toBeTiled[u] = !0, !0;
1995
+ }, v.prototype.getNodeDegree = function(s) {
1996
+ s.id;
1997
+ for (var u = s.getEdges(), c = 0, A = 0; A < u.length; A++) {
1998
+ var _ = u[A];
1999
+ _.getSource().id !== _.getTarget().id && (c = c + 1);
2000
+ }
2001
+ return c;
2002
+ }, v.prototype.getNodeDegreeWithChildren = function(s) {
2003
+ var u = this.getNodeDegree(s);
2004
+ if (s.getChild() == null)
2005
+ return u;
2006
+ for (var c = s.getChild().getNodes(), A = 0; A < c.length; A++) {
2007
+ var _ = c[A];
2008
+ u += this.getNodeDegreeWithChildren(_);
2009
+ }
2010
+ return u;
2011
+ }, v.prototype.performDFSOnCompounds = function() {
2012
+ this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2013
+ }, v.prototype.fillCompexOrderByDFS = function(s) {
2014
+ for (var u = 0; u < s.length; u++) {
2015
+ var c = s[u];
2016
+ c.getChild() != null && this.fillCompexOrderByDFS(c.getChild().getNodes()), this.getToBeTiled(c) && this.compoundOrder.push(c);
2017
+ }
2018
+ }, v.prototype.adjustLocations = function(s, u, c, A, _) {
2019
+ u += A, c += _;
2020
+ for (var O = u, D = 0; D < s.rows.length; D++) {
2021
+ var w = s.rows[D];
2022
+ u = O;
2023
+ for (var R = 0, F = 0; F < w.length; F++) {
2024
+ var b = w[F];
2025
+ b.rect.x = u, b.rect.y = c, u += b.rect.width + s.horizontalPadding, b.rect.height > R && (R = b.rect.height);
2026
+ }
2027
+ c += R + s.verticalPadding;
2028
+ }
2029
+ }, v.prototype.tileCompoundMembers = function(s, u) {
2030
+ var c = this;
2031
+ this.tiledMemberPack = [], Object.keys(s).forEach(function(A) {
2032
+ var _ = u[A];
2033
+ c.tiledMemberPack[A] = c.tileNodes(s[A], _.paddingLeft + _.paddingRight), _.rect.width = c.tiledMemberPack[A].width, _.rect.height = c.tiledMemberPack[A].height;
2034
+ });
2035
+ }, v.prototype.tileNodes = function(s, u) {
2036
+ var c = o.TILING_PADDING_VERTICAL, A = o.TILING_PADDING_HORIZONTAL, _ = {
2037
+ rows: [],
2038
+ rowWidth: [],
2039
+ rowHeight: [],
2040
+ width: 0,
2041
+ height: u,
2042
+ // assume minHeight equals to minWidth
2043
+ verticalPadding: c,
2044
+ horizontalPadding: A
2045
+ };
2046
+ s.sort(function(w, R) {
2047
+ return w.rect.width * w.rect.height > R.rect.width * R.rect.height ? -1 : w.rect.width * w.rect.height < R.rect.width * R.rect.height ? 1 : 0;
2048
+ });
2049
+ for (var O = 0; O < s.length; O++) {
2050
+ var D = s[O];
2051
+ _.rows.length == 0 ? this.insertNodeToRow(_, D, 0, u) : this.canAddHorizontal(_, D.rect.width, D.rect.height) ? this.insertNodeToRow(_, D, this.getShortestRowIndex(_), u) : this.insertNodeToRow(_, D, _.rows.length, u), this.shiftToLastRow(_);
2052
+ }
2053
+ return _;
2054
+ }, v.prototype.insertNodeToRow = function(s, u, c, A) {
2055
+ var _ = A;
2056
+ if (c == s.rows.length) {
2057
+ var O = [];
2058
+ s.rows.push(O), s.rowWidth.push(_), s.rowHeight.push(0);
2059
+ }
2060
+ var D = s.rowWidth[c] + u.rect.width;
2061
+ s.rows[c].length > 0 && (D += s.horizontalPadding), s.rowWidth[c] = D, s.width < D && (s.width = D);
2062
+ var w = u.rect.height;
2063
+ c > 0 && (w += s.verticalPadding);
2064
+ var R = 0;
2065
+ w > s.rowHeight[c] && (R = s.rowHeight[c], s.rowHeight[c] = w, R = s.rowHeight[c] - R), s.height += R, s.rows[c].push(u);
2066
+ }, v.prototype.getShortestRowIndex = function(s) {
2067
+ for (var u = -1, c = Number.MAX_VALUE, A = 0; A < s.rows.length; A++)
2068
+ s.rowWidth[A] < c && (u = A, c = s.rowWidth[A]);
2069
+ return u;
2070
+ }, v.prototype.getLongestRowIndex = function(s) {
2071
+ for (var u = -1, c = Number.MIN_VALUE, A = 0; A < s.rows.length; A++)
2072
+ s.rowWidth[A] > c && (u = A, c = s.rowWidth[A]);
2073
+ return u;
2074
+ }, v.prototype.canAddHorizontal = function(s, u, c) {
2075
+ var A = this.getShortestRowIndex(s);
2076
+ if (A < 0)
2077
+ return !0;
2078
+ var _ = s.rowWidth[A];
2079
+ if (_ + s.horizontalPadding + u <= s.width) return !0;
2080
+ var O = 0;
2081
+ s.rowHeight[A] < c && A > 0 && (O = c + s.verticalPadding - s.rowHeight[A]);
2082
+ var D;
2083
+ s.width - _ >= u + s.horizontalPadding ? D = (s.height + O) / (_ + u + s.horizontalPadding) : D = (s.height + O) / s.width, O = c + s.verticalPadding;
2084
+ var w;
2085
+ return s.width < u ? w = (s.height + O) / u : w = (s.height + O) / s.width, w < 1 && (w = 1 / w), D < 1 && (D = 1 / D), D < w;
2086
+ }, v.prototype.shiftToLastRow = function(s) {
2087
+ var u = this.getLongestRowIndex(s), c = s.rowWidth.length - 1, A = s.rows[u], _ = A[A.length - 1], O = _.width + s.horizontalPadding;
2088
+ if (s.width - s.rowWidth[c] > O && u != c) {
2089
+ A.splice(-1, 1), s.rows[c].push(_), s.rowWidth[u] = s.rowWidth[u] - O, s.rowWidth[c] = s.rowWidth[c] + O, s.width = s.rowWidth[instance.getLongestRowIndex(s)];
2090
+ for (var D = Number.MIN_VALUE, w = 0; w < A.length; w++)
2091
+ A[w].height > D && (D = A[w].height);
2092
+ u > 0 && (D += s.verticalPadding);
2093
+ var R = s.rowHeight[u] + s.rowHeight[c];
2094
+ s.rowHeight[u] = D, s.rowHeight[c] < _.height + s.verticalPadding && (s.rowHeight[c] = _.height + s.verticalPadding);
2095
+ var F = s.rowHeight[u] + s.rowHeight[c];
2096
+ s.height += F - R, this.shiftToLastRow(s);
2097
+ }
2098
+ }, v.prototype.tilingPreLayout = function() {
2099
+ o.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2100
+ }, v.prototype.tilingPostLayout = function() {
2101
+ o.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2102
+ }, v.prototype.reduceTrees = function() {
2103
+ for (var s = [], u = !0, c; u; ) {
2104
+ var A = this.graphManager.getAllNodes(), _ = [];
2105
+ u = !1;
2106
+ for (var O = 0; O < A.length; O++)
2107
+ c = A[O], c.getEdges().length == 1 && !c.getEdges()[0].isInterGraph && c.getChild() == null && (_.push([c, c.getEdges()[0], c.getOwner()]), u = !0);
2108
+ if (u == !0) {
2109
+ for (var D = [], w = 0; w < _.length; w++)
2110
+ _[w][0].getEdges().length == 1 && (D.push(_[w]), _[w][0].getOwner().remove(_[w][0]));
2111
+ s.push(D), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2112
+ }
2113
+ }
2114
+ this.prunedNodesAll = s;
2115
+ }, v.prototype.growTree = function(s) {
2116
+ for (var u = s.length, c = s[u - 1], A, _ = 0; _ < c.length; _++)
2117
+ A = c[_], this.findPlaceforPrunedNode(A), A[2].add(A[0]), A[2].add(A[1], A[1].source, A[1].target);
2118
+ s.splice(s.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2119
+ }, v.prototype.findPlaceforPrunedNode = function(s) {
2120
+ var u, c, A = s[0];
2121
+ A == s[1].source ? c = s[1].target : c = s[1].source;
2122
+ var _ = c.startX, O = c.finishX, D = c.startY, w = c.finishY, R = 0, F = 0, b = 0, C = 0, M = [R, b, F, C];
2123
+ if (D > 0)
2124
+ for (var G = _; G <= O; G++)
2125
+ M[0] += this.grid[G][D - 1].length + this.grid[G][D].length - 1;
2126
+ if (O < this.grid.length - 1)
2127
+ for (var G = D; G <= w; G++)
2128
+ M[1] += this.grid[O + 1][G].length + this.grid[O][G].length - 1;
2129
+ if (w < this.grid[0].length - 1)
2130
+ for (var G = _; G <= O; G++)
2131
+ M[2] += this.grid[G][w + 1].length + this.grid[G][w].length - 1;
2132
+ if (_ > 0)
2133
+ for (var G = D; G <= w; G++)
2134
+ M[3] += this.grid[_ - 1][G].length + this.grid[_][G].length - 1;
2135
+ for (var P = E.MAX_VALUE, S, U, Y = 0; Y < M.length; Y++)
2136
+ M[Y] < P ? (P = M[Y], S = 1, U = Y) : M[Y] == P && S++;
2137
+ if (S == 3 && P == 0)
2138
+ M[0] == 0 && M[1] == 0 && M[2] == 0 ? u = 1 : M[0] == 0 && M[1] == 0 && M[3] == 0 ? u = 0 : M[0] == 0 && M[2] == 0 && M[3] == 0 ? u = 3 : M[1] == 0 && M[2] == 0 && M[3] == 0 && (u = 2);
2139
+ else if (S == 2 && P == 0) {
2140
+ var B = Math.floor(Math.random() * 2);
2141
+ M[0] == 0 && M[1] == 0 ? B == 0 ? u = 0 : u = 1 : M[0] == 0 && M[2] == 0 ? B == 0 ? u = 0 : u = 2 : M[0] == 0 && M[3] == 0 ? B == 0 ? u = 0 : u = 3 : M[1] == 0 && M[2] == 0 ? B == 0 ? u = 1 : u = 2 : M[1] == 0 && M[3] == 0 ? B == 0 ? u = 1 : u = 3 : B == 0 ? u = 2 : u = 3;
2142
+ } else if (S == 4 && P == 0) {
2143
+ var B = Math.floor(Math.random() * 4);
2144
+ u = B;
2145
+ } else
2146
+ u = U;
2147
+ u == 0 ? A.setCenter(c.getCenterX(), c.getCenterY() - c.getHeight() / 2 - p.DEFAULT_EDGE_LENGTH - A.getHeight() / 2) : u == 1 ? A.setCenter(c.getCenterX() + c.getWidth() / 2 + p.DEFAULT_EDGE_LENGTH + A.getWidth() / 2, c.getCenterY()) : u == 2 ? A.setCenter(c.getCenterX(), c.getCenterY() + c.getHeight() / 2 + p.DEFAULT_EDGE_LENGTH + A.getHeight() / 2) : A.setCenter(c.getCenterX() - c.getWidth() / 2 - p.DEFAULT_EDGE_LENGTH - A.getWidth() / 2, c.getCenterY());
2148
+ }, I.exports = v;
2149
+ },
2150
+ /* 7 */
2151
+ /***/
2152
+ function(I, T, n) {
2153
+ var e = {};
2154
+ e.layoutBase = n(0), e.CoSEConstants = n(1), e.CoSEEdge = n(2), e.CoSEGraph = n(3), e.CoSEGraphManager = n(4), e.CoSELayout = n(6), e.CoSENode = n(5), I.exports = e;
2155
+ }
2156
+ /******/
2157
+ ])
2158
+ );
2159
+ });
2160
+ }(z)), z.exports;
2161
+ }
2162
+ var ft = V.exports, J;
2163
+ function yt() {
2164
+ return J || (J = 1, function(x, X) {
2165
+ (function(m, I) {
2166
+ x.exports = I(pt());
2167
+ })(ft, function(m) {
2168
+ return (
2169
+ /******/
2170
+ function(I) {
2171
+ var T = {};
2172
+ function n(e) {
2173
+ if (T[e])
2174
+ return T[e].exports;
2175
+ var t = T[e] = {
2176
+ /******/
2177
+ i: e,
2178
+ /******/
2179
+ l: !1,
2180
+ /******/
2181
+ exports: {}
2182
+ /******/
2183
+ };
2184
+ return I[e].call(t.exports, t, t.exports, n), t.l = !0, t.exports;
2185
+ }
2186
+ return n.m = I, n.c = T, n.i = function(e) {
2187
+ return e;
2188
+ }, n.d = function(e, t, r) {
2189
+ n.o(e, t) || Object.defineProperty(e, t, {
2190
+ /******/
2191
+ configurable: !1,
2192
+ /******/
2193
+ enumerable: !0,
2194
+ /******/
2195
+ get: r
2196
+ /******/
2197
+ });
2198
+ }, n.n = function(e) {
2199
+ var t = e && e.__esModule ? (
2200
+ /******/
2201
+ function() {
2202
+ return e.default;
2203
+ }
2204
+ ) : (
2205
+ /******/
2206
+ function() {
2207
+ return e;
2208
+ }
2209
+ );
2210
+ return n.d(t, "a", t), t;
2211
+ }, n.o = function(e, t) {
2212
+ return Object.prototype.hasOwnProperty.call(e, t);
2213
+ }, n.p = "", n(n.s = 1);
2214
+ }([
2215
+ /* 0 */
2216
+ /***/
2217
+ function(I, T) {
2218
+ I.exports = m;
2219
+ },
2220
+ /* 1 */
2221
+ /***/
2222
+ function(I, T, n) {
2223
+ var e = n(0).layoutBase.LayoutConstants, t = n(0).layoutBase.FDLayoutConstants, r = n(0).CoSEConstants, h = n(0).CoSELayout, a = n(0).CoSENode, o = n(0).layoutBase.PointD, p = n(0).layoutBase.DimensionD, i = {
2224
+ // Called on `layoutready`
2225
+ ready: function() {
2226
+ },
2227
+ // Called on `layoutstop`
2228
+ stop: function() {
2229
+ },
2230
+ // 'draft', 'default' or 'proof"
2231
+ // - 'draft' fast cooling rate
2232
+ // - 'default' moderate cooling rate
2233
+ // - "proof" slow cooling rate
2234
+ quality: "default",
2235
+ // include labels in node dimensions
2236
+ nodeDimensionsIncludeLabels: !1,
2237
+ // number of ticks per frame; higher is faster but more jerky
2238
+ refresh: 30,
2239
+ // Whether to fit the network view after when done
2240
+ fit: !0,
2241
+ // Padding on fit
2242
+ padding: 10,
2243
+ // Whether to enable incremental mode
2244
+ randomize: !0,
2245
+ // Node repulsion (non overlapping) multiplier
2246
+ nodeRepulsion: 4500,
2247
+ // Ideal edge (non nested) length
2248
+ idealEdgeLength: 50,
2249
+ // Divisor to compute edge forces
2250
+ edgeElasticity: 0.45,
2251
+ // Nesting factor (multiplier) to compute ideal edge length for nested edges
2252
+ nestingFactor: 0.1,
2253
+ // Gravity force (constant)
2254
+ gravity: 0.25,
2255
+ // Maximum number of iterations to perform
2256
+ numIter: 2500,
2257
+ // For enabling tiling
2258
+ tile: !0,
2259
+ // Type of layout animation. The option set is {'during', 'end', false}
2260
+ animate: "end",
2261
+ // Duration for animate:end
2262
+ animationDuration: 500,
2263
+ // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
2264
+ tilingPaddingVertical: 10,
2265
+ // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
2266
+ tilingPaddingHorizontal: 10,
2267
+ // Gravity range (constant) for compounds
2268
+ gravityRangeCompound: 1.5,
2269
+ // Gravity force (constant) for compounds
2270
+ gravityCompound: 1,
2271
+ // Gravity range (constant)
2272
+ gravityRange: 3.8,
2273
+ // Initial cooling factor for incremental layout
2274
+ initialEnergyOnIncremental: 0.5
2275
+ };
2276
+ function g(y, d) {
2277
+ var N = {};
2278
+ for (var v in y)
2279
+ N[v] = y[v];
2280
+ for (var v in d)
2281
+ N[v] = d[v];
2282
+ return N;
2283
+ }
2284
+ function l(y) {
2285
+ this.options = g(i, y), f(this.options);
2286
+ }
2287
+ var f = function(y) {
2288
+ y.nodeRepulsion != null && (r.DEFAULT_REPULSION_STRENGTH = t.DEFAULT_REPULSION_STRENGTH = y.nodeRepulsion), y.idealEdgeLength != null && (r.DEFAULT_EDGE_LENGTH = t.DEFAULT_EDGE_LENGTH = y.idealEdgeLength), y.edgeElasticity != null && (r.DEFAULT_SPRING_STRENGTH = t.DEFAULT_SPRING_STRENGTH = y.edgeElasticity), y.nestingFactor != null && (r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = y.nestingFactor), y.gravity != null && (r.DEFAULT_GRAVITY_STRENGTH = t.DEFAULT_GRAVITY_STRENGTH = y.gravity), y.numIter != null && (r.MAX_ITERATIONS = t.MAX_ITERATIONS = y.numIter), y.gravityRange != null && (r.DEFAULT_GRAVITY_RANGE_FACTOR = t.DEFAULT_GRAVITY_RANGE_FACTOR = y.gravityRange), y.gravityCompound != null && (r.DEFAULT_COMPOUND_GRAVITY_STRENGTH = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH = y.gravityCompound), y.gravityRangeCompound != null && (r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = y.gravityRangeCompound), y.initialEnergyOnIncremental != null && (r.DEFAULT_COOLING_FACTOR_INCREMENTAL = t.DEFAULT_COOLING_FACTOR_INCREMENTAL = y.initialEnergyOnIncremental), y.quality == "draft" ? e.QUALITY = 0 : y.quality == "proof" ? e.QUALITY = 2 : e.QUALITY = 1, r.NODE_DIMENSIONS_INCLUDE_LABELS = t.NODE_DIMENSIONS_INCLUDE_LABELS = e.NODE_DIMENSIONS_INCLUDE_LABELS = y.nodeDimensionsIncludeLabels, r.DEFAULT_INCREMENTAL = t.DEFAULT_INCREMENTAL = e.DEFAULT_INCREMENTAL = !y.randomize, r.ANIMATE = t.ANIMATE = e.ANIMATE = y.animate, r.TILE = y.tile, r.TILING_PADDING_VERTICAL = typeof y.tilingPaddingVertical == "function" ? y.tilingPaddingVertical.call() : y.tilingPaddingVertical, r.TILING_PADDING_HORIZONTAL = typeof y.tilingPaddingHorizontal == "function" ? y.tilingPaddingHorizontal.call() : y.tilingPaddingHorizontal;
2289
+ };
2290
+ l.prototype.run = function() {
2291
+ var y, d, N = this.options;
2292
+ this.idToLNode = {};
2293
+ var v = this.layout = new h(), L = this;
2294
+ L.stopped = !1, this.cy = this.options.cy, this.cy.trigger({ type: "layoutstart", layout: this });
2295
+ var s = v.newGraphManager();
2296
+ this.gm = s;
2297
+ var u = this.options.eles.nodes(), c = this.options.eles.edges();
2298
+ this.root = s.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(u), v);
2299
+ for (var A = 0; A < c.length; A++) {
2300
+ var _ = c[A], O = this.idToLNode[_.data("source")], D = this.idToLNode[_.data("target")];
2301
+ if (O !== D && O.getEdgesBetween(D).length == 0) {
2302
+ var w = s.add(v.newEdge(), O, D);
2303
+ w.id = _.id();
2304
+ }
2305
+ }
2306
+ var R = function(b, C) {
2307
+ typeof b == "number" && (b = C);
2308
+ var M = b.data("id"), G = L.idToLNode[M];
2309
+ return {
2310
+ x: G.getRect().getCenterX(),
2311
+ y: G.getRect().getCenterY()
2312
+ };
2313
+ }, F = function b() {
2314
+ for (var C = function() {
2315
+ N.fit && N.cy.fit(N.eles, N.padding), y || (y = !0, L.cy.one("layoutready", N.ready), L.cy.trigger({ type: "layoutready", layout: L }));
2316
+ }, M = L.options.refresh, G, P = 0; P < M && !G; P++)
2317
+ G = L.stopped || L.layout.tick();
2318
+ if (G) {
2319
+ v.checkLayoutSuccess() && !v.isSubLayout && v.doPostLayout(), v.tilingPostLayout && v.tilingPostLayout(), v.isLayoutFinished = !0, L.options.eles.nodes().positions(R), C(), L.cy.one("layoutstop", L.options.stop), L.cy.trigger({ type: "layoutstop", layout: L }), d && cancelAnimationFrame(d), y = !1;
2320
+ return;
2321
+ }
2322
+ var S = L.layout.getPositionsData();
2323
+ N.eles.nodes().positions(function(U, Y) {
2324
+ if (typeof U == "number" && (U = Y), !U.isParent()) {
2325
+ for (var B = U.id(), H = S[B], k = U; H == null && (H = S[k.data("parent")] || S["DummyCompound_" + k.data("parent")], S[B] = H, k = k.parent()[0], k != null); )
2326
+ ;
2327
+ return H != null ? {
2328
+ x: H.x,
2329
+ y: H.y
2330
+ } : {
2331
+ x: U.position("x"),
2332
+ y: U.position("y")
2333
+ };
2334
+ }
2335
+ }), C(), d = requestAnimationFrame(b);
2336
+ };
2337
+ return v.addListener("layoutstarted", function() {
2338
+ L.options.animate === "during" && (d = requestAnimationFrame(F));
2339
+ }), v.runLayout(), this.options.animate !== "during" && (L.options.eles.nodes().not(":parent").layoutPositions(L, L.options, R), y = !1), this;
2340
+ }, l.prototype.getTopMostNodes = function(y) {
2341
+ for (var d = {}, N = 0; N < y.length; N++)
2342
+ d[y[N].id()] = !0;
2343
+ var v = y.filter(function(L, s) {
2344
+ typeof L == "number" && (L = s);
2345
+ for (var u = L.parent()[0]; u != null; ) {
2346
+ if (d[u.id()])
2347
+ return !1;
2348
+ u = u.parent()[0];
2349
+ }
2350
+ return !0;
2351
+ });
2352
+ return v;
2353
+ }, l.prototype.processChildrenList = function(y, d, N) {
2354
+ for (var v = d.length, L = 0; L < v; L++) {
2355
+ var s = d[L], u = s.children(), c, A = s.layoutDimensions({
2356
+ nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels
2357
+ });
2358
+ if (s.outerWidth() != null && s.outerHeight() != null ? c = y.add(new a(N.graphManager, new o(s.position("x") - A.w / 2, s.position("y") - A.h / 2), new p(parseFloat(A.w), parseFloat(A.h)))) : c = y.add(new a(this.graphManager)), c.id = s.data("id"), c.paddingLeft = parseInt(s.css("padding")), c.paddingTop = parseInt(s.css("padding")), c.paddingRight = parseInt(s.css("padding")), c.paddingBottom = parseInt(s.css("padding")), this.options.nodeDimensionsIncludeLabels && s.isParent()) {
2359
+ var _ = s.boundingBox({ includeLabels: !0, includeNodes: !1 }).w, O = s.boundingBox({ includeLabels: !0, includeNodes: !1 }).h, D = s.css("text-halign");
2360
+ c.labelWidth = _, c.labelHeight = O, c.labelPos = D;
2361
+ }
2362
+ if (this.idToLNode[s.data("id")] = c, isNaN(c.rect.x) && (c.rect.x = 0), isNaN(c.rect.y) && (c.rect.y = 0), u != null && u.length > 0) {
2363
+ var w;
2364
+ w = N.getGraphManager().add(N.newGraph(), c), this.processChildrenList(w, u, N);
2365
+ }
2366
+ }
2367
+ }, l.prototype.stop = function() {
2368
+ return this.stopped = !0, this;
2369
+ };
2370
+ var E = function(y) {
2371
+ y("layout", "cose-bilkent", l);
2372
+ };
2373
+ typeof cytoscape < "u" && E(cytoscape), I.exports = E;
2374
+ }
2375
+ /******/
2376
+ ])
2377
+ );
2378
+ });
2379
+ }(V)), V.exports;
2380
+ }
2381
+ var Et = yt();
2382
+ const vt = /* @__PURE__ */ gt(Et);
2383
+ tt.use(vt);
2384
+ function et(x, X) {
2385
+ x.forEach((m) => {
2386
+ const I = {
2387
+ id: m.id,
2388
+ labelText: m.label,
2389
+ height: m.height,
2390
+ width: m.width,
2391
+ padding: m.padding ?? 0
2392
+ };
2393
+ Object.keys(m).forEach((T) => {
2394
+ ["id", "label", "height", "width", "padding", "x", "y"].includes(T) || (I[T] = m[T]);
2395
+ }), X.add({
2396
+ group: "nodes",
2397
+ data: I,
2398
+ position: {
2399
+ x: m.x ?? 0,
2400
+ y: m.y ?? 0
2401
+ }
2402
+ });
2403
+ });
2404
+ }
2405
+ W(et, "addNodes");
2406
+ function rt(x, X) {
2407
+ x.forEach((m) => {
2408
+ const I = {
2409
+ id: m.id,
2410
+ source: m.start,
2411
+ target: m.end
2412
+ };
2413
+ Object.keys(m).forEach((T) => {
2414
+ ["id", "start", "end"].includes(T) || (I[T] = m[T]);
2415
+ }), X.add({
2416
+ group: "edges",
2417
+ data: I
2418
+ });
2419
+ });
2420
+ }
2421
+ W(rt, "addEdges");
2422
+ function it(x) {
2423
+ return new Promise((X) => {
2424
+ const m = lt("body").append("div").attr("id", "cy").attr("style", "display:none"), I = tt({
2425
+ container: document.getElementById("cy"),
2426
+ // container to render in
2427
+ style: [
2428
+ {
2429
+ selector: "edge",
2430
+ style: {
2431
+ "curve-style": "bezier"
2432
+ }
2433
+ }
2434
+ ]
2435
+ });
2436
+ m.remove(), et(x.nodes, I), rt(x.edges, I), I.nodes().forEach(function(n) {
2437
+ n.layoutDimensions = () => {
2438
+ const e = n.data();
2439
+ return { w: e.width, h: e.height };
2440
+ };
2441
+ });
2442
+ const T = {
2443
+ name: "cose-bilkent",
2444
+ // @ts-ignore Types for cose-bilkent are not correct?
2445
+ quality: "proof",
2446
+ styleEnabled: !1,
2447
+ animate: !1
2448
+ };
2449
+ I.layout(T).run(), I.ready((n) => {
2450
+ j.info("Cytoscape ready", n), X(I);
2451
+ });
2452
+ });
2453
+ }
2454
+ W(it, "createCytoscapeInstance");
2455
+ function nt(x) {
2456
+ return x.nodes().map((X) => {
2457
+ const m = X.data(), I = X.position(), T = {
2458
+ id: m.id,
2459
+ x: I.x,
2460
+ y: I.y
2461
+ };
2462
+ return Object.keys(m).forEach((n) => {
2463
+ n !== "id" && (T[n] = m[n]);
2464
+ }), T;
2465
+ });
2466
+ }
2467
+ W(nt, "extractPositionedNodes");
2468
+ function ot(x) {
2469
+ return x.edges().map((X) => {
2470
+ const m = X.data(), I = X._private.rscratch, T = {
2471
+ id: m.id,
2472
+ source: m.source,
2473
+ target: m.target,
2474
+ startX: I.startX,
2475
+ startY: I.startY,
2476
+ midX: I.midX,
2477
+ midY: I.midY,
2478
+ endX: I.endX,
2479
+ endY: I.endY
2480
+ };
2481
+ return Object.keys(m).forEach((n) => {
2482
+ ["id", "source", "target"].includes(n) || (T[n] = m[n]);
2483
+ }), T;
2484
+ });
2485
+ }
2486
+ W(ot, "extractPositionedEdges");
2487
+ async function st(x, X) {
2488
+ j.debug("Starting cose-bilkent layout algorithm");
2489
+ try {
2490
+ at(x);
2491
+ const m = await it(x), I = nt(m), T = ot(m);
2492
+ return j.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`), {
2493
+ nodes: I,
2494
+ edges: T
2495
+ };
2496
+ } catch (m) {
2497
+ throw j.error("Error in cose-bilkent layout algorithm:", m), m;
2498
+ }
2499
+ }
2500
+ W(st, "executeCoseBilkentLayout");
2501
+ function at(x) {
2502
+ if (!x)
2503
+ throw new Error("Layout data is required");
2504
+ if (!x.config)
2505
+ throw new Error("Configuration is required in layout data");
2506
+ if (!x.rootNode)
2507
+ throw new Error("Root node is required");
2508
+ if (!x.nodes || !Array.isArray(x.nodes))
2509
+ throw new Error("No nodes found in layout data");
2510
+ if (!Array.isArray(x.edges))
2511
+ throw new Error("Edges array is required in layout data");
2512
+ return !0;
2513
+ }
2514
+ W(at, "validateLayoutData");
2515
+ var At = /* @__PURE__ */ W(async (x, X, {
2516
+ insertCluster: m,
2517
+ insertEdge: I,
2518
+ insertEdgeLabel: T,
2519
+ insertMarkers: n,
2520
+ insertNode: e,
2521
+ log: t,
2522
+ positionEdgeLabel: r
2523
+ }, { algorithm: h }) => {
2524
+ const a = {}, o = {}, p = X.select("g");
2525
+ n(p, x.markers, x.type, x.diagramId);
2526
+ const i = p.insert("g").attr("class", "subgraphs"), g = p.insert("g").attr("class", "edgePaths"), l = p.insert("g").attr("class", "edgeLabels"), f = p.insert("g").attr("class", "nodes");
2527
+ t.debug("Inserting nodes into DOM for dimension calculation"), await Promise.all(
2528
+ x.nodes.map(async (d) => {
2529
+ if (d.isGroup) {
2530
+ const N = { ...d };
2531
+ o[d.id] = N, a[d.id] = N, await m(i, d);
2532
+ } else {
2533
+ const N = { ...d };
2534
+ a[d.id] = N;
2535
+ const v = await e(f, d, {
2536
+ config: x.config,
2537
+ dir: x.direction || "TB"
2538
+ }), L = v.node().getBBox();
2539
+ N.width = L.width, N.height = L.height, N.domId = v, t.debug(`Node ${d.id} dimensions: ${L.width}x${L.height}`);
2540
+ }
2541
+ })
2542
+ ), t.debug("Running cose-bilkent layout algorithm");
2543
+ const E = {
2544
+ ...x,
2545
+ nodes: x.nodes.map((d) => {
2546
+ const N = a[d.id];
2547
+ return {
2548
+ ...d,
2549
+ width: N.width,
2550
+ height: N.height
2551
+ };
2552
+ })
2553
+ }, y = await st(E, x.config);
2554
+ t.debug("Positioning nodes based on layout results"), y.nodes.forEach((d) => {
2555
+ const N = a[d.id];
2556
+ N != null && N.domId && (N.domId.attr(
2557
+ "transform",
2558
+ `translate(${d.x}, ${d.y})`
2559
+ ), N.x = d.x, N.y = d.y, t.debug(`Positioned node ${N.id} at center (${d.x}, ${d.y})`));
2560
+ }), y.edges.forEach((d) => {
2561
+ const N = x.edges.find((v) => v.id === d.id);
2562
+ N && (N.points = [
2563
+ { x: d.startX, y: d.startY },
2564
+ { x: d.midX, y: d.midY },
2565
+ { x: d.endX, y: d.endY }
2566
+ ]);
2567
+ }), t.debug("Inserting and positioning edges"), await Promise.all(
2568
+ x.edges.map(async (d) => {
2569
+ await T(l, d);
2570
+ const N = a[d.start ?? ""], v = a[d.end ?? ""];
2571
+ if (N && v) {
2572
+ const L = y.edges.find((s) => s.id === d.id);
2573
+ if (L) {
2574
+ t.debug("APA01 positionedEdge", L);
2575
+ const s = { ...d }, u = I(
2576
+ g,
2577
+ s,
2578
+ o,
2579
+ x.type,
2580
+ N,
2581
+ v,
2582
+ x.diagramId
2583
+ );
2584
+ r(s, u);
2585
+ } else {
2586
+ const s = {
2587
+ ...d,
2588
+ points: [
2589
+ { x: N.x || 0, y: N.y || 0 },
2590
+ { x: v.x || 0, y: v.y || 0 }
2591
+ ]
2592
+ }, u = I(
2593
+ g,
2594
+ s,
2595
+ o,
2596
+ x.type,
2597
+ N,
2598
+ v,
2599
+ x.diagramId
2600
+ );
2601
+ r(s, u);
2602
+ }
2603
+ }
2604
+ })
2605
+ ), t.debug("Cose-bilkent rendering completed");
2606
+ }, "render"), _t = At;
2607
+ export {
2608
+ _t as render
2609
+ };