@sourcegraph/amp 0.0.1749585689-g82b91d → 0.0.1749614780-g9a56bd

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 (61) hide show
  1. package/dist/amp.js +3 -3
  2. package/dist/architectureDiagram-RWNHDUBN-1v8WgxdD.js +4635 -0
  3. package/dist/blockDiagram-XZSR5OGQ-XFBYN-jB.js +2243 -0
  4. package/dist/c4Diagram-6R2MQUNL-B0L0pltn.js +1587 -0
  5. package/dist/chunk-COUQ6RZ3-qd4eG6tc.js +17852 -0
  6. package/dist/chunk-CRQPXCKQ-yjI467Bq.js +65 -0
  7. package/dist/chunk-EFPBJHX4-DdHmqd0M.js +1378 -0
  8. package/dist/chunk-EOAU2GW5-CpRNAcjo.js +253 -0
  9. package/dist/chunk-IHYUGLNO-DJcRQIf7.js +1365 -0
  10. package/dist/chunk-K2ZEYYM2-CbqHhUqy.js +9 -0
  11. package/dist/chunk-Q7VUVKE6-gBSSbdjU.js +24 -0
  12. package/dist/chunk-T2M37SMK-Br8mK30k.js +1411 -0
  13. package/dist/chunk-TGZYFRKZ-BYBLXoJz.js +1331 -0
  14. package/dist/chunk-YJGJQOYZ-BGiSkWF0.js +19 -0
  15. package/dist/classDiagram-LB37KKQG-DhFsEyDS.js +17 -0
  16. package/dist/classDiagram-v2-KFQJBC22-DhFsEyDS.js +17 -0
  17. package/dist/{client-C1WG2nEf.js → client-D-YAg8x6.js} +6 -6
  18. package/dist/{console-DK0gDzNQ.js → console-CoE5Qzyz.js} +41106 -22971
  19. package/dist/create_file.node-Co0Uh1F3.js +21 -0
  20. package/dist/dagre-CMTPJJKG-UDPzd9Iy.js +446 -0
  21. package/dist/diagram-BIPOGRU5-B7TV59-n.js +128 -0
  22. package/dist/diagram-YF4VECWA-LsAZsciQ.js +219 -0
  23. package/dist/{edit_file.node-BH524GkF.js → edit_file.node-CmTZeBc2.js} +11 -11
  24. package/dist/erDiagram-AK44R45H-BWpeEu7D.js +843 -0
  25. package/dist/{executable-5cBRGrsC.js → executable-BE7tfoX5.js} +1 -1
  26. package/dist/{files-CybxYgbE.js → files-DqpRf5q4.js} +10 -10
  27. package/dist/flowDiagram-XARHJDSH-DzpV02UB.js +1618 -0
  28. package/dist/ganttDiagram-H5QQZTZ5-C0BhJTzn.js +1605 -0
  29. package/dist/gitGraphDiagram-XHLTLO3W-0EiOmv44.js +701 -0
  30. package/dist/{glob.node-C6HbLuPt.js → glob.node-DNei8bFS.js} +11 -11
  31. package/dist/{index-C2wo7rRZ.js → index-BcjxaWOc.js} +31 -31
  32. package/dist/infoDiagram-TP2HPDHO-CQX5a0Fc.js +24 -0
  33. package/dist/journeyDiagram-VHRN44N3-C82dEe4G.js +809 -0
  34. package/dist/kanban-definition-K5J3OUUV-xilJcrom.js +718 -0
  35. package/dist/katex-5N2NCDMP-CAsrnb6_.js +11703 -0
  36. package/dist/{list_directory.node-ZQscizpi.js → list_directory.node-CMiNNbXP.js} +1 -1
  37. package/dist/{load-profile-BbmyxO_7.js → load-profile-Cg8XaTx6.js} +1 -1
  38. package/dist/{main-CiUaVPC2.js → main-CtwgALCc.js} +23 -16
  39. package/dist/mindmap-definition-TI5ONXTW-BNaRba4R.js +3221 -0
  40. package/dist/{node-VrazB_nQ.js → node-Bfma_T75.js} +58 -58
  41. package/dist/{node-DvmQAW7h.js → node-BtG1o_DD.js} +2 -2
  42. package/dist/{node-GgocwWwI.js → node-CZJC9BSF.js} +3 -3
  43. package/dist/{node-Cpbjmhrj.js → node-Cp3D7_hw.js} +71 -71
  44. package/dist/{node-CiFAW-F3.js → node-Ctw1i0nl.js} +12 -12
  45. package/dist/{node-CgVq0JJ9.js → node-D1zxOCuN.js} +1 -1
  46. package/dist/pieDiagram-FPR3CNQC-_30_tQz0.js +120 -0
  47. package/dist/quadrantDiagram-RLP5YTJ2-CTD43GTk.js +1028 -0
  48. package/dist/radar-MK3ICKWK-55CS4JTO-afihMdR4.js +14398 -0
  49. package/dist/{read_file.node-CIdAFiJ6.js → read_file.node-QZ0VCmB2.js} +1 -1
  50. package/dist/requirementDiagram-P5NVWGNK-Sd2_6g8e.js +853 -0
  51. package/dist/sankeyDiagram-C6NZRJHT-D1EcCYaw.js +864 -0
  52. package/dist/sequenceDiagram-6SLVIXKN-CghQTpGf.js +2283 -0
  53. package/dist/stateDiagram-WI5ZVJ5I-Bv21MlSK.js +272 -0
  54. package/dist/stateDiagram-v2-KVDSFUFK-BgP0D8xL.js +17 -0
  55. package/dist/{stdio-D9HyubOc.js → stdio-yXWLIEvb.js} +8 -8
  56. package/dist/storybook.js +7 -7
  57. package/dist/timeline-definition-65575674-BUqRZdJ-.js +800 -0
  58. package/dist/{undo_edit.node-VYuTxRwd.js → undo_edit.node-BkletvTZ.js} +5 -5
  59. package/dist/xychartDiagram-674MFTBU-DjBabATx.js +1291 -0
  60. package/package.json +1 -1
  61. package/dist/create_file.node-DtVTaHj5.js +0 -21
@@ -0,0 +1,1365 @@
1
+ #!/usr/bin/env node
2
+ import { G as y } from "./chunk-EOAU2GW5-CpRNAcjo.js";
3
+ import { f as c, p as A, d as rr, m as E, l as G, a as D, u as ae, b as m, r as _, i as g, c as C, h as xe, n as Ee, e as I, g as ie, s as tr, j as oe, k as P, v as L, o as W, z as ar, q as S, t as ir, w as or, x as dr } from "./chunk-TGZYFRKZ-BYBLXoJz.js";
4
+ import { _ as s, br as H, bs as sr, a_ as ur } from "./console-CoE5Qzyz.js";
5
+ function x(e, n, r, t) {
6
+ var a;
7
+ do
8
+ a = ae(t);
9
+ while (e.hasNode(a));
10
+ return r.dummy = n, e.setNode(a, r), a;
11
+ }
12
+ s(x, "addDummyNode");
13
+ function _e(e) {
14
+ var n = new y().setGraph(e.graph());
15
+ return c(e.nodes(), function(r) {
16
+ n.setNode(r, e.node(r));
17
+ }), c(e.edges(), function(r) {
18
+ var t = n.edge(r.v, r.w) || { weight: 0, minlen: 1 }, a = e.edge(r);
19
+ n.setEdge(r.v, r.w, {
20
+ weight: t.weight + a.weight,
21
+ minlen: Math.max(t.minlen, a.minlen)
22
+ });
23
+ }), n;
24
+ }
25
+ s(_e, "simplify");
26
+ function de(e) {
27
+ var n = new y({ multigraph: e.isMultigraph() }).setGraph(e.graph());
28
+ return c(e.nodes(), function(r) {
29
+ e.children(r).length || n.setNode(r, e.node(r));
30
+ }), c(e.edges(), function(r) {
31
+ n.setEdge(r, e.edge(r));
32
+ }), n;
33
+ }
34
+ s(de, "asNonCompoundGraph");
35
+ function U(e, n) {
36
+ var r = e.x, t = e.y, a = n.x - r, i = n.y - t, o = e.width / 2, d = e.height / 2;
37
+ if (!a && !i)
38
+ throw new Error("Not possible to find intersection inside of the rectangle");
39
+ var u, f;
40
+ return Math.abs(i) * o > Math.abs(a) * d ? (i < 0 && (d = -d), u = d * a / i, f = d) : (a < 0 && (o = -o), u = o, f = o * i / a), { x: r + u, y: t + f };
41
+ }
42
+ s(U, "intersectRect");
43
+ function T(e) {
44
+ var n = m(_(se(e) + 1), function() {
45
+ return [];
46
+ });
47
+ return c(e.nodes(), function(r) {
48
+ var t = e.node(r), a = t.rank;
49
+ g(a) || (n[a][t.order] = r);
50
+ }), n;
51
+ }
52
+ s(T, "buildLayerMatrix");
53
+ function Le(e) {
54
+ var n = C(
55
+ m(e.nodes(), function(r) {
56
+ return e.node(r).rank;
57
+ })
58
+ );
59
+ c(e.nodes(), function(r) {
60
+ var t = e.node(r);
61
+ xe(t, "rank") && (t.rank -= n);
62
+ });
63
+ }
64
+ s(Le, "normalizeRanks");
65
+ function Ne(e) {
66
+ var n = C(
67
+ m(e.nodes(), function(i) {
68
+ return e.node(i).rank;
69
+ })
70
+ ), r = [];
71
+ c(e.nodes(), function(i) {
72
+ var o = e.node(i).rank - n;
73
+ r[o] || (r[o] = []), r[o].push(i);
74
+ });
75
+ var t = 0, a = e.graph().nodeRankFactor;
76
+ c(r, function(i, o) {
77
+ g(i) && o % a !== 0 ? --t : t && c(i, function(d) {
78
+ e.node(d).rank += t;
79
+ });
80
+ });
81
+ }
82
+ s(Ne, "removeEmptyRanks");
83
+ function J(e, n, r, t) {
84
+ var a = {
85
+ width: 0,
86
+ height: 0
87
+ };
88
+ return arguments.length >= 4 && (a.rank = r, a.order = t), x(e, "border", a, n);
89
+ }
90
+ s(J, "addBorderNode");
91
+ function se(e) {
92
+ return E(
93
+ m(e.nodes(), function(n) {
94
+ var r = e.node(n).rank;
95
+ if (!g(r))
96
+ return r;
97
+ })
98
+ );
99
+ }
100
+ s(se, "maxRank");
101
+ function Oe(e, n) {
102
+ var r = { lhs: [], rhs: [] };
103
+ return c(e, function(t) {
104
+ n(t) ? r.lhs.push(t) : r.rhs.push(t);
105
+ }), r;
106
+ }
107
+ s(Oe, "partition");
108
+ function Ce(e, n) {
109
+ var r = Ee();
110
+ try {
111
+ return n();
112
+ } finally {
113
+ console.log(e + " time: " + (Ee() - r) + "ms");
114
+ }
115
+ }
116
+ s(Ce, "time");
117
+ function Re(e, n) {
118
+ return n();
119
+ }
120
+ s(Re, "notime");
121
+ function Ie(e) {
122
+ function n(r) {
123
+ var t = e.children(r), a = e.node(r);
124
+ if (t.length && c(t, n), Object.prototype.hasOwnProperty.call(a, "minRank")) {
125
+ a.borderLeft = [], a.borderRight = [];
126
+ for (var i = a.minRank, o = a.maxRank + 1; i < o; ++i)
127
+ K(e, "borderLeft", "_bl", r, a, i), K(e, "borderRight", "_br", r, a, i);
128
+ }
129
+ }
130
+ s(n, "dfs"), c(e.children(), n);
131
+ }
132
+ s(Ie, "addBorderSegments");
133
+ function K(e, n, r, t, a, i) {
134
+ var o = { width: 0, height: 0, rank: i, borderType: n }, d = a[n][i - 1], u = x(e, "border", o, r);
135
+ a[n][i] = u, e.setParent(u, t), d && e.setEdge(d, u, { weight: 1 });
136
+ }
137
+ s(K, "addBorderNode");
138
+ function Pe(e) {
139
+ var n = e.graph().rankdir.toLowerCase();
140
+ (n === "lr" || n === "rl") && ue(e);
141
+ }
142
+ s(Pe, "adjust");
143
+ function Se(e) {
144
+ var n = e.graph().rankdir.toLowerCase();
145
+ (n === "bt" || n === "rl") && Te(e), (n === "lr" || n === "rl") && (je(e), ue(e));
146
+ }
147
+ s(Se, "undo");
148
+ function ue(e) {
149
+ c(e.nodes(), function(n) {
150
+ Q(e.node(n));
151
+ }), c(e.edges(), function(n) {
152
+ Q(e.edge(n));
153
+ });
154
+ }
155
+ s(ue, "swapWidthHeight");
156
+ function Q(e) {
157
+ var n = e.width;
158
+ e.width = e.height, e.height = n;
159
+ }
160
+ s(Q, "swapWidthHeightOne");
161
+ function Te(e) {
162
+ c(e.nodes(), function(n) {
163
+ j(e.node(n));
164
+ }), c(e.edges(), function(n) {
165
+ var r = e.edge(n);
166
+ c(r.points, j), Object.prototype.hasOwnProperty.call(r, "y") && j(r);
167
+ });
168
+ }
169
+ s(Te, "reverseY");
170
+ function j(e) {
171
+ e.y = -e.y;
172
+ }
173
+ s(j, "reverseYOne");
174
+ function je(e) {
175
+ c(e.nodes(), function(n) {
176
+ M(e.node(n));
177
+ }), c(e.edges(), function(n) {
178
+ var r = e.edge(n);
179
+ c(r.points, M), Object.prototype.hasOwnProperty.call(r, "x") && M(r);
180
+ });
181
+ }
182
+ s(je, "swapXY");
183
+ function M(e) {
184
+ var n = e.x;
185
+ e.x = e.y, e.y = n;
186
+ }
187
+ s(M, "swapXYOne");
188
+ var fr = class {
189
+ static {
190
+ s(this, "List");
191
+ }
192
+ constructor() {
193
+ var e = {};
194
+ e._next = e._prev = e, this._sentinel = e;
195
+ }
196
+ dequeue() {
197
+ var e = this._sentinel, n = e._prev;
198
+ if (n !== e)
199
+ return Z(n), n;
200
+ }
201
+ enqueue(e) {
202
+ var n = this._sentinel;
203
+ e._prev && e._next && Z(e), e._next = n._next, n._next._prev = e, n._next = e, e._prev = n;
204
+ }
205
+ toString() {
206
+ for (var e = [], n = this._sentinel, r = n._prev; r !== n; )
207
+ e.push(JSON.stringify(r, Me)), r = r._prev;
208
+ return "[" + e.join(", ") + "]";
209
+ }
210
+ };
211
+ function Z(e) {
212
+ e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
213
+ }
214
+ s(Z, "unlink");
215
+ function Me(e, n) {
216
+ if (e !== "_next" && e !== "_prev")
217
+ return n;
218
+ }
219
+ s(Me, "filterOutLinks");
220
+ var cr = sr(1);
221
+ function Fe(e, n) {
222
+ if (e.nodeCount() <= 1)
223
+ return [];
224
+ var r = Ve(e, n || cr), t = Be(r.graph, r.buckets, r.zeroIdx);
225
+ return I(
226
+ m(t, function(a) {
227
+ return e.outEdges(a.v, a.w);
228
+ })
229
+ );
230
+ }
231
+ s(Fe, "greedyFAS");
232
+ function Be(e, n, r) {
233
+ for (var t = [], a = n[n.length - 1], i = n[0], o; e.nodeCount(); ) {
234
+ for (; o = i.dequeue(); )
235
+ F(e, n, r, o);
236
+ for (; o = a.dequeue(); )
237
+ F(e, n, r, o);
238
+ if (e.nodeCount()) {
239
+ for (var d = n.length - 2; d > 0; --d)
240
+ if (o = n[d].dequeue(), o) {
241
+ t = t.concat(F(e, n, r, o, !0));
242
+ break;
243
+ }
244
+ }
245
+ }
246
+ return t;
247
+ }
248
+ s(Be, "doGreedyFAS");
249
+ function F(e, n, r, t, a) {
250
+ var i = a ? [] : void 0;
251
+ return c(e.inEdges(t.v), function(o) {
252
+ var d = e.edge(o), u = e.node(o.v);
253
+ a && i.push({ v: o.v, w: o.w }), u.out -= d, Y(n, r, u);
254
+ }), c(e.outEdges(t.v), function(o) {
255
+ var d = e.edge(o), u = o.w, f = e.node(u);
256
+ f.in -= d, Y(n, r, f);
257
+ }), e.removeNode(t.v), i;
258
+ }
259
+ s(F, "removeNode");
260
+ function Ve(e, n) {
261
+ var r = new y(), t = 0, a = 0;
262
+ c(e.nodes(), function(d) {
263
+ r.setNode(d, { v: d, in: 0, out: 0 });
264
+ }), c(e.edges(), function(d) {
265
+ var u = r.edge(d.v, d.w) || 0, f = n(d), l = u + f;
266
+ r.setEdge(d.v, d.w, l), a = Math.max(a, r.node(d.v).out += f), t = Math.max(t, r.node(d.w).in += f);
267
+ });
268
+ var i = _(a + t + 3).map(function() {
269
+ return new fr();
270
+ }), o = t + 1;
271
+ return c(r.nodes(), function(d) {
272
+ Y(i, o, r.node(d));
273
+ }), { graph: r, buckets: i, zeroIdx: o };
274
+ }
275
+ s(Ve, "buildState");
276
+ function Y(e, n, r) {
277
+ r.out ? r.in ? e[r.out - r.in + n].enqueue(r) : e[e.length - 1].enqueue(r) : e[0].enqueue(r);
278
+ }
279
+ s(Y, "assignBucket");
280
+ function Ae(e) {
281
+ var n = e.graph().acyclicer === "greedy" ? Fe(e, r(e)) : Ge(e);
282
+ c(n, function(t) {
283
+ var a = e.edge(t);
284
+ e.removeEdge(t), a.forwardName = t.name, a.reversed = !0, e.setEdge(t.w, t.v, a, ae("rev"));
285
+ });
286
+ function r(t) {
287
+ return function(a) {
288
+ return t.edge(a).weight;
289
+ };
290
+ }
291
+ s(r, "weightFn");
292
+ }
293
+ s(Ae, "run");
294
+ function Ge(e) {
295
+ var n = [], r = {}, t = {};
296
+ function a(i) {
297
+ Object.prototype.hasOwnProperty.call(t, i) || (t[i] = !0, r[i] = !0, c(e.outEdges(i), function(o) {
298
+ Object.prototype.hasOwnProperty.call(r, o.w) ? n.push(o) : a(o.w);
299
+ }), delete r[i]);
300
+ }
301
+ return s(a, "dfs"), c(e.nodes(), a), n;
302
+ }
303
+ s(Ge, "dfsFAS");
304
+ function Ye(e) {
305
+ c(e.edges(), function(n) {
306
+ var r = e.edge(n);
307
+ if (r.reversed) {
308
+ e.removeEdge(n);
309
+ var t = r.forwardName;
310
+ delete r.reversed, delete r.forwardName, e.setEdge(n.w, n.v, r, t);
311
+ }
312
+ });
313
+ }
314
+ s(Ye, "undo");
315
+ function De(e) {
316
+ e.graph().dummyChains = [], c(e.edges(), function(n) {
317
+ We(e, n);
318
+ });
319
+ }
320
+ s(De, "run");
321
+ function We(e, n) {
322
+ var r = n.v, t = e.node(r).rank, a = n.w, i = e.node(a).rank, o = n.name, d = e.edge(n), u = d.labelRank;
323
+ if (i !== t + 1) {
324
+ e.removeEdge(n);
325
+ var f = void 0, l, h;
326
+ for (h = 0, ++t; t < i; ++h, ++t)
327
+ d.points = [], f = {
328
+ width: 0,
329
+ height: 0,
330
+ edgeLabel: d,
331
+ edgeObj: n,
332
+ rank: t
333
+ }, l = x(e, "edge", f, "_d"), t === u && (f.width = d.width, f.height = d.height, f.dummy = "edge-label", f.labelpos = d.labelpos), e.setEdge(r, l, { weight: d.weight }, o), h === 0 && e.graph().dummyChains.push(l), r = l;
334
+ e.setEdge(r, a, { weight: d.weight }, o);
335
+ }
336
+ }
337
+ s(We, "normalizeEdge");
338
+ function ze(e) {
339
+ c(e.graph().dummyChains, function(n) {
340
+ var r = e.node(n), t = r.edgeLabel, a;
341
+ for (e.setEdge(r.edgeObj, t); r.dummy; )
342
+ a = e.successors(n)[0], e.removeNode(n), t.points.push({ x: r.x, y: r.y }), r.dummy === "edge-label" && (t.x = r.x, t.y = r.y, t.width = r.width, t.height = r.height), n = a, r = e.node(n);
343
+ });
344
+ }
345
+ s(ze, "undo");
346
+ function z(e) {
347
+ var n = {};
348
+ function r(t) {
349
+ var a = e.node(t);
350
+ if (Object.prototype.hasOwnProperty.call(n, t))
351
+ return a.rank;
352
+ n[t] = !0;
353
+ var i = C(
354
+ m(e.outEdges(t), function(o) {
355
+ return r(o.w) - e.edge(o).minlen;
356
+ })
357
+ );
358
+ return (i === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
359
+ i === void 0 || // return value of _.map([]) for Lodash 4
360
+ i === null) && (i = 0), a.rank = i;
361
+ }
362
+ s(r, "dfs"), c(e.sources(), r);
363
+ }
364
+ s(z, "longestPath");
365
+ function N(e, n) {
366
+ return e.node(n.w).rank - e.node(n.v).rank - e.edge(n).minlen;
367
+ }
368
+ s(N, "slack");
369
+ function fe(e) {
370
+ var n = new y({ directed: !1 }), r = e.nodes()[0], t = e.nodeCount();
371
+ n.setNode(r, {});
372
+ for (var a, i; qe(n, e) < t; )
373
+ a = Xe(n, e), i = n.hasNode(a.v) ? N(e, a) : -N(e, a), He(n, e, i);
374
+ return n;
375
+ }
376
+ s(fe, "feasibleTree");
377
+ function qe(e, n) {
378
+ function r(t) {
379
+ c(n.nodeEdges(t), function(a) {
380
+ var i = a.v, o = t === i ? a.w : i;
381
+ !e.hasNode(o) && !N(n, a) && (e.setNode(o, {}), e.setEdge(t, o, {}), r(o));
382
+ });
383
+ }
384
+ return s(r, "dfs"), c(e.nodes(), r), e.nodeCount();
385
+ }
386
+ s(qe, "tightTree");
387
+ function Xe(e, n) {
388
+ return ie(n.edges(), function(r) {
389
+ if (e.hasNode(r.v) !== e.hasNode(r.w))
390
+ return N(n, r);
391
+ });
392
+ }
393
+ s(Xe, "findMinSlackEdge");
394
+ function He(e, n, r) {
395
+ c(e.nodes(), function(t) {
396
+ n.node(t).rank += r;
397
+ });
398
+ }
399
+ s(He, "shiftRanks");
400
+ Ue.CycleException = R;
401
+ function Ue(e) {
402
+ var n = {}, r = {}, t = [];
403
+ function a(i) {
404
+ if (Object.prototype.hasOwnProperty.call(r, i))
405
+ throw new R();
406
+ Object.prototype.hasOwnProperty.call(n, i) || (r[i] = !0, n[i] = !0, c(e.predecessors(i), a), delete r[i], t.push(i));
407
+ }
408
+ if (s(a, "visit"), c(e.sinks(), a), tr(n) !== e.nodeCount())
409
+ throw new R();
410
+ return t;
411
+ }
412
+ s(Ue, "topsort");
413
+ function R() {
414
+ }
415
+ s(R, "CycleException");
416
+ R.prototype = new Error();
417
+ function ce(e, n, r) {
418
+ ur(n) || (n = [n]);
419
+ var t = (e.isDirected() ? e.successors : e.neighbors).bind(e), a = [], i = {};
420
+ return c(n, function(o) {
421
+ if (!e.hasNode(o))
422
+ throw new Error("Graph does not have node: " + o);
423
+ le(e, o, r === "post", i, t, a);
424
+ }), a;
425
+ }
426
+ s(ce, "dfs");
427
+ function le(e, n, r, t, a, i) {
428
+ Object.prototype.hasOwnProperty.call(t, n) || (t[n] = !0, r || i.push(n), c(a(n), function(o) {
429
+ le(e, o, r, t, a, i);
430
+ }), r && i.push(n));
431
+ }
432
+ s(le, "doDfs");
433
+ function Je(e, n) {
434
+ return ce(e, n, "post");
435
+ }
436
+ s(Je, "postorder");
437
+ function Ke(e, n) {
438
+ return ce(e, n, "pre");
439
+ }
440
+ s(Ke, "preorder");
441
+ k.initLowLimValues = X;
442
+ k.initCutValues = q;
443
+ k.calcCutValue = he;
444
+ k.leaveEdge = pe;
445
+ k.enterEdge = we;
446
+ k.exchangeEdges = me;
447
+ function k(e) {
448
+ e = _e(e), z(e);
449
+ var n = fe(e);
450
+ X(n), q(n, e);
451
+ for (var r, t; r = pe(n); )
452
+ t = we(n, e, r), me(n, e, r, t);
453
+ }
454
+ s(k, "networkSimplex");
455
+ function q(e, n) {
456
+ var r = Je(e, e.nodes());
457
+ r = r.slice(0, r.length - 1), c(r, function(t) {
458
+ Qe(e, n, t);
459
+ });
460
+ }
461
+ s(q, "initCutValues");
462
+ function Qe(e, n, r) {
463
+ var t = e.node(r), a = t.parent;
464
+ e.edge(r, a).cutvalue = he(e, n, r);
465
+ }
466
+ s(Qe, "assignCutValue");
467
+ function he(e, n, r) {
468
+ var t = e.node(r), a = t.parent, i = !0, o = n.edge(r, a), d = 0;
469
+ return o || (i = !1, o = n.edge(a, r)), d = o.weight, c(n.nodeEdges(r), function(u) {
470
+ var f = u.v === r, l = f ? u.w : u.v;
471
+ if (l !== a) {
472
+ var h = f === i, v = n.edge(u).weight;
473
+ if (d += h ? v : -v, $e(e, r, l)) {
474
+ var p = e.edge(r, l).cutvalue;
475
+ d += h ? -p : p;
476
+ }
477
+ }
478
+ }), d;
479
+ }
480
+ s(he, "calcCutValue");
481
+ function X(e, n) {
482
+ arguments.length < 2 && (n = e.nodes()[0]), ve(e, {}, 1, n);
483
+ }
484
+ s(X, "initLowLimValues");
485
+ function ve(e, n, r, t, a) {
486
+ var i = r, o = e.node(t);
487
+ return n[t] = !0, c(e.neighbors(t), function(d) {
488
+ Object.prototype.hasOwnProperty.call(n, d) || (r = ve(e, n, r, d, t));
489
+ }), o.low = i, o.lim = r++, a ? o.parent = a : delete o.parent, r;
490
+ }
491
+ s(ve, "dfsAssignLowLim");
492
+ function pe(e) {
493
+ return oe(e.edges(), function(n) {
494
+ return e.edge(n).cutvalue < 0;
495
+ });
496
+ }
497
+ s(pe, "leaveEdge");
498
+ function we(e, n, r) {
499
+ var t = r.v, a = r.w;
500
+ n.hasEdge(t, a) || (t = r.w, a = r.v);
501
+ var i = e.node(t), o = e.node(a), d = i, u = !1;
502
+ i.lim > o.lim && (d = o, u = !0);
503
+ var f = P(n.edges(), function(l) {
504
+ return u === $(e, e.node(l.v), d) && u !== $(e, e.node(l.w), d);
505
+ });
506
+ return ie(f, function(l) {
507
+ return N(n, l);
508
+ });
509
+ }
510
+ s(we, "enterEdge");
511
+ function me(e, n, r, t) {
512
+ var a = r.v, i = r.w;
513
+ e.removeEdge(a, i), e.setEdge(t.v, t.w, {}), X(e), q(e, n), Ze(e, n);
514
+ }
515
+ s(me, "exchangeEdges");
516
+ function Ze(e, n) {
517
+ var r = oe(e.nodes(), function(a) {
518
+ return !n.node(a).parent;
519
+ }), t = Ke(e, r);
520
+ t = t.slice(1), c(t, function(a) {
521
+ var i = e.node(a).parent, o = n.edge(a, i), d = !1;
522
+ o || (o = n.edge(i, a), d = !0), n.node(a).rank = n.node(i).rank + (d ? o.minlen : -o.minlen);
523
+ });
524
+ }
525
+ s(Ze, "updateRanks");
526
+ function $e(e, n, r) {
527
+ return e.hasEdge(n, r);
528
+ }
529
+ s($e, "isTreeEdge");
530
+ function $(e, n, r) {
531
+ return r.low <= n.lim && n.lim <= r.lim;
532
+ }
533
+ s($, "isDescendant");
534
+ function en(e) {
535
+ switch (e.graph().ranker) {
536
+ case "network-simplex":
537
+ ee(e);
538
+ break;
539
+ case "tight-tree":
540
+ nn(e);
541
+ break;
542
+ case "longest-path":
543
+ lr(e);
544
+ break;
545
+ default:
546
+ ee(e);
547
+ }
548
+ }
549
+ s(en, "rank");
550
+ var lr = z;
551
+ function nn(e) {
552
+ z(e), fe(e);
553
+ }
554
+ s(nn, "tightTreeRanker");
555
+ function ee(e) {
556
+ k(e);
557
+ }
558
+ s(ee, "networkSimplexRanker");
559
+ function rn(e) {
560
+ var n = x(e, "root", {}, "_root"), r = tn(e), t = E(L(r)) - 1, a = 2 * t + 1;
561
+ e.graph().nestingRoot = n, c(e.edges(), function(o) {
562
+ e.edge(o).minlen *= a;
563
+ });
564
+ var i = an(e) + 1;
565
+ c(e.children(), function(o) {
566
+ be(e, n, a, i, t, r, o);
567
+ }), e.graph().nodeRankFactor = a;
568
+ }
569
+ s(rn, "run");
570
+ function be(e, n, r, t, a, i, o) {
571
+ var d = e.children(o);
572
+ if (!d.length) {
573
+ o !== n && e.setEdge(n, o, { weight: 0, minlen: r });
574
+ return;
575
+ }
576
+ var u = J(e, "_bt"), f = J(e, "_bb"), l = e.node(o);
577
+ e.setParent(u, o), l.borderTop = u, e.setParent(f, o), l.borderBottom = f, c(d, function(h) {
578
+ be(e, n, r, t, a, i, h);
579
+ var v = e.node(h), p = v.borderTop ? v.borderTop : h, w = v.borderBottom ? v.borderBottom : h, b = v.borderTop ? t : 2 * t, O = p !== w ? 1 : a - i[o] + 1;
580
+ e.setEdge(u, p, {
581
+ weight: b,
582
+ minlen: O,
583
+ nestingEdge: !0
584
+ }), e.setEdge(w, f, {
585
+ weight: b,
586
+ minlen: O,
587
+ nestingEdge: !0
588
+ });
589
+ }), e.parent(o) || e.setEdge(n, u, { weight: 0, minlen: a + i[o] });
590
+ }
591
+ s(be, "dfs");
592
+ function tn(e) {
593
+ var n = {};
594
+ function r(t, a) {
595
+ var i = e.children(t);
596
+ i && i.length && c(i, function(o) {
597
+ r(o, a + 1);
598
+ }), n[t] = a;
599
+ }
600
+ return s(r, "dfs"), c(e.children(), function(t) {
601
+ r(t, 1);
602
+ }), n;
603
+ }
604
+ s(tn, "treeDepths");
605
+ function an(e) {
606
+ return W(
607
+ e.edges(),
608
+ function(n, r) {
609
+ return n + e.edge(r).weight;
610
+ },
611
+ 0
612
+ );
613
+ }
614
+ s(an, "sumWeights");
615
+ function on(e) {
616
+ var n = e.graph();
617
+ e.removeNode(n.nestingRoot), delete n.nestingRoot, c(e.edges(), function(r) {
618
+ var t = e.edge(r);
619
+ t.nestingEdge && e.removeEdge(r);
620
+ });
621
+ }
622
+ s(on, "cleanup");
623
+ function dn(e, n, r) {
624
+ var t = {}, a;
625
+ c(r, function(i) {
626
+ for (var o = e.parent(i), d, u; o; ) {
627
+ if (d = e.parent(o), d ? (u = t[d], t[d] = o) : (u = a, a = o), u && u !== o) {
628
+ n.setEdge(u, o);
629
+ return;
630
+ }
631
+ o = d;
632
+ }
633
+ });
634
+ }
635
+ s(dn, "addSubgraphConstraints");
636
+ function sn(e, n, r) {
637
+ var t = un(e), a = new y({ compound: !0 }).setGraph({ root: t }).setDefaultNodeLabel(function(i) {
638
+ return e.node(i);
639
+ });
640
+ return c(e.nodes(), function(i) {
641
+ var o = e.node(i), d = e.parent(i);
642
+ (o.rank === n || o.minRank <= n && n <= o.maxRank) && (a.setNode(i), a.setParent(i, d || t), c(e[r](i), function(u) {
643
+ var f = u.v === i ? u.w : u.v, l = a.edge(f, i), h = g(l) ? 0 : l.weight;
644
+ a.setEdge(f, i, { weight: e.edge(u).weight + h });
645
+ }), Object.prototype.hasOwnProperty.call(o, "minRank") && a.setNode(i, {
646
+ borderLeft: o.borderLeft[n],
647
+ borderRight: o.borderRight[n]
648
+ }));
649
+ }), a;
650
+ }
651
+ s(sn, "buildLayerGraph");
652
+ function un(e) {
653
+ for (var n; e.hasNode(n = ae("_root")); ) ;
654
+ return n;
655
+ }
656
+ s(un, "createRootNode");
657
+ function fn(e, n) {
658
+ for (var r = 0, t = 1; t < n.length; ++t)
659
+ r += cn(e, n[t - 1], n[t]);
660
+ return r;
661
+ }
662
+ s(fn, "crossCount");
663
+ function cn(e, n, r) {
664
+ for (var t = ar(
665
+ r,
666
+ m(r, function(f, l) {
667
+ return l;
668
+ })
669
+ ), a = I(
670
+ m(n, function(f) {
671
+ return S(
672
+ m(e.outEdges(f), function(l) {
673
+ return { pos: t[l.w], weight: e.edge(l).weight };
674
+ }),
675
+ "pos"
676
+ );
677
+ })
678
+ ), i = 1; i < r.length; ) i <<= 1;
679
+ var o = 2 * i - 1;
680
+ i -= 1;
681
+ var d = m(new Array(o), function() {
682
+ return 0;
683
+ }), u = 0;
684
+ return c(
685
+ // @ts-expect-error
686
+ a.forEach(function(f) {
687
+ var l = f.pos + i;
688
+ d[l] += f.weight;
689
+ for (var h = 0; l > 0; )
690
+ l % 2 && (h += d[l + 1]), l = l - 1 >> 1, d[l] += f.weight;
691
+ u += f.weight * h;
692
+ })
693
+ ), u;
694
+ }
695
+ s(cn, "twoLayerCrossCount");
696
+ function ln(e) {
697
+ var n = {}, r = P(e.nodes(), function(d) {
698
+ return !e.children(d).length;
699
+ }), t = E(
700
+ m(r, function(d) {
701
+ return e.node(d).rank;
702
+ })
703
+ ), a = m(_(t + 1), function() {
704
+ return [];
705
+ });
706
+ function i(d) {
707
+ if (!xe(n, d)) {
708
+ n[d] = !0;
709
+ var u = e.node(d);
710
+ a[u.rank].push(d), c(e.successors(d), i);
711
+ }
712
+ }
713
+ s(i, "dfs");
714
+ var o = S(r, function(d) {
715
+ return e.node(d).rank;
716
+ });
717
+ return c(o, i), a;
718
+ }
719
+ s(ln, "initOrder");
720
+ function hn(e, n) {
721
+ return m(n, function(r) {
722
+ var t = e.inEdges(r);
723
+ if (t.length) {
724
+ var a = W(
725
+ t,
726
+ function(i, o) {
727
+ var d = e.edge(o), u = e.node(o.v);
728
+ return {
729
+ sum: i.sum + d.weight * u.order,
730
+ weight: i.weight + d.weight
731
+ };
732
+ },
733
+ { sum: 0, weight: 0 }
734
+ );
735
+ return {
736
+ v: r,
737
+ barycenter: a.sum / a.weight,
738
+ weight: a.weight
739
+ };
740
+ } else
741
+ return { v: r };
742
+ });
743
+ }
744
+ s(hn, "barycenter");
745
+ function vn(e, n) {
746
+ var r = {};
747
+ c(e, function(a, i) {
748
+ var o = r[a.v] = {
749
+ indegree: 0,
750
+ in: [],
751
+ out: [],
752
+ vs: [a.v],
753
+ i
754
+ };
755
+ g(a.barycenter) || (o.barycenter = a.barycenter, o.weight = a.weight);
756
+ }), c(n.edges(), function(a) {
757
+ var i = r[a.v], o = r[a.w];
758
+ !g(i) && !g(o) && (o.indegree++, i.out.push(r[a.w]));
759
+ });
760
+ var t = P(r, function(a) {
761
+ return !a.indegree;
762
+ });
763
+ return pn(t);
764
+ }
765
+ s(vn, "resolveConflicts");
766
+ function pn(e) {
767
+ var n = [];
768
+ function r(i) {
769
+ return function(o) {
770
+ o.merged || (g(o.barycenter) || g(i.barycenter) || o.barycenter >= i.barycenter) && wn(i, o);
771
+ };
772
+ }
773
+ s(r, "handleIn");
774
+ function t(i) {
775
+ return function(o) {
776
+ o.in.push(i), --o.indegree === 0 && e.push(o);
777
+ };
778
+ }
779
+ for (s(t, "handleOut"); e.length; ) {
780
+ var a = e.pop();
781
+ n.push(a), c(a.in.reverse(), r(a)), c(a.out, t(a));
782
+ }
783
+ return m(
784
+ P(n, function(i) {
785
+ return !i.merged;
786
+ }),
787
+ function(i) {
788
+ return A(i, ["vs", "i", "barycenter", "weight"]);
789
+ }
790
+ );
791
+ }
792
+ s(pn, "doResolveConflicts");
793
+ function wn(e, n) {
794
+ var r = 0, t = 0;
795
+ e.weight && (r += e.barycenter * e.weight, t += e.weight), n.weight && (r += n.barycenter * n.weight, t += n.weight), e.vs = n.vs.concat(e.vs), e.barycenter = r / t, e.weight = t, e.i = Math.min(n.i, e.i), n.merged = !0;
796
+ }
797
+ s(wn, "mergeEntries");
798
+ function mn(e, n) {
799
+ var r = Oe(e, function(l) {
800
+ return Object.prototype.hasOwnProperty.call(l, "barycenter");
801
+ }), t = r.lhs, a = S(r.rhs, function(l) {
802
+ return -l.i;
803
+ }), i = [], o = 0, d = 0, u = 0;
804
+ t.sort(bn(!!n)), u = ne(i, a, u), c(t, function(l) {
805
+ u += l.vs.length, i.push(l.vs), o += l.barycenter * l.weight, d += l.weight, u = ne(i, a, u);
806
+ });
807
+ var f = { vs: I(i) };
808
+ return d && (f.barycenter = o / d, f.weight = d), f;
809
+ }
810
+ s(mn, "sort");
811
+ function ne(e, n, r) {
812
+ for (var t; n.length && (t = G(n)).i <= r; )
813
+ n.pop(), e.push(t.vs), r++;
814
+ return r;
815
+ }
816
+ s(ne, "consumeUnsortable");
817
+ function bn(e) {
818
+ return function(n, r) {
819
+ return n.barycenter < r.barycenter ? -1 : n.barycenter > r.barycenter ? 1 : e ? r.i - n.i : n.i - r.i;
820
+ };
821
+ }
822
+ s(bn, "compareWithBias");
823
+ function ge(e, n, r, t) {
824
+ var a = e.children(n), i = e.node(n), o = i ? i.borderLeft : void 0, d = i ? i.borderRight : void 0, u = {};
825
+ o && (a = P(a, function(w) {
826
+ return w !== o && w !== d;
827
+ }));
828
+ var f = hn(e, a);
829
+ c(f, function(w) {
830
+ if (e.children(w.v).length) {
831
+ var b = ge(e, w.v, r, t);
832
+ u[w.v] = b, Object.prototype.hasOwnProperty.call(b, "barycenter") && yn(w, b);
833
+ }
834
+ });
835
+ var l = vn(f, r);
836
+ gn(l, u);
837
+ var h = mn(l, t);
838
+ if (o && (h.vs = I([o, h.vs, d]), e.predecessors(o).length)) {
839
+ var v = e.node(e.predecessors(o)[0]), p = e.node(e.predecessors(d)[0]);
840
+ Object.prototype.hasOwnProperty.call(h, "barycenter") || (h.barycenter = 0, h.weight = 0), h.barycenter = (h.barycenter * h.weight + v.order + p.order) / (h.weight + 2), h.weight += 2;
841
+ }
842
+ return h;
843
+ }
844
+ s(ge, "sortSubgraph");
845
+ function gn(e, n) {
846
+ c(e, function(r) {
847
+ r.vs = I(
848
+ r.vs.map(function(t) {
849
+ return n[t] ? n[t].vs : t;
850
+ })
851
+ );
852
+ });
853
+ }
854
+ s(gn, "expandSubgraphs");
855
+ function yn(e, n) {
856
+ g(e.barycenter) ? (e.barycenter = n.barycenter, e.weight = n.weight) : (e.barycenter = (e.barycenter * e.weight + n.barycenter * n.weight) / (e.weight + n.weight), e.weight += n.weight);
857
+ }
858
+ s(yn, "mergeBarycenters");
859
+ function kn(e) {
860
+ var n = se(e), r = re(e, _(1, n + 1), "inEdges"), t = re(e, _(n - 1, -1, -1), "outEdges"), a = ln(e);
861
+ te(e, a);
862
+ for (var i = Number.POSITIVE_INFINITY, o, d = 0, u = 0; u < 4; ++d, ++u) {
863
+ En(d % 2 ? r : t, d % 4 >= 2), a = T(e);
864
+ var f = fn(e, a);
865
+ f < i && (u = 0, o = ir(a), i = f);
866
+ }
867
+ te(e, o);
868
+ }
869
+ s(kn, "order");
870
+ function re(e, n, r) {
871
+ return m(n, function(t) {
872
+ return sn(e, t, r);
873
+ });
874
+ }
875
+ s(re, "buildLayerGraphs");
876
+ function En(e, n) {
877
+ var r = new y();
878
+ c(e, function(t) {
879
+ var a = t.graph().root, i = ge(t, a, r, n);
880
+ c(i.vs, function(o, d) {
881
+ t.node(o).order = d;
882
+ }), dn(t, r, i.vs);
883
+ });
884
+ }
885
+ s(En, "sweepLayerGraphs");
886
+ function te(e, n) {
887
+ c(n, function(r) {
888
+ c(r, function(t, a) {
889
+ e.node(t).order = a;
890
+ });
891
+ });
892
+ }
893
+ s(te, "assignOrder");
894
+ function xn(e) {
895
+ var n = Ln(e);
896
+ c(e.graph().dummyChains, function(r) {
897
+ for (var t = e.node(r), a = t.edgeObj, i = _n(e, n, a.v, a.w), o = i.path, d = i.lca, u = 0, f = o[u], l = !0; r !== a.w; ) {
898
+ if (t = e.node(r), l) {
899
+ for (; (f = o[u]) !== d && e.node(f).maxRank < t.rank; )
900
+ u++;
901
+ f === d && (l = !1);
902
+ }
903
+ if (!l) {
904
+ for (; u < o.length - 1 && e.node(f = o[u + 1]).minRank <= t.rank; )
905
+ u++;
906
+ f = o[u];
907
+ }
908
+ e.setParent(r, f), r = e.successors(r)[0];
909
+ }
910
+ });
911
+ }
912
+ s(xn, "parentDummyChains");
913
+ function _n(e, n, r, t) {
914
+ var a = [], i = [], o = Math.min(n[r].low, n[t].low), d = Math.max(n[r].lim, n[t].lim), u, f;
915
+ u = r;
916
+ do
917
+ u = e.parent(u), a.push(u);
918
+ while (u && (n[u].low > o || d > n[u].lim));
919
+ for (f = u, u = t; (u = e.parent(u)) !== f; )
920
+ i.push(u);
921
+ return { path: a.concat(i.reverse()), lca: f };
922
+ }
923
+ s(_n, "findPath");
924
+ function Ln(e) {
925
+ var n = {}, r = 0;
926
+ function t(a) {
927
+ var i = r;
928
+ c(e.children(a), t), n[a] = { low: i, lim: r++ };
929
+ }
930
+ return s(t, "dfs"), c(e.children(), t), n;
931
+ }
932
+ s(Ln, "postorder");
933
+ function Nn(e, n) {
934
+ var r = {};
935
+ function t(a, i) {
936
+ var o = 0, d = 0, u = a.length, f = G(i);
937
+ return c(i, function(l, h) {
938
+ var v = Cn(e, l), p = v ? e.node(v).order : u;
939
+ (v || l === f) && (c(i.slice(d, h + 1), function(w) {
940
+ c(e.predecessors(w), function(b) {
941
+ var O = e.node(b), ke = O.order;
942
+ (ke < o || p < ke) && !(O.dummy && e.node(w).dummy) && ye(r, b, w);
943
+ });
944
+ }), d = h + 1, o = p);
945
+ }), i;
946
+ }
947
+ return s(t, "visitLayer"), W(n, t), r;
948
+ }
949
+ s(Nn, "findType1Conflicts");
950
+ function On(e, n) {
951
+ var r = {};
952
+ function t(i, o, d, u, f) {
953
+ var l;
954
+ c(_(o, d), function(h) {
955
+ l = i[h], e.node(l).dummy && c(e.predecessors(l), function(v) {
956
+ var p = e.node(v);
957
+ p.dummy && (p.order < u || p.order > f) && ye(r, v, l);
958
+ });
959
+ });
960
+ }
961
+ s(t, "scan");
962
+ function a(i, o) {
963
+ var d = -1, u, f = 0;
964
+ return c(o, function(l, h) {
965
+ if (e.node(l).dummy === "border") {
966
+ var v = e.predecessors(l);
967
+ v.length && (u = e.node(v[0]).order, t(o, f, h, d, u), f = h, d = u);
968
+ }
969
+ t(o, f, o.length, u, i.length);
970
+ }), o;
971
+ }
972
+ return s(a, "visitLayer"), W(n, a), r;
973
+ }
974
+ s(On, "findType2Conflicts");
975
+ function Cn(e, n) {
976
+ if (e.node(n).dummy)
977
+ return oe(e.predecessors(n), function(r) {
978
+ return e.node(r).dummy;
979
+ });
980
+ }
981
+ s(Cn, "findOtherInnerSegmentNode");
982
+ function ye(e, n, r) {
983
+ if (n > r) {
984
+ var t = n;
985
+ n = r, r = t;
986
+ }
987
+ var a = e[n];
988
+ a || (e[n] = a = {}), a[r] = !0;
989
+ }
990
+ s(ye, "addConflict");
991
+ function Rn(e, n, r) {
992
+ if (n > r) {
993
+ var t = n;
994
+ n = r, r = t;
995
+ }
996
+ return !!e[n] && Object.prototype.hasOwnProperty.call(e[n], r);
997
+ }
998
+ s(Rn, "hasConflict");
999
+ function In(e, n, r, t) {
1000
+ var a = {}, i = {}, o = {};
1001
+ return c(n, function(d) {
1002
+ c(d, function(u, f) {
1003
+ a[u] = u, i[u] = u, o[u] = f;
1004
+ });
1005
+ }), c(n, function(d) {
1006
+ var u = -1;
1007
+ c(d, function(f) {
1008
+ var l = t(f);
1009
+ if (l.length) {
1010
+ l = S(l, function(b) {
1011
+ return o[b];
1012
+ });
1013
+ for (var h = (l.length - 1) / 2, v = Math.floor(h), p = Math.ceil(h); v <= p; ++v) {
1014
+ var w = l[v];
1015
+ i[f] === f && u < o[w] && !Rn(r, f, w) && (i[w] = f, i[f] = a[f] = a[w], u = o[w]);
1016
+ }
1017
+ }
1018
+ });
1019
+ }), { root: a, align: i };
1020
+ }
1021
+ s(In, "verticalAlignment");
1022
+ function Pn(e, n, r, t, a) {
1023
+ var i = {}, o = Sn(e, n, r, a), d = a ? "borderLeft" : "borderRight";
1024
+ function u(h, v) {
1025
+ for (var p = o.nodes(), w = p.pop(), b = {}; w; )
1026
+ b[w] ? h(w) : (b[w] = !0, p.push(w), p = p.concat(v(w))), w = p.pop();
1027
+ }
1028
+ s(u, "iterate");
1029
+ function f(h) {
1030
+ i[h] = o.inEdges(h).reduce(function(v, p) {
1031
+ return Math.max(v, i[p.v] + o.edge(p));
1032
+ }, 0);
1033
+ }
1034
+ s(f, "pass1");
1035
+ function l(h) {
1036
+ var v = o.outEdges(h).reduce(function(w, b) {
1037
+ return Math.min(w, i[b.w] - o.edge(b));
1038
+ }, Number.POSITIVE_INFINITY), p = e.node(h);
1039
+ v !== Number.POSITIVE_INFINITY && p.borderType !== d && (i[h] = Math.max(i[h], v));
1040
+ }
1041
+ return s(l, "pass2"), u(f, o.predecessors.bind(o)), u(l, o.successors.bind(o)), c(t, function(h) {
1042
+ i[h] = i[r[h]];
1043
+ }), i;
1044
+ }
1045
+ s(Pn, "horizontalCompaction");
1046
+ function Sn(e, n, r, t) {
1047
+ var a = new y(), i = e.graph(), o = Bn(i.nodesep, i.edgesep, t);
1048
+ return c(n, function(d) {
1049
+ var u;
1050
+ c(d, function(f) {
1051
+ var l = r[f];
1052
+ if (a.setNode(l), u) {
1053
+ var h = r[u], v = a.edge(h, l);
1054
+ a.setEdge(h, l, Math.max(o(e, f, u), v || 0));
1055
+ }
1056
+ u = f;
1057
+ });
1058
+ }), a;
1059
+ }
1060
+ s(Sn, "buildBlockGraph");
1061
+ function Tn(e, n) {
1062
+ return ie(L(n), function(r) {
1063
+ var t = Number.NEGATIVE_INFINITY, a = Number.POSITIVE_INFINITY;
1064
+ return or(r, function(i, o) {
1065
+ var d = Vn(e, o) / 2;
1066
+ t = Math.max(i + d, t), a = Math.min(i - d, a);
1067
+ }), t - a;
1068
+ });
1069
+ }
1070
+ s(Tn, "findSmallestWidthAlignment");
1071
+ function jn(e, n) {
1072
+ var r = L(n), t = C(r), a = E(r);
1073
+ c(["u", "d"], function(i) {
1074
+ c(["l", "r"], function(o) {
1075
+ var d = i + o, u = e[d], f;
1076
+ if (u !== n) {
1077
+ var l = L(u);
1078
+ f = o === "l" ? t - C(l) : a - E(l), f && (e[d] = D(u, function(h) {
1079
+ return h + f;
1080
+ }));
1081
+ }
1082
+ });
1083
+ });
1084
+ }
1085
+ s(jn, "alignCoordinates");
1086
+ function Mn(e, n) {
1087
+ return D(e.ul, function(r, t) {
1088
+ if (n)
1089
+ return e[n.toLowerCase()][t];
1090
+ var a = S(m(e, t));
1091
+ return (a[1] + a[2]) / 2;
1092
+ });
1093
+ }
1094
+ s(Mn, "balance");
1095
+ function Fn(e) {
1096
+ var n = T(e), r = H(Nn(e, n), On(e, n)), t = {}, a;
1097
+ c(["u", "d"], function(o) {
1098
+ a = o === "u" ? n : L(n).reverse(), c(["l", "r"], function(d) {
1099
+ d === "r" && (a = m(a, function(h) {
1100
+ return L(h).reverse();
1101
+ }));
1102
+ var u = (o === "u" ? e.predecessors : e.successors).bind(e), f = In(e, a, r, u), l = Pn(e, a, f.root, f.align, d === "r");
1103
+ d === "r" && (l = D(l, function(h) {
1104
+ return -h;
1105
+ })), t[o + d] = l;
1106
+ });
1107
+ });
1108
+ var i = Tn(e, t);
1109
+ return jn(t, i), Mn(t, e.graph().align);
1110
+ }
1111
+ s(Fn, "positionX");
1112
+ function Bn(e, n, r) {
1113
+ return function(t, a, i) {
1114
+ var o = t.node(a), d = t.node(i), u = 0, f;
1115
+ if (u += o.width / 2, Object.prototype.hasOwnProperty.call(o, "labelpos"))
1116
+ switch (o.labelpos.toLowerCase()) {
1117
+ case "l":
1118
+ f = -o.width / 2;
1119
+ break;
1120
+ case "r":
1121
+ f = o.width / 2;
1122
+ break;
1123
+ }
1124
+ if (f && (u += r ? f : -f), f = 0, u += (o.dummy ? n : e) / 2, u += (d.dummy ? n : e) / 2, u += d.width / 2, Object.prototype.hasOwnProperty.call(d, "labelpos"))
1125
+ switch (d.labelpos.toLowerCase()) {
1126
+ case "l":
1127
+ f = d.width / 2;
1128
+ break;
1129
+ case "r":
1130
+ f = -d.width / 2;
1131
+ break;
1132
+ }
1133
+ return f && (u += r ? f : -f), f = 0, u;
1134
+ };
1135
+ }
1136
+ s(Bn, "sep");
1137
+ function Vn(e, n) {
1138
+ return e.node(n).width;
1139
+ }
1140
+ s(Vn, "width");
1141
+ function An(e) {
1142
+ e = de(e), Gn(e), dr(Fn(e), function(n, r) {
1143
+ e.node(r).x = n;
1144
+ });
1145
+ }
1146
+ s(An, "position");
1147
+ function Gn(e) {
1148
+ var n = T(e), r = e.graph().ranksep, t = 0;
1149
+ c(n, function(a) {
1150
+ var i = E(
1151
+ m(a, function(o) {
1152
+ return e.node(o).height;
1153
+ })
1154
+ );
1155
+ c(a, function(o) {
1156
+ e.node(o).y = t + i / 2;
1157
+ }), t += i + r;
1158
+ });
1159
+ }
1160
+ s(Gn, "positionY");
1161
+ function hr(e, n) {
1162
+ var r = n && n.debugTiming ? Ce : Re;
1163
+ r("layout", () => {
1164
+ var t = r(" buildLayoutGraph", () => Wn(e));
1165
+ r(" runLayout", () => Yn(t, r)), r(" updateInputGraph", () => Dn(e, t));
1166
+ });
1167
+ }
1168
+ s(hr, "layout");
1169
+ function Yn(e, n) {
1170
+ n(" makeSpaceForEdgeLabels", () => zn(e)), n(" removeSelfEdges", () => $n(e)), n(" acyclic", () => Ae(e)), n(" nestingGraph.run", () => rn(e)), n(" rank", () => en(de(e))), n(" injectEdgeLabelProxies", () => qn(e)), n(" removeEmptyRanks", () => Ne(e)), n(" nestingGraph.cleanup", () => on(e)), n(" normalizeRanks", () => Le(e)), n(" assignRankMinMax", () => Xn(e)), n(" removeEdgeLabelProxies", () => Hn(e)), n(" normalize.run", () => De(e)), n(" parentDummyChains", () => xn(e)), n(" addBorderSegments", () => Ie(e)), n(" order", () => kn(e)), n(" insertSelfEdges", () => er(e)), n(" adjustCoordinateSystem", () => Pe(e)), n(" position", () => An(e)), n(" positionSelfEdges", () => nr(e)), n(" removeBorderNodes", () => Zn(e)), n(" normalize.undo", () => ze(e)), n(" fixupEdgeLabelCoords", () => Kn(e)), n(" undoCoordinateSystem", () => Se(e)), n(" translateGraph", () => Un(e)), n(" assignNodeIntersects", () => Jn(e)), n(" reversePoints", () => Qn(e)), n(" acyclic.undo", () => Ye(e));
1171
+ }
1172
+ s(Yn, "runLayout");
1173
+ function Dn(e, n) {
1174
+ c(e.nodes(), function(r) {
1175
+ var t = e.node(r), a = n.node(r);
1176
+ t && (t.x = a.x, t.y = a.y, n.children(r).length && (t.width = a.width, t.height = a.height));
1177
+ }), c(e.edges(), function(r) {
1178
+ var t = e.edge(r), a = n.edge(r);
1179
+ t.points = a.points, Object.prototype.hasOwnProperty.call(a, "x") && (t.x = a.x, t.y = a.y);
1180
+ }), e.graph().width = n.graph().width, e.graph().height = n.graph().height;
1181
+ }
1182
+ s(Dn, "updateInputGraph");
1183
+ var vr = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], pr = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, wr = ["acyclicer", "ranker", "rankdir", "align"], mr = ["width", "height"], br = { width: 0, height: 0 }, gr = ["minlen", "weight", "width", "height", "labeloffset"], yr = {
1184
+ minlen: 1,
1185
+ weight: 1,
1186
+ width: 0,
1187
+ height: 0,
1188
+ labeloffset: 10,
1189
+ labelpos: "r"
1190
+ }, kr = ["labelpos"];
1191
+ function Wn(e) {
1192
+ var n = new y({ multigraph: !0, compound: !0 }), r = V(e.graph());
1193
+ return n.setGraph(
1194
+ H({}, pr, B(r, vr), A(r, wr))
1195
+ ), c(e.nodes(), function(t) {
1196
+ var a = V(e.node(t));
1197
+ n.setNode(t, rr(B(a, mr), br)), n.setParent(t, e.parent(t));
1198
+ }), c(e.edges(), function(t) {
1199
+ var a = V(e.edge(t));
1200
+ n.setEdge(
1201
+ t,
1202
+ H({}, yr, B(a, gr), A(a, kr))
1203
+ );
1204
+ }), n;
1205
+ }
1206
+ s(Wn, "buildLayoutGraph");
1207
+ function zn(e) {
1208
+ var n = e.graph();
1209
+ n.ranksep /= 2, c(e.edges(), function(r) {
1210
+ var t = e.edge(r);
1211
+ t.minlen *= 2, t.labelpos.toLowerCase() !== "c" && (n.rankdir === "TB" || n.rankdir === "BT" ? t.width += t.labeloffset : t.height += t.labeloffset);
1212
+ });
1213
+ }
1214
+ s(zn, "makeSpaceForEdgeLabels");
1215
+ function qn(e) {
1216
+ c(e.edges(), function(n) {
1217
+ var r = e.edge(n);
1218
+ if (r.width && r.height) {
1219
+ var t = e.node(n.v), a = e.node(n.w), i = { rank: (a.rank - t.rank) / 2 + t.rank, e: n };
1220
+ x(e, "edge-proxy", i, "_ep");
1221
+ }
1222
+ });
1223
+ }
1224
+ s(qn, "injectEdgeLabelProxies");
1225
+ function Xn(e) {
1226
+ var n = 0;
1227
+ c(e.nodes(), function(r) {
1228
+ var t = e.node(r);
1229
+ t.borderTop && (t.minRank = e.node(t.borderTop).rank, t.maxRank = e.node(t.borderBottom).rank, n = E(n, t.maxRank));
1230
+ }), e.graph().maxRank = n;
1231
+ }
1232
+ s(Xn, "assignRankMinMax");
1233
+ function Hn(e) {
1234
+ c(e.nodes(), function(n) {
1235
+ var r = e.node(n);
1236
+ r.dummy === "edge-proxy" && (e.edge(r.e).labelRank = r.rank, e.removeNode(n));
1237
+ });
1238
+ }
1239
+ s(Hn, "removeEdgeLabelProxies");
1240
+ function Un(e) {
1241
+ var n = Number.POSITIVE_INFINITY, r = 0, t = Number.POSITIVE_INFINITY, a = 0, i = e.graph(), o = i.marginx || 0, d = i.marginy || 0;
1242
+ function u(f) {
1243
+ var l = f.x, h = f.y, v = f.width, p = f.height;
1244
+ n = Math.min(n, l - v / 2), r = Math.max(r, l + v / 2), t = Math.min(t, h - p / 2), a = Math.max(a, h + p / 2);
1245
+ }
1246
+ s(u, "getExtremes"), c(e.nodes(), function(f) {
1247
+ u(e.node(f));
1248
+ }), c(e.edges(), function(f) {
1249
+ var l = e.edge(f);
1250
+ Object.prototype.hasOwnProperty.call(l, "x") && u(l);
1251
+ }), n -= o, t -= d, c(e.nodes(), function(f) {
1252
+ var l = e.node(f);
1253
+ l.x -= n, l.y -= t;
1254
+ }), c(e.edges(), function(f) {
1255
+ var l = e.edge(f);
1256
+ c(l.points, function(h) {
1257
+ h.x -= n, h.y -= t;
1258
+ }), Object.prototype.hasOwnProperty.call(l, "x") && (l.x -= n), Object.prototype.hasOwnProperty.call(l, "y") && (l.y -= t);
1259
+ }), i.width = r - n + o, i.height = a - t + d;
1260
+ }
1261
+ s(Un, "translateGraph");
1262
+ function Jn(e) {
1263
+ c(e.edges(), function(n) {
1264
+ var r = e.edge(n), t = e.node(n.v), a = e.node(n.w), i, o;
1265
+ r.points ? (i = r.points[0], o = r.points[r.points.length - 1]) : (r.points = [], i = a, o = t), r.points.unshift(U(t, i)), r.points.push(U(a, o));
1266
+ });
1267
+ }
1268
+ s(Jn, "assignNodeIntersects");
1269
+ function Kn(e) {
1270
+ c(e.edges(), function(n) {
1271
+ var r = e.edge(n);
1272
+ if (Object.prototype.hasOwnProperty.call(r, "x"))
1273
+ switch ((r.labelpos === "l" || r.labelpos === "r") && (r.width -= r.labeloffset), r.labelpos) {
1274
+ case "l":
1275
+ r.x -= r.width / 2 + r.labeloffset;
1276
+ break;
1277
+ case "r":
1278
+ r.x += r.width / 2 + r.labeloffset;
1279
+ break;
1280
+ }
1281
+ });
1282
+ }
1283
+ s(Kn, "fixupEdgeLabelCoords");
1284
+ function Qn(e) {
1285
+ c(e.edges(), function(n) {
1286
+ var r = e.edge(n);
1287
+ r.reversed && r.points.reverse();
1288
+ });
1289
+ }
1290
+ s(Qn, "reversePointsForReversedEdges");
1291
+ function Zn(e) {
1292
+ c(e.nodes(), function(n) {
1293
+ if (e.children(n).length) {
1294
+ var r = e.node(n), t = e.node(r.borderTop), a = e.node(r.borderBottom), i = e.node(G(r.borderLeft)), o = e.node(G(r.borderRight));
1295
+ r.width = Math.abs(o.x - i.x), r.height = Math.abs(a.y - t.y), r.x = i.x + r.width / 2, r.y = t.y + r.height / 2;
1296
+ }
1297
+ }), c(e.nodes(), function(n) {
1298
+ e.node(n).dummy === "border" && e.removeNode(n);
1299
+ });
1300
+ }
1301
+ s(Zn, "removeBorderNodes");
1302
+ function $n(e) {
1303
+ c(e.edges(), function(n) {
1304
+ if (n.v === n.w) {
1305
+ var r = e.node(n.v);
1306
+ r.selfEdges || (r.selfEdges = []), r.selfEdges.push({ e: n, label: e.edge(n) }), e.removeEdge(n);
1307
+ }
1308
+ });
1309
+ }
1310
+ s($n, "removeSelfEdges");
1311
+ function er(e) {
1312
+ var n = T(e);
1313
+ c(n, function(r) {
1314
+ var t = 0;
1315
+ c(r, function(a, i) {
1316
+ var o = e.node(a);
1317
+ o.order = i + t, c(o.selfEdges, function(d) {
1318
+ x(
1319
+ e,
1320
+ "selfedge",
1321
+ {
1322
+ width: d.label.width,
1323
+ height: d.label.height,
1324
+ rank: o.rank,
1325
+ order: i + ++t,
1326
+ e: d.e,
1327
+ label: d.label
1328
+ },
1329
+ "_se"
1330
+ );
1331
+ }), delete o.selfEdges;
1332
+ });
1333
+ });
1334
+ }
1335
+ s(er, "insertSelfEdges");
1336
+ function nr(e) {
1337
+ c(e.nodes(), function(n) {
1338
+ var r = e.node(n);
1339
+ if (r.dummy === "selfedge") {
1340
+ var t = e.node(r.e.v), a = t.x + t.width / 2, i = t.y, o = r.x - a, d = t.height / 2;
1341
+ e.setEdge(r.e, r.label), e.removeNode(n), r.label.points = [
1342
+ { x: a + 2 * o / 3, y: i - d },
1343
+ { x: a + 5 * o / 6, y: i - d },
1344
+ { x: a + o, y: i },
1345
+ { x: a + 5 * o / 6, y: i + d },
1346
+ { x: a + 2 * o / 3, y: i + d }
1347
+ ], r.label.x = r.x, r.label.y = r.y;
1348
+ }
1349
+ });
1350
+ }
1351
+ s(nr, "positionSelfEdges");
1352
+ function B(e, n) {
1353
+ return D(A(e, n), Number);
1354
+ }
1355
+ s(B, "selectNumberAttrs");
1356
+ function V(e) {
1357
+ var n = {};
1358
+ return c(e, function(r, t) {
1359
+ n[t.toLowerCase()] = r;
1360
+ }), n;
1361
+ }
1362
+ s(V, "canonicalize");
1363
+ export {
1364
+ hr as l
1365
+ };