@notmrabhi/flowforge 0.1.7 → 0.1.9
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.
- package/dist/{GatewayBranchEdge-DJql3GUT.js → GatewayBranchEdge-Cnl2Hj5T.js} +1 -1
- package/dist/{GatewayBranchEdge-C9tybnDE.js → GatewayBranchEdge-D6o2Dnkd.js} +2 -2
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.js +2 -2
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/{templateSkeletons-DQGmO1Yu.js → templateSkeletons-C7mMpUns.js} +1 -1
- package/dist/{templateSkeletons-BIQDennR.js → templateSkeletons-CZ7m_Cjb.js} +505 -505
- package/package.json +1 -1
|
@@ -2,20 +2,20 @@ import { jsxs as m, jsx as f, Fragment as Lt } from "react/jsx-runtime";
|
|
|
2
2
|
import P, { useRef as pt, useEffect as ie, useState as j, useMemo as W, useCallback as Y } from "react";
|
|
3
3
|
import _r, { useStore as Tr, useReactFlow as Nr, Background as Cr, Controls as Sr, MiniMap as Ir } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as Or, G as Mr, E as jr, P as Fr, L as zr, d as Rr, f as Dr } from "./GatewayBranchEdge-
|
|
6
|
-
import { Dialog as Lr, Box as te, Drawer as Ar,
|
|
7
|
-
import { MdClose as
|
|
8
|
-
import { GrTrigger as
|
|
9
|
-
import { BiCollapse as
|
|
10
|
-
import { a as
|
|
11
|
-
import { m as
|
|
12
|
-
import { T as
|
|
13
|
-
var $t = Object.defineProperty,
|
|
5
|
+
import { e as Or, G as Mr, E as jr, P as Fr, L as zr, d as Rr, f as Dr } from "./GatewayBranchEdge-D6o2Dnkd.js";
|
|
6
|
+
import { Dialog as Lr, Box as te, Drawer as Ar, IconButton as bt, Button as yt } from "@mui/material";
|
|
7
|
+
import { MdClose as Pr, MdCalendarToday as Br, MdBolt as Wr, MdArrowBack as Gr, MdChevronRight as At, MdAddCircleOutline as $r, MdApps as Yr, MdErrorOutline as Kr, MdAccountTree as Ur, MdAdd as Vr, MdSearch as Hr, MdCategory as qr, MdCancel as Pt, MdError as Bt, MdCheckCircle as Wt, MdPlayArrow as Gt, MdHourglassEmpty as Xr, MdSchedule as mt, MdPerson as Jr, MdExpandLess as Zr, MdExpandMore as Qr } from "react-icons/md";
|
|
8
|
+
import { GrTrigger as en } from "react-icons/gr";
|
|
9
|
+
import { BiCollapse as tn, BiExpand as rn } from "react-icons/bi";
|
|
10
|
+
import { a as nn } from "./index-D6g2IXSf.js";
|
|
11
|
+
import { m as on } from "./messages-CO299wPN.js";
|
|
12
|
+
import { T as sn, E as q } from "./canvasTokens-CAD6G24b.js";
|
|
13
|
+
var $t = Object.defineProperty, ln = (e, t, r) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, dn = (e, t) => {
|
|
14
14
|
for (var r in t) $t(e, r, { get: t[r], enumerable: !0 });
|
|
15
|
-
},
|
|
16
|
-
dn(Yt, { Graph: () => G, alg: () => Ve, json: () => Ut, version: () =>
|
|
17
|
-
var
|
|
18
|
-
for (var r in t)
|
|
15
|
+
}, an = (e, t, r) => ln(e, t + "", r), Yt = {};
|
|
16
|
+
dn(Yt, { Graph: () => G, alg: () => Ve, json: () => Ut, version: () => fn });
|
|
17
|
+
var cn = Object.defineProperty, Kt = (e, t) => {
|
|
18
|
+
for (var r in t) cn(e, r, { get: t[r], enumerable: !0 });
|
|
19
19
|
}, G = class {
|
|
20
20
|
constructor(e) {
|
|
21
21
|
this._isDirected = !0, this._isMultigraph = !1, this._isCompound = !1, this._nodes = {}, this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {}, this._nodeCount = 0, this._edgeCount = 0, this._defaultNodeLabelFn = () => {
|
|
@@ -147,14 +147,14 @@ var un = Object.defineProperty, Kt = (e, t) => {
|
|
|
147
147
|
return e.reduce((r, n) => (t !== void 0 ? this.setEdge(r, n, t) : this.setEdge(r, n), n)), this;
|
|
148
148
|
}
|
|
149
149
|
setEdge(e, t, r, n) {
|
|
150
|
-
let o, i, s, l,
|
|
151
|
-
typeof e == "object" && e !== null && "v" in e ? (o = e.v, i = e.w, s = e.name, arguments.length === 2 && (l = t,
|
|
152
|
-
let
|
|
153
|
-
if (
|
|
150
|
+
let o, i, s, l, a = !1;
|
|
151
|
+
typeof e == "object" && e !== null && "v" in e ? (o = e.v, i = e.w, s = e.name, arguments.length === 2 && (l = t, a = !0)) : (o = e, i = t, s = n, arguments.length > 2 && (l = r, a = !0)), o = "" + o, i = "" + i, s !== void 0 && (s = "" + s);
|
|
152
|
+
let d = ge(this._isDirected, o, i, s);
|
|
153
|
+
if (d in this._edgeLabels) return a && (this._edgeLabels[d] = l), this;
|
|
154
154
|
if (s !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
155
|
-
this.setNode(o), this.setNode(i), this._edgeLabels[
|
|
156
|
-
let c =
|
|
157
|
-
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[
|
|
155
|
+
this.setNode(o), this.setNode(i), this._edgeLabels[d] = a ? l : this._defaultEdgeLabelFn(o, i, s);
|
|
156
|
+
let c = un(this._isDirected, o, i, s);
|
|
157
|
+
return o = c.v, i = c.w, Object.freeze(c), this._edgeObjs[d] = c, wt(this._preds[i], o), wt(this._sucs[o], i), this._in[i][d] = c, this._out[o][d] = c, this._edgeCount++, this;
|
|
158
158
|
}
|
|
159
159
|
edge(e, t, r) {
|
|
160
160
|
let n = arguments.length === 1 ? Fe(this._isDirected, e) : ge(this._isDirected, e, t, r);
|
|
@@ -207,7 +207,7 @@ function ge(e, t, r, n) {
|
|
|
207
207
|
}
|
|
208
208
|
return o + "" + i + "" + (n === void 0 ? "\0" : n);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function un(e, t, r, n) {
|
|
211
211
|
let o = "" + t, i = "" + r;
|
|
212
212
|
if (!e && o > i) {
|
|
213
213
|
let l = o;
|
|
@@ -219,25 +219,25 @@ function fn(e, t, r, n) {
|
|
|
219
219
|
function Fe(e, t) {
|
|
220
220
|
return ge(e, t.v, t.w, t.name);
|
|
221
221
|
}
|
|
222
|
-
var
|
|
223
|
-
Kt(Ut, { read: () =>
|
|
224
|
-
function
|
|
225
|
-
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes:
|
|
222
|
+
var fn = "4.0.1", Ut = {};
|
|
223
|
+
Kt(Ut, { read: () => bn, write: () => hn });
|
|
224
|
+
function hn(e) {
|
|
225
|
+
let t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes: gn(e), edges: pn(e) }, r = e.graph();
|
|
226
226
|
return r !== void 0 && (t.value = structuredClone(r)), t;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function gn(e) {
|
|
229
229
|
return e.nodes().map((t) => {
|
|
230
230
|
let r = e.node(t), n = e.parent(t), o = { v: t };
|
|
231
231
|
return r !== void 0 && (o.value = r), n !== void 0 && (o.parent = n), o;
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function pn(e) {
|
|
235
235
|
return e.edges().map((t) => {
|
|
236
236
|
let r = e.edge(t), n = { v: t.v, w: t.w };
|
|
237
237
|
return t.name !== void 0 && (n.name = t.name), r !== void 0 && (n.value = r), n;
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function bn(e) {
|
|
241
241
|
let t = new G(e.options);
|
|
242
242
|
return e.value !== void 0 && t.setGraph(e.value), e.nodes.forEach((r) => {
|
|
243
243
|
t.setNode(r.v, r.value), r.parent && t.setParent(r.v, r.parent);
|
|
@@ -246,22 +246,22 @@ function yn(e) {
|
|
|
246
246
|
}), t;
|
|
247
247
|
}
|
|
248
248
|
var Ve = {};
|
|
249
|
-
Kt(Ve, { CycleException: () => _e, bellmanFord: () => Vt, components: () =>
|
|
250
|
-
var
|
|
249
|
+
Kt(Ve, { CycleException: () => _e, bellmanFord: () => Vt, components: () => wn, dijkstra: () => xe, dijkstraAll: () => kn, findCycles: () => xn, floydWarshall: () => Tn, isAcyclic: () => Cn, postorder: () => In, preorder: () => On, prim: () => Mn, shortestPaths: () => jn, tarjan: () => qt, topsort: () => Xt });
|
|
250
|
+
var yn = () => 1;
|
|
251
251
|
function Vt(e, t, r, n) {
|
|
252
|
-
return
|
|
252
|
+
return mn(e, String(t), r || yn, n || function(o) {
|
|
253
253
|
return e.outEdges(o);
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
let o = {}, i, s = 0, l = e.nodes(),
|
|
256
|
+
function mn(e, t, r, n) {
|
|
257
|
+
let o = {}, i, s = 0, l = e.nodes(), a = function(u) {
|
|
258
258
|
let h = r(u);
|
|
259
259
|
o[u.v].distance + h < o[u.w].distance && (o[u.w] = { distance: o[u.v].distance + h, predecessor: u.v }, i = !0);
|
|
260
|
-
},
|
|
260
|
+
}, d = function() {
|
|
261
261
|
l.forEach(function(u) {
|
|
262
262
|
n(u).forEach(function(h) {
|
|
263
263
|
let g = h.v === u ? h.v : h.w, b = g === h.v ? h.w : h.v;
|
|
264
|
-
|
|
264
|
+
a({ v: g, w: b });
|
|
265
265
|
});
|
|
266
266
|
});
|
|
267
267
|
};
|
|
@@ -270,11 +270,11 @@ function wn(e, t, r, n) {
|
|
|
270
270
|
o[u] = { distance: h, predecessor: "" };
|
|
271
271
|
});
|
|
272
272
|
let c = l.length;
|
|
273
|
-
for (let u = 1; u < c && (i = !1, s++,
|
|
274
|
-
if (s === c - 1 && (i = !1,
|
|
273
|
+
for (let u = 1; u < c && (i = !1, s++, d(), !!i); u++) ;
|
|
274
|
+
if (s === c - 1 && (i = !1, d(), i)) throw new Error("The graph contains a negative weight cycle");
|
|
275
275
|
return o;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function wn(e) {
|
|
278
278
|
let t = {}, r = [], n;
|
|
279
279
|
function o(i) {
|
|
280
280
|
i in t || (t[i] = !0, n.push(i), e.successors(i).forEach(o), e.predecessors(i).forEach(o));
|
|
@@ -336,26 +336,26 @@ var Ht = class {
|
|
|
336
336
|
let r = this._arr, n = this._keyIndices, o = r[e], i = r[t];
|
|
337
337
|
r[e] = i, r[t] = o, n[i.key] = e, n[o.key] = t;
|
|
338
338
|
}
|
|
339
|
-
},
|
|
339
|
+
}, vn = () => 1;
|
|
340
340
|
function xe(e, t, r, n) {
|
|
341
341
|
let o = function(i) {
|
|
342
342
|
return e.outEdges(i);
|
|
343
343
|
};
|
|
344
|
-
return
|
|
344
|
+
return En(e, String(t), r || vn, n || o);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
let o = {}, i = new Ht(), s, l,
|
|
348
|
-
let c =
|
|
349
|
-
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " +
|
|
346
|
+
function En(e, t, r, n) {
|
|
347
|
+
let o = {}, i = new Ht(), s, l, a = function(d) {
|
|
348
|
+
let c = d.v !== s ? d.v : d.w, u = o[c], h = r(d), g = l.distance + h;
|
|
349
|
+
if (h < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + d + " Weight: " + h);
|
|
350
350
|
g < u.distance && (u.distance = g, u.predecessor = s, i.decrease(c, g));
|
|
351
351
|
};
|
|
352
|
-
for (e.nodes().forEach(function(
|
|
353
|
-
let c =
|
|
354
|
-
o[
|
|
355
|
-
}); i.size() > 0 && (s = i.removeMin(), l = o[s], l.distance !== Number.POSITIVE_INFINITY); ) n(s).forEach(
|
|
352
|
+
for (e.nodes().forEach(function(d) {
|
|
353
|
+
let c = d === t ? 0 : Number.POSITIVE_INFINITY;
|
|
354
|
+
o[d] = { distance: c, predecessor: "" }, i.add(d, c);
|
|
355
|
+
}); i.size() > 0 && (s = i.removeMin(), l = o[s], l.distance !== Number.POSITIVE_INFINITY); ) n(s).forEach(a);
|
|
356
356
|
return o;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function kn(e, t, r) {
|
|
359
359
|
return e.nodes().reduce(function(n, o) {
|
|
360
360
|
return n[o] = xe(e, o, t, r), n;
|
|
361
361
|
}, {});
|
|
@@ -364,46 +364,46 @@ function qt(e) {
|
|
|
364
364
|
let t = 0, r = [], n = {}, o = [];
|
|
365
365
|
function i(s) {
|
|
366
366
|
let l = n[s] = { onStack: !0, lowlink: t, index: t++ };
|
|
367
|
-
if (r.push(s), e.successors(s).forEach(function(
|
|
368
|
-
|
|
367
|
+
if (r.push(s), e.successors(s).forEach(function(a) {
|
|
368
|
+
a in n ? n[a].onStack && (l.lowlink = Math.min(l.lowlink, n[a].index)) : (i(a), l.lowlink = Math.min(l.lowlink, n[a].lowlink));
|
|
369
369
|
}), l.lowlink === l.index) {
|
|
370
|
-
let
|
|
370
|
+
let a = [], d;
|
|
371
371
|
do
|
|
372
|
-
|
|
373
|
-
while (s !==
|
|
374
|
-
o.push(
|
|
372
|
+
d = r.pop(), n[d].onStack = !1, a.push(d);
|
|
373
|
+
while (s !== d);
|
|
374
|
+
o.push(a);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
return e.nodes().forEach(function(s) {
|
|
378
378
|
s in n || i(s);
|
|
379
379
|
}), o;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function xn(e) {
|
|
382
382
|
return qt(e).filter(function(t) {
|
|
383
383
|
return t.length > 1 || t.length === 1 && e.hasEdge(t[0], t[0]);
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
var
|
|
387
|
-
function
|
|
388
|
-
return
|
|
386
|
+
var _n = () => 1;
|
|
387
|
+
function Tn(e, t, r) {
|
|
388
|
+
return Nn(e, t || _n, r || function(n) {
|
|
389
389
|
return e.outEdges(n);
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Nn(e, t, r) {
|
|
393
393
|
let n = {}, o = e.nodes();
|
|
394
394
|
return o.forEach(function(i) {
|
|
395
395
|
n[i] = {}, n[i][i] = { distance: 0, predecessor: "" }, o.forEach(function(s) {
|
|
396
396
|
i !== s && (n[i][s] = { distance: Number.POSITIVE_INFINITY, predecessor: "" });
|
|
397
397
|
}), r(i).forEach(function(s) {
|
|
398
|
-
let l = s.v === i ? s.w : s.v,
|
|
399
|
-
n[i][l] = { distance:
|
|
398
|
+
let l = s.v === i ? s.w : s.v, a = t(s);
|
|
399
|
+
n[i][l] = { distance: a, predecessor: i };
|
|
400
400
|
});
|
|
401
401
|
}), o.forEach(function(i) {
|
|
402
402
|
let s = n[i];
|
|
403
403
|
o.forEach(function(l) {
|
|
404
|
-
let
|
|
405
|
-
o.forEach(function(
|
|
406
|
-
let c =
|
|
404
|
+
let a = n[l];
|
|
405
|
+
o.forEach(function(d) {
|
|
406
|
+
let c = a[i], u = s[d], h = a[d], g = c.distance + u.distance;
|
|
407
407
|
g < h.distance && (h.distance = g, h.predecessor = u.predecessor);
|
|
408
408
|
});
|
|
409
409
|
});
|
|
@@ -423,7 +423,7 @@ function Xt(e) {
|
|
|
423
423
|
if (e.sinks().forEach(o), Object.keys(t).length !== e.nodeCount()) throw new _e();
|
|
424
424
|
return n;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Cn(e) {
|
|
427
427
|
try {
|
|
428
428
|
Xt(e);
|
|
429
429
|
} catch (t) {
|
|
@@ -432,11 +432,11 @@ function Sn(e) {
|
|
|
432
432
|
}
|
|
433
433
|
return !0;
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function Sn(e, t, r, n, o) {
|
|
436
436
|
Array.isArray(t) || (t = [t]);
|
|
437
437
|
let i = (l) => {
|
|
438
|
-
var
|
|
439
|
-
return (
|
|
438
|
+
var a;
|
|
439
|
+
return (a = e.isDirected() ? e.successors(l) : e.neighbors(l)) != null ? a : [];
|
|
440
440
|
}, s = {};
|
|
441
441
|
return t.forEach(function(l) {
|
|
442
442
|
if (!e.hasNode(l)) throw new Error("Graph does not have node: " + l);
|
|
@@ -449,28 +449,28 @@ function Jt(e, t, r, n, o, i, s) {
|
|
|
449
449
|
}), r && (s = i(s, t))), s;
|
|
450
450
|
}
|
|
451
451
|
function Zt(e, t, r) {
|
|
452
|
-
return
|
|
452
|
+
return Sn(e, t, r, function(n, o) {
|
|
453
453
|
return n.push(o), n;
|
|
454
454
|
}, []);
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function In(e, t) {
|
|
457
457
|
return Zt(e, t, "post");
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function On(e, t) {
|
|
460
460
|
return Zt(e, t, "pre");
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Mn(e, t) {
|
|
463
463
|
let r = new G(), n = {}, o = new Ht(), i;
|
|
464
|
-
function s(
|
|
465
|
-
let
|
|
464
|
+
function s(a) {
|
|
465
|
+
let d = a.v === i ? a.w : a.v, c = o.priority(d);
|
|
466
466
|
if (c !== void 0) {
|
|
467
|
-
let u = t(
|
|
468
|
-
u < c && (n[
|
|
467
|
+
let u = t(a);
|
|
468
|
+
u < c && (n[d] = i, o.decrease(d, u));
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
if (e.nodeCount() === 0) return r;
|
|
472
|
-
e.nodes().forEach(function(
|
|
473
|
-
o.add(
|
|
472
|
+
e.nodes().forEach(function(a) {
|
|
473
|
+
o.add(a, Number.POSITIVE_INFINITY), r.setNode(a);
|
|
474
474
|
}), o.decrease(e.nodes()[0], 0);
|
|
475
475
|
let l = !1;
|
|
476
476
|
for (; o.size() > 0; ) {
|
|
@@ -483,19 +483,19 @@ function jn(e, t) {
|
|
|
483
483
|
}
|
|
484
484
|
return r;
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
return
|
|
486
|
+
function jn(e, t, r, n) {
|
|
487
|
+
return Fn(e, t, r, n ?? ((o) => {
|
|
488
488
|
let i = e.outEdges(o);
|
|
489
489
|
return i ?? [];
|
|
490
490
|
}));
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function Fn(e, t, r, n) {
|
|
493
493
|
if (r === void 0) return xe(e, t, r, n);
|
|
494
494
|
let o = !1, i = e.nodes();
|
|
495
495
|
for (let s = 0; s < i.length; s++) {
|
|
496
496
|
let l = n(i[s]);
|
|
497
|
-
for (let
|
|
498
|
-
let
|
|
497
|
+
for (let a = 0; a < l.length; a++) {
|
|
498
|
+
let d = l[a], c = d.v === i[s] ? d.v : d.w, u = c === d.v ? d.w : d.v;
|
|
499
499
|
r({ v: c, w: u }) < 0 && (o = !0);
|
|
500
500
|
}
|
|
501
501
|
if (o) return Vt(e, t, r, n);
|
|
@@ -507,7 +507,7 @@ function fe(e, t, r, n) {
|
|
|
507
507
|
for (; e.hasNode(o); ) o = He(n);
|
|
508
508
|
return r.dummy = t, e.setNode(o, r), o;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function zn(e) {
|
|
511
511
|
let t = new G().setGraph(e.graph());
|
|
512
512
|
return e.nodes().forEach((r) => t.setNode(r, e.node(r))), e.edges().forEach((r) => {
|
|
513
513
|
let n = t.edge(r.v, r.w) || { weight: 0, minlen: 1 }, o = e.edge(r);
|
|
@@ -525,8 +525,8 @@ function Qt(e) {
|
|
|
525
525
|
function Et(e, t) {
|
|
526
526
|
let r = e.x, n = e.y, o = t.x - r, i = t.y - n, s = e.width / 2, l = e.height / 2;
|
|
527
527
|
if (!o && !i) throw new Error("Not possible to find intersection inside of the rectangle");
|
|
528
|
-
let
|
|
529
|
-
return Math.abs(i) * s > Math.abs(o) * l ? (i < 0 && (l = -l),
|
|
528
|
+
let a, d;
|
|
529
|
+
return Math.abs(i) * s > Math.abs(o) * l ? (i < 0 && (l = -l), a = l * o / i, d = l) : (o < 0 && (s = -s), a = s, d = s * i / o), { x: r + a, y: n + d };
|
|
530
530
|
}
|
|
531
531
|
function ye(e) {
|
|
532
532
|
let t = pe(tr(e) + 1).map(() => []);
|
|
@@ -535,7 +535,7 @@ function ye(e) {
|
|
|
535
535
|
o !== void 0 && (t[o] || (t[o] = []), t[o][n.order] = r);
|
|
536
536
|
}), t;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function Rn(e) {
|
|
539
539
|
let t = e.nodes().map((n) => {
|
|
540
540
|
let o = e.node(n).rank;
|
|
541
541
|
return o === void 0 ? Number.MAX_VALUE : o;
|
|
@@ -545,7 +545,7 @@ function Dn(e) {
|
|
|
545
545
|
Object.hasOwn(o, "rank") && (o.rank -= r);
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Dn(e) {
|
|
549
549
|
let t = e.nodes().map((s) => e.node(s).rank).filter((s) => s !== void 0), r = K(Math.min, t), n = [];
|
|
550
550
|
e.nodes().forEach((s) => {
|
|
551
551
|
let l = e.node(s).rank - r;
|
|
@@ -553,14 +553,14 @@ function Ln(e) {
|
|
|
553
553
|
});
|
|
554
554
|
let o = 0, i = e.graph().nodeRankFactor;
|
|
555
555
|
Array.from(n).forEach((s, l) => {
|
|
556
|
-
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((
|
|
556
|
+
s === void 0 && l % i !== 0 ? --o : s !== void 0 && o && s.forEach((a) => e.node(a).rank += o);
|
|
557
557
|
});
|
|
558
558
|
}
|
|
559
559
|
function kt(e, t, r, n) {
|
|
560
560
|
let o = { width: 0, height: 0 };
|
|
561
561
|
return arguments.length >= 4 && (o.rank = r, o.order = n), fe(e, "border", o, t);
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Ln(e, t = er) {
|
|
564
564
|
let r = [];
|
|
565
565
|
for (let n = 0; n < e.length; n += t) {
|
|
566
566
|
let o = e.slice(n, n + t);
|
|
@@ -571,7 +571,7 @@ function An(e, t = er) {
|
|
|
571
571
|
var er = 65535;
|
|
572
572
|
function K(e, t) {
|
|
573
573
|
if (t.length > er) {
|
|
574
|
-
let r =
|
|
574
|
+
let r = Ln(t);
|
|
575
575
|
return e(...r.map((n) => e(...n)));
|
|
576
576
|
} else return e(...t);
|
|
577
577
|
}
|
|
@@ -582,7 +582,7 @@ function tr(e) {
|
|
|
582
582
|
});
|
|
583
583
|
return K(Math.max, t);
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function An(e, t) {
|
|
586
586
|
let r = { lhs: [], rhs: [] };
|
|
587
587
|
return e.forEach((n) => {
|
|
588
588
|
t(n) ? r.lhs.push(n) : r.rhs.push(n);
|
|
@@ -599,9 +599,9 @@ function rr(e, t) {
|
|
|
599
599
|
function nr(e, t) {
|
|
600
600
|
return t();
|
|
601
601
|
}
|
|
602
|
-
var
|
|
602
|
+
var Pn = 0;
|
|
603
603
|
function He(e) {
|
|
604
|
-
let t = ++
|
|
604
|
+
let t = ++Pn;
|
|
605
605
|
return e + ("" + t);
|
|
606
606
|
}
|
|
607
607
|
function pe(e, t, r = 1) {
|
|
@@ -621,12 +621,12 @@ function Ne(e, t) {
|
|
|
621
621
|
let r;
|
|
622
622
|
return typeof t == "string" ? r = (n) => n[t] : r = t, Object.entries(e).reduce((n, [o, i]) => (n[o] = r(i, o), n), {});
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function Bn(e, t) {
|
|
625
625
|
return e.reduce((r, n, o) => (r[n] = t[o], r), {});
|
|
626
626
|
}
|
|
627
|
-
var Ce = "\0",
|
|
627
|
+
var Ce = "\0", Wn = "3.0.0", Gn = class {
|
|
628
628
|
constructor() {
|
|
629
|
-
|
|
629
|
+
an(this, "_sentinel");
|
|
630
630
|
let e = {};
|
|
631
631
|
e._next = e._prev = e, this._sentinel = e;
|
|
632
632
|
}
|
|
@@ -640,30 +640,30 @@ var Ce = "\0", Gn = "3.0.0", $n = class {
|
|
|
640
640
|
}
|
|
641
641
|
toString() {
|
|
642
642
|
let e = [], t = this._sentinel, r = t._prev;
|
|
643
|
-
for (; r !== t; ) e.push(JSON.stringify(r,
|
|
643
|
+
for (; r !== t; ) e.push(JSON.stringify(r, $n)), r = r._prev;
|
|
644
644
|
return "[" + e.join(", ") + "]";
|
|
645
645
|
}
|
|
646
646
|
};
|
|
647
647
|
function xt(e) {
|
|
648
648
|
e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function $n(e, t) {
|
|
651
651
|
if (e !== "_next" && e !== "_prev") return t;
|
|
652
652
|
}
|
|
653
|
-
var
|
|
654
|
-
function
|
|
653
|
+
var Yn = Gn, Kn = () => 1;
|
|
654
|
+
function Un(e, t) {
|
|
655
655
|
if (e.nodeCount() <= 1) return [];
|
|
656
|
-
let r =
|
|
657
|
-
return
|
|
656
|
+
let r = Hn(e, t || Kn);
|
|
657
|
+
return Vn(r.graph, r.buckets, r.zeroIdx).flatMap((n) => e.outEdges(n.v, n.w) || []);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function Vn(e, t, r) {
|
|
660
660
|
var n;
|
|
661
661
|
let o = [], i = t[t.length - 1], s = t[0], l;
|
|
662
662
|
for (; e.nodeCount(); ) {
|
|
663
663
|
for (; l = s.dequeue(); ) ze(e, t, r, l);
|
|
664
664
|
for (; l = i.dequeue(); ) ze(e, t, r, l);
|
|
665
665
|
if (e.nodeCount()) {
|
|
666
|
-
for (let
|
|
666
|
+
for (let a = t.length - 2; a > 0; --a) if (l = (n = t[a]) == null ? void 0 : n.dequeue(), l) {
|
|
667
667
|
o = o.concat(ze(e, t, r, l, !0) || []);
|
|
668
668
|
break;
|
|
669
669
|
}
|
|
@@ -674,24 +674,24 @@ function Hn(e, t, r) {
|
|
|
674
674
|
function ze(e, t, r, n, o) {
|
|
675
675
|
let i = [], s = o ? i : void 0;
|
|
676
676
|
return (e.inEdges(n.v) || []).forEach((l) => {
|
|
677
|
-
let
|
|
678
|
-
o && i.push({ v: l.v, w: l.w }),
|
|
677
|
+
let a = e.edge(l), d = e.node(l.v);
|
|
678
|
+
o && i.push({ v: l.v, w: l.w }), d.out -= a, Ge(t, r, d);
|
|
679
679
|
}), (e.outEdges(n.v) || []).forEach((l) => {
|
|
680
|
-
let
|
|
681
|
-
c.in -=
|
|
680
|
+
let a = e.edge(l), d = l.w, c = e.node(d);
|
|
681
|
+
c.in -= a, Ge(t, r, c);
|
|
682
682
|
}), e.removeNode(n.v), s;
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function Hn(e, t) {
|
|
685
685
|
let r = new G(), n = 0, o = 0;
|
|
686
686
|
e.nodes().forEach((l) => {
|
|
687
687
|
r.setNode(l, { v: l, in: 0, out: 0 });
|
|
688
688
|
}), e.edges().forEach((l) => {
|
|
689
|
-
let
|
|
689
|
+
let a = r.edge(l.v, l.w) || 0, d = t(l), c = a + d;
|
|
690
690
|
r.setEdge(l.v, l.w, c);
|
|
691
691
|
let u = r.node(l.v), h = r.node(l.w);
|
|
692
|
-
o = Math.max(o, u.out +=
|
|
692
|
+
o = Math.max(o, u.out += d), n = Math.max(n, h.in += d);
|
|
693
693
|
});
|
|
694
|
-
let i =
|
|
694
|
+
let i = qn(o + n + 3).map(() => new Yn()), s = n + 1;
|
|
695
695
|
return r.nodes().forEach((l) => {
|
|
696
696
|
Ge(i, s, r.node(l));
|
|
697
697
|
}), { graph: r, buckets: i, zeroIdx: s };
|
|
@@ -700,13 +700,13 @@ function Ge(e, t, r) {
|
|
|
700
700
|
var n, o, i;
|
|
701
701
|
r.out ? r.in ? (i = e[r.out - r.in + t]) == null || i.enqueue(r) : (o = e[e.length - 1]) == null || o.enqueue(r) : (n = e[0]) == null || n.enqueue(r);
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function qn(e) {
|
|
704
704
|
let t = [];
|
|
705
705
|
for (let r = 0; r < e; r++) t.push(r);
|
|
706
706
|
return t;
|
|
707
707
|
}
|
|
708
|
-
function
|
|
709
|
-
(e.graph().acyclicer === "greedy" ?
|
|
708
|
+
function Xn(e) {
|
|
709
|
+
(e.graph().acyclicer === "greedy" ? Un(e, t(e)) : Jn(e)).forEach((r) => {
|
|
710
710
|
let n = e.edge(r);
|
|
711
711
|
e.removeEdge(r), n.forwardName = r.name, n.reversed = !0, e.setEdge(r.w, r.v, n, He("rev"));
|
|
712
712
|
});
|
|
@@ -714,7 +714,7 @@ function Jn(e) {
|
|
|
714
714
|
return (n) => r.edge(n).weight;
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function Jn(e) {
|
|
718
718
|
let t = [], r = {}, n = {};
|
|
719
719
|
function o(i) {
|
|
720
720
|
Object.hasOwn(n, i) || (n[i] = !0, r[i] = !0, e.outEdges(i).forEach((s) => {
|
|
@@ -723,7 +723,7 @@ function Zn(e) {
|
|
|
723
723
|
}
|
|
724
724
|
return e.nodes().forEach(o), t;
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function Zn(e) {
|
|
727
727
|
e.edges().forEach((t) => {
|
|
728
728
|
let r = e.edge(t);
|
|
729
729
|
if (r.reversed) {
|
|
@@ -733,18 +733,18 @@ function Qn(e) {
|
|
|
733
733
|
}
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
|
-
function
|
|
737
|
-
e.graph().dummyChains = [], e.edges().forEach((t) =>
|
|
736
|
+
function Qn(e) {
|
|
737
|
+
e.graph().dummyChains = [], e.edges().forEach((t) => eo(e, t));
|
|
738
738
|
}
|
|
739
|
-
function
|
|
740
|
-
let r = t.v, n = e.node(r).rank, o = t.w, i = e.node(o).rank, s = t.name, l = e.edge(t),
|
|
739
|
+
function eo(e, t) {
|
|
740
|
+
let r = t.v, n = e.node(r).rank, o = t.w, i = e.node(o).rank, s = t.name, l = e.edge(t), a = l.labelRank;
|
|
741
741
|
if (i === n + 1) return;
|
|
742
742
|
e.removeEdge(t);
|
|
743
|
-
let
|
|
744
|
-
for (u = 0, ++n; n < i; ++u, ++n) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: n },
|
|
743
|
+
let d, c, u;
|
|
744
|
+
for (u = 0, ++n; n < i; ++u, ++n) l.points = [], c = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: n }, d = fe(e, "edge", c, "_d"), n === a && (c.width = l.width, c.height = l.height, c.dummy = "edge-label", c.labelpos = l.labelpos), e.setEdge(r, d, { weight: l.weight }, s), u === 0 && e.graph().dummyChains.push(d), r = d;
|
|
745
745
|
e.setEdge(r, o, { weight: l.weight }, s);
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function to(e) {
|
|
748
748
|
e.graph().dummyChains.forEach((t) => {
|
|
749
749
|
let r = e.node(t), n = r.edgeLabel, o;
|
|
750
750
|
for (e.setEdge(r.edgeObj, n); r.dummy; ) o = e.successors(t)[0], e.removeNode(t), n.points.push({ x: r.x, y: r.y }), r.dummy === "edge-label" && (n.x = r.x, n.y = r.y, n.width = r.width, n.height = r.height), t = o, r = e.node(t);
|
|
@@ -756,7 +756,7 @@ function qe(e) {
|
|
|
756
756
|
let o = e.node(n);
|
|
757
757
|
if (Object.hasOwn(t, n)) return o.rank;
|
|
758
758
|
t[n] = !0;
|
|
759
|
-
let i = e.outEdges(n), s = i ? i.map((
|
|
759
|
+
let i = e.outEdges(n), s = i ? i.map((a) => a == null ? Number.POSITIVE_INFINITY : r(a.w) - e.edge(a).minlen) : [], l = K(Math.min, s);
|
|
760
760
|
return l === Number.POSITIVE_INFINITY && (l = 0), o.rank = l;
|
|
761
761
|
}
|
|
762
762
|
e.sources().forEach(r);
|
|
@@ -764,17 +764,17 @@ function qe(e) {
|
|
|
764
764
|
function ue(e, t) {
|
|
765
765
|
return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
|
|
766
766
|
}
|
|
767
|
-
var or =
|
|
768
|
-
function
|
|
767
|
+
var or = ro;
|
|
768
|
+
function ro(e) {
|
|
769
769
|
let t = new G({ directed: !1 }), r = e.nodes();
|
|
770
770
|
if (r.length === 0) throw new Error("Graph must have at least one node");
|
|
771
771
|
let n = r[0], o = e.nodeCount();
|
|
772
772
|
t.setNode(n, {});
|
|
773
773
|
let i, s;
|
|
774
|
-
for (;
|
|
774
|
+
for (; no(t, e) < o && (i = oo(t, e), !!i); ) s = t.hasNode(i.v) ? ue(e, i) : -ue(e, i), io(t, e, s);
|
|
775
775
|
return t;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function no(e, t) {
|
|
778
778
|
function r(n) {
|
|
779
779
|
let o = t.nodeEdges(n);
|
|
780
780
|
o && o.forEach((i) => {
|
|
@@ -784,34 +784,34 @@ function oo(e, t) {
|
|
|
784
784
|
}
|
|
785
785
|
return e.nodes().forEach(r), e.nodeCount();
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function oo(e, t) {
|
|
788
788
|
return t.edges().reduce((r, n) => {
|
|
789
789
|
let o = Number.POSITIVE_INFINITY;
|
|
790
790
|
return e.hasNode(n.v) !== e.hasNode(n.w) && (o = ue(t, n)), o < r[0] ? [o, n] : r;
|
|
791
791
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function io(e, t, r) {
|
|
794
794
|
e.nodes().forEach((n) => t.node(n).rank += r);
|
|
795
795
|
}
|
|
796
|
-
var { preorder:
|
|
796
|
+
var { preorder: so, postorder: lo } = Ve, ao = se;
|
|
797
797
|
se.initLowLimValues = Je;
|
|
798
798
|
se.initCutValues = Xe;
|
|
799
799
|
se.calcCutValue = ir;
|
|
800
800
|
se.leaveEdge = lr;
|
|
801
|
-
se.enterEdge =
|
|
802
|
-
se.exchangeEdges =
|
|
801
|
+
se.enterEdge = dr;
|
|
802
|
+
se.exchangeEdges = ar;
|
|
803
803
|
function se(e) {
|
|
804
|
-
e =
|
|
804
|
+
e = zn(e), qe(e);
|
|
805
805
|
let t = or(e);
|
|
806
806
|
Je(t), Xe(t, e);
|
|
807
807
|
let r, n;
|
|
808
|
-
for (; r = lr(t); ) n =
|
|
808
|
+
for (; r = lr(t); ) n = dr(t, e, r), ar(t, e, r, n);
|
|
809
809
|
}
|
|
810
810
|
function Xe(e, t) {
|
|
811
|
-
let r =
|
|
812
|
-
r = r.slice(0, r.length - 1), r.forEach((n) =>
|
|
811
|
+
let r = lo(e, e.nodes());
|
|
812
|
+
r = r.slice(0, r.length - 1), r.forEach((n) => co(e, t, n));
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function co(e, t, r) {
|
|
815
815
|
let n = e.node(r).parent, o = e.edge(r, n);
|
|
816
816
|
o.cutvalue = ir(e, t, r);
|
|
817
817
|
}
|
|
@@ -819,11 +819,11 @@ function ir(e, t, r) {
|
|
|
819
819
|
let n = e.node(r).parent, o = !0, i = t.edge(r, n), s = 0;
|
|
820
820
|
i || (o = !1, i = t.edge(n, r)), s = i.weight;
|
|
821
821
|
let l = t.nodeEdges(r);
|
|
822
|
-
return l && l.forEach((
|
|
823
|
-
let
|
|
822
|
+
return l && l.forEach((a) => {
|
|
823
|
+
let d = a.v === r, c = d ? a.w : a.v;
|
|
824
824
|
if (c !== n) {
|
|
825
|
-
let u =
|
|
826
|
-
if (s += u ? h : -h,
|
|
825
|
+
let u = d === o, h = t.edge(a).weight;
|
|
826
|
+
if (s += u ? h : -h, fo(e, r, c)) {
|
|
827
827
|
let g = e.edge(r, c).cutvalue;
|
|
828
828
|
s += u ? -g : g;
|
|
829
829
|
}
|
|
@@ -837,40 +837,40 @@ function sr(e, t, r, n, o) {
|
|
|
837
837
|
let i = r, s = e.node(n);
|
|
838
838
|
t[n] = !0;
|
|
839
839
|
let l = e.neighbors(n);
|
|
840
|
-
return l && l.forEach((
|
|
841
|
-
Object.hasOwn(t,
|
|
840
|
+
return l && l.forEach((a) => {
|
|
841
|
+
Object.hasOwn(t, a) || (r = sr(e, t, r, a, n));
|
|
842
842
|
}), s.low = i, s.lim = r++, o ? s.parent = o : delete s.parent, r;
|
|
843
843
|
}
|
|
844
844
|
function lr(e) {
|
|
845
845
|
return e.edges().find((t) => e.edge(t).cutvalue < 0);
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function dr(e, t, r) {
|
|
848
848
|
let n = r.v, o = r.w;
|
|
849
849
|
t.hasEdge(n, o) || (n = r.w, o = r.v);
|
|
850
|
-
let i = e.node(n), s = e.node(o), l = i,
|
|
851
|
-
return i.lim > s.lim && (l = s,
|
|
850
|
+
let i = e.node(n), s = e.node(o), l = i, a = !1;
|
|
851
|
+
return i.lim > s.lim && (l = s, a = !0), t.edges().filter((d) => a === _t(e, e.node(d.v), l) && a !== _t(e, e.node(d.w), l)).reduce((d, c) => ue(t, c) < ue(t, d) ? c : d);
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function ar(e, t, r, n) {
|
|
854
854
|
let o = r.v, i = r.w;
|
|
855
|
-
e.removeEdge(o, i), e.setEdge(n.v, n.w, {}), Je(e), Xe(e, t),
|
|
855
|
+
e.removeEdge(o, i), e.setEdge(n.v, n.w, {}), Je(e), Xe(e, t), uo(e, t);
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function uo(e, t) {
|
|
858
858
|
let r = e.nodes().find((o) => !e.node(o).parent);
|
|
859
859
|
if (!r) return;
|
|
860
|
-
let n =
|
|
860
|
+
let n = so(e, [r]);
|
|
861
861
|
n = n.slice(1), n.forEach((o) => {
|
|
862
862
|
let i = e.node(o).parent, s = t.edge(o, i), l = !1;
|
|
863
863
|
s || (s = t.edge(i, o), l = !0), t.node(o).rank = t.node(i).rank + (l ? s.minlen : -s.minlen);
|
|
864
864
|
});
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function fo(e, t, r) {
|
|
867
867
|
return e.hasEdge(t, r);
|
|
868
868
|
}
|
|
869
869
|
function _t(e, t, r) {
|
|
870
870
|
return r.low <= t.lim && t.lim <= r.lim;
|
|
871
871
|
}
|
|
872
|
-
var
|
|
873
|
-
function
|
|
872
|
+
var ho = go;
|
|
873
|
+
function go(e) {
|
|
874
874
|
let t = e.graph().ranker;
|
|
875
875
|
if (typeof t == "function") return t(e);
|
|
876
876
|
switch (t) {
|
|
@@ -878,10 +878,10 @@ function po(e) {
|
|
|
878
878
|
Tt(e);
|
|
879
879
|
break;
|
|
880
880
|
case "tight-tree":
|
|
881
|
-
|
|
881
|
+
bo(e);
|
|
882
882
|
break;
|
|
883
883
|
case "longest-path":
|
|
884
|
-
|
|
884
|
+
po(e);
|
|
885
885
|
break;
|
|
886
886
|
case "none":
|
|
887
887
|
break;
|
|
@@ -889,42 +889,42 @@ function po(e) {
|
|
|
889
889
|
Tt(e);
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
|
-
var
|
|
893
|
-
function
|
|
892
|
+
var po = qe;
|
|
893
|
+
function bo(e) {
|
|
894
894
|
qe(e), or(e);
|
|
895
895
|
}
|
|
896
896
|
function Tt(e) {
|
|
897
|
-
|
|
897
|
+
ao(e);
|
|
898
898
|
}
|
|
899
|
-
var
|
|
900
|
-
function
|
|
901
|
-
let t =
|
|
899
|
+
var yo = mo;
|
|
900
|
+
function mo(e) {
|
|
901
|
+
let t = vo(e);
|
|
902
902
|
e.graph().dummyChains.forEach((r) => {
|
|
903
|
-
let n = e.node(r), o = n.edgeObj, i =
|
|
903
|
+
let n = e.node(r), o = n.edgeObj, i = wo(e, t, o.v, o.w), s = i.path, l = i.lca, a = 0, d = s[a], c = !0;
|
|
904
904
|
for (; r !== o.w; ) {
|
|
905
905
|
if (n = e.node(r), c) {
|
|
906
|
-
for (; (
|
|
907
|
-
|
|
906
|
+
for (; (d = s[a]) !== l && e.node(d).maxRank < n.rank; ) a++;
|
|
907
|
+
d === l && (c = !1);
|
|
908
908
|
}
|
|
909
909
|
if (!c) {
|
|
910
|
-
for (;
|
|
911
|
-
|
|
910
|
+
for (; a < s.length - 1 && e.node(s[a + 1]).minRank <= n.rank; ) a++;
|
|
911
|
+
d = s[a];
|
|
912
912
|
}
|
|
913
|
-
|
|
913
|
+
d !== void 0 && e.setParent(r, d), r = e.successors(r)[0];
|
|
914
914
|
}
|
|
915
915
|
});
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
let o = [], i = [], s = Math.min(t[r].low, t[n].low), l = Math.max(t[r].lim, t[n].lim),
|
|
919
|
-
|
|
917
|
+
function wo(e, t, r, n) {
|
|
918
|
+
let o = [], i = [], s = Math.min(t[r].low, t[n].low), l = Math.max(t[r].lim, t[n].lim), a;
|
|
919
|
+
a = r;
|
|
920
920
|
do
|
|
921
|
-
|
|
922
|
-
while (
|
|
923
|
-
let
|
|
924
|
-
for (; (c = e.parent(c)) !==
|
|
925
|
-
return { path: o.concat(i.reverse()), lca:
|
|
921
|
+
a = e.parent(a), o.push(a);
|
|
922
|
+
while (a && (t[a].low > s || l > t[a].lim));
|
|
923
|
+
let d = a, c = n;
|
|
924
|
+
for (; (c = e.parent(c)) !== d; ) i.push(c);
|
|
925
|
+
return { path: o.concat(i.reverse()), lca: d };
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function vo(e) {
|
|
928
928
|
let t = {}, r = 0;
|
|
929
929
|
function n(o) {
|
|
930
930
|
let i = r;
|
|
@@ -932,28 +932,28 @@ function Eo(e) {
|
|
|
932
932
|
}
|
|
933
933
|
return e.children(Ce).forEach(n), t;
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
let t = fe(e, "root", {}, "_root"), r =
|
|
935
|
+
function Eo(e) {
|
|
936
|
+
let t = fe(e, "root", {}, "_root"), r = ko(e), n = Object.values(r), o = K(Math.max, n) - 1, i = 2 * o + 1;
|
|
937
937
|
e.graph().nestingRoot = t, e.edges().forEach((l) => e.edge(l).minlen *= i);
|
|
938
|
-
let s =
|
|
938
|
+
let s = xo(e) + 1;
|
|
939
939
|
e.children(Ce).forEach((l) => cr(e, t, i, s, o, r, l)), e.graph().nodeRankFactor = i;
|
|
940
940
|
}
|
|
941
941
|
function cr(e, t, r, n, o, i, s) {
|
|
942
942
|
var l;
|
|
943
|
-
let
|
|
944
|
-
if (!
|
|
943
|
+
let a = e.children(s);
|
|
944
|
+
if (!a.length) {
|
|
945
945
|
s !== t && e.setEdge(t, s, { weight: 0, minlen: r });
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
948
|
-
let
|
|
949
|
-
e.setParent(
|
|
948
|
+
let d = kt(e, "_bt"), c = kt(e, "_bb"), u = e.node(s);
|
|
949
|
+
e.setParent(d, s), u.borderTop = d, e.setParent(c, s), u.borderBottom = c, a.forEach((h) => {
|
|
950
950
|
var g;
|
|
951
951
|
cr(e, t, r, n, o, i, h);
|
|
952
952
|
let b = e.node(h), y = b.borderTop ? b.borderTop : h, p = b.borderBottom ? b.borderBottom : h, v = b.borderTop ? n : 2 * n, N = y !== p ? 1 : o - ((g = i[s]) != null ? g : 0) + 1;
|
|
953
|
-
e.setEdge(
|
|
954
|
-
}), e.parent(s) || e.setEdge(t,
|
|
953
|
+
e.setEdge(d, y, { weight: v, minlen: N, nestingEdge: !0 }), e.setEdge(p, c, { weight: v, minlen: N, nestingEdge: !0 });
|
|
954
|
+
}), e.parent(s) || e.setEdge(t, d, { weight: 0, minlen: o + ((l = i[s]) != null ? l : 0) });
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function ko(e) {
|
|
957
957
|
let t = {};
|
|
958
958
|
function r(n, o) {
|
|
959
959
|
let i = e.children(n);
|
|
@@ -961,17 +961,17 @@ function xo(e) {
|
|
|
961
961
|
}
|
|
962
962
|
return e.children(Ce).forEach((n) => r(n, 1)), t;
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function xo(e) {
|
|
965
965
|
return e.edges().reduce((t, r) => t + e.edge(r).weight, 0);
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function _o(e) {
|
|
968
968
|
let t = e.graph();
|
|
969
969
|
e.removeNode(t.nestingRoot), delete t.nestingRoot, e.edges().forEach((r) => {
|
|
970
970
|
e.edge(r).nestingEdge && e.removeEdge(r);
|
|
971
971
|
});
|
|
972
972
|
}
|
|
973
|
-
var
|
|
974
|
-
function
|
|
973
|
+
var To = No;
|
|
974
|
+
function No(e) {
|
|
975
975
|
function t(r) {
|
|
976
976
|
let n = e.children(r), o = e.node(r);
|
|
977
977
|
if (n.length && n.forEach(t), Object.hasOwn(o, "minRank")) {
|
|
@@ -982,18 +982,18 @@ function Co(e) {
|
|
|
982
982
|
e.children(Ce).forEach(t);
|
|
983
983
|
}
|
|
984
984
|
function Nt(e, t, r, n, o, i) {
|
|
985
|
-
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1],
|
|
986
|
-
o[t][i] =
|
|
985
|
+
let s = { width: 0, height: 0, rank: i, borderType: t }, l = o[t][i - 1], a = fe(e, "border", s, r);
|
|
986
|
+
o[t][i] = a, e.setParent(a, n), l && e.setEdge(l, a, { weight: 1 });
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function Co(e) {
|
|
989
989
|
var t;
|
|
990
990
|
let r = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
991
991
|
(r === "lr" || r === "rl") && ur(e);
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function So(e) {
|
|
994
994
|
var t;
|
|
995
995
|
let r = (t = e.graph().rankdir) == null ? void 0 : t.toLowerCase();
|
|
996
|
-
(r === "bt" || r === "rl") &&
|
|
996
|
+
(r === "bt" || r === "rl") && Io(e), (r === "lr" || r === "rl") && (Oo(e), ur(e));
|
|
997
997
|
}
|
|
998
998
|
function ur(e) {
|
|
999
999
|
e.nodes().forEach((t) => Ct(e.node(t))), e.edges().forEach((t) => Ct(e.edge(t)));
|
|
@@ -1002,7 +1002,7 @@ function Ct(e) {
|
|
|
1002
1002
|
let t = e.width;
|
|
1003
1003
|
e.width = e.height, e.height = t;
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function Io(e) {
|
|
1006
1006
|
e.nodes().forEach((t) => Re(e.node(t))), e.edges().forEach((t) => {
|
|
1007
1007
|
var r;
|
|
1008
1008
|
let n = e.edge(t);
|
|
@@ -1012,7 +1012,7 @@ function Oo(e) {
|
|
|
1012
1012
|
function Re(e) {
|
|
1013
1013
|
e.y = -e.y;
|
|
1014
1014
|
}
|
|
1015
|
-
function
|
|
1015
|
+
function Oo(e) {
|
|
1016
1016
|
e.nodes().forEach((t) => De(e.node(t))), e.edges().forEach((t) => {
|
|
1017
1017
|
var r;
|
|
1018
1018
|
let n = e.edge(t);
|
|
@@ -1023,54 +1023,54 @@ function De(e) {
|
|
|
1023
1023
|
let t = e.x;
|
|
1024
1024
|
e.x = e.y, e.y = t;
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1026
|
+
function Mo(e) {
|
|
1027
1027
|
let t = {}, r = e.nodes().filter((l) => !e.children(l).length), n = r.map((l) => e.node(l).rank), o = K(Math.max, n), i = pe(o + 1).map(() => []);
|
|
1028
1028
|
function s(l) {
|
|
1029
1029
|
if (t[l]) return;
|
|
1030
1030
|
t[l] = !0;
|
|
1031
|
-
let
|
|
1032
|
-
i[
|
|
1033
|
-
let
|
|
1034
|
-
|
|
1031
|
+
let a = e.node(l);
|
|
1032
|
+
i[a.rank].push(l);
|
|
1033
|
+
let d = e.successors(l);
|
|
1034
|
+
d && d.forEach(s);
|
|
1035
1035
|
}
|
|
1036
|
-
return r.sort((l,
|
|
1036
|
+
return r.sort((l, a) => e.node(l).rank - e.node(a).rank).forEach(s), i;
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function jo(e, t) {
|
|
1039
1039
|
let r = 0;
|
|
1040
|
-
for (let n = 1; n < t.length; ++n) r +=
|
|
1040
|
+
for (let n = 1; n < t.length; ++n) r += Fo(e, t[n - 1], t[n]);
|
|
1041
1041
|
return r;
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1044
|
-
let n =
|
|
1045
|
-
let c = e.outEdges(
|
|
1043
|
+
function Fo(e, t, r) {
|
|
1044
|
+
let n = Bn(r, r.map((d, c) => c)), o = t.flatMap((d) => {
|
|
1045
|
+
let c = e.outEdges(d);
|
|
1046
1046
|
return c ? c.map((u) => ({ pos: n[u.w], weight: e.edge(u).weight })).sort((u, h) => u.pos - h.pos) : [];
|
|
1047
1047
|
}), i = 1;
|
|
1048
1048
|
for (; i < r.length; ) i <<= 1;
|
|
1049
1049
|
let s = 2 * i - 1;
|
|
1050
1050
|
i -= 1;
|
|
1051
|
-
let l = new Array(s).fill(0),
|
|
1052
|
-
return o.forEach((
|
|
1053
|
-
let c =
|
|
1054
|
-
l[c] +=
|
|
1051
|
+
let l = new Array(s).fill(0), a = 0;
|
|
1052
|
+
return o.forEach((d) => {
|
|
1053
|
+
let c = d.pos + i;
|
|
1054
|
+
l[c] += d.weight;
|
|
1055
1055
|
let u = 0;
|
|
1056
|
-
for (; c > 0; ) c % 2 && (u += l[c + 1]), c = c - 1 >> 1, l[c] +=
|
|
1057
|
-
|
|
1058
|
-
}),
|
|
1056
|
+
for (; c > 0; ) c % 2 && (u += l[c + 1]), c = c - 1 >> 1, l[c] += d.weight;
|
|
1057
|
+
a += d.weight * u;
|
|
1058
|
+
}), a;
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function zo(e, t = []) {
|
|
1061
1061
|
return t.map((r) => {
|
|
1062
1062
|
let n = e.inEdges(r);
|
|
1063
1063
|
if (!n || !n.length) return { v: r };
|
|
1064
1064
|
{
|
|
1065
1065
|
let o = n.reduce((i, s) => {
|
|
1066
|
-
let l = e.edge(s),
|
|
1067
|
-
return { sum: i.sum + l.weight *
|
|
1066
|
+
let l = e.edge(s), a = e.node(s.v);
|
|
1067
|
+
return { sum: i.sum + l.weight * a.order, weight: i.weight + l.weight };
|
|
1068
1068
|
}, { sum: 0, weight: 0 });
|
|
1069
1069
|
return { v: r, barycenter: o.sum / o.weight, weight: o.weight };
|
|
1070
1070
|
}
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function Ro(e, t) {
|
|
1074
1074
|
let r = {};
|
|
1075
1075
|
e.forEach((o, i) => {
|
|
1076
1076
|
let s = { indegree: 0, in: [], out: [], vs: [o.v], i };
|
|
@@ -1080,13 +1080,13 @@ function Do(e, t) {
|
|
|
1080
1080
|
i !== void 0 && s !== void 0 && (s.indegree++, i.out.push(s));
|
|
1081
1081
|
});
|
|
1082
1082
|
let n = Object.values(r).filter((o) => !o.indegree);
|
|
1083
|
-
return
|
|
1083
|
+
return Do(n);
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function Do(e) {
|
|
1086
1086
|
let t = [];
|
|
1087
1087
|
function r(o) {
|
|
1088
1088
|
return (i) => {
|
|
1089
|
-
i.merged || (i.barycenter === void 0 || o.barycenter === void 0 || i.barycenter >= o.barycenter) &&
|
|
1089
|
+
i.merged || (i.barycenter === void 0 || o.barycenter === void 0 || i.barycenter >= o.barycenter) && Lo(o, i);
|
|
1090
1090
|
};
|
|
1091
1091
|
}
|
|
1092
1092
|
function n(o) {
|
|
@@ -1100,39 +1100,39 @@ function Lo(e) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
return t.filter((o) => !o.merged).map((o) => Te(o, ["vs", "i", "barycenter", "weight"]));
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function Lo(e, t) {
|
|
1104
1104
|
let r = 0, n = 0;
|
|
1105
1105
|
e.weight && (r += e.barycenter * e.weight, n += e.weight), t.weight && (r += t.barycenter * t.weight, n += t.weight), e.vs = t.vs.concat(e.vs), e.barycenter = r / n, e.weight = n, e.i = Math.min(t.i, e.i), t.merged = !0;
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1108
|
-
let r =
|
|
1109
|
-
n.sort(
|
|
1110
|
-
|
|
1107
|
+
function Ao(e, t) {
|
|
1108
|
+
let r = An(e, (c) => Object.hasOwn(c, "barycenter")), n = r.lhs, o = r.rhs.sort((c, u) => u.i - c.i), i = [], s = 0, l = 0, a = 0;
|
|
1109
|
+
n.sort(Po(!!t)), a = St(i, o, a), n.forEach((c) => {
|
|
1110
|
+
a += c.vs.length, i.push(c.vs), s += c.barycenter * c.weight, l += c.weight, a = St(i, o, a);
|
|
1111
1111
|
});
|
|
1112
|
-
let
|
|
1113
|
-
return l && (
|
|
1112
|
+
let d = { vs: i.flat(1) };
|
|
1113
|
+
return l && (d.barycenter = s / l, d.weight = l), d;
|
|
1114
1114
|
}
|
|
1115
1115
|
function St(e, t, r) {
|
|
1116
1116
|
let n;
|
|
1117
1117
|
for (; t.length && (n = t[t.length - 1]).i <= r; ) t.pop(), e.push(n.vs), r++;
|
|
1118
1118
|
return r;
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1120
|
+
function Po(e) {
|
|
1121
1121
|
return (t, r) => t.barycenter < r.barycenter ? -1 : t.barycenter > r.barycenter ? 1 : e ? r.i - t.i : t.i - r.i;
|
|
1122
1122
|
}
|
|
1123
1123
|
function fr(e, t, r, n) {
|
|
1124
|
-
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0,
|
|
1124
|
+
let o = e.children(t), i = e.node(t), s = i ? i.borderLeft : void 0, l = i ? i.borderRight : void 0, a = {};
|
|
1125
1125
|
s && (o = o.filter((h) => h !== s && h !== l));
|
|
1126
|
-
let
|
|
1127
|
-
|
|
1126
|
+
let d = zo(e, o);
|
|
1127
|
+
d.forEach((h) => {
|
|
1128
1128
|
if (e.children(h.v).length) {
|
|
1129
1129
|
let g = fr(e, h.v, r, n);
|
|
1130
|
-
|
|
1130
|
+
a[h.v] = g, Object.hasOwn(g, "barycenter") && Wo(h, g);
|
|
1131
1131
|
}
|
|
1132
1132
|
});
|
|
1133
|
-
let c =
|
|
1134
|
-
|
|
1135
|
-
let u =
|
|
1133
|
+
let c = Ro(d, r);
|
|
1134
|
+
Bo(c, a);
|
|
1135
|
+
let u = Ao(c, n);
|
|
1136
1136
|
if (s && l) {
|
|
1137
1137
|
u.vs = [s, u.vs, l].flat(1);
|
|
1138
1138
|
let h = e.predecessors(s);
|
|
@@ -1143,41 +1143,41 @@ function fr(e, t, r, n) {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
return u;
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function Bo(e, t) {
|
|
1147
1147
|
e.forEach((r) => {
|
|
1148
1148
|
r.vs = r.vs.flatMap((n) => t[n] ? t[n].vs : n);
|
|
1149
1149
|
});
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1151
|
+
function Wo(e, t) {
|
|
1152
1152
|
e.barycenter !== void 0 ? (e.barycenter = (e.barycenter * e.weight + t.barycenter * t.weight) / (e.weight + t.weight), e.weight += t.weight) : (e.barycenter = t.barycenter, e.weight = t.weight);
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function Go(e, t, r, n) {
|
|
1155
1155
|
n || (n = e.nodes());
|
|
1156
|
-
let o =
|
|
1156
|
+
let o = $o(e), i = new G({ compound: !0 }).setGraph({ root: o }).setDefaultNodeLabel((s) => e.node(s));
|
|
1157
1157
|
return n.forEach((s) => {
|
|
1158
|
-
let l = e.node(s),
|
|
1158
|
+
let l = e.node(s), a = e.parent(s);
|
|
1159
1159
|
if (l.rank === t || l.minRank <= t && t <= l.maxRank) {
|
|
1160
|
-
i.setNode(s), i.setParent(s,
|
|
1161
|
-
let
|
|
1162
|
-
|
|
1160
|
+
i.setNode(s), i.setParent(s, a || o);
|
|
1161
|
+
let d = e[r](s);
|
|
1162
|
+
d && d.forEach((c) => {
|
|
1163
1163
|
let u = c.v === s ? c.w : c.v, h = i.edge(u, s), g = h !== void 0 ? h.weight : 0;
|
|
1164
1164
|
i.setEdge(u, s, { weight: e.edge(c).weight + g });
|
|
1165
1165
|
}), Object.hasOwn(l, "minRank") && i.setNode(s, { borderLeft: l.borderLeft[t], borderRight: l.borderRight[t] });
|
|
1166
1166
|
}
|
|
1167
1167
|
}), i;
|
|
1168
1168
|
}
|
|
1169
|
-
function
|
|
1169
|
+
function $o(e) {
|
|
1170
1170
|
let t;
|
|
1171
1171
|
for (; e.hasNode(t = He("_root")); ) ;
|
|
1172
1172
|
return t;
|
|
1173
1173
|
}
|
|
1174
|
-
function
|
|
1174
|
+
function Yo(e, t, r) {
|
|
1175
1175
|
let n = {}, o;
|
|
1176
1176
|
r.forEach((i) => {
|
|
1177
|
-
let s = e.parent(i), l,
|
|
1177
|
+
let s = e.parent(i), l, a;
|
|
1178
1178
|
for (; s; ) {
|
|
1179
|
-
if (l = e.parent(s), l ? (
|
|
1180
|
-
t.setEdge(
|
|
1179
|
+
if (l = e.parent(s), l ? (a = n[l], n[l] = s) : (a = o, o = s), a && a !== s) {
|
|
1180
|
+
t.setEdge(a, s);
|
|
1181
1181
|
return;
|
|
1182
1182
|
}
|
|
1183
1183
|
s = l;
|
|
@@ -1189,12 +1189,12 @@ function hr(e, t = {}) {
|
|
|
1189
1189
|
t.customOrder(e, hr);
|
|
1190
1190
|
return;
|
|
1191
1191
|
}
|
|
1192
|
-
let r = tr(e), n = It(e, pe(1, r + 1), "inEdges"), o = It(e, pe(r - 1, -1, -1), "outEdges"), i =
|
|
1192
|
+
let r = tr(e), n = It(e, pe(1, r + 1), "inEdges"), o = It(e, pe(r - 1, -1, -1), "outEdges"), i = Mo(e);
|
|
1193
1193
|
if (Ot(e, i), t.disableOptimalOrderHeuristic) return;
|
|
1194
|
-
let s = Number.POSITIVE_INFINITY, l,
|
|
1195
|
-
for (let
|
|
1196
|
-
|
|
1197
|
-
let u =
|
|
1194
|
+
let s = Number.POSITIVE_INFINITY, l, a = t.constraints || [];
|
|
1195
|
+
for (let d = 0, c = 0; c < 4; ++d, ++c) {
|
|
1196
|
+
Ko(d % 2 ? n : o, d % 4 >= 2, a), i = ye(e);
|
|
1197
|
+
let u = jo(e, i);
|
|
1198
1198
|
u < s ? (c = 0, l = Object.assign({}, i), s = u) : u === s && (l = structuredClone(i));
|
|
1199
1199
|
}
|
|
1200
1200
|
Ot(e, l);
|
|
@@ -1208,27 +1208,27 @@ function It(e, t, r) {
|
|
|
1208
1208
|
if (typeof s.rank == "number" && o(s.rank, i), typeof s.minRank == "number" && typeof s.maxRank == "number") for (let l = s.minRank; l <= s.maxRank; l++) l !== s.rank && o(l, i);
|
|
1209
1209
|
}
|
|
1210
1210
|
return t.map(function(i) {
|
|
1211
|
-
return
|
|
1211
|
+
return Go(e, i, r, n.get(i) || []);
|
|
1212
1212
|
});
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function Ko(e, t, r) {
|
|
1215
1215
|
let n = new G();
|
|
1216
1216
|
e.forEach(function(o) {
|
|
1217
1217
|
r.forEach((l) => n.setEdge(l.left, l.right));
|
|
1218
1218
|
let i = o.graph().root, s = fr(o, i, n, t);
|
|
1219
|
-
s.vs.forEach((l,
|
|
1219
|
+
s.vs.forEach((l, a) => o.node(l).order = a), Yo(o, n, s.vs);
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
1222
|
function Ot(e, t) {
|
|
1223
1223
|
Object.values(t).forEach((r) => r.forEach((n, o) => e.node(n).order = o));
|
|
1224
1224
|
}
|
|
1225
|
-
function
|
|
1225
|
+
function Uo(e, t) {
|
|
1226
1226
|
let r = {};
|
|
1227
1227
|
function n(o, i) {
|
|
1228
|
-
let s = 0, l = 0,
|
|
1228
|
+
let s = 0, l = 0, a = o.length, d = i[i.length - 1];
|
|
1229
1229
|
return i.forEach((c, u) => {
|
|
1230
|
-
let h =
|
|
1231
|
-
(h || c ===
|
|
1230
|
+
let h = Ho(e, c), g = h ? e.node(h).order : a;
|
|
1231
|
+
(h || c === d) && (i.slice(l, u + 1).forEach((b) => {
|
|
1232
1232
|
let y = e.predecessors(b);
|
|
1233
1233
|
y && y.forEach((p) => {
|
|
1234
1234
|
let v = e.node(p), N = v.order;
|
|
@@ -1239,9 +1239,9 @@ function Vo(e, t) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
return t.length && t.reduce(n), r;
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function Vo(e, t) {
|
|
1243
1243
|
let r = {};
|
|
1244
|
-
function n(i, s, l,
|
|
1244
|
+
function n(i, s, l, a, d) {
|
|
1245
1245
|
pe(s, l).forEach((c) => {
|
|
1246
1246
|
let u = i[c];
|
|
1247
1247
|
if (u !== void 0 && e.node(u).dummy) {
|
|
@@ -1249,28 +1249,28 @@ function Ho(e, t) {
|
|
|
1249
1249
|
h && h.forEach((g) => {
|
|
1250
1250
|
if (g === void 0) return;
|
|
1251
1251
|
let b = e.node(g);
|
|
1252
|
-
b.dummy && (b.order <
|
|
1252
|
+
b.dummy && (b.order < a || b.order > d) && gr(r, g, u);
|
|
1253
1253
|
});
|
|
1254
1254
|
}
|
|
1255
1255
|
});
|
|
1256
1256
|
}
|
|
1257
1257
|
function o(i, s) {
|
|
1258
|
-
let l = -1,
|
|
1258
|
+
let l = -1, a = -1, d = 0;
|
|
1259
1259
|
return s.forEach((c, u) => {
|
|
1260
1260
|
if (e.node(c).dummy === "border") {
|
|
1261
1261
|
let h = e.predecessors(c);
|
|
1262
1262
|
if (h && h.length) {
|
|
1263
1263
|
let g = h[0];
|
|
1264
1264
|
if (g === void 0) return;
|
|
1265
|
-
|
|
1265
|
+
a = e.node(g).order, n(s, d, u, l, a), d = u, l = a;
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
1268
|
-
n(s,
|
|
1268
|
+
n(s, d, s.length, a, i.length);
|
|
1269
1269
|
}), s;
|
|
1270
1270
|
}
|
|
1271
1271
|
return t.length && t.reduce(o), r;
|
|
1272
1272
|
}
|
|
1273
|
-
function
|
|
1273
|
+
function Ho(e, t) {
|
|
1274
1274
|
if (e.node(t).dummy) {
|
|
1275
1275
|
let r = e.predecessors(t);
|
|
1276
1276
|
if (r) return r.find((n) => e.node(n).dummy);
|
|
@@ -1284,7 +1284,7 @@ function gr(e, t, r) {
|
|
|
1284
1284
|
let n = e[t];
|
|
1285
1285
|
n || (e[t] = n = {}), n[r] = !0;
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function qo(e, t, r) {
|
|
1288
1288
|
if (t > r) {
|
|
1289
1289
|
let o = t;
|
|
1290
1290
|
t = r, r = o;
|
|
@@ -1292,16 +1292,16 @@ function Xo(e, t, r) {
|
|
|
1292
1292
|
let n = e[t];
|
|
1293
1293
|
return n !== void 0 && Object.hasOwn(n, r);
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1295
|
+
function Xo(e, t, r, n) {
|
|
1296
1296
|
let o = {}, i = {}, s = {};
|
|
1297
1297
|
return t.forEach((l) => {
|
|
1298
|
-
l.forEach((
|
|
1299
|
-
o[
|
|
1298
|
+
l.forEach((a, d) => {
|
|
1299
|
+
o[a] = a, i[a] = a, s[a] = d;
|
|
1300
1300
|
});
|
|
1301
1301
|
}), t.forEach((l) => {
|
|
1302
|
-
let
|
|
1303
|
-
l.forEach((
|
|
1304
|
-
let c = n(
|
|
1302
|
+
let a = -1;
|
|
1303
|
+
l.forEach((d) => {
|
|
1304
|
+
let c = n(d);
|
|
1305
1305
|
if (c && c.length) {
|
|
1306
1306
|
let u = c.sort((g, b) => {
|
|
1307
1307
|
let y = s[g], p = s[b];
|
|
@@ -1311,18 +1311,18 @@ function Jo(e, t, r, n) {
|
|
|
1311
1311
|
let y = u[g];
|
|
1312
1312
|
if (y === void 0) continue;
|
|
1313
1313
|
let p = s[y];
|
|
1314
|
-
if (p !== void 0 && i[
|
|
1314
|
+
if (p !== void 0 && i[d] === d && a < p && !qo(r, d, y)) {
|
|
1315
1315
|
let v = o[y];
|
|
1316
|
-
v !== void 0 && (i[y] =
|
|
1316
|
+
v !== void 0 && (i[y] = d, i[d] = o[d] = v, a = p);
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
1320
|
});
|
|
1321
1321
|
}), { root: o, align: i };
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1324
|
-
let i = {}, s =
|
|
1325
|
-
function
|
|
1323
|
+
function Jo(e, t, r, n, o = !1) {
|
|
1324
|
+
let i = {}, s = Zo(e, t, r, o), l = o ? "borderLeft" : "borderRight";
|
|
1325
|
+
function a(g, b) {
|
|
1326
1326
|
let y = s.nodes().slice(), p = {}, v = y.pop();
|
|
1327
1327
|
for (; v; ) {
|
|
1328
1328
|
if (p[v]) g(v);
|
|
@@ -1333,7 +1333,7 @@ function Zo(e, t, r, n, o = !1) {
|
|
|
1333
1333
|
v = y.pop();
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function d(g) {
|
|
1337
1337
|
let b = s.inEdges(g);
|
|
1338
1338
|
b ? i[g] = b.reduce((y, p) => {
|
|
1339
1339
|
var v;
|
|
@@ -1356,133 +1356,133 @@ function Zo(e, t, r, n, o = !1) {
|
|
|
1356
1356
|
function h(g) {
|
|
1357
1357
|
return s.successors(g) || [];
|
|
1358
1358
|
}
|
|
1359
|
-
return d
|
|
1359
|
+
return a(d, u), a(c, h), Object.keys(n).forEach((g) => {
|
|
1360
1360
|
var b;
|
|
1361
1361
|
let y = r[g];
|
|
1362
1362
|
y !== void 0 && (i[g] = (b = i[y]) != null ? b : 0);
|
|
1363
1363
|
}), i;
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1366
|
-
let o = new G(), i = e.graph(), s =
|
|
1365
|
+
function Zo(e, t, r, n) {
|
|
1366
|
+
let o = new G(), i = e.graph(), s = ni(i.nodesep, i.edgesep, n);
|
|
1367
1367
|
return t.forEach((l) => {
|
|
1368
|
-
let
|
|
1369
|
-
l.forEach((
|
|
1370
|
-
let c = r[
|
|
1368
|
+
let a;
|
|
1369
|
+
l.forEach((d) => {
|
|
1370
|
+
let c = r[d];
|
|
1371
1371
|
if (c !== void 0) {
|
|
1372
|
-
if (o.setNode(c),
|
|
1373
|
-
let u = r[
|
|
1372
|
+
if (o.setNode(c), a !== void 0) {
|
|
1373
|
+
let u = r[a];
|
|
1374
1374
|
if (u !== void 0) {
|
|
1375
1375
|
let h = o.edge(u, c);
|
|
1376
|
-
o.setEdge(u, c, Math.max(s(e,
|
|
1376
|
+
o.setEdge(u, c, Math.max(s(e, d, a), h || 0));
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
|
-
|
|
1379
|
+
a = d;
|
|
1380
1380
|
}
|
|
1381
1381
|
});
|
|
1382
1382
|
}), o;
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function Qo(e, t) {
|
|
1385
1385
|
return Object.values(t).reduce((r, n) => {
|
|
1386
1386
|
let o = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY;
|
|
1387
|
-
Object.entries(n).forEach(([l,
|
|
1388
|
-
let
|
|
1389
|
-
o = Math.max(
|
|
1387
|
+
Object.entries(n).forEach(([l, a]) => {
|
|
1388
|
+
let d = oi(e, l) / 2;
|
|
1389
|
+
o = Math.max(a + d, o), i = Math.min(a - d, i);
|
|
1390
1390
|
});
|
|
1391
1391
|
let s = o - i;
|
|
1392
1392
|
return s < r[0] && (r = [s, n]), r;
|
|
1393
1393
|
}, [Number.POSITIVE_INFINITY, null])[1];
|
|
1394
1394
|
}
|
|
1395
|
-
function
|
|
1395
|
+
function ei(e, t) {
|
|
1396
1396
|
let r = Object.values(t), n = K(Math.min, r), o = K(Math.max, r);
|
|
1397
1397
|
["u", "d"].forEach((i) => {
|
|
1398
1398
|
["l", "r"].forEach((s) => {
|
|
1399
|
-
let l = i + s,
|
|
1400
|
-
if (!
|
|
1401
|
-
let
|
|
1402
|
-
s !== "l" && (c = o - K(Math.max,
|
|
1399
|
+
let l = i + s, a = e[l];
|
|
1400
|
+
if (!a || a === t) return;
|
|
1401
|
+
let d = Object.values(a), c = n - K(Math.min, d);
|
|
1402
|
+
s !== "l" && (c = o - K(Math.max, d)), c && (e[l] = Ne(a, (u) => u + c));
|
|
1403
1403
|
});
|
|
1404
1404
|
});
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1406
|
+
function ti(e, t = void 0) {
|
|
1407
1407
|
let r = e.ul;
|
|
1408
1408
|
return r ? Ne(r, (n, o) => {
|
|
1409
1409
|
var i, s;
|
|
1410
1410
|
if (t) {
|
|
1411
|
-
let
|
|
1412
|
-
if (
|
|
1411
|
+
let a = t.toLowerCase(), d = e[a];
|
|
1412
|
+
if (d && d[o] !== void 0) return d[o];
|
|
1413
1413
|
}
|
|
1414
|
-
let l = Object.values(e).map((
|
|
1415
|
-
let
|
|
1416
|
-
return
|
|
1417
|
-
}).sort((
|
|
1414
|
+
let l = Object.values(e).map((a) => {
|
|
1415
|
+
let d = a[o];
|
|
1416
|
+
return d !== void 0 ? d : 0;
|
|
1417
|
+
}).sort((a, d) => a - d);
|
|
1418
1418
|
return (((i = l[1]) != null ? i : 0) + ((s = l[2]) != null ? s : 0)) / 2;
|
|
1419
1419
|
}) : {};
|
|
1420
1420
|
}
|
|
1421
|
-
function
|
|
1422
|
-
let t = ye(e), r = Object.assign(
|
|
1421
|
+
function ri(e) {
|
|
1422
|
+
let t = ye(e), r = Object.assign(Uo(e, t), Vo(e, t)), n = {}, o;
|
|
1423
1423
|
["u", "d"].forEach((s) => {
|
|
1424
1424
|
o = s === "u" ? t : Object.values(t).reverse(), ["l", "r"].forEach((l) => {
|
|
1425
1425
|
l === "r" && (o = o.map((c) => Object.values(c).reverse()));
|
|
1426
|
-
let
|
|
1427
|
-
l === "r" && (
|
|
1426
|
+
let a = Xo(e, o, r, (c) => (s === "u" ? e.predecessors(c) : e.successors(c)) || []), d = Jo(e, o, a.root, a.align, l === "r");
|
|
1427
|
+
l === "r" && (d = Ne(d, (c) => -c)), n[s + l] = d;
|
|
1428
1428
|
});
|
|
1429
1429
|
});
|
|
1430
|
-
let i =
|
|
1431
|
-
return
|
|
1430
|
+
let i = Qo(e, n);
|
|
1431
|
+
return ei(n, i), ti(n, e.graph().align);
|
|
1432
1432
|
}
|
|
1433
|
-
function
|
|
1433
|
+
function ni(e, t, r) {
|
|
1434
1434
|
return (n, o, i) => {
|
|
1435
|
-
let s = n.node(o), l = n.node(i),
|
|
1436
|
-
if (
|
|
1435
|
+
let s = n.node(o), l = n.node(i), a = 0, d;
|
|
1436
|
+
if (a += s.width / 2, Object.hasOwn(s, "labelpos")) switch (s.labelpos.toLowerCase()) {
|
|
1437
1437
|
case "l":
|
|
1438
|
-
|
|
1438
|
+
d = -s.width / 2;
|
|
1439
1439
|
break;
|
|
1440
1440
|
case "r":
|
|
1441
|
-
|
|
1441
|
+
d = s.width / 2;
|
|
1442
1442
|
break;
|
|
1443
1443
|
}
|
|
1444
|
-
if (
|
|
1444
|
+
if (d && (a += r ? d : -d), d = void 0, a += (s.dummy ? t : e) / 2, a += (l.dummy ? t : e) / 2, a += l.width / 2, Object.hasOwn(l, "labelpos")) switch (l.labelpos.toLowerCase()) {
|
|
1445
1445
|
case "l":
|
|
1446
|
-
|
|
1446
|
+
d = l.width / 2;
|
|
1447
1447
|
break;
|
|
1448
1448
|
case "r":
|
|
1449
|
-
|
|
1449
|
+
d = -l.width / 2;
|
|
1450
1450
|
break;
|
|
1451
1451
|
}
|
|
1452
|
-
return
|
|
1452
|
+
return d && (a += r ? d : -d), a;
|
|
1453
1453
|
};
|
|
1454
1454
|
}
|
|
1455
|
-
function
|
|
1455
|
+
function oi(e, t) {
|
|
1456
1456
|
return e.node(t).width;
|
|
1457
1457
|
}
|
|
1458
|
-
function
|
|
1459
|
-
e = Qt(e),
|
|
1458
|
+
function ii(e) {
|
|
1459
|
+
e = Qt(e), si(e), Object.entries(ri(e)).forEach(([t, r]) => e.node(t).x = r);
|
|
1460
1460
|
}
|
|
1461
|
-
function
|
|
1461
|
+
function si(e) {
|
|
1462
1462
|
let t = ye(e), r = e.graph(), n = r.ranksep, o = r.rankalign, i = 0;
|
|
1463
1463
|
t.forEach((s) => {
|
|
1464
|
-
let l = s.reduce((
|
|
1464
|
+
let l = s.reduce((a, d) => {
|
|
1465
1465
|
var c;
|
|
1466
|
-
let u = (c = e.node(
|
|
1467
|
-
return
|
|
1466
|
+
let u = (c = e.node(d).height) != null ? c : 0;
|
|
1467
|
+
return a > u ? a : u;
|
|
1468
1468
|
}, 0);
|
|
1469
|
-
s.forEach((
|
|
1470
|
-
let
|
|
1471
|
-
o === "top" ?
|
|
1469
|
+
s.forEach((a) => {
|
|
1470
|
+
let d = e.node(a);
|
|
1471
|
+
o === "top" ? d.y = i + d.height / 2 : o === "bottom" ? d.y = i + l - d.height / 2 : d.y = i + l / 2;
|
|
1472
1472
|
}), i += l + n;
|
|
1473
1473
|
});
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function li(e, t = {}) {
|
|
1476
1476
|
let r = t.debugTiming ? rr : nr;
|
|
1477
1477
|
return r("layout", () => {
|
|
1478
|
-
let n = r(" buildLayoutGraph", () =>
|
|
1479
|
-
return r(" runLayout", () => di(n, r, t)), r(" updateInputGraph", () =>
|
|
1478
|
+
let n = r(" buildLayoutGraph", () => yi(e));
|
|
1479
|
+
return r(" runLayout", () => di(n, r, t)), r(" updateInputGraph", () => ai(e, n)), n;
|
|
1480
1480
|
});
|
|
1481
1481
|
}
|
|
1482
1482
|
function di(e, t, r) {
|
|
1483
|
-
t(" makeSpaceForEdgeLabels", () =>
|
|
1483
|
+
t(" makeSpaceForEdgeLabels", () => mi(e)), t(" removeSelfEdges", () => Ci(e)), t(" acyclic", () => Xn(e)), t(" nestingGraph.run", () => Eo(e)), t(" rank", () => ho(Qt(e))), t(" injectEdgeLabelProxies", () => wi(e)), t(" removeEmptyRanks", () => Dn(e)), t(" nestingGraph.cleanup", () => _o(e)), t(" normalizeRanks", () => Rn(e)), t(" assignRankMinMax", () => vi(e)), t(" removeEdgeLabelProxies", () => Ei(e)), t(" normalize.run", () => Qn(e)), t(" parentDummyChains", () => yo(e)), t(" addBorderSegments", () => To(e)), t(" order", () => hr(e, r)), t(" insertSelfEdges", () => Si(e)), t(" adjustCoordinateSystem", () => Co(e)), t(" position", () => ii(e)), t(" positionSelfEdges", () => Ii(e)), t(" removeBorderNodes", () => Ni(e)), t(" normalize.undo", () => to(e)), t(" fixupEdgeLabelCoords", () => _i(e)), t(" undoCoordinateSystem", () => So(e)), t(" translateGraph", () => ki(e)), t(" assignNodeIntersects", () => xi(e)), t(" reversePoints", () => Ti(e)), t(" acyclic.undo", () => Zn(e));
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1485
|
+
function ai(e, t) {
|
|
1486
1486
|
e.nodes().forEach((r) => {
|
|
1487
1487
|
let n = e.node(r), o = t.node(r);
|
|
1488
1488
|
n && (n.x = o.x, n.y = o.y, n.order = o.order, n.rank = o.rank, t.children(r).length && (n.width = o.width, n.height = o.height));
|
|
@@ -1491,11 +1491,11 @@ function ci(e, t) {
|
|
|
1491
1491
|
n.points = o.points, Object.hasOwn(o, "x") && (n.x = o.x, n.y = o.y);
|
|
1492
1492
|
}), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
|
|
1493
1493
|
}
|
|
1494
|
-
var
|
|
1495
|
-
function
|
|
1494
|
+
var ci = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], ui = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, fi = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], hi = ["width", "height", "rank"], Mt = { width: 0, height: 0 }, gi = ["minlen", "weight", "width", "height", "labeloffset"], pi = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, bi = ["labelpos"];
|
|
1495
|
+
function yi(e) {
|
|
1496
1496
|
let t = new G({ multigraph: !0, compound: !0 }), r = Ae(e.graph());
|
|
1497
|
-
return t.setGraph(Object.assign({},
|
|
1498
|
-
let o = Ae(e.node(n)), i = Le(o,
|
|
1497
|
+
return t.setGraph(Object.assign({}, ui, Le(r, ci), Te(r, fi))), e.nodes().forEach((n) => {
|
|
1498
|
+
let o = Ae(e.node(n)), i = Le(o, hi);
|
|
1499
1499
|
Object.keys(Mt).forEach((l) => {
|
|
1500
1500
|
i[l] === void 0 && (i[l] = Mt[l]);
|
|
1501
1501
|
}), t.setNode(n, i);
|
|
@@ -1503,17 +1503,17 @@ function mi(e) {
|
|
|
1503
1503
|
s !== void 0 && t.setParent(n, s);
|
|
1504
1504
|
}), e.edges().forEach((n) => {
|
|
1505
1505
|
let o = Ae(e.edge(n));
|
|
1506
|
-
t.setEdge(n, Object.assign({},
|
|
1506
|
+
t.setEdge(n, Object.assign({}, pi, Le(o, gi), Te(o, bi)));
|
|
1507
1507
|
}), t;
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function mi(e) {
|
|
1510
1510
|
let t = e.graph();
|
|
1511
1511
|
t.ranksep /= 2, e.edges().forEach((r) => {
|
|
1512
1512
|
let n = e.edge(r);
|
|
1513
1513
|
n.minlen *= 2, n.labelpos.toLowerCase() !== "c" && (t.rankdir === "TB" || t.rankdir === "BT" ? n.width += n.labeloffset : n.height += n.labeloffset);
|
|
1514
1514
|
});
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1516
|
+
function wi(e) {
|
|
1517
1517
|
e.edges().forEach((t) => {
|
|
1518
1518
|
let r = e.edge(t);
|
|
1519
1519
|
if (r.width && r.height) {
|
|
@@ -1522,14 +1522,14 @@ function vi(e) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
});
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1525
|
+
function vi(e) {
|
|
1526
1526
|
let t = 0;
|
|
1527
1527
|
e.nodes().forEach((r) => {
|
|
1528
1528
|
let n = e.node(r);
|
|
1529
1529
|
n.borderTop && (n.minRank = e.node(n.borderTop).rank, n.maxRank = e.node(n.borderBottom).rank, t = Math.max(t, n.maxRank));
|
|
1530
1530
|
}), e.graph().maxRank = t;
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1532
|
+
function Ei(e) {
|
|
1533
1533
|
e.nodes().forEach((t) => {
|
|
1534
1534
|
let r = e.node(t);
|
|
1535
1535
|
if (r.dummy === "edge-proxy") {
|
|
@@ -1538,32 +1538,32 @@ function ki(e) {
|
|
|
1538
1538
|
}
|
|
1539
1539
|
});
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1541
|
+
function ki(e) {
|
|
1542
1542
|
let t = Number.POSITIVE_INFINITY, r = 0, n = Number.POSITIVE_INFINITY, o = 0, i = e.graph(), s = i.marginx || 0, l = i.marginy || 0;
|
|
1543
|
-
function d
|
|
1544
|
-
let c =
|
|
1543
|
+
function a(d) {
|
|
1544
|
+
let c = d.x, u = d.y, h = d.width, g = d.height;
|
|
1545
1545
|
t = Math.min(t, c - h / 2), r = Math.max(r, c + h / 2), n = Math.min(n, u - g / 2), o = Math.max(o, u + g / 2);
|
|
1546
1546
|
}
|
|
1547
|
-
e.nodes().forEach((
|
|
1548
|
-
let c = e.edge(
|
|
1549
|
-
Object.hasOwn(c, "x") &&
|
|
1550
|
-
}), t -= s, n -= l, e.nodes().forEach((
|
|
1551
|
-
let c = e.node(
|
|
1547
|
+
e.nodes().forEach((d) => a(e.node(d))), e.edges().forEach((d) => {
|
|
1548
|
+
let c = e.edge(d);
|
|
1549
|
+
Object.hasOwn(c, "x") && a(c);
|
|
1550
|
+
}), t -= s, n -= l, e.nodes().forEach((d) => {
|
|
1551
|
+
let c = e.node(d);
|
|
1552
1552
|
c.x -= t, c.y -= n;
|
|
1553
|
-
}), e.edges().forEach((
|
|
1554
|
-
let c = e.edge(
|
|
1553
|
+
}), e.edges().forEach((d) => {
|
|
1554
|
+
let c = e.edge(d);
|
|
1555
1555
|
c.points.forEach((u) => {
|
|
1556
1556
|
u.x -= t, u.y -= n;
|
|
1557
1557
|
}), Object.hasOwn(c, "x") && (c.x -= t), Object.hasOwn(c, "y") && (c.y -= n);
|
|
1558
1558
|
}), i.width = r - t + s, i.height = o - n + l;
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1560
|
+
function xi(e) {
|
|
1561
1561
|
e.edges().forEach((t) => {
|
|
1562
1562
|
let r = e.edge(t), n = e.node(t.v), o = e.node(t.w), i, s;
|
|
1563
1563
|
r.points ? (i = r.points[0], s = r.points[r.points.length - 1]) : (r.points = [], i = o, s = n), r.points.unshift(Et(n, i)), r.points.push(Et(o, s));
|
|
1564
1564
|
});
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1566
|
+
function _i(e) {
|
|
1567
1567
|
e.edges().forEach((t) => {
|
|
1568
1568
|
let r = e.edge(t);
|
|
1569
1569
|
if (Object.hasOwn(r, "x")) switch ((r.labelpos === "l" || r.labelpos === "r") && (r.width -= r.labeloffset), r.labelpos) {
|
|
@@ -1576,13 +1576,13 @@ function Ti(e) {
|
|
|
1576
1576
|
}
|
|
1577
1577
|
});
|
|
1578
1578
|
}
|
|
1579
|
-
function
|
|
1579
|
+
function Ti(e) {
|
|
1580
1580
|
e.edges().forEach((t) => {
|
|
1581
1581
|
let r = e.edge(t);
|
|
1582
1582
|
r.reversed && r.points.reverse();
|
|
1583
1583
|
});
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1585
|
+
function Ni(e) {
|
|
1586
1586
|
e.nodes().forEach((t) => {
|
|
1587
1587
|
if (e.children(t).length) {
|
|
1588
1588
|
let r = e.node(t), n = e.node(r.borderTop), o = e.node(r.borderBottom), i = e.node(r.borderLeft[r.borderLeft.length - 1]), s = e.node(r.borderRight[r.borderRight.length - 1]);
|
|
@@ -1592,7 +1592,7 @@ function Ci(e) {
|
|
|
1592
1592
|
e.node(t).dummy === "border" && e.removeNode(t);
|
|
1593
1593
|
});
|
|
1594
1594
|
}
|
|
1595
|
-
function
|
|
1595
|
+
function Ci(e) {
|
|
1596
1596
|
e.edges().forEach((t) => {
|
|
1597
1597
|
if (t.v === t.w) {
|
|
1598
1598
|
let r = e.node(t.v);
|
|
@@ -1600,7 +1600,7 @@ function Si(e) {
|
|
|
1600
1600
|
}
|
|
1601
1601
|
});
|
|
1602
1602
|
}
|
|
1603
|
-
function
|
|
1603
|
+
function Si(e) {
|
|
1604
1604
|
ye(e).forEach((t) => {
|
|
1605
1605
|
let r = 0;
|
|
1606
1606
|
t.forEach((n, o) => {
|
|
@@ -1611,12 +1611,12 @@ function Ii(e) {
|
|
|
1611
1611
|
});
|
|
1612
1612
|
});
|
|
1613
1613
|
}
|
|
1614
|
-
function
|
|
1614
|
+
function Ii(e) {
|
|
1615
1615
|
e.nodes().forEach((t) => {
|
|
1616
1616
|
let r = e.node(t);
|
|
1617
1617
|
if (r.dummy === "selfedge") {
|
|
1618
|
-
let n = r, o = e.node(n.e.v), i = o.x + o.width / 2, s = o.y, l = r.x - i,
|
|
1619
|
-
e.setEdge(n.e, n.label), e.removeNode(t), n.label.points = [{ x: i + 2 * l / 3, y: s -
|
|
1618
|
+
let n = r, o = e.node(n.e.v), i = o.x + o.width / 2, s = o.y, l = r.x - i, a = o.height / 2;
|
|
1619
|
+
e.setEdge(n.e, n.label), e.removeNode(t), n.label.points = [{ x: i + 2 * l / 3, y: s - a }, { x: i + 5 * l / 6, y: s - a }, { x: i + l, y: s }, { x: i + 5 * l / 6, y: s + a }, { x: i + 2 * l / 3, y: s + a }], n.label.x = r.x, n.label.y = r.y;
|
|
1620
1620
|
}
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
@@ -1629,7 +1629,7 @@ function Ae(e) {
|
|
|
1629
1629
|
typeof r == "string" && (r = r.toLowerCase()), t[r] = n;
|
|
1630
1630
|
}), t;
|
|
1631
1631
|
}
|
|
1632
|
-
function
|
|
1632
|
+
function Oi(e) {
|
|
1633
1633
|
let t = ye(e), r = new G({ compound: !0, multigraph: !0 }).setGraph({});
|
|
1634
1634
|
return e.nodes().forEach((n) => {
|
|
1635
1635
|
r.setNode(n, { label: n }), r.setParent(n, "layer" + e.node(n).rank);
|
|
@@ -1638,30 +1638,30 @@ function Mi(e) {
|
|
|
1638
1638
|
r.setNode(i, { rank: "same" }), n.reduce((s, l) => (r.setEdge(s, l, { style: "invis" }), l));
|
|
1639
1639
|
}), r;
|
|
1640
1640
|
}
|
|
1641
|
-
var
|
|
1641
|
+
var Mi = { graphlib: Yt, version: Wn, layout: li, debug: Oi, util: { time: rr, notime: nr } }, jt = Mi;
|
|
1642
1642
|
/*! For license information please see dagre.esm.js.LEGAL.txt */
|
|
1643
|
-
const
|
|
1643
|
+
const ji = (e) => {
|
|
1644
1644
|
const t = [];
|
|
1645
1645
|
return e.nodeInternals.forEach((r, n) => t.push(`${n}:${r.height ?? 0}`)), t.join(",");
|
|
1646
|
-
},
|
|
1647
|
-
const r = Tr(
|
|
1646
|
+
}, Fi = ({ onHeightsReady: e, nodeCount: t }) => {
|
|
1647
|
+
const r = Tr(ji), n = pt("");
|
|
1648
1648
|
pt(0);
|
|
1649
1649
|
const { fitView: o } = Nr();
|
|
1650
1650
|
return ie(() => {
|
|
1651
1651
|
if (!r || r === n.current) return;
|
|
1652
1652
|
const i = {};
|
|
1653
1653
|
for (const s of r.split(",")) {
|
|
1654
|
-
const [l,
|
|
1655
|
-
l &&
|
|
1654
|
+
const [l, a] = s.split(":"), d = Number(a);
|
|
1655
|
+
l && d > 0 && (i[l] = d);
|
|
1656
1656
|
}
|
|
1657
1657
|
Object.keys(i).length !== 0 && (n.current = r, e(i));
|
|
1658
1658
|
}, [r]), null;
|
|
1659
1659
|
}, Se = ({ isOpen: e, onClose: t, title: r, icon: n, children: o, footer: i, width: s = 600 }) => {
|
|
1660
|
-
const [l,
|
|
1660
|
+
const [l, a] = j(!1), d = () => a((h) => !h), c = () => /* @__PURE__ */ m(te, { sx: { display: "flex", alignItems: "center", p: 2, pt: 3, borderBottom: "1px solid #e0e0e0", mb: 0, flexShrink: 0 }, children: [
|
|
1661
1661
|
n && /* @__PURE__ */ f(te, { sx: { mr: 1.5, display: "flex", alignItems: "center", fontSize: "1.25rem", color: "#1DBF60" }, children: n }),
|
|
1662
|
-
/* @__PURE__ */ f(
|
|
1663
|
-
/* @__PURE__ */ f(bt, { onClick:
|
|
1664
|
-
/* @__PURE__ */ f(bt, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ f(
|
|
1662
|
+
/* @__PURE__ */ f("span", { style: { flexGrow: 1, fontSize: 14, fontWeight: 600, color: "#212121" }, children: r }),
|
|
1663
|
+
/* @__PURE__ */ f(bt, { onClick: d, size: "small", sx: { mr: 1 }, title: l ? "Collapse" : "Expand", "data-testid": "expand-collapse-base-drawer-btn", children: l ? /* @__PURE__ */ f(tn, {}) : /* @__PURE__ */ f(rn, {}) }),
|
|
1664
|
+
/* @__PURE__ */ f(bt, { onClick: t, size: "small", "data-testid": "close-drawer-button", children: /* @__PURE__ */ f(Pr, {}) })
|
|
1665
1665
|
] }), u = () => i ? /* @__PURE__ */ f(te, { sx: { flexShrink: 0, p: 2, borderTop: "1px solid #e0e0e0", display: "flex", justifyContent: "flex-end", gap: 2 }, children: i }) : null;
|
|
1666
1666
|
return l ? /* @__PURE__ */ m(Lr, { open: e, onClose: t, maxWidth: !1, fullWidth: !0, PaperProps: { sx: { display: "flex", flexDirection: "column", height: "80vh", boxShadow: 24, width: "750px", maxWidth: "100%" } }, children: [
|
|
1667
1667
|
/* @__PURE__ */ f(c, {}),
|
|
@@ -1698,7 +1698,7 @@ const Fi = (e) => {
|
|
|
1698
1698
|
]
|
|
1699
1699
|
}
|
|
1700
1700
|
);
|
|
1701
|
-
},
|
|
1701
|
+
}, zi = ({ open: e, templates: t, messages: r, onSelect: n, onClose: o }) => /* @__PURE__ */ f(Se, { isOpen: e, onClose: o, title: r.addTriggerTitle, icon: /* @__PURE__ */ f(en, {}), width: 500, children: /* @__PURE__ */ m(te, { sx: { p: 2 }, children: [
|
|
1702
1702
|
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: r.chooseTrigger }),
|
|
1703
1703
|
/* @__PURE__ */ m("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: [
|
|
1704
1704
|
t.map((i) => /* @__PURE__ */ m(
|
|
@@ -1719,7 +1719,7 @@ const Fi = (e) => {
|
|
|
1719
1719
|
s.currentTarget.style.background = "";
|
|
1720
1720
|
},
|
|
1721
1721
|
children: [
|
|
1722
|
-
/* @__PURE__ */ f("div", { style: { color: i.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: i.triggerCategory === "scheduler" ? /* @__PURE__ */ f(
|
|
1722
|
+
/* @__PURE__ */ f("div", { style: { color: i.triggerCategory === "scheduler" ? "#1976d2" : "#f57c00", marginTop: 2, flexShrink: 0 }, children: i.triggerCategory === "scheduler" ? /* @__PURE__ */ f(Br, { size: 18 }) : /* @__PURE__ */ f(Wr, { size: 18 }) }),
|
|
1723
1723
|
/* @__PURE__ */ m("div", { children: [
|
|
1724
1724
|
/* @__PURE__ */ f("div", { style: { fontSize: 14, fontWeight: 600, color: "#212121" }, children: i.label }),
|
|
1725
1725
|
i.description && /* @__PURE__ */ f("div", { style: { fontSize: 12, color: "#757575", marginTop: 2 }, children: i.description })
|
|
@@ -1733,7 +1733,7 @@ const Fi = (e) => {
|
|
|
1733
1733
|
] }) }), Pe = {
|
|
1734
1734
|
cursor: "pointer",
|
|
1735
1735
|
transition: "background 0.15s"
|
|
1736
|
-
}, Be = "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-center ff-gap-3",
|
|
1736
|
+
}, Be = "ff-p-3 ff-rounded ff-border ff-d-flex ff-align-items-center ff-gap-3", Ri = ({ open: e, availableDescriptors: t, messages: r, onSelect: n, onClose: o }) => {
|
|
1737
1737
|
const { apps: i, ungrouped: s } = W(() => {
|
|
1738
1738
|
const u = /* @__PURE__ */ new Map(), h = [];
|
|
1739
1739
|
for (const g of t)
|
|
@@ -1749,20 +1749,20 @@ const Fi = (e) => {
|
|
|
1749
1749
|
} else
|
|
1750
1750
|
h.push(g);
|
|
1751
1751
|
return { apps: [...u.values()], ungrouped: h };
|
|
1752
|
-
}, [t]), [l,
|
|
1752
|
+
}, [t]), [l, a] = j(null), d = l ? i.find((u) => u.key === l) ?? null : null;
|
|
1753
1753
|
ie(() => {
|
|
1754
|
-
e ||
|
|
1754
|
+
e || a(null);
|
|
1755
1755
|
}, [e]), ie(() => {
|
|
1756
|
-
|
|
1756
|
+
a(null);
|
|
1757
1757
|
}, [t]);
|
|
1758
|
-
const c = !
|
|
1758
|
+
const c = !d;
|
|
1759
1759
|
return /* @__PURE__ */ f(
|
|
1760
1760
|
Se,
|
|
1761
1761
|
{
|
|
1762
1762
|
isOpen: e,
|
|
1763
1763
|
onClose: o,
|
|
1764
|
-
title: c ? r.addStepTitle :
|
|
1765
|
-
icon: c ? /* @__PURE__ */ f(
|
|
1764
|
+
title: c ? r.addStepTitle : d.label,
|
|
1765
|
+
icon: c ? /* @__PURE__ */ f($r, {}) : d.icon ?? /* @__PURE__ */ f(Yr, {}),
|
|
1766
1766
|
width: 500,
|
|
1767
1767
|
children: /* @__PURE__ */ m(te, { sx: { p: 2 }, children: [
|
|
1768
1768
|
!c && /* @__PURE__ */ m(
|
|
@@ -1770,30 +1770,30 @@ const Fi = (e) => {
|
|
|
1770
1770
|
{
|
|
1771
1771
|
role: "button",
|
|
1772
1772
|
tabIndex: 0,
|
|
1773
|
-
onClick: () =>
|
|
1773
|
+
onClick: () => a(null),
|
|
1774
1774
|
onKeyDown: (u) => {
|
|
1775
|
-
u.key === "Enter" &&
|
|
1775
|
+
u.key === "Enter" && a(null);
|
|
1776
1776
|
},
|
|
1777
1777
|
className: "ff-d-flex ff-align-items-center ff-gap-1 ff-mb-3",
|
|
1778
1778
|
style: { cursor: "pointer", color: "#0066cc", fontSize: 13, fontWeight: 500, width: "fit-content" },
|
|
1779
1779
|
children: [
|
|
1780
|
-
/* @__PURE__ */ f(
|
|
1780
|
+
/* @__PURE__ */ f(Gr, { size: 16 }),
|
|
1781
1781
|
/* @__PURE__ */ f("span", { children: r.addStepTitle })
|
|
1782
1782
|
]
|
|
1783
1783
|
}
|
|
1784
1784
|
),
|
|
1785
|
-
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? r.chooseAction : `Pick an action from ${
|
|
1785
|
+
/* @__PURE__ */ f("p", { className: "ff-text-muted ff-mb-3", style: { fontSize: 13 }, children: c ? r.chooseAction : `Pick an action from ${d.label}` }),
|
|
1786
1786
|
/* @__PURE__ */ f("div", { className: "ff-d-flex ff-flex-column ff-gap-2", children: c ? /* @__PURE__ */ m(Lt, { children: [
|
|
1787
1787
|
i.map((u) => /* @__PURE__ */ m(
|
|
1788
1788
|
"div",
|
|
1789
1789
|
{
|
|
1790
1790
|
className: Be,
|
|
1791
1791
|
style: Pe,
|
|
1792
|
-
onClick: () =>
|
|
1792
|
+
onClick: () => a(u.key),
|
|
1793
1793
|
role: "button",
|
|
1794
1794
|
tabIndex: 0,
|
|
1795
1795
|
onKeyDown: (h) => {
|
|
1796
|
-
h.key === "Enter" &&
|
|
1796
|
+
h.key === "Enter" && a(u.key);
|
|
1797
1797
|
},
|
|
1798
1798
|
onMouseEnter: (h) => {
|
|
1799
1799
|
h.currentTarget.style.background = "#f5f5f5";
|
|
@@ -1839,7 +1839,7 @@ const Fi = (e) => {
|
|
|
1839
1839
|
i.length === 0 && s.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted ff-text-center", style: { fontSize: 13 }, children: r.noActions })
|
|
1840
1840
|
] }) : (
|
|
1841
1841
|
/* Stage 2 — actions for the selected app */
|
|
1842
|
-
|
|
1842
|
+
d.descriptors.map((u) => /* @__PURE__ */ m(
|
|
1843
1843
|
"div",
|
|
1844
1844
|
{
|
|
1845
1845
|
className: Be,
|
|
@@ -1867,26 +1867,26 @@ const Fi = (e) => {
|
|
|
1867
1867
|
] })
|
|
1868
1868
|
}
|
|
1869
1869
|
);
|
|
1870
|
-
}, Ft = "_conditionConfig",
|
|
1871
|
-
const [l,
|
|
1870
|
+
}, Ft = "_conditionConfig", Di = ({ open: e, nodeId: t, descriptor: r, initialValues: n, messages: o, onSave: i, onClose: s }) => {
|
|
1871
|
+
const [l, a] = j([]), [d, c] = j(!1), [u, h] = j(null), [g, b] = j({});
|
|
1872
1872
|
ie(() => {
|
|
1873
1873
|
b((n == null ? void 0 : n[Ft]) ?? {});
|
|
1874
1874
|
}, [n, t]), ie(() => {
|
|
1875
1875
|
let N = !1;
|
|
1876
1876
|
if (h(null), !r || !t) {
|
|
1877
|
-
|
|
1877
|
+
a([]), c(!1);
|
|
1878
1878
|
return;
|
|
1879
1879
|
}
|
|
1880
1880
|
const O = r.formSchema;
|
|
1881
1881
|
return typeof O == "function" ? (c(!0), O(t).then((M) => {
|
|
1882
|
-
N || (
|
|
1882
|
+
N || (a(M), c(!1));
|
|
1883
1883
|
}).catch((M) => {
|
|
1884
|
-
N || (
|
|
1885
|
-
})) : (
|
|
1884
|
+
N || (a([]), h(M instanceof Error ? M.message : "Unable to load configuration."), c(!1));
|
|
1885
|
+
})) : (a(O), c(!1)), () => {
|
|
1886
1886
|
N = !0;
|
|
1887
1887
|
};
|
|
1888
1888
|
}, [r, t]);
|
|
1889
|
-
const y = t ? `node-config-form-${t}` : "node-config-form", p = !
|
|
1889
|
+
const y = t ? `node-config-form-${t}` : "node-config-form", p = !d && !u && l.length > 0, v = p ? /* @__PURE__ */ m(Lt, { children: [
|
|
1890
1890
|
/* @__PURE__ */ f(yt, { type: "button", variant: "outlined", size: "small", onClick: s, children: o.cancel }),
|
|
1891
1891
|
/* @__PURE__ */ f(yt, { type: "submit", form: y, variant: "contained", size: "small", children: o.save })
|
|
1892
1892
|
] }) : null;
|
|
@@ -1900,11 +1900,11 @@ const Fi = (e) => {
|
|
|
1900
1900
|
width: 500,
|
|
1901
1901
|
footer: v,
|
|
1902
1902
|
children: /* @__PURE__ */ m(te, { sx: { p: 2 }, children: [
|
|
1903
|
-
|
|
1904
|
-
!
|
|
1905
|
-
!
|
|
1903
|
+
d && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.loadingConfiguration }),
|
|
1904
|
+
!d && u && /* @__PURE__ */ f("p", { style: { fontSize: 13, color: "#d32f2f" }, children: u }),
|
|
1905
|
+
!d && !u && l.length === 0 && /* @__PURE__ */ f("p", { className: "ff-text-muted", style: { fontSize: 13 }, children: o.noConfigurationNeeded }),
|
|
1906
1906
|
p && /* @__PURE__ */ f(
|
|
1907
|
-
|
|
1907
|
+
nn,
|
|
1908
1908
|
{
|
|
1909
1909
|
schema: { layout: "flat", fields: l },
|
|
1910
1910
|
initialValues: n ?? {},
|
|
@@ -1921,7 +1921,7 @@ const Fi = (e) => {
|
|
|
1921
1921
|
] })
|
|
1922
1922
|
}
|
|
1923
1923
|
);
|
|
1924
|
-
},
|
|
1924
|
+
}, Li = ({
|
|
1925
1925
|
isOpen: e,
|
|
1926
1926
|
onClose: t,
|
|
1927
1927
|
workflowId: r,
|
|
@@ -1941,7 +1941,7 @@ const Fi = (e) => {
|
|
|
1941
1941
|
isOpen: e,
|
|
1942
1942
|
onClose: t,
|
|
1943
1943
|
title: n ? `Preview: ${n}` : "Sub-Workflow Preview",
|
|
1944
|
-
icon: /* @__PURE__ */ f(
|
|
1944
|
+
icon: /* @__PURE__ */ f(Ur, { size: 18, color: "#00695c" }),
|
|
1945
1945
|
width: 700,
|
|
1946
1946
|
children: /* @__PURE__ */ m("div", { style: { height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: 24 }, children: [
|
|
1947
1947
|
i.status === "idle" && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", fontSize: 14 }, children: "Select a workflow to preview" }),
|
|
@@ -1951,18 +1951,18 @@ const Fi = (e) => {
|
|
|
1951
1951
|
/* @__PURE__ */ f("style", { children: "@keyframes spin { to { transform: rotate(360deg); } }" })
|
|
1952
1952
|
] }),
|
|
1953
1953
|
i.status === "error" && /* @__PURE__ */ m("div", { style: { textAlign: "center", color: "#c62828" }, children: [
|
|
1954
|
-
/* @__PURE__ */ f(
|
|
1954
|
+
/* @__PURE__ */ f(Kr, { size: 32, style: { marginBottom: 8 } }),
|
|
1955
1955
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: i.message })
|
|
1956
1956
|
] }),
|
|
1957
|
-
i.status === "loaded" && /* @__PURE__ */ f("div", { style: { width: "100%", flex: 1 }, children: /* @__PURE__ */ f(
|
|
1957
|
+
i.status === "loaded" && /* @__PURE__ */ f("div", { style: { width: "100%", flex: 1 }, children: /* @__PURE__ */ f(Ai, { state: i.state }) })
|
|
1958
1958
|
] })
|
|
1959
1959
|
}
|
|
1960
1960
|
);
|
|
1961
|
-
},
|
|
1961
|
+
}, Ai = ({ state: e }) => {
|
|
1962
1962
|
const [t, r] = j(null), [n, o] = j(null);
|
|
1963
1963
|
return ie(() => {
|
|
1964
1964
|
Promise.all([
|
|
1965
|
-
Promise.resolve().then(() =>
|
|
1965
|
+
Promise.resolve().then(() => Yi).then((i) => i.default),
|
|
1966
1966
|
import("./nodeRegistry.js").then((i) => i.nodeTypeRegistry),
|
|
1967
1967
|
import("./templateRegistry.js").then((i) => i.templateRegistry)
|
|
1968
1968
|
]).then(([i, s, l]) => {
|
|
@@ -1987,7 +1987,7 @@ const Fi = (e) => {
|
|
|
1987
1987
|
approvalNode: 90,
|
|
1988
1988
|
delayNode: 80,
|
|
1989
1989
|
notificationNode: 80
|
|
1990
|
-
},
|
|
1990
|
+
}, Pi = {
|
|
1991
1991
|
plusEdge: Rr,
|
|
1992
1992
|
labelPlusEdge: zr,
|
|
1993
1993
|
plainEdge: Fr,
|
|
@@ -2001,34 +2001,34 @@ function zt() {
|
|
|
2001
2001
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2002
2002
|
];
|
|
2003
2003
|
}
|
|
2004
|
-
function
|
|
2004
|
+
function Bi(e, t, r, n = "TB") {
|
|
2005
2005
|
const o = new jt.graphlib.Graph();
|
|
2006
2006
|
return o.setGraph({ rankdir: n, ranksep: 70, nodesep: 50 }), o.setDefaultEdgeLabel(() => ({})), e.forEach((i) => {
|
|
2007
2007
|
const s = r[i.id] ?? { width: be, height: Ke[i.type ?? ""] ?? 80 };
|
|
2008
2008
|
o.setNode(i.id, { width: s.width, height: s.height });
|
|
2009
2009
|
}), t.forEach((i) => o.setEdge(i.source, i.target)), jt.layout(o), e.map((i) => {
|
|
2010
|
-
var
|
|
2011
|
-
const s = o.node(i.id), l = ((
|
|
2012
|
-
return { ...i, position: { x: s.x - l / 2, y: s.y -
|
|
2010
|
+
var d, c;
|
|
2011
|
+
const s = o.node(i.id), l = ((d = r[i.id]) == null ? void 0 : d.width) ?? be, a = ((c = r[i.id]) == null ? void 0 : c.height) ?? Ke[i.type ?? ""] ?? 80;
|
|
2012
|
+
return { ...i, position: { x: s.x - l / 2, y: s.y - a / 2 } };
|
|
2013
2013
|
});
|
|
2014
2014
|
}
|
|
2015
2015
|
const oe = (e) => e === "filter" || e === "approval";
|
|
2016
|
-
function
|
|
2017
|
-
const s = $e, l = 30,
|
|
2016
|
+
function Wi(e, t, r, n) {
|
|
2017
|
+
const s = $e, l = 30, a = 30, d = {}, c = {}, u = /* @__PURE__ */ new Map();
|
|
2018
2018
|
for (const p of e) u.set(p.id, p);
|
|
2019
2019
|
for (const p of Object.values(t))
|
|
2020
2020
|
for (const v of Object.values(p))
|
|
2021
2021
|
for (const N of v) u.set(N.id, N);
|
|
2022
2022
|
const h = (p, v, N) => {
|
|
2023
2023
|
const O = n[p] ?? { width: be, height: 80 };
|
|
2024
|
-
return
|
|
2024
|
+
return d[p] = { x: v - O.width / 2, y: N }, N + O.height;
|
|
2025
2025
|
}, g = (p, v, N) => {
|
|
2026
2026
|
let O = N;
|
|
2027
2027
|
for (const M of p)
|
|
2028
2028
|
O = h(M.id, v, O) + s, oe(M.kind) && t[M.id] && (O = b(M.id, v, O));
|
|
2029
2029
|
return O;
|
|
2030
2030
|
}, b = (p, v, N) => {
|
|
2031
|
-
const O = v + 180, M = t[p], F = Object.keys(M), B = u.get(p), re = (B == null ? void 0 : B.branchLabels) ?? { pass: "Pass", fail: "Fail" }, he =
|
|
2031
|
+
const O = v + 180, M = t[p], F = Object.keys(M), B = u.get(p), re = (B == null ? void 0 : B.branchLabels) ?? { pass: "Pass", fail: "Fail" }, he = d[p], z = n[p] ?? { height: 80 }, me = he.y + z.height, we = [];
|
|
2032
2032
|
let U = N;
|
|
2033
2033
|
return F.forEach((le, X) => {
|
|
2034
2034
|
const R = M[le], J = U;
|
|
@@ -2036,7 +2036,7 @@ function Gi(e, t, r, n) {
|
|
|
2036
2036
|
y: J - me,
|
|
2037
2037
|
label: re[le] ?? le,
|
|
2038
2038
|
isPass: X === 0
|
|
2039
|
-
}), U = g(R, O, U +
|
|
2039
|
+
}), U = g(R, O, U + a), X < F.length - 1 && (U += l);
|
|
2040
2040
|
}), c[p] = {
|
|
2041
2041
|
branches: we,
|
|
2042
2042
|
height: U - me,
|
|
@@ -2047,7 +2047,7 @@ function Gi(e, t, r, n) {
|
|
|
2047
2047
|
for (const p of e)
|
|
2048
2048
|
y = h(p.id, 400, y) + s, oe(p.kind) && t[p.id] && (y = b(p.id, 400, y));
|
|
2049
2049
|
return {
|
|
2050
|
-
nodes: r.map((p) =>
|
|
2050
|
+
nodes: r.map((p) => d[p.id] ? { ...p, position: d[p.id] } : p),
|
|
2051
2051
|
railSpecs: c
|
|
2052
2052
|
};
|
|
2053
2053
|
}
|
|
@@ -2061,7 +2061,7 @@ function Rt(e) {
|
|
|
2061
2061
|
selectable: !1
|
|
2062
2062
|
};
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2064
|
+
function Gi(e, t, r, n, o) {
|
|
2065
2065
|
return {
|
|
2066
2066
|
id: `e-${e.id}-${t.id}`,
|
|
2067
2067
|
source: e.id,
|
|
@@ -2075,13 +2075,13 @@ function $i(e, t, r, n, o) {
|
|
|
2075
2075
|
}
|
|
2076
2076
|
};
|
|
2077
2077
|
}
|
|
2078
|
-
function
|
|
2079
|
-
const l = o.edgeColor ?? "#b0bec5",
|
|
2078
|
+
function $i(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
2079
|
+
const l = o.edgeColor ?? "#b0bec5", a = [], d = [], c = (b, y) => {
|
|
2080
2080
|
const p = t[b];
|
|
2081
2081
|
if (!p) return;
|
|
2082
2082
|
const N = y ?? { pass: "Pass", fail: "Fail" }, O = Object.keys(p), M = (F, B, re, he) => {
|
|
2083
2083
|
if (F.length !== 0) {
|
|
2084
|
-
F.forEach((z) =>
|
|
2084
|
+
F.forEach((z) => a.push(Rt(z))), d.push({
|
|
2085
2085
|
id: `e-${b}-${B}-start`,
|
|
2086
2086
|
source: b,
|
|
2087
2087
|
target: F[0].id,
|
|
@@ -2090,7 +2090,7 @@ function Yi(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
|
2090
2090
|
data: { branch: B, filterId: b, label: re, isFirst: he === 0, onAddStepClick: r, verticalRouting: s === "vertical" }
|
|
2091
2091
|
});
|
|
2092
2092
|
for (let z = 1; z < F.length; z++)
|
|
2093
|
-
oe(F[z - 1].kind) ||
|
|
2093
|
+
oe(F[z - 1].kind) || d.push(Gi(F[z - 1], F[z], l, r, { filterId: b, branch: B }));
|
|
2094
2094
|
for (const z of F)
|
|
2095
2095
|
oe(z.kind) && t[z.id] && c(z.id, z.branchLabels);
|
|
2096
2096
|
}
|
|
@@ -2101,10 +2101,10 @@ function Yi(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
|
2101
2101
|
};
|
|
2102
2102
|
for (let b = 0; b < e.length; b++) {
|
|
2103
2103
|
const y = e[b];
|
|
2104
|
-
if (
|
|
2104
|
+
if (a.push(Rt(y)), b > 0) {
|
|
2105
2105
|
const p = e[b - 1], v = p.kind === "start" || p.kind === "addTrigger";
|
|
2106
2106
|
if (p.kind === "filter" || p.kind === "approval") continue;
|
|
2107
|
-
|
|
2107
|
+
d.push({
|
|
2108
2108
|
id: `e-${p.id}-${y.id}`,
|
|
2109
2109
|
source: p.id,
|
|
2110
2110
|
target: y.id,
|
|
@@ -2119,7 +2119,7 @@ function Yi(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
|
2119
2119
|
(y.kind === "filter" || y.kind === "approval") && t[y.id] && c(y.id, y.branchLabels);
|
|
2120
2120
|
}
|
|
2121
2121
|
const u = {};
|
|
2122
|
-
if (
|
|
2122
|
+
if (a.forEach((b) => {
|
|
2123
2123
|
u[b.id] = {
|
|
2124
2124
|
width: be,
|
|
2125
2125
|
height: n[b.id] ?? Ke[b.type ?? ""] ?? 80
|
|
@@ -2127,25 +2127,25 @@ function Yi(e, t, r, n, o = {}, i = "TB", s = "horizontal") {
|
|
|
2127
2127
|
}), !(Object.keys(t).length > 0)) {
|
|
2128
2128
|
if (i === "LR") {
|
|
2129
2129
|
let N = Ye;
|
|
2130
|
-
return { nodes:
|
|
2130
|
+
return { nodes: a.map((M) => {
|
|
2131
2131
|
const F = u[M.id].width, B = u[M.id].height, re = { ...M, position: { x: N, y: 300 - B / 2 } };
|
|
2132
2132
|
return N += F + $e, re;
|
|
2133
|
-
}), edges:
|
|
2133
|
+
}), edges: d };
|
|
2134
2134
|
}
|
|
2135
2135
|
const b = 400;
|
|
2136
2136
|
let y = Ye;
|
|
2137
|
-
return { nodes:
|
|
2137
|
+
return { nodes: a.map((v) => {
|
|
2138
2138
|
const N = u[v.id].height, O = { ...v, position: { x: b - be / 2, y } };
|
|
2139
2139
|
return y += N + $e, O;
|
|
2140
|
-
}), edges:
|
|
2140
|
+
}), edges: d };
|
|
2141
2141
|
}
|
|
2142
2142
|
if (s === "vertical") {
|
|
2143
|
-
const { nodes: b, railSpecs: y } =
|
|
2143
|
+
const { nodes: b, railSpecs: y } = Wi(e, t, a, u);
|
|
2144
2144
|
return { nodes: b.map(
|
|
2145
2145
|
(v) => y[v.id] ? { ...v, data: { ...v.data, _branchRail: y[v.id] } } : v
|
|
2146
|
-
), edges:
|
|
2146
|
+
), edges: d };
|
|
2147
2147
|
}
|
|
2148
|
-
return { nodes:
|
|
2148
|
+
return { nodes: Bi(a, d, u, i), edges: d };
|
|
2149
2149
|
}
|
|
2150
2150
|
const Dt = ({
|
|
2151
2151
|
nodeRegistry: e,
|
|
@@ -2156,8 +2156,8 @@ const Dt = ({
|
|
|
2156
2156
|
onSave: i,
|
|
2157
2157
|
readOnly: s = !1,
|
|
2158
2158
|
theme: l = {},
|
|
2159
|
-
messages:
|
|
2160
|
-
canvasOptions:
|
|
2159
|
+
messages: a,
|
|
2160
|
+
canvasOptions: d = {},
|
|
2161
2161
|
renderTriggerSelector: c,
|
|
2162
2162
|
renderNodePicker: u,
|
|
2163
2163
|
renderNodeConfig: h,
|
|
@@ -2180,12 +2180,12 @@ const Dt = ({
|
|
|
2180
2180
|
snapGrid: we = [15, 15],
|
|
2181
2181
|
branchLayout: U = "horizontal",
|
|
2182
2182
|
nodeBody: le = "full"
|
|
2183
|
-
} =
|
|
2183
|
+
} = d, X = W(() => on(a), [a]), [R, J] = j(() => (r == null ? void 0 : r.slots) ?? zt()), [V, Z] = j(() => (r == null ? void 0 : r.branches) ?? {}), [de, $] = j(null), [Ie, Ze] = j(null), [ae, ve] = j(null), [Oe, Qe] = j(null), [Ee, et] = j(null), [Q, tt] = j(() => {
|
|
2184
2184
|
const w = r == null ? void 0 : r.slots.find((k) => k.kind === "triggerFixed"), E = w != null && w.id.startsWith("trigger-") ? w.id.slice(8) : void 0;
|
|
2185
2185
|
return E ? t.lookup(E) ?? null : null;
|
|
2186
2186
|
}), [rt, br] = j({}), yr = Y((w) => {
|
|
2187
2187
|
br(w);
|
|
2188
|
-
}, []), mr = W(() => ({ ...Or, ...n }), [n]), wr = W(() => ({ ...
|
|
2188
|
+
}, []), mr = W(() => ({ ...Or, ...n }), [n]), wr = W(() => ({ ...Pi, ...o }), [o]), vr = W(() => {
|
|
2189
2189
|
const w = R.filter((k) => k.kind === "userTask").length, E = Object.values(V).flatMap((k) => Object.values(k).flat()).filter((k) => k.kind === "userTask").length;
|
|
2190
2190
|
return w + E;
|
|
2191
2191
|
}, [R, V]), nt = b ?? (Q == null ? void 0 : Q.maxTasks), ot = nt !== void 0 && vr >= nt, ne = Y((w) => {
|
|
@@ -2251,11 +2251,11 @@ const Dt = ({
|
|
|
2251
2251
|
},
|
|
2252
2252
|
{ id: "end", kind: "end", reactFlowType: "endNode" }
|
|
2253
2253
|
]);
|
|
2254
|
-
}, []),
|
|
2254
|
+
}, []), dt = Y(() => {
|
|
2255
2255
|
const w = e.list();
|
|
2256
2256
|
return (Q != null && Q.availableTasks ? w.filter((k) => Q.availableTasks.includes(k.type)) : w).filter((k) => k.maxPerWorkflow === void 0 ? !0 : R.filter((x) => x.descriptorType === k.type).length + Object.values(V).flatMap((x) => Object.values(x).flat()).filter((x) => x.descriptorType === k.type).length < k.maxPerWorkflow);
|
|
2257
|
-
}, [e, Q, R, V]),
|
|
2258
|
-
if (!
|
|
2257
|
+
}, [e, Q, R, V]), at = Y((w) => {
|
|
2258
|
+
if (!ae) return;
|
|
2259
2259
|
const E = `${w.type}-${Date.now()}`, k = w.reactFlowType === "filterNode" || w.reactFlowType === "approvalNode" || w.reactFlowType === "conditionBranchNode", C = w.branchLabels ?? { pass: "Pass", fail: "Fail" }, x = {
|
|
2260
2260
|
id: E,
|
|
2261
2261
|
kind: k ? w.reactFlowType === "approvalNode" ? "approval" : "filter" : "userTask",
|
|
@@ -2271,7 +2271,7 @@ const Dt = ({
|
|
|
2271
2271
|
Z((S) => {
|
|
2272
2272
|
const I = [...S[_][T]];
|
|
2273
2273
|
if (k) {
|
|
2274
|
-
const ee = I.filter((ce) => ce.kind !== "end"), gt = ee.findIndex((ce) => ce.id ===
|
|
2274
|
+
const ee = I.filter((ce) => ce.kind !== "end"), gt = ee.findIndex((ce) => ce.id === ae), xr = gt === -1 ? ee.length : gt + 1;
|
|
2275
2275
|
return ee.splice(xr, 0, x), {
|
|
2276
2276
|
...S,
|
|
2277
2277
|
[_]: { ...S[_], [T]: ee },
|
|
@@ -2280,12 +2280,12 @@ const Dt = ({
|
|
|
2280
2280
|
)
|
|
2281
2281
|
};
|
|
2282
2282
|
}
|
|
2283
|
-
const D = I.findIndex((ee) => ee.id ===
|
|
2283
|
+
const D = I.findIndex((ee) => ee.id === ae), A = I.findIndex((ee) => ee.kind === "end"), L = D === -1 ? A === -1 ? I.length : A : D + 1;
|
|
2284
2284
|
return I.splice(L, 0, x), { ...S, [_]: { ...S[_], [T]: I } };
|
|
2285
2285
|
});
|
|
2286
2286
|
} else
|
|
2287
2287
|
k ? (J((_) => {
|
|
2288
|
-
const T = _.findIndex((I) => I.id ===
|
|
2288
|
+
const T = _.findIndex((I) => I.id === ae);
|
|
2289
2289
|
return [..._.filter((I) => I.kind !== "end").slice(0, T + 1), x];
|
|
2290
2290
|
}), Z((_) => ({
|
|
2291
2291
|
..._,
|
|
@@ -2293,11 +2293,11 @@ const Dt = ({
|
|
|
2293
2293
|
Object.keys(C).map((T) => [T, [{ id: `end-${E}-${T}`, kind: "end", reactFlowType: "endNode" }]])
|
|
2294
2294
|
)
|
|
2295
2295
|
}))) : J((_) => {
|
|
2296
|
-
const T = _.findIndex((S) => S.id ===
|
|
2296
|
+
const T = _.findIndex((S) => S.id === ae);
|
|
2297
2297
|
return T === -1 ? _ : [..._.slice(0, T + 1), x, ..._.slice(T + 1)];
|
|
2298
2298
|
});
|
|
2299
2299
|
ve(null), Qe(null), Ze(E), $("nodeConfig");
|
|
2300
|
-
}, [
|
|
2300
|
+
}, [ae, Oe]), ct = Y((w, E) => {
|
|
2301
2301
|
const k = (x) => {
|
|
2302
2302
|
const _ = ne(w);
|
|
2303
2303
|
if ((_ == null ? void 0 : _.descriptorType) !== "conditionBranch") return x;
|
|
@@ -2339,7 +2339,7 @@ const Dt = ({
|
|
|
2339
2339
|
return T;
|
|
2340
2340
|
});
|
|
2341
2341
|
}, [R, V, ne, i]), H = W(() => ne(Ie ?? ""), [ne, Ie]), ut = W(() => H != null && H.descriptorType ? e.forType(H.descriptorType) ?? null : null, [H, e]), { nodes: ft, edges: Er } = W(
|
|
2342
|
-
() =>
|
|
2342
|
+
() => $i(R, V, s ? null : st, rt, l, y, U),
|
|
2343
2343
|
[R, V, s, st, rt, l, y, U]
|
|
2344
2344
|
), ht = W(() => {
|
|
2345
2345
|
const w = p ? new Map(p.steps.map((E) => [E.nodeId, E])) : null;
|
|
@@ -2409,19 +2409,19 @@ const Dt = ({
|
|
|
2409
2409
|
),
|
|
2410
2410
|
M && /* @__PURE__ */ f(Sr, { showInteractive: !1 }),
|
|
2411
2411
|
F && /* @__PURE__ */ f(Ir, { zoomable: !0, pannable: !0 }),
|
|
2412
|
-
/* @__PURE__ */ f(
|
|
2412
|
+
/* @__PURE__ */ f(Fi, { onHeightsReady: yr, nodeCount: ht.length })
|
|
2413
2413
|
]
|
|
2414
2414
|
}
|
|
2415
2415
|
),
|
|
2416
|
-
c ?
|
|
2417
|
-
u ?
|
|
2416
|
+
c ? de === "triggerSelect" && c(t.list(), lt, () => $(null)) : /* @__PURE__ */ f(zi, { open: de === "triggerSelect", templates: t.list(), messages: X, onSelect: lt, onClose: () => $(null) }),
|
|
2417
|
+
u ? de === "nodePicker" && u(dt(), at, () => {
|
|
2418
2418
|
$(null), ve(null);
|
|
2419
|
-
}) : /* @__PURE__ */ f(
|
|
2419
|
+
}) : /* @__PURE__ */ f(Ri, { open: de === "nodePicker", availableDescriptors: dt(), messages: X, onSelect: at, onClose: () => {
|
|
2420
2420
|
$(null), ve(null);
|
|
2421
2421
|
} }),
|
|
2422
|
-
h ?
|
|
2422
|
+
h ? de === "nodeConfig" && h(ut ?? void 0, H, ct, () => $(null)) : /* @__PURE__ */ f(Di, { open: de === "nodeConfig", nodeId: Ie, descriptor: ut, initialValues: H == null ? void 0 : H.formData, messages: X, onSave: ct, onClose: () => $(null) }),
|
|
2423
2423
|
v && Ee && /* @__PURE__ */ f(
|
|
2424
|
-
|
|
2424
|
+
Li,
|
|
2425
2425
|
{
|
|
2426
2426
|
isOpen: !!Ee,
|
|
2427
2427
|
onClose: () => et(null),
|
|
@@ -2433,14 +2433,14 @@ const Dt = ({
|
|
|
2433
2433
|
]
|
|
2434
2434
|
}
|
|
2435
2435
|
) });
|
|
2436
|
-
},
|
|
2436
|
+
}, Yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2437
2437
|
__proto__: null,
|
|
2438
2438
|
WorkflowCanvas: Dt,
|
|
2439
2439
|
default: Dt
|
|
2440
2440
|
}, Symbol.toStringTag, { value: "Module" })), We = "All";
|
|
2441
|
-
function
|
|
2441
|
+
function Ki({ template: e, onSelect: t }) {
|
|
2442
2442
|
var o, i;
|
|
2443
|
-
const r = e.triggerCategory ?
|
|
2443
|
+
const r = e.triggerCategory ? sn[e.triggerCategory] : null, n = ((o = e.skeletonState) == null ? void 0 : o.slots.filter((s) => s.kind === "userTask").length) ?? 0;
|
|
2444
2444
|
return /* @__PURE__ */ m(
|
|
2445
2445
|
"div",
|
|
2446
2446
|
{
|
|
@@ -2493,28 +2493,28 @@ function Ui({ template: e, onSelect: t }) {
|
|
|
2493
2493
|
}
|
|
2494
2494
|
);
|
|
2495
2495
|
}
|
|
2496
|
-
const
|
|
2496
|
+
const ls = ({
|
|
2497
2497
|
templates: e,
|
|
2498
2498
|
onSelectTemplate: t,
|
|
2499
2499
|
onStartFromScratch: r
|
|
2500
2500
|
}) => {
|
|
2501
2501
|
const [n, o] = j(""), [i, s] = j(We), l = W(() => {
|
|
2502
|
-
const
|
|
2502
|
+
const d = /* @__PURE__ */ new Set();
|
|
2503
2503
|
return e.forEach((c) => {
|
|
2504
|
-
c.category &&
|
|
2505
|
-
}), [We, ...Array.from(
|
|
2506
|
-
}, [e]),
|
|
2507
|
-
let
|
|
2508
|
-
if (i !== We && (
|
|
2504
|
+
c.category && d.add(c.category);
|
|
2505
|
+
}), [We, ...Array.from(d)];
|
|
2506
|
+
}, [e]), a = W(() => {
|
|
2507
|
+
let d = e;
|
|
2508
|
+
if (i !== We && (d = d.filter((c) => c.category === i)), n.trim()) {
|
|
2509
2509
|
const c = n.toLowerCase();
|
|
2510
|
-
|
|
2510
|
+
d = d.filter(
|
|
2511
2511
|
(u) => {
|
|
2512
2512
|
var h, g;
|
|
2513
2513
|
return u.label.toLowerCase().includes(c) || ((h = u.description) == null ? void 0 : h.toLowerCase().includes(c)) || ((g = u.tags) == null ? void 0 : g.some((b) => b.toLowerCase().includes(c)));
|
|
2514
2514
|
}
|
|
2515
2515
|
);
|
|
2516
2516
|
}
|
|
2517
|
-
return [...
|
|
2517
|
+
return [...d].sort((c, u) => (u.popularity ?? 0) - (c.popularity ?? 0));
|
|
2518
2518
|
}, [e, i, n]);
|
|
2519
2519
|
return /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", height: "100%", fontFamily: "inherit" }, children: [
|
|
2520
2520
|
/* @__PURE__ */ m("div", { style: { padding: "24px 24px 0", borderBottom: "1px solid #f0f0f0", paddingBottom: 16 }, children: [
|
|
@@ -2529,56 +2529,56 @@ const as = ({
|
|
|
2529
2529
|
onClick: r,
|
|
2530
2530
|
style: { display: "flex", alignItems: "center", gap: 6, padding: "8px 16px", border: "1.5px solid #1976d2", borderRadius: 6, background: "#fff", color: "#1976d2", fontSize: 13, fontWeight: 600, cursor: "pointer" },
|
|
2531
2531
|
children: [
|
|
2532
|
-
/* @__PURE__ */ f(
|
|
2532
|
+
/* @__PURE__ */ f(Vr, { size: 16 }),
|
|
2533
2533
|
"Start from Scratch"
|
|
2534
2534
|
]
|
|
2535
2535
|
}
|
|
2536
2536
|
)
|
|
2537
2537
|
] }),
|
|
2538
2538
|
/* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", gap: 8, background: "#f5f5f5", borderRadius: 8, padding: "8px 12px", marginBottom: 12 }, children: [
|
|
2539
|
-
/* @__PURE__ */ f(
|
|
2539
|
+
/* @__PURE__ */ f(Hr, { size: 18, color: "#9e9e9e" }),
|
|
2540
2540
|
/* @__PURE__ */ f(
|
|
2541
2541
|
"input",
|
|
2542
2542
|
{
|
|
2543
2543
|
value: n,
|
|
2544
|
-
onChange: (
|
|
2544
|
+
onChange: (d) => o(d.target.value),
|
|
2545
2545
|
placeholder: "Search templates...",
|
|
2546
2546
|
style: { border: "none", background: "transparent", outline: "none", fontSize: 14, color: "#212121", flex: 1 }
|
|
2547
2547
|
}
|
|
2548
2548
|
)
|
|
2549
2549
|
] }),
|
|
2550
|
-
l.length > 1 && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: l.map((
|
|
2550
|
+
l.length > 1 && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: l.map((d) => /* @__PURE__ */ f(
|
|
2551
2551
|
"button",
|
|
2552
2552
|
{
|
|
2553
|
-
onClick: () => s(
|
|
2553
|
+
onClick: () => s(d),
|
|
2554
2554
|
style: {
|
|
2555
2555
|
padding: "4px 12px",
|
|
2556
2556
|
borderRadius: 20,
|
|
2557
2557
|
border: "1.5px solid",
|
|
2558
|
-
borderColor: i ===
|
|
2559
|
-
background: i ===
|
|
2560
|
-
color: i ===
|
|
2558
|
+
borderColor: i === d ? "#1976d2" : "#e0e0e0",
|
|
2559
|
+
background: i === d ? "#e3f2fd" : "#fff",
|
|
2560
|
+
color: i === d ? "#1565c0" : "#616161",
|
|
2561
2561
|
fontSize: 12,
|
|
2562
|
-
fontWeight: i ===
|
|
2562
|
+
fontWeight: i === d ? 600 : 400,
|
|
2563
2563
|
cursor: "pointer"
|
|
2564
2564
|
},
|
|
2565
|
-
children:
|
|
2565
|
+
children: d
|
|
2566
2566
|
},
|
|
2567
|
-
|
|
2567
|
+
d
|
|
2568
2568
|
)) })
|
|
2569
2569
|
] }),
|
|
2570
|
-
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children:
|
|
2571
|
-
/* @__PURE__ */ f(
|
|
2570
|
+
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto", padding: 24 }, children: a.length === 0 ? /* @__PURE__ */ m("div", { style: { textAlign: "center", padding: "40px 0", color: "#9e9e9e" }, children: [
|
|
2571
|
+
/* @__PURE__ */ f(qr, { size: 36, style: { marginBottom: 8 } }),
|
|
2572
2572
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No templates found" })
|
|
2573
|
-
] }) : /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children:
|
|
2573
|
+
] }) : /* @__PURE__ */ f("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: 16 }, children: a.map((d) => /* @__PURE__ */ f(Ki, { template: d, onSelect: () => t(d) }, d.triggerKey)) }) })
|
|
2574
2574
|
] });
|
|
2575
2575
|
}, ke = {
|
|
2576
2576
|
running: { label: "Running", color: q.running, icon: P.createElement(Gt, { size: 14 }) },
|
|
2577
2577
|
success: { label: "Success", color: q.success, icon: P.createElement(Wt, { size: 14 }) },
|
|
2578
2578
|
failed: { label: "Failed", color: q.failed, icon: P.createElement(Bt, { size: 14 }) },
|
|
2579
2579
|
cancelled: { label: "Cancelled", color: q.cancelled, icon: P.createElement(Pt, { size: 14 }) }
|
|
2580
|
-
},
|
|
2581
|
-
pending: { color: q.pending, icon: P.createElement(
|
|
2580
|
+
}, Ui = {
|
|
2581
|
+
pending: { color: q.pending, icon: P.createElement(Xr, { size: 14 }) },
|
|
2582
2582
|
running: { color: q.running, icon: P.createElement(Gt, { size: 14 }) },
|
|
2583
2583
|
success: { color: q.success, icon: P.createElement(Wt, { size: 14 }) },
|
|
2584
2584
|
failed: { color: q.failed, icon: P.createElement(Bt, { size: 14 }) },
|
|
@@ -2599,8 +2599,8 @@ function pr(e, t) {
|
|
|
2599
2599
|
return "—";
|
|
2600
2600
|
}
|
|
2601
2601
|
}
|
|
2602
|
-
function
|
|
2603
|
-
const [t, r] = j(!1), n =
|
|
2602
|
+
function Vi({ step: e }) {
|
|
2603
|
+
const [t, r] = j(!1), n = Ui[e.status], o = !!(e.inputs || e.outputs || e.error);
|
|
2604
2604
|
return /* @__PURE__ */ m("div", { style: { borderBottom: "1px solid #f5f5f5" }, children: [
|
|
2605
2605
|
/* @__PURE__ */ m(
|
|
2606
2606
|
"div",
|
|
@@ -2619,7 +2619,7 @@ function Hi({ step: e }) {
|
|
|
2619
2619
|
/* @__PURE__ */ f("span", { style: { flex: 1, fontSize: 13, color: "#212121" }, children: e.label || e.nodeId }),
|
|
2620
2620
|
e.branchTaken && /* @__PURE__ */ f("span", { style: { fontSize: 10, padding: "1px 6px", borderRadius: 10, background: "#e3f2fd", color: "#1565c0", fontWeight: 600 }, children: e.branchTaken }),
|
|
2621
2621
|
/* @__PURE__ */ f("span", { style: { fontSize: 11, color: "#9e9e9e", flexShrink: 0 }, children: e.startedAt ? pr(e.startedAt, e.completedAt) : "—" }),
|
|
2622
|
-
o && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ? P.createElement(
|
|
2622
|
+
o && /* @__PURE__ */ f("span", { style: { color: "#9e9e9e", flexShrink: 0 }, children: t ? P.createElement(Zr, { size: 16 }) : P.createElement(Qr, { size: 16 }) })
|
|
2623
2623
|
]
|
|
2624
2624
|
}
|
|
2625
2625
|
),
|
|
@@ -2636,7 +2636,7 @@ function Hi({ step: e }) {
|
|
|
2636
2636
|
] })
|
|
2637
2637
|
] });
|
|
2638
2638
|
}
|
|
2639
|
-
function
|
|
2639
|
+
function Hi({ record: e, selected: t, onSelect: r }) {
|
|
2640
2640
|
const n = ke[e.status];
|
|
2641
2641
|
return /* @__PURE__ */ m(
|
|
2642
2642
|
"div",
|
|
@@ -2677,7 +2677,7 @@ function qi({ record: e, selected: t, onSelect: r }) {
|
|
|
2677
2677
|
}
|
|
2678
2678
|
const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
2679
2679
|
var s;
|
|
2680
|
-
const [r, n] = j(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === r) ?? null, i = [...e].sort((l,
|
|
2680
|
+
const [r, n] = j(((s = e[0]) == null ? void 0 : s.id) ?? null), o = e.find((l) => l.id === r) ?? null, i = [...e].sort((l, a) => new Date(a.triggeredAt).getTime() - new Date(l.triggeredAt).getTime());
|
|
2681
2681
|
return e.length === 0 ? /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: 300, color: "#9e9e9e", gap: 8 }, children: [
|
|
2682
2682
|
/* @__PURE__ */ f(mt, { size: 36 }),
|
|
2683
2683
|
/* @__PURE__ */ f("p", { style: { margin: 0, fontSize: 14 }, children: "No executions yet" }),
|
|
@@ -2689,7 +2689,7 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2689
2689
|
e.length,
|
|
2690
2690
|
")"
|
|
2691
2691
|
] }),
|
|
2692
|
-
i.map((l) => /* @__PURE__ */ f(
|
|
2692
|
+
i.map((l) => /* @__PURE__ */ f(Hi, { record: l, selected: l.id === r, onSelect: () => n(l.id) }, l.id))
|
|
2693
2693
|
] }),
|
|
2694
2694
|
/* @__PURE__ */ f("div", { style: { flex: 1, overflowY: "auto" }, children: o ? /* @__PURE__ */ m("div", { children: [
|
|
2695
2695
|
/* @__PURE__ */ m("div", { style: { padding: "16px 20px", borderBottom: "1px solid #f0f0f0", display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }, children: [
|
|
@@ -2706,7 +2706,7 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2706
2706
|
o.completedAt && ` → ${Ue(o.completedAt)} (${pr(o.triggeredAt, o.completedAt)})`
|
|
2707
2707
|
] }),
|
|
2708
2708
|
o.triggeredBy && /* @__PURE__ */ m("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
2709
|
-
/* @__PURE__ */ f(
|
|
2709
|
+
/* @__PURE__ */ f(Jr, { size: 13 }),
|
|
2710
2710
|
" ",
|
|
2711
2711
|
o.triggeredBy
|
|
2712
2712
|
] })
|
|
@@ -2728,7 +2728,7 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2728
2728
|
o.steps.length,
|
|
2729
2729
|
")"
|
|
2730
2730
|
] }),
|
|
2731
|
-
o.steps.map((l,
|
|
2731
|
+
o.steps.map((l, a) => /* @__PURE__ */ f(Vi, { step: l }, `${l.nodeId}-${a}`))
|
|
2732
2732
|
] }),
|
|
2733
2733
|
o.inputs && Object.keys(o.inputs).length > 0 && /* @__PURE__ */ f("div", { style: { padding: "10px 16px" }, children: /* @__PURE__ */ m("details", { children: [
|
|
2734
2734
|
/* @__PURE__ */ f("summary", { style: { cursor: "pointer", fontSize: 12, fontWeight: 600, color: "#757575", marginBottom: 6 }, children: "TRIGGER INPUTS" }),
|
|
@@ -2736,7 +2736,7 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2736
2736
|
] }) })
|
|
2737
2737
|
] }) : /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%", color: "#9e9e9e", fontSize: 14 }, children: "Select a run to see details" }) })
|
|
2738
2738
|
] });
|
|
2739
|
-
},
|
|
2739
|
+
}, as = {
|
|
2740
2740
|
slots: [
|
|
2741
2741
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2742
2742
|
{ id: "trigger-END_USER_CREATION", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "New User Registration", nodeData: { label: "New User Registration" } },
|
|
@@ -2750,7 +2750,7 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2750
2750
|
fail: [{ id: "notification-fail-1", kind: "userTask", reactFlowType: "notificationNode", descriptorType: "notification", deletable: !0, label: "Rejection Notice", nodeData: { title: "Rejection Notice" } }]
|
|
2751
2751
|
}
|
|
2752
2752
|
}
|
|
2753
|
-
},
|
|
2753
|
+
}, cs = {
|
|
2754
2754
|
slots: [
|
|
2755
2755
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2756
2756
|
{ id: "trigger-ACCESS_REQUEST", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "Access Request Submitted", nodeData: { label: "Access Request Submitted" } },
|
|
@@ -2768,7 +2768,7 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2768
2768
|
]
|
|
2769
2769
|
}
|
|
2770
2770
|
}
|
|
2771
|
-
},
|
|
2771
|
+
}, us = {
|
|
2772
2772
|
slots: [
|
|
2773
2773
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2774
2774
|
{ id: "trigger-USER_DEACTIVATION", kind: "triggerFixed", reactFlowType: "triggerNode", deletable: !0, label: "User Deactivation", nodeData: { label: "User Deactivation" } },
|
|
@@ -2777,7 +2777,7 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2777
2777
|
{ id: "end", kind: "end", reactFlowType: "endNode", deletable: !1 }
|
|
2778
2778
|
],
|
|
2779
2779
|
branches: {}
|
|
2780
|
-
},
|
|
2780
|
+
}, fs = {
|
|
2781
2781
|
slots: [
|
|
2782
2782
|
{ id: "start", kind: "start", reactFlowType: "startNode", deletable: !1 },
|
|
2783
2783
|
{ id: "trigger-WEBHOOK_TRIGGER", kind: "triggerFixed", reactFlowType: "webhookTriggerNode", deletable: !0, label: "Incoming Webhook", nodeData: { label: "Incoming Webhook" } },
|
|
@@ -2789,11 +2789,11 @@ const ds = ({ records: e, onViewOnCanvas: t }) => {
|
|
|
2789
2789
|
};
|
|
2790
2790
|
export {
|
|
2791
2791
|
Dt as F,
|
|
2792
|
-
|
|
2792
|
+
Li as S,
|
|
2793
2793
|
ds as W,
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2794
|
+
ls as a,
|
|
2795
|
+
cs as b,
|
|
2796
|
+
us as o,
|
|
2797
|
+
as as u,
|
|
2798
|
+
fs as w
|
|
2799
2799
|
};
|